|
@@ -129,6 +129,7 @@ export struct UserCenter {
|
|
|
@State hasActiveSubscription: boolean = false;
|
|
@State hasActiveSubscription: boolean = false;
|
|
|
@State subscriptionName: string = '';
|
|
@State subscriptionName: string = '';
|
|
|
@State subscriptionEndDate: string = '';
|
|
@State subscriptionEndDate: string = '';
|
|
|
|
|
+ @State isForever: boolean = false;
|
|
|
@StorageProp('currentBreakpoint') currentBreakpoint: string = BreakpointTypeEnum.MD;
|
|
@StorageProp('currentBreakpoint') currentBreakpoint: string = BreakpointTypeEnum.MD;
|
|
|
@State vipFeatures: VipFeature[] = [
|
|
@State vipFeatures: VipFeature[] = [
|
|
|
{
|
|
{
|
|
@@ -437,7 +438,7 @@ export struct UserCenter {
|
|
|
Scroll() {
|
|
Scroll() {
|
|
|
Column() {
|
|
Column() {
|
|
|
this.buildUserInfoCard()
|
|
this.buildUserInfoCard()
|
|
|
- if(!Utility.isForever()){
|
|
|
|
|
|
|
+ if(!this.isForever){
|
|
|
this.buildVipPlans()
|
|
this.buildVipPlans()
|
|
|
}
|
|
}
|
|
|
this.buildVipFeatures()
|
|
this.buildVipFeatures()
|
|
@@ -552,15 +553,8 @@ export struct UserCenter {
|
|
|
this.hasActiveSubscription = false;
|
|
this.hasActiveSubscription = false;
|
|
|
this.subscriptionName = '';
|
|
this.subscriptionName = '';
|
|
|
this.subscriptionEndDate = '';
|
|
this.subscriptionEndDate = '';
|
|
|
- PreferencesUtil.putSync('isLogin', false);
|
|
|
|
|
- PreferencesUtil.putSync('userId', 0);
|
|
|
|
|
- PreferencesUtil.putSync('userName', '未登录用户');
|
|
|
|
|
- PreferencesUtil.putSync('userAvatarUrl', '');
|
|
|
|
|
- PreferencesUtil.putSync('subscriptionName', '');
|
|
|
|
|
- PreferencesUtil.putSync('subscriptionEndDate', '');
|
|
|
|
|
- PreferencesUtil.putSync('hasActiveSubscription', false);
|
|
|
|
|
- PreferencesUtil.putSync('userToken', '');
|
|
|
|
|
- PreferencesUtil.putSync('isForever', false);
|
|
|
|
|
|
|
+ this.isForever=false;
|
|
|
|
|
+ UserUtil.logout();
|
|
|
emitter.emit({ eventId: 1001 }, {})
|
|
emitter.emit({ eventId: 1001 }, {})
|
|
|
ToastUtil.showToast('已退出登录')
|
|
ToastUtil.showToast('已退出登录')
|
|
|
})
|
|
})
|
|
@@ -1178,7 +1172,7 @@ export struct UserCenter {
|
|
|
this.subscriptionName = PreferencesUtil.getStringSync('subscriptionName', '');
|
|
this.subscriptionName = PreferencesUtil.getStringSync('subscriptionName', '');
|
|
|
this.subscriptionEndDate = PreferencesUtil.getStringSync('subscriptionEndDate', '');
|
|
this.subscriptionEndDate = PreferencesUtil.getStringSync('subscriptionEndDate', '');
|
|
|
this.hasActiveSubscription = PreferencesUtil.getBooleanSync('hasActiveSubscription', false);
|
|
this.hasActiveSubscription = PreferencesUtil.getBooleanSync('hasActiveSubscription', false);
|
|
|
- // console.log('Heanup hasActiveSubscription:' + this.hasActiveSubscription)
|
|
|
|
|
|
|
+ this.isForever= PreferencesUtil.getBooleanSync('isForever', false);
|
|
|
// 新增:同步线上会员状态到本地,便于 Utility.isNoble 全局判断
|
|
// 新增:同步线上会员状态到本地,便于 Utility.isNoble 全局判断
|
|
|
PreferencesUtil.putSync('hasActiveSubscription', this.hasActiveSubscription);
|
|
PreferencesUtil.putSync('hasActiveSubscription', this.hasActiveSubscription);
|
|
|
}
|
|
}
|