Commit 2eaa7d13 by 高淑倩

报错

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