From 248b0e031d417ecaf98a5675a2f2ffd7d8415f9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=89=E9=B9=8F?= Date: Mon, 15 Jun 2020 16:22:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=94=AF=E4=BB=98=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/confirmOrder/confirmOrder.vue | 45 ++++++++++++++++++++----------- src/pages/myOrderPaying/myOrderPaying.vue | 6 ++--- 2 files changed, 33 insertions(+), 18 deletions(-) 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}} -- 2.0.0