|
@@ -213,6 +213,7 @@
|
|
|
},
|
|
|
methods: {
|
|
|
async initStorage(option){
|
|
|
+ console.log(option)
|
|
|
const data = JSON.parse(option.data)
|
|
|
const userInfo = await this.$api.getStorage()
|
|
|
console.log('infodata',data)
|
|
@@ -223,12 +224,14 @@
|
|
|
this.confirmParam.cartType = 2
|
|
|
this.productParam.productCount = data.data.productCount
|
|
|
this.productParam.productId = data.data.productIds
|
|
|
- this.productIds = this.postageParam.productIds = data.data.productIds
|
|
|
+ // this.productIds = this.postageParam.productIds = data.data.productIds
|
|
|
+ this.productIds = data.data.productIds
|
|
|
this.GetProductCreateOrderInfo()
|
|
|
}else{
|
|
|
this.confirmParam.cartType = 1
|
|
|
this.confirmType = 2
|
|
|
- this.productIds = this.cartParam.productIds = this.postageParam.productIds = data.data.productIds
|
|
|
+ // this.productIds = this.cartParam.productIds = this.postageParam.productIds = data.data.productIds
|
|
|
+ this.productIds = this.cartParam.productIds = data.data.productIds
|
|
|
this.CartCreateOrderInfo()
|
|
|
}
|
|
|
},
|
|
@@ -250,6 +253,8 @@
|
|
|
}
|
|
|
this.orderShouldPayFee = this.allPrice - this.couponAmount
|
|
|
this.totalDiscountAmount = this.reducedPrice + this.couponAmount
|
|
|
+ this.postageParam.productIds = this.getProductIds(data.list)
|
|
|
+ this.getAddressData()
|
|
|
})
|
|
|
.catch(error =>{
|
|
|
this.$util.msg(error.msg,2000)
|
|
@@ -259,6 +264,7 @@
|
|
|
this.OrderService.CartCreateOrderInfo(this.cartParam).then(response =>{
|
|
|
let data = response.data
|
|
|
this.isRequest = true
|
|
|
+ debugger
|
|
|
this.goodsData = data.list
|
|
|
this.couponList = data.couponList
|
|
|
this.userMoney = data.userMoney
|
|
@@ -273,11 +279,25 @@
|
|
|
}
|
|
|
this.orderShouldPayFee = this.allPrice - this.couponAmount
|
|
|
this.totalDiscountAmount = this.reducedPrice + this.couponAmount
|
|
|
+ this.postageParam.productIds = this.getProductIds(data.list)
|
|
|
+ this.getAddressData()
|
|
|
})
|
|
|
.catch(error =>{
|
|
|
this.$util.msg(error.msg,2000)
|
|
|
})
|
|
|
},
|
|
|
+ // 获取订单商品id列表
|
|
|
+ getProductIds(list){
|
|
|
+ const productIds = []
|
|
|
+ list.forEach(function(supplier){
|
|
|
+ supplier.cartList.forEach(function(product){
|
|
|
+ productIds.push(product.productId)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ // console.log(list);
|
|
|
+ return productIds.join(',')
|
|
|
+ },
|
|
|
+
|
|
|
getFreightData(){// 获取邮费信息
|
|
|
this.isFreight = false
|
|
|
this.OrderService.GetOrderPostage(this.postageParam).then(response =>{
|
|
@@ -359,6 +379,7 @@
|
|
|
},
|
|
|
hanldFreightBeans(data){//是否勾选采美豆抵扣
|
|
|
this.isCheckedBeans = data
|
|
|
+ console.log(this.confirmParam.payInfo)
|
|
|
if(this.isCheckedBeans){
|
|
|
// 判断如果采美豆大于等于运费*100
|
|
|
if( this.freightData.userBeans > 0 ){
|
|
@@ -537,6 +558,9 @@
|
|
|
}
|
|
|
}).catch(error =>{
|
|
|
this.isSubLoading = false
|
|
|
+ this.confirmParam.payInfo = JSON.parse(this.confirmParam.payInfo)
|
|
|
+ this.confirmParam.orderInfo = JSON.parse(this.confirmParam.orderInfo)
|
|
|
+ this.confirmParam.orderInvoice = JSON.parse(this.confirmParam.orderInvoice)
|
|
|
this.$util.msg(error.msg,3000)
|
|
|
})
|
|
|
},
|