| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- <template>
- <v-page>
- <!-- 头部 -->
- <v-header :title="$t('accountSettings.a0')"></v-header>
- <!-- 中间 -->
- <view class=" m-y-sm rounded-md m-x-lg overflow-hidden box-shadow">
- <view
- class="p-y-xs per-bot p-x-md h-36 border-b border-gray-7 d-flex align-center justify-between bg-panel-3 ">
- <span class="color-light">{{$t('accountSettings.a1')}}</span>
- <view class="d-flex align-center">
- <van-icon name="user-circle-o" class="color-theme-1 fn-30" />
- </view>
- </view>
- <view class="per-bot p-x-md p-y-md border-b border-gray-7 d-flex align-center justify-between bg-panel-3">
- <span class="color-light">{{$t('accountSettings.a2')}}</span>
- <view class="d-flex align-center">
- <span>{{user.username}}</span>
- </view>
- </view>
- <view class="per-bot p-x-md p-y-md d-flex align-center justify-between bg-panel-3">
- <span class="color-light">{{$t('accountSettings.a3')}}</span>
- <view class="d-flex align-center">
- <span>{{user.account}}</span>
- </view>
- </view>
- </view>
- <view class="m-x-lg rounded-md overflow-hidden box-shadow">
- <v-link to="/pages/safe/phone" tag="div"
- class="per-bot p-x-md border-b border-gray-7 p-y-md d-flex align-center justify-between bg-panel-3 ">
- <span class="color-light">{{$t('accountSettings.a4')}}</span>
- <view class="d-flex align-center">
- <span class="color-right">{{user.phone}}</span>
- <span class="color-theme-1 m-l-xs" v-if="user.phone">{{$t('accountSettings.a5')}}</span>
- <span class="color-theme-1 m-l-xs" v-else>{{$t('accountSettings.a6')}}</span>
- <van-icon class="p-l-xs" name="arrow" size="16" color="#646566" @click.stop />
- </view>
- </v-link>
- <v-link tag="div" to="/pages/safe/email"
- class="per-bot p-x-md p-y-md d-flex align-center justify-between bg-panel-3">
- <span class="color-light">{{$t('accountSettings.a7')}}</span>
- <view class="d-flex align-center">
- <span>{{user.email}}</span>
- <span class="color-theme-1 m-l-xs" v-if="user.email">{{$t('accountSettings.a5')}}</span>
- <span class="color-theme-1 m-l-xs" v-else>{{$t('accountSettings.a6')}}</span>
- <van-icon class="p-l-xs" name="arrow" size="16" color="#646566" @click.stop />
- </view>
- </v-link>
- </view>
- <view class="m-y-sm m-x-lg overflow-hidden rounded-md box-shadow">
- <view class="per-bot p-x-md p-y-md d-flex align-center justify-between bg-panel-3">
- <view class="color-light">{{$t('accountSettings.b2')}}</view>
- <view class="d-flex align-center">
- <v-lang />
- <van-icon class="p-l-xs" name="arrow" size="16" color="#646566" @click.stop />
- </view>
- </view>
- </view>
- <view class="m-x-lg rounded-md overflow-hidden box-shadow">
- <view @click="outLogin"
- class="per-bot p-x-md border-b border-gray-7 p-y-md d-flex align-center justify-between bg-panel-3 ">
- <span class="color-light">{{$t('accountSettings.a8')}}</span>
- <view class="d-flex align-center">
- <van-icon class="p-l-xs" name="arrow" size="16" color="#646566" @click.stop />
- </view>
- </view>
- <view @click="loginOut" class="per-bot p-x-md p-y-md d-flex align-center justify-between bg-panel-3">
- <span class="color-light">{{$t('accountSettings.a9')}}</span>
- <view class="d-flex align-center">
- <van-icon class="p-l-xs" name="arrow" size="16" color="#646566" @click.stop />
- </view>
- </view>
- </view>
- <!-- <view class="m-t-lg p-x-md fn-center">
- <van-button
- icon="exchange"
- class="w-max fn-lg m-b-md"
- color="#f05319"
- type="info"
- block
- @click="outLogin"
- >{{$t('accountSettings.a8')}}</van-button>
- <view class="m-t-md">
- <v-button block class="w-max color-light" plain @click="loginOut">{{$t('accountSettings.a9')}}</v-button>
- </view>
- </view> -->
- </v-page>
- </template>
- <script>
- import {
- mapState,
- mapGetters
- } from "vuex";
- import Member from "@/api/member";
- export default {
- data() {
- return {
- agreement: {},
- };
- },
- computed: {
- ...mapState({
- user: "user",
- }),
- ...mapGetters(['themeStyle'])
- },
- created() {
- this.clause()
- let isLogin = uni.getStorageSync("token");
- if(!isLogin){
- uni.redirectTo({
- url:'/pages/login/index'
- })
- }
- },
- methods: {
- // 获取协议
- clause() {
- Member.clause().then((res) => {
- this.agreement = res.data;
- });
- },
- changeNickname() {
- // this.$router.push({
- // path: "/changeNickname"
- // });
- uni.navigateTo({
- url:"/changeNickname"
- })
- },
- // 切换用户
- outLogin() {
- uni.removeStorageSync("token");
- uni.reLaunch({
- url:"/pages/login/index"
- })
- },
- // 退出登录
- loginOut() {
- Member.logout({}, {
- toast: true
- })
- .then(() => {
- this.outLogin();
- })
- .catch(() => {});
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .head-account {
- font-size: 20px;
- }
- </style>
|