Funny пре 3 година
родитељ
комит
317a5827e3
36 измењених фајлова са 923 додато и 393 уклоњено
  1. 11 0
      src/api/help.js
  2. 4 0
      src/api/setting.js
  3. 184 156
      src/common/sider.vue
  4. 91 0
      src/components/about.vue
  5. 66 14
      src/components/accountCompoents/consumption.vue
  6. 61 38
      src/components/accountCompoents/recharge.vue
  7. 8 0
      src/components/accountCompoents/wallet.vue
  8. 4 4
      src/components/settingComponents/addressManagement.vue
  9. 129 0
      src/components/help.vue
  10. 53 7
      src/components/manualCreate.vue
  11. 7 18
      src/components/merchantAdd.vue
  12. 2 2
      src/components/orderComponents/orderAMap.vue
  13. 1 1
      src/components/orderComponents/orderList.vue
  14. 8 0
      src/components/orderSearch.vue
  15. 118 0
      src/components/pictureManagement.vue
  16. 0 3
      src/components/set.vue
  17. 13 9
      src/components/settingComponents/voiceSetting.vue
  18. 53 19
      src/components/shopCompoents/bindDelivery.vue
  19. 9 3
      src/components/shopCompoents/bindPrinter.vue
  20. 12 14
      src/components/shopCompoents/bindTakeOut.vue
  21. 15 89
      src/components/shopCompoents/printerAdd.vue
  22. 11 4
      src/components/shopCompoents/shopList.vue
  23. 8 0
      src/components/shopInfo.vue
  24. 25 1
      src/router/index.js
  25. 19 5
      src/store/index.js
  26. 1 2
      src/views/home.vue
  27. 10 4
      src/views/login.vue
  28. BIN
      static/image/about-bg.png
  29. BIN
      static/image/about-icon.png
  30. BIN
      static/image/download.png
  31. BIN
      static/image/help-icon.png
  32. BIN
      static/image/order-icon.png
  33. BIN
      static/image/pc-icon.png
  34. BIN
      static/image/setting-icon.png
  35. BIN
      static/image/shop-icon.png
  36. BIN
      static/image/update.png

+ 11 - 0
src/api/help.js

@@ -0,0 +1,11 @@
+import { get, post, postJson } from './http.js';
+
+// 帮助中心栏目
+export const helpList = (params) => {
+  return get('app/common/help', params)
+}
+
+//帮助中心内容
+export const helpDetail = (params) => {
+  return get('app/common/help_detail', params)
+}

+ 4 - 0
src/api/setting.js

