Browse Source

设置页面添加注销账户按钮

gjy 2 years ago
parent
commit
f010222bdd
2 changed files with 21 additions and 1 deletions
  1. 0 1
      pages/public/login.vue
  2. 21 0
      pages/user/setUp.vue

+ 0 - 1
pages/public/login.vue

@@ -12,7 +12,6 @@
 			</view>
 			<button @click='gocode' :class='codestatus?"active":""' class='verificationCode'>获取验证码</button>
 			<view @click='gonumber' class="Regular use-password" style='text-align:center;color:#6A6A6A;'>使用账号密码登录</view>
-			
 			<button v-if='tabbar' @click='goregister' class='Regular register active'>手机号一键注册</button>
 		</view>
 		<view v-if="loginType === 'phone'" class="register-section">

+ 21 - 0
pages/user/setUp.vue

@@ -47,6 +47,12 @@
 				</view>
 				<image src="../../static/img/myimg/gengduo1@3x.png" class="arrow"></image>
 			</view>
+			<view class='cu-item' style='margin-bottom:10px;' @click='unsubscribe'>
+				<view>
+					<text>注销账户</text>
+				</view>
+				<image src="../../static/img/myimg/gengduo1@3x.png" class="arrow"></image>
+			</view>
 		</view>
 		<view class='exitloginwrap'>
 			<button @click='logout()' class='exitlogin'>退出登录</button>
@@ -281,6 +287,21 @@
 					url: `/pages/user/fankui`
 				})
 			},
+			unsubscribe(){
+				var that=this
+				uni.clearStorage({
+					success: function(res) {
+						console.log('success');
+						that.$store.commit('logout')
+						that.$api.logout()
+						// plus.nativeUI.toast(
+						// 	"注销成功");
+						uni.navigateTo({
+							url: `/pages/public/login`
+						})
+					}
+				})
+			},
 			logout() {
 				// const that = this
 				this.isShowAlert = true