zhaojs
2023-06-25 e5f21e8972f2870d5fa5dbf9e947b285fc4660fb
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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
<template>
    <view class="cancellation-wrapper wrapperLayer">
        <titleBar :titleText='"注销帐号"' :pageForm='"accointSecurity"'></titleBar>
        <view class="pageContent-container colCen borderBox">
            <view class="phoneInfo">
                请注意,将{{userinfo.mobile}}帐号注销后
            </view>
            <view class="tips">
                以下信息将被清空且无法找回
            </view>
            <view class="info-container colCen borderBox">
                <view class="info-items rowCen">
                    <view class="circle"></view>
                    <view class="info-text">
                        帐号、身份信息
                    </view>
                </view>
                <view class="info-items rowCen">
                    <view class="circle"></view>
                    <view class="info-text">
                        收藏、浏览记录
                    </view>
                </view>
                <view class="info-items rowCen">
                    <view class="circle"></view>
                    <view class="info-text">
                        个人隐私信息
                    </view>
                </view>
                <view class="info-items rowCen">
                    <view class="circle"></view>
                    <view class="info-text">
                        帐号内预估可获得和已获得的收益
                    </view>
                </view>
            </view>
 
            <view class="tips">
                请确保所有交易已完结且无纠纷,帐号注销后无法再登陆
            </view>
            <view class="tips" style="color: #d21136; margin-top: 10rpx;">
                帐号注销后,历史交易产生的收益等权益视为自动放弃
            </view>
 
            <view class="btn-container rowCenBet">
                <view class="cancellationBtn rowCenCen" @click="openModel()">
                    <view>
                        注销帐号
                    </view>
                </view>
                <view class="uncancelBtn rowCenCen" @click="goback()">
                    <view>
                        暂不注销
                    </view>
                </view>
            </view>
        </view>
 
 
        <!-- 模态窗 -->
        <u-popup v-model="showModel" mode="center" closeable border-radius="10" width="auto" height="auto">
            <view class="model-wrapper colCen borderBox">
                <view class="titlebar rowCenCen">
                    <view class="modelTitle">
                        注销验证
                    </view>
                </view>
                <view class="subform colCen">
                    <view class="acount-Bar rowCen">
                        <view class="user defIcon">
                            <image src="../../../static/images/mine/userName.png"></image>
                        </view>
                        <view class="tishitext">{{userinfo.mobile}}</view>
                    </view>
 
                    <view class="code-Bar rowCenBet">
                        <view class="leftinput rowCen">
                            <view class="code defIcon">
                                <image src="../../../static/images/mine/pass.png"></image>
                            </view>
                            <view class="codebox"><input type="text" placeholder="验证码" v-model="codeNum" placeholder-class='inputpla'></view>
                        </view>
                        <view class="rightsendbtn" @click="getCode()">
                            {{canGetCode?'获取验证码':second+'s后重新获取'}}
                        </view>
                    </view>
                </view>
                
                <view class="confirmBtn rowCenCen" @tap="delact()">
                    <view>确认注销</view>
                </view>
            </view>
        </u-popup>
    </view>
</template>
 
<script>
    import MD5 from '../../../utils/md5.js'
    import config from '../../../utils/config.js'
    import titleBar from '@/components/backTitlebar.vue'
    export default {
        components: {
            titleBar
        },
        data() {
            return {
                showModel: false,
                account: '',
                btnstates:'获取验证码',
                userinfo:'',
                
                second:60,
                canGetCode:true,
                prevent:true,
                codeNum:''
            }
        },
        onLoad() {
            this.userinfo = uni.getStorageSync('userInfo')
            console.log(this.userinfo);
        },
        methods: {
            getCode() {
                var that = this;
                if (this.prevent && this.canGetCode) {
                    this.prevent = false
                    var timerChuo = new Date().getTime()
                    console.log(this.userinfo.mobile);
                    console.log(this.userinfo);
                    this.$u.api.sendSms({
                        mobile: this.userinfo.mobile,
                        event: 'cancel'
                    }).then(e => {
                        console.log(e);
                        if(e.code != 0) return that.$alert(e.msg)
                        that.canGetCode = false
                        that.prevent = true
                        var timer = setInterval(() => {
                            that.second--
                            if (that.second < 1) {
                                that.second = 60
                                that.canGetCode = true
                                clearInterval(timer)
                            }
                        }, 1000)
                        
                    }).catch(function (err) {
                        that.canGetCode = true
                        that.prevent = true
                    })
                } else {
                    uni.showToast({
                        title: '您点的太快了~',
                        icon: 'none',
                        position: 'bottom',
                        duration: 3000
                    });
                }
            },
            
            goback() {
                uni.navigateBack({
                    delta: 1
                })
            },
            openModel(type) {
                this.showModel = true;
            },
            
            delact(){
                var that = this;
                this.$u.api.userCancel({
                    validateCode: this.codeNum
                }).then(e => {
                    if(e.code != 0) return that.$alert(e.msg)
                    uni.removeStorageSync('userInfo');
                    that.$alert('注销成功');
                    setTimeout(function(){
                        uni.reLaunch({
                            url:'../../login/login'
                        })
                    },1000)
                    
                }).catch(function (err) {
                })
            }
        }
    }
