|
|
@@ -345,7 +345,6 @@ export default function Page() {
|
|
|
}
|
|
|
|
|
|
const handleAppStateChange = (nextAppState) => {
|
|
|
- console.log(nextAppState)
|
|
|
if (nextAppState != 'active') {
|
|
|
return
|
|
|
}
|
|
|
@@ -353,6 +352,9 @@ export default function Page() {
|
|
|
checkTimeZone()
|
|
|
updateNotificationStatus()
|
|
|
mainTimer()
|
|
|
+ if (user.isLogin){
|
|
|
+ getUserAccess()
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
};
|
|
|
@@ -504,7 +506,7 @@ export default function Page() {
|
|
|
setTimeout(() => {
|
|
|
Taro.createSelectorQuery().select('#latest').boundingClientRect((rect) => {
|
|
|
Taro.pageScrollTo({
|
|
|
- scrollTop: (rect as any).top-40,
|
|
|
+ scrollTop: (rect as any).top - 40,
|
|
|
duration: 150
|
|
|
})
|
|
|
}).exec()
|
|
|
@@ -540,15 +542,7 @@ export default function Page() {
|
|
|
|
|
|
if (user.isLogin) {
|
|
|
getHistory()
|
|
|
- userAccess().then(res => {
|
|
|
- global.offsetTimestamp = 0;
|
|
|
- const {server_timestamp} = res as any
|
|
|
- if (server_timestamp){
|
|
|
- global.offsetTimestamp = new Date().getTime()-server_timestamp
|
|
|
- }
|
|
|
- dispatch(setAccessData(res))
|
|
|
- setAccess(res)
|
|
|
- })
|
|
|
+ getUserAccess()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -556,6 +550,18 @@ export default function Page() {
|
|
|
setAccess(res)
|
|
|
}
|
|
|
|
|
|
+ function getUserAccess() {
|
|
|
+ userAccess().then(res => {
|
|
|
+ global.offsetTimestamp = 0;
|
|
|
+ const { server_timestamp } = res as any
|
|
|
+ if (server_timestamp) {
|
|
|
+ global.offsetTimestamp = new Date().getTime() - server_timestamp
|
|
|
+ }
|
|
|
+ dispatch(setAccessData(res))
|
|
|
+ setAccess(res)
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
function setCheckData(list: any) {
|
|
|
setHomeData(list[0])
|
|
|
setSchedules(list[1].scenarios)
|
|
|
@@ -841,39 +847,39 @@ export default function Page() {
|
|
|
</View>
|
|
|
<WeekCalendar isFastSleep={false} />
|
|
|
<View className="vip_calendar" style={{ marginBottom: 40 }} onClick={() => setShowEatCalendar(false)}>
|
|
|
- <Text style={{ color: '#fff',fontWeight:'bold' }}>{t('feature.track_time_duration.weekly.back')}</Text>
|
|
|
+ <Text style={{ color: '#fff', fontWeight: 'bold' }}>{t('feature.track_time_duration.weekly.back')}</Text>
|
|
|
</View>
|
|
|
</View>
|
|
|
}
|
|
|
|
|
|
- function demo(){
|
|
|
+ function demo() {
|
|
|
Taro.addPhoneCalendar({
|
|
|
- title:'单次日历标题',
|
|
|
- startTime:(new Date().getTime()/1000+60),
|
|
|
- success:(res)=>{
|
|
|
+ title: '单次日历标题',
|
|
|
+ startTime: (new Date().getTime() / 1000 + 60),
|
|
|
+ success: (res) => {
|
|
|
console.log('success')
|
|
|
},
|
|
|
- fail:(e)=>{
|
|
|
- console.log('failed',e)
|
|
|
+ fail: (e) => {
|
|
|
+ console.log('failed', e)
|
|
|
},
|
|
|
- complete:(res)=>{
|
|
|
+ complete: (res) => {
|
|
|
console.log('complete')
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- function demo2(){
|
|
|
+ function demo2() {
|
|
|
Taro.addPhoneRepeatCalendar({
|
|
|
- title:'重复日历标题',
|
|
|
- repeatInterval:'day',
|
|
|
- startTime:(new Date().getTime()/1000+60),
|
|
|
- success:(res)=>{
|
|
|
+ title: '重复日历标题',
|
|
|
+ repeatInterval: 'day',
|
|
|
+ startTime: (new Date().getTime() / 1000 + 60),
|
|
|
+ success: (res) => {
|
|
|
console.log('success')
|
|
|
},
|
|
|
- fail:(e)=>{
|
|
|
- console.log('failed',e)
|
|
|
+ fail: (e) => {
|
|
|
+ console.log('failed', e)
|
|
|
},
|
|
|
- complete:(res)=>{
|
|
|
+ complete: (res) => {
|
|
|
console.log('complete')
|
|
|
}
|
|
|
})
|
|
|
@@ -964,7 +970,7 @@ export default function Page() {
|
|
|
<View className="vip_calendar" onClick={() => setShowEatCalendar(true)}>
|
|
|
{
|
|
|
process.env.TARO_ENV == 'weapp' ? <Text className="eat_calendar_text">{t('feature.track_time_duration.weekly.show_eating_window')}</Text> :
|
|
|
- <GradientText style={{ fontSize: rpxToPx(28), color: 'black',fontWeight:'bold' }} colors={[ColorType.food, ColorType.activity]}>{t('feature.track_time_duration.weekly.show_eating_window')}</GradientText>
|
|
|
+ <GradientText style={{ fontSize: rpxToPx(28), color: 'black', fontWeight: 'bold' }} colors={[ColorType.food, ColorType.activity]}>{t('feature.track_time_duration.weekly.show_eating_window')}</GradientText>
|
|
|
}
|
|
|
|
|
|
</View>
|
|
|
@@ -1029,11 +1035,11 @@ export default function Page() {
|
|
|
<Text style={{ color: '#fff', fontSize: 15 }}>member status:{access && access.member && access.member.status}</Text>
|
|
|
{
|
|
|
access && access.member && access.member.status == 'MEMBER' &&
|
|
|
- <Text style={{ color: '#fff', fontSize: 15 }}>会员过期时间:{access.member.type=='NON_CONSUMABLE'?'Lifelong':dayjs(access.member.expire).format('YYYY-MM-DD HH:mm:ss')}</Text>
|
|
|
+ <Text style={{ color: '#fff', fontSize: 15 }}>会员过期时间:{access.member.type == 'NON_CONSUMABLE' ? 'Lifelong' : dayjs(access.member.expire).format('YYYY-MM-DD HH:mm:ss')}</Text>
|
|
|
}
|
|
|
{
|
|
|
access && access.member && access.member.status == 'MEMBER' &&
|
|
|
- <Text style={{ color: '#fff', fontSize: 15 }}>会员过期倒计时:{access.member.type=='NON_CONSUMABLE'?'Lifelong':TimeFormatter.countdown(access.member.expire)}</Text>
|
|
|
+ <Text style={{ color: '#fff', fontSize: 15 }}>会员过期倒计时:{access.member.type == 'NON_CONSUMABLE' ? 'Lifelong' : TimeFormatter.countdown(access.member.expire)}</Text>
|
|
|
}
|
|
|
<Text style={{ color: '#fff', fontSize: 15 }}>current status:{access.fast_sleep.current.qualification.status}</Text>
|
|
|
<Text style={{ color: '#fff', fontSize: 15 }}>previous status:{access.fast_sleep.previous.qualification.status}</Text>
|