QYF-GitLab1
14 小时以前 332aab16348cccb280a1d78452b13338c8cfae27
pages/personalCenter/components/user-center-card/index.js
@@ -1,8 +1,14 @@
import {
  loginInfo
} from '../../../../assets/js/login';
const AuthStepType = {
  ONE: 1,
  TWO: 2,
  THREE: 3,
};
const app = getApp()
Component({
  options: {
@@ -23,9 +29,9 @@
    },
  },
  data: {
    defaultAvatarUrl:
      'https://cdn-we-retail.ym.tencent.com/miniapp/usercenter/icon-user-center-avatar@2x.png',
    defaultAvatarUrl: 'https://cdn-we-retail.ym.tencent.com/miniapp/usercenter/icon-user-center-avatar@2x.png',
    AuthStepType,
    count: 0, //模拟退出,
  },
  methods: {
    gotoUserEditPage() {
@@ -34,5 +40,31 @@
    editUserType() {
      this.triggerEvent('editUserType');
    },
    cilckFive() {
      this.data.count += 1
      if (this.data.count >= 5) {
        wx.clearStorageSync()
        wx.showModal({
          title: '已清空,请点击登录',
          content: '',
          complete: (res) => {
            if (res.confirm) {
              loginInfo(app, (data) => {
                if (data) {
                  this.setData({
                    count: 0
                  })
                  return false
                }
              })
            } else {
              wx.switchTab({
                url: '/pages/home/home',
              })
            }
          }
        })
      }
    }
  },
});
});