文案配置化 + 支付开关
小程序 - 页面固定文案全部改读后台配置(购买、登录、资料、首页、分享、介绍页),代码里不再硬编码 - 已拥有课程时在当前页提示,不再跳购买页再提示 - 介绍页正文由代码常量改为读 settings.page.formula.content 服务端 - 课程相关报错文案(不存在 / 已下架 / 课时不存在 / 未购买 / 已过期 / 重复购买 / 未配置支付商品)改读配置,代码保留默认值兜底 - 新增支付总开关 pay.blocked:打开即拦截下单并下发配置里的提示;开关存在数据库里,开发库与生产库各一份(开发库已开,生产库未设) 后台 - 系统配置页按页面分组折叠,默认收起;认不出来的配置归入「其他」 配套数据(不在代码里):对应的 settings 行已写入生产库与开发库
This commit is contained in:
1 parent
c45025fc86
commit
879e74ebda
21 files changed
+325
-103
No files matched your search
@@ -16,6 +16,8 @@ Page({
|
||||
VideoDetails: '',
|
||||
coverUrl: '',
|
||||
playdata: [],
|
||||
/** 列表上方的更新期数文案,整句来自后台配置 */
|
||||
updatedText: '',
|
||||
VideoPlayerSrc: '',
|
||||
HiddenVideoControl: true,
|
||||
top: 0,
|
||||
@@ -59,7 +61,7 @@ Page({
|
||||
})
|
||||
.catch((err) => {
|
||||
this.setData({ loading: false });
|
||||
wx.showToast({ title: err.message || '课程加载失败', icon: 'none' });
|
||||
wx.showToast({ title: err.message || store.cfg('course.tip.loadFailed'), icon: 'none' });
|
||||
setTimeout(() => wx.switchTab({ url: '/pages/kecheng/kecheng' }), 1500);
|
||||
});
|
||||
},
|
||||
@@ -77,7 +79,11 @@ Page({
|
||||
publishedAt: format.toDateString(item.publishedAt),
|
||||
coverUrl: item.coverUrl,
|
||||
}));
|
||||
this.setData({ playdata: rows });
|
||||
// 期数文案整句来自后台配置,{n} 在这里替换成实际条数
|
||||
this.setData({
|
||||
playdata: rows,
|
||||
updatedText: store.cfg('course.lesson.updated').replace('{n}', rows.length),
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
this.setData({ playdata: [] });
|
||||
@@ -99,18 +105,23 @@ Page({
|
||||
})
|
||||
.catch((err) => {
|
||||
wx.hideLoading();
|
||||
wx.showToast({ title: err.message || '无法播放', icon: 'none' });
|
||||
wx.showToast({ title: err.message || store.cfg('course.tip.playFailed'), icon: 'none' });
|
||||
});
|
||||
},
|
||||
|
||||
/** 购买入口:详情页不做交易,统一跳商业化页面。 */
|
||||
goBuy() {
|
||||
if (!this.data.code) return;
|
||||
// 已经拥有就不必再进购买页:原地提示一句
|
||||
if (this.data.owned) {
|
||||
wx.showToast({ title: store.cfg('course.tip.owned'), icon: 'none' });
|
||||
return;
|
||||
}
|
||||
wx.navigateTo({ url: '/pages/buy/buy?code=' + this.data.code });
|
||||
},
|
||||
|
||||
onShareAppMessage() {
|
||||
return { title: '叶雷讲数学', path: '/pages/index/index' };
|
||||
return { title: store.cfg('share.title'), path: '/pages/index/index' };
|
||||
},
|
||||
});
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<view class="jieshao">
|
||||
<text decode class="video_biaoti"> {{VideoTitle}}</text>
|
||||
<text decode class="video_miaoshu"> {{VideoDetails}}</text>
|
||||
<text decode class="video_info"> 已更新{{playdata.length}}期</text>
|
||||
<text decode class="video_info"> {{updatedText}}</text>
|
||||
</view>
|
||||
|
||||
<view class="videolistcontainer" bind:tap="onTapLesson"
|
||||
|
||||
Reference in new issue
Block a user