liyongli 3 years ago
parent
commit
96a582abfd
2 changed files with 13 additions and 12 deletions
  1. 5 5
      src/views/Applyreal.vue
  2. 8 7
      src/views/Appointment.vue

+ 5 - 5
src/views/Applyreal.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="apply">
-    <van-nav-bar title="预定" left-text="返回列表" left-arrow @click-left="$router.go(-1)" />
+    <van-nav-bar title="预定"  />
     <van-form @submit="onSubmit">
       <van-field
         v-model="username"
@@ -50,9 +50,11 @@ import {
   Button as vanButton,
   RadioGroup as vanRadioGroup,
   Radio as vanRadio,
+  Toast
 } from "vant";
 import "vant/lib/nav-bar/style/index";
 import "vant/lib/form/style/index";
+import "vant/lib/toast/style/index";
 import "vant/lib/field/style/index";
 import "vant/lib/button/style/index";
 
@@ -78,8 +80,7 @@ export default {
     });
    
   },
-  computed: {
-  },
+  computed: {},
   methods: {
     filter(type, options) {
       if (type === "minute") {
@@ -88,13 +89,12 @@ export default {
       return options;
     },
     onSubmit() {
-
       applyreal({
         userName: this.username,
         userPhone: this.userphone,
         goodsId: this.radio,
       }).then(() => {
-        this.$router.push('/');
+          Toast("预约成功")
       });
     },
   },

+ 8 - 7
src/views/Appointment.vue

@@ -18,9 +18,9 @@
             >
               取消预约
             </van-button>
-            <van-tag type="primary" v-if="item.status === 2"
-              >已超时 请重新预约</van-tag
-            >
+            <van-tag type="primary" v-if="item.status === 2">
+              已超时 请重新预约
+            </van-tag>
           </div>
         </template>
       </van-cell>
@@ -74,10 +74,7 @@ import "vant/lib/toast/style/index";
 import "vant/lib/dialog/style/index";
 import "vant/lib/sidebar-item/style/index";
 
-import {
-  orderList,
-  cancel,
-} from "../api/index";
+import { orderList, cancel } from "../api/index";
 
 export default {
   name: "Appointment",
@@ -111,6 +108,10 @@ export default {
         // v.orderTime = v.orderTime.replace(/:00$/, "");
         if (v.status !== 2 && v.self) that.isDis = true;
         let key = v.orderTime.split(" ")[0];
+        key = key.split("-");
+        key.shift();
+        if(key.length) key = key.join("月") + '日';
+        else key = ""
         if (that.group[key]) {
           that.group[key].push(v);
         } else {