</script>
 
<style lang="scss">
    .cancellation-wrapper {
        width: 100%;
 
        .pageContent-container {
            width: 100%;
            padding: 0 32rpx;
 
            .phoneInfo {
                width: 100%;
                margin-top: 40rpx;
                font-size: 28rpx;
                font-weight: 500;
                color: #333333;
            }
 
            .tips {
                width: 100%;
                margin-top: 25rpx;
                font-size: 22rpx;
                font-weight: 500;
                color: #999999;
            }
 
            .info-container {
                width: 100%;
                background-color: #FFFFFF;
                border-radius: 20rpx;
                margin-top: 20rpx;
                padding: 20rpx 40rpx;
 
                .info-items {
                    width: 100%;
                    height: 60rpx;
 
                    .circle {
                        width: 8rpx;
                        height: 8rpx;
                        border-radius: 50%;
                        background-color: #DCDCDC;
                    }
 
                    .info-text {
                        font-size: 28rpx;
                        font-weight: 500;
                        color: #333333;
                        margin-left: 15rpx;
                    }
                }
            }
 
            .btn-container {
                width: 100%;
                margin-top: 40rpx;
 
                .cancellationBtn {
                    width: 320rpx;
                    height: 80rpx;
                    background: #CCCCCC;
                    border-radius: 40rpx;
                    font-size: 28rpx;
                    font-weight: 500;
                    color: #FFFFFF;
                }
 
                .uncancelBtn {
                    width: 320rpx;
                    height: 80rpx;
                    background: linear-gradient(-81deg, #AD62FD, #563CF7);
                    border-radius: 40rpx;
                    font-size: 28rpx;
                    font-weight: 500;
                    color: #FFFFFF;
                }
            }
        }
 
        .model-wrapper {
            width: 500rpx;
            background-color: #FFFFFF;
            border-radius: 10rpx;
            padding: 0 52rpx;
 
            .modelTitle {
                margin-top: 60rpx;
                font-size: 28rpx;
                font-weight: 500;
                color: #333333;
            }
 
            .subform {
                width: 100%;
                margin-top: 50rpx;
 
                .acount-Bar {
                    width: 100%;
 
                    .user {
                        width: 24rpx;
                        height: 26rpx;
                        margin-right: 30rpx;
                    }
                }
 
                .code-Bar {
                    width: 100%;
                    margin-top: 50rpx;
 
                    .leftinput {
                        .code {
                            width: 24rpx !important;
                            height: 28rpx;
                            margin-right: 30rpx;
                        }
 
                        .codebox {
                            input{
                                width: 200rpx;
                                font-size: 28rpx;
                            }
                        }
                        .inputpla{
                            font-size: 24rpx;
                            font-weight: 400;
                            color: #999999;
                        }
                    }
                    
                    .rightsendbtn{
                        white-space: nowrap;
                        font-size: 24rpx;
                        font-weight: 500;
                        color: #5E46DC;
                    }
                }
            }
            
            .confirmBtn{
                width: 240rpx;
                height: 56rpx;
                background: linear-gradient(-77deg, #9D46F5, #6741F9);
                border-radius: 28rpx;
                font-size: 24rpx;
                font-weight: 500;
                color: #FFFFFF;
                margin-top: 60rpx;
                margin-bottom: 30rpx;
            }
        }
    }
</style>