zizhong.wang 2 anni fa
parent
commit
34d7ecb606
1 ha cambiato i file con 13 aggiunte e 3 eliminazioni
  1. 13 3
      pages/heatingPage/pay.vue

+ 13 - 3
pages/heatingPage/pay.vue

@@ -156,11 +156,15 @@ export default {
 		this.payInfo.type = e.detail.value;
 	},
 	paySubmit(){
-		
+		let type = this.payInfo.type;
+		if (this.payInfo.status == 2)
+		{
+			type = 3;
+		}
 		let url = getApp().makeApiUrl("user",'user','prepay');
 		let postData = {
 		  code:this.pay_code,
-		  type : this.payInfo.type,
+		  type : type,
 		  openId: getApp().globalData.open_id,
 		};
 		uni.request({
@@ -182,7 +186,9 @@ export default {
 				 	paySign: r.sign,
 				 	success: function (res) {
 				 		console.log('success:' + JSON.stringify(res));
-				 		this.payStatus = 1;
+				 		setTimeout(function() {
+				 			Location.reload();
+				 		}, 2500);
 				 	},
 				 	fail: function (err) {
 				 		console.log('fail:' + JSON.stringify(err));
@@ -234,11 +240,15 @@ export default {
 		    data: postData,
 		    success: (res) => {
 		      if (res.data.code === 200) {
+				  /*
 		           uni.showToast({
 		             title: res.data.msg,
 		             icon: "none",
 		             duration: 2500,
 		           });
+				  */
+				   window.location.reload();
+				   
 		      } else {
 		        uni.showToast({
 		          title: res.data.msg,