Răsfoiți Sursa

1.allDelivery.vue检测地址与经纬度数据 2.取件时间组件实现调整与页面底部的间距

shizhongqi 6 luni în urmă
părinte
comite
991ee63de9

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

@@ -583,7 +583,7 @@
       />
 
       <!-- 取件时间选择器 -->
-      <TimePicker ref="timePicker" @confirm="handleTimeConfirm" />
+      <TimePicker ref="timePicker" :bottomOffset="80" @confirm="handleTimeConfirm" />
 
     </view>
   </view>

+ 17 - 0
ghsApp/src/admin/delivery/allDelivery.vue

@@ -171,6 +171,12 @@ export default {
         return 0;
       }
       return parseInt(item.price);
+    },
+    isClientAddressInvalid() {
+      return this.$util.isEmpty(this.receiverInfo.long) || this.$util.isEmpty(this.receiverInfo.lat) || this.$util.isEmpty(this.receiverInfo.address)
+    },
+    isSenderAddressInvalid() {
+      return this.$util.isEmpty(this.senderInfo.long) || this.$util.isEmpty(this.senderInfo.lat) || this.$util.isEmpty(this.senderInfo.address)
     }
   },
   onLoad(options) {
@@ -275,6 +281,17 @@ export default {
       });
     },
     loadDeliveryList() {
+      //客户地址不完善
+      if (this.isClientAddressInvalid) {
+        //this.$msg('客户地址不完善,无法获取运力');
+        return;
+      }
+      //门店
+      if (this.isSenderAddressInvalid) {
+        //this.$msg('门店地址不完善,无法获取运力');
+        return;
+      }
+      
       // 设置加载状态
       this.isLoadingDelivery = true;
       

+ 7 - 1
ghsApp/src/components/plugin/TimePicker.vue

@@ -1,6 +1,6 @@
 <template>
   <uni-popup ref="popup" type="bottom" :safe-area="false">
-    <view class="time-picker-container">
+    <view class="time-picker-container" :style="{ marginBottom: bottomOffset + 'rpx' }">
       <view class="picker-header">
         <text class="title">期望取件时间</text>
         <view class="close-btn" @click="close">
@@ -34,6 +34,12 @@ const minutes = [0, 10, 20, 30, 40, 50];
 
 export default {
   name: 'TimePicker',
+  props: {
+    bottomOffset: {
+      type: [Number, String],
+      default: 0
+    }
+  },
   data() {
     return {
       visible: false, // 控制picker-view的渲染

+ 1 - 1
hdApp/src/admin/billing/affirm.vue

@@ -494,7 +494,7 @@
     <mx-date-picker :show="reachDatePickerShow" format="yyyy-mm-dd" type="date" :value="reachDatePickerValue" :show-tips="true" @confirm="confirmReachDatePicker" @cancel="reachDatePickerShow = false" />
 
     <!-- 取件时间选择器 -->
-    <TimePicker ref="timePicker" @confirm="handleTimeConfirm" />
+    <TimePicker ref="timePicker" :bottomOffset="80" @confirm="handleTimeConfirm" />
 
     </view>
   </view>

+ 17 - 0
hdApp/src/admin/delivery/allDelivery.vue

@@ -164,6 +164,12 @@ export default {
         return 0;
       }
       return parseInt(item.price);
+    },
+    isClientAddressInvalid() {
+      return this.$util.isEmpty(this.receiverInfo.long) || this.$util.isEmpty(this.receiverInfo.lat) || this.$util.isEmpty(this.receiverInfo.address)
+    },
+    isSenderAddressInvalid() {
+      return this.$util.isEmpty(this.senderInfo.long) || this.$util.isEmpty(this.senderInfo.lat) || this.$util.isEmpty(this.senderInfo.address)
     }
   },
   onLoad(options) {
@@ -267,6 +273,17 @@ export default {
       });
     },
     loadDeliveryList() {
+      //客户地址不完善
+      if (this.isClientAddressInvalid) {
+        //this.$msg('客户地址不完善,无法获取运力');
+        return;
+      }
+      //门店
+      if (this.isSenderAddressInvalid) {
+        //this.$msg('门店地址不完善,无法获取运力');
+        return;
+      }
+
       // 设置加载状态
       this.isLoadingDelivery = true;
       

+ 7 - 1
hdApp/src/components/plugin/TimePicker.vue

@@ -1,6 +1,6 @@
 <template>
   <uni-popup ref="popup" type="bottom" :safe-area="false">
-    <view class="time-picker-container">
+    <view class="time-picker-container" :style="{ marginBottom: bottomOffset + 'rpx' }">
       <view class="picker-header">
         <text class="title">期望取件时间</text>
         <view class="close-btn" @click="close">
@@ -34,6 +34,12 @@ const minutes = [0, 10, 20, 30, 40, 50];
 
 export default {
   name: 'TimePicker',
+  props: {
+    bottomOffset: {
+      type: [Number, String],
+      default: 0
+    }
+  },
   data() {
     return {
       visible: false, // 控制picker-view的渲染