kitchendDevice/pageTwo/setting/setting.vue

155 lines
3.2 KiB
Vue
Raw Normal View History

2025-03-25 10:17:30 +08:00
<template>
<view class="content">
<view class="caritem" @click="navTo('/pageTwo/setting/phone')">
2025-12-22 09:34:09 +08:00
<view class="text">{{$t('infoMobile')}}</view>
2025-03-25 10:17:30 +08:00
<view class="text_r">
2025-11-08 16:50:26 +08:00
<text>{{userinfo.tel?userinfo.tel:''}}</text>
<uni-icons type="forward" size="20" color="#666"></uni-icons>
2025-03-25 10:17:30 +08:00
</view>
</view>
<view class="caritem" @click="navTo('/pageTwo/setting/email')">
2025-12-22 09:34:09 +08:00
<view class="text">{{$t('infoEmail')}}</view>
2025-03-25 10:17:30 +08:00
<view class="text_r">
2025-11-08 16:50:26 +08:00
<text>{{userinfo.email}}</text>
<uni-icons type="forward" size="20" color="#666"></uni-icons>
2025-03-25 10:17:30 +08:00
</view>
</view>
<view class="caritem" @click="navTo('/pageTwo/setting/password')">
2025-12-22 09:34:09 +08:00
<view class="text">{{$t('titleSetPassword')}}</view>
2025-11-08 16:50:26 +08:00
<uni-icons type="forward" size="20" color="#666"></uni-icons>
2025-03-25 10:17:30 +08:00
</view>
<!-- <view class="btn mb-15" @click="handleOutLogin">删除账号</view> -->
</view>
</template>
<script>
import {
mapState
} from "vuex";
export default {
data() {
return {
isEdit: false,
headimg: null,
nickname: ""
};
},
computed: {
2025-11-08 16:50:26 +08:00
...mapState(["user"]),
userinfo() {
return this.user
2025-03-25 10:17:30 +08:00
}
},
2025-12-22 09:34:09 +08:00
onLoad() {
let that = this
uni.setNavigationBarTitle({
title: that.$t('titleSet')
})
},
2025-03-25 10:17:30 +08:00
methods: {
handleOutLogin() {
let that = this
uni.showModal({
2025-12-22 09:34:09 +08:00
title: that.$t('msgTitle'),
confirmText: that.$t('btnDelete'),
content: that.$t('verifyDeleteAccount'),
2025-03-25 10:17:30 +08:00
success: function(res) {
if (res.confirm) {
that.$model.getdeleteAccount({}).then((res) => {
if (res.code != 0) return
2025-12-22 09:34:09 +08:00
that.$tools.msg(that.$t('msgDelete'));
2025-03-25 10:17:30 +08:00
uni.setStorageSync('token', null)
uni.setStorageSync('aan_id', null)
uni.clearStorageSync()
setTimeout(() => {
uni.reLaunch({
url: "/pageTwo/login/login"
})
}, 3000);
})
} else if (res.cancel) {
2025-12-22 09:34:09 +08:00
that.$tools.msg(that.$t('msgCancel'));
2025-03-25 10:17:30 +08:00
}
},
})
},
// 修改昵称
handleBlur() {
let that = this
return that.$model.getAccountNickname({
nickname: that.nickname,
}).then(res => {
if (res.code != 0) return
that.user.nickname = that.nickname
that.$store.commit('changeAccountNumber', {
nickname: that.nickname
})
that.isEdit = false
})
},
navTo(url) {
uni.navigateTo({
url
})
},
}
}
</script>
<style lang="scss" scoped>
.content {
background-color: #F3F4F6;
2025-11-25 14:21:22 +08:00
padding: 30rpx;
2025-03-25 10:17:30 +08:00
min-height: 100vh;
font-size: 14px;
}
.image {
2025-11-25 14:21:22 +08:00
width: 80rpx;
height: 80rpx;
2025-03-25 10:17:30 +08:00
border-radius: 50%;
}
.text_r {
width: 70%;
display: flex;
align-items: center;
justify-content: flex-end;
text {
2025-11-08 16:50:26 +08:00
text-align: right;
2025-11-25 14:21:22 +08:00
width: calc(100% - 60rpx);
2025-03-25 10:17:30 +08:00
display: inline-block;
}
input {
width: 80%;
border-bottom: 1px solid #dfdfdf;
}
}
.btn {
width: auto;
background: #999;
2025-11-25 14:21:22 +08:00
margin: 100rpx 30rpx 0 30rpx;
2025-03-25 10:17:30 +08:00
}
.caritem {
2025-11-25 14:21:22 +08:00
height: 100rpx;
line-height: 100rpx;
2025-03-25 10:17:30 +08:00
background-color: #fff;
2025-11-25 14:21:22 +08:00
border-radius: 20rpx;
padding: 0 20rpx;
margin-bottom: 30rpx;
2025-03-25 10:17:30 +08:00
display: flex;
align-items: center;
justify-content: space-between;
2025-11-25 14:21:22 +08:00
width: calc(100% - 40rpx);
2025-11-08 16:50:26 +08:00
2025-03-25 10:17:30 +08:00
.uni-icons {
2025-11-25 14:21:22 +08:00
width: 60rpx;
2025-03-25 10:17:30 +08:00
text-align: right;
}
2025-11-08 16:50:26 +08:00
2025-03-25 10:17:30 +08:00
}
</style>