Просмотр исходного кода

配送平台报价页面动力获取结果提示优化

shizhongqi 7 месяцев назад
Родитель
Сommit
62ff38be7e

+ 1 - 7
ghsApp/src/admin/billing/affirm.vue

@@ -379,18 +379,12 @@ export default {
     };
   },
   onLoad (option) {
-
     this.book = this.option.book ? this.option.book : 0
-
     this.kdType = option.kdType
-
     let that = this
     this.initMerchantInfo().then((data) => {
-
         uni.setNavigationBarTitle({ title: data.name })
-
         that.currentShop = data.shopInfo
-
     })
 
     //默认送货
@@ -421,9 +415,9 @@ export default {
     }
 	  //#endif
 
+    // 不主动加载花材,避免影响性能。有执行 takeItem 时会自动加载花材。
     this.listenScanItem()
 
-
     getStaffInfo().then(res=>{
       if(res.code == 1){
         let staffInfo = res.data.staff?res.data.staff:[]

+ 1 - 1
ghsApp/src/admin/billing/index2.vue

@@ -233,7 +233,7 @@ export default {
 			let customName = this.option.customName ? this.option.customName : '';
 			let orderId = this.option.orderId  ? this.option.orderId : 0
 			let book = this.option.book ? this.option.book : 0
-			this.$util.pageTo({ url: '/admin/billing/affirm',type:2,query: {customId:this.option.customId,customName:customName,orderId:orderId,book:book}})
+			this.$util.pageTo({ url: '/admin/billing/affirm', type:2, query: {customId:this.option.customId,customName:customName,orderId:orderId,book:book}})
 		}
 	}
 };

+ 16 - 3
ghsApp/src/admin/delivery/allDelivery.vue

@@ -101,8 +101,13 @@
       <!-- 没有运力时显示提示 -->
       <view class="no-delivery-list" v-if="deliveryList.length === 0">
         <text class="no-delivery-icon">🛵</text>
-        <text class="no-delivery-text">请点击"加载运力"按钮获取运力</text>
-        <text class="no-delivery-subtext">如无运力请稍后再试</text>
+        <template v-if="!hasAttemptedLoad">
+          <text class="no-delivery-text">请点击"加载运力"获取运力</text>
+          <text class="no-delivery-subtext">如无运力请稍后再试</text>
+        </template>
+        <template v-else>
+          <text class="no-delivery-text">没有可用配送,请击"加载运力"重试</text>
+        </template>
       </view>
     </view>
 
@@ -189,6 +194,8 @@ export default {
         },
         // 加载运力的loading状态
         isLoadingDelivery: false,
+        // 是否已经尝试加载过运力
+        hasAttemptedLoad: false,
         // 重量输入防抖定时器
         weightDebounceTimer: null,
     };
@@ -295,6 +302,7 @@ export default {
     clearDeliveryList() {
       this.deliveryList = [];
       this.selectedDelivery = null;
+      this.hasAttemptedLoad = false;
     },
 
     // 保存表单数据的当前值
@@ -348,6 +356,7 @@ export default {
       }).finally(() => {
         // 无论成功失败都要关闭加载状态
         this.isLoadingDelivery = false;
+        this.hasAttemptedLoad = true;
       });
     },
     selectDelivery(item) {
@@ -399,7 +408,11 @@ export default {
     },
     submitOrder() {
       const selectedItem = this.selectedDeliveryItem;
-      if (!selectedItem || selectedItem.price === '暂无报价') {
+      if (!selectedItem) {
+          this.$msg('请选择一个配送方式');
+          return;
+      }
+      if(selectedItem.price === 0) {
           this.$msg('该平台暂无报价,请选择其他平台');
           return;
       }

+ 7 - 0
ghsApp/src/mixins/product.js

@@ -501,6 +501,13 @@ export default {
 			let current = null
 			let unitPrice = 0
 			let unitName = ''
+
+			if(this.globalAllProduct.length == 0){
+				this.listenScanItem()
+				
+				// this.$msg('请先载入花材(此功能已关闭,请联系管理员)')
+				// return false
+			}
 			//花材
 			current = this.globalAllProduct.find(function(val){
 				return Number(val.itemId) == Number(code)