用户封禁、后台筛选排序

This commit is contained in:
Yeomai committed 2026-10-01 09:12:39 +08:00
1 parent 6b263af74f
commit c45025fc86
14 files changed
+293 -30

No files matched your search

+20 -2
View File
@@ -11,6 +11,10 @@ Page({
hasCourse: false,
ownedCourses: [],
tipsHtml: '',
/** 账号被封禁:不显示已购权益,改为显示提示。文字全部来自后台配置 */
blocked: false,
blockedTitle: '',
blockedDesc: '',
},
onLoad() {
@@ -31,9 +35,23 @@ Page({
.getEntitlements()
.then((list) => {
store.setEntitlements(list);
this.setData({ ownedCourses: list || [], hasCourse: (list || []).length > 0 });
this.setData({ ownedCourses: list || [], hasCourse: (list || []).length > 0, blocked: false });
})
.catch((err) => console.warn('[kecheng] 已购课程加载失败', err));
.catch((err) => {
if (err && err.code === api.ACCOUNT_DISABLED) {
// 服务端不返回权益了,本地缓存也一并清掉,免得露出上一次的课程
store.setEntitlements([]);
this.setData({
ownedCourses: [],
hasCourse: false,
blocked: true,
blockedTitle: store.cfg('account.blocked_title'),
blockedDesc: store.cfg('account.blocked_desc'),
});
return;
}
console.warn('[kecheng] 已购课程加载失败', err);
});
},
loadTips() {