@@ -50,3 +50,7 @@ export const getAddressDetail = (params) => {
 export const defaultAddress = (params) => {
   return post('app/address/default', params)
 }
+// 同步外卖平台图片
+export const syncFoodImg = (params) => {
+  return get('app/waimai/syncFoodImg', params)
+}

+ 184 - 156
src/common/sider.vue

@@ -1,170 +1,198 @@
 <template>
-    <el-aside style="width: 254px;">
-      <div class="sidebar">
-        <div class="side-logo">
-          <img @click="$router.push({path:'/'})" src="/static/image/logo.png" class="logo" />
-        </div>
-        <el-menu class="sidebar-el-menu" :default-active="$route.path" :collapse="collapse" background-color="#00152A"
-          text-color="#bfcbd9" active-text-color="#20a0ff" router>
-          <template v-for="item in items">
-            <template v-if="item.children">
-              <el-submenu :index="item.path" :key="item.path">
-                <template slot="title">
-                  <!-- <i :class="[item.icon,'aliFamily']"></i> -->
-                  <img v-if="item.icon" class="side-bar-icon" :src="item.icon" />
-                  <span slot="title">{{ item.title }}</span>
-                </template>
-                <template v-for="subItem in item.children">
-                  <el-submenu v-if="subItem.children" :index="subItem.path" :key="subItem.path">
-                    <template slot="title">{{ subItem.title }}</template>
-                    <el-menu-item v-for="(threeItem,i) in subItem.children" :key="i" :index="threeItem.path">
-                      {{ threeItem.title }}</el-menu-item>
-                  </el-submenu>
-                  <el-menu-item v-else :index="subItem.path" :key="subItem.path">{{ subItem.title }}</el-menu-item>
-                </template>
-              </el-submenu>
-            </template>
-            <template v-else>
-              <el-menu-item :index="item.path" :key="item.path">
+  <el-aside style="width: 254px;">
+    <div class="sidebar">
+      <div class="side-logo">
+        <img @click="$router.push({path:'/'})" src="/static/image/logo.png" class="logo" />
+      </div>
+      <el-menu class="sidebar-el-menu" :default-active="$route.path" :collapse="collapse" background-color="#00152A" text-color="#bfcbd9" active-text-color="#20a0ff" router>
+        <template v-for="item in items">
+          <template v-if="item.children">
+            <el-submenu :index="item.path" :key="item.path">
+              <template slot="title">
                 <!-- <i :class="[item.icon,'aliFamily']"></i> -->
-                <img :src="item.icon" class="side-bar-icon" v-if="item.icon" />
+                <img v-if="item.icon" class="side-bar-icon" :src="item.icon" />
                 <span slot="title">{{ item.title }}</span>
-              </el-menu-item>
-            </template>
+              </template>
+              <template v-for="subItem in item.children">
+                <el-submenu v-if="subItem.children" :index="subItem.path" :key="subItem.path">
+                  <template slot="title">{{ subItem.title }}</template>
+                  <el-menu-item v-for="(threeItem,i) in subItem.children" :key="i" :index="threeItem.path">
+                    {{ threeItem.title }}</el-menu-item>
+                </el-submenu>
+                <el-menu-item v-else :index="subItem.path" :key="subItem.path">{{ subItem.title }}</el-menu-item>
+              </template>
+            </el-submenu>
           </template>
-        </el-menu>
-      </div>
-    </el-aside>
+          <template v-else>
+            <el-menu-item :index="item.path" :key="item.path">
+              <!-- <i :class="[item.icon,'aliFamily']"></i> -->
+              <img :src="item.icon" class="side-bar-icon" v-if="item.icon" />
+              <span slot="title">{{ item.title }}</span>
+            </el-menu-item>
+          </template>
+        </template>
+      </el-menu>
+    </div>
+  </el-aside>
 </template>
 
 <script>
-  import bus from '../common/bus'
-  import router from '../router/index.js';
-  export default {
-    data() {
-      return {
-        collapse: false,
-        //items: []
-        items: [
-          {
-            path: '/',
-            name: 'home',
-            title: '一键发单',
-            icon: '/static/image/order-icon.png',
-            children: [
-              {
-                path: '/',
-                name: 'HomeIndex',
-                title: '订单列表',
-              },
-              {
-                path: '/orderSearch',
-                name: 'orderSearch',
-                title: '订单查询',
-              },
-              {
-                path: '/manualCreate',
-                name: 'manualCreate',
-                title: '手动发单',
-              }
-            ]
-          },
-          {
-            path: '/shopInfo',
-            name: 'shopInfo',
-            title: '商户信息',
-            icon: '/static/image/shop-icon.png',
-            children: [
-              {
-                path: '/shopInfo/shopInfos',
-                name: 'shopInfos',
-                title: '门店管理',
-              },
-              {
-                path: '/shopInfo/shopAccount',
-                name: 'shopInfos',
-                title: '我的账户',
-              }
-            ]
-          },
-          {
-            path: '/setUp/set',
-            name: 'setUp',
-            title: '设置',
-            icon: '/static/image/setting-icon.png'
-          }
-        ]
-      }
-    },
-    created() {
-      console.log(router.options.routes)
-      //this.items = [...router.options.routes];
-      // 通过 Event Bus 进行组件间通信,来折叠侧边栏
-      bus.$on('collapse', msg => {
-        this.collapse = msg
-        bus.$emit('collapse-content', msg)
-      })
-    }
-  }
+import bus from "../common/bus";
+import router from "../router/index.js";
+export default {
+  data() {
+    return {
+      collapse: false,
+      //items: []
+      items: [
+        {
+          path: "/",
+          name: "home",
+          title: "一键发单",
+          icon: "/static/image/order-icon.png",
+          children: [
+            {
+              path: "/",
+              name: "HomeIndex",
+              title: "订单列表",
+            },
+            {
+              path: "/orderSearch",
+              name: "orderSearch",
+              title: "订单查询",
+            },
+            {
+              path: "/manualCreate",
+              name: "manualCreate",
+              title: "手动发单",
+            },
+          ],
+        },
+        {
+          path: "/shopInfo",
+          name: "shopInfo",
+          title: "商户信息",
+          icon: "/static/image/shop-icon.png",
+          children: [
+            {
+              path: "/shopInfo/shopInfos",
+              name: "shopInfos",
+              title: "门店管理",
+            },
+            {
+              path: "/shopInfo/shopAccount",
+              name: "shopInfos",
+              title: "我的账户",
+            },
+          ],
+        },
+        {
+          path: "/setUp",
+          name: "setUp",
+          title: "设置",
+          icon: "/static/image/setting-icon.png",
+          children: [
+            {
+              path: "/setUp/set",
+              name: "set",
+              title: "外卖设置",
+            },
+            {
+              path: "/setUp/addressManagement",
+              name: "addressManagement",
+              title: "常用地址",
+            },
+            {
+              path: "/setUp/pictureManagement",
+              name: "pictureManagement",
+              title: "商品管理",
+            },
+          ],
+        },
+        {
+          path: "/help",
+          name: "help",
+          title: "帮助中心",
+          icon: "/static/image/help-icon.png",
+        },
+        {
+          path: "/about",
+          name: "about",
+          title: "关于我们",
+          icon: "/static/image/about-icon.png",
+        },
+      ],
+    };
+  },
+  created() {
+    console.log(router.options.routes);
+    //this.items = [...router.options.routes];
+    // 通过 Event Bus 进行组件间通信,来折叠侧边栏
+    bus.$on("collapse", (msg) => {
+      this.collapse = msg;
+      bus.$emit("collapse-content", msg);
+    });
+  },
+};
 </script>
 
 <style lang='scss' scoped='scoped'>
-  /deep/ .el-submenu .el-menu-item {
-    padding-left: 76px !important;
-  }
-  /deep/ .el-menu-item.is-active {
-    color: #fff !important;
-    background-color: #0C2B47 !important;
-    border-right: 6px solid #009CFF;
-  }
-  .sidebar {
-    display: block;
-    position: absolute;
-    left: 0;
-    top: 0;
-    bottom: 0;
-    box-sizing: border-box;
-    padding-top: 80px;
-  }
-  .side-logo {
-    width: 100%;
-    height: 80px;
-    box-sizing: border-box;
-    padding-top: 18px;
-    position: absolute;
-    top: 0;
-    left: 0;
-    z-index: 400;
-    background-color: #fff;
-    font-size: 0;
-    padding-left: 32px;
-    cursor: pointer;
-  }
-  .logo {
-    width: 204px;
-    height: 44px;
-  }
-  .side-bar-icon {
-    width: 21px;
-    height: 21px;
-    margin-right: 18px;
-    margin-left: 14px;
-  }
-  .aliFamily {
-    font-size: 24px;
-    margin-right: 10px;
-  }
+/deep/ .el-submenu .el-menu-item {
+  padding-left: 76px !important;
+}
+/deep/ .el-menu-item.is-active {
+  color: #fff !important;
+  background-color: #0c2b47 !important;
+  border-right: 6px solid #009cff;
+}
+.sidebar {
+  display: block;
+  position: absolute;
+  left: 0;
+  top: 0;
+  bottom: 0;
+  box-sizing: border-box;
+  padding-top: 80px;
+}
+.side-logo {
+  width: 100%;
+  height: 80px;
+  box-sizing: border-box;
+  padding-top: 18px;
+  position: absolute;
+  top: 0;
+  left: 0;
+  z-index: 400;
+  background-color: #fff;
+  font-size: 0;
+  padding-left: 32px;
+  cursor: pointer;
+}
+.logo {
+  width: 204px;
+  height: 44px;
+}
+.side-bar-icon {
+  width: 21px;
+  height: 21px;
+  margin-right: 18px;
+  margin-left: 14px;
+}
+.aliFamily {
+  font-size: 24px;
+  margin-right: 10px;
+}
 
-  .sidebar::-webkit-scrollbar {
-    width: 0;
-  }
+.sidebar::-webkit-scrollbar {
+  width: 0;
+}
 
-  .sidebar-el-menu:not(.el-menu--collapse) {
-    width: 254px;
-    box-sizing: border-box;
-  }
+.sidebar-el-menu:not(.el-menu--collapse) {
+  width: 254px;
+  box-sizing: border-box;
+}
 
-  .sidebar>ul {
-    height: 100%;
-  }
+.sidebar > ul {
+  height: 100%;
+}
 </style>

+ 91 - 0
src/components/about.vue

@@ -0,0 +1,91 @@
+<template>
+  <div class="about">
+    <div class="about-bg">
+      <div class="name">猎豹AI</div>
+      <div class="des">智能聚合运力平台</div>
+      <img class="download" src="../../static/image/download.png" alt="">
+      <div class="scan">扫码下载APP</div>
+      <div class="version">
+        <img class="pc" src="../../static/image/pc-icon.png" alt="">
+        <div class="versoin-num">猎豹AI聚合配送PC版版本V1.0.1</div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "about",
+  data() {
+    return {};
+  },
+  // 监听属性 类似于data概念
+  computed: {},
+  // 监控data中的数据变化
+  watch: {},
+
+  // 生命周期 - 创建完成(可以访问当前this实例)
+  created() {},
+  // 生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {},
+  // 方法集合
+  methods: {},
+};
+</script>
+
+<style lang="scss" scoped  type="text/css">
+.about {
+  display: flex;
+  justify-content: center;
+  margin-top: 150px;
+  .about-bg {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    background: url("../../static/image/about-bg.png");
+    background-size: 100% 100%;
+    width: 372px;
+    height: 268px;
+    .name {
+      font-weight: bold;
+      font-size: 40px;
+      color: #eb5605;
+      letter-spacing: 10px;
+    }
+    .des {
+      font-size: 16px;
+      color: #333;
+      letter-spacing: 10px;
+    }
+    .download {
+      margin-top: 10px;
+      width: 150px;
+      height: 150px;
+    }
+    .scan {
+      margin-top: 10px;
+      font-size: 14px;
+      color: #333;
+    }
+    .version {
+      margin-top: 20px;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      background: #eb5605;
+      opacity: 0.6;
+      border-radius: 29px;
+      padding: 10px 20px;
+      .pc {
+        width: 21px;
+        height: 21px;
+        margin-right: 10px;
+      }
+      .versoin-num {
+        font-size: 12px;
+        color: #fff;
+      }
+    }
+  }
+}
+</style>

+ 66 - 14
src/components/accountCompoents/consumption.vue

@@ -18,26 +18,23 @@
         </div>
       </el-col>
     </el-row>
-    <div style="min-height: 400px;">
+    <div>
       <el-table :data="flowList">
         <el-table-column prop="shopName" label="门店"></el-table-column>
