|
|
@ -2,7 +2,7 @@
|
|
|
|
* @Author: ch
|
|
|
|
* @Author: ch
|
|
|
|
* @Date: 2022-03-20 14:14:53
|
|
|
|
* @Date: 2022-03-20 14:14:53
|
|
|
|
* @LastEditors: ch
|
|
|
|
* @LastEditors: ch
|
|
|
|
* @LastEditTime: 2022-04-18 18:33:51
|
|
|
|
* @LastEditTime: 2022-04-19 10:58:00
|
|
|
|
* @Description: file content
|
|
|
|
* @Description: file content
|
|
|
|
-->
|
|
|
|
-->
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
@ -108,7 +108,9 @@ export default {
|
|
|
|
if(query.mode === 'buyNow'){
|
|
|
|
if(query.mode === 'buyNow'){
|
|
|
|
res = await ApiGetBeforeOrder({
|
|
|
|
res = await ApiGetBeforeOrder({
|
|
|
|
productSkuId : query.skuId,
|
|
|
|
productSkuId : query.skuId,
|
|
|
|
quantity : query.num
|
|
|
|
quantity : query.num,
|
|
|
|
|
|
|
|
// 1正常购买 2活动购买
|
|
|
|
|
|
|
|
activityType : query.activityType
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(res.error){
|
|
|
|
if(res.error){
|
|
|
@ -123,13 +125,15 @@ export default {
|
|
|
|
* 提交订单
|
|
|
|
* 提交订单
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
async submit(){
|
|
|
|
async submit(){
|
|
|
|
|
|
|
|
const {query} = this.$Route;
|
|
|
|
const {error, result} = await ApiPostSubmitOrder({
|
|
|
|
const {error, result} = await ApiPostSubmitOrder({
|
|
|
|
orderSource : 2,
|
|
|
|
orderSource : 2,
|
|
|
|
recipientAddressId : this.address.id,
|
|
|
|
recipientAddressId : this.address.id,
|
|
|
|
products : this.orderInfo.products.map(i => ({
|
|
|
|
products : this.orderInfo.products.map(i => ({
|
|
|
|
productId : i.productId,
|
|
|
|
productId : i.productId,
|
|
|
|
productSkuId : i.productSkuId,
|
|
|
|
productSkuId : i.productSkuId,
|
|
|
|
quantity : i.quantity
|
|
|
|
quantity : i.quantity,
|
|
|
|
|
|
|
|
activityType : query.activityType
|
|
|
|
})),
|
|
|
|
})),
|
|
|
|
userMessage : this.userMessage
|
|
|
|
userMessage : this.userMessage
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -140,11 +144,11 @@ export default {
|
|
|
|
this.wxpay(result.orderId);
|
|
|
|
this.wxpay(result.orderId);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
async wxpay(orderId){
|
|
|
|
async wxpay(orderId){
|
|
|
|
const {error, result} = await ApiPostWxPay({orderId});
|
|
|
|
const {error, result} = await ApiPostWxPay({orderId,payTypeEnum:'WXPAY'});
|
|
|
|
if(error){
|
|
|
|
if(error){
|
|
|
|
this.$Router.push(`/payFail?ordId=${orderId}`)
|
|
|
|
this.$Router.replace(`/payFail?ordId=${orderId}`)
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
this.$Router.push(`/paySuccess?ordId=${orderId}`)
|
|
|
|
this.$Router.replace(`/paySuccess?ordId=${orderId}`)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|