Funny 3 anni fa
parent
commit
aa1278df41

+ 2 - 2
src/App.vue

@@ -32,8 +32,7 @@ export default {
       openMsg: false,
     };
   },
-  created() {
-  },
+  created() {},
   mounted() {
     bus.$on("closeGetSoundMsg", () => {
       console.log("进来准备关闭新订单提醒声音了");
@@ -61,6 +60,7 @@ export default {
     clearInterval(this.timer);
     this.timer = null;
   },
+  destroyed() {},
   methods: {
     getSoundMsg() {
       getSoundMsg().then((res) => {

+ 4 - 2
src/components/orderComponents/orderDetail.vue

@@ -28,11 +28,13 @@
       <template v-if="orderDetail.caution || orderDetail.takeRemark">
         <div class="info2" v-if="orderDetail.caution">
           <div class="title">用户备注:</div>
-          <div class="cont cont1">{{orderDetail.caution.length > 60 ? orderDetail.caution.slice(0,60) + '...' : orderDetail.caution}}</div>
+          <!-- <div class="cont cont1">{{orderDetail.caution.length > 60 ? orderDetail.caution.slice(0,60) + '...' : orderDetail.caution}}</div> -->
+          <div class="cont cont1">{{orderDetail.caution.length}}</div>
         </div>
         <div class="info2 info3" v-if="orderDetail.takeRemark">
           <div class="title">发单备注:</div>
-          <div class="cont cont1">{{orderDetail.takeRemark.length > 60 ? orderDetail.takeRemark.slice(0,60) + '...' : orderDetail.takeRemark}}</div>
+          <!-- <div class="cont cont1">{{orderDetail.takeRemark.length > 60 ? orderDetail.takeRemark.slice(0,60) + '...' : orderDetail.takeRemark}}</div> -->
+          <div class="cont cont1">{{orderDetail.takeRemark.length}}</div>
         </div>
         <div class="detail_ine"></div>
       </template>

+ 35 - 24
src/components/orderComponents/orderList.vue

@@ -2,7 +2,7 @@
   <div>
     <el-row class="track-detail">
       <!-- 订单追踪、订单详情 -->
-      <el-col :span="7">
+      <el-col :span="7"  v-loading="!orderDetailStutus && !showTrack" element-loading-text="拼命加载中">
         <div class="order_detail">
           <div class="detail_title">
             <div v-show="buttonStatus !== 0 && buttonStatus !== 10" class="detail_txt" @click="orderDetailStutus = 0" :class="{ detail_txt_ac: !orderDetailStutus }">
@@ -371,7 +371,6 @@ export default {
   },
   watch: {
     tabNum(newVal, oldVal) {
-      console.log(1111);
       this.curIdx = 0;
     },
     list: {
@@ -469,30 +468,41 @@ export default {
           type: "error",
         });
       }
-      cancelOrder({
-        orderId: this.orderId,
-        cancelReason:
-          this.reasonIndex != 8 ? this.chooseReason : this.cancelReason,
-      }).then((res) => {
-        if (res.code == 200) {
-          this.$message({
-            message: "取消订单成功",
-            type: "success",
-          });
-          this.orderId = "";
-          this.cancelReason = "";
-          this.chooseReason = "";
-          this.reasonIndex = null;
-          bus.$emit("refreshData");
-          bus.$emit("refreshData2");
+      this.$confirm("取消订单可能会存在违约金, 是否继续?", "提示", {
+        confirmButtonText: "取消",
+        cancelButtonText: "确定",
+        center: true,
+        type: "warning",
+      })
+        .then(() => {
           this.cancelStatus = false;
-        } else {
-          this.$message({
-            message: res.msg,
-            type: "error",
+        })
+        .catch(() => {
+          cancelOrder({
+            orderId: this.orderId,
+            cancelReason:
+              this.reasonIndex != 8 ? this.chooseReason : this.cancelReason,
+          }).then((res) => {
+            if (res.code == 200) {
+              this.$message({
+                message: "取消订单成功",
+                type: "success",
+              });
+              this.orderId = "";
+              this.cancelReason = "";
+              this.chooseReason = "";
+              this.reasonIndex = null;
+              bus.$emit("refreshData");
+              bus.$emit("refreshData2");
+              this.cancelStatus = false;
+            } else {
+              this.$message({
+                message: res.msg,
+                type: "error",
+              });
+            }
           });
-        }
-      });
+        });
     },
     // 取消定时发单
     cancalSettingTime() {
@@ -1169,6 +1179,7 @@ export default {
   font-size: 14px;
   font-weight: 400;
   color: #b1b1b1;
+  word-wrap:break-word;
 }
 .order_detail {
   position: relative;

+ 34 - 22
src/components/set.vue

@@ -3,8 +3,7 @@
     <el-row class="order_tab">
       <el-col :span="15">
         <div class="tab_list">
-          <div class="tab_item" @click="changeTabs(i)" :class="{'tab_item_ac':tab_ac==i?true:false}"
-               v-for="(item,i) in tab_list" :key="i">
+          <div class="tab_item" @click="changeTabs(i)" :class="{'tab_item_ac':tab_ac==i?true:false}" v-for="(item,i) in tab_list" :key="i">
             <span>{{item.name}}</span>
             <div class="tab_line"></div>
           </div>
@@ -13,39 +12,52 @@
     </el-row>
     <el-row class="content">
       <el-col :span="24">
-        <component :is="activeName"></component>
+        <component v-if="renderComponent" :is="activeName"></component>
       </el-col>
     </el-row>
   </div>
 </template>
 
 <script>
-import voiceSetting from './settingComponents/voiceSetting.vue';
-import deliverySetting from './settingComponents/deliverySetting.vue';
+import voiceSetting from "./settingComponents/voiceSetting.vue";
+import deliverySetting from "./settingComponents/deliverySetting.vue";
 export default {
-  name: 'HelloWorld',
-  data () {
+  name: "HelloWorld",
+  data() {
     return {
-      msg: 'Welcome to Your Vue.js App',
+      msg: "Welcome to Your Vue.js App",
       tab_list: [
-        {name: '自动接单/语音设置', index: 0},
-        {name: '推荐/屏蔽运力', index: 1}
+        { name: "自动接单/语音设置", index: 0 },
+        { name: "推荐/屏蔽运力", index: 1 },
       ],
       tab_ac: 0,
-      activeName: 'voiceSetting'
-    }
+      activeName: "voiceSetting",
+      renderComponent: true,
+    };
   },
   components: {
     voiceSetting,
-    deliverySetting
+    deliverySetting,
   },
   methods: {
+    forceRerender() {
+      // 从 DOM 中删除 my-component 组件
+      this.renderComponent = false;
+      this.$nextTick(() => {
+        // 在 DOM 中添加 my-component 组件
+        this.renderComponent = true;
+      });
+    },
     changeTabs(i) {
+      if (i === this.tab_ac) {
+        this.forceRerender();
+        return;
+      }
       this.tab_ac = i;
-      this.activeName = i == 0 ? 'voiceSetting' : 'deliverySetting';
-    }
-  }
-}
+      this.activeName = i == 0 ? "voiceSetting" : "deliverySetting";
+    },
+  },
+};
 </script>
 
 <!-- Add "scoped" attribute to limit CSS to this component only -->
@@ -54,7 +66,7 @@ export default {
   .order_tab {
     width: 100%;
     height: 74px;
-    background: #FFF;
+    background: #fff;
 
     .tab_list {
       width: 100%;
@@ -69,7 +81,7 @@ export default {
         margin-right: 56px;
         font-size: 16px;
         font-weight: 500;
-        color: #B1B1B1;
+        color: #b1b1b1;
         position: relative;
         text-align: center;
         cursor: pointer;
@@ -77,17 +89,17 @@ export default {
         .tab_line {
           width: 58px;
           height: 6px;
-          background: #FFF;
+          background: #fff;
           border-radius: 3px;
           margin: 15px auto 0;
         }
       }
 
       .tab_item_ac {
-        color: #FC7200;
+        color: #fc7200;
 
         .tab_line {
-          background: #FC7200;
+          background: #fc7200;
         }
       }
     }

+ 6 - 1
src/components/shopCompoents/bindDelivery.vue

@@ -119,7 +119,7 @@ export default {
         deliveryId: "",
         shopNo: "",
       },
-      memberType: this.$store.state.userInfo.memberType
+      memberType: this.$store.state.userInfo.memberType,
     };
   },
   watch: {
@@ -223,6 +223,11 @@ export default {
       // 显示U跑腿绑定弹框
       if (v.type === 7) {
         this.title = "UU跑腿绑定";
+        this.UUData = {
+          cityName: "",
+          mobile: "",
+          validateCode: "",
+        };
         this.centerDialogVisible = true;
         return;
       }

+ 12 - 1
src/components/shopCompoents/bindPrinter.vue

@@ -15,7 +15,8 @@
         <el-button class="btn" @click.stop="addPrinter(1)">添加打印机</el-button>
       </div>
     </div>
-    <div class="take-out-list" v-for="(v,i) in printerList" :key="i">
+    <template v-if="printerList.length">
+      <div  class="take-out-list" v-for="(v,i) in printerList" :key="i">
       <div class="item">
         <div class="item-top">
           <div class="name">{{v.name}}</div>
@@ -46,6 +47,10 @@
         </div>
       </div>
     </div>
+    </template>
+    <div class="empty-img" v-else>
+      <img src="../../../static/image/printer.png" />
+    </div>
     <printer-add @shopDeviceList="shopDeviceList(curIdx)" ref="printerAdd" :devices="deviceList"></printer-add>
   </div>
 </template>
@@ -314,6 +319,12 @@ export default {
       }
     }
   }
+  .empty-img {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    background: #f9fafb;
+  }
   .category_box {
     display: flex;
     flex-wrap: wrap;

+ 1 - 0
src/router/index.js

@@ -74,6 +74,7 @@ router.beforeEach((to, from, next) => {
     next()
   } else {
     const token = localStorage.getItem('token') || null;
+    console.log('这是一个token:',token);
     if (token) {
       next()
     } else if (to.path !== '/resetPassword') {

+ 1 - 1
src/views/home.vue

@@ -64,7 +64,7 @@ export default {
         cancelButtonText: "取消",
         type: "warning",
       }).then(() => {
-        localStorage.clear("token");
+        localStorage.clear();
         bus.$emit("closeGetSoundMsg");
         this.$router.push({
           path: "/login",