-        <!-- <el-table-column prop="" label="订单来源/编号">
+        <el-table-column prop="" label="订单来源/编号" min-width="100px">
           <template slot-scope="scope">
-            <div v-if="scope.row.payType == 1">支付宝</div>
-            <div v-if="scope.row.payType == 2">微信</div>
-            <div v-if="!scope.row.payType">--</div>
+            <div>{{showType(scope.row.orderType)}}</div>
+            <div>{{scope.row.outOrderId}}</div>
           </template>
-        </el-table-column> -->
-        <!-- <el-table-column prop="createTime" label="平台订单号"></el-table-column> -->
-        <el-table-column prop="createTime" label="消费时间"></el-table-column>
-        <el-table-column prop="remark" label="用途"></el-table-column>
-        <!-- <el-table-column prop="" label="支付方式">
+        </el-table-column>
+        <el-table-column prop="orderSn" label="平台订单号" min-width="120px"></el-table-column>
+        <el-table-column prop="createTime" label="消费时间" min-width="110px"></el-table-column>
+        <el-table-column prop="remark" label="用途" min-width="100px"></el-table-column>
+        <el-table-column prop="" label="支付方式">
           <template slot-scope="scope">
-            <div v-if="scope.row.payType == 1">支付宝</div>
-            <div v-if="scope.row.payType == 2">微信</div>
-            <div v-if="!scope.row.payType">--</div>
+            <div>{{showPayMent(scope.row.paymentType)}}</div>
           </template>
-        </el-table-column> -->
+        </el-table-column>
         <el-table-column prop="amount" label="金额">
           <template slot-scope="scope">
             <div>{{scope.row.type === 1 ? '+' : '-'}}{{ scope.row.amount.toFixed(2) }}</div>
@@ -105,6 +102,14 @@ export default {
       },
     };
   },
+  watch: {
+    "$store.state.userInfo": {
+      handler(newVal, oldVal) {
+        this.memberType = newVal.memberType;
+      },
+      deep: true,
+    },
+  },
   created() {
     this.init();
     this.search();
@@ -176,6 +181,53 @@ export default {
         }
       });
     },
+    showType(type){
+      let name;
+      switch (type) {
+        case 1:
+          name="美团"
+          break;
+        case 2:
+          name="饿了么"
+          break;
+        case 3:
+          name="饿百"
+          break;
+        case 99:
+          name="手动发单"
+          break;
+      
+        default:
+          name= '--'
+          break;
+      }
+      return name
+    },
+    showPayMent(type) {
+      let name;
+      switch (type) {
+        case 1:
+          name= '支付宝支付'
+          break;
+        case 2:
+          name= '微信支付'
+          break;
+        case 3:
+          name= '银联支付'
+          break;
+        case 4:
+          name= '余额支付'
+          break;
+        case 5:
+          name= '三方运力支付'
+          break;
+
+        default:
+          name = "--";
+          break;
+      }
+      return name;
+    },
   },
 };
 </script>

+ 61 - 38
src/components/accountCompoents/recharge.vue

@@ -10,9 +10,7 @@
         </el-table-column>
         <el-table-column prop="" label="支付方式">
           <template slot-scope="scope">
-            <div v-if="scope.row.payType == 1">支付宝</div>
-            <div v-if="scope.row.payType == 2">微信</div>
-            <div v-if="!scope.row.payType">--</div>
+            <div>{{showPayMent(scope.row.paymentType)}}</div>
           </template>
         </el-table-column>
       </el-table>
@@ -25,45 +23,70 @@
 </template>
 
 <script>
