|
@@ -169,6 +169,8 @@ var shoppingConfirm = new Vue({
|
|
|
_self.balance.userMoney = data.userMoney;
|
|
|
_self.balance.originUserMoney = data.userMoney;
|
|
|
_self.hanldShouldPayFee = data.totalPrice;
|
|
|
+ _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;
|
|
@@ -204,7 +206,9 @@ var shoppingConfirm = new Vue({
|
|
|
_self.balance.userMoney = data.userMoney;
|
|
|
_self.balance.originUserMoney = data.userMoney;
|
|
|
_self.hanldShouldPayFee = data.totalPrice;
|
|
|
+ _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;
|
|
@@ -227,6 +231,7 @@ var shoppingConfirm = new Vue({
|
|
|
},
|
|
|
getFreight: function(){// 获取邮费
|
|
|
var _self = this;
|
|
|
+ console.log(_self.postageParam, '邮费接口调用')
|
|
|
OrderApi.GetOrderPostage(_self.postageParam,function (r) {
|
|
|
if(r.code === 0 && r.data){
|
|
|
_self.confirmParam.payInfo.postageFlag = _self.hanldPostageFlag = r.data.postageFlag;
|
|
@@ -374,6 +379,7 @@ var shoppingConfirm = new Vue({
|
|
|
this.addressForm.provinceId= '';
|
|
|
this.addressForm.desc= '';
|
|
|
this.addressForm.default= '';
|
|
|
+ this.addressForm.id = '';
|
|
|
this.getProvinceOptions();
|
|
|
if(!isPC){fixedBody();}
|
|
|
},
|
|
@@ -716,12 +722,14 @@ var shoppingConfirm = new Vue({
|
|
|
_self.orderInvoice.type = parseInt(_self.orderInvoice.type)
|
|
|
_self.confirmParam.orderInvoice = _self.orderInvoice;
|
|
|
}
|
|
|
+ var hanldPostageFlag =
|
|
|
_self.confirmParam.payInfo.postage = parseInt(_self.hanldPostage).toFixed(2);
|
|
|
_self.confirmParam.payInfo.postageFlag = parseInt(_self.hanldPostageFlag);
|
|
|
_self.confirmParam.payInfo.orderShouldPayFee = parseFloat(_self.hanldShouldPayFee).toFixed(2);
|
|
|
_self.confirmParam.payInfo = JSON.stringify(_self.confirmParam.payInfo);
|
|
|
_self.confirmParam.orderInfo = JSON.stringify(_self.confirmParam.orderInfo);
|
|
|
_self.confirmParam.orderInvoice = JSON.stringify(_self.confirmParam.orderInvoice);
|
|
|
+ console.log('confirmParam',_self.confirmParam);
|
|
|
OrderApi.ConfirmOrder(_self.confirmParam,function (res) {
|
|
|
if(res.code === 0){
|
|
|
var data = res.data;
|
|
@@ -745,10 +753,23 @@ var shoppingConfirm = new Vue({
|
|
|
CAIMEI.Alert(res.msg,'确定',true, function(){
|
|
|
setTimeout(function(){
|
|
|
_self.submitLoading = false;
|
|
|
+ _self.confirmParam.payInfo = JSON.parse(_self.confirmParam.payInfo);
|
|
|
+ _self.confirmParam.orderInfo = JSON.parse(_self.confirmParam.orderInfo);
|
|
|
+ _self.confirmParam.orderInvoice = JSON.parse(_self.confirmParam.orderInvoice);
|
|
|
},500);
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
+ },
|
|
|
+ getProductIds: function(list){
|
|
|
+ var productIds = [];
|
|
|
+ list.forEach(function(supplier){
|
|
|
+ supplier.cartList.forEach(function(product){
|
|
|
+ productIds.push(product.productId)
|
|
|
+ });
|
|
|
+ })
|
|
|
+ // console.log(list);
|
|
|
+ return productIds.join(',');
|
|
|
}
|
|
|
},
|
|
|
created: function () {
|
|
@@ -763,12 +784,14 @@ var shoppingConfirm = new Vue({
|
|
|
// type:(1购物车提交[对应表cm_cart],2直接购买提交, 3协销下单)
|
|
|
if(urlType === 1) {//购物车提交
|
|
|
_self.confirmParam.cartType = 1;
|
|
|
- _self.cartParam.productIds = _self.postageParam.productIds = _self.productIds = window.localStorage.getItem("shoppingProductIds");
|
|
|
+ // _self.cartParam.productIds = _self.postageParam.productIds = _self.productIds = window.localStorage.getItem("shoppingProductIds");
|
|
|
+ _self.cartParam.productIds = _self.productIds = window.localStorage.getItem("shoppingProductIds");
|
|
|
// 获取列表数据
|
|
|
_self.getCartCreateOrderInfo();
|
|
|
}else if(urlType === 2){//立即购买
|
|
|
_self.confirmParam.cartType = 2;
|
|
|
- _self.productParam.productId = _self.postageParam.productIds = _self.productIds = getUrlParam("productId");
|
|
|
+ // _self.productParam.productId = _self.postageParam.productIds = _self.productIds = getUrlParam("productId");
|
|
|
+ _self.productParam.productId = _self.productIds = getUrlParam("productId");
|
|
|
_self.productParam.productCount = getUrlParam("count");
|
|
|
if(_self.productParam.productId && _self.productParam.productCount) {
|
|
|
_self.getProductCreateOrderInfo();
|