From 37f3387c9a521db64ac886200ccb0aa1aae1cfda Mon Sep 17 00:00:00 2001
From: BigBoss <2280520255@qq.com>
Date: Sun, 7 Jun 2020 23:45:15 +0800
Subject: [PATCH] =?UTF-8?q?=E8=B4=AD=E7=89=A9=E8=BD=A6=E6=94=AF=E4=BB=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/CommodityCard/CommodityCard.vue | 2 +-
src/pages/confirmOrder/confirmOrder.vue | 62 +++++++++++++++++---------
2 files changed, 42 insertions(+), 22 deletions(-)
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) {
--
2.0.0