You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
shop-app/pages/account/setting/index.vue

104 lines
2.3 KiB

<!--
* @Author: ch
* @Date: 2022-03-22 15:09:06
* @LastEditors: ch
3 years ago
* @LastEditTime: 2022-05-16 20:21:20
* @Description: file content
-->
<template>
<view>
<UiCell class="userInfo cell" :title="userInfo.nickname" @click="$Router.push('/setUserInfo')">
<image slot="icon" class="userInfo--head" :src="userInfo.avatar || require('@/static/account/tx.png')" ></image>
</UiCell>
3 years ago
<UiCell class="cell" title="我的收货地址" @click="$Router.push('/addressList')"></UiCell>
<UiCell class="cell" title="关于我们" ></UiCell>
<UiCell class="cell cell--last" title="版本号" value="1.0.0" valueClass="cell--value" :rightIcon="false"></UiCell>
<view class="logout" @click="logout">退</view>
</view>
</template>
<script>
import UiButton from '@/components/UiButton.vue'
3 years ago
import UiCell from '@/components/UiCell.vue';
import {MsbWebSkt} from '@/common/utils';
import {ApiGetLogout} from '@/common/api/index';
export default {
components: { UiCell, UiButton },
computed:{
userInfo (){
return this.$store.state.userInfo
}
},
methods:{
logout(){
3 years ago
uni.showModal({
content : '是否退出登录?',
cancelText : '再看看',
3 years ago
cancelColor : '#999',
confirmColor : '#3A83FB',
3 years ago
success:async ({confirm})=>{
3 years ago
if(confirm){
3 years ago
await ApiGetLogout();
3 years ago
this.$store.commit('SET_SESSION_DATA',[])
this.$store.commit('SET_SESSION_MSG_COUNT',0)
this.$store.commit('SET_SESSION_MSG_ID','')
3 years ago
this.$store.commit('SET_TOKEN');
3 years ago
MsbWebSkt.close();
3 years ago
this.$Router.replace('/login');
}
}
})
3 years ago
// this.$msb.confirm({
// content : '是否退出登录?',
// cancelText : '再看看',
// confirm : ()=>{
// this.$store.commit('SET_TOKEN');
// this.$Router.replace('/login');
// }
// })
}
}
}
</script>
3 years ago
<style lang="scss">
page {
background: $color-grey1;
}
3 years ago
</style>
<style lang="scss" scoped>
.userInfo{
margin: 20rpx 0;
border: 0;
height: 200rpx;
&--head{
width: 120rpx;
height: 120rpx;
border-radius: 50%;
margin-right: 40rpx;
}
}
.cell{
padding: 0 40rpx;
&--last{
border: 0;
}
}
.logout{
height: 100rpx;
line-height: 100rpx;
text-align: center;
color: $color-grey4;
background: $color-grey0;
margin: 20rpx 0;
font-size: $font-size-lg;
}
/deep/{
.userInfo .uiCell--title{
font-size: $font-size-lg;
}
.uiCell--value{
color: $color-grey4;
}
}
</style>