kitchendDevice/pageTwo/setting/password.vue

146 lines
2.8 KiB
Vue
Raw Normal View History

2025-03-25 10:17:30 +08:00
<template>
<view class="content">
<view class="login">
<view class="editem">
<view class="item">
2025-12-22 09:34:09 +08:00
<view class="text">{{$t('titlePassword')}}</view>
2025-03-25 10:17:30 +08:00
<view class="input">
2025-12-22 09:34:09 +08:00
<input class="uni-input" v-model="password" :placeholder="$t('verifyPassword')" />
2025-03-25 10:17:30 +08:00
</view>
</view>
<view class="item">
2025-12-22 09:34:09 +08:00
<view class="text">{{$t('titleConfirmPassword')}}</view>
2025-03-25 10:17:30 +08:00
<view class="input">
2025-12-22 09:34:09 +08:00
<input class="uni-input" v-model="password2" :placeholder="$t('verifyPasswordTwo')" />
2025-03-25 10:17:30 +08:00
</view>
</view>
</view>
2025-12-22 09:34:09 +08:00
<view class="btnlogin" @click="handleTelLogin">{{$t('btnSubmit')}}</view>
2025-03-25 10:17:30 +08:00
</view>
</view>
</template>
<script>
export default {
data() {
return {
password: "",
password2: "",
}
},
2025-12-22 09:34:09 +08:00
onLoad() {
let that = this
uni.setNavigationBarTitle({
title: that.$t('titlePasswordEdit')
})
},
2025-03-25 10:17:30 +08:00
methods: {
// 登录、
handleTelLogin() {
let that = this
if (!that.password) {
2025-12-22 09:34:09 +08:00
that.$tools.msg(that.$t('verifyPassword'))
2025-03-25 10:17:30 +08:00
return
}
if (!that.password2) {
2025-12-22 09:34:09 +08:00
that.$tools.msg(that.$t('verifyPasswordTwo'))
2025-03-25 10:17:30 +08:00
return
}
if (that.password2 != that.password) {
2025-12-22 09:34:09 +08:00
that.$tools.msg(that.$t('verifyPasswordCorrect'))
2025-03-25 10:17:30 +08:00
return
}
that.$model.getAccountPassword({
password: that.password,
c_password: that.password2,
}).then(res => {
console.log("注册", res)
if (res.code != 0) {
that.$tools.msg(res.msg)
} else {
2025-12-22 09:34:09 +08:00
that.$tools.msg(that.$t('msgSetSuccess'))
2025-04-02 09:49:39 +08:00
setTimeout(function() {
uni.navigateBack()
}, 1000)
2025-03-25 10:17:30 +08:00
}
}).catch(err => {})
},
}
}
</script>
<style scoped lang="scss">
.content {
width: 100%;
height: 100vh;
background-color: #fff;
}
.login {
2025-11-25 14:21:22 +08:00
width: calc(100% - 60rpx);
2025-03-25 10:17:30 +08:00
height: auto;
background: #fff;
2025-11-25 14:21:22 +08:00
border-radius: 20rpx;
padding: 30rpx;
2025-03-25 10:17:30 +08:00
z-index: 99;
.editem {
position: relative;
display: flex;
align-items: center;
2025-04-02 09:49:39 +08:00
font-size: 28rpx;
2025-03-25 10:17:30 +08:00
justify-content: space-between;
flex-wrap: wrap;
.item {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
2025-11-25 14:21:22 +08:00
margin-bottom: 30rpx;
2025-03-25 10:17:30 +08:00
.text {
width: 80px;
2025-11-25 14:21:22 +08:00
height: 80rpx;
line-height: 80rpx;
2025-03-25 10:17:30 +08:00
font-size: 32rpx;
}
.input {
width: calc(100% - 100px);
height: 35px;
line-height: 35px;
display: flex;
position: relative;
border: #dfdfdf 1px solid;
border-radius: 5px;
2025-11-25 14:21:22 +08:00
padding: 0 20rpx;
2025-03-25 10:17:30 +08:00
background-color: #f7f7f7;
}
input {
2025-11-25 14:21:22 +08:00
height: 80rpx;
line-height: 80rpx;
2025-03-25 10:17:30 +08:00
position: absolute;
2025-11-25 14:21:22 +08:00
left: 20rpx;
2025-03-25 10:17:30 +08:00
right: 0px;
z-index: 88;
2025-04-02 09:49:39 +08:00
font-size: 28rpx;
2025-03-25 10:17:30 +08:00
}
}
}
.btnlogin {
width: 100%;
2025-11-25 14:21:22 +08:00
margin: 30rpx 0;
2025-03-25 10:17:30 +08:00
height: 42px;
line-height: 42px;
background: $btncolor;
font-weight: 700;
2025-11-25 14:21:22 +08:00
border-radius: 30rpx;
2025-03-25 10:17:30 +08:00
text-align: center;
color: #fff !important;
}
}
</style>