移动系统liao
2025-02-17 557c2711a3e103ebc3d0492344eca9730d5e92b2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<template>
    <view>
        <u-toast ref="uToast" /><u-no-network></u-no-network>
        <u-navbar title="设置" safeAreaInsetTop fixed placeholder>
            <view class="coreshop-navbar-left-slot" slot="left">
                <u-icon name="arrow-left" size="19" @click="goNavigateBack"></u-icon>
                <u-line direction="column" :hairline="false" length="16" margin="0 8px"></u-line>
                <u-icon name="home" size="22" @click="goHome"></u-icon>
            </view>
            <view slot="right">
            </view>
        </u-navbar>
        <u-list>
            <u-list-item>
                <u-cell :title="`个人资料`" @click="navigateToHandle('/pages/member/setting/userInfo/index')">
                    <u-icon slot="icon" shape="square" size="18" randomBgColor name="setting"></u-icon>
                    <u-icon slot="right-icon" shape="square" size="18" randomBgColor name="arrow-right"></u-icon>
                </u-cell>
            </u-list-item>
            <!-- #ifdef APP-PLUS || APP-PLUS-NVUE -->
            <u-list-item>
                <u-cell title="修改密码" @click="navigateToHandle('/pages/member/setting/userInfo/password')">
                    <u-icon slot="icon" shape="square" size="18" randomBgColor name="warning"></u-icon>
                    <u-icon slot="right-icon" shape="square" size="18" randomBgColor name="arrow-right"></u-icon>
                </u-cell>
            </u-list-item>
            <!-- #endif -->
            <u-list-item>
                <u-cell title="关于我们" @click="goAboutUs()">
                    <u-icon slot="icon" shape="square" size="18" randomBgColor name="tags"></u-icon>
                    <u-icon slot="right-icon" shape="square" size="18" randomBgColor name="arrow-right"></u-icon>
                </u-cell>
            </u-list-item>
            <u-list-item>
                <u-cell title="用户协议" @click="goUserAgreementPage()">
                    <u-icon slot="icon" shape="square" size="18" randomBgColor name="order"></u-icon>
                    <u-icon slot="right-icon" shape="square" size="18" randomBgColor name="arrow-right"></u-icon>
                </u-cell>
            </u-list-item>
            <u-list-item>
                <u-cell title="隐私政策" @click="goUserPrivacyPolicy()">
                    <u-icon slot="icon" shape="square" size="18" randomBgColor name="eye-off"></u-icon>
                    <u-icon slot="right-icon" shape="square" size="18" randomBgColor name="arrow-right"></u-icon>
                </u-cell>
            </u-list-item>
            <!--<u-list-item>
                <u-cell title="清除缓存" @click="clearCache">
                    <u-icon slot="icon" shape="square" size="18" randomBgColor name="trash"></u-icon>
                    <u-icon slot="right-icon" shape="square" size="18" randomBgColor name="arrow-right"></u-icon>
                </u-cell>
            </u-list-item>-->
            <!-- #ifdef APP-PLUS || APP-PLUS-NVUE -->
            <u-list-item>
                <u-cell title="切换账号" @click="changeAccount">
                    <u-icon slot="icon" shape="square" size="18" randomBgColor name="account"></u-icon>
                    <u-icon slot="right-icon" shape="square" size="18" randomBgColor name="arrow-right"></u-icon>
                </u-cell>
            </u-list-item>
            <!-- #endif -->
        </u-list>
        <!-- #ifdef APP-PLUS || APP-PLUS-NVUE -->
        <view class="coreshop-bg-white coreshop-footer-fixed coreshop-foot-padding-bottom">
            <u-button class="coreshop-percent-100" type="error" size="normal" @click="logOff">退出登录</u-button>
        </view>
        <!-- #endif -->
    </view>
</template>
 
<script>
 
    export default {
 
        methods: {
            navigateToHandle(pageUrl) {
                this.$u.route(pageUrl)
            },
            //// 清除缓存
            //clearCache() {
            //    // 重新获取统一配置信息
            //    this.$u.api.shopConfigV2().then(res => {
            //        this.$store.commit('config', res.data)
            //    })
            //    //获取地区信息
            //    this.$u.api.getAreaList().then(res => {
            //        if (res.status) {
            //            // 删除地区缓存信息
            //            this.$db.del('areaList');
            //            this.$db.set('areaList', res.data)
            //        }
            //    });
            //    setTimeout(() => {
            //        this.$refs.uToast.show({ message: '清除成功', type: 'success' })
            //    }, 500)
            //},
 
            // 退出登录
            logOff() {
                var that = this;
                this.$common.modelShow('退出', '确认退出登录吗?', () => {
                    that.$store.commit('hasLogin', false);
                    that.$store.commit('userInfo', "");
                    that.$db.del('userToken')
                    uni.reLaunch({
                        url: '/pages/index/default/default'
                    })
                })
            },
            // 切换账号
            changeAccount() {
                var that = this;
                this.$common.modelShow('切换', '确认切换登录账号吗?', () => {
                    that.$db.del('userToken')
                    that.$u.route({ url: '/pages/login/loginBySMS/loginBySMS', });
                })
            }
        }
    }
</script>
 
<style lang="scss">
    page { background: #fff; }
</style>