|
@@ -13,32 +13,31 @@ var payContainer = new Vue({
|
|
|
PAY_DATA:{} //支付数据
|
|
|
},
|
|
|
bankData:[
|
|
|
- {imgUrl:'/web/order/img/iconbank-01@2x.png',bankName:'中国工商银行',bankNum:'ICBC_B2B'},
|
|
|
- {imgUrl:'/web/order/img/iconbank-02@2x.png',bankName:'招商银行',bankNum:'CMBCHINA_B2B'},
|
|
|
- {imgUrl:'/web/order/img/iconbank-03@2x.png',bankName:'中国建设银行',bankNum:'CCB_B2B'},
|
|
|
- {imgUrl:'/web/order/img/iconbank-04@2x.png',bankName:'交通银行',bankNum:'BOCO_B2B'},
|
|
|
- {imgUrl:'/web/order/img/iconbank-05@2x.png',bankName:'兴业银行',bankNum:'CIB_B2B'},
|
|
|
- {imgUrl:'/web/order/img/iconbank-06@2x.png',bankName:'中国民生银行',bankNum:'CMBC_B2B'},
|
|
|
- {imgUrl:'/web/order/img/iconbank-07@2x.png',bankName:'中国广发银行',bankNum:'CEB_B2B'},
|
|
|
- {imgUrl:'/web/order/img/iconbank-08@2x.png',bankName:'中国银行',bankNum:'BOC_B2B'},
|
|
|
- {imgUrl:'/web/order/img/iconbank-09@2x.png',bankName:'平安银行',bankNum:'SZPA_B2B'},
|
|
|
- {imgUrl:'/web/order/img/iconbank-10@2x.png',bankName:'中信银行',bankNum:'ECITIC_B2B'},
|
|
|
- {imgUrl:'/web/order/img/iconbank-11@2x.png',bankName:'浦发银行',bankNum:'SPDB_B2B'},
|
|
|
- {imgUrl:'/web/order/img/iconbank-12@2x.png',bankName:'华夏银行',bankNum:'HXB_B2B'},
|
|
|
- {imgUrl:'/web/order/img/iconbank-13@2x.png',bankName:'北京银行',bankNum:'BCCB_B2B'},
|
|
|
- {imgUrl:'/web/order/img/iconbank-14@2x.png',bankName:'中国农业银行',bankNum:'ABC_B2B'},
|
|
|
- {imgUrl:'/web/order/img/iconbank-15@2x.png',bankName:'中国邮政储蓄银行',bankNum:'PSBC_B2B'},
|
|
|
- {imgUrl:'/web/order/img/iconbank-16@2x.png',bankName:'徽商银行',bankNum:'HSB_B2B'},
|
|
|
- {imgUrl:'/web/order/img/iconbank-17@2x.png',bankName:'青岛银行',bankNum:'QDYH_B2B'},
|
|
|
- {imgUrl:'/web/order/img/iconbank-18@2x.png',bankName:'浙商银行',bankNum:'CZ_B2B'},
|
|
|
- {imgUrl:'/web/order/img/iconbank-19@2x.png',bankName:'齐鲁银行',bankNum:'QLYH_B2B'},
|
|
|
+ {imgUrl:'/img/pay/iconbank-01@2x.png',bankName:'中国工商银行',bankNum:'ICBC_B2B'},
|
|
|
+ {imgUrl:'/img/pay/iconbank-02@2x.png',bankName:'招商银行',bankNum:'CMBCHINA_B2B'},
|
|
|
+ {imgUrl:'/img/pay/iconbank-03@2x.png',bankName:'中国建设银行',bankNum:'CCB_B2B'},
|
|
|
+ {imgUrl:'/img/pay/iconbank-04@2x.png',bankName:'交通银行',bankNum:'BOCO_B2B'},
|
|
|
+ {imgUrl:'/img/pay/iconbank-05@2x.png',bankName:'兴业银行',bankNum:'CIB_B2B'},
|
|
|
+ {imgUrl:'/img/pay/iconbank-06@2x.png',bankName:'中国民生银行',bankNum:'CMBC_B2B'},
|
|
|
+ {imgUrl:'/img/pay/iconbank-07@2x.png',bankName:'中国广发银行',bankNum:'CEB_B2B'},
|
|
|
+ {imgUrl:'/img/pay/iconbank-08@2x.png',bankName:'中国银行',bankNum:'BOC_B2B'},
|
|
|
+ {imgUrl:'/img/pay/iconbank-09@2x.png',bankName:'平安银行',bankNum:'SZPA_B2B'},
|
|
|
+ {imgUrl:'/img/pay/iconbank-10@2x.png',bankName:'中信银行',bankNum:'ECITIC_B2B'},
|
|
|
+ {imgUrl:'/img/pay/iconbank-11@2x.png',bankName:'浦发银行',bankNum:'SPDB_B2B'},
|
|
|
+ {imgUrl:'/img/pay/iconbank-12@2x.png',bankName:'华夏银行',bankNum:'HXB_B2B'},
|
|
|
+ {imgUrl:'/img/pay/iconbank-13@2x.png',bankName:'北京银行',bankNum:'BCCB_B2B'},
|
|
|
+ {imgUrl:'/img/pay/iconbank-14@2x.png',bankName:'中国农业银行',bankNum:'ABC_B2B'},
|
|
|
+ {imgUrl:'/img/pay/iconbank-15@2x.png',bankName:'中国邮政储蓄银行',bankNum:'PSBC_B2B'},
|
|
|
+ {imgUrl:'/img/pay/iconbank-16@2x.png',bankName:'徽商银行',bankNum:'HSB_B2B'},
|
|
|
+ {imgUrl:'/img/pay/iconbank-17@2x.png',bankName:'青岛银行',bankNum:'QDYH_B2B'},
|
|
|
+ {imgUrl:'/img/pay/iconbank-18@2x.png',bankName:'浙商银行',bankNum:'CZ_B2B'},
|
|
|
+ {imgUrl:'/img/pay/iconbank-19@2x.png',bankName:'齐鲁银行',bankNum:'QLYH_B2B'}
|
|
|
],
|
|
|
methodTab:['线上支付','转账支付'],
|
|
|
mobileData:[
|
|
|
- {imgUrl:'/web/order/img/iconbank-ali@2x.png',bankName:'支付宝支付',bankNum:'ALIPAY'},
|
|
|
- {imgUrl:'/web/order/img/iconbank-wx@2x.png',bankName:'微信支付',bankNum:'WEIXIN'},
|
|
|
- {imgUrl:'/web/order/img/iconbank-bank@2x.png',bankName:'网银支付',bankNum:'ICBC_B2B'},
|
|
|
-
|
|
|
+ {imgUrl:'/img/pay/iconbank-ali@2x.png',bankName:'支付宝支付',bankNum:'ALIPAY'},
|
|
|
+ {imgUrl:'/img/pay/iconbank-wx@2x.png',bankName:'微信支付',bankNum:'WEIXIN'},
|
|
|
+ {imgUrl:'/img/pay/iconbank-bank@2x.png',bankName:'网银支付',bankNum:'ICBC_B2B'}
|
|
|
],
|
|
|
pageType:'',//页面跳转类型
|
|
|
paidAmount:'',//订单待付金额
|
|
@@ -66,7 +65,7 @@ var payContainer = new Vue({
|
|
|
productID:''//发布商品的ID
|
|
|
},
|
|
|
filters: {
|
|
|
- NumFormat(value) {
|
|
|
+ NumFormat:function(value) {
|
|
|
if(!value) return '0.00';
|
|
|
var intPart = Number(value) - Number(value)%1; //获取整数部分(这里是windy93的方法)
|
|
|
var intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,'); //将整数部分逢三一断
|
|
@@ -86,169 +85,162 @@ var payContainer = new Vue({
|
|
|
},
|
|
|
methods: {
|
|
|
infoPayOrderCheckoutCounter:function(){//初始化订单数据
|
|
|
- var _this = this;
|
|
|
- PayApi.PayOrderCheckoutCounter({orderId:_this.payInfo.PAY_ORDERID},function(response){
|
|
|
+ var _self = this;
|
|
|
+ PayApi.PayOrderCheckoutCounter({orderId:_self.payInfo.PAY_ORDERID},function(response){
|
|
|
if(response.code == 0){
|
|
|
// console.log(response);
|
|
|
var data = response.data; //金额初始化
|
|
|
- _this.payInfo.PAY_UNPAIDAMOUNT = (data.order.payableAmount - data.order.receiptAmount).toFixed(2);
|
|
|
- _this.payInfo.PAY_PAYAMOUNT = (data.order.payableAmount-data.order.receiptAmount).toFixed(2);
|
|
|
- _this.discernReceiptList = data.discernReceipt;
|
|
|
- _this.paidAmount = (data.order.payableAmount-data.order.receiptAmount).toFixed(2);
|
|
|
- _this.receiptAmount = data.order.receiptAmount;
|
|
|
- _this.payableAmount= data.order.payableAmount;
|
|
|
- _this.balanceAmount = ( _this.payableAmount - _this.receiptAmount).toFixed(2) - _this.payInfo.PAY_PAYAMOUNT;
|
|
|
- _this.payAmount = (_this.payableAmount - _this.receiptAmount).toFixed(2);//本次支付金额
|
|
|
- _this.paySuccessCounter = data.order.paySuccessCounter;
|
|
|
- _this.receiptStatus = data.order.receiptStatus;
|
|
|
- _this.invoiceStatus = data.order.invoiceStatus;
|
|
|
- _this.onlinePayFlag = data.order.onlinePayFlag;
|
|
|
- if(_this.receiptAmount>0){
|
|
|
- _this.payStatusText = '使用微信和企业网银支付全部金额后,供应商会在24小时后发货(周末、节假日顺延)。';
|
|
|
- _this.isReceiptStatus = false;
|
|
|
+ _self.payInfo.PAY_UNPAIDAMOUNT = (data.order.payableAmount - data.order.receiptAmount).toFixed(2);
|
|
|
+ _self.payInfo.PAY_PAYAMOUNT = (data.order.payableAmount-data.order.receiptAmount).toFixed(2);
|
|
|
+ _self.discernReceiptList = data.discernReceipt;
|
|
|
+ _self.paidAmount = (data.order.payableAmount-data.order.receiptAmount).toFixed(2);
|
|
|
+ _self.receiptAmount = data.order.receiptAmount;
|
|
|
+ _self.payableAmount= data.order.payableAmount;
|
|
|
+ _self.balanceAmount = ( _self.payableAmount - _self.receiptAmount).toFixed(2) - _self.payInfo.PAY_PAYAMOUNT;
|
|
|
+ _self.payAmount = (_self.payableAmount - _self.receiptAmount).toFixed(2);//本次支付金额
|
|
|
+ _self.paySuccessCounter = data.order.paySuccessCounter;
|
|
|
+ _self.receiptStatus = data.order.receiptStatus;
|
|
|
+ _self.invoiceStatus = data.order.invoiceStatus;
|
|
|
+ _self.onlinePayFlag = data.order.onlinePayFlag;
|
|
|
+ if(_self.receiptAmount>0){
|
|
|
+ _self.payStatusText = '使用微信和企业网银支付全部金额后,供应商会在24小时后发货(周末、节假日顺延)。';
|
|
|
+ _self.isReceiptStatus = false;
|
|
|
}else{
|
|
|
- _this.payStatusText = '使用微信和企业网银支付全部金额后,供应商会在24小时后发货(周末、节假日顺延)。若着急发货,可以选择使用线下转账进行付款。';
|
|
|
- _this.isReceiptStatus = true;
|
|
|
+ _self.payStatusText = '使用微信和企业网银支付全部金额后,供应商会在24小时后发货(周末、节假日顺延)。若着急发货,可以选择使用线下转账进行付款。';
|
|
|
+ _self.isReceiptStatus = true;
|
|
|
}
|
|
|
- _this.isRequest = true;
|
|
|
+ _self.isRequest = true;
|
|
|
}else{
|
|
|
layer.msg(response.msg, {icon: 7});
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
PayMobileSubmitFn:function(){//点击移动支付方式
|
|
|
- var _this = this;
|
|
|
- if(_this.invoiceStatus){
|
|
|
- _this.layerConfirm();
|
|
|
+ var _self = this;
|
|
|
+ if(_self.invoiceStatus){
|
|
|
+ _self.layerConfirm();
|
|
|
}else{
|
|
|
- if(_this.payInfo.PAY_BANK_NUM == ''){
|
|
|
- layer.msg('请选择支付方式!');
|
|
|
+ if(_self.payInfo.PAY_BANK_NUM == ''){
|
|
|
+ CAIMEI.dialog('请选择支付方式');
|
|
|
return;
|
|
|
}
|
|
|
- if(_this.payAmount == ''){
|
|
|
- layer.msg('请输入本次支付金额');
|
|
|
+ if(_self.payAmount == ''){
|
|
|
+ CAIMEI.dialog('请输入本次支付金额');
|
|
|
return;
|
|
|
}
|
|
|
- if(_this.payAmount == 0){
|
|
|
- layer.msg('本次支付金额不能为0');
|
|
|
+ if(_self.payAmount == 0){
|
|
|
+ CAIMEI.dialog('本次支付金额不能为0');
|
|
|
return;
|
|
|
}
|
|
|
- if(_this.payAmount*100 < 2){
|
|
|
- layer.msg('本次支付金额必须大于¥0.02');
|
|
|
+ if(_self.payAmount*100 < 2){
|
|
|
+ CAIMEI.dialog('本次支付金额必须大于¥0.02');
|
|
|
return;
|
|
|
}
|
|
|
- if(_this.payAmount > _this.paymentIimit){
|
|
|
- switch (_this.payInfo.PAY_BANK_NUM) {
|
|
|
+ if(_self.payAmount > _self.paymentIimit){
|
|
|
+ switch (_self.payInfo.PAY_BANK_NUM) {
|
|
|
case 'WEIXIN':
|
|
|
- _this.paymentIimitText = '本次支付金额已超出微信支付限额,请输入小于5万的金额进行支付';
|
|
|
+ _self.paymentIimitText = '本次支付金额已超出微信支付限额,请输入小于5万的金额进行支付';
|
|
|
break;
|
|
|
case 'ALIPAY':
|
|
|
- _this.paymentIimitText = '本次支付金额已超出支付宝限额,请输入小于5万的金额进行支付';
|
|
|
+ _self.paymentIimitText = '本次支付金额已超出支付宝限额,请输入小于5万的金额进行支付';
|
|
|
break;
|
|
|
}
|
|
|
- layer.confirm(_this.paymentIimitText, {
|
|
|
- title:"提示",
|
|
|
- btn: ['知道了'], //按钮
|
|
|
- }, function () {
|
|
|
- layer.closeAll();
|
|
|
- }, function () {
|
|
|
-
|
|
|
- });
|
|
|
+ CAIMEI.Alert(_self.paymentIimitText,'知道了');
|
|
|
return;
|
|
|
}
|
|
|
- if(_this.payInfo.PAY_BANK_NUM == "WEIXIN"){
|
|
|
- if(_this.pageType === '1'){
|
|
|
- _this.payInfo.PAY_DATA = {//二手
|
|
|
- type:_this.payInfo.PAY_BANK_NUM,
|
|
|
- productId:_this.productID,
|
|
|
- amount:_this.payAmount,
|
|
|
- url:_this.payInfo.PAY_MOBILE_URL
|
|
|
+ if(_self.payInfo.PAY_BANK_NUM == "WEIXIN"){
|
|
|
+ if(_self.pageType === '1'){
|
|
|
+ _self.payInfo.PAY_DATA = {//二手
|
|
|
+ type:_self.payInfo.PAY_BANK_NUM,
|
|
|
+ productId:_self.productID,
|
|
|
+ amount:_self.payAmount,
|
|
|
+ url:_self.payInfo.PAY_MOBILE_URL
|
|
|
};
|
|
|
- _util.setStorageItem('PAY_DATA',JSON.stringify(_this.payInfo.PAY_DATA));
|
|
|
- window.open("/web/order/view/pay/caimei-paymobile.jsp?pageType=1");
|
|
|
- _this.isPayAlert = true;
|
|
|
+ CAIMEI.Storage.setItem('PAY_DATA',JSON.stringify(_self.payInfo.PAY_DATA));
|
|
|
+ window.open("/pay/caimei-paymobile.html?pageType=1");
|
|
|
+ _self.isPayAlert = true;
|
|
|
}else{
|
|
|
- _this.payInfo.PAY_DATA = {//正常订单
|
|
|
- type:_this.payInfo.PAY_BANK_NUM,
|
|
|
- orderid:_this.payInfo.PAY_ORDERID,
|
|
|
- amount:_this.payAmount,
|
|
|
- url:_this.payInfo.PAY_MOBILE_URL
|
|
|
+ _self.payInfo.PAY_DATA = {//正常订单
|
|
|
+ type:_self.payInfo.PAY_BANK_NUM,
|
|
|
+ orderid:_self.payInfo.PAY_ORDERID,
|
|
|
+ amount:_self.payAmount,
|
|
|
+ url:_self.payInfo.PAY_MOBILE_URL
|
|
|
};
|
|
|
- _util.setStorageItem('PAY_DATA',JSON.stringify(_this.payInfo.PAY_DATA));
|
|
|
- window.open("/web/order/view/pay/caimei-paymobile.jsp");
|
|
|
- _this.isPayAlert = true;
|
|
|
+ CAIMEI.Storage.setItem('PAY_DATA',JSON.stringify(_self.payInfo.PAY_DATA));
|
|
|
+ window.open("/pay/caimei-paymobile.html");
|
|
|
+ _self.isPayAlert = true;
|
|
|
}
|
|
|
}else{
|
|
|
- if(_this.pageType === '1'){
|
|
|
+ if(_self.pageType === '1'){
|
|
|
var params = {//二手
|
|
|
- payWay:_this.payInfo.PAY_BANK_NUM,
|
|
|
+ payWay:_self.payInfo.PAY_BANK_NUM,
|
|
|
returnUrl:'https://www.caimei365.com/',
|
|
|
- productId:_this.productID,
|
|
|
+ productId:_self.productID,
|
|
|
};
|
|
|
- _this.PayOrdersecondHandPay(params,_this.payInfo.PAY_BANK_NUM);
|
|
|
+ _self.PayOrdersecondHandPay(params,_self.payInfo.PAY_BANK_NUM);
|
|
|
}else{
|
|
|
var params = {//正常订单
|
|
|
- payWay:_this.payInfo.PAY_BANK_NUM,
|
|
|
- payAmount:parseInt(_this.payAmount*100),
|
|
|
+ payWay:_self.payInfo.PAY_BANK_NUM,
|
|
|
+ payAmount:parseInt(_self.payAmount*100),
|
|
|
returnUrl:'https://www.caimei365.com/',
|
|
|
- orderId:_this.payInfo.PAY_ORDERID
|
|
|
+ orderId:_self.payInfo.PAY_ORDERID
|
|
|
};
|
|
|
- _this.PayOrderPcMallPay(params,_this.payInfo.PAY_BANK_NUM);
|
|
|
+ _self.PayOrderPcMallPay(params,_self.payInfo.PAY_BANK_NUM);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
PaySubmitFn:function(){//点击网银支付方式
|
|
|
- var _this = this;
|
|
|
- if(_this.invoiceStatus){
|
|
|
- _this.layerConfirm();
|
|
|
+ var _self = this;
|
|
|
+ if(_self.invoiceStatus){
|
|
|
+ _self.layerConfirm();
|
|
|
}else{
|
|
|
- if(_this.payInfo.PAY_BANK_NUM == ''){
|
|
|
- layer.msg('请选择银行!');
|
|
|
+ if(_self.payInfo.PAY_BANK_NUM == ''){
|
|
|
+ CAIMEI.dialog('请选择银行!');
|
|
|
return;
|
|
|
}
|
|
|
- if(_this.payAmount <= 10){
|
|
|
- layer.msg('企业网银支付的金额必须大于¥10.00');
|
|
|
+ if(_self.payAmount <= 10){
|
|
|
+ CAIMEI.dialog('企业网银支付的金额必须大于¥10.00');
|
|
|
return;
|
|
|
}
|
|
|
- if(_this.pageType === '1'){
|
|
|
+ if(_self.pageType === '1'){
|
|
|
var params = {//二手
|
|
|
payWay:'UNIONPAY',
|
|
|
- payAmount: parseInt(_this.payAmount*100),
|
|
|
- bankCode:_this.payInfo.PAY_BANK_NUM,
|
|
|
+ payAmount: parseInt(_self.payAmount*100),
|
|
|
+ bankCode:_self.payInfo.PAY_BANK_NUM,
|
|
|
returnUrl:'https://www.caimei365.com/',
|
|
|
- productId:_this.productID,
|
|
|
+ productId:_self.productID,
|
|
|
};
|
|
|
- _this.PayOrdersecondHandPay(params,_this.payInfo.PAY_BANK_NUM);
|
|
|
+ _self.PayOrdersecondHandPay(params,_self.payInfo.PAY_BANK_NUM);
|
|
|
}else{
|
|
|
var params = {//正常订单
|
|
|
payWay:'UNIONPAY',
|
|
|
- payAmount: parseInt(_this.payAmount*100),
|
|
|
- bankCode:_this.payInfo.PAY_BANK_NUM,
|
|
|
+ payAmount: parseInt(_self.payAmount*100),
|
|
|
+ bankCode:_self.payInfo.PAY_BANK_NUM,
|
|
|
returnUrl:'https://www.caimei365.com/',
|
|
|
- orderId:_this.payInfo.PAY_ORDERID
|
|
|
+ orderId:_self.payInfo.PAY_ORDERID
|
|
|
};
|
|
|
- _this.PayOrderPcMallPay(params,_this.payInfo.PAY_BANK_NUM);
|
|
|
+ _self.PayOrderPcMallPay(params,_self.payInfo.PAY_BANK_NUM);
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
PayOrderPcMallPay:function(params,type){//网银&&支付宝生成支付地址
|
|
|
- var _this = this;
|
|
|
+ var _self = this;
|
|
|
PayApi.PayOrderPcMallPay(params,function(response){
|
|
|
if(response.code == 0){
|
|
|
- _this.isPayAlert = true;
|
|
|
- _this.mbOrderId = response.data.data.mbOrderId;
|
|
|
+ _self.isPayAlert = true;
|
|
|
+ _self.mbOrderId = response.data.data.mbOrderId;
|
|
|
if(type == 'ALIPAY'){
|
|
|
- _this.payInfo.PAY_MOBILE_URL = response.data.data.payUrl;
|
|
|
- _this.payInfo.PAY_DATA = {
|
|
|
- mbOrderId:_this.mbOrderId,
|
|
|
- type:_this.payInfo.PAY_BANK_NUM,
|
|
|
- orderid:_this.payInfo.PAY_ORDERID,
|
|
|
- amount:_this.payAmount,
|
|
|
- url:_this.payInfo.PAY_MOBILE_URL
|
|
|
+ _self.payInfo.PAY_MOBILE_URL = response.data.data.payUrl;
|
|
|
+ _self.payInfo.PAY_DATA = {
|
|
|
+ mbOrderId:_self.mbOrderId,
|
|
|
+ type:_self.payInfo.PAY_BANK_NUM,
|
|
|
+ orderid:_self.payInfo.PAY_ORDERID,
|
|
|
+ amount:_self.payAmount,
|
|
|
+ url:_self.payInfo.PAY_MOBILE_URL
|
|
|
};
|
|
|
- _util.setStorageItem('PAY_DATA',JSON.stringify(_this.payInfo.PAY_DATA));
|
|
|
- window.open("/web/order/view/pay/caimei-paymobile.jsp?pageType=1");
|
|
|
+ CAIMEI.Storage.setItem('PAY_DATA',JSON.stringify(_self.payInfo.PAY_DATA));
|
|
|
+ window.open("/pay/caimei-paymobile.html?pageType=1");
|
|
|
}else{
|
|
|
window.open(response.data.data.payUrl);
|
|
|
}
|
|
@@ -258,33 +250,33 @@ var payContainer = new Vue({
|
|
|
})
|
|
|
},
|
|
|
PayOrdersecondHandPay:function(params,type){//二手支付请求
|
|
|
- var _this = this;
|
|
|
+ var _self = this;
|
|
|
PayApi.PayOrdersecondHandPay(params,function(response){
|
|
|
if(response.code == 0){
|
|
|
- _this.isPayAlert = true;
|
|
|
- _this.mbOrderId = response.data.data.mbOrderId;
|
|
|
+ _self.isPayAlert = true;
|
|
|
+ _self.mbOrderId = response.data.data.mbOrderId;
|
|
|
if(type == 'ALIPAY'){
|
|
|
- _this.payInfo.PAY_MOBILE_URL = response.data.data.payUrl;
|
|
|
- if(_this.pageType === '1'){
|
|
|
- _this.payInfo.PAY_DATA = {
|
|
|
- mbOrderId:_this.mbOrderId,
|
|
|
- type:_this.payInfo.PAY_BANK_NUM,
|
|
|
- productId:_this.productID,
|
|
|
- amount:_this.payAmount,
|
|
|
- url:_this.payInfo.PAY_MOBILE_URL
|
|
|
+ _self.payInfo.PAY_MOBILE_URL = response.data.data.payUrl;
|
|
|
+ if(_self.pageType === '1'){
|
|
|
+ _self.payInfo.PAY_DATA = {
|
|
|
+ mbOrderId:_self.mbOrderId,
|
|
|
+ type:_self.payInfo.PAY_BANK_NUM,
|
|
|
+ productId:_self.productID,
|
|
|
+ amount:_self.payAmount,
|
|
|
+ url:_self.payInfo.PAY_MOBILE_URL
|
|
|
};
|
|
|
- _util.setStorageItem('PAY_DATA',JSON.stringify(_this.payInfo.PAY_DATA));
|
|
|
- window.open("/web/order/view/pay/caimei-paymobile.jsp?pageType=1");
|
|
|
+ CAIMEI.Storage.setItem('PAY_DATA',JSON.stringify(_self.payInfo.PAY_DATA));
|
|
|
+ window.open("/pay/caimei-paymobile.html?pageType=1");
|
|
|
}else{
|
|
|
- _this.payInfo.PAY_DATA = {
|
|
|
- mbOrderId:_this.mbOrderId,
|
|
|
- type:_this.payInfo.PAY_BANK_NUM,
|
|
|
- orderid:_this.payInfo.PAY_ORDERID,
|
|
|
- amount:_this.payAmount,
|
|
|
- url:_this.payInfo.PAY_MOBILE_URL
|
|
|
+ _self.payInfo.PAY_DATA = {
|
|
|
+ mbOrderId:_self.mbOrderId,
|
|
|
+ type:_self.payInfo.PAY_BANK_NUM,
|
|
|
+ orderid:_self.payInfo.PAY_ORDERID,
|
|
|
+ amount:_self.payAmount,
|
|
|
+ url:_self.payInfo.PAY_MOBILE_URL
|
|
|
};
|
|
|
- _util.setStorageItem('PAY_DATA',JSON.stringify(_this.payInfo.PAY_DATA));
|
|
|
- window.open("/web/order/view/pay/caimei-paymobile.jsp");
|
|
|
+ CAIMEI.Storage.setItem('PAY_DATA',JSON.stringify(_self.payInfo.PAY_DATA));
|
|
|
+ window.open("/pay/caimei-paymobile.html");
|
|
|
}
|
|
|
}else{
|
|
|
window.open(response.data.data.payUrl);
|
|
@@ -295,27 +287,27 @@ var payContainer = new Vue({
|
|
|
})
|
|
|
},
|
|
|
changePayAmount:function(event){//输入支付金额控制
|
|
|
- var _this = this;
|
|
|
+ var _self = this;
|
|
|
var value = event.target.value;
|
|
|
if(value == "" || value <0 ){//判断是否等于0 或者为空
|
|
|
- _this.payAmount = '';
|
|
|
- _this.payInfo.PAY_PAYAMOUNT = _this.payInfo.PAY_UNPAIDAMOUNT;
|
|
|
- _this.balanceAmount = _this.toFixedFn(_this.payInfo.PAY_UNPAIDAMOUNT);
|
|
|
+ _self.payAmount = '';
|
|
|
+ _self.payInfo.PAY_PAYAMOUNT = _self.payInfo.PAY_UNPAIDAMOUNT;
|
|
|
+ _self.balanceAmount = _self.toFixedFn(_self.payInfo.PAY_UNPAIDAMOUNT);
|
|
|
return;
|
|
|
- }else if(Number(value) > _this.payInfo.PAY_UNPAIDAMOUNT){//判断大于应付金额
|
|
|
- _this.payAmount = _this.payInfo.PAY_UNPAIDAMOUNT;
|
|
|
- _this.payInfo.PAY_PAYAMOUNT = _this.payAmount;
|
|
|
- _this.balanceAmount = _this.toFixedFn(_this.payInfo.PAY_UNPAIDAMOUNT-_this.payInfo.PAY_PAYAMOUNT);
|
|
|
+ }else if(Number(value) > _self.payInfo.PAY_UNPAIDAMOUNT){//判断大于应付金额
|
|
|
+ _self.payAmount = _self.payInfo.PAY_UNPAIDAMOUNT;
|
|
|
+ _self.payInfo.PAY_PAYAMOUNT = _self.payAmount;
|
|
|
+ _self.balanceAmount = _self.toFixedFn(_self.payInfo.PAY_UNPAIDAMOUNT-_self.payInfo.PAY_PAYAMOUNT);
|
|
|
}else{
|
|
|
- _this.payAmount = value;
|
|
|
- _this.payInfo.PAY_PAYAMOUNT = _this.payAmount;
|
|
|
- _this.balanceAmount = _this.toFixedFn(_this.payInfo.PAY_UNPAIDAMOUNT-_this.payInfo.PAY_PAYAMOUNT);
|
|
|
+ _self.payAmount = value;
|
|
|
+ _self.payInfo.PAY_PAYAMOUNT = _self.payAmount;
|
|
|
+ _self.balanceAmount = _self.toFixedFn(_self.payInfo.PAY_UNPAIDAMOUNT-_self.payInfo.PAY_PAYAMOUNT);
|
|
|
}
|
|
|
},
|
|
|
changePayAmountBlur:function(event){//失去焦点设置金额
|
|
|
- var _this = this;
|
|
|
- _this.payAmount = _this.toFixedFn(event.target.value);
|
|
|
- _this.payInfo.PAY_PAYAMOUNT = _this.payAmount;
|
|
|
+ var _self = this;
|
|
|
+ _self.payAmount = _self.toFixedFn(event.target.value);
|
|
|
+ _self.payInfo.PAY_PAYAMOUNT = _self.payAmount;
|
|
|
},
|
|
|
changeTab:function(index,item){//选择支付方式切换
|
|
|
this.tabIndex = index;
|
|
@@ -340,77 +332,77 @@ var payContainer = new Vue({
|
|
|
this.payInfo.PAY_BANK_NUM = item.bankNum;
|
|
|
},
|
|
|
copyLinkPaySubmitFn:function(){//复制网银支付链接
|
|
|
- var _this = this;
|
|
|
- if(_this.invoiceStatus){
|
|
|
- _this.layerConfirm();
|
|
|
+ var _self = this;
|
|
|
+ if(_self.invoiceStatus){
|
|
|
+ _self.layerConfirm();
|
|
|
}else{
|
|
|
- if(_this.payAmount == ''){
|
|
|
- layer.msg('请输入本次支付金额');
|
|
|
+ if(_self.payAmount == ''){
|
|
|
+ CAIMEI.dialog('请输入本次支付金额');
|
|
|
return;
|
|
|
}
|
|
|
- if(_this.payAmount == 0){
|
|
|
- layer.msg('本次支付金额不能为0');
|
|
|
+ if(_self.payAmount == 0){
|
|
|
+ CAIMEI.dialog('本次支付金额不能为0');
|
|
|
return;
|
|
|
}
|
|
|
- if(_this.payAmount <= 10){
|
|
|
- layer.msg('企业网银支付的金额必须大于¥10.00');
|
|
|
+ if(_self.payAmount <= 10){
|
|
|
+ CAIMEI.dialog('企业网银支付的金额必须大于¥10.00');
|
|
|
return;
|
|
|
}
|
|
|
- PayApi.PayOrderPayLink({unpaidAmount:_this.payAmount,orderId:_this.payInfo.PAY_ORDERID},function(response){
|
|
|
- _this.bankPayLink_url = response.data;
|
|
|
+ PayApi.PayOrderPayLink({unpaidAmount:_self.payAmount,orderId:_self.payInfo.PAY_ORDERID},function(response){
|
|
|
+ _self.bankPayLink_url = response.data;
|
|
|
var oInput = document.createElement("textarea");
|
|
|
- oInput.value = _this.bankPayLink_url;
|
|
|
+ oInput.value = _self.bankPayLink_url;
|
|
|
document.body.appendChild(oInput);
|
|
|
oInput.select(); // 选择对象
|
|
|
document.execCommand("Copy"); // 执行浏览器复制命令
|
|
|
document.body.removeChild(oInput);
|
|
|
- layer.msg('复制成功');
|
|
|
+ CAIMEI.dialog('复制成功');
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
copyOrderBtnSubmitFn:function(){//复制订单标识
|
|
|
- var _this = this;
|
|
|
+ var _self = this;
|
|
|
var oInput = document.createElement("textarea");
|
|
|
- oInput.value = _this.orderIdentificationId;
|
|
|
+ oInput.value = _self.orderIdentificationId;
|
|
|
document.body.appendChild(oInput);
|
|
|
oInput.select(); // 选择对象
|
|
|
document.execCommand("Copy"); // 执行浏览器复制命令
|
|
|
document.body.removeChild(oInput);
|
|
|
- layer.msg('复制成功');
|
|
|
+ CAIMEI.dialog('复制成功');
|
|
|
},
|
|
|
hidePayAlert:function(){//隐藏已支付弹窗
|
|
|
- var _this = this;
|
|
|
- _this.isPayAlert = false;
|
|
|
+ var _self = this;
|
|
|
+ _self.isPayAlert = false;
|
|
|
},
|
|
|
RefreshBody:function(){//刷新页面
|
|
|
- var _this = this;
|
|
|
- if(_this.payInfo.PAY_BANK_NUM == 'WEIXIN'){
|
|
|
- PayApi.PayOrderPayWhetherSuccess({orderId: _this.payInfo.PAY_ORDERID, paySuccessCounter:_this.paySuccessCounter},function(response){
|
|
|
- _this.isPayAlert = false;
|
|
|
+ var _self = this;
|
|
|
+ if(_self.payInfo.PAY_BANK_NUM == 'WEIXIN'){
|
|
|
+ PayApi.PayOrderPayWhetherSuccess({orderId: _self.payInfo.PAY_ORDERID, paySuccessCounter:_self.paySuccessCounter},function(response){
|
|
|
+ _self.isPayAlert = false;
|
|
|
if(response.code === 0){
|
|
|
- _this.windowLocationHref('success');
|
|
|
+ _self.windowLocationHref('success');
|
|
|
}else{
|
|
|
- _this.windowLocationHref('error');
|
|
|
+ _self.windowLocationHref('error');
|
|
|
}
|
|
|
});
|
|
|
}else{
|
|
|
- PayApi.PayOrderFindOrderStatus({mbOrderId:_this.mbOrderId},function(response){
|
|
|
- _this.isPayAlert = false;
|
|
|
+ PayApi.PayOrderFindOrderStatus({mbOrderId:_self.mbOrderId},function(response){
|
|
|
+ _self.isPayAlert = false;
|
|
|
var data = response.data.data;
|
|
|
if(data.status === '1'){
|
|
|
- _this.windowLocationHref('success');
|
|
|
+ _self.windowLocationHref('success');
|
|
|
}else{
|
|
|
- _this.windowLocationHref('error');
|
|
|
+ _self.windowLocationHref('error');
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
windowLocationHref:function(state){
|
|
|
- var _this = this;
|
|
|
- if( _this.pageType === '1'){
|
|
|
- window.location.href = '/web/order/view/pay/caimei-success.jsp?pageType=second&type='+state+'&payAmount='+_this.payAmount;
|
|
|
+ var _self = this;
|
|
|
+ if( _self.pageType === '1'){
|
|
|
+ window.location.href = '/pay/success.html?pageType=second&type='+state+'&payAmount='+_self.payAmount;
|
|
|
}else{
|
|
|
- window.location.href = '/web/order/view/pay/caimei-success.jsp?pageType=www&type='+state+'&payAmount='+_this.payAmount;
|
|
|
+ window.location.href = '/pay/success.html?pageType=www&type='+state+'&payAmount='+_self.payAmount;
|
|
|
}
|
|
|
},
|
|
|
payTypeText:function(state){//处理支付记录文字
|
|
@@ -433,37 +425,32 @@ var payContainer = new Vue({
|
|
|
return Number(text).toFixed(2);
|
|
|
},
|
|
|
layerConfirm:function(){
|
|
|
- layer.confirm('本次交易暂不支持线上支付开票,请使用线下转账的方式付款', {
|
|
|
- title:"提示",
|
|
|
- btn: ['知道了'], //按钮
|
|
|
- }, function () {
|
|
|
- layer.closeAll();
|
|
|
- _this.payStatusText = '使用微信和企业网银支付全部金额后,供应商会在24小时后发货(周末、节假日顺延)。若着急发货,可以选择使用线下转账进行付款。';
|
|
|
- _this.isReceiptStatus = true;
|
|
|
- }, function () {
|
|
|
-
|
|
|
+ var _self = this;
|
|
|
+ CAIMEI.Alert('本次交易暂不支持线上支付开票,请使用线下转账的方式付款','知道了',true,function () {
|
|
|
+ _self.payStatusText = '使用微信和企业网银支付全部金额后,供应商会在24小时后发货(周末、节假日顺延)。若着急发货,可以选择使用线下转账进行付款。';
|
|
|
+ _self.isReceiptStatus = true;
|
|
|
});
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
mounted: function () {
|
|
|
- var _this = this;
|
|
|
- _this.pageType = _util.getUrlParam('pageType');
|
|
|
- if( _this.pageType === '1'){//二手
|
|
|
- _this.productID = _util.getUrlParam('productID');
|
|
|
- _this.payAmount = _this.toFixedFn(100);
|
|
|
- _this.isRequest = true;
|
|
|
- _this.payStatusText = '';
|
|
|
+ var _self = this;
|
|
|
+ _self.pageType = CAIMEI.getUrlParam('pageType');
|
|
|
+ if( _self.pageType === '1'){//二手
|
|
|
+ _self.productID = CAIMEI.getUrlParam('productID');
|
|
|
+ _self.payAmount = _self.toFixedFn(100);
|
|
|
+ _self.isRequest = true;
|
|
|
+ _self.payStatusText = '';
|
|
|
}else{
|
|
|
- var HrefType = _util.getUrlParam('type');
|
|
|
+ var HrefType = CAIMEI.getUrlParam('type');
|
|
|
if(HrefType == 'payfirm'){
|
|
|
- _this.payInfo.PAY_ORDERID = _util.getUrlParam('orderID');
|
|
|
- _this.orderIdentificationId = '#'+_this.payInfo.PAY_ORDERID+'#';
|
|
|
+ _self.payInfo.PAY_ORDERID = CAIMEI.getUrlParam('orderID');
|
|
|
+ _self.orderIdentificationId = '#'+_self.payInfo.PAY_ORDERID+'#';
|
|
|
}else{
|
|
|
var data =JSON.parse(localStorage.getItem("confirmOrderInfo"));
|
|
|
- _this.payInfo.PAY_ORDERID = data.data.orderID;
|
|
|
- _this.orderIdentificationId = '#'+_this.payInfo.PAY_ORDERID+'#';
|
|
|
+ _self.payInfo.PAY_ORDERID = data.data.orderID;
|
|
|
+ _self.orderIdentificationId = '#'+_self.payInfo.PAY_ORDERID+'#';
|
|
|
}
|
|
|
- _this.infoPayOrderCheckoutCounter();//正常订单初始化
|
|
|
+ _self.infoPayOrderCheckoutCounter();//正常订单初始化
|
|
|
}
|
|
|
|
|
|
|