Funny 3 лет назад
Родитель
Сommit
7e34c24f56

+ 1 - 1
src/api/setting.js

@@ -52,5 +52,5 @@ export const defaultAddress = (params) => {
 }
 }
 // 同步外卖平台图片
 // 同步外卖平台图片
 export const syncFoodImg = (params) => {
 export const syncFoodImg = (params) => {
-  return post('app/waimai/syncFoodImg', params)
+  return get('app/waimai/syncFoodImg', params)
 }
 }

+ 17 - 7
src/components/shopCompoents/bindDelivery.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <div>
+  <div v-loading="loading" element-loading-text="数据加载中">
     <div v-if="deliveryList.length" class="take-out-list">
     <div v-if="deliveryList.length" class="take-out-list">
       <div class="item" v-for="(v, index) in deliveryList" :key="index">
       <div class="item" v-for="(v, index) in deliveryList" :key="index">
         <div class="item-top">
         <div class="item-top">
@@ -37,7 +37,7 @@
         <div v-if="v.bindStatus === 3" class="respect">{{ v.authMsg }}</div>
         <div v-if="v.bindStatus === 3" class="respect">{{ v.authMsg }}</div>
       </div>
       </div>
     </div>
     </div>
-    <el-empty v-else description="暂无绑定配送平台!"></el-empty>
+    <el-empty v-if="!deliveryList.length && !loading" description="暂无绑定配送平台!"></el-empty>
     <!-- UU跑腿 -->
     <!-- UU跑腿 -->
     <el-dialog :title="title" :visible.sync="centerDialogVisible" width="40%" center>
     <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">
       <el-form v-if="title === 'UU跑腿绑定'" :model="UUData" ref="UUData" label-width="80px" class="demo-ruleForm">
@@ -86,7 +86,7 @@
     </el-dialog>
     </el-dialog>
   </div>
   </div>
 </template>
 </template>
-
+     
 <script>
 <script>
 import {
 import {
   getDeliveryList,
   getDeliveryList,
@@ -107,6 +107,7 @@ export default {
       fullscreenLoading: false,
       fullscreenLoading: false,
       centerDialogVisible: false,
       centerDialogVisible: false,
       centerDialogVisible2: false,
       centerDialogVisible2: false,
+      loading: false,
       UUData: {
       UUData: {
         cityName: "",
         cityName: "",
         mobile: "",
         mobile: "",
@@ -168,8 +169,17 @@ export default {
       });
       });
     },
     },
     getDeliveryList() {
     getDeliveryList() {
+      this.loading = true;
       getDeliveryList().then((res) => {
       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) {
     checkPhone(phone) {
@@ -270,9 +280,9 @@ export default {
               this.jumpUrl = res.data;
               this.jumpUrl = res.data;
             } else {
             } else {
               this.$message({
               this.$message({
-                type: 'success',
-                message: '已成功绑定!'
-              })
+                type: "success",
+                message: "已成功绑定!",
+              });
               this.getDeliveryList();
               this.getDeliveryList();
             }
             }
           } else {
           } else {

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

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

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

@@ -33,7 +33,7 @@
         </div>
         </div>
       </div>
       </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>
     <el-dialog title="绑定美团外卖" :visible.sync="centerDialogVisible" width="520px" center>
       <div class="bind">
       <div class="bind">
         <div v-if="!showMT" @click="showMT = true" class="more">更多授权方式</div>
         <div v-if="!showMT" @click="showMT = true" class="more">更多授权方式</div>
@@ -111,20 +111,18 @@ export default {
   },
   },
   methods: {
   methods: {
     getShopList() {
     getShopList() {
+      this.loading = true;
       getShopList().then((res) => {
       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) {
     getBindTakeOutList(index) {

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

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <div class="shopList">
+  <div class="shopList" v-loading="loading" element-loading-text="数据加载中">
     <div class="header" v-if="shopList.length">
     <div class="header" v-if="shopList.length">
       <div class="left">
       <div class="left">
         <div class="line">
         <div class="line">
@@ -12,7 +12,7 @@
         <el-button class="btn" v-if="$store.state.userInfo.memberType === 2" @click.stop="addShop(1)">新增门店</el-button>
         <el-button class="btn" v-if="$store.state.userInfo.memberType === 2" @click.stop="addShop(1)">新增门店</el-button>
       </div>
       </div>
     </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="code" label="门店编号" width="170"></el-table-column>
       <el-table-column prop="name" label="门店名称" width="172" align="center"></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>
       <el-table-column prop="address" label="门店地址" width="321" align="center"></el-table-column>
@@ -32,7 +32,7 @@
         </template>
         </template>
       </el-table-column>
       </el-table-column>
     </el-table>
     </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>
     <shop-add @getData="getData" ref="shopAdd" :products="productList"></shop-add>
   </div>
   </div>
 </template>
 </template>
@@ -52,7 +52,6 @@ export default {
       memberType: this.$store.state.userInfo.memberType,
       memberType: this.$store.state.userInfo.memberType,
     };
     };
   },
   },
-
   mounted() {
   mounted() {
     if (this.memberType !== 1) {
     if (this.memberType !== 1) {
       this.getData();
       this.getData();