|
@@ -115,41 +115,6 @@
|
|
|
import exchangeCoupon from '@/components/cm-module/creatOrder/exchangeCoupon'
|
|
|
import freight from '@/components/cm-module/creatOrder/freight'
|
|
|
import freightAlert from '@/components/cm-module/modelAlert/freightAlert'
|
|
|
- const defaultProductParam = {
|
|
|
- productCount:0, // 商品数量
|
|
|
- productId:0, // 商品Id
|
|
|
- source:2, // 来源:1WWW 2小程序
|
|
|
- userId:0 // 用户Id
|
|
|
- }
|
|
|
- const defaultCartParam = {
|
|
|
- productIds:0, // 商品Id(逗号隔开)
|
|
|
- source:2, // 来源:1WWW 2小程序
|
|
|
- userId:0 // 用户Id
|
|
|
- }
|
|
|
- const defaultPostageParam = {
|
|
|
- productIds:0, // 商品Id(逗号隔开)
|
|
|
- userId:0, // 用户Id
|
|
|
- townId:0 // 地区Id
|
|
|
- }
|
|
|
- const defaultConfirmParam = {
|
|
|
- cartType:1, // 购买类型:(1自主下单, 3协销下单)
|
|
|
- orderSource:6, // 订单来源 1WWW 6小程序[采美,星范]
|
|
|
- addressId:0, // 收货地址Id
|
|
|
- clubCouponId:0, // 关联优惠券Id
|
|
|
- clubId:0, // 机构Id
|
|
|
- orderInfo:[], // 订单商品数据
|
|
|
- orderInvoice:{type:0}, // 订单发票信息
|
|
|
- payInfo:{ // 订单金额数据
|
|
|
- orderShouldPayFee: 0, // 订单最终支付金额
|
|
|
- balancePayFlag: 0, // 勾选余额的状态(1使用,0不使用)
|
|
|
- clauseId:0, // 条款Id
|
|
|
- postage: 0, // 运费金额
|
|
|
- postageFlag: 0, // 运费类型
|
|
|
- userBeans: 0, // 抵扣采美豆数量
|
|
|
- rebateFlag:0 // 是否返佣订单
|
|
|
- },
|
|
|
- unionId:uni.getStorageSync('unionId'),// 用户unionId
|
|
|
- }
|
|
|
export default {
|
|
|
components:{
|
|
|
choiceAddress,
|
|
@@ -166,10 +131,41 @@
|
|
|
isSubLoading:false,
|
|
|
confirmType:1,
|
|
|
orderID:0,
|
|
|
- cartParam: Object.assign({}, defaultCartParam), // 购物车立即结算确认订单参数
|
|
|
- productParam: Object.assign({}, defaultProductParam), // 商品立即购买确认订单参数
|
|
|
- postageParam: Object.assign({}, defaultPostageParam), // 邮费计算参数
|
|
|
- confirmParam: Object.assign({}, defaultConfirmParam), // 提交订单参数
|
|
|
+ cartParam: {// 购物车立即结算确认订单参数
|
|
|
+ productIds:0, // 商品Id(逗号隔开)
|
|
|
+ source:2, // 来源:1WWW 2小程序
|
|
|
+ userId:0 // 用户Id
|
|
|
+ },
|
|
|
+ productParam: {// 商品立即购买确认订单参数
|
|
|
+ productCount:0, // 商品数量
|
|
|
+ productId:0, // 商品Id
|
|
|
+ source:2, // 来源:1WWW 2小程序
|
|
|
+ userId:0 // 用户Id
|
|
|
+ },
|
|
|
+ postageParam: {// 邮费计算参数
|
|
|
+ productIds:0, // 商品Id(逗号隔开)
|
|
|
+ userId:0, // 用户Id
|
|
|
+ townId:0 // 地区Id
|
|
|
+ },
|
|
|
+ confirmParam: {
|
|
|
+ cartType:1, // 购买类型:(1自主下单, 3协销下单)
|
|
|
+ orderSource:6, // 订单来源 1WWW 6小程序[采美,星范]
|
|
|
+ addressId:0, // 收货地址Id
|
|
|
+ clubCouponId:0, // 关联优惠券Id
|
|
|
+ clubId:0, // 机构Id
|
|
|
+ orderInfo:[], // 订单商品数据
|
|
|
+ orderInvoice:{type:0}, // 订单发票信息
|
|
|
+ payInfo:{ // 订单金额数据
|
|
|
+ orderShouldPayFee: 0, // 订单最终支付金额
|
|
|
+ balancePayFlag: 0, // 勾选余额的状态(1使用,0不使用)
|
|
|
+ clauseId:0, // 条款Id
|
|
|
+ postage: 0, // 运费金额
|
|
|
+ postageFlag: 0, // 运费类型
|
|
|
+ userBeans: 0, // 抵扣采美豆数量
|
|
|
+ rebateFlag:0 // 是否返佣订单
|
|
|
+ },
|
|
|
+ unionId:uni.getStorageSync('unionId'),// 用户unionId
|
|
|
+ }, // 提交订单参数
|
|
|
productIds:'', // 获取上一级页面商品信息
|
|
|
submitState:'', // 提交状态
|
|
|
totalCount:1, // 订单提交总数量
|
|
@@ -429,6 +425,7 @@
|
|
|
this.confirmParam.payInfo.balancePayFlag = 1
|
|
|
this.attributePallPrice()
|
|
|
}else{
|
|
|
+ this.confirmParam.payInfo.balancePayFlag = 0
|
|
|
if(this.hanldFreePostFlag == 1 || this.hanldFreePostFlag == '1'){ //如果是有运费时
|
|
|
if(this.isCheckedBeans){
|
|
|
this.orderShouldPayFee = this.allPrice - this.couponAmount
|
|
@@ -438,7 +435,6 @@
|
|
|
}else{
|
|
|
this.orderShouldPayFee = this.allPrice - this.couponAmount
|
|
|
}
|
|
|
- this.confirmParam.payInfo.balancePayFlag = 0
|
|
|
}
|
|
|
console.log('最终订单支付金额',this.orderShouldPayFee)
|
|
|
console.log('优惠券金额',this.couponAmount)
|
|
@@ -530,7 +526,7 @@
|
|
|
this.confirmParam.orderInfo = JSON.stringify(this.confirmParam.orderInfo)
|
|
|
this.confirmParam.orderInvoice = JSON.stringify(this.confirmParam.orderInvoice)
|
|
|
console.log(this.confirmParam)
|
|
|
- this.isSubLoading = true
|
|
|
+ this.isSubLoading = true
|
|
|
this.OrderService.CreatedOrderSubmit(this.confirmParam).then(response =>{
|
|
|
let data = response.data
|
|
|
// 友盟埋点收集机构自主提交订单
|
|
@@ -541,13 +537,13 @@
|
|
|
Um_Key_OrderID:`${data.orderId}`
|
|
|
})
|
|
|
}
|
|
|
- console.log('机构提交订单机构提交订单机构提交订单机构提交订单')
|
|
|
if(data.code === 1){
|
|
|
this.submitState ='success'
|
|
|
setTimeout(()=>{
|
|
|
this.isSubLoading = false
|
|
|
},2000)
|
|
|
- this.$api.navigateTo(`/pages/user/order/success?data=${JSON.stringify({data:{orderId:data.orderId}})}`)
|
|
|
+
|
|
|
+ this.$api.redirectTo(`/pages/user/order/success?data=${JSON.stringify({data:{orderId:data.orderId}})}`)
|
|
|
}else{
|
|
|
this.submitState ='confirm'
|
|
|
this.$util.msg('订单提交成功',3000,true,'success')
|