From d7c95a7d713d8895aa2e22ebb5175d761a07ec31 Mon Sep 17 00:00:00 2001 From: Lufaneng Date: Sun, 28 Sep 2025 21:16:58 +0800 Subject: [PATCH] 1 --- package.json | 4 +- pages.json | 3 +- pages/consumption/consumption.vue | 669 +++++---- pages/login/login.vue | 24 +- pages/mine/mine.vue | 124 +- pages/order/order.vue | 210 +-- pagesA/generate-record/generate-record.vue | 9 +- pagesA/generate-record/new_file.js | 40 + pagesA/recharge/recharge.vue | 1431 ++++++++++---------- 9 files changed, 1316 insertions(+), 1198 deletions(-) create mode 100644 pagesA/generate-record/new_file.js diff --git a/package.json b/package.json index a991c4f..53f2a2d 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "lift-wechat", + "name": "lift-drawing-wechat", "version": "1.0.0", "description": "电梯图纸生成", "main": "main.js", @@ -10,7 +10,7 @@ "commit": "git-cz" }, "keywords": [ - "卡叔电梯" + "智能电梯图纸生成" ], "author": "Lufaneng", "license": "MIT", diff --git a/pages.json b/pages.json index 12f408c..6bb8f4b 100644 --- a/pages.json +++ b/pages.json @@ -49,7 +49,8 @@ "needLogin": true, "style" : { - "navigationBarTitleText" : "我的" + "navigationBarTitleText" : "我的", + "enablePullDownRefresh":true } }, { diff --git a/pages/consumption/consumption.vue b/pages/consumption/consumption.vue index 3ea124d..0aa75fe 100644 --- a/pages/consumption/consumption.vue +++ b/pages/consumption/consumption.vue @@ -1,379 +1,316 @@ \ No newline at end of file diff --git a/pages/login/login.vue b/pages/login/login.vue index 3d9f53a..69762f5 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -604,19 +604,19 @@ onMounted(() => { checkEnvironment(); - // #ifdef MP-WEIXIN - // 检查是否是微信授权回调 - const urlParams = new URLSearchParams(window.location.search); - const code = urlParams.get("code"); - const from = urlParams.get("from"); - console.log('from',from) - if (from && from === 'h5') { - handleWechatH5Callback(code); - } + // // #ifdef MP-WEIXIN + // // 检查是否是微信授权回调 + // const urlParams = new URLSearchParams(window.location.search); + // const code = urlParams.get("code"); + // const from = urlParams.get("from"); + // console.log('from',from) + // if (from && from === 'h5') { + // handleWechatH5Callback(code); + // } - // 可选:初始化微信JS-SDK - // initWechatJSSDK(); - // #endif + // // 可选:初始化微信JS-SDK + // // initWechatJSSDK(); + // // #endif }); diff --git a/pages/mine/mine.vue b/pages/mine/mine.vue index e85ea44..48ffb2b 100644 --- a/pages/mine/mine.vue +++ b/pages/mine/mine.vue @@ -16,7 +16,9 @@ 用户ID: {{userStore.userInfo.id}} - 会员等级: 年会员 (有效期至: 2026-05-15) + 会员等级: {{memberInfo.plan?.name}} (有效期至: + {{memberInfo.end_at ? dayjs(memberInfo.end_at * 1000).format('YYYY-MM-DD') : ''}}) @@ -31,7 +33,7 @@ 账户余额 - ¥50.00 + ¥{{memberInfo.wallet_balance || 0}} 充值 @@ -45,7 +47,7 @@ :key="item.id" @click="selectPlan(item)"> {{item.tags}} {{item.name}} - ¥{{item.price_cents}} + ¥{{item.price}} - + - 订单编号: {{ order.orderNumber }} - 复制 + 订单编号: {{ order.order_no }} + 复制 - - {{ order.statusText }} + + 待付款 + 待支付 + 已支付 + 支付失败 + 已取消 + 已退款 @@ -25,50 +31,58 @@ 用户名称: - {{ order.userName }} + {{ order.user_name }} 用户ID: - {{ order.userId }} + {{ order.user_id }} 订单类型: - {{ order.orderType }} + {{ order.order_type }} 订单金额: ¥{{ order.amount }} + + + 支付渠道: + + + + + - + + - {{ order.status === 'pending' ? '创建时间:' : '支付时间:' }} - {{ order.payTime }} + 创建时间 + {{ order.created_at ? dayjs(order.created_at * 1000).format('YYYY-MM-DD HH:mm:ss') :'' }} - +
-
支付剩余时间: {{ order.countdown }} -
+
- @@ -128,7 +128,7 @@ const downloadRecord = (record) => { // #ifdef MP-WEIXIN // 小程序和App端使用uni.downloadFile uni.downloadFile({ - url: 'https://ksdt-1255846884.cos.ap-shanghai.myqcloud.com/lift-result/2025/09/24/d6180add4cd94875a1854a4febce8966.pdf', + url: record.result_url, success: (res) => { console.log(res); if (res.statusCode === 200) { @@ -200,6 +200,7 @@ const deleteRecord = (record) => { // 加载生成记录 const loadRecords = async () => { + uni.showLoading(); loadingStatus.value = "loading"; RPC.post("/planned_list", { page: page.value, page_size: 20 }) .then((res) => { @@ -213,7 +214,9 @@ const loadRecords = async () => { }) .catch(() => { loadingStatus.value = "loadmore"; - }); + }).finally(() => { + uni.hideLoading(); + }); }; // 刷新数据 diff --git a/pagesA/generate-record/new_file.js b/pagesA/generate-record/new_file.js new file mode 100644 index 0000000..2c0e9be --- /dev/null +++ b/pagesA/generate-record/new_file.js @@ -0,0 +1,40 @@ +订单列表的 + +"id": it.ID, // 订单ID + "order_no": it.OrderNo, // 订单号(M=会员订单,R=充值订单) + "user_id": it.UserID, // 用户ID + "user_name": userNameMap[it.UserID], // 用户名 + "plan_id": it.PlanID, // 套餐ID(充值订单为0) + "plan_name": planName, // 套餐名称(充值订单固定为“钱包充值”) + "order_type": it.OrderType, // 订单类型:会员购买/钱包充值(中文) + "amount_cents": it.AmountCents.ToInt64(), // 订单金额(分) + "amount": it.AmountCents.String(), // 订单金额(元,字符串,保留两位小数) + "pay_channel": it.PayChannel, // 支付渠道:wallet|wxpay|alipay|other + "status": it.Status, // 订单状态:created|paid|canceled|refunded + "pay_time": it.PayTime, // 支付时间(Unix 时间戳,秒) + "transaction_id": it.TransactionID, // 第三方交易号/平台流水号 + "remark": it.Remark, // 备注 + "created_at": it.CreatedAt, // 创建时间(Unix 时间戳,秒) + "updated_at": it.UpdatedAt, // 更新时间(Unix 时间戳,秒) + + +消费列表 + +"id": it.ID, // 流水ID + "user_id": it.UserID, // 用户ID + "user_name": userName, // 用户名 + "type": it.Type, // 交易类型:recharge(充值)|purchase(消费) + "amount_cents": it.AmountCents.ToInt64(), // 金额(分) + "amount": it.AmountCents.String(), // 金额(元,字符串,保留两位小数) + "related_order_id": it.RelatedOrderID, // 关联的订单ID(可为空) + "order_no": it.OrderNo, // 关联订单号(M* 会员订单 / R* 充值订单) + "pay_channel": it.PayChannel, // 支付渠道:wallet|wxpay|alipay|other + "status": it.Status, // 交易状态:success|failed|pending + "remark": it.Remark, // 备注 + "balance_before_cents": it.BalanceBeforeCents.ToInt64(), // 变动前余额(分) + "balance_after_cents": it.BalanceAfterCents.ToInt64(), // 变动后余额(分) + "finished_at": it.FinishedAt, // 完成时间(Unix 时间戳,秒) + "external_txn_id": it.ExternalTxnID, // 外部交易号(第三方平台返回) + "currency": it.Currency, // 币种(默认 CNY) + "created_at": it.CreatedAt, // 创建时间(Unix 时间戳,秒) + }) \ No newline at end of file diff --git a/pagesA/recharge/recharge.vue b/pagesA/recharge/recharge.vue index b46f07c..a2cebdc 100644 --- a/pagesA/recharge/recharge.vue +++ b/pagesA/recharge/recharge.vue @@ -1,699 +1,734 @@ - - - - - \ No newline at end of file