Переглянути джерело

同步app功能,配送信息同步设置

Funny 2 роки тому
батько
коміт
52855c9cd3
1 змінених файлів з 65 додано та 39 видалено
  1. 65 39
      src/components/settingComponents/deliverySetting.vue

+ 65 - 39
src/components/settingComponents/deliverySetting.vue

@@ -23,7 +23,7 @@
           <div class="left">
             <div class="left-top">
               <div class="name">{{v.name}}</div>
-              <div @click="setTime(v,i)" class="set">{{v.setContent}}</div>
+              <div @click="setTime(v,i)" class="set-tips">{{v.setContent}}</div>
             </div>
             <div class="left-bot">{{v.tips}}</div>
           </div>
@@ -36,8 +36,19 @@
       </div>
     </div>
     <div class="model">
-      <div class="title">同步设置</div>
+      <div class="title">配送信息同步设置</div>
       <div class="list">
+        <div class="item">
+          <div class="left">
+            <div class="left-top">
+              <div class="name">同步商品图片</div>
+            </div>
+            <div class="left-bot">同步后显示最新的商品图片,7天内只可以同步一次,如遇特殊情况可联系客服。</div>
+          </div>
+          <div class="right">
+            <img @click="syncFoodImg" class="img" src="../../../static/image/update.png" alt="">
+          </div>
+        </div>
         <div class="item" v-for="(v,i) in list2" :key=i>
           <div class="left">
             <div class="left-top">
@@ -62,8 +73,8 @@
             <div class="left-bot">{{v.tips}}</div>
           </div>
           <div class="right">
-            <div class="con con1" @click="changeDelivery(v,3)" v-if="billDeliveryIds.includes(String(v.deliveryId))">取消推荐</div>
-            <div class="con" @click="changeDelivery(v,2)" v-if="billDeliveryIds.includes(String(v.deliveryId)) || !shieldDeliveryIds.includes(String(v.deliveryId))">屏蔽</div>
+            <div class="con" @click="changeDelivery(v,3)" v-if="billDeliveryIds.includes(String(v.deliveryId))">取消推荐</div>
+            <div class="con con1" @click="changeDelivery(v,2)" v-if="billDeliveryIds.includes(String(v.deliveryId)) || !shieldDeliveryIds.includes(String(v.deliveryId))">屏蔽</div>
             <div class="con con1" @click="changeDelivery(v,3)" v-if="shieldDeliveryIds.includes(String(v.deliveryId))">取消屏蔽</div>
             <div class="con" @click="changeDelivery(v,1)" v-if="shieldDeliveryIds.includes(String(v.deliveryId)) || !billDeliveryIds.includes(String(v.deliveryId))">推荐</div>
           </div>
@@ -91,6 +102,7 @@ import {
   getDeliveryFloorList,
   getConfig,
   updateConfig,
+  syncFoodImg,
 } from "../../api/setting.js";
 export default {
   name: "deliverySetting",
@@ -116,22 +128,16 @@ export default {
       ],
       list2: [
         {
-          name: "同步订单商品给骑手",
+          name: "订单详情显示出商品图片",
           value: 1,
-          field: "syncGoodsDetailToDelivery",
-          tips: "关闭后骑手将看不到商品详情",
+          field: "showFoodImg",
+          tips: "在订单详情的商品显示图片,方便制作时确认",
         },
         {
-          name: "同步打印客户联商品明细",
-          value: 1,
-          field: "customerLinkPrintGoodsDetail",
-          tips: "关闭后打印的客户联小票将看不到商品明细",
-        },
-        {
-          name: "同步打印客户联商品价格",
+          name: "同步订单商品给骑手",
           value: 1,
-          field: "customerLinkPrintGoodsPrice",
-          tips: "关闭后打印的客户联小票将看不到商品价格",
+          field: "syncGoodsDetailToDelivery",
+          tips: "关闭后骑手将看不到商品详情",
         },
       ],
       list3: [
@@ -140,7 +146,7 @@ export default {
           value: 1,
           field: "openAutoorder",
           tips: "非冲突绑定模式,不支持自动接单",
-        }
+        },
       ],
       billDeliveryIds: [], // 推荐运力
       shieldDeliveryIds: [], // 屏蔽运力
@@ -154,6 +160,27 @@ export default {
   computed: {},
   // 监控data中的数据变化
   watch: {},
+  // 生命周期 - 创建完成(可以访问当前this实例)
+  created() {
+    this.getDelivery();
+    this.getConfig();
+  },
+  // 生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {},
+  // 生命周期 - 创建之前
+  beforeCreate() {},
+  // 生命周期 - 挂载之前
+  beforeMount() {},
+  // 生命周期 - 更新之前
+  beforeUpdate() {},
+  // 生命周期 - 更新之后
+  updated() {},
+  // 生命周期 - 销毁之前
+  beforeDestroy() {},
+  // 生命周期 - 销毁完成
+  destroyed() {},
+  // 如果页面有keep-alive缓存功能,这个函数会触发
+  activated() {},
   // 方法集合
   methods: {
     changeDelivery(v, type) {
@@ -272,28 +299,22 @@ export default {
         this.getConfig();
       });
     },
+    syncFoodImg() {
+      syncFoodImg().then((res) => {
+        if (res.code === 200) {
+          this.$message({
+            type: "success",
+            message: "正在同步!",
+          });
+        } else {
+          this.$message({
+            type: "error",
+            message: res.msg,
+          });
+        }
+      });
+    },
   },
-  // 生命周期 - 创建完成(可以访问当前this实例)
-  created() {
-    this.getDelivery();
-    this.getConfig();
-  },
-  // 生命周期 - 挂载完成(可以访问DOM元素)
-  mounted() {},
-  // 生命周期 - 创建之前
-  beforeCreate() {},
-  // 生命周期 - 挂载之前
-  beforeMount() {},
-  // 生命周期 - 更新之前
-  beforeUpdate() {},
-  // 生命周期 - 更新之后
-  updated() {},
-  // 生命周期 - 销毁之前
-  beforeDestroy() {},
-  // 生命周期 - 销毁完成
-  destroyed() {},
-  // 如果页面有keep-alive缓存功能,这个函数会触发
-  activated() {},
 };
 </script>
 
@@ -351,7 +372,7 @@ export default {
         .left-top {
           display: flex;
           align-items: center;
-          .set {
+          .set-tips {
             font-weight: 400;
             color: #fc7200;
             margin-left: 10px;
@@ -391,6 +412,11 @@ export default {
         .con1 {
           color: #999999;
         }
+        .img {
+          width: 20px;
+          height: 20px;
+          cursor: pointer;
+        }
       }
     }
   }