unsubscribeCode.vue
4.03 KB
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
<template>
<!-- 登录 -->
<view class="container flex-items-plus flex-column">
<global-loading />
<view class="login-logoBox">
<image class="login-logo" src="@/static/logo.png"></image>
</view>
<view class="iphoneNum-box flex-row-plus flex-items">
<view style="margin-right: 30rpx">
<image class="loginIcon" src="https://zhgw-uat.028wlkj.com/cdwlMall/zsfwzxt/file/static/images/phone.png"></image>
</view>
<view>
<input v-model="userInfo.phone" placeholder-class="iphoneNum-input" type="number" disabled
placeholder="请输入您的手机号" />
</view>
</view>
<view class="flex-row-plus mar-top-20">
<view class="code-box">
<view style="margin-right: 30rpx">
<image class="loginIcon" src="https://zhgw-uat.028wlkj.com/cdwlMall/zsfwzxt/file/static/images/code.png"></image>
</view>
<view>
<input v-model="code" placeholder-class="codeNum-input" placeholder="请输入验证码" />
</view>
</view>
<view :class="disabled === true ? 'on' : ''" :disabled="disabled" class="getcode" @click="codede">{{text}}
</view>
</view>
<view class="mar-top-60">
<view class="registerBut mar-top-100" @click="unsubscribe">立即注销</view>
</view>
</view>
</template>
<script>
import sendVerifyCode from "@/mixins/SendVerifyCode";
const NET = require('../../utils/request')
const API = require('../../config/api')
export default {
data() {
return {
code: '',
userInfo: {}
}
},
mixins: [sendVerifyCode],
onLoad() {
this.userInfo = uni.getStorageSync('storage_userInfo')
console.log(this.userInfo)
},
methods: {
// 获取验证码
codede() {
this.getVerify()
},
getVerify() {
NET.request(API.Verify, {
phone: this.userInfo.phone,
}, 'GET').then(res => {
this.sendCode()
}).catch(res => {
uni.showToast({
title: res.data.message,
duration: 1000,
icon: 'none'
});
})
},
// 账户注销
unsubscribe() {
NET.request(API.delUser + this.code, {}, "delete").then(res => {
console.log(res)
if (res.code == '200') {
// uni.showLoading({
// mask: true,
// title: '注销成功,正在退出...',
// duration: 2000,
// });
setTimeout(function() {
uni.removeStorageSync('storage_key');
uni.removeStorageSync('distributorId');
uni.reLaunch({
url: 'login',
success() {
// uni.hideLoading()
}
})
}, 1000)
} else {
uni.showToast({
title: res.data.message,
duration: 1000,
icon: 'none'
});
}
})
}
}
}
</script>
<style lang="scss">
.container {
background-color: #FFFFFF;
height: 100vh;
.login-logoBox {
margin-top: -300rpx;
.login-logo {
width: 234rpx;
height: 193rpx;
}
}
.iphoneNum-box {
margin-top: 100rpx;
border-bottom: 1rpx solid #DDDDDD;
height: 100rpx;
width: 600rpx;
.loginIcon {
width: 40rpx;
height: 53rpx;
}
.iphoneNum-input {
color: #999999;
font-size: 28rpx;
font-weight: 400;
}
}
.passwordNum-box {
border-bottom: 1rpx solid #DDDDDD;
height: 100rpx;
width: 600rpx;
.passwordNum-input {
color: #999999;
font-size: 28rpx;
font-weight: 400;
width: 346rpx;
}
}
.code-box {
border-bottom: 1rpx solid #DDDDDD;
height: 100rpx;
width: 360rpx;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
.loginIcon {
width: 44rpx;
height: 50rpx;
}
.code-lab {
width: 200rpx;
}
.codeNum-input {
color: #999999;
font-size: 28rpx;
font-weight: 400;
}
}
.getcode {
background-color: #39be7a;
height: 100rpx;
width: 230rpx;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
margin-left: 20rpx;
color: #FFFFFF;
}
.registerBut {
background: #333333;
color: #FFEBC4;
height: 100rpx;
width: 600rpx;
text-align: center;
line-height: 100rpx;
margin-top: 30rpx;
}
}
</style>