|
@@ -51,6 +51,11 @@ var shoppingConfirm = new Vue({
|
|
|
productParam: Object.assign({}, defaultProductParam), // 商品立即购买确认订单参数
|
|
|
postageParam: Object.assign({}, defaultPostageParam), // 邮费计算参数
|
|
|
confirmParam: Object.assign({}, defaultConfirmParam), // 提交订单参数
|
|
|
+ supportParm:{// 组合商品立即购买确认订单参数
|
|
|
+ productInfo:'',
|
|
|
+ source:2, // 来源:1WWW 2小程序
|
|
|
+ userId:0 // 用户Id
|
|
|
+ },
|
|
|
address: {
|
|
|
id: '',
|
|
|
townId: '',
|
|
@@ -164,34 +169,18 @@ var shoppingConfirm = new Vue({
|
|
|
if(_self.userId ===0){return;}
|
|
|
OrderApi.ProductCreateOrderInfo(_self.productParam,function(response){
|
|
|
if (response.code === 0 ) {
|
|
|
- var data = response.data;
|
|
|
- _self.listData = data.list;
|
|
|
- _self.totalPrice = data.totalPrice;
|
|
|
- _self.reducedPrice = data.reducedPrice;
|
|
|
- _self.totalCount = data.totalCount;
|
|
|
- _self.kindCount = data.kindCount;
|
|
|
- _self.balance.userMoney = data.userMoney;
|
|
|
- _self.balance.originUserMoney = data.userMoney;
|
|
|
- _self.hanldShouldPayFee = data.totalPrice;
|
|
|
- _self.svipReducedPrice = data.svipReducedPrice;
|
|
|
- _self.postageParam.productIds = _self.getProductIds(data.list); // 获取订单商品id列表 以 , 隔开
|
|
|
- console.log('邮费接口数据', _self.postageParam)
|
|
|
- _self.getAddressList(_self.userId,20);
|
|
|
- if( data.couponList && data.couponList.length>0){
|
|
|
- _self.isCouponShow = true;
|
|
|
- _self.couponAmount = data.couponList[0].couponAmount;
|
|
|
- _self.confirmParam.clubCouponId = data.couponList[0].clubCouponId;
|
|
|
- data.couponList.forEach((el) => {
|
|
|
- _self.couponList.push(Object.assign(el,{ischecked:false}))
|
|
|
- })
|
|
|
- _self.couponList[0].ischecked = true;
|
|
|
- _self.hanldShouldPayFee = data.totalPrice - _self.couponAmount;
|
|
|
- }
|
|
|
- _self.totalDiscountAmount = _self.reducedPrice + _self.couponAmount;
|
|
|
- if(data.invoice){
|
|
|
- data.invoice.type = 0;
|
|
|
- _self.orderInvoice = data.invoice;
|
|
|
- }
|
|
|
+ _self.setCreatDataInfo(response.data)
|
|
|
+ }else{
|
|
|
+ CAIMEI.Alert(r.msg, '确定', false);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ OrderClubProductSupporting:function(){// 组合商品确认订单初始化
|
|
|
+ var _self = this;
|
|
|
+ if(_self.userId ===0){return;}
|
|
|
+ OrderApi.OrderClubProductSupporting(_self.supportParm,function(response){
|
|
|
+ if (response.code === 0 ) {
|
|
|
+ _self.setCreatDataInfo(response.data)
|
|
|
}else{
|
|
|
CAIMEI.Alert(r.msg, '确定', false);
|
|
|
}
|
|
@@ -202,39 +191,42 @@ var shoppingConfirm = new Vue({
|
|
|
if(_self.userId ===0){return;}
|
|
|
OrderApi.GetOrderConfirmInfo(_self.cartParam,function(response){
|
|
|
if (response.code === 0 ) {
|
|
|
- var data = response.data;
|
|
|
- _self.listData = data.list;
|
|
|
- _self.totalPrice = data.totalPrice;
|
|
|
- _self.reducedPrice = data.reducedPrice;
|
|
|
- _self.totalCount = data.totalCount;
|
|
|
- _self.kindCount = data.kindCount;
|
|
|
- _self.balance.userMoney = data.userMoney;
|
|
|
- _self.balance.originUserMoney = data.userMoney;
|
|
|
- _self.hanldShouldPayFee = data.totalPrice;
|
|
|
- _self.svipReducedPrice = data.svipReducedPrice;
|
|
|
- _self.postageParam.productIds = _self.getProductIds(data.list); // 获取订单商品id列表 以 , 隔开
|
|
|
- _self.getAddressList(_self.userId,20);
|
|
|
- console.log('邮费接口数据', _self.postageParam)
|
|
|
- if( data.couponList && data.couponList.length>0){
|
|
|
- _self.isCouponShow = true;
|
|
|
- _self.couponAmount = data.couponList[0].couponAmount;
|
|
|
- _self.confirmParam.clubCouponId = data.couponList[0].clubCouponId;
|
|
|
- data.couponList.forEach((el) => {
|
|
|
- _self.couponList.push(Object.assign(el,{ischecked:false}))
|
|
|
- })
|
|
|
- _self.couponList[0].ischecked = true;
|
|
|
- _self.hanldShouldPayFee = data.totalPrice - _self.couponAmount;
|
|
|
- }
|
|
|
- _self.totalDiscountAmount = _self.reducedPrice + _self.couponAmount;
|
|
|
- if(data.invoice){
|
|
|
- data.invoice.type = 0;
|
|
|
- _self.orderInvoice = data.invoice;
|
|
|
- }
|
|
|
+ _self.setCreatDataInfo(response.data)
|
|
|
}else{
|
|
|
CAIMEI.Alert(r.msg, '确定', false);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ setCreatDataInfo(data){
|
|
|
+ var _self = this;
|
|
|
+ _self.listData = data.list;
|
|
|
+ _self.totalPrice = data.totalPrice;
|
|
|
+ _self.reducedPrice = data.reducedPrice;
|
|
|
+ _self.totalCount = data.totalCount;
|
|
|
+ _self.kindCount = data.kindCount;
|
|
|
+ _self.balance.userMoney = data.userMoney;
|
|
|
+ _self.balance.originUserMoney = data.userMoney;
|
|
|
+ _self.hanldShouldPayFee = data.totalPrice;
|
|
|
+ _self.svipReducedPrice = data.svipReducedPrice;
|
|
|
+ _self.postageParam.productIds = _self.getProductIds(data.list); // 获取订单商品id列表 以 , 隔开
|
|
|
+ _self.getAddressList(_self.userId,20);
|
|
|
+ console.log('邮费接口数据', _self.postageParam)
|
|
|
+ if( data.couponList && data.couponList.length>0){
|
|
|
+ _self.isCouponShow = true;
|
|
|
+ _self.couponAmount = data.couponList[0].couponAmount;
|
|
|
+ _self.confirmParam.clubCouponId = data.couponList[0].clubCouponId;
|
|
|
+ data.couponList.forEach((el) => {
|
|
|
+ _self.couponList.push(Object.assign(el,{ischecked:false}))
|
|
|
+ })
|
|
|
+ _self.couponList[0].ischecked = true;
|
|
|
+ _self.hanldShouldPayFee = data.totalPrice - _self.couponAmount;
|
|
|
+ }
|
|
|
+ _self.totalDiscountAmount = _self.reducedPrice + _self.couponAmount;
|
|
|
+ if(data.invoice){
|
|
|
+ data.invoice.type = 0;
|
|
|
+ _self.orderInvoice = data.invoice;
|
|
|
+ }
|
|
|
+ },
|
|
|
getFreight: function(){// 获取邮费
|
|
|
var _self = this;
|
|
|
console.log(_self.postageParam, '邮费接口调用')
|
|
@@ -665,18 +657,20 @@ var shoppingConfirm = new Vue({
|
|
|
n=(r1>=r2)?r1:r2;
|
|
|
return ((arg1*m-arg2*m)/m).toFixed(n);
|
|
|
},
|
|
|
- submitOrder: function(){
|
|
|
+ submitOrder: function(){// 提交按钮点击
|
|
|
var _self = this;
|
|
|
- if( _self.confirmParam.payInfo.orderShouldPayFee<1000){
|
|
|
+ if( _self.hanldShouldPayFee<1000){
|
|
|
_self.isModelAlert = true;
|
|
|
_self.isModelAlertText = '采购金额过小,将扣除500采美豆。建议您使用微信扫描 以下二维码,进入采美旗下“呵呵商城”小程序购买小额 商品。';
|
|
|
- }else if(_self.confirmParam.payInfo.orderShouldPayFee<1000 && _self.userBeans<0){
|
|
|
+ }else if(_self.hanldShouldPayFee<1000 && _self.userBeans<0){
|
|
|
_self.isModelAlert = true;
|
|
|
_self.isShowConfirm = false;
|
|
|
_self.isModelAlertText = '采美豆不足,不能提交订单。您可使用微信扫描以下二维码,进入采美旗下“呵呵商城”小程序购买小额商品。';
|
|
|
+ }else{
|
|
|
+ _self.handleClickOrderSubmitMit()
|
|
|
}
|
|
|
},
|
|
|
- handleClickOrderSubmitMit:function () {
|
|
|
+ handleClickOrderSubmitMit:function () {// 提交订单
|
|
|
var _self = this;
|
|
|
if(_self.submitLoading){return false;}
|
|
|
if(!_self.confirmParam.addressId){
|
|
@@ -797,7 +791,7 @@ var shoppingConfirm = new Vue({
|
|
|
var urlType = getUrlParam("type") ? getUrlParam("type")*1 : "";
|
|
|
console.log('urlType',urlType)
|
|
|
if(globalUserData){
|
|
|
- _self.userId = _self.productParam.userId = _self.cartParam.userId = _self.postageParam.userId = globalUserData.userId;
|
|
|
+ _self.userId = _self.productParam.userId = _self.cartParam.userId = _self.postageParam.userId = _self.supportParm.userId = globalUserData.userId;
|
|
|
_self.confirmParam.clubId = globalUserData.clubId
|
|
|
_self.userIdentity = globalUserData.identity;
|
|
|
_self.userToken = globalUserData.token;
|
|
@@ -816,6 +810,10 @@ var shoppingConfirm = new Vue({
|
|
|
if(_self.productParam.productId && _self.productParam.productCount) {
|
|
|
_self.getProductCreateOrderInfo();
|
|
|
}
|
|
|
+ }else if(urlType === 3){// 组合商品立即购买
|
|
|
+ _self.supportParm.productInfo = window.localStorage.getItem("KEY_SUPPORE");
|
|
|
+ _self.OrderClubProductSupporting()
|
|
|
+ console.log('_self.supportParm.productInfo',_self.supportParm.productInfo)
|
|
|
}
|
|
|
}
|
|
|
},
|