Files
YelayMaths/yelaymaths/pages/buy/buy.wxml
T
Yeomai 879e74ebda 文案配置化 + 支付开关
小程序
- 页面固定文案全部改读后台配置(购买、登录、资料、首页、分享、介绍页),代码里不再硬编码
- 已拥有课程时在当前页提示,不再跳购买页再提示
- 介绍页正文由代码常量改为读 settings.page.formula.content

服务端
- 课程相关报错文案(不存在 / 已下架 / 课时不存在 / 未购买 / 已过期 / 重复购买 / 未配置支付商品)改读配置,代码保留默认值兜底
- 新增支付总开关 pay.blocked:打开即拦截下单并下发配置里的提示;开关存在数据库里,开发库与生产库各一份(开发库已开,生产库未设)

后台
- 系统配置页按页面分组折叠,默认收起;认不出来的配置归入「其他」

配套数据(不在代码里):对应的 settings 行已写入生产库与开发库
2026-10-01 11:28:29 +08:00

35 lines
1.1 KiB
Plaintext

<!--pages/buy/buy.wxml-->
<view class="buy-page">
<!-- 带 ?code= 进来就只买这一门,否则列出全部课程、一门一个购买按钮。
注意别在 wx:if 和 wx:else 之间插注释。 -->
<view class="buy-single" wx:if="{{code}}">
<text class="buy-title">{{title}}</text>
<text class="buy-price">¥{{priceYuan}}</text>
<button
class="buy-btn"
disabled="{{buying || owned}}"
bindtap="buyNow"
>{{owned ? textOwned : (buying ? textPaying : textBuy)}}</button>
</view>
<view class="buy-list" wx:else>
<view class="buy-item" wx:for="{{list}}" wx:key="code">
<view class="buy-item-main">
<text class="buy-item-title">{{item.title}}</text>
<text class="buy-item-price">¥{{item.priceYuan}}</text>
</view>
<button
class="buy-btn buy-btn-mini"
size="mini"
disabled="{{buying || item.owned}}"
data-code="{{item.code}}"
bindtap="buyNow"
>{{item.owned ? textOwned : textBuyList}}</button>
</view>
<view class="buy-empty" wx:if="{{!loading && list.length === 0}}">
<text>{{textEmpty}}</text>
</view>
</view>
</view>