Commit 8b4f9042 by zhangxw

确认订单地址选择修改

1 parent dc6fa1e2
...@@ -126,8 +126,9 @@ Page({ ...@@ -126,8 +126,9 @@ Page({
}) })
}, },
checkOut() { checkOut() {
let { money, walletObj } = this.data let { money, walletObj, contactInfo } = this.data
if (money > walletObj?.currentScore) return // 积分不足 if (money > walletObj?.currentScore) return // 积分不足
if (!Object.keys(contactInfo)?.length) return wx.p.wxApi.showToast('请选择收货地址')
this.setData({ this.setData({
showModal: true showModal: true
}) })
...@@ -180,7 +181,7 @@ Page({ ...@@ -180,7 +181,7 @@ Page({
let { goodsInfo } = this.data let { goodsInfo } = this.data
mineApi.getCustomerAddressList().then(res => { mineApi.getCustomerAddressList().then(res => {
let obj = {} let obj = {}
res?.forEach(val => { res?.forEach((val, index) => {
if ((!goodsInfo?.defaultAddress && val.isDefault == 1) || if ((!goodsInfo?.defaultAddress && val.isDefault == 1) ||
(goodsInfo?.defaultAddress?.id == val.id)) { (goodsInfo?.defaultAddress?.id == val.id)) {
obj = { obj = {
...@@ -189,6 +190,14 @@ Page({ ...@@ -189,6 +190,14 @@ Page({
contactPhone: val.receiveMobile, contactPhone: val.receiveMobile,
contactAddress: `${val.provinceName}${val.cityName}${val.countyName}${val.address}` contactAddress: `${val.provinceName}${val.cityName}${val.countyName}${val.address}`
} }
} else {
let data = res[0]
obj = {
...data,
contactName: data.receiveName,
contactPhone: data.receiveMobile,
contactAddress: `${data.provinceName}${data.cityName}${data.countyName}${data.address}`
}
} }
}) })
this.setData({ this.setData({
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
</view> </view>
<view class="text"> <view class="text">
<view class="text-hide">{{item.goodsSkuName}}</view> <view class="text-hide">{{item.goodsSkuName}}</view>
<view class="specification" wx:if="{{item.specificationData}}">{{item.specificationData}}</view> <view class="specification text-hide" wx:if="{{item.specificationData}}">{{item.specificationData}}</view>
<view class="price-box" wx:if="{{!item.flag}}"> <view class="price-box" wx:if="{{!item.flag}}">
<view class="price"> <view class="price">
{{item.redeemPoints || 0}} {{item.redeemPoints || 0}}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!