|
@@ -143,7 +143,6 @@ var shoppingConfirm = new Vue({
|
|
|
if( _self.userBeans >= r.data.freight*100 ){
|
|
|
_self.freightBeansMoney = r.data.freight;
|
|
|
_self.freightMoney = r.data.freight;
|
|
|
- console.log('freightBeansMoney',_self.freightBeansMoney);
|
|
|
_self.isBeansShow = true;
|
|
|
}else{
|
|
|
_self.freightBeansMoney = 0;
|
|
@@ -399,13 +398,16 @@ var shoppingConfirm = new Vue({
|
|
|
var total = _self.totalPrice + _self.payInfo.freight;
|
|
|
if(_self.balance.flag){
|
|
|
_self.payInfo.balancePayFlag = 1;
|
|
|
- if(_self.balance.userMoney>=total){
|
|
|
- // 全部抵扣
|
|
|
+ if(_self.balance.userMoney>=total){ // 全部抵扣
|
|
|
_self.payInfo.orderShouldPayFee = 0;
|
|
|
- _self.balance.deductMoney = total;
|
|
|
- _self.balance.surplusMoney = _self.balance.userMoney-total;
|
|
|
- }else{
|
|
|
- // 部分抵扣
|
|
|
+ if(_self.balance.isFreight){
|
|
|
+ _self.balance.deductMoney = _self.totalPrice;
|
|
|
+ _self.balance.surplusMoney = _self.balance.userMoney-total;
|
|
|
+ }else{
|
|
|
+ _self.balance.deductMoney = total;
|
|
|
+ _self.balance.surplusMoney = _self.balance.userMoney - _self.balance.deductMoney;
|
|
|
+ }
|
|
|
+ }else{ // 部分抵扣
|
|
|
_self.payInfo.orderShouldPayFee = total - _self.balance.userMoney;
|
|
|
_self.balance.deductMoney = _self.balance.userMoney;
|
|
|
_self.balance.surplusMoney = 0;
|
|
@@ -413,33 +415,54 @@ var shoppingConfirm = new Vue({
|
|
|
}else{
|
|
|
// 取消抵扣
|
|
|
_self.payInfo.balancePayFlag = 0;
|
|
|
- _self.payInfo.orderShouldPayFee = total;
|
|
|
_self.balance.userMoney = _self.balance.originUserMoney;
|
|
|
_self.balance.deductMoney = 0;
|
|
|
_self.balance.surplusMoney = _self.balance.originUserMoney;
|
|
|
+ if(_self.balance.isFreight){
|
|
|
+ _self.payInfo.orderShouldPayFee = _self.totalPrice;
|
|
|
+ }else{
|
|
|
+ _self.payInfo.orderShouldPayFee = total;
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
changeDeductibleFreight: function(){//选择采美豆抵扣邮费
|
|
|
var _self = this;
|
|
|
+ var total = _self.totalPrice + _self.payInfo.freight;
|
|
|
if(_self.balance.isFreight){
|
|
|
_self.hanldUserBeans = _self.freightBeansMoney*100;
|
|
|
if(_self.payInfo.freePostFlag == 1){
|
|
|
if( _self.userBeans >= _self.payInfo.freight*100 ){
|
|
|
- console.log('商品总价-------->',_self.totalPrice);
|
|
|
- console.log('邮费------------>',_self.payInfo.freight);
|
|
|
- console.log('采美豆换算金额--->',_self.freightBeansMoney);
|
|
|
- _self.payInfo.orderShouldPayFee = (_self.totalPrice*100 + _self.payInfo.freight*100 - _self.freightBeansMoney*100)/100;
|
|
|
- console.log('最终支付金额---->',_self.payInfo.orderShouldPayFee)
|
|
|
+ if(_self.balance.flag) {
|
|
|
+ if(_self.balance.userMoney>=total){ // 全部抵扣
|
|
|
+ _self.payInfo.orderShouldPayFee = 0;
|
|
|
+ _self.balance.deductMoney = _self.totalPrice;
|
|
|
+ _self.balance.surplusMoney = _self.balance.userMoney-_self.balance.deductMoney;
|
|
|
+ }else{ // 部分抵扣
|
|
|
+ _self.payInfo.orderShouldPayFee = total - _self.balance.userMoney;
|
|
|
+ _self.balance.deductMoney = _self.balance.userMoney;
|
|
|
+ _self.balance.surplusMoney = _self.balance.userMoney-_self.balance.deductMoney;
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ _self.payInfo.orderShouldPayFee = (_self.totalPrice*100 + _self.payInfo.freight*100 - _self.freightBeansMoney*100)/100;
|
|
|
+ }
|
|
|
}
|
|
|
}else{
|
|
|
_self.payInfo.orderShouldPayFee = _self.totalPrice ;
|
|
|
_self.hanldUserBeans = 0
|
|
|
}
|
|
|
}else{
|
|
|
- _self.payInfo.orderShouldPayFee = _self.totalPrice + _self.payInfo.freight;
|
|
|
_self.hanldUserBeans = 0
|
|
|
+ if(_self.balance.flag) {//
|
|
|
+ if(_self.balance.userMoney>=total) { // 全部抵扣
|
|
|
+ _self.payInfo.orderShouldPayFee = 0 ;
|
|
|
+ _self.balance.deductMoney = total;
|
|
|
+ _self.balance.surplusMoney = _self.balance.userMoney-_self.balance.deductMoney;
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ _self.payInfo.orderShouldPayFee = _self.totalPrice + _self.payInfo.freight;
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
submitOrder: function(){
|