Parcourir la source

feat 推荐、屏蔽运力

Funny il y a 3 ans
Parent
commit
ffc7370911

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

@@ -43,13 +43,13 @@
           <div class="title">姓名:</div>
           <div class="cont">{{orderDetail.receiptContactName}}</div>
         </div>
-        <div class="info2 info4" v-if="orderDetail.receiptPrivacyPhone">
+        <div class="info2 info4" v-if="orderDetail.receiptPhone">
           <div class="title">隐私号:</div>
-          <div class="cont">{{orderDetail.receiptPrivacyPhone}}</div>
+          <div class="cont">{{orderDetail.receiptPhone}}</div>
         </div>
-        <div class="info2 info4" v-if="orderDetail.receiptPhone">
+        <div class="info2 info4" v-if="orderDetail.receiptPrivacyPhone">
           <div class="title">手机号:</div>
-          <div class="cont">{{orderDetail.receiptPhone}}</div>
+          <div class="cont">{{orderDetail.receiptPrivacyPhone}}</div>
         </div>
       </template>
       <div class="detail_ine"></div>

+ 1 - 1
src/components/orderComponents/orderList.vue

@@ -43,7 +43,7 @@
               </div>
               <!-- 取货中 -->
               <div class="order_item_header_r" v-if="tabNum === 3">
-                <span class="header_r">预计{{item.takeTimeTxt}}取件</span>
+                <span v-show="Number(item.riderArriveMinute)" class="header_r">预计{{Number(item.riderArriveMinute)}}分钟取件</span>
                 <el-button size='small' @click.stop="cancelOrder(item.id)">取消订单</el-button>
                 <el-button size='small' class="btn" @click.stop="orderPrinter(item.waimaiOrderId)">补打发票</el-button>
               </div>

+ 96 - 35
src/components/settingComponents/deliverySetting.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="delivery-content">
     <div>
-      <el-button type="primary">保存操作</el-button>
+      <!-- <el-button type="primary">保存操作</el-button> -->
     </div>
     <div class="recommend">
       <div class="title">
@@ -10,12 +10,24 @@
         <span>用户选择非聚合配送发单时,优先选中的运力置顶显示,提高您的下单效率</span>
       </div>
       <div class="delivery-list">
-        <div class="item" v-for="(v,i) in list" :key="i">
+        <div @click="changeStatus(v.deliveryId)" class="item" v-for="(v,i) in list" :key="i">
           <img :src="v.pcLogo" class="icon" />
-          <div class="mantle"></div>
+          <div v-if="shieldDeliveryIds.includes(String(v.deliveryId))" class="mask mantle">
+            {{v.name}}已屏蔽
+          </div>
+          <div v-if="billDeliveryIds.includes(String(v.deliveryId))" class="mask recommend-delivery">
+            {{v.name}}已推荐
+          </div>
         </div>
       </div>
     </div>
+    <el-dialog title="请选择对当前运力的操作!" :visible.sync="centerDialogVisible" width="600px" center>
+      <span slot="footer" class="dialog-footer">
+        <el-button type="success" @click="changeDelivery(1)">推荐该运力</el-button>
+        <el-button type="danger" @click="changeDelivery(2)">屏蔽该运力</el-button>
+        <el-button type="primary" @click="changeDelivery(3)">恢复普通运力</el-button>
+      </span>
+    </el-dialog>
     <!-- <div class="recommend">
       <div class="title">
         <span>屏蔽运力</span>
