diff --git a/src/components/CommodityCard/CommodityCard.vue b/src/components/CommodityCard/CommodityCard.vue index a430f2d..7cce3d2 100644 --- a/src/components/CommodityCard/CommodityCard.vue +++ b/src/components/CommodityCard/CommodityCard.vue @@ -77,7 +77,7 @@ image { } .name { width: 92%; - height: 76rpx; + height: 84rpx; padding: 5px 4%; box-sizing: border-box; display: -webkit-box; diff --git a/src/pages/confirmOrder/confirmOrder.vue b/src/pages/confirmOrder/confirmOrder.vue index d17b9c5..9985847 100644 --- a/src/pages/confirmOrder/confirmOrder.vue +++ b/src/pages/confirmOrder/confirmOrder.vue @@ -73,7 +73,7 @@ type="default" @click="counter(false,index)" >- - {{count}} + {{checkedCartLst[index].num}} { @@ -360,7 +362,7 @@ export default { url: `../address/addressList?edit=${1}`, success: res => {}, fail: error => { - // console.log('跳转到地址列表页面失败====>', error) + console.log('跳转到地址列表页面失败====>', error) }, complete: () => {}, }) @@ -370,20 +372,38 @@ export default { uni.showLoading({ title: '支付中', }) - // console.log('this', this.$store.state) - const { sk_id_arr: skId, mp_id: mpId } = this.$store.state.order.param - store.dispatch('order/buyNow', { - pid: skId.pid, - sk_id: skId.sk_id, - number: this.count, - mp_id: mpId, - address: JSON.stringify(this.addressInfo), - totalPrice: this.totalPrice, - liuyan: this.note, - dir: 1, - }).then((res) => { - this.pay(res.data) - }) + if(this.isCart == 'true'){ + const checkedGoods = [] + const sk_id_arr = [] + this.checkedCartLst.map(item=>{ + checkedGoods.push(item.pid) + sk_id_arr.push(item.sk_id) + }) + store.dispatch('order/build', { + uid: this.$store.state.user.userInfo.uid, + address: JSON.stringify(this.addressInfo), + checkedGoods:checkedGoods, + sk_id_arr: sk_id_arr, + totalPrice: this.totalPrice, + }).then((res) => { + this.pay(res.data) + }) + } + if(this.isCart == 'false'){ + const { sk_id_arr: skId, mp_id: mpId } = this.$store.state.order.param + store.dispatch('order/buyNow', { + pid: skId.pid, + sk_id: skId.sk_id, + number: this.count, + mp_id: mpId, + address: JSON.stringify(this.addressInfo), + totalPrice: this.totalPrice, + liuyan: this.note, + dir: 1, + }).then((res) => { + this.pay(res.data) + }) + } }, // 支付 pay(res) {