|
|
@@ -24,8 +24,8 @@
|
|
|
<view class="tel flex">
|
|
|
<label>缴费类型:</label>
|
|
|
<radio-group @change="payChange">
|
|
|
- <radio value="1" :checked="payInfo.type!=2" style="margin-right: 30rpx;transform: scale(0.85);">金额</radio>
|
|
|
- <radio value="2" :checked="payInfo.type==2" style="transform: scale(0.85);">空置</radio>
|
|
|
+ <radio value="1" :checked="payInfo.type!=2" style="margin-right: 30rpx;transform: scale(0.85);" >金额</radio>
|
|
|
+ <radio value="2" :checked="payInfo.type==2" style="transform: scale(0.85);" :disabled="payInfo.status==1 || payInfo.status==3">空置</radio>
|
|
|
</radio-group>
|
|
|
</view>
|
|
|
<view class="tel flex">
|
|
|
@@ -97,7 +97,10 @@ export default {
|
|
|
this.getPayDetail(option.id);
|
|
|
this.pay_code = option.id;
|
|
|
},
|
|
|
- methods: {
|
|
|
+ methods: {
|
|
|
+ reload(){
|
|
|
+ this.getPayDetail(this.pay_code);
|
|
|
+ },
|
|
|
getPayDetail(payId) {
|
|
|
|
|
|
let url = getApp().makeApiUrl("user",'user','get_order_info');
|
|
|
@@ -119,6 +122,9 @@ export default {
|
|
|
if (this.payInfo.status > 0 && this.payInfo.invoice_status == 0){
|
|
|
this.needInvoice = 1;
|
|
|
}
|
|
|
+ else{
|
|
|
+ this.needInvoice = 0;
|
|
|
+ }
|
|
|
if (this.payInfo.status == 2){
|
|
|
this.payStatusStr = '补充缴费';
|
|
|
}
|
|
|
@@ -156,6 +162,7 @@ export default {
|
|
|
this.payInfo.type = e.detail.value;
|
|
|
},
|
|
|
paySubmit(){
|
|
|
+ let that = this;
|
|
|
let type = this.payInfo.type;
|
|
|
if (this.payInfo.status == 2)
|
|
|
{
|
|
|
@@ -176,19 +183,28 @@ export default {
|
|
|
data: postData,
|
|
|
success: (res) => {
|
|
|
if (res.data.code === 200) {
|
|
|
- let r = res.data.data;
|
|
|
+ let r = res.data.data;
|
|
|
+ let timeStamp = Date.now().toString();
|
|
|
+ let nonceStr = getApp().randomStr(32);
|
|
|
+ let p = 'prepay_id=' + r.prepay_id;
|
|
|
+ let key = 'd2452k56khlk987HJ456uy7856HKJsd3'; //支付的key
|
|
|
+
|
|
|
+ let origin = "appId="+"wx3cf5d0fd376116e2"+"&nonceStr="+nonceStr+"&package="+p+"&signType=MD5&timeStamp="+timeStamp+"&key="+key;
|
|
|
+ let md5Sign = getApp().MD5(origin);
|
|
|
+// console.log('md5Sign_origin:' + origin);
|
|
|
+// console.log('md5Sign:' + md5Sign);
|
|
|
uni.requestPayment({
|
|
|
- provider: 'wxpay',
|
|
|
- timeStamp: String(Date.now()),
|
|
|
- nonceStr: r.nonce_str,
|
|
|
- package: 'prepay_id=' + r.prepay_id,
|
|
|
+ appId: 'wx3cf5d0fd376116e2',
|
|
|
+ timeStamp: timeStamp,
|
|
|
+ nonceStr: nonceStr,
|
|
|
+ package: p,
|
|
|
signType: 'MD5',
|
|
|
- paySign: r.sign,
|
|
|
+ paySign: md5Sign,
|
|
|
success: function (res) {
|
|
|
console.log('success:' + JSON.stringify(res));
|
|
|
setTimeout(function() {
|
|
|
- Location.reload();
|
|
|
- }, 2500);
|
|
|
+ that.reload();
|
|
|
+ }, 500);
|
|
|
},
|
|
|
fail: function (err) {
|
|
|
console.log('fail:' + JSON.stringify(err));
|
|
|
@@ -224,6 +240,7 @@ export default {
|
|
|
},
|
|
|
closePopup() {
|
|
|
this.$refs.popup.close();
|
|
|
+ let that = this;
|
|
|
let url = getApp().makeApiUrl("user",'user','invoice');
|
|
|
let postData = {
|
|
|
code:this.pay_code,
|
|
|
@@ -240,14 +257,16 @@ export default {
|
|
|
data: postData,
|
|
|
success: (res) => {
|
|
|
if (res.data.code === 200) {
|
|
|
- /*
|
|
|
+
|
|
|
uni.showToast({
|
|
|
title: res.data.msg,
|
|
|
icon: "none",
|
|
|
duration: 2500,
|
|
|
});
|
|
|
- */
|
|
|
- window.location.reload();
|
|
|
+
|
|
|
+ setTimeout(function() {
|
|
|
+ that.reload();
|
|
|
+ }, 500);
|
|
|
|
|
|
} else {
|
|
|
uni.showToast({
|