@@ -43,6 +55,7 @@ export default {
       list: [],
       billDeliveryIds: "", // 推荐运力ID
       shieldDeliveryIds: "", // 屏蔽运力ID
+      centerDialogVisible: false,
     };
   },
   created() {
@@ -51,6 +64,39 @@ export default {
   },
   mounted() {},
   methods: {
+    changeStatus(id) {
+      this.id = id;
+      this.centerDialogVisible = true;
+    },
+    changeDelivery(type) {
+      console.log(2222);
+      // 推荐该运力
+      if (type === 1) {
+        this.shieldDeliveryIds = this.shieldDeliveryIds.filter((v) => {
+          return v !== String(this.id);
+        });
+        this.billDeliveryIds.push(String(this.id));
+        this.billDeliveryIds = [...new Set(this.billDeliveryIds)];
+      }
+      // 屏蔽该运力
+      if (type === 2) {
+        this.billDeliveryIds = this.billDeliveryIds.filter((v) => {
+          return v !== String(this.id);
+        });
+        this.shieldDeliveryIds.push(String(this.id));
+        this.shieldDeliveryIds = [...new Set(this.shieldDeliveryIds)];
+      }
+      // 恢复为普通运力
+      if (type === 3) {
+        this.billDeliveryIds = this.billDeliveryIds.filter((v) => {
+          return v !== String(this.id);
+        });
+        this.shieldDeliveryIds = this.shieldDeliveryIds.filter((v) => {
+          return v !== String(this.id);
+        });
+      }
+      this.updateConfig();
+    },
     getDeliveryFloorList() {
       getDeliveryFloorList().then((res) => {
         if (res.code === 200) {
@@ -66,8 +112,31 @@ export default {
     getConfig() {
       getConfig().then((res) => {
         if (res.code === 200) {
-          this.billDeliveryIds = res.data.billDeliveryIds;
-          this.shieldDeliveryIds = res.data.shieldDeliveryIds;
+          this.billDeliveryIds = res.data.billDeliveryIds.split(",");
+          this.shieldDeliveryIds = res.data.shieldDeliveryIds.split(",");
+          let a = new Set(this.shieldDeliveryIds);
+          let b = new Set(this.billDeliveryIds);
+          let difference = new Set([...a].filter((x) => !b.has(x)));
+          this.shieldDeliveryIds = [...difference];
+        } else {
+          this.$message({
+            type: "error",
+            message: res.msg,
+          });
+        }
+        this.centerDialogVisible = false
+      });
+    },
+    updateConfig() {
+      let billDeliveryIds = this.billDeliveryIds.toString();
+      let shieldDeliveryIds = this.shieldDeliveryIds.toString();
+      updateConfig({ billDeliveryIds, shieldDeliveryIds }).then((res) => {
+        if (res.code === 200) {
+          this.$message({
+            type: "success",
+            message: "修改成功!",
+          });
+          this.getConfig();
         } else {
           this.$message({
             type: "error",
@@ -76,22 +145,6 @@ export default {
         }
       });
     },
-  },
-  updateConfig() {
-    updateConfig().then((res) => {
-      if (res.code === 200) {
-        this.$message({
-          type: "success",
-          message: "修改成功!",
-        });
-        this.getConfig();
-      } else {
-        this.$message({
-          type: "error",
-          message: res.msg,
-        });
-      }
-    });
   },
 };
 </script>
@@ -124,25 +177,33 @@ export default {
       padding: 30px 18px 0;
       .item {
         position: relative;
-        font-size: 0;
-        width: 166px;
-        height: 50px;
-        border-radius: 25px;
-        overflow: hidden;
-        margin-right: 50px;
-        margin-bottom: 30px;
-        .mantle{
+        cursor: pointer;
+        margin: 0 30px 30px 0;
+        .mask {
           position: absolute;
-            
+          display: flex;
+          align-items: center;
+          justify-content: center;
+          top: 0;
+          left: 0;
+          width: 129px;
+          height: 40px;
+          background: #999;
+          font-size: 14px;
+          border-radius: 25px;
+          opacity: 0.8;
+        }
+        .mantle {
+          color: #fff;
+        }
+        .recommend-delivery {
+          color: red;
         }
         .icon {
-          width: 100%;
-          height: 100%;
+          width: 129px;
+          height: 40px;
         }
       }
-      .item-opcity {
-        opacity: 0.4;
-      }
     }
   }
 }

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

@@ -23,7 +23,7 @@
         <div class="item-bottom">
           <div class="left">
             <div class="l-l">
-              <img src="../../../static/image/alipay.png" class="l-l-img" />
+              <img :src="v.img" class="l-l-img" />
             </div>
             <div class="take-out-name">
               <div class="take-out-name-bot">
@@ -65,15 +65,7 @@ export default {
   },
   data() {
     return {
-      shopList: [
-        { id: 1, name: "门店名称-1" },
-        { id: 2, name: "门店名称-2" },
-        { id: 3, name: "门店名称-3" },
-        { id: 4, name: "门店名称-4" },
-        { id: 5, name: "门店名称-5" },
-        { id: 6, name: "门店名称-6" },
-        { id: 7, name: "门店名称-7" },
-      ],
+      shopList: [],
       curIdx: -1,
       loading: true,
       printerList: [],
@@ -255,8 +247,8 @@ export default {
           display: flex;
           align-items: center;
           .l-l {
-            width: 220px;
-            height: 220px;
+            width: 155px;
+            height: 80px;
             font-size: 0;
             .l-l-img {
               width: 100%;