diff --git a/src/pages/confirmOrder/confirmOrder.vue b/src/pages/confirmOrder/confirmOrder.vue index 14eab55..aae4f40 100644 --- a/src/pages/confirmOrder/confirmOrder.vue +++ b/src/pages/confirmOrder/confirmOrder.vue @@ -23,19 +23,25 @@ @tap="toaddAddress" class="list order-user" > - + 默认{{addressInfo.name}} + > + 默认 + + {{addressInfo.name}} {{addressInfo.mobile}} - + {{addressInfo.address}}\n{{addressInfo.add_detail}} - + + + 点击添加地址 + { - if (code === 1) { - // console.log('code', code, data) this.showAddress = true - this.addressInfo = data - } + this.addressInfo = data + console.log("this.addressInfo", this.addressInfo) }) } }, @@ -375,10 +379,16 @@ export default { }) }, // 下单 - orderBuild() { + orderBuild() { + if(!this.addressInfo){ + uni.showLoading({ + title: '请先添加地址', + }) + return + } uni.showLoading({ title: '支付中', - }) + }) if (this.isCart === 'true') { const checkedGoods = [] const sk_id_arr = [] @@ -415,10 +425,10 @@ export default { // 支付 pay(res) { console.log('pay', res) - const { data, exKeyName: keyName } = res + const { data, exKeyName: keyName } = res const uid = uni.getStorageSync('uid') const timeStamp = new Date().getTime().toString() - const nonceStr = 'asfafasfasfasfasf' + const nonceStr = 'asfafasfasfasfasf' // 支付参数 const fieldSet = { openid: this.$store.state.user.userInfo.openid, @@ -433,8 +443,13 @@ export default { app_uid: 2020, timeStamp, keyname: keyName, - billInfo: JSON.stringify(data), - } + billInfo: JSON.stringify({ + address:this.addressInfo, + list:data, + keyname: keyName + }), + } + console.log("fieldSet", fieldSet) // 请求后台支付接口 store.dispatch('order/pay', fieldSet).then(({ data, data2, pay_id: payId }) => { if (data.return_code === 'SUCCESS' && data.result_code === 'SUCCESS') { diff --git a/src/pages/myOrderPaying/myOrderPaying.vue b/src/pages/myOrderPaying/myOrderPaying.vue index 4bffccd..60a55c0 100644 --- a/src/pages/myOrderPaying/myOrderPaying.vue +++ b/src/pages/myOrderPaying/myOrderPaying.vue @@ -43,12 +43,12 @@ - {{orderAddressInfo.userName}} - {{orderAddressInfo.telNumber}} + {{orderAddressInfo.name}} + {{orderAddressInfo.mobile}} - {{orderAddressInfo.provinceName}} {{orderAddressInfo.cityName}} {{orderAddressInfo.countyName}}\n{{orderAddressInfo.detailInfo}} + {{orderAddressInfo.address}}