新增「我的订单」页面(订单中心)

- 微信审核要求交易类小程序提交订单中心 path,之前小程序没有订单页
- 新页面 pages/orders/orders:列表展示商品名 / 状态 / 订单号 / 金额 / 下单时间,接 GET /v1/orders
- 我的页新增「我的订单」入口,文案走后台配置 profile.menu.orders
- utils/api.js 补 getOrders(),utils/format.js 补 toDateTimeString()
This commit is contained in:
Yeomai committed 2026-10-01 12:22:11 +08:00
1 parent 014fa90dcd
commit 7d5db6a867
9 files changed
+172 -1

No files matched your search

+2
View File
@@ -218,6 +218,8 @@ const api = {
getEntitlements: () => request({ url: '/v1/me/entitlements' }),
// ── 订单与支付 ──────────────────────────────────────────────────────
/** 我的订单列表(订单中心用)。 */
getOrders: () => request({ url: '/v1/orders' }),
createOrder: (courseCode) =>
request({
url: '/v1/orders',
+9 -1
View File
@@ -12,6 +12,14 @@ function toDateString(value) {
return d.getFullYear() + '-' + pad(d.getMonth() + 1) + '-' + pad(d.getDate());
}
/** ISO 字符串 → YYYY-MM-DD HH:mm */
function toDateTimeString(value) {
if (!value) return '';
const d = new Date(value);
if (isNaN(d.getTime())) return '';
return toDateString(value) + ' ' + pad(d.getHours()) + ':' + pad(d.getMinutes());
}
/** 分 → 元(保留两位,去掉多余的 .00) */
function fenToYuan(fen) {
const n = Number(fen);
@@ -20,5 +28,5 @@ function fenToYuan(fen) {
return yuan % 1 === 0 ? String(yuan) : yuan.toFixed(2);
}
module.exports = { toDateString, fenToYuan };
module.exports = { toDateString, toDateTimeString, fenToYuan };