Sfoglia il codice sorgente

Merge branch 'release/2.0.2'

Funny 2 anni fa
parent
commit
e3ebf3ce41

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "liebao-web",
-  "version": "2.0.1",
+  "version": "2.0.2",
   "private": true,
   "author": "优巨引擎",
   "description": "有运力的地方,就有猎豹AI。",

+ 4 - 1
src/api/shop.js

@@ -236,7 +236,10 @@ export const getCloudDevice = (params) => {
 export const cloudPrint = (params) => {
   return post('app/order/print/card', params)
 }
-
+// 云盒打印测试
+export const cloudPrintTest = (params) => {
+  return post('app/order/print/test/card', params)
+}
 // 云盒配置列表
 export const cloudConfigList = (params) => {
   return get('app/shop/cloud/card/list', params)

+ 176 - 89
src/components/orderComponents/orderDetail.vue

@@ -222,58 +222,73 @@ export default {
       });
     },
     printHtml() {
-      return `<style type="text/css">
-                @font-face {
-                  font-family: ${this.params.fontFamily};
-                  src: url("https://h5.liebaoai.cn/font/${
-                    this.params.fontFamily
-                  }.woff2") format('woff2'),
-                        url("https://h5.liebaoai.cn/font/${
-                          this.params.fontFamily
-                        }.woff") format('woff'),
-                        url("https://h5.liebaoai.cn/font/${
-                          this.params.fontFamily
-                        }.ttf") format('truetype');
-                  font-weight: normal;
-                  font-style: normal;
-                }
-                .card-a4 {
-                  display: flex;
-                  justify-content: ${
-                    this.params.htmlContentAlign ? "center" : "flex-start"
-                  };
-                  align-items: ${
-                    this.params.direction === 2 ? "center" : "flex-start"
-                  };
-                  height: 297mm;
-                  width: 210mm;
-                }
-                .card-left {
-                  margin-top: -8mm;
-                  position: relative;
-                  height: ${this.params.cardHeight}mm;
-                  width: ${this.params.cardWidth}mm;
-                  display:flex;
-                  ${this.contentStyle(1)[0]}
-                }
-                .card-con {
-                  margin-top: ${this.params.paddingTop}mm;
-                  margin-right: ${this.params.paddingRight}mm;
-                  margin-bottom: ${this.params.paddingBottom}mm;
-                  margin-left: ${this.params.paddingLeft}mm;
-                  text-align: ${this.textAlign};
-                  outline:none;
-                  font-family: ${this.params.fontFamily};
-                  font-size:${this.fontSize}px;
-                  line-height:${this.fontSize + 5}px;
-                  ${this.contentStyle(1)[1]}
-                }
-              </style>
-              <div class="card-left">
-                <div id="card-con" class="card-con" contenteditable="true">
-                  ${this.printContent}
-                </div>
-              </div>`;
+      return `<!DOCTYPE html>
+              <html lang="en">
+              <head>
+                  <meta charset="UTF-8">
+                  <title>提交三方打印任务html</title>
+                  <style>
+                      @font-face {
+                          font-family: ${this.params.fontFamily};
+                          src: url("https://h5.liebaoai.cn/font/${
+                            this.params.fontFamily
+                          }.woff2") format('woff2'),
+                              url("https://h5.liebaoai.cn/font/${
+                                this.params.fontFamily
+                              }.woff") format('woff'),
+                              url("https://h5.liebaoai.cn/font/${
+                                this.params.fontFamily
+                              }.ttf") format('truetype');
+                          font-weight: normal;
+                          font-style: normal;
+                      }
+
+                      body {
+                          margin: 0;
+                          box-sizing: border-box;
+                      }
+
+                      .page {
+                          height: ${this.params.cardHeight}mm;
+                          width: ${this.params.cardWidth}mm;
+                          position: relative;
+                          box-sizing: border-box;
+                      }
+
+                      .box {
+                          position: absolute;
+                          height: ${this.params.cardHeight}mm;
+                          width: ${this.params.cardWidth}mm;
+                          top: 0;
+                          left: 0;
+                          display:flex;
+                          ${this.contentStyle(1)[0]}
+                      }
+
+                      .card-con {
+                          margin-top: ${this.params.paddingTop}mm;
+                          margin-right: ${this.params.paddingRight}mm;
+                          margin-bottom: ${this.params.paddingBottom}mm;
+                          margin-left: ${this.params.paddingLeft}mm;
+                          text-align: ${this.textAlign};
+                          outline:none;
+                          font-family: ${this.params.fontFamily};
+                          font-size:${this.fontSize}px;
+                          line-height:${this.fontSize + 5}px;
+                          ${this.contentStyle(1)[1]}
+                      }
+                  </style>
+              </head>
+              <body>
+                  <div class="page">
+                      <div class="box">
+                          <div id="cardCon" class="card-con" contenteditable="true">
+                              ${this.printContent}
+                          </div>
+                      </div>
+                  </div>
+              </body>
+              </html>`;
     },
   },
   methods: {
@@ -316,23 +331,95 @@ export default {
       this.printContent = this.initCardInfo(this.orderDetail.cardInfo);
     },
     print() {
-      let html = this.$refs.html.innerHTML;
-      if (this.params.direction === 2) {
-        html = html.replace(
-          `height: ${this.params.cardHeight}mm;`,
-          `height: ${this.params.cardWidth}mm;`
-        );
-        html = html.replace(
-          `width: ${this.params.cardWidth}mm;`,
-          `width: ${this.params.cardHeight}mm;`
-        );
-        html = html.replace(
-          `margin-right: ${this.params.paddingRight}mm`,
-          `margin-right: ${this.params.paddingRight + 15}mm`
-        );
-      }
-      html = html.replace(`</style>`, `</style><div class="card-a4">`);
-      html = `${html}</div>`;
+      let text = document.getElementById("cardCon").innerText;
+      let html = `<!DOCTYPE html>
+              <html lang="en">
+              <head>
+                  <meta charset="UTF-8">
+                  <title>提交三方打印任务html</title>
+                  <style>
+                      @font-face {
+                          font-family: ${this.params.fontFamily};
+                          src: url("https://h5.liebaoai.cn/font/${
+                            this.params.fontFamily
+                          }.woff2") format('woff2'),
+                              url("https://h5.liebaoai.cn/font/${
+                                this.params.fontFamily
+                              }.woff") format('woff'),
+                              url("https://h5.liebaoai.cn/font/${
+                                this.params.fontFamily
+                              }.ttf") format('truetype');
+                          font-weight: normal;
+                          font-style: normal;
+                      }
+
+                      body {
+                          margin: 0;
+                          box-sizing: border-box;
+                      }
+
+                      .page {
+                          height: ${
+                            this.params.direction === 1
+                              ? this.params.cardHeight
+                              : this.params.cardWidth
+                          }mm;
+                          width: ${
+                            this.params.direction === 1
+                              ? this.params.cardWidth
+                              : this.params.cardHeight
+                          }mm;
+                          position: relative;
+                          box-sizing: border-box;
+                      }
+
+                      .box {
+                          position: absolute;
+                          height: ${
+                            this.params.direction === 1
+                              ? this.params.cardHeight - 20
+                              : this.params.cardWidth - 10
+                          }mm;
+                          width: ${
+                            this.params.direction === 1
+                              ? this.params.cardWidth - 5
+                              : this.params.cardHeight - 10
+                          }mm;
+                          top: ${this.params.direction === 1 ? 2 : 8}mm;
+                          left: 0mm;
+                          display:flex;
+                          ${this.contentStyle(1)[0]}
+                      }
+
+                      .card-con {
+                          margin-top: ${
+                            this.params.direction === 1 &&
+                            ["z1", "z4", "z7"].includes(this.params.jpAutoAlign)
+                              ? this.params.paddingTop - 10
+                              : this.params.paddingTop
+                          }mm;
+                          margin-right: ${this.params.paddingRight}mm;
+                          margin-bottom: ${this.params.paddingBottom}mm;
+                          margin-left: ${this.params.paddingLeft}mm;
+                          text-align: ${this.textAlign};
+                          outline:none;
+                          font-family: ${this.params.fontFamily};
+                          font-size:${this.fontSize}px;
+                          line-height:${this.fontSize + 5}px;
+                          ${this.contentStyle(1)[1]}
+                      }
+                  </style>
+              </head>
+              <body>
+                  <div class="page">
+                      <div class="box">
+                          <div id="card-con" class="card-con" contenteditable="true">
+                              ${text}
+                          </div>
+                      </div>
+                  </div>
+              </body>
+              </html>`;
 
       console.log("html:", html);
       let params = {
@@ -387,72 +474,72 @@ export default {
       let style = ``;
       let transform = ``;
       if (direction === 1) {
-        switch (this.params.textAlign) {
-          case 1:
+        switch (this.params.jpAutoAlign) {
+          case "z1":
             style = `justify-content:flex-start;align-items:flex-start;`;
             break;
-          case 2:
+          case "z2":
             style = `justify-content:flex-start;align-items:center;`;
             break;
-          case 3:
+          case "z3":
             style = `justify-content:flex-start;align-items:flex-end;`;
             break;
-          case 4:
+          case "z4":
             style = `justify-content:center;align-items:flex-start;`;
             break;
-          case 5:
+          case "z5":
             style = `justify-content:center;align-items:center;`;
             break;
-          case 6:
+          case "z6":
             style = `justify-content:center;align-items:flex-end;`;
             break;
-          case 7:
+          case "z7":
             style = `justify-content:flex-end;align-items:flex-start;`;
             break;
-          case 8:
+          case "z8":
             style = `justify-content:flex-end;align-items:center;`;
             break;
-          case 9:
+          case "z9":
             style = `justify-content:flex-end;align-items:flex-end;`;
             break;
           default:
             break;
         }
       } else {
-        switch (this.params.textAlign) {
-          case 1:
+        switch (this.params.jpAutoAlign) {
+          case "z1":
             style = `justify-content:flex-end;align-items:flex-start;`;
             transform = `transform: translateX(100%) rotate(90deg);transform-origin: left top;`;
             break;
-          case 2:
+          case "z2":
             style = `justify-content:center;align-items:flex-start;`;
             transform = `transform: translateX(50%) translateY(-50%) rotate(90deg);transform-origin: left;`;
             break;
-          case 3:
+          case "z3":
             style = `justify-content:flex-start;align-items:flex-start;`;
             transform = `transform: translateY(-100%) rotate(90deg);transform-origin: left bottom;`;
             break;
-          case 4:
+          case "z4":
             style = `justify-content:flex-end;align-items:center;`;
             transform = `transform: translateX(50%) rotate(90deg);transform-origin: center top;`;
             break;
-          case 5:
+          case "z5":
             style = `justify-content:center;align-items:center;`;
             transform = `transform: rotate(90deg);`;
             break;
-          case 6:
+          case "z6":
             style = `justify-content:flex-start;align-items:center;`;
             transform = `transform: translateX(-50%) rotate(90deg);`;
             break;
-          case 7:
+          case "z7":
             style = `justify-content:flex-end;align-items:flex-end;`;
             transform = `transform: translatey(100%) rotate(90deg);transform-origin: right top;`;
             break;
-          case 8:
+          case "z8":
             style = `justify-content:center;align-items:flex-end;`;
             transform = `transform: translateX(-50%) translateY(50%) rotate(90deg);transform-origin:right;`;
             break;
-          case 9:
+          case "z9":
             style = `justify-content:flex-start;align-items:flex-end;`;
             transform = `transform: translateX(-100%) rotate(90deg);transform-origin:right bottom;`;
             break;

+ 29 - 169
src/components/settingComponents/deliverySetting.vue

@@ -1,57 +1,6 @@
 <template>
   <div class="delivery-setting">
     <div class="model">
-      <div class="title">接单设置</div>
-      <div class="list">
-        <div class="item" v-for="(v,i) in list3" :key=i>
-          <div class="left">
-            <div class="left-top">
-              <div class="name">{{v.name}}</div>
-            </div>
-            <div class="left-bot">{{v.tips}}</div>
-          </div>
-          <div class="right">
-            <el-switch @change="change(v)" v-model="v.value" :active-value="1" :inactive-value="0" active-color="#FC7200" inactive-color="#999" />
-          </div>
-        </div>
-      </div>
-    </div>
-    <div class="model">
-      <div class="title">自动发单设置</div>
-      <div class="list">
-        <div class="item" v-for="(v,i) in list" :key=i>
-          <div class="left">
-            <div class="left-top">
-              <div class="name">{{v.name}}</div>
-              <div @click="setTime(v,i)" class="set">{{v.setContent}}</div>
-            </div>
-            <div class="left-bot">{{v.tips}}</div>
-          </div>
-          <div class="right">
-            <div v-if="!i" :class="['time', v.value ? '' : 'time1']">顾客下单{{v.time}}分钟后</div>
-            <div v-else :class="['time', v.value ? '' : 'time1']">期望送达前{{v.time}}分钟</div>
-            <el-switch @change="change(v)" v-model="v.value" :active-value="1" :inactive-value="0" active-color="#FC7200" inactive-color="#999" />
-          </div>
-        </div>
-      </div>
-    </div>
-    <div class="model">
-      <div class="title">同步设置</div>
-      <div class="list">
-        <div class="item" v-for="(v,i) in list2" :key=i>
-          <div class="left">
-            <div class="left-top">
-              <div class="name">{{v.name}}</div>
-            </div>
-            <div class="left-bot">{{v.tips}}</div>
-          </div>
-          <div class="right">
-            <el-switch @change="change(v)" v-model="v.value" :active-value="1" :inactive-value="0" active-color="#FC7200" inactive-color="#999" />
-          </div>
-        </div>
-      </div>
-    </div>
-    <div class="model">
       <div class="title">运力设置<span class="tips">(推荐的运力在聚合发单时会置顶展示,屏蔽的运力在发单时将不进行计价)</span></div>
       <div class="list">
         <div class="item" v-for="(v,i) in deliveryList" :key=i>
@@ -62,27 +11,14 @@
             <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>
         </div>
       </div>
     </div>
-    <el-dialog :title="!curIndex ? '即时单自动发单时间设置' : '预定单自动发单时间设置'" @close="centerDialogVisible=false" :visible.sync="centerDialogVisible" width="400px" center>
-      <el-form label-width="120px">
-        <el-form-item :label="!curIndex ? '顾客下单' : '期望送达前'">
-          <el-input size="small" class="auto-time" v-model="time" clearable>
-            <template slot="append">分钟{{curIndex ? '' : '后'}}</template>
-          </el-input>
-        </el-form-item>
-      </el-form>
-      <span slot="footer" class="dialog-footer">
-        <el-button size="medium" @click="centerDialogVisible=false">取 消</el-button>
-        <el-button size='medium' type="primary" @click="confirm">确 定</el-button>
-      </span>
-    </el-dialog>
   </div>
 </template>
 
@@ -96,52 +32,6 @@ export default {
   name: "deliverySetting",
   data() {
     return {
-      list: [
-        {
-          name: "自动发单",
-          setContent: "设置时长",
-          value: 1,
-          field: "openAutodelivery",
-          tips: "非冲突绑定模式,不支持自动发单",
-          time: 0,
-        },
-        {
-          name: "预约单自动发单",
-          setContent: "设置时长",
-          value: 1,
-          field: "openBookingAutodelivery",
-          tips: "设置的时长为预约单期望送达前多长时间自动呼叫配送",
-          time: 0,
-        },
-      ],
-      list2: [
-        {
-          name: "同步订单商品给骑手",
-          value: 1,
-          field: "syncGoodsDetailToDelivery",
-          tips: "关闭后骑手将看不到商品详情",
-        },
-        {
-          name: "同步打印客户联商品明细",
-          value: 1,
-          field: "customerLinkPrintGoodsDetail",
-          tips: "关闭后打印的客户联小票将看不到商品明细",
-        },
-        {
-          name: "同步打印客户联商品价格",
-          value: 1,
-          field: "customerLinkPrintGoodsPrice",
-          tips: "关闭后打印的客户联小票将看不到商品价格",
-        },
-      ],
-      list3: [
-        {
-          name: "自动接单",
-          value: 1,
-          field: "openAutoorder",
-          tips: "非冲突绑定模式,不支持自动接单",
-        }
-      ],
       billDeliveryIds: [], // 推荐运力
       shieldDeliveryIds: [], // 屏蔽运力
       deliveryList: [],
@@ -154,6 +44,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) {
@@ -189,33 +100,12 @@ export default {
       };
       this.updateConfig(data);
     },
-    confirm() {
-      let data = {};
-      if (!this.curIndex) {
-        data = { autodeliveryOrderTime: this.time * 60 };
-      } else {
-        data = { bookingAutodeliveryOrderTime: this.time * 60 };
-      }
-      this.updateConfig(data);
-    },
-    setTime(v, i) {
-      if (!v.value) {
-        return this.$message({
-          message: "请开启后再设置时间!",
-          type: "warning",
-        });
-      }
-      this.curIndex = i;
-      this.time = v.time;
-      this.centerDialogVisible = true;
-    },
     change(e) {
       let data = { [e.field]: e.value };
       this.updateConfig(data);
     },
     getDelivery() {
       getDeliveryFloorList().then((res) => {
-        console.log("返回的运力:", res);
         if (res.code === 200) {
           // 电脑端暂时不支持货拉拉
           this.deliveryList = res.data.filter((v) => {
@@ -238,20 +128,6 @@ export default {
           this.shieldDeliveryIds = res.data.shieldDeliveryIds
             ? res.data.shieldDeliveryIds.split(",")
             : [];
-          this.list[0].time = res.data.autodeliveryOrderTime / 60;
-          this.list[1].time = res.data.bookingAutodeliveryOrderTime / 60;
-          this.list = this.list.map((v) => {
-            v.value = res.data[v.field];
-            return v;
-          });
-          this.list2 = this.list2.map((v) => {
-            v.value = res.data[v.field];
-            return v;
-          });
-          this.list3 = this.list3.map((v) => {
-            v.value = res.data[v.field];
-            return v;
-          });
         } else {
           this.$message({
             type: "error",
@@ -273,27 +149,6 @@ export default {
       });
     },
   },
-  // 生命周期 - 创建完成(可以访问当前this实例)
-  created() {
-    this.getDelivery();
-    this.getConfig();
-  },
-  // 生命周期 - 挂载完成(可以访问DOM元素)
-  mounted() {},
-  // 生命周期 - 创建之前
-  beforeCreate() {},
-  // 生命周期 - 挂载之前
-  beforeMount() {},
-  // 生命周期 - 更新之前
-  beforeUpdate() {},
-  // 生命周期 - 更新之后
-  updated() {},
-  // 生命周期 - 销毁之前
-  beforeDestroy() {},
-  // 生命周期 - 销毁完成
-  destroyed() {},
-  // 如果页面有keep-alive缓存功能,这个函数会触发
-  activated() {},
 };
 </script>
 
@@ -351,7 +206,7 @@ export default {
         .left-top {
           display: flex;
           align-items: center;
-          .set {
+          .set-tips {
             font-weight: 400;
             color: #fc7200;
             margin-left: 10px;
@@ -391,6 +246,11 @@ export default {
         .con1 {
           color: #999999;
         }
+        .img {
+          width: 20px;
+          height: 20px;
+          cursor: pointer;
+        }
       }
     }
   }

+ 183 - 138
src/components/settingComponents/print/greetingCardPrinter.vue

@@ -78,8 +78,8 @@
               </div>
               <div class="setting-params">
                 <div class="card-title">内容位置</div>
-                <el-select v-model="params.textAlign">
-                  <el-option v-for="item in textAlignList" :key="item.value" :value="item.value" :label="item.name">
+                <el-select v-model="params.jpAutoAlign">
+                  <el-option v-for="item in jpAutoAlignList" :key="item.value" :value="item.value" :label="item.name">
                     <div>{{ item.name }}</div>
                   </el-option>
                 </el-select>
@@ -173,6 +173,7 @@ import {
   getCloudDevice,
   deviceAdd,
   cloudPrint,
+  cloudPrintTest,
   shopDeviceList,
   deviceDelete,
   cloudConfigList,
@@ -215,7 +216,7 @@ export default {
         fontFamily: "FangZhengKaiTi",
         shopIdList: [0],
         sizeType: 9, // 纸张尺寸
-        textAlign: 5,
+        jpAutoAlign: "z5",
       },
       printerList: [],
       shopList: [],
@@ -277,42 +278,42 @@ export default {
           value: 2,
         },
       ],
-      textAlignList: [
+      jpAutoAlignList: [
         {
           name: "左上",
-          value: 1,
+          value: "z1",
         },
         {
           name: "左中",
-          value: 2,
+          value: "z2",
         },
         // {
         //   name: "左下",
-        //   value: 3,
+        //   value: 'z3',
         // },
         {
           name: "中上",
-          value: 4,
+          value: "z4",
         },
         {
           name: "中",
-          value: 5,
+          value: "z5",
         },
         // {
         //   name: "中下",
-        //   value: 6,
+        //   value: 'z6',
         // },
         {
           name: "右上",
-          value: 7,
+          value: "z7",
         },
         {
           name: "右中",
-          value: 8,
+          value: "z8",
         },
         // {
         //   name: "右下",
-        //   value: 9,
+        //   value: 'z9',
         // },
       ],
       dialogVisible: false,
@@ -321,41 +322,70 @@ export default {
   // 监听属性 类似于data概念
   computed: {
     cardHtml() {
-      return `<style type="text/css">
-                @font-face {
-                  font-family: ${this.params.fontFamily};
-                  src: url("https://h5.liebaoai.cn/font/${
-                    this.params.fontFamily
-                  }.woff2") format('woff2'),
-                        url("https://h5.liebaoai.cn/font/${
-                          this.params.fontFamily
-                        }.woff") format('woff'),
-                        url("https://h5.liebaoai.cn/font/${
-                          this.params.fontFamily
-                        }.ttf") format('truetype');
-                  font-weight: normal;
-                  font-style: normal;
-                }
-                .card-left {
-                  position: relative;
-                  height: ${this.params.cardHeight}mm;
-                  width: ${this.params.cardWidth}mm;
-                  display:flex;
-                  ${this.contentStyle(this.params.direction)[0]}
-                }
-                .card-con {
-                  margin-top: ${this.directionPadding("top")}mm;
-                  margin-right: ${this.directionPadding("right")}mm;
-                  margin-bottom: ${this.directionPadding("bottom")}mm;
-                  margin-left: ${this.directionPadding("left")}mm;
-                  font-size:35px;
-                  font-family: ${this.params.fontFamily};
-                  ${this.contentStyle(this.params.direction)[1]}
-                }
-              </style>
-              <div class="card-left">
-                <div class="card-con">亲爱的,生日快乐!</div>
-              </div>`;
+      return `<!DOCTYPE html>
+              <html lang="en">
+              <head>
+                  <meta charset="UTF-8">
+                  <title>提交三方打印任务html</title>
+                  <style>
+                      @font-face {
+                          font-family: ${this.params.fontFamily};
+                          src: url("https://h5.liebaoai.cn/font/${
+                            this.params.fontFamily
+                          }.woff2") format('woff2'),
+                              url("https://h5.liebaoai.cn/font/${
+                                this.params.fontFamily
+                              }.woff") format('woff'),
+                              url("https://h5.liebaoai.cn/font/${
+                                this.params.fontFamily
+                              }.ttf") format('truetype');
+                          font-weight: normal;
+                          font-style: normal;
+                      }
+
+                      body {
+                          margin: 0;
+                          box-sizing: border-box;
+                      }
+
+                      .page {
+                          height: ${this.params.cardHeight}mm;
+                          width: ${this.params.cardWidth}mm;
+                          position: relative;
+                          box-sizing: border-box;
+                      }
+
+                      .box {
+                          position: absolute;
+                          height: ${this.params.cardHeight}mm;
+                          width: ${this.params.cardWidth}mm;
+                          top: 0;
+                          left: 0;
+                          display:flex;
+                          ${this.contentStyle(this.params.direction)[0]}
+                      }
+
+                      .card-con {
+                          margin-top: ${this.directionPadding("top")}mm;
+                          margin-right: ${this.directionPadding("right")}mm;
+                          margin-bottom: ${this.directionPadding("bottom")}mm;
+                          margin-left: ${this.directionPadding("left")}mm;
+                          font-size:35px;
+                          font-family: ${this.params.fontFamily};
+                          ${this.contentStyle(this.params.direction)[1]}
+                      }
+                  </style>
+              </head>
+              <body>
+                  <div class="page">
+                      <div class="box">
+                          <div class="card-con">
+                              亲爱的,生日快乐!
+                          </div>
+                      </div>
+                  </div>
+              </body>
+              </html>`;
     },
   },
   // 监控data中的数据变化
@@ -464,16 +494,6 @@ export default {
     },
     ...mapMutations(["SET_USERINFO"]),
     saveCard() {
-      // if (this.params.sizeType === 0) {
-      //   if (this.params.cardWidth < 195) {
-      //     this.$refs.cardWidth.focus();
-      //     return this.$message.error(`自定义纸张宽度不可小于195毫米!`);
-      //   }
-      //   if (this.params.cardHeight < 145) {
-      //     this.$refs.cardHeight.focus();
-      //     return this.$message.error(`自定义纸张高度不可小于145毫米!`);
-      //   }
-      // }
       cloudConfigAdd(this.params).then((res) => {
         console.log("添加贺卡配置信息", res);
         if (res.code === 200) {
@@ -488,72 +508,97 @@ export default {
       });
     },
     printTest() {
-      let html = `<style type="text/css">
-                @font-face {
-                  font-family: ${this.params.fontFamily};
-                  src:  url("https://h5.liebaoai.cn/font/${
-                    this.params.fontFamily
-                  }.woff2") format('woff2'),
-                        url("https://h5.liebaoai.cn/font/${
-                          this.params.fontFamily
-                        }.woff") format('woff'),
-                        url("https://h5.liebaoai.cn/font/${
-                          this.params.fontFamily
-                        }.ttf") format('truetype');
-                  font-weight: normal;
-                  font-style: normal;
-                }
-                .card-a4 {
-                  display: flex;
-                  justify-content: ${
-                    this.params.htmlContentAlign ? "center" : "flex-start"
-                  };
-                  align-items: ${
-                    this.params.direction === 2 ? "center" : "flex-start"
-                  };
-                  height: 297mm;
-                  width: 210mm;
-                }
-                .card-left {
-                  margin-top: -8mm;
-                  position: relative;
-                  height: ${
-                    this.params.direction === 1
-                      ? this.params.cardHeight
-                      : this.params.cardWidth
-                  }mm;
-                  width: ${
-                    this.params.direction === 1
-                      ? this.params.cardWidth
-                      : this.params.cardHeight
-                  }mm;
-                  display:flex;
-                  ${this.contentStyle(1)[0]}
-                }
-                .card-con {
-                  margin-top: ${this.params.paddingTop}mm;
-                  margin-right: ${this.params.paddingRight}mm;
-                  margin-bottom: ${this.params.paddingBottom}mm;
-                  margin-left: ${this.params.paddingLeft}mm;
-                  font-size:35px;
-                  font-family: ${this.params.fontFamily};
-                  ${this.contentStyle(1)[1]}
-                }
-              </style>
-              <div class="card-a4">
-                <div class="card-left">
-                  <div class="card-con">
-                    亲爱的,生日快乐!
+      let html = `<!DOCTYPE html>
+              <html lang="en">
+              <head>
+                  <meta charset="UTF-8">
+                  <title>提交三方打印任务html</title>
+                  <style>
+                      @font-face {
+                          font-family: ${this.params.fontFamily};
+                          src: url("https://h5.liebaoai.cn/font/${
+                            this.params.fontFamily
+                          }.woff2") format('woff2'),
+                              url("https://h5.liebaoai.cn/font/${
+                                this.params.fontFamily
+                              }.woff") format('woff'),
+                              url("https://h5.liebaoai.cn/font/${
+                                this.params.fontFamily
+                              }.ttf") format('truetype');
+                          font-weight: normal;
+                          font-style: normal;
+                      }
+
+                      body {
+                          margin: 0;
+                          box-sizing: border-box;
+                      }
+
+                      .page {
+                          height: ${
+                            this.params.direction === 1
+                              ? this.params.cardHeight
+                              : this.params.cardWidth
+                          }mm;
+                          width: ${
+                            this.params.direction === 1
+                              ? this.params.cardWidth
+                              : this.params.cardHeight
+                          }mm;
+                          position: relative;
+                          box-sizing: border-box;
+                      }
+
+                      .box {
+                          position: absolute;
+                          height: ${
+                            this.params.direction === 1
+                              ? this.params.cardHeight - 20
+                              : this.params.cardWidth - 10
+                          }mm;
+                          width: ${
+                            this.params.direction === 1
+                              ? this.params.cardWidth - 5
+                              : this.params.cardHeight - 10
+                          }mm;
+                          top: ${this.params.direction === 1 ? 2 : 8}mm;
+                          left: 0;
+                          display:flex;
+                          ${this.contentStyle(1)[0]}
+                      }
+
+                      .card-con {
+                          margin-top: ${
+                            this.params.direction === 1 &&
+                            ["z1", "z4", "z7"].includes(this.params.jpAutoAlign)
+                              ? this.params.paddingTop - 10
+                              : this.params.paddingTop
+                          }mm;
+                          margin-right: ${this.params.paddingRight}mm;
+                          margin-bottom: ${this.params.paddingBottom}mm;
+                          margin-left: ${this.params.paddingLeft}mm;
+                          font-size:35px;
+                          font-family: ${this.params.fontFamily};
+                          ${this.contentStyle(1)[1]}
+                      }
+                  </style>
+              </head>
+              <body>
+                  <div class="page">
+                      <div class="box">
+                          <div class="card-con">
+                              亲爱的,生日快乐!
+                          </div>
+                      </div>
                   </div>
-                </div>
-              </div>`;
+              </body>
+              </html>`;
 
       let params = {
-        orderId: 0,
         shopId: this.params.shopIdList[0],
         jobFile: html,
       };
-      cloudPrint(params).then((res) => {
+      cloudPrintTest(params).then((res) => {
         console.log("云盒打印信息", res);
         if (res.code === 200) {
           this.$message({
@@ -748,72 +793,72 @@ export default {
       let style = ``;
       let transform = ``;
       if (direction === 1) {
-        switch (this.params.textAlign) {
-          case 1:
+        switch (this.params.jpAutoAlign) {
+          case "z1":
             style = `justify-content:flex-start;align-items:flex-start;`;
             break;
-          case 2:
+          case "z2":
             style = `justify-content:flex-start;align-items:center;`;
             break;
-          case 3:
+          case "z3":
             style = `justify-content:flex-start;align-items:flex-end;`;
             break;
-          case 4:
+          case "z4":
             style = `justify-content:center;align-items:flex-start;`;
             break;
-          case 5:
+          case "z5":
             style = `justify-content:center;align-items:center;`;
             break;
-          case 6:
+          case "z6":
             style = `justify-content:center;align-items:flex-end;`;
             break;
-          case 7:
+          case "z7":
             style = `justify-content:flex-end;align-items:flex-start;`;
             break;
-          case 8:
+          case "z8":
             style = `justify-content:flex-end;align-items:center;`;
             break;
-          case 9:
+          case "z9":
             style = `justify-content:flex-end;align-items:flex-end;`;
             break;
           default:
             break;
         }
       } else {
-        switch (this.params.textAlign) {
-          case 1:
+        switch (this.params.jpAutoAlign) {
+          case "z1":
             style = `justify-content:flex-end;align-items:flex-start;`;
             transform = `transform: translateX(100%) rotate(90deg);transform-origin: left top;`;
             break;
-          case 2:
+          case "z2":
             style = `justify-content:center;align-items:flex-start;`;
             transform = `transform: translateX(50%) translateY(-50%) rotate(90deg);transform-origin: left;`;
             break;
-          case 3:
+          case "z3":
             style = `justify-content:flex-start;align-items:flex-start;`;
             transform = `transform: translateY(-100%) rotate(90deg);transform-origin: left bottom;`;
             break;
-          case 4:
+          case "z4":
             style = `justify-content:flex-end;align-items:center;`;
             transform = `transform: translateX(50%) rotate(90deg);transform-origin: center top;`;
             break;
-          case 5:
+          case "z5":
             style = `justify-content:center;align-items:center;`;
             transform = `transform: rotate(90deg);`;
             break;
-          case 6:
+          case "z6":
             style = `justify-content:flex-start;align-items:center;`;
             transform = `transform: translateX(-50%) rotate(90deg);`;
             break;
-          case 7:
+          case "z7":
             style = `justify-content:flex-end;align-items:flex-end;`;
             transform = `transform: translatey(100%) rotate(90deg);transform-origin: right top;`;
             break;
-          case 8:
+          case "z8":
             style = `justify-content:center;align-items:flex-end;`;
             transform = `transform: translateX(-50%) translateY(50%) rotate(90deg);transform-origin:right;`;
             break;
-          case 9:
+          case "z9":
             style = `justify-content:flex-start;align-items:flex-end;`;
             transform = `transform: translateX(-100%) rotate(90deg);transform-origin:right bottom;`;
             break;

+ 0 - 39
src/components/settingComponents/system.vue

@@ -1,39 +0,0 @@
-<template>
-  <div>这是系统设置</div>
-</template>
-
-<script>
-export default {
-  name: "system",
-  data() {
-    return {};
-  },
-  // 监听属性 类似于data概念
-  computed: {},
-  // 监控data中的数据变化
-  watch: {},
-  // 方法集合
-  methods: {},
-  // 生命周期 - 创建完成(可以访问当前this实例)
-  created() {},
-  // 生命周期 - 挂载完成(可以访问DOM元素)
-  mounted() {},
-  // 生命周期 - 创建之前
-  beforeCreate() {},
-  // 生命周期 - 挂载之前
-  beforeMount() {},
-  // 生命周期 - 更新之前
-  beforeUpdate() {},
-  // 生命周期 - 更新之后
-  updated() {},
-  // 生命周期 - 销毁之前
-  beforeDestroy() {},
-  // 生命周期 - 销毁完成
-  destroyed() {},
-  // 如果页面有keep-alive缓存功能,这个函数会触发
-  activated() {},
-};
-</script>
-
-<style lang="scss" scoped  type="text/css">
-</style>

+ 618 - 0
src/components/settingComponents/systemSetting.vue

@@ -0,0 +1,618 @@
+<template>
+  <div class="delivery-setting">
+
+    <div class="model">
+      <div class="title">自动发单</div>
+      <div class="list">
+        <div class="item" v-for="(v,i) in list" :key=i>
+          <div class="left">
+            <div class="left-top">
+              <div class="name">{{v.name}}</div>
+              <div @click="setTime(v,i)" class="set-tips">{{v.setContent}}</div>
+            </div>
+            <div class="left-bot">{{v.tips}}</div>
+          </div>
+          <div class="right">
+            <template v-if="v.value">
+              <div v-if="i===1" :class="['time', v.value ? '' : 'time1']">顾客下单{{v.time}}分钟后</div>
+              <div v-if="i===2" :class="['time', v.value ? '' : 'time1']">期望送达前{{v.time}}分钟</div>
+            </template>
+            <el-switch @change="change(v)" v-model="v.value" :active-value="1" :inactive-value="0" active-color="#FC7200" inactive-color="#999" />
+          </div>
+        </div>
+      </div>
+    </div>
+    <div class="model">
+      <div class="title">配送设置</div>
+      <div class="list">
+        <div class="item" v-for="(v,i) in list3" :key=i>
+          <div class="left">
+            <div class="left-top">
+              <div class="name">{{v.name}}</div>
+              <div @click="setTime(v,i)" class="set-tips">{{v.setContent}}</div>
+            </div>
+            <div class="left-bot">{{v.tips}}</div>
+          </div>
+          <div class="right">
+            <template v-if="v.value">
+              <div v-if="i===1" :class="['time', v.value ? '' : 'time1']">商家发起自配{{v.time}}分钟后</div>
+              <div v-if="i===2" :class="['time', v.value ? '' : 'time1']">最便宜运力优先发单{{v.time}}分钟</div>
+            </template>
+            <el-switch @change="change(v)" v-model="v.value" :active-value="1" :inactive-value="0" active-color="#FC7200" inactive-color="#999" />
+          </div>
+        </div>
+      </div>
+    </div>
+    <div class="model">
+      <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">
+              <div class="name">{{v.name}}</div>
+            </div>
+            <div class="left-bot">{{v.tips}}</div>
+          </div>
+          <div class="right">
+            <el-switch @change="change(v)" v-model="v.value" :active-value="1" :inactive-value="0" active-color="#FC7200" inactive-color="#999" />
+          </div>
+        </div>
+      </div>
+    </div>
+    <el-dialog :title="title" @close="centerDialogVisible=false" :visible.sync="centerDialogVisible" width="400px" center>
+      <el-form label-width="120px">
+        <el-form-item :label="textLabel">
+          <el-input size="small" class="auto-time" v-model="time" clearable>
+            <template slot="append">分钟</template>
+          </el-input>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button size="medium" @click="centerDialogVisible=false">取 消</el-button>
+        <el-button size='medium' type="primary" @click="confirm">确 定</el-button>
+      </span>
+    </el-dialog>
+
+    <el-dialog title="设置时长" @close="closeLittleMoneyTime" :visible.sync="centerDialogVisible1" width="600px" center>
+      <div class="time-list">
+        <div class="time">
+          <div class="title">
+            <div class="title-left">价格最优</div>
+            <div class="tips">(设置的时间内先发最便宜的运力,设置上限5分钟)</div>
+          </div>
+          <div class="list">
+            <div @click="chooseTime(0,v)" class="item" :class="[littleMoneyTime === v ? 'active-item' : '']" v-for="(v,i) in timeList" :key="i">{{v}}</div>
+          </div>
+        </div>
+        <div class="time">
+          <div class="title">
+            <div class="title-left">价格次优</div>
+            <el-tooltip :content="content" placement="top" :popper-class="ruleTips">
+              <img class="img" src="../../../static/image/icon-help.png" alt="">
+            </el-tooltip>
+          </div>
+          <div class="list">
+            <div @click="chooseTime(1,v)" class="item" :class="[littleMoneyTime1 === v ? 'active-item' : '']" v-for="(v,i) in timeList1" :key="i">{{v}}</div>
+          </div>
+        </div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button size="medium" @click="closeLittleMoneyTime">取 消</el-button>
+        <el-button size='medium' type="primary" @click="confirm1">确 定</el-button>
+      </span>
+    </el-dialog>
+    <el-dialog title="设置自动加小费" @close="closeLittleMoneyTime" :visible.sync="centerDialogVisible2" width="600px" center>
+      <div class="time-list">
+        <div class="time">
+          <div class="title">
+            <div class="title-left">小费金额</div>
+          </div>
+          <el-input size="small" class="auto-time" v-model="tipAmount" clearable>
+            <template slot="append">元</template>
+          </el-input>
+        </div>
+        <div class="time">
+          <div class="title">
+            <div class="title-left">触发时间</div>
+            <div class="tips">(下单后多长时间无骑手接单开始自动加小费)</div>
+          </div>
+          <el-input size="small" class="auto-time" v-model="addPriceTime" clearable>
+            <template slot="append">分钟</template>
+          </el-input>
+        </div>
+        <div class="time">
+          <div class="title">
+            <div class="title-left">选择运力</div>
+            <div class="tips">(给哪些运力自动加小费)</div>
+          </div>
+          <el-select v-model="tipRemark" placeholder="请选择运力">
+            <el-option v-for="(item,i) in options" :key="i" :label="item" :value="i">
+            </el-option>
+          </el-select>
+        </div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button size="medium" @click="closeLittleMoneyTime">取 消</el-button>
+        <el-button size='medium' type="primary" @click="confirm2">确 定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { getConfig, updateConfig, syncFoodImg } from "../../api/setting.js";
+export default {
+  name: "systemSetting",
+  data() {
+    return {
+      list: [
+        {
+          name: "自动接单",
+          setContent: "",
+          value: 1,
+          field: "openAutoorder",
+          tips: "非冲突绑定模式,不支持自动接单",
+        },
+        {
+          name: "自动发单",
+          setContent: "设置时长",
+          value: 1,
+          field: "openAutodelivery",
+          tips: "非冲突绑定模式,不支持自动发单",
+          time: 0,
+        },
+        {
+          name: "预约单自动发单",
+          setContent: "设置时长",
+          value: 1,
+          field: "openBookingAutodelivery",
+          tips: "设置的时长为预约单期望送达前多长时间自动呼叫配送",
+          time: 0,
+        },
+        {
+          name: "自动加小费",
+          setContent: "设置",
+          value: 1,
+          field: "openTipSwitch",
+          tips: "",
+          time: 0,
+        },
+      ],
+      list2: [
+        {
+          name: "订单详情显示出商品图片",
+          value: 1,
+          field: "showFoodImg",
+          tips: "在订单详情的商品显示图片,方便制作时确认",
+        },
+        {
+          name: "同步订单商品给骑手",
+          value: 1,
+          field: "syncGoodsDetailToDelivery",
+          tips: "关闭后骑手将看不到商品详情",
+        },
+      ],
+      list3: [
+        {
+          name: "系统取消订单重发",
+          setContent: "",
+          value: 1,
+          field: "againOrder",
+          tips: "开启后长时间无骑手接单的订单系统取消后进行再次呼叫骑手",
+        },
+        {
+          name: "商家配送自动完成",
+          setContent: "设置时长",
+          value: 1,
+          field: "selfDeliveryAutoFinish",
+          tips: "商家自己去送货后多长时间自动完成",
+          time: 0,
+        },
+        {
+          name: "省钱模式",
+          setContent: "设置时长",
+          value: 1,
+          field: "littleMoney",
+          tips: "开启后将为您优先呼叫费用最低的运力",
+        },
+        {
+          name: "达达四轮车",
+          setContent: "",
+          value: 1,
+          field: "showDadaCar",
+          tips: "开启后支持达达四轮车的城市将可以使用达达四轮车运力",
+        },
+      ],
+      centerDialogVisible: false,
+      centerDialogVisible1: false,
+      centerDialogVisible2: false,
+      curIndex: 0,
+      time: 0,
+      title: "",
+      setField: "",
+      openField: "",
+      openValue: 0,
+      timeList: [1, 3, 5],
+      timeList1: [1, 2, 3],
+      textLabel: "",
+      littleMoneyTime: 0,
+      littleMoneyTime1: 0,
+      tipAmount: 0,
+      addPriceTime: 0,
+      tipRemark: 0,
+      options: ["全部运力", "运力价格最优惠", "运力价格优惠前三"],
+      ruleTips: "rule-tips",
+      content:
+        "例如:价格最优惠的运力设置呼叫时间5分钟,价格次优惠的运力设置呼叫3分钟,那么价格最优惠的运力总计会呼叫8分钟,价格次优惠的运力呼叫3分钟。",
+    };
+  },
+  // 监听属性 类似于data概念
+  computed: {},
+  // 监控data中的数据变化
+  watch: {},
+  // 生命周期 - 创建完成(可以访问当前this实例)
+  created() {
+    this.getConfig();
+  },
+  // 生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {},
+  // 生命周期 - 创建之前
+  beforeCreate() {},
+  // 生命周期 - 挂载之前
+  beforeMount() {},
+  // 生命周期 - 更新之前
+  beforeUpdate() {},
+  // 生命周期 - 更新之后
+  updated() {},
+  // 生命周期 - 销毁之前
+  beforeDestroy() {},
+  // 生命周期 - 销毁完成
+  destroyed() {},
+  // 如果页面有keep-alive缓存功能,这个函数会触发
+  activated() {},
+  // 方法集合
+  methods: {
+    chooseTime(flag, time) {
+      flag === 0
+        ? (this.littleMoneyTime = time)
+        : (this.littleMoneyTime1 = time);
+    },
+    closeLittleMoneyTime() {
+      this.centerDialogVisible1 = false;
+      this.centerDialogVisible2 = false;
+      this.getConfig();
+    },
+    confirm1() {
+      let littleMoneyTime = `${this.littleMoneyTime}${
+        this.littleMoneyTime1 ? "," + this.littleMoneyTime1 : ""
+      }`;
+      let data = { littleMoneyTime };
+      this.updateConfig(data);
+    },
+    confirm2() {
+      if (this.tipAmount <= 1) {
+        return this.$message.error("加小费金额必须为正整数!");
+      }
+      if (this.addPriceTime <= 1) {
+        return this.$message.error("加小费触发时间必须为正整数!");
+      }
+      let data = {
+        tipAmount: this.tipAmount,
+        addPriceTime: this.addPriceTime,
+        tipRemark: this.tipRemark,
+      };
+      this.updateConfig(data);
+    },
+    confirm() {
+      let data = {};
+      if (this.time <= 1) {
+        return this.$message.error("时间必须为正整数!");
+      }
+      switch (this.setField) {
+        case "openAutodelivery":
+          data = { autodeliveryOrderTime: this.time * 60 };
+          break;
+        case "openBookingAutodelivery":
+          data = { bookingAutodeliveryOrderTime: this.time * 60 };
+          break;
+        case "selfDeliveryAutoFinish":
+          data = { selfDeliveryAutoFinishMinute: this.time };
+          break;
+        default:
+          break;
+      }
+
+      this.updateConfig(data);
+    },
+    setTextLabel() {
+      switch (this.setField) {
+        case "openAutodelivery":
+          this.textLabel = `顾客下单后`;
+          break;
+        case "openBookingAutodelivery":
+          this.textLabel = `期望送达前`;
+          break;
+        case "selfDeliveryAutoFinish":
+          this.textLabel = `商家发起自配后`;
+          break;
+        default:
+          break;
+      }
+    },
+    setTime(v, i) {
+      if (!v.value) {
+        return this.$message({
+          message: "请开启后再设置时间!",
+          type: "warning",
+        });
+      }
+      this.setField = v.field;
+      if (v.field === "littleMoney") {
+        this.centerDialogVisible1 = true;
+        return;
+      }
+      if (v.field === "openTipSwitch") {
+        this.centerDialogVisible2 = true;
+        return;
+      }
+      this.setTextLabel();
+      this.title = v.name + "时长设置";
+      this.curIndex = i;
+      this.time = v.time;
+      this.centerDialogVisible = true;
+    },
+    change(e) {
+      this.openField = e.field;
+      this.openValue = e.value;
+      let data = { [e.field]: e.value };
+      this.updateConfig(data);
+    },
+    getConfig() {
+      getConfig().then((res) => {
+        if (res.code === 200) {
+          this.list[1].time = res.data.autodeliveryOrderTime / 60;
+          this.list[2].time = res.data.bookingAutodeliveryOrderTime / 60;
+          this.list = this.list.map((v) => {
+            v.value = res.data[v.field];
+            return v;
+          });
+          this.list2 = this.list2.map((v) => {
+            v.value = res.data[v.field];
+            return v;
+          });
+          this.list3[1].time = res.data.selfDeliveryAutoFinishMinute;
+          let littleMoneyTime = res.data.littleMoneyTime.split(",");
+          this.littleMoneyTime = Number(littleMoneyTime[0]);
+          this.littleMoneyTime1 = Number(littleMoneyTime[1]);
+          this.list3[2].time = this.littleMoneyTime;
+          this.list3 = this.list3.map((v) => {
+            v.value = res.data[v.field];
+            return v;
+          });
+          this.tipAmount = res.data.tipAmount;
+          this.addPriceTime = res.data.addPriceTime;
+          this.tipRemark = Number(res.data.tipRemark);
+        } else {
+          this.$message({
+            type: "error",
+            message: res.msg,
+          });
+        }
+        this.centerDialogVisible = false;
+      });
+    },
+    updateConfig(data) {
+      updateConfig(data).then((res) => {
+        if (res.code === 200) {
+          this.centerDialogVisible1 = false;
+          this.centerDialogVisible2 = false;
+          this.showSetting();
+        } else {
+          this.$message({
+            type: "error",
+            message: res.msg,
+          });
+        }
+        this.getConfig();
+      });
+    },
+    showSetting() {
+      switch (this.openField) {
+        case "littleMoney":
+          this.openValue ? (this.centerDialogVisible1 = true) : "";
+          this.openValue = 0;
+          break;
+        case "openTipSwitch":
+          this.openValue ? (this.centerDialogVisible2 = true) : "";
+          this.openValue = 0;
+          break;
+        default:
+          break;
+      }
+    },
+    syncFoodImg() {
+      syncFoodImg().then((res) => {
+        if (res.code === 200) {
+          this.$message({
+            type: "success",
+            message: "正在同步!",
+          });
+        } else {
+          this.$message({
+            type: "error",
+            message: res.msg,
+          });
+        }
+      });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped  type="text/css">
+/deep/ .el-button--default:hover {
+  background-color: rgba(252, 114, 0, 0.2);
+  border-color: rgba(252, 114, 0, 0.2);
+  color: #fc7200;
+}
+/deep/ .el-button--primary {
+  background-color: #fc7200;
+  border-color: #fc7200;
+}
+
+.model {
+  .title {
+    position: relative;
+    font-size: 16px;
+    font-weight: bold;
+    line-height: 22px;
+    color: #333333;
+    padding-left: 10px;
+    margin-top: 24px;
+    .tips {
+      font-size: 14px;
+      font-weight: 400;
+      line-height: 22px;
+      color: #999999;
+    }
+  }
+  .title::before {
+    width: 3px;
+    height: 16px;
+    background: #fc7200;
+    border-radius: 2px;
+    content: "";
+    position: absolute;
+    top: 2px;
+    left: 0;
+  }
+  .list {
+    .item {
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      background: #ffffff;
+      margin-top: 10px;
+      padding: 16px 20px;
+      .left {
+        display: flex;
+        flex-direction: column;
+        font-size: 14px;
+        font-weight: bold;
+        line-height: 20px;
+        color: #000000;
+        .left-top {
+          display: flex;
+          align-items: center;
+          .set-tips {
+            font-weight: 400;
+            color: #fc7200;
+            margin-left: 10px;
+            cursor: pointer;
+          }
+        }
+        .left-bot {
+          margin-top: 2px;
+          font-size: 12px;
+          font-weight: 400;
+          line-height: 17px;
+          color: #999999;
+        }
+      }
+      .right {
+        display: flex;
+        align-items: center;
+        .time {
+          font-size: 12px;
+          font-family: PingFang SC;
+          font-weight: 400;
+          line-height: 17px;
+          color: #333333;
+          margin-right: 20px;
+        }
+        .time1 {
+          color: #999999;
+        }
+        .con {
+          font-size: 14px;
+          font-weight: 400;
+          line-height: 20px;
+          color: #fc7200;
+          padding-left: 20px;
+          cursor: pointer;
+        }
+        .con1 {
+          color: #999999;
+        }
+        .img {
+          width: 20px;
+          height: 20px;
+          cursor: pointer;
+        }
+      }
+    }
+  }
+}
+
+.time-list {
+  .time {
+    margin-bottom: 30px;
+    .title {
+      display: flex;
+      align-items: center;
+      margin-bottom: 10px;
+      .title-left {
+        font-size: 15px;
+        font-weight: bold;
+      }
+      .tips {
+        font-size: 12px;
+        color: #999;
+      }
+      .img {
+        width: 20px;
+        height: 20px;
+        margin-left: 5px;
+        cursor: pointer;
+      }
+    }
+    .list {
+      display: flex;
+      .item {
+        width: 50px;
+        height: 25px;
+        border: 1px solid #999;
+        color: #999;
+        margin-right: 30px;
+        border-radius: 5px;
+        text-align: center;
+        line-height: 25px;
+        cursor: pointer;
+      }
+      .active-item {
+        color: #fff !important;
+        background: #fc7200;
+        border-color: #fc7200;
+      }
+    }
+  }
+}
+</style>
+<style>
+.rule-tips {
+  width: 300px !important;
+  font-size: 14px !important;
+  font-weight: bold;
+}
+</style>

+ 6 - 14
src/components/settingComponents/waimai.vue

@@ -25,33 +25,25 @@
 </template>
 
 <script>
-import printerList from "./print/printerList.vue";
-import a4Printer from "./print/a4Printer.vue";
-import greetingCardPrinter from "./print/greetingCardPrinter.vue";
-import usbPrinter from "../shopCompoents/bindUsbPrint.vue";
-import pictureManagement from "./pictureManagement.vue";
 import addressManagement from "./addressManagement.vue";
+import systemSetting from "./systemSetting.vue";
 import deliverySetting from "./deliverySetting.vue";
 import voiceSetting from "./voiceSetting.vue";
 export default {
   name: "waimai",
   components: {
-    printerList,
-    usbPrinter,
-    a4Printer,
-    greetingCardPrinter,
-    pictureManagement,
+    systemSetting,
     addressManagement,
     deliverySetting,
     voiceSetting,
   },
   data() {
     return {
-      activeName: "deliverySetting",
+      activeName: "systemSetting",
       tabList: [
-        { name: "配送设置", index: 0, activeName: "deliverySetting" },
-        { name: "语音设置", index: 1, activeName: "voiceSetting" },
-        { name: "商品管理", index: 2, activeName: "pictureManagement" },
+        { name: "基础设置", index: 0, activeName: "systemSetting" },
+        { name: "运力设置", index: 1, activeName: "deliverySetting" },
+        { name: "语音设置", index: 2, activeName: "voiceSetting" },
         { name: "常用地址", index: 3, activeName: "addressManagement" },
       ],
       tabNum: 0,

+ 1 - 1
src/router/index.js

@@ -96,7 +96,7 @@ const router = new Router({
           path: '/set/system',
           name: 'system',
           title: '系统设置',
-          component: () => import('../components/settingComponents/system.vue')
+          component: () => import('../components/settingComponents/systemSetting.vue')
         },
         {
           path: '/help/commonProblem',

BIN
static/image/icon-help.png