|
|
@@ -32,10 +32,7 @@ function loadBindingState() {
|
|
32
|
32
|
}
|
|
33
|
33
|
console.log("===getBindingState",res);
|
|
34
|
34
|
}).catch(error => {
|
|
35
|
|
- // uni.showToast({
|
|
36
|
|
- // title: error,
|
|
37
|
|
- // icon: 'none'
|
|
38
|
|
- // })
|
|
|
35
|
+
|
|
39
|
36
|
})
|
|
40
|
37
|
}
|
|
41
|
38
|
|
|
|
@@ -48,10 +45,7 @@ function getBindState(type:any) {
|
|
48
|
45
|
}
|
|
49
|
46
|
|
|
50
|
47
|
function updateAccount(type, info: {unionId: string, nickName: string, avatarUrl: string}) {
|
|
51
|
|
- uni.showLoading({
|
|
52
|
|
- title: '授权中',
|
|
53
|
|
- icon: 'none'
|
|
54
|
|
- })
|
|
|
48
|
+
|
|
55
|
49
|
|
|
56
|
50
|
getUpdateAccount({
|
|
57
|
51
|
type,
|
|
|
@@ -84,6 +78,8 @@ function unbindAccount(){
|
|
84
|
78
|
title:'解绑成功',
|
|
85
|
79
|
icon:'none'
|
|
86
|
80
|
})
|
|
|
81
|
+ userNick.value ='点击获取微信昵称'
|
|
|
82
|
+ userHead.value =''
|
|
87
|
83
|
loadBindingState()
|
|
88
|
84
|
}).catch(res=>{
|
|
89
|
85
|
uni.showToast({
|
|
|
@@ -160,8 +156,6 @@ function getUserProfile({detail}){
|
|
160
|
156
|
},
|
|
161
|
157
|
filePath: detail.avatarUrl ,
|
|
162
|
158
|
success: res => {
|
|
163
|
|
-
|
|
164
|
|
- console.log("===res");
|
|
165
|
159
|
uni.hideLoading()
|
|
166
|
160
|
const { data } = res
|
|
167
|
161
|
const assetData = JSON.parse(data)
|
|
|
@@ -178,7 +172,15 @@ function getUserProfile({detail}){
|
|
178
|
172
|
function onBindClick(){
|
|
179
|
173
|
|
|
180
|
174
|
if(getBindState('1')){
|
|
181
|
|
- unbindAccount()
|
|
|
175
|
+ uni.showModal({
|
|
|
176
|
+ title:'温馨提示',
|
|
|
177
|
+ content:'确定解除当前用户绑定?',
|
|
|
178
|
+ complete: (res) => {
|
|
|
179
|
+ if(res.confirm){
|
|
|
180
|
+ unbindAccount()
|
|
|
181
|
+ }
|
|
|
182
|
+ }
|
|
|
183
|
+ })
|
|
182
|
184
|
return
|
|
183
|
185
|
}
|
|
184
|
186
|
if(!userHead.value){
|
|
|
@@ -189,14 +191,17 @@ function onBindClick(){
|
|
189
|
191
|
return
|
|
190
|
192
|
}
|
|
191
|
193
|
|
|
192
|
|
- if(!userNick.value){
|
|
|
194
|
+ if(!userNick.value ||userNick.value =='点击获取微信昵称' ){
|
|
193
|
195
|
uni.showToast({
|
|
194
|
196
|
title:'请点击获取微信昵称',
|
|
195
|
197
|
icon:'none'
|
|
196
|
198
|
})
|
|
197
|
199
|
return
|
|
198
|
200
|
}
|
|
199
|
|
-
|
|
|
201
|
+ uni.showLoading({
|
|
|
202
|
+ title: '授权中',
|
|
|
203
|
+ mask:true,
|
|
|
204
|
+ })
|
|
200
|
205
|
uni.login({
|
|
201
|
206
|
provider: 'weixin',
|
|
202
|
207
|
univerifyStyle: {
|
|
|
@@ -216,6 +221,7 @@ function onBindClick(){
|
|
216
|
221
|
},
|
|
217
|
222
|
fail: (error) => {
|
|
218
|
223
|
console.log(error)
|
|
|
224
|
+ uni.hideLoading()
|
|
219
|
225
|
}
|
|
220
|
226
|
});
|
|
221
|
227
|
}
|
|
|
@@ -232,11 +238,11 @@ function onBindClick(){
|
|
232
|
238
|
微信授权
|
|
233
|
239
|
</div>
|
|
234
|
240
|
</div>
|
|
235
|
|
- <button class="border border-solid rounded-full text-xs px-2 h-6"
|
|
|
241
|
+ <view class="border border-solid rounded-full text-xs px-2 h-4"
|
|
236
|
242
|
:class="getBindState('1') ? 'text-red' : 'text-gray border-gray'"
|
|
237
|
243
|
>
|
|
238
|
244
|
{{ getBindState('1') ? '已授权' : '未授权' }}
|
|
239
|
|
- </button>
|
|
|
245
|
+ </view>
|
|
240
|
246
|
|
|
241
|
247
|
</div>
|
|
242
|
248
|
<view class="item-line"></view>
|