Commit 2eaa7d13 by 高淑倩

报错

parent c82e10b7
......@@ -40,7 +40,7 @@ App({
onShow: function (options = {}) {
console.log('app-onshow', options)
const baseUserInfo = wx.getStorageSync('_baseUserInfo')
const { registerTime ='' } = baseUserInfo.member
const registerTime = baseUserInfo && baseUserInfo.member && baseUserInfo.member.registerTime || ''
// ios 兼容 是不是plus vip
let currentEndTime = (new Date(registerTime.replace(/-/g, '/'))).getTime(); // 过期时间
......
......@@ -5,7 +5,7 @@ const envInfo = require('../../config/index').envInfo
Component({
properties: {
currentHasUserInfo:{
currentHasUserInfo: {
type: Boolean,
type: false
},
......@@ -54,34 +54,31 @@ Component({
_token: '',
currentMobile: '',
baseImgUrl: '',
storgeUserInfo: wx.getStorageSync('_baseUserInfo'),
storgeUserInfo: wx.getStorageSync('_baseUserInfo'),
isPlusVip: false,
currentPlusStyle: null
},
observers: {
'**': function(e) {
'**': function (e) {
// 每次 setData 都触发
},
},
attached() {
const { isPlusVip, imageUrl } = app.globalData
const { personData } = this.data
this.setData({
personCenter: personData,
baseImgUrl: imageUrl,
isPlusVip,
currentPlusStyle: isPlusVip ? personData.plus.filter(item=> item.purchased == 1)[0] : personData.plus.filter(item=> item.purchased == 0)[1]
},()=> {
console.log('aaaaaaaaaa', this.data.currentPlusStyle)
currentPlusStyle: isPlusVip ? personData.plus.filter(item => item.purchased == 1)[0] : personData.plus.filter(item => item.purchased == 0)[0]
})
},
methods: {
_getUserInfo(res = {}) {
wxService.nextTick(() => {
this.triggerEvent('getAuth', res);
})
},
wxService.nextTick(() => {
this.triggerEvent('getAuth', res);
})
},
_userInfoChange(newVal, oldVal) {
if (newVal !== oldVal) {
this.setData({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment