From 18421bc31b96072803263c3a684f31d989783378 Mon Sep 17 00:00:00 2001
From: "3321822538@qq.com" <3321822538@qq.com>
Date: Fri, 24 May 2024 18:02:56 +0800
Subject: [PATCH] aa
---
page_components/fuwu/index.vue | 94 +++++++++++++++++----------
page_fenbao/statulist/fault/index.vue | 3 +
2 files changed, 61 insertions(+), 36 deletions(-)
diff --git a/page_components/fuwu/index.vue b/page_components/fuwu/index.vue
index 37220ab..602ec58 100644
--- a/page_components/fuwu/index.vue
+++ b/page_components/fuwu/index.vue
@@ -1,7 +1,7 @@
-
+
设备名称:{{deviceobj.deviceName}}
@@ -52,8 +52,8 @@
立即支付
-
-
+
+
@@ -65,29 +65,44 @@
indexactive: 0,
checked: false,
deviceobj: {},
- deviceid: 'DS-000002',
+ deviceid: '',
timer: null,
expireTimeStr: '',
zfobj: {},
orderno: '',
- id:'',
- czflag:false,
- sytime:0,
- datetime:0
+ id: '',
+ czflag: false,
+ sytime: 0,
+ datetime: 0
}
},
onLoad(option) {
- this.id = option.id
- this.startTimer()
- this.gettaoc()
+ if (option.q) {
+ function getQueryParam(url, paramName) {
+ let regex = new RegExp(`[?&]${paramName}=([^&]*)`);
+ let results = regex.exec(url);
+ return results ? decodeURIComponent(results[1].replace(/\+/g, ' ')) : null;
+ }
+ let sceneValue = option.q
+ let decodedValue = decodeURIComponent(sceneValue);
+ this.id = getQueryParam(decodedValue, 'deviceNo')
+ console.log(this.id)
+ this.startTimer()
+ this.gettaoc()
+ } else {
+ this.id = option.id
+ this.startTimer()
+ this.gettaoc()
+ }
+
},
computed: {
},
onShow() {
- if(this.orderno){
- this.gethuidaio()
- }
+ if (this.orderno) {
+ this.gethuidaio()
+ }
},
methods: {
startTimer() {
@@ -138,16 +153,16 @@
package: res.data.packageVal,
signType: res.data.signType,
paySign: res.data.paySign,
- success: (res) => {
- console.log(res,'支付成功');
+ success: (res) => {
+ console.log(res, '支付成功');
if (this.timer) {
clearInterval(this.timer);
this.timer = null;
}
// 支付成功逻辑
- uni.reLaunch({
- url:'/pages/shouye/index'
- })
+ uni.reLaunch({
+ url: '/pages/shouye/index'
+ })
uni.setStorageSync('time', this.expireTimeStr)
},
fail(err) {
@@ -161,16 +176,16 @@
});
}
})
- }else if(res.code == 401){
+ } else if (res.code == 401) {
uni.reLaunch({
- url:'/pages/login/login'
+ url: '/pages/login/login'
})
}
})
}
},
-
-
+
+
btnactive(item) {
this.sytime = item.value
@@ -192,9 +207,10 @@