liyongli 3 年之前
父節點
當前提交
d13fb9d01e
共有 2 個文件被更改,包括 13 次插入1 次删除
  1. 1 0
      src/views/Apply.vue
  2. 12 1
      src/views/Appointment.vue

+ 1 - 0
src/views/Apply.vue

@@ -98,6 +98,7 @@ import {
   ImagePreview,
 } from "vant";
 import "vant/lib/form/style/index";
+import "vant/lib/tag/style/index";
 import "vant/lib/field/style/index";
 import "vant/lib/button/style/index";
 import "vant/lib/popup/style/index";

+ 12 - 1
src/views/Appointment.vue

@@ -11,13 +11,16 @@
         <template #default>
           <div style="text-align: right">
             <van-button
-              v-if="item.self"
+              v-if="item.status !== 2 && item.self"
               @click="() => removequeue(item.id)"
               type="danger"
               size="mini"
             >
               取消预约
             </van-button>
+            <van-tag type="primary" v-if="item.status === 2"
+              >已超时 请重新预约</van-tag
+            >
           </div>
         </template>
       </van-cell>
@@ -39,6 +42,7 @@
         color="#e42417"
         round
         block
+        :disabled="isDis"
         type="info"
         @click="toAppointment"
         native-type="submit"
@@ -57,10 +61,12 @@ import {
   SidebarItem as vanSidebarItem,
   Cell as vanCell,
   Button as vanButton,
+  Tag as vanTag,
   Dialog,
   Toast,
 } from "vant";
 import "vant/lib/sidebar/style/index";
+import "vant/lib/tag/style/index";
 import "vant/lib/button/style/index";
 import "vant/lib/cell/style/index";
 import "vant/lib/icon/style/index";
@@ -84,6 +90,7 @@ export default {
       group: {},
       phone: "",
       name: "",
+      isDis: false,
       activeKey: 0,
       dataList: [],
       mainList: [],
@@ -101,6 +108,7 @@ export default {
       const li = res || [];
       let l = [];
       li.sort((a, b) => {
+        if (a.self || b.self) this.isDis = true;
         return new Date(a.orderTime) - new Date(b.orderTime);
       });
       for (let i = 0; i < li.length; i++) {
@@ -185,11 +193,13 @@ export default {
             const li = res || [];
             let l = [],
               group = {};
+            that.isDis = false;
             li.sort((a, b) => {
               return new Date(a.orderTime) - new Date(b.orderTime);
             });
             for (let i = 0; i < li.length; i++) {
               const v = li[i];
+              if (v.status !== 2 &&  v.self ) that.isDis = true;
               v.orderTime = v.orderTime.replace(/:00$/, "");
               let key = v.orderTime.split(" ")[0];
               if (group[key]) {
@@ -215,6 +225,7 @@ export default {
     vanCell,
     vanSidebarItem,
     vanButton,
+    vanTag,
   },
 };
 </script>