Explorar el Código

点击退出登录到登录页

宋飞扬 hace 1 año
padre
commit
4083c8aa1f
Se han modificado 2 ficheros con 27 adiciones y 3 borrados
  1. 7 1
      src/pages/client/clientUser/mine/setting.vue
  2. 20 2
      src/pages/login/index.vue

+ 7 - 1
src/pages/client/clientUser/mine/setting.vue

@@ -74,7 +74,13 @@
 
     <view class="exit">
       <u-button type="info" shape="circle" text="注销账号" class="button" />
-      <u-button type="primary" shape="circle" text="退出登录" class="button" />
+      <u-button
+        type="primary"
+        shape="circle"
+        text="退出登录"
+        @tap="$Router.push('/pages/login/index')"
+        class="button"
+      />
     </view>
   </view>
 </template>

+ 20 - 2
src/pages/login/index.vue

@@ -47,6 +47,13 @@
 
     <!-- 用户协议 -->
     <userAgreement v-if="show" :title="title" :show="show" @handleConfirm="handleConfirm" />
+
+    <u-modal
+      @confirm="confirmTips"
+      :show="showTips"
+      title="确认提示"
+      content="我已阅读并同意《用户协议》和 《隐私政策》"
+    ></u-modal>
   </view>
 </template>
 
@@ -59,6 +66,7 @@ export default {
   },
   data() {
     return {
+      showTips: false,
       isUserAgreement: false,
       loading: false,
       headline: '欢迎登录车旅程!',
@@ -120,16 +128,26 @@ export default {
       this.show = false; //关闭弹框
     },
 
+    confirmTips() {
+      this.showTips = false;
+      this.checked = ['1'];
+      this.login();
+    },
+
     //点击微信用户一键登录
     async login() {
+      console.log('this.checked', this.checked);
       if (this.checked && this.checked.length == 0) {
-        uni.$u.toast('请阅读并同意《用户协议》和 《隐私政策》');
+        // uni.$u.toast('请阅读并同意《用户协议》和 《隐私政策》');
+        this.showTips = true;
         return;
       }
       if (this.checked.length !== 0) {
         this.loading = true;
         this.form.token = await getWxLoginCode();
-        this.$store.dispatch('LoginByWxCode', this.form).then(() => {
+        this.$store
+          .dispatch('LoginByWxCode', this.form)
+          .then(() => {
             uni.setStorageSync('tabbar_type', true);
             this.$Router.pushTab('/pages/client/tabBar/home/index');
             this.loading = false;