shish 11 miesięcy temu
rodzic
commit
feeba2d82d

+ 8 - 6
mallApp/src/components/app-delivery.vue

@@ -4,11 +4,11 @@
     <div class="module-com">
       <tui-list-cell class="line-cell" :hover="false">
         <div class="tui-title">收花人姓名</div>
-        <input v-model="form.receiveUserName" placeholder-class="phcolor" placeholder-style="color:#ccc" class="tui-input" name="receiveUserName" placeholder="请填写姓名" />
+        <input v-model="form.receiveUserName" placeholder-class="phcolor" placeholder-style="color:#ccc" @blur="onInputBlur" class="tui-input" name="receiveUserName" placeholder="请填写姓名" />
       </tui-list-cell>
       <tui-list-cell class="line-cell" :hover="false">
         <div class="tui-title">收花人电话</div>
-        <input v-model="form.receiveMobile" placeholder-class="phcolor" placeholder-style="color:#ccc" class="tui-input" name="receiveMobile" placeholder="请填写电话" type="number" />
+        <input v-model="form.receiveMobile" placeholder-class="phcolor" placeholder-style="color:#ccc" @blur="onInputBlur" class="tui-input" name="receiveMobile" placeholder="请填写电话" type="number" />
       </tui-list-cell>
       <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="openAddres">
         <div class="tui-title">所在城市</div>
@@ -51,7 +51,7 @@
 
       <tui-list-cell class="line-cell" :hover="false" v-show="showCardInfo">
         <div class="tui-title">贺卡内容</div>
-        <input v-model="form.cardInfo" placeholder-class="phcolor" placeholder-style="color:#ccc" class="tui-input" name="cardInfo" style="width:100%;" placeholder="请填写,不要贺卡请写不要贺卡" />
+        <input v-model="form.cardInfo" placeholder-class="phcolor" placeholder-style="color:#ccc" class="tui-input" name="cardInfo" style="width:100%;" placeholder="请填写" />
 
       </tui-list-cell>
 
@@ -70,7 +70,7 @@
     <div class="module-com remark-wrap">
       <tui-list-cell class="line-cell" :hover="false">
         <div class="tui-title">备注内容</div>
-        <input v-model="form.remark" placeholder-class="phcolor" placeholder-style="color:#ccc" class="tui-input" name="remark" placeholder="选填" />
+        <input v-model="form.remark" placeholder-class="phcolor" placeholder-style="color:#ccc" class="tui-input" name="remark" placeholder="选填,不需要贺卡这里备注" />
       </tui-list-cell>
     </div>
     <!-- 省市联动 -->
@@ -169,14 +169,16 @@ export default {
       this.showRegion = true;
     },
     changeAreaFn(e) {
-      //console.log("changeAreaFn", e);
       this.form.address = e.name;
       this.form.showAddress = e.address;
       let locationStr = e.location
       let fruits = locationStr.split(",").map(fruit => fruit.trim());
       this.region.latitude = fruits[1];
       this.region.longitude = fruits[0];
-      this.$emit("changeAddress", e);
+      this.$emit("countFreight")
+    },
+    onInputBlur(){
+      this.$emit("countFreight")
     },
     anonymityChange(e) {
       this.form.anonymity = e.detail.value == 1 ? 1 : 0;

+ 7 - 7
mallApp/src/pages/order/buy.vue

@@ -20,7 +20,7 @@
         </tui-list-cell>
       </view>
       <block v-if="form.sendType == 2">
-        <app-delivery-module ref="appDelivery" @changeAddress="changeAddress" :hasMap="hasMap" />
+        <app-delivery-module ref="appDelivery" @countFreight="countFreight" :hasMap="hasMap" />
       </block>
 
       <view class="module-com input-line-wrap" v-if="form.sendType == 2">
@@ -29,9 +29,9 @@
             <view class="tui-input">{{ showDistance }}公里</view>
         </tui-list-cell>
         <tui-list-cell class="line-cell" :hover="false">
-            <view class="tui-title">费</view>
+            <view class="tui-title">跑腿费</view>
             <view class="tui-input" v-if="isFreight">¥{{ freightPrice?parseFloat(freightPrice):0 }}</view>
-            <view class="tui-input" v-else>免费</view>
+            <view class="tui-input" v-else>免跑腿费</view>
         </tui-list-cell>
       </view>
       <view style="height:90upx;"> </view>
@@ -129,11 +129,11 @@ export default {
 			this.form.sendType = num
 			if(num == 2){
 				this.$nextTick(()=>{
-					this.changeAddress()
+					this.countFreight()
 				})
 			}
 		},
-    changeAddress() {
+    countFreight() {
       const ref = this.$refs.appDelivery
       if(!ref || !ref.region) return
       let lat = ref.region.latitude;
@@ -178,8 +178,8 @@ export default {
           if (res && res.code == 1) {
             const data = res.data || {};
             this.freightPrice = data.est_fee ? parseFloat(Number(data.est_fee/100)) : 0;
-            this.showDistance = (data.distance/1000 || 0).toFixed(2);
-            this.form.sendDistance = (data.distance/1000 || 0).toFixed(2);
+            this.showDistance = parseFloat((data.distance/1000 || 0).toFixed(2))
+            this.form.sendDistance = parseFloat((data.distance/1000 || 0).toFixed(2))
             this.form.sendCost = this.isFreight ? this.freightPrice : 0
           }
         }).catch(() => {});