首页致命bug修复

This commit is contained in:
@fawn-nine
2023-10-07 13:15:54 +08:00
parent cb86e855cc
commit b7d31af52a
4 changed files with 37 additions and 24 deletions

View File

@@ -50,7 +50,7 @@
<view class="tanchu">
<view class="dp_title">请输入昵称</view>
<u--input v-model="userMes.nickname" placeholder="请输入昵称" border="surround" clearable></u--input>
<u-button color="linear-gradient(to right, #72d386, #317e42)" text="确定" @click="choseNickname()"
<u-button color="linear-gradient(to right, #72d386, #317e42)" text="确定" @click="choseNickname(userMes.nickname)"
style="margin-top: 50rpx;"></u-button>
<view @click="nicknameShow=false" class="dp_canBtn">取消</view>
</view>
@@ -124,7 +124,8 @@
nickname: '',
tel: '',
password: '',
Repassword: ''
Repassword: '',
oldName:'', // 老的用户名
},
avatarShow: false,
nicknameShow: false,
@@ -176,6 +177,7 @@
that.userMes.nickname = res.user.nickname
that.userMes.tel = res.user.tel
that.userMes.avatar = res.user.avatar
that.userMes.oldName = that.userMes.nickname
});
}
},
@@ -212,8 +214,18 @@
// 昵称
choseNickname(e) {
let that = this
that.choseData()
that.nicknameShow = false
if(e && e != ''){
that.choseData()
that.nicknameShow = false
}else{
that.userMes.nickname = that.userMes.oldName
console.log(that.userMes.nickname)
uni.showToast({
title:'请输入昵称',
icon:'none'
})
}
},
// 性别