-  import { balanceLogs } from '../../api/amount.js';
-  export default {
-    data() {
-      return {
-        rechargeList: [],
-        query: {
-          source: 1,
-          pageNum: 1,
-          pageSize: 10
-        },
-        total: 0
-      }
+import { balanceLogs } from "../../api/amount.js";
+export default {
+  data() {
+    return {
+      rechargeList: [],
+      query: {
+        source: 1,
+        pageNum: 1,
+        pageSize: 10,
+      },
+      total: 0,
+    };
+  },
+  created() {
+    this.getBalanceLogs();
+  },
+  methods: {
+    handleSizeChange(val) {
+      this.query.pageNum = 1;
+      this.query.pageSize = val;
+      this.rechargeList = [];
+      this.getBalanceLogs();
     },
-    created() {
+    handleCurrentChange(val) {
+      this.query.pageNum = val;
+      this.rechargeList = [];
       this.getBalanceLogs();
     },
-    methods: {
-      handleSizeChange(val) {
-        this.query.pageNum = 1;
-        this.query.pageSize = val;
-        this.rechargeList = [];
-        this.getBalanceLogs();
-      },
-      handleCurrentChange(val) {
-        this.query.pageNum = val;
-        this.rechargeList = [];
-        this.getBalanceLogs();
-      },
-      getBalanceLogs() {
-        let params  = { ...this.query };
-        balanceLogs( params ).then(res=> {
-          if ( res.code == 200 ) {
-            this.rechargeList = res.data.data || [];
-            this.total = res.data.totalNums || 0;
-          }
-        })
+    getBalanceLogs() {
+      let params = { ...this.query };
+      balanceLogs(params).then((res) => {
+        if (res.code == 200) {
+          this.rechargeList = res.data.data || [];
+          this.total = res.data.totalNums || 0;
+        }
+      });
+    },
+    showPayMent(type) {
+      let name;
+      switch (type) {
+        case 1:
+          name= '支付宝支付'
+          break;
+        case 2:
+          name= '微信支付'
+          break;
+        case 3:
+          name= '银联支付'
+          break;
+        case 4:
+          name= '余额支付'
+          break;
+        case 5:
+          name= '三方运力支付'
+          break;
+
+        default:
+          name = "--";
+          break;
       }
-    }
-  }
+      return name;
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>

+ 8 - 0
src/components/accountCompoents/wallet.vue

@@ -72,6 +72,14 @@ export default {
       memberType: this.$store.state.userInfo.memberType,
     };
   },
+  watch: {
+    "$store.state.userInfo": {
+      handler(newVal, oldVal) {
+        this.memberType = newVal.memberType;
+      },
+      deep: true,
+    },
+  },
   components: {
     qrCode,
   },

+ 4 - 4
src/components/settingComponents/addressManagement.vue

@@ -23,7 +23,7 @@
       <el-form ref="form" :model="form" label-width="100px" label-position="left" size="small">
         <el-form-item label="位置" required>
           <el-input v-model="form.address" placeholder="请选择位置!" disabled>
-            <el-image @click="showMap" slot="append" class="map" src="../../static/image/icon_map.png"></el-image>
+            <el-image @click="showMap" slot="append" class="map" src="../static/image/icon_map.png"></el-image>
           </el-input>
         </el-form-item>
         <el-form-item label="门牌号">
@@ -36,7 +36,7 @@
           <el-input v-model="form.phone" placeholder="请填写联系人电话!"></el-input>
         </el-form-item>
         <el-form-item label="设为默认地址">
-          <el-switch v-model="form.isDefault" :active-value="1" :inactive-value="0"></el-switch>
+          <el-switch v-model="form.isDefault" :active-value="1" :inactive-value="0" active-color="#FC7200" inactive-color="#999"></el-switch>
         </el-form-item>
       </el-form>
       <span slot="footer" class="dialog-footer">
@@ -50,7 +50,7 @@
 </template>
 
 <script>
-import orderMap from "../orderComponents/orderAMap.vue";
+import orderMap from "./orderComponents/orderAMap.vue";
 import {
   getAddressList,
   deleteAddress,
@@ -58,7 +58,7 @@ import {
   updateAddress,
   getAddressDetail,
   defaultAddress,
-} from "../../api/setting.js";
+} from "../api/setting.js";
 export default {
   name: "addressManagement",
   data() {

+ 129 - 0
src/components/help.vue

@@ -0,0 +1,129 @@
+<template>
+  <div class="help">
+    <div class="help-content">
+      <div class="menu">
+        <el-menu :default-openeds="openeds" :default-active="defaultActive" class="el-menu-vertical-demo" @select="select">
+          <el-submenu :index="String(i)" v-for="(v,i) in helpList" :key="i">
+            <template slot="title">
+              <span>{{v.firstColumnNames}}</span>
+            </template>
+            <el-menu-item-group v-for="(item,index) in v.helpSeconds" :key="index">
+              <el-menu-item :index="i+'-'+index">{{item.secondColumnNames}}</el-menu-item>
+            </el-menu-item-group>
+          </el-submenu>
+        </el-menu>
+      </div>
+      <div class="content">
+        <el-tabs v-model="activeName">
+          <el-tab-pane v-for="(v,i) in detailList" :key="i" :label="v.title" :name="v.title" v-html="v.content"></el-tab-pane>
+        </el-tabs>
+      </div>
+    </div>
+    <template>
+      <el-backtop>返回顶部</el-backtop>
+    </template>
+  </div>
+</template>
+
+<script>
+import { helpList, helpDetail } from "../api/help.js";
+export default {
+  name: "help",
+  data() {
+    return {
+      helpList: [],
+      detailList: [],
+      openeds: [],
+      activeName: "",
+      defaultActive: "0",
+    };
+  },
+  // 监听属性 类似于data概念
+  computed: {},
+  // 监控data中的数据变化
+  watch: {},
+
+  // 生命周期 - 创建完成(可以访问当前this实例)
+  created() {
+    this.getHelpList();
+  },
+  // 生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {},
+  // 方法集合
+  methods: {
+    getHelpList() {
+      helpList().then((res) => {
+        console.log(res);
+        if (res.code === 200) {
+          this.helpList = res.data;
+          this.openeds = this.helpList.map((v, i) => {
+            return String(i);
+          });
+          this.getDetail(this.helpList[0].helpSeconds[0].secondColumnId);
+        } else {
+          this.$message({
+            type: "error",
+            message: res.msg,
+          });
+        }
+      });
+    },
+    getDetail(secondColumnId) {
+      helpDetail({ secondColumnId }).then((res) => {
+        if (res.code === 200) {
+          this.detailList = res.data;
+          this.activeName = this.detailList.length
+            ? this.detailList[0].title
+            : "";
+        } else {
+          this.$message({
+            type: "error",
+            message: res.msg,
+          });
+        }
+      });
+    },
+    select() {
+      console.log("object", arguments);
+      let nums = arguments[0].split("-");
+      let num1 = Number(nums[0]);
+      let num2 = Number(nums[1]);
+      let id = this.helpList[num1].helpSeconds[num2].secondColumnId;
+      this.getDetail(id);
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped  type="text/css">
+.help {
+  height: 100%;
+  .help-content {
+    display: flex;
+    justify-content: space-between;
+    height: 100%;
+    .menu {
+      height: 100%;
+      width: 250px;
+      /deep/ ul {
+        height: 100%;
+        overflow: auto;
+      }
+      .title {
+        cursor: pointer;
+      }
+    }
+    .content {
+      width: calc(100% - 260px);
+      background: #fff;
+      overflow: auto;
+      /deep/ .el-tabs__item {
+        padding-left: 20px;
+      }
+      /deep/ .el-tab-pane {
+        padding: 0 20px;
+      }
+    }
+  }
+}
+</style>

+ 53 - 7
src/components/manualCreate.vue

@@ -149,19 +149,20 @@
 </template>
 <script>
 import orderMap from "./orderComponents/orderAMap.vue";
-import addressManagement from "../components/settingComponents/addressManagement.vue";
+import addressManagement from "./addressManagement.vue";
 import { getProductList } from "../api/shop.js";
+import { getConfig } from "../api/setting.js";
 import { sendValuation, saveOrder, getAddressList } from "../api/order.js";
 import sendOrderPopup from "../components/orderComponents/sendOrderPopup.vue";
-import { send } from "process";
 export default {
   name: "manualCreate",
   data() {
     return {
       products: [],
-      sendType: this.$store.state.userInfo.memberType === 1 ? 0 : 1, // 0是个人地址发单 1是门店地址发单
       addressType: 1,
       name: "",
+      sendType: this.$store.state.userInfo.memberType === 1 ? 0 : 1,
+      memberType: this.$store.state.userInfo.memberType,
       form: {
         name: "",
         sendAddress: {
@@ -216,7 +217,6 @@ export default {
           );
         },
       },
-      memberType: this.$store.state.userInfo.memberType,
       min: 15,
       showAddress: false,
       personalSendAddressId: "",
@@ -232,6 +232,15 @@ export default {
   computed: {},
   // 监控data中的数据变化
   watch: {
+    "$store.state.userInfo": {
+      handler(newVal, oldVal) {
+        this.sendType = newVal.memberType === 1 ? 0 : 1;
+        this.memberType = newVal.memberType;
+        this.form.type = newVal.memberType === 1 ? 1 : 2;
+        this.form.shopId = newVal.shopId;
+      },
+      deep: true,
+    },
     sendType: {
       handler(newVal, oldVal) {
         this.searchKey = "";
@@ -320,9 +329,9 @@ export default {
             });
             console.log("sendAddress1", sendAddress);
             Object.keys(this.form.sendAddress).map((v) => {
-              this.form.sendAddress[v] = sendAddress ? sendAddress[v] : '';
+              this.form.sendAddress[v] = sendAddress ? sendAddress[v] : "";
             });
-            this.name = sendAddress ? sendAddress.name : '';
+            this.name = sendAddress ? sendAddress.name : "";
           }
           if (this.addressType === 2) {
             this.addressList = res.data.personal;
@@ -488,7 +497,44 @@ export default {
           });
         }
         this.form.saveFlag = 1;
-        this.saveOrder();
+        getConfig().then((res) => {
+          if (res.code === 200) {
+            let amount = res.data.amount;
+            if (amount < 100) {
+              this.$confirm(
+                "您的账户余额不足100元,可能会导致预约发单失败,请及时充值!",
+                "提示",
+                {
+                  confirmButtonText: "去充值",
+                  cancelButtonText: "知道了!",
+                  distinguishCancelAndClose: true,
+                  center: true,
+                  type: "warning",
+                }
+              )
+                .then(() => {
+                  this.$router.push({
+                    path: "/shopInfo/shopAccount",
+                  });
+                })
+                .catch((action) => {
+                  console.log("action:", action);
+                  if (action === "close") {
+                    return;
+                  } else {
+                    this.saveOrder();
+                  }
+                });
+            } else {
+              this.saveOrder();
+            }
+          } else {
+            this.$message({
+              type: "error",
+              message: res.msg,
+            });
+          }
+        });
       } else {
         this.form.takeTime = this.$tool.getFormatDate(new Date());
         this.sendValuation();

+ 7 - 18
src/components/merchantAdd.vue

@@ -40,6 +40,7 @@
 <script>
 import orderMap from "../components/orderComponents/orderAMap.vue";
 import { merchantAdd, merchantDetail, merchantModify } from "../api/user.js";
+import { mapActions } from "vuex";
 import bus from "../common/bus.js";
 export default {
   props: {
@@ -77,6 +78,7 @@ export default {
     orderMap,
   },
   methods: {
+    ...mapActions(["getUserInfo"]),
     init(type) {
       if (type) {
         this.title = "修改资料";
@@ -165,22 +167,15 @@ export default {
           if (res.code === 200) {
             this.$message({
               type: "success",
-              message: `已经修改成功,即将跳出重新登录!`,
+              message: `已经修改成功!`,
             });
-
-            setTimeout(() => {
-              localStorage.clear();
-              bus.$emit("closeGetSoundMsg");
-              this.$router.push({
-                path: "/login",
-              });
-            }, 2000);
           } else {
             this.$message({
               type: "error",
               message: res.msg,
             });
           }
+          this.getUserInfo();
           this.showVisible = false;
           this.loading = false;
         });
@@ -189,22 +184,16 @@ export default {
           if (res.code === 200) {
             this.$message({
               type: "success",
-              message: `已经成为商家,即将跳出重新登录`,
+              message: `已经成为商家!`,
             });
-
-            setTimeout(() => {
-              localStorage.clear();
-              bus.$emit("closeGetSoundMsg");
-              this.$router.push({
-                path: "/login",
-              });
-            }, 2000);
           } else {
             this.$message({
               type: "error",
               message: res.msg,
             });
           }
+          this.getUserInfo();
+          this.showVisible = false;
           this.loading = false;
         });
       }

+ 2 - 2
src/components/orderComponents/orderAMap.vue

@@ -113,10 +113,10 @@ export default {
         id: 1,
         position: [data.sendLng, data.sendLat],
         icon: "/static/image/map-fa.png",
-        offset: [10, -50],
         label: {
           content: `商家距离目的地${orderDistance}`,
           direction: "top",
+          offset: [-10, -20],
         },
       };
       let receiptM = {
@@ -141,7 +141,6 @@ export default {
           id: 3,
           position: [mapData.shipperLng, mapData.shipperLat],
           icon: "/static/image/map-rider.png",
-          offset: [15, -50],
           label: {
             content:
               data.buttonStatus === 2
@@ -150,6 +149,7 @@ export default {
                 ? `骑手距离目的地${distance} | 预计${mapData.estimateArriveTime}送达`
                 : "",
             direction: "top",
+            offset: [-10, -20],
           },
         };
         this.markers.push(riderM);

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

@@ -159,7 +159,7 @@
             <div class="order_item_cont">
               <div class="content">
                 {{ item.receiptContactName
-                }}<span>{{ item.receiptPhone }}</span>
+                }}<span>{{ item.receiptPhone }}{{item.receiptExtension ? "_" + item.receiptExtension : ""}}</span>
               </div>
               <div class="address">
                 <!-- {{ item.receiptProvinceName }}

+ 8 - 0
src/components/orderSearch.vue

@@ -171,6 +171,14 @@ export default {
     sendOrderPopup,
     OrderList,
   },
+  watch:{
+    "$store.state.userInfo": {
+      handler(newVal, oldVal) {
+        this.memberType = newVal.memberType;
+      },
+      deep: true,
+    },
+  },
   created() {
     let searchKey = this.$route.query.searchKey;
     if (searchKey) {

+ 118 - 0
src/components/pictureManagement.vue

@@ -0,0 +1,118 @@
+<template>
+  <div class="picture-management">
+    <div class="set">
+      <div class="title">
+        <div class="name">同步商品图片</div>
+        <div class="tips">(同步后显示最新的商品图片)</div>
+      </div>
+      <img @click="syncFoodImg" class="img" src="../../static/image/update.png" alt="">
+    </div>
+    <div class="set">
+      <div class="title">
+        <div class="name">订单详情显示出商品图片</div>
+        <div class="tips">(在订单详情的商品显示图片,方便制作时确认)</div>
+      </div>
+      <el-switch @change="changeShowFoodImg" v-model="showFoodImg" :active-value="1" :inactive-value="0" active-color="#FC7200" inactive-color="#999">
+      </el-switch>
+    </div>
+  </div>
+</template>
+
+<script>
+import { getConfig, updateConfig, syncFoodImg } from "../api/setting.js";
+export default {
+  name: "pictureManagement",
+  data() {
+    return {
+      showFoodImg: 0,
+    };
+  },
+  // 监听属性 类似于data概念
+  computed: {},
+  // 监控data中的数据变化
+  watch: {},
+
+  // 生命周期 - 创建完成(可以访问当前this实例)
+  created() {
+    this.getConfig();
+  },
+  // 生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {},
+  // 方法集合
+  methods: {
+    getConfig() {
+      getConfig().then((res) => {
+        if (res.code === 200) {
+          this.showFoodImg = res.data.showFoodImg;
+        } else {
+          this.$message({
+            type: "error",
+            message: res.msg,
+          });
+        }
+      });
+    },
+    changeShowFoodImg() {
+      updateConfig({ showFoodImg: this.showFoodImg }).then((res) => {
+        if (res.code === 200) {
+          this.$message({
+            type: "success",
+            message: "修改成功!",
+          });
+        } else {
+          this.$message({
+            type: "error",
+            message: res.msg,
+          });
+        }
+        this.getConfig();
+      });
+    },
+    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">
+.picture-management {
+  .set {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    padding: 20px;
+    background: #fff;
+    margin-bottom: 20px;
+    border-radius: 5px;
+    .title {
+      display: flex;
+      align-items: center;
+      .name {
+        font-size: 14px;
+      }
+      .tips {
+        font-size: 12px;
+        color: #999;
+      }
+    }
+    .img {
+      width: 20px;
+      height: 20px;
+      cursor: pointer;
+    }
+  }
+}
+</style>

+ 0 - 3
src/components/set.vue

@@ -21,7 +21,6 @@
 <script>
 import voiceSetting from "./settingComponents/voiceSetting.vue";
 import deliverySetting from "./settingComponents/deliverySetting.vue";
-import addressManagement from "./settingComponents/addressManagement.vue";
 export default {
   name: "HelloWorld",
   data() {
@@ -29,7 +28,6 @@ export default {
       tabList: [
         { name: "自动接单/语音设置", index: 0,activeName: 'voiceSetting' },
         { name: "推荐/屏蔽运力", index: 1,activeName: 'deliverySetting' },
-        { name: "常用地址", index: 2,activeName: 'addressManagement' },
       ],
       tabNum: 0,
       activeName: "voiceSetting",
@@ -39,7 +37,6 @@ export default {
   components: {
     voiceSetting,
     deliverySetting,
-    addressManagement,
   },
   methods: {
     forceRerender() {

+ 13 - 9
src/components/settingComponents/voiceSetting.vue

@@ -6,7 +6,7 @@
           自动接单
         </div>
         <div class="t-right">
-          <el-switch @change="updateConfig" v-model="openAutoorder" :active-value="1" :inactive-value="0" />
+          <el-switch @change="updateConfig" v-model="openAutoorder" :active-value="1" :inactive-value="0" active-color="#FC7200" inactive-color="#999" />
         </div>
       </div>
       <div class="top-set">
@@ -16,7 +16,7 @@
         </div>
         <div class="t-right">
           <span>默认下单{{autodeliveryOrderTime}}分钟后</span>
-          <el-switch @change="autodelivery" v-model="openAutodelivery" :active-value="1" :inactive-value="0" />
+          <el-switch @change="autodelivery" v-model="openAutodelivery" :active-value="1" :inactive-value="0" active-color="#FC7200" inactive-color="#999" />
         </div>
       </div>
       <div class="top-set">
@@ -25,7 +25,7 @@
           <span style="color: #999;">(开启后将为您自动打印小票)</span>
         </div>
         <div class="t-right">
-          <el-switch @change="updateConfig" v-model="openPrintSwitch" :active-value="1" :inactive-value="0" />
+          <el-switch @change="updateConfig" v-model="openPrintSwitch" :active-value="1" :inactive-value="0" active-color="#FC7200" inactive-color="#999" />
         </div>
       </div>
     </template>
@@ -36,7 +36,7 @@
         </div>
         <div class="t-right">
           <span>一键开启</span>
-          <el-switch @change="changeMessageStatus" v-model="msasterSwitch" :active-value="1" :inactive-value="0" />
+          <el-switch @change="changeMessageStatus" v-model="msasterSwitch" :active-value="1" :inactive-value="0"  active-color="#FC7200" inactive-color="#999" />
         </div>
       </div>
       <div class="voice-list">
@@ -48,7 +48,7 @@
                 <span>{{ item.name }}</span>
               </div>
               <div class="right">
-                <el-switch @change="updateSavePushMessageStatus" v-model="item.msasterSwitch" :active-value="1" :inactive-value="0" />
+                <el-switch @change="updateSavePushMessageStatus" v-model="item.msasterSwitch" :active-value="1" :inactive-value="0" active-color="#FC7200" inactive-color="#999" />
               </div>
             </div>
           </el-col>
@@ -101,6 +101,14 @@ export default {
       memberType: this.$store.state.userInfo.memberType,
     };
   },
+  watch:{
+    "$store.state.userInfo": {
+      handler(newVal, oldVal) {
+        this.memberType = newVal.memberType;
+      },
+      deep: true,
+    },
+  },
   created() {
     this.getConfig();
     this.queryPushMessageStatus();
@@ -264,10 +272,6 @@ export default {
 
 <style lang="scss" scoped>
 .voice {
-  /deep/ .el-switch.is-checked .el-switch__core {
-    border-color: #fc7200;
-    background-color: #fc7200;
-  }
   /deep/ .el-checkbox__input.is-checked .el-checkbox__inner,
   /deep/ .el-checkbox__input.is-indeterminate .el-checkbox__inner {
     background-color: #fc7200;

+ 53 - 19
src/components/shopCompoents/bindDelivery.vue

@@ -1,5 +1,5 @@
 <template>
-  <div>
+  <div v-loading="loading" element-loading-text="数据加载中">
     <div v-if="deliveryList.length" class="take-out-list">
       <div class="item" v-for="(v, index) in deliveryList" :key="index">
         <div class="item-top">
@@ -9,7 +9,7 @@
           </div>
           <div v-if="v.bindStatus === 1 && memberType === 2" class="top-right">
             <span>开启后首选该账号平台为配送平台</span>
-            <el-switch @change="statusDelivery(v)" v-model="v.preferredDelivery" :active-value="1" :inactive-value="0" />
+            <el-switch @change="statusDelivery(v)" v-model="v.preferredDelivery" :active-value="1" :inactive-value="0" active-color="#FC7200" inactive-color="#999" />
           </div>
         </div>
         <div class="item-bottom">
@@ -29,15 +29,13 @@
             }}</span>
             <el-button v-if="[0, 3].includes(v.bindStatus)" @click="goBind(v)" v-loading.fullscreen.lock="fullscreenLoading" element-loading-text="关闭窗口后再操作!" type="primary" size="small" class="right-btn">去绑定</el-button>
             <el-button v-if="[1].includes(v.bindStatus)" @click="release(v)" size="small">解&nbsp;&nbsp;&nbsp;绑</el-button>
-            <!-- <el-button v-if="v.bindStatus === 2" @click="release(v)" type="info" size="small">审核中</el-button> -->
-            <!-- <el-button v-if="v.bindStatus === 3" @click="release(v)" type="danger" size="small">已拒绝</el-button> -->
             <el-button v-if="[1, 4].includes(v.bindStatus) && [1, 9].includes(v.type)" @click="perfectData(v)" type="primary" size="small" class="right-btn">完善资料</el-button>
           </div>
         </div>
         <div v-if="v.bindStatus === 3" class="respect">{{ v.authMsg }}</div>
       </div>
     </div>
-    <el-empty v-else description="暂无绑定配送平台!"></el-empty>
+    <el-empty v-if="!deliveryList.length && !loading" description="暂无绑定配送平台!"></el-empty>
     <!-- UU跑腿 -->
     <el-dialog :title="title" :visible.sync="centerDialogVisible" width="40%" center>
       <el-form v-if="title === 'UU跑腿绑定'" :model="UUData" ref="UUData" label-width="80px" class="demo-ruleForm">
@@ -86,7 +84,7 @@
     </el-dialog>
   </div>
 </template>
-
+     
 <script>
 import {
   getDeliveryList,
@@ -107,6 +105,7 @@ export default {
       fullscreenLoading: false,
       centerDialogVisible: false,
       centerDialogVisible2: false,
+      loading: false,
       UUData: {
         cityName: "",
         mobile: "",
@@ -124,6 +123,12 @@ export default {
     };
   },
   watch: {
+    "$store.state.userInfo": {
+      handler(newVal, oldVal) {
+        this.memberType = newVal.memberType;
+      },
+      deep: true,
+    },
     jumpUrl(newVal, oldVal) {
       if (this.jumpUrl) {
         this.fullscreenLoading = true;
@@ -161,6 +166,7 @@ export default {
   // 9->达达优质
   // 10->快服务
   // 12->货拉拉
+  // 13-> 美图跑腿
   methods: {
     explainDelivery() {
       explainDelivery().then((res) => {
@@ -168,8 +174,17 @@ export default {
       });
     },
     getDeliveryList() {
+      this.loading = true;
       getDeliveryList().then((res) => {
-        this.deliveryList = res.data;
+        if (res.code === 200) {
+          this.deliveryList = res.data;
+        } else {
+          this.$message({
+            type: "error",
+            message: res.msg,
+          });
+        }
+        this.loading = false;
       });
     },
     checkPhone(phone) {
@@ -264,20 +279,38 @@ export default {
             return;
           });
       } else {
-        bindDelivery(params).then((res) => {
-          if (res.code === 200) {
-            if (res.data) {
-              this.jumpUrl = res.data;
-            } else {
-              this.getDeliveryList();
-            }
-          } else {
+        this.$confirm("此操作将绑定当前配送平台, 是否继续?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+          center: true,
+        })
+          .then(() => {
+            bindDelivery(params).then((res) => {
+              if (res.code === 200) {
+                if (res.data) {
+                  this.jumpUrl = res.data;
+                } else {
+                  this.$message({
+                    type: "success",
+                    message: "已成功绑定!",
+                  });
+                  this.getDeliveryList();
+                }
+              } else {
+                this.$message({
+                  type: "error",
+                  message: res.msg,
+                });
+              }
+            });
+          })
+          .catch(() => {
             this.$message({
-              type: "error",
-              message: res.msg,
+              type: "info",
+              message: "已取消绑定!",
             });
-          }
-        });
+          });
       }
     },
     bindUU() {
@@ -388,6 +421,7 @@ export default {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",
+        center: true,
       })
         .then(() => {
           // 爱跑腿解除绑定

+ 9 - 3
src/components/shopCompoents/bindPrinter.vue

@@ -48,7 +48,7 @@
         </div>
       </div>
     </template>
-    <el-empty v-else description="暂无绑定打印机!"></el-empty>
+    <el-empty v-if="!shopList.length && !loading" description="暂无绑定打印机!"></el-empty>
     <!-- <div class="empty-img" v-else>
       <img src="../../../static/image/printer.png" />
     </div> -->
@@ -80,13 +80,19 @@ export default {
       showVisible: false,
       title: "添加打印机",
       deviceList: [],
-      memberType: this.$store.state.userInfo.memberType
+      memberType: this.$store.state.userInfo.memberType,
     };
   },
   watch: {
     curIdx(newVal, oldVal) {
       this.shopDeviceList(newVal);
     },
+    "$store.state.userInfo": {
+      handler(newVal, oldVal) {
+        this.memberType = newVal.memberType;
+      },
+      deep: true,
+    },
   },
   created() {
     if (this.memberType !== 1) {
@@ -137,8 +143,8 @@ export default {
       });
     },
     getShopList() {
+      this.loading = true;
       getShopList().then((res) => {
-        this.loading = true;
         if (res.code === 200) {
           this.shopList = res.data;
           this.curIdx = 0;

+ 12 - 14
src/components/shopCompoents/bindTakeOut.vue

@@ -33,7 +33,7 @@
         </div>
       </div>
     </div>
-    <el-empty v-else description="暂无绑定外卖平台!"></el-empty>
+    <el-empty v-if="!takeOutList.length && !loading" description="暂无绑定外卖平台!"></el-empty>
     <el-dialog title="绑定美团外卖" :visible.sync="centerDialogVisible" width="520px" center>
       <div class="bind">
         <div v-if="!showMT" @click="showMT = true" class="more">更多授权方式</div>
@@ -111,20 +111,18 @@ export default {
   },
   methods: {
     getShopList() {
+      this.loading = true;
       getShopList().then((res) => {
-        this.loading = true;
-        getShopList().then((res) => {
-          if (res.code === 200) {
-            this.shopList = res.data;
-            this.curIdx = 0;
-          } else {
-            this.$message({
-              type: "error",
-              message: res.msg,
-            });
-          }
-          this.loading = false;
-        });
+        if (res.code === 200) {
+          this.shopList = res.data;
+          this.curIdx = 0;
+        } else {
+          this.$message({
+            type: "error",
+            message: res.msg,
+          });
+        }
+        this.loading = false;
       });
     },
     getBindTakeOutList(index) {

+ 15 - 89
src/components/shopCompoents/printerAdd.vue

@@ -1,129 +1,56 @@
 <template>
   <div class="shopAdd">
     <!-- 打印机新增、编辑 -->
-    <el-dialog
-      width="40%"
-      :title="title"
-      destroy-on-close
-      center
-      :visible.sync="showVisible"
-    >
+    <el-dialog width="40%" :title="title" destroy-on-close center :visible.sync="showVisible">
       <el-form :model="form" ref="form" label-width="120px">
         <el-form-item label="选择打印机" prop="deviceType">
           <div class="category_box">
-            <div
-              class="item"
-              :class="form.deviceType == item.type ? 'active' : ''"
-              v-for="(item, i) in devices"
-              :key="i"
-              @click="changeType(item)"
-            >
+            <div class="item" :class="form.deviceType == item.type ? 'active' : ''" v-for="(item, i) in devices" :key="i" @click="changeType(item)">
               {{ item.name }}
             </div>
           </div>
         </el-form-item>
         <el-form-item label="打印机名称" prop="name">
-          <el-input
-            v-model="form.name"
-            placeholder="给这台打印机取个名字吧"
-            autocomplete="off"
-            style="width: 100%"
-          >
+          <el-input v-model="form.name" placeholder="给这台打印机取个名字吧" autocomplete="off" style="width: 100%">
           </el-input>
         </el-form-item>
         <el-form-item label="打印机编号" prop="deviceSn">
-          <el-input
-            v-model="form.deviceSn"
-            placeholder="查看打印机底部标签"
-            autocomplete="off"
-            style="width: 100%"
-          >
+          <el-input v-model="form.deviceSn" placeholder="查看打印机底部标签" autocomplete="off" style="width: 100%">
           </el-input>
         </el-form-item>
         <el-form-item label="打印机KEY" prop="deviceSecret">
-          <el-input
-            v-model="form.deviceSecret"
-            placeholder="查看打印机底部标签"
-            autocomplete="off"
-            style="width: 100%"
-          >
+          <el-input v-model="form.deviceSecret" placeholder="查看打印机底部标签" autocomplete="off" style="width: 100%">
           </el-input>
         </el-form-item>
         <el-form-item label="自动打印接单" prop="deviceSecret">
-          <el-switch
-            v-model="form.openOrderPrint"
-            :active-value="1"
-            :inactive-value="0"
-          />
+          <el-switch v-model="form.openOrderPrint" :active-value="1" :inactive-value="0" active-color="#FC7200" inactive-color="#999" />
         </el-form-item>
         <el-form-item label="自动打印取消单" prop="deviceSecret">
-          <el-switch
-            v-model="form.openOrderCancelPrint"
-            :active-value="1"
-            :inactive-value="0"
-          />
+          <el-switch v-model="form.openOrderCancelPrint" :active-value="1" :inactive-value="0" active-color="#FC7200" inactive-color="#999" />
         </el-form-item>
         <el-form-item label="打印份数">
           <div class="printer-num">
-            <img
-              @click="reduce(1)"
-              src="../../../static/image/icon_reduce.png"
-              class="reduce"
-              alt=""
-              srcset=""
-            />
+            <img @click="reduce(1)" src="../../../static/image/icon_reduce.png" class="reduce" alt="" srcset="" />
             <div class="num">{{ form.printCustomerCount }} 份</div>
-            <img
-              @click="add(1)"
-              src="../../../static/image/icon_add.png"
-              class="add"
-              alt=""
-              srcset=""
-            />
+            <img @click="add(1)" src="../../../static/image/icon_add.png" class="add" alt="" srcset="" />
             <div class="name">客户联</div>
           </div>
           <div class="printer-num">
-            <img
-              @click="reduce(2)"
-              src="../../../static/image/icon_reduce.png"
-              class="reduce"
-              alt=""
-              srcset=""
-            />
+            <img @click="reduce(2)" src="../../../static/image/icon_reduce.png" class="reduce" alt="" srcset="" />
             <div class="num">{{ form.printMerchantCount }} 份</div>
-            <img
-              @click="add(2)"
-              src="../../../static/image/icon_add.png"
-              class="add"
-              alt=""
-              srcset=""
-            />
+            <img @click="add(2)" src="../../../static/image/icon_add.png" class="add" alt="" srcset="" />
             <div class="name">商家联</div>
           </div>
           <div class="printer-num">
-            <img
-              @click="reduce(3)"
-              src="../../../static/image/icon_reduce.png"
-              class="reduce"
-              alt=""
-              srcset=""
-            />
+            <img @click="reduce(3)" src="../../../static/image/icon_reduce.png" class="reduce" alt="" srcset="" />
             <div class="num">{{ form.printKitchenCount }} 份</div>
-            <img
-              @click="add(3)"
-              src="../../../static/image/icon_add.png"
-              class="add"
-              alt=""
-              srcset=""
-            />
+            <img @click="add(3)" src="../../../static/image/icon_add.png" class="add" alt="" srcset="" />
             <div class="name">厨房联</div>
           </div>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button :loading="loading" size="medium" class="btn" @click="save"
-          >保存</el-button
-        >
+        <el-button :loading="loading" size="medium" class="btn" @click="save">保存</el-button>
       </div>
     </el-dialog>
   </div>
@@ -149,8 +76,7 @@ export default {
       loading: false,
     };
   },
-  created(){
-  },
+  created() {},
   methods: {
     changeType(v) {
       this.$set(this.form, "deviceType", v.type);

+ 11 - 4
src/components/shopCompoents/shopList.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="shopList">
+  <div class="shopList" v-loading="loading" element-loading-text="数据加载中">
     <div class="header" v-if="shopList.length">
       <div class="left">
         <div class="line">
@@ -12,7 +12,7 @@
         <el-button class="btn" v-if="$store.state.userInfo.memberType === 2" @click.stop="addShop(1)">新增门店</el-button>
       </div>
     </div>
-    <el-table v-if="shopList.length" v-loading="loading" element-loading-text="数据加载中" :data="shopList" stripe header-row-class-name="table_h" style="width: 100%; margin-top: 10px">
+    <el-table v-if="shopList.length" :data="shopList" stripe header-row-class-name="table_h" style="width: 100%; margin-top: 10px">
       <el-table-column prop="code" label="门店编号" width="170"></el-table-column>
       <el-table-column prop="name" label="门店名称" width="172" align="center"></el-table-column>
       <el-table-column prop="address" label="门店地址" width="321" align="center"></el-table-column>
@@ -32,7 +32,7 @@
         </template>
       </el-table-column>
     </el-table>
-    <el-empty v-else description="暂无门店数据!"></el-empty>
+    <el-empty v-if="!shopList.length && !loading" description="暂无门店数据!"></el-empty>
     <shop-add @getData="getData" ref="shopAdd" :products="productList"></shop-add>
   </div>
 </template>
@@ -52,7 +52,14 @@ export default {
       memberType: this.$store.state.userInfo.memberType,
     };
   },
-
+  watch:{
+    "$store.state.userInfo": {
+      handler(newVal, oldVal) {
+        this.memberType = newVal.memberType;
+      },
+      deep: true,
+    },
+  },
   mounted() {
     if (this.memberType !== 1) {
       this.getData();

+ 8 - 0
src/components/shopInfo.vue

@@ -54,6 +54,14 @@ export default {
       memberType: this.$store.state.userInfo.memberType,
     };
   },
+  watch: {
+    "$store.state.userInfo": {
+      handler(newVal, oldVal) {
+        this.memberType = newVal.memberType;
+      },
+      deep: true,
+    },
+  },
   created() {
     this.getProductList();
     bus.$on("goPrinter", () => {

+ 25 - 1
src/router/index.js

@@ -34,10 +34,22 @@ const router = new Router({
         {
           path: '/setUp/set',
           name: 'set',
-          title: '订单',
+          title: '外卖设置',
           component: () => import('../components/set.vue')
         },
         {
+          path: '/setUp/addressManagement',
+          name: 'addressManagement',
+          title: '常用地址',
+          component: () => import('../components/addressManagement.vue')
+        },
+        {
+          path: '/setUp/pictureManagement',
+          name: 'pictureManagement',
+          title: '图片管理',
+          component: () => import('../components/pictureManagement.vue')
+        },
+        {
           path: '/shopInfo/shopInfos',
           name: 'shopInfos',
           title: '门店管理',
@@ -55,6 +67,18 @@ const router = new Router({
           title: '手动发单',
           component: () => import('../components/manualCreate.vue')
         },
+        {
+          path: '/help',
+          name: 'help',
+          title: '帮助中心',
+          component: () => import('../components/help.vue')
+        },
+        {
+          path: '/about',
+          name: 'about',
+          title: '关于我们',
+          component: () => import('../components/about.vue')
+        },
 
       ]
     },

+ 19 - 5
src/store/index.js

@@ -1,16 +1,30 @@
 import Vue from 'vue';
 import Vuex from 'vuex';
-
+import { getConfig } from '../api/setting.js';
 Vue.use(Vuex);
 
 const state = {
-  userInfo: null || JSON.parse( localStorage.getItem('userInfo') )
+  userInfo: null || JSON.parse(localStorage.getItem('userInfo'))
 }
 
-const actions = {}
+const actions = {
+  getUserInfo(context) {
+    getConfig().then(res => {
+      if (res.code === 200) {
+        context.commit('SET_USERINFO', res.data)
+      } else {
+        this.$message({
+          type: 'error',
+          message: res.msg
+        })
+      }
+    })
+  }
+}
 
 const mutations = {
-  SET_USERINFO: ( state, userInfo ) => {
+  SET_USERINFO: (state, userInfo) => {
+    console.log('进来了', userInfo);
     state.userInfo = userInfo;
     // 防止页面刷新,导致Vuex重启
     localStorage.setItem('userInfo', JSON.stringify(userInfo));
@@ -18,7 +32,7 @@ const mutations = {
 }
 
 const getters = {
-  userInfo: ( state ) => {
+  userInfo: (state) => {
     return state.userInfo
   }
 }

+ 1 - 2
src/views/home.vue

@@ -3,7 +3,7 @@
     <sidebar></sidebar>
     <el-container>
       <el-header style="text-align: right;height: 80px;line-height: 80px;">
-        <span @click="showMerchant" v-if="memberType === 1" class="header-button">成为商户</span>
+        <span @click="showMerchant" v-if="$store.state.userInfo.memberType === 1" class="header-button">成为商户</span>
         <span @click="$router.push({
           path: '/shopInfo/shopAccount'
         })" class="header-button">充值中心</span>
@@ -38,7 +38,6 @@ export default {
     return {
       audio: null,
       productList: [],
-      memberType: this.$store.state.userInfo.memberType,
     };
   },
   computed: {

+ 10 - 4
src/views/login.vue

@@ -16,23 +16,23 @@
           <div class="login-password" v-if="activeIndex == 1">
             <div class="pass-item">
               <img src="../../static/image/phone-icon.png" class="phone-icon" />
-              <el-input placeholder="请输入手机号" v-model="mobile" class="input-phone" :maxlength="11" />
+              <el-input @keydown.enter.native="seachEnterFun" placeholder="请输入手机号" v-model="mobile" class="input-phone" :maxlength="11" />
             </div>
             <div class="pass-item">
               <img src="../../static/image/lock-icon.png" class="lock-icon" />
-              <el-input name='1' placeholder="用户密码" v-model="password" class="input-phone" type="password" />
+              <el-input @keydown.enter.native="seachEnterFun" name='1' placeholder="用户密码" v-model="password" class="input-phone" type="password" />
             </div>
           </div>
           <!-- 验证码登录 -->
           <div class="login-password" v-else>
             <div class="pass-item">
               <img src="../../static/image/phone-icon.png" class="phone-icon" />
-              <el-input placeholder="请输入手机号" v-model="mobile" class="input-phone" :maxlength="11" />
+              <el-input @keydown.enter.native="seachEnterFun" placeholder="请输入手机号" v-model="mobile" class="input-phone" :maxlength="11" />
             </div>
             <div class="pass-item">
               <img src="../../static/image/code-icon.png" class="phone-icon" />
               <el-input name="1" style="display:none;" />
-              <el-input name="2" placeholder="验证码" v-model="code" class="input-phone" :maxlength="4" />
+              <el-input @keydown.enter.native="seachEnterFun" name="2" placeholder="验证码" v-model="code" class="input-phone" :maxlength="4" />
               <div class="get-code" v-if="!showCode" @click.stop="getCode">获取短信验证码</div>
               <div class="get-code" v-else>{{ count }}秒</div>
             </div>
@@ -82,6 +82,12 @@ export default {
   },
   methods: {
     ...mapMutations(["SET_USERINFO"]),
+    seachEnterFun(e) {
+      var keyCode = window.event ? e.keyCode : e.which;
+      if (keyCode == 13) {
+        this.toLogin();
+      }
+    },
     // 短信验证码登录
     loginOfCode() {
       let params = {

BIN
static/image/about-bg.png


BIN
static/image/about-icon.png


BIN
static/image/download.png


BIN
static/image/help-icon.png


BIN
static/image/order-icon.png


BIN
static/image/pc-icon.png


BIN
static/image/setting-icon.png


BIN
static/image/shop-icon.png


BIN
static/image/update.png