退出登录,提现修改,扫码bug修复

This commit is contained in:
tx 2024-08-01 17:06:10 +08:00
parent c3f818ae60
commit 062c925581
4 changed files with 129 additions and 47 deletions

7
package-lock.json generated
View File

@ -326,6 +326,7 @@
},
"fast-xml-parser": {
"version": "4.3.2",
"integrity": "sha512-rmrXUXwbJedoXkStenj1kkljNF7ugn5ZjR9FJcwmCfcCbtOMDghPajbc+Tck6vE6F5XsDmx+Pr2le9fw8+pXBg==",
"requires": {
"strnum": "^1.0.5"
}
@ -387,7 +388,8 @@
"peer": true
},
"strnum": {
"version": "1.0.5"
"version": "1.0.5",
"integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA=="
},
"update-browserslist-db": {
"version": "1.0.16",
@ -400,7 +402,8 @@
}
},
"uview-ui": {
"version": "1.8.8"
"version": "1.8.8",
"integrity": "sha512-Osal3yzXiHor0In9OPTZuXTaqTbDglMZ9RGK/MPYDoQQs+y0hrBCUD0Xp5T70C8i2lLu2X6Z11zJhmsQWMR7Jg=="
}
}
}

View File

@ -366,7 +366,7 @@
</view>
<view class="bot_btn">
<view class="cont" @click="topage(1)">
<view class="cont" @click="topage(1)" v-if="areaInfo.deposit!=0">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uYfTj4a3NkSNY0AqYHFc" mode=""></image>
<view class="text">
押金充值
@ -4409,8 +4409,11 @@
}
if (this.sn) {
this.deviceInfo(0)
this.qParam = null
setTimeout(()=>{
this.deviceInfo(0)
this.qParam = null
},500)
}
// if(!hasShownPopup){

View File

@ -34,7 +34,7 @@
<view class="btnbg" v-if="false">
<view class="btnbox">
<view class="btncard">
<view class="card_li" @click="topage(1)">
<view class="card_li" @click="topage(1)" v-if="areaInfo.deposit!=0">
<view class="card_left">
<image src="https://api.ccttiot.com/smartmeter/img/static/u3ILM6aE0MdFo3ZKiYPH" mode="">
</image>
@ -187,7 +187,7 @@
</view>
</view>
<view class="tocont">
<view class="cont_li" @click="topage(1)">
<view class="cont_li" @click="topage(1)" v-if="areaInfo.deposit!=0">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uYfTj4a3NkSNY0AqYHFc" mode=""></image>
<view class="txt">
押金
@ -242,6 +242,9 @@
<view class="iconfont icon-xiangyou1" ></view>
</view>
</view>
<view class="btns" @click="layout">
退出登录
</view>
<u-select v-model="show" :list="list" title='选择运营区' @confirm="confirm"></u-select>
</view>
</template>
@ -265,7 +268,8 @@
show: false,
deptId: 0,
statusBarHeight: 0,
navBarHeight: 0
navBarHeight: 0,
areaInfo:{}
@ -291,6 +295,7 @@
onShow() {
this.deptId = uni.getStorageSync('deptId');
this.getuserInfo()
this.getarea()
},
computed: {
maskedPhoneNumber() {
@ -303,6 +308,48 @@
}
},
methods: {
getarea() {
let id = uni.getStorageSync('areaId');
this.$u.get("/app/area/" + id).then((res) => {
if (res.code == 200) {
this.areaInfo = res.data
} else {
// uni.showToast({
// title: res.msg,
// icon: 'none',
// duration: 2000
// });
}
});
},
layout(){
this.$u.post('/logout').then((res) => {
if (res.code == 200) {
//
const keys = uni.getStorageInfoSync().keys;
//
const preserveKey = 'deptId'; //
//
keys.forEach(key => {
if (key !== preserveKey) {
uni.removeStorageSync(key);
}
});
//
uni.redirectTo({
url: '/pages/index/index'
});
}
}).catch(error => {
console.error("Error fetching area data:", error);
});
},
topage(num) {
if (num == 0) {
// uni.navigateTo({
@ -489,7 +536,18 @@
.page {
width: 750rpx;
.btns{
display: flex;
align-items: center;
justify-content: center;
width: 680rpx;
height: 90rpx;
background: #64B6A7 ;
color: #fff;
font-size: 36rpx;
border-radius: 20rpx;
margin: 40rpx auto;
}
.fixed {
z-index: 999;
position: fixed;

View File

@ -97,6 +97,7 @@
realprice:0,
Quantity:0,
border: false,
isThrottled:false
}
},
onLoad(e) {
@ -190,44 +191,61 @@
return `${month}-${day} ${hours}:${minutes}`;
},
payBtn() {
if(this.realprice!=0){
let data = {
amount: this.realprice
}
this.$u.post('/appVerify/admin/withdraw',data).then((res) => {
if (res.code == 200) {
this.amount=''
this.Quantity=0
this.realprice=0
this.price=0
this.list=[]
this.pageNum=1
this.getareaInfo()
this.getlist()
uni.showToast({
title: '提现成功',
icon: 'none',
duration: 2000
});
}else{
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
});
}
}).catch(error => {
console.error("Error fetching area data:", error);
});
}else{
uni.showToast({
title: '提现金额不能为0',
icon: 'none',
duration: 2000
});
}
if (this.realprice != 0) {
//
if (this.isThrottled) {
uni.showToast({
title: '请勿重复点击',
icon: 'none',
duration: 2000
});
return;
}
//
this.isThrottled = true;
let data = {
amount: this.realprice,
areaId: this.areaId
}
this.$u.post('/appVerify/admin/withdraw', data).then((res) => {
if (res.code == 200) {
this.amount = ''
this.Quantity = 0
this.realprice = 0
this.price = 0
this.list = []
this.pageNum = 1
this.getareaInfo()
this.getlist()
uni.showToast({
title: '提现成功',
icon: 'none',
duration: 2000
});
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
});
}
}).catch(error => {
console.error("Error fetching area data:", error);
}).finally(() => {
//
setTimeout(() => {
this.isThrottled = false;
}, 3000);
});
} else {
uni.showToast({
title: '提现金额不能为0',
icon: 'none',
duration: 2000
});
}
},
getareaInfo() {