用户封禁、后台筛选排序

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() {
+9 -2
View File
@@ -1,5 +1,12 @@
<scroll-view class="container" scroll-y enable-flex type="custom">
<block wx:if="{{!hasCourse}}">
<block wx:if="{{blocked}}">
<view class="blocked-tip">
<text wx:if="{{blockedTitle}}" class="blocked-title">{{blockedTitle}}</text>
<text wx:if="{{blockedDesc}}" class="blocked-desc">{{blockedDesc}}</text>
</view>
</block>
<block wx:elif="{{!hasCourse}}">
<view style="width: 100%;height: 400rpx;">
<image style="margin-top: 30rpx; margin-left: 20rpx; height: 350rpx; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5); width: 710rpx; border-radius: 20rpx; background-color: rgb(0, 255, 255);"
src="{{staticBase}}/Images/Banner/BGbanner.png" mode="aspectFill" />
@@ -7,7 +14,7 @@
<Parser html="{{tipsHtml}}" />
</block>
<block wx:if="{{hasCourse}}">
<block wx:elif="{{hasCourse}}">
<view wx:for="{{ownedCourses}}" wx:for-item="item" wx:for-index="index" wx:key="courseId"
class="kecheng" bind:tap="toMyCourse" data-code="{{item.code}}">
<view class="kecheng_video_up">
+26 -1
View File
@@ -46,4 +46,29 @@
font-size: 25rpx;
margin-top: 15rpx;
margin-left: 15rpx;
}
}
/* 账号异常提示的容器:整页替换成这一块,文字由后台配置下发 */
.blocked-tip {
box-sizing: border-box;
width: 710rpx;
margin-top: 120rpx;
padding: 60rpx 40rpx;
border: 1rpx solid #ffd9d9;
border-radius: 20rpx;
background-color: #fff7f7;
}
.blocked-title {
display: block;
font-size: 36rpx;
font-weight: bold;
text-align: center;
color: #e60012;
}
.blocked-desc {
display: block;
margin-top: 20rpx;
font-size: 26rpx;
text-align: center;
color: #888;
}