Bladeren bron

Signed-off-by: 1004749546@qq.com <1004749546@qq.com>
修改下单地址显示不全bug

1004749546@qq.com 4 jaren geleden
bovenliggende
commit
e1812ef70d
2 gewijzigde bestanden met toevoegingen van 14 en 2 verwijderingen
  1. 3 0
      pages/toOrder/editAddress.vue
  2. 11 2
      pages/toOrder/index.vue

+ 3 - 0
pages/toOrder/editAddress.vue

@@ -69,6 +69,9 @@
 		onLoad(option) {
 			this.form = this.$store.state.vuex_OrderAddress
 			if (this.form.receiveAreasName) {
+				this.receiveAreas = this.form.receiveAreas
+				this.areaName = this.form.receiveAreasName
+				this.form.receiveAreasName = this.form.receiveAreasName.replace(/\,/g,'-')
 				uni.setNavigationBarTitle({
 					title: '修改地址'
 				})

+ 11 - 2
pages/toOrder/index.vue

@@ -9,7 +9,7 @@
 				<u-image height="40rpx" width="40rpx" src="/static/position.png"></u-image>
 			</view>
 			<view class="position">
-				 <view class="address">{{userInfo.receiveAddress}}</view>
+				 <view class="address">{{receiveAddress}}</view>
 				 <view>{{userInfo.receiverName +'&nbsp;&nbsp;&nbsp;' + userInfo.receiverPhone}}</view>
 			</view>
 			<view @click="editAddress">
@@ -134,12 +134,20 @@
 			uni.$once('setPswSuccess', this.setPsw)
 		},
 		computed: {
+			// 总计
 			totalPrice() {
 				let total = 0
 				this.goodsList.map(item => {
 					total = total + item.buyQty * item.goods.sellGold
 				})
 				return total 
+			},
+			// 收货地址
+			receiveAddress() { 
+				if (this.userInfo.receiveAreasName) {
+					let area = this.userInfo.receiveAreasName.split(',')
+					return area[0]+area[1]+area[2]+this.userInfo.receiveAddress
+				}
 			}
 		},
 		methods: {
@@ -230,8 +238,9 @@
 							buyQty: item.buyQty
 						}
 					})
+					
 					let params = {
-						receiveAddress: this.userInfo.receiveAddress,
+						receiveAddress: this.receiveAddress,
 						receiverName: this.userInfo.receiverName,
 						receiverPhone: this.userInfo.receiverPhone,
 						orderGoodsList: orderGoodsList,