|
@@ -61,6 +61,7 @@ var shoppingConfirm = new Vue({
|
|
|
freePostFlag:-1 // 0包邮 -1到付 1 有运费
|
|
|
},
|
|
|
invoice: {
|
|
|
+ id:'',
|
|
|
type: 0,
|
|
|
invoiceTitleType: 0, //发票抬头类型 1企业 0个人
|
|
|
invoiceTitle: '', //单位名称
|
|
@@ -107,6 +108,7 @@ var shoppingConfirm = new Vue({
|
|
|
_self.balance.userMoney = r.data.userMoney;
|
|
|
_self.balance.originUserMoney = r.data.userMoney;
|
|
|
_self.payInfo.orderShouldPayFee = r.data.totalPrice;
|
|
|
+ _self.invoice = r.data.invoice;
|
|
|
_self.getAddressList(_self.userId,20);
|
|
|
}else{
|
|
|
CAIMEI.Alert(r.msg, '确定', false);
|
|
@@ -222,6 +224,13 @@ var shoppingConfirm = new Vue({
|
|
|
},
|
|
|
createAddress: function(){
|
|
|
this.isShowAddressForm = true;
|
|
|
+ this.addressForm.name= '';
|
|
|
+ this.addressForm.mobile= '';
|
|
|
+ this.addressForm.townId= '';
|
|
|
+ this.addressForm.cityId= '';
|
|
|
+ this.addressForm.provinceId= '';
|
|
|
+ this.addressForm.desc= '';
|
|
|
+ this.addressForm.default= '';
|
|
|
if(!isPC){fixedBody();}
|
|
|
},
|
|
|
updateAddress: function(){
|
|
@@ -411,63 +420,48 @@ var shoppingConfirm = new Vue({
|
|
|
CAIMEI.dialog('请输入银行账号');return false;
|
|
|
}
|
|
|
}
|
|
|
- var params = {
|
|
|
- cartType: this.type,
|
|
|
- orderSource: 1, // 购买类型:(1购物车提交[对应表cm_cart],2直接购买提交, 3协销下单)
|
|
|
- serviceProviderId: '', // 协销ID(小程序忽略)
|
|
|
- clubUserId: this.userId, // 机构用户ID
|
|
|
- addressId: this.address.id,// 地址ID
|
|
|
- orderInfo: [], // 商品信息
|
|
|
- payInfo: {}, // 订单信息
|
|
|
- orderInvoice: {} // 发票信息
|
|
|
- };
|
|
|
// 发票信息
|
|
|
if(this.invoice.type*1 === 0){
|
|
|
- params.orderInvoice = {type: 0};
|
|
|
+ this.invoice = Object.assign(this.invoice,'',{type:0});
|
|
|
}else if(this.invoice.type*1 === 1){
|
|
|
- params.orderInvoice = {
|
|
|
- type: 1, // 普通发票
|
|
|
- invoiceContent: '商品明细',
|
|
|
- invoiceTitleType: this.invoice.invoiceTitleType, //发票抬头类型 1企业 0个人
|
|
|
- invoiceTitle: this.invoice.invoiceTitle, //发票抬头
|
|
|
- corporationTaxNum: this.invoice.corporationTaxNum//纳税人识别号
|
|
|
- }
|
|
|
+ this.invoice = Object.assign(this.invoice,'',{type:1, invoiceContent: '商品明细'});
|
|
|
}else if(this.invoice.type*1 === 2){
|
|
|
- params.orderInvoice = {
|
|
|
- type: 2, // 增值税发票
|
|
|
- invoiceTitle: this.invoice.invoiceTitle, //单位名称
|
|
|
- corporationTaxNum: this.invoice.corporationTaxNum,//纳税人识别号
|
|
|
- registeredAddress: this.invoice.registeredAddress,//单位地址
|
|
|
- registeredPhone: this.invoice.registeredPhone, //注册电话
|
|
|
- openBank: this.invoice.openBank, //开户银行
|
|
|
- bankAccountNo: this.invoice.bankAccountNo //银行账号
|
|
|
- }
|
|
|
+ this.invoice = Object.assign(this.invoice,'',{type:2});
|
|
|
}
|
|
|
//商品信息
|
|
|
- params.orderInfo = this.listData.map(function(supplier){
|
|
|
- var productInfo = [];
|
|
|
- supplier.cartList.forEach(function(item){
|
|
|
- productInfo.push({
|
|
|
- productId:item.productId,
|
|
|
- productNum:item.number,
|
|
|
- presentNum:0,
|
|
|
- productType:item.productType
|
|
|
- })
|
|
|
+ var _orderInfo = this.listData.map(function(supplier){
|
|
|
+ var productInfo = [];
|
|
|
+ supplier.cartList.forEach(function(item){
|
|
|
+ productInfo.push({
|
|
|
+ productId:item.productId,
|
|
|
+ productNum:item.number,
|
|
|
+ presentNum:0,
|
|
|
+ productType:item.productType
|
|
|
+ })
|
|
|
+ });
|
|
|
+ return {
|
|
|
+ shopId: supplier.id,
|
|
|
+ note: supplier.note ? supplier.note : '',
|
|
|
+ productInfo: productInfo
|
|
|
+ }
|
|
|
});
|
|
|
- return {
|
|
|
- shopId: supplier.id,
|
|
|
- note: supplier.note ? supplier.note : '',
|
|
|
- productInfo: productInfo
|
|
|
- }
|
|
|
- });
|
|
|
- params.payInfo = {
|
|
|
- clauseId: 0,
|
|
|
- orderShouldPayFee: toFloat(this.payInfo.orderShouldPayFee),
|
|
|
- balancePayFlag: this.payInfo.balancePayFlag,
|
|
|
- freight: toFloat(this.payInfo.freight),
|
|
|
- freePostFlag: this.payInfo.freePostFlag
|
|
|
+ var _payInfo = {
|
|
|
+ clauseId: 0,
|
|
|
+ orderShouldPayFee: toFloat(this.payInfo.orderShouldPayFee),
|
|
|
+ balancePayFlag: this.payInfo.balancePayFlag,
|
|
|
+ freight: toFloat(this.payInfo.freight),
|
|
|
+ freePostFlag: this.payInfo.freePostFlag
|
|
|
+ };
|
|
|
+ var params = {
|
|
|
+ cartType: this.type,
|
|
|
+ orderSource: 1, // 购买类型:(1购物车提交[对应表cm_cart],2直接购买提交, 3协销下单)
|
|
|
+ serviceProviderId: '', // 协销ID(小程序忽略)
|
|
|
+ clubUserId: this.userId, // 机构用户ID
|
|
|
+ addressId: this.address.id,// 地址ID
|
|
|
+ orderInfo: _orderInfo, // 商品信息
|
|
|
+ payInfo: _payInfo, // 订单信息
|
|
|
+ orderInvoice: this.invoice // 发票信息
|
|
|
};
|
|
|
- console.log(params);
|
|
|
this.submitLoading = true;
|
|
|
OrderApi.ConfirmOrder({'params':JSON.stringify(params)},function (r) {
|
|
|
if(r.code === 0){
|