cshenfu
2024-06-27 58aa6e282bb343503be3cb198948328ea3ed7b79
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<template>
    <view class="flex-col page">
        <!-- #ifdef APP-PLUS -->
        <view class="status_bar">
            <view class="top_view"></view>
        </view>
        <!-- #endif -->
        <view class="top_nav">
            <image src="/static/local/3546451940011a031009b939a8b26314.png" class="image_1" @click="pageBack" />
            <view class="cate">设置</view>
        </view>
        <view class="flex-col group_1">
            <view class="justify-between group_2" @tap="navigateTo('/pages/mine/setting/change-password')">
                <text>修改登录密码</text>
                <image src="/static/remote/59d50f245e774077b29cc12824c65db5.png" class="image_2" />
            </view>
            <image src="/static/local/0cec384fa1c7befc3fb0a06c13233461.png" class="image_4" />
            <view class="group_3 justify-between" @tap="navigateTo('/pages/mine/setting/payment-password')">
                <text>修改支付密码</text>
                <image src="/static/remote/59d50f245e774077b29cc12824c65db5.png" class="image_2" />
            </view>
            <image src="/static/local/0cec384fa1c7befc3fb0a06c13233461.png" class="image_4" />
            <view class="group_3 justify-between view" @tap="navigateTo('/pages/mine/setting/change-phone-number')">
                <text>手机号</text>
                <image src="/static/remote/59d50f245e774077b29cc12824c65db5.png" class="image_2" />
            </view>
            <view class="flex-col group_4">
                <image src="/static/local/0cec384fa1c7befc3fb0a06c13233461.png" class="image_4" />
                <view class="group_3 justify-between" @tap="navigateTo('/pages/mine/setting/address')">
                    <text>地址管理</text>
                    <image src="/static/remote/59d50f245e774077b29cc12824c65db5.png" class="image_2" />
                </view>
                <view class="flex-col">
                    <image src="/static/local/0cec384fa1c7befc3fb0a06c13233461.png" class="image_4" />
                    <view class="group_3 justify-between" @tap="show = true">
                        <text>注销账号</text>
                        <image src="/static/remote/59d50f245e774077b29cc12824c65db5.png" class="image_2" />
                    </view>
                    <image src="/static/local/0cec384fa1c7befc3fb0a06c13233461.png" class="image_4" />
                </view>
            </view>
            <view class="flex-col items-center button" @tap="logOut">
                <text>退出登录</text>
            </view>
        </view>
        <u-modal v-model="show" content="此操作将注销账号,继续么?" :show-cancel-button="true" @confirm="delUser"></u-modal>
    </view>
</template>
 
<script>
    var that; // 当前页面对象
    var vk; // vk依赖
    export default {
        data() {
            // 页面数据变量
            return {
                show: false
            }
        },
        // 监听 - 页面每次【加载时】执行(如:前进)
        onLoad(options = {}) {
            that = this;
            vk = that.vk;
            that.init(options)
        },
        // 监听 - 页面【首次渲染完成时】执行。注意如果渲染速度快,会在页面进入动画完成前触发
        onReady() {},
        // 监听 - 页面每次【显示时】执行(如:前进和返回) (页面每次出现在屏幕上都触发,包括从下级页面点返回露出当前页面)
        onShow() {},
        // 监听 - 页面每次【隐藏时】执行(如:返回)
        onHide() {},
        // 函数
        methods: {
            // 页面数据初始化函数
            init(options) {},
            pageBack() {
                uni.navigateBack({ delta: 1 })
            },
            // 登出
            logOut() {
                this.vk.userCenter.updateUser({
                    data: { clientid: '' },
                    success: function(data) {
                        vk.userCenter.logout({
                            success: function(data) {
                                uni.$emit('courseReload')
                                uni.showToast({ title: "退出成功", icon: "none" })
                                setTimeout(() => { uni.navigateBack() }, 500)
                            }
                        });
                    }
                });
            },
            // 注销账户
            delUser() {
                vk.callFunction({
                    url: 'client/setting/kh/deleteUser',
                    title: '请求中...',
                    data: { need_user_info: true },
                    success: function(data) {
                        vk.toast('注销成功', 'none')
                        setTimeout(() => { uni.navigateBack() }, 500)
                    }
                });
            }
        }
    }
</script>
 
<style lang="scss" scoped>
    .page {
        background-color: #ffffff;
        width: 100%;
        height: 100%;
        overflow-y: auto;
 
        .status_bar,
        .top_view {
            background-color: #FFFFFF;
        }
 
        .top_nav {
            padding-bottom: 24rpx;
            color: rgb(51, 51, 51);
            font-size: 34rpx;
            line-height: 41rpx;
            white-space: nowrap;
            background-color: rgb(255, 255, 255);
            box-shadow: 0px 6rpx 12rpx 0px rgba(0, 0, 0, 0.1);
            border-radius: 0px 0px 30rpx 30rpx;
            height: 90rpx;
            position: relative;
 
            .image_1 {
                left: 21rpx;
                top: 27rpx;
                width: 19rpx;
                height: 35rpx;
                position: absolute;
            }
 
            .cate {
                width: 100%;
                padding: 20rpx 0;
                color: rgb(51, 51, 51);
                font-size: 34rpx;
                font-weight: 500;
                line-height: 41rpx;
                white-space: nowrap;
                text-align: center;
            }
        }
 
        .group_1 {
            flex: 1 1 auto;
            overflow-y: auto;
 
            .group_2 {
                padding: 40rpx 20rpx 37rpx;
                color: rgb(51, 51, 51);
                font-size: 28rpx;
                line-height: 34rpx;
                white-space: nowrap;
            }
 
            .view {
                color: rgb(51, 51, 51);
                font-size: 28rpx;
                line-height: 34rpx;
                white-space: nowrap;
            }
 
            .group_4 {
                color: rgb(51, 51, 51);
                font-size: 28rpx;
                line-height: 34rpx;
                white-space: nowrap;
            }
 
            .button {
                margin: 492rpx 30rpx 0;
                padding: 26rpx 0 24rpx;
                color: rgb(255, 255, 255);
                font-size: 32rpx;
                line-height: 38rpx;
                white-space: nowrap;
                background-color: rgb(51, 51, 51);
                border-radius: 44rpx;
            }
 
            .group_3 {
                padding: 38rpx 20rpx 37rpx;
            }
 
            .image_4 {
                width: 100vw;
                height: 0.5vw;
            }
 
            .image_2 {
                margin-bottom: 4rpx;
                width: 16rpx;
                height: 28rpx;
            }
        }
    }
</style>