| | |
| | | url: info.url |
| | | }) |
| | | } else { |
| | | wx.navigateTo({ |
| | | url: info.url |
| | | }) |
| | | if (info.text == '数字阅读') { |
| | | if (wx.getStorageSync(app.config.tokenKey)) { |
| | | wx.navigateTo({ |
| | | url: info.url |
| | | }) |
| | | } else { |
| | | loginInfo(app, (data) => { |
| | | if (data) { |
| | | this.registe() |
| | | } |
| | | }) |
| | | } |
| | | } else { |
| | | wx.navigateTo({ |
| | | url: info.url |
| | | }) |
| | | } |
| | | |
| | | } |
| | | } else { |
| | | wx.showToast({ |
| | |
| | | import { |
| | | loginInfo |
| | | } from '../../../../assets/js/login'; |
| | | |
| | | const AuthStepType = { |
| | | ONE: 1, |
| | | TWO: 2, |
| | | THREE: 3, |
| | | }; |
| | | |
| | | const app = getApp() |
| | | |
| | | Component({ |
| | | options: { |
| | |
| | | }, |
| | | }, |
| | | 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() { |
| | |
| | | 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', |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | }); |
| | | }); |
| | |
| | | <block wx:if="{{currAuthStep === AuthStepType.TWO}}"> |
| | | <view class="user-center-card__header"> |
| | | <!-- <t-avatar image="{{userInfo.icon || defaultAvatarUrl}}" class="user-center-card__header__avatar" mode="aspectFill" t-class="avatar" /> --> |
| | | <view class="user-center-card__header__avatar"> |
| | | <view class="user-center-card__header__avatar" bindtap="cilckFive"> |
| | | <t-image src="{{userInfo.icon || defaultAvatarUrl}}" mode="aspectFill" class="img" /> |
| | | </view> |
| | | <view> |