|
|
@ -46,23 +46,85 @@ Page({ |
|
|
|
confimPay(){ |
|
|
|
let leases =this.data.leases |
|
|
|
let userInfo = wx.getStorageSync('userInfo') |
|
|
|
let productName = leases.orderType == '0'?'短信充值':leases.orderType == '1'?'交租':leases.orderType == '2'?'语音电话充值':leases.orderType == '3'?'系统续费':'未知' |
|
|
|
var data = { |
|
|
|
description: "交租", |
|
|
|
productName: "交租", |
|
|
|
total: parseInt(leases.monthRent)*100,//parseInt(this.data.leases.expand.rent)*100,
|
|
|
|
description: productName, |
|
|
|
productName: productName, |
|
|
|
total: parseInt(leases.totalFee)*100,//parseInt(this.data.leases.expand.rent)*100,
|
|
|
|
userId: leases.cardId, |
|
|
|
cardId:leases.cardId, |
|
|
|
openid:wx.getStorageSync('openid'), |
|
|
|
appid:'wx20de9fe5943934a1', |
|
|
|
appid:'wx885b65d99da00084',//'wx20de9fe5943934a1',//'wx885b65d99da00084',
|
|
|
|
uid:userInfo.id, |
|
|
|
eid:userInfo.enterpriseId, |
|
|
|
orderType:1, |
|
|
|
orderType:leases.orderType, |
|
|
|
payType:this.data.radio, |
|
|
|
expand:JSON.stringify({ |
|
|
|
phone:leases.phone, |
|
|
|
nickname:leases.name |
|
|
|
}) |
|
|
|
nickname:leases.cardName |
|
|
|
}), |
|
|
|
relevanceId:leases.id |
|
|
|
} |
|
|
|
WXAPI.miniPrepayOrderT(data).then(res=>{ |
|
|
|
wx.requestPayment({ |
|
|
|
timeStamp: res.data.data.timeStamp, |
|
|
|
appid: res.data.data.appId, |
|
|
|
nonceStr: res.data.data.nonceStr, |
|
|
|
package: res.data.data.package, |
|
|
|
signType: res.data.data.signType, |
|
|
|
totalFee: parseInt(leases.totalFee)*100, |
|
|
|
paySign: res.data.data.paySign, |
|
|
|
success (res1) { |
|
|
|
wx.showToast({ |
|
|
|
title: "支付成功", |
|
|
|
duration: 2000, |
|
|
|
icon: 'success' |
|
|
|
}) |
|
|
|
let dataOne={ |
|
|
|
code: "wx/updatePrepayStatus", |
|
|
|
cardId:leases.cardId, |
|
|
|
data: { |
|
|
|
orderNo: res.data.data.orderNo, |
|
|
|
status:0 |
|
|
|
} |
|
|
|
} |
|
|
|
WXAPI.sendCommand(dataOne).then(res2=>{ |
|
|
|
wx.showToast({ |
|
|
|
title: '支付成功', |
|
|
|
duration:2000 |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
fail (res1) { |
|
|
|
wx.showToast({ |
|
|
|
title: "支付失败", |
|
|
|
duration: 2000, |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
let dataOne={} |
|
|
|
if(res1.errMsg == 'requestPayment:fail cancel'){ |
|
|
|
dataOne={ |
|
|
|
code: "wx/updatePrepayStatus", |
|
|
|
data: { |
|
|
|
orderNo: res.data.data.orderNo, |
|
|
|
status:8 |
|
|
|
} |
|
|
|
} |
|
|
|
}else{ |
|
|
|
dataOne={ |
|
|
|
code: "wx/updatePrepayStatus", |
|
|
|
cardId:leases.cardId, |
|
|
|
data: { |
|
|
|
orderNo: res.data.data.orderNo, |
|
|
|
status:6 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
WXAPI.sendCommand(dataOne).then(res2=>{ |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
// WXAPI.miniPrepayOrder(data).then(res=>{
|
|
|
|
// let dataOne={
|
|
|
|
// code: "wx/updatePrepayStatus",
|
|
|
@ -87,6 +149,7 @@ Page({ |
|
|
|
// }
|
|
|
|
// })
|
|
|
|
// })
|
|
|
|
}) |
|
|
|
}, |
|
|
|
onChangeRadio(event){ |
|
|
|
this.setData({ |
|
|
@ -112,6 +175,8 @@ Page({ |
|
|
|
if(res.success){ |
|
|
|
res.data.list.map(li=>{ |
|
|
|
li.createTime = moment(li.createTime).format('YYYY-MM-DD HH:mm:ss') |
|
|
|
li.waterFee = parseFloat(li.waterFee/100).toFixed(2) |
|
|
|
li.electricityFee = parseFloat(li.electricityFee/100).toFixed(2) |
|
|
|
}) |
|
|
|
this.setData({ |
|
|
|
orderLogList:res.data.list |