|
@@ -220,138 +220,11 @@
|
|
this.payOrderId ='#'+e.orderId+'#';
|
|
this.payOrderId ='#'+e.orderId+'#';
|
|
this.optionType = e.type;
|
|
this.optionType = e.type;
|
|
console.log(this.optionType)
|
|
console.log(this.optionType)
|
|
- switch(e.type){
|
|
|
|
- case 'confirm':
|
|
|
|
- this.nvabarData.haveBack = false
|
|
|
|
- this.nvabarData.haveHome = true
|
|
|
|
- this.nvabarData.title = '支付'
|
|
|
|
- this.PayOrderOnLineSwitch()
|
|
|
|
- this.PayOrderCheckoutCounter(this.orderId)
|
|
|
|
- break;
|
|
|
|
- case 'payfirm':
|
|
|
|
- this.nvabarData.haveBack = true
|
|
|
|
- this.nvabarData.haveHome = false
|
|
|
|
- this.nvabarData.title = '选择支付方式'
|
|
|
|
- this.PayOrderOnLineSwitch()
|
|
|
|
- this.PayOrderCheckoutCounter(this.orderId)
|
|
|
|
- break;
|
|
|
|
- case 'onlinePay':
|
|
|
|
- this.invoiceStatus = true
|
|
|
|
- this.isPaySwitch = false
|
|
|
|
- this.nvabarData.haveBack = true
|
|
|
|
- this.nvabarData.haveHome = false
|
|
|
|
- this.nvabarData.title = '付款提示'
|
|
|
|
- this.payableAmount = this.ableUserMoney = e.Amount
|
|
|
|
- this.payBringTitle = '您已通过线下转账的方式支付了订单部分款项,剩余款项依然需要使用线下转账方式,给您带来的不便敬请谅解'
|
|
|
|
- this.initAbleUserMoney(this.payableAmount)
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- PayOrderOnLineSwitch(){
|
|
|
|
- this.PayService.PayOrderOnLineSwitch().then(response=>{
|
|
|
|
- if(response.data === 0 ){
|
|
|
|
- this.isPaySwitch = true
|
|
|
|
- }else{
|
|
|
|
- this.isPaySwitch = false
|
|
|
|
- }
|
|
|
|
- }).catch(error =>{
|
|
|
|
- this.$util.msg(error.msg,2000)
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- PayOrderCheckoutCounter(orderId){
|
|
|
|
- this.PayService.PayOrderCheckoutCounter({orderId:orderId}).then(response =>{
|
|
|
|
- let data = response.data.order
|
|
|
|
- this.payableAmount = this.ableUserMoney = data.payableAmount - data.receiptAmount //待付金额
|
|
|
|
- this.receiptStatus = data.receiptStatus
|
|
|
|
- this.onlinePayFlag = data.onlinePayFlag
|
|
|
|
- this.initAbleUserMoney(this.payableAmount)
|
|
|
|
- if(this.payableAmount > 5000){
|
|
|
|
- this.tabCurrentIndex = 1
|
|
|
|
- this.isUnbindWxPay = false
|
|
|
|
- }
|
|
|
|
- //判断线上线下显示
|
|
|
|
- this.invoiceStatus = true
|
|
|
|
- // if(this.optionType == 'onlinePay'){
|
|
|
|
- // this.invoiceStatus = true
|
|
|
|
- // }else{
|
|
|
|
- // this.invoiceStatus = data.invoiceStatus
|
|
|
|
- // }
|
|
|
|
- if(data.receiptAmount > 0){
|
|
|
|
- this.payStatusText = '使用微信和网银支付全部金额后,供应商会在24小时后发货(周末、节假日顺延)。'
|
|
|
|
- this.isReceiptStatus = false
|
|
|
|
- }else{
|
|
|
|
- this.payStatusText = '使用微信和网银支付全部金额后,供应商会在24小时后发货(周末、节假日顺延)。若着急发货,可以选择使用线下转账进行付款。'
|
|
|
|
- this.isReceiptStatus = true
|
|
|
|
- }
|
|
|
|
- }).catch(error =>{
|
|
|
|
- this.$util.msg(error.msg,2000)
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- goOrderCash(){
|
|
|
|
- if(this.invoiceStatus){
|
|
|
|
- this.$util.modal('','本次交易暂不支持线上支付开票,请使用线下转账的方式付款','知道了','',false,() =>{})
|
|
|
|
- this.payStatusText = '使用微信和网银支付全部金额后,供应商会在24小时后发货(周末、节假日顺延)。若着急发货,可以选择使用线下转账进行付款。'
|
|
|
|
- this.isReceiptStatus = true
|
|
|
|
- }else{
|
|
|
|
- switch(this.tabCurrentIndex){
|
|
|
|
- case 0:
|
|
|
|
- this.MiniWxPayFor()
|
|
|
|
- break;
|
|
|
|
- case 1:
|
|
|
|
- this.payType = '1'
|
|
|
|
- this.BuildCatenate()
|
|
|
|
- break;
|
|
|
|
- case 2:
|
|
|
|
- this.payType = '2'
|
|
|
|
- this.BuildCatenate()
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- async MiniWxPayFor(){
|
|
|
|
- const wechatCode = await authorize.getCode('weixin')
|
|
|
|
- if(this.payableAmount > 5000){
|
|
|
|
- this.$util.modal('','本次支付金额已超出微信支付限额,请输入小于5千的金额进行支付','知道了','',false,() =>{})
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- let params ={
|
|
|
|
- payAmount:this.payableAmount*100,
|
|
|
|
- payWay:"WEIXIN",
|
|
|
|
- code:wechatCode,
|
|
|
|
- orderId:this.orderId
|
|
|
|
- }
|
|
|
|
- this.PayService.WeChatMiniWxPay(params).then(response =>{
|
|
|
|
- let PayInfo = JSON.parse(response.data.data.payInfo);
|
|
|
|
- this.WxRequestPayment(PayInfo)
|
|
|
|
- }).catch(error =>{
|
|
|
|
- this.$util.msg(error.msg,2000)
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- WxRequestPayment(data){
|
|
|
|
- let self = this
|
|
|
|
- wx.requestPayment({
|
|
|
|
- 'timeStamp': data.timeStamp,
|
|
|
|
- 'nonceStr': data.nonceStr,
|
|
|
|
- 'package': data.package,
|
|
|
|
- 'signType': data.signType,
|
|
|
|
- 'paySign': data.paySign,
|
|
|
|
- 'success':function(res){
|
|
|
|
- wx.reLaunch({url: '/pages/index/index'});
|
|
|
|
- },
|
|
|
|
- 'fail':function(res){
|
|
|
|
- console.log(res)
|
|
|
|
- self.$util.msg('用户取消支付~')
|
|
|
|
- },
|
|
|
|
- 'complete':function(res){
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- BuildCatenate(){
|
|
|
|
- this.PayService.PayOrderPayLink({unpaidAmount:this.payableAmount,orderId:this.orderId,payType:this.payType}).then(response =>{
|
|
|
|
- this.payHttpUrl = response.data
|
|
|
|
- this.isHttpUrlShowTip = true
|
|
|
|
- })
|
|
|
|
|
|
+ this.invoiceStatus = true
|
|
|
|
+ this.nvabarData.haveBack = true
|
|
|
|
+ this.nvabarData.haveHome = true
|
|
|
|
+ this.nvabarData.title = '收银台'
|
|
|
|
+ this.initAbleUserMoney(e.money)
|
|
},
|
|
},
|
|
initAbleUserMoney(money){//拆分金额并转千分位格式显示
|
|
initAbleUserMoney(money){//拆分金额并转千分位格式显示
|
|
if(money == 0){
|
|
if(money == 0){
|
|
@@ -373,23 +246,6 @@
|
|
console.log(this.smallMoney)
|
|
console.log(this.smallMoney)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- tabClick(index) {//tab切换
|
|
|
|
- this.tabCurrentIndex = index;
|
|
|
|
- switch(index){
|
|
|
|
- case 0:
|
|
|
|
- this.btnColor="#09BB07"
|
|
|
|
- this.buttonText='使用微信支付';
|
|
|
|
- break;
|
|
|
|
- case 1:
|
|
|
|
- this.btnColor="#034582"
|
|
|
|
- this.buttonText='使用企业网银支付';
|
|
|
|
- break;
|
|
|
|
- case 2:
|
|
|
|
- this.btnColor="#034582"
|
|
|
|
- this.buttonText='使用个人网银支付';
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
hanldNavigateBack(){//页面返回
|
|
hanldNavigateBack(){//页面返回
|
|
uni.navigateBack({
|
|
uni.navigateBack({
|
|
delta: 1
|
|
delta: 1
|