This commit is contained in:
3321822538@qq.com 2024-05-24 18:02:56 +08:00
parent c7295caf71
commit 18421bc31b
2 changed files with 61 additions and 36 deletions

View File

@ -1,7 +1,7 @@
<template> <template>
<view class="page"> <view class="page">
<u-navbar title="充值" :border-bottom="false" :background="bgc" title-color='#fff' back-icon-color="#fff" title-size='36' <u-navbar title="充值" :border-bottom="false" :background="bgc" title-color='#fff' back-icon-color="#fff"
height='58'></u-navbar> title-size='36' height='58'></u-navbar>
<view class="title"> <view class="title">
设备名称{{deviceobj.deviceName}} 设备名称{{deviceobj.deviceName}}
</view> </view>
@ -52,8 +52,8 @@
立即支付 立即支付
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
@ -65,29 +65,44 @@
indexactive: 0, indexactive: 0,
checked: false, checked: false,
deviceobj: {}, deviceobj: {},
deviceid: 'DS-000002', deviceid: '',
timer: null, timer: null,
expireTimeStr: '', expireTimeStr: '',
zfobj: {}, zfobj: {},
orderno: '', orderno: '',
id:'', id: '',
czflag:false, czflag: false,
sytime:0, sytime: 0,
datetime:0 datetime: 0
} }
}, },
onLoad(option) { onLoad(option) {
this.id = option.id if (option.q) {
this.startTimer() function getQueryParam(url, paramName) {
this.gettaoc() 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: { computed: {
}, },
onShow() { onShow() {
if(this.orderno){ if (this.orderno) {
this.gethuidaio() this.gethuidaio()
} }
}, },
methods: { methods: {
startTimer() { startTimer() {
@ -138,16 +153,16 @@
package: res.data.packageVal, package: res.data.packageVal,
signType: res.data.signType, signType: res.data.signType,
paySign: res.data.paySign, paySign: res.data.paySign,
success: (res) => { success: (res) => {
console.log(res,'支付成功'); console.log(res, '支付成功');
if (this.timer) { if (this.timer) {
clearInterval(this.timer); clearInterval(this.timer);
this.timer = null; this.timer = null;
} }
// //
uni.reLaunch({ uni.reLaunch({
url:'/pages/shouye/index' url: '/pages/shouye/index'
}) })
uni.setStorageSync('time', this.expireTimeStr) uni.setStorageSync('time', this.expireTimeStr)
}, },
fail(err) { fail(err) {
@ -161,16 +176,16 @@
}); });
} }
}) })
}else if(res.code == 401){ } else if (res.code == 401) {
uni.reLaunch({ uni.reLaunch({
url:'/pages/login/login' url: '/pages/login/login'
}) })
} }
}) })
} }
}, },
btnactive(item) { btnactive(item) {
this.sytime = item.value this.sytime = item.value
@ -192,9 +207,10 @@
</script> </script>
<style lang="scss"> <style lang="scss">
/deep/ .u-title{ /deep/ .u-title {
padding-bottom: 41rpx; padding-bottom: 41rpx;
} }
// /deep/ .u-icon__icon{ // /deep/ .u-icon__icon{
// padding-bottom: 41rpx; // padding-bottom: 41rpx;
// } // }
@ -212,7 +228,8 @@
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
.tip_box{
.tip_box {
position: fixed; position: fixed;
left: 72rpx; left: 72rpx;
top: 700rpx; top: 700rpx;
@ -221,9 +238,11 @@
background: #F7FAFE; background: #F7FAFE;
border-radius: 30rpx 30rpx 30rpx 30rpx; border-radius: 30rpx 30rpx 30rpx 30rpx;
z-index: 10000000; z-index: 10000000;
.top{
.top {
padding: 52rpx 38rpx 42rpx 36rpx; padding: 52rpx 38rpx 42rpx 36rpx;
.txt{
.txt {
width: 100%; width: 100%;
text-align: center; text-align: center;
font-weight: 500; font-weight: 500;
@ -231,12 +250,14 @@
color: #3D3D3D; color: #3D3D3D;
} }
} }
.bot{
border-top: 2rpx solid #D8D8D8 ; .bot {
border-top: 2rpx solid #D8D8D8;
display: flex; display: flex;
flex-wrap: nowrap; flex-wrap: nowrap;
height: 100%; height: 100%;
.bot_left{
.bot_left {
width: 50%; width: 50%;
height: 98rpx; height: 98rpx;
display: flex; display: flex;
@ -246,20 +267,21 @@
font-size: 36rpx; font-size: 36rpx;
color: #3D3D3D; color: #3D3D3D;
} }
.bot_right{
.bot_right {
width: 50%; width: 50%;
height: 98rpx; height: 98rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
border-left: 2rpx solid #D8D8D8 ; border-left: 2rpx solid #D8D8D8;
font-weight: 500; font-weight: 500;
font-size: 36rpx; font-size: 36rpx;
color: #8883F0; color: #8883F0;
} }
} }
} }

View File

@ -41,6 +41,9 @@
total: 0, total: 0,
keyword:'' keyword:''
} }
},
onLoad() {
}, },
onShow() { onShow() {
this.wateringList = [] this.wateringList = []