logout.vue
2.2 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
<template>
<view style="padding-left: 4%; padding-right: 4%; padding-top: 4%;">
<view style="display: flex; ">
<text space="emsp" style="font-size: 35rpx;">手机号</text>
<text style="margin-left: 25rpx; font-size: 35rpx;">{{phoneNume}}</text>
</view>
<view style="height: 2rpx; background-color: #eeeeee; margin-top: 5rpx; margin-bottom: 20rpx;"></view>
<view style="display: flex; align-items: center;">
<text space="emsp" style="font-size: 35rpx;">密 码</text>
<input style="font-size: 35rpx; margin-left: 25rpx;" password type="text" v-model="pwd"
placeholder="请输入密码" />
</view>
<view style="height: 2rpx; background-color: #eeeeee; margin-top: 5rpx; margin-bottom: 20rpx;"></view>
<view style="align-content: center; width: 100%;">
<text style="color: #D4383D; font-size: 22rpx;">账号注销后该账户下所有信息将被清除</text>
</view>
<button style="margin-top: 8%; background-color: #2a0d5c; border-radius: 13rpx; color: white;"
@click="bindLogout()">确实注销</button>
</view>
</template>
<script>
import http from "@/utils/http";
import loginHelper from '../../utils/loginHelper.js'
export default {
data() {
return {
pwd: "",
phoneNume: ""
}
},
onLoad: function(){
console.info("onLoad")
this.phoneNume = "******" + loginHelper.getUserInfo().Mobile.substring(7);
},
methods: {
bindLogout() {
{
this.logoutLogin();
}
},
async logoutLogin() {
if (this.pwd.length <= 0) {
uni.showToast({
icon: "none",
title: "请输入密码",
});
return;
}
let query_data = `mutation{
info_update_user(user:{ user_status:"-1"})
{
error
success
error_type
}
}`;
console.info(query_data);
let result = await http.gql({
query: query_data
})
this.loginBtnLoading = false;
console.info(result);
//处理返回请求
if (result && result.data && result.data.info_update_user &&
!result.data.info_update_user.error) {
loginHelper.logout();
uni.navigateBack();
} else {
uni.showToast({
icon: "none",
title: "注销异常",
});
return;
}
}
}
}
</script>
<style>
</style>