liyongli il y a 3 ans
Parent
commit
d13fb9d01e
2 fichiers modifiés avec 13 ajouts et 1 suppressions
  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,
   ImagePreview,
 } from "vant";
 } from "vant";
 import "vant/lib/form/style/index";
 import "vant/lib/form/style/index";
+import "vant/lib/tag/style/index";
 import "vant/lib/field/style/index";
 import "vant/lib/field/style/index";
 import "vant/lib/button/style/index";
 import "vant/lib/button/style/index";
 import "vant/lib/popup/style/index";
 import "vant/lib/popup/style/index";

+ 12 - 1
src/views/Appointment.vue

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