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 @@
-
-
-
-
- 全部
-
-
- 生成
-
-
- 会员
-
-
- 其他
-
-
-
-
-
-
-
-
+
+
+
+
+
+ 消费编号:
+ {{ item.order_no }}
+
+
+ 消费时间:
+ {{ item.finished_at ? dayjs(item.finished_at * 1000).format('YYYY-MM-DD HH:mm:ss') :'' }}
+
+
+
+ 账前金额:
+
+ ¥{{ item.balance_before_cents / 100 }}
+
+
+
+ 账后金额:
+
+ ¥{{ item.balance_after_cents / 100 }}
+
+
+
+
+
+
+
+
+
+
+ 暂无消费记录
+
+
+
+
\ 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}}
-
+
@@ -120,7 +112,8 @@
ref
} from "vue";
import {
- onShow
+ onShow,
+ onReachBottom
} from "@dcloudio/uni-app";
import {
useAuthStore,
@@ -128,14 +121,26 @@
} from "@/store";
import HeaderCustom from '/components/HeaderCustom/HeaderCustom.vue'
import RPC from "@/utils/request";
+ import dayjs from "dayjs";
+
const active = ref('全部')
const authStore = useAuthStore()
- const userStore = useUserStore()
+ const userStore = useUserStore()
+
+ const copyOrderNo = (orderNo) => {
+ uni.setClipboardData({
+ data: orderNo,
+ success: () => {
+ uni.showToast({
+ title: '订单号已复制',
+ icon: 'success'
+ })
+ }
+ })
+ }
- // 响应式数据
- const activeTab = ref('all')
- const orders = ref([{
+ const list = ref([{
id: 1,
orderNumber: 'ORD20230515001',
typeLabel: '续费',
@@ -183,17 +188,17 @@
}
])
- // 计算过滤后的订单
- const filteredOrders = computed(() => {
- if (activeTab.value === 'all') {
- return orders.value
- }
- return orders.value.filter(order => order.type === activeTab.value)
- })
-
// 切换标签
const switchTab = (tab) => {
- activeTab.value = tab
+ list.value = []
+ active.value = tab
+ page.value = 1
+ if(tab === '全部') {
+ typeParams.value = ''
+ } else {
+ typeParams.value = tab
+ }
+ getList()
}
// 查看订单详情
@@ -212,13 +217,12 @@
if (res.confirm) {
try {
// 调用取消订单API
- // await RPC.post('/api/order/cancel', { orderId: order.id })
+ await RPC.post('/membership/order/cancel', { order_no: order.order_no })
// 更新订单状态
- const index = orders.value.findIndex(item => item.id === order.id)
+ const index = list.value.findIndex(item => item.id === order.id)
if (index !== -1) {
- orders.value[index].status = 'cancelled'
- orders.value[index].statusText = '已取消'
+ list.value[index].status = 'canceled'
}
uni.showToast({
@@ -272,33 +276,63 @@
// 支付订单
const payOrder = (order) => {
- uni.navigateTo({
- url: `/pages/payment/payment?orderId=${order.id}`
+ uni.showModal({
+ title: '确认支付',
+ content: '确定继续支付这个订单吗?',
+ success: async (res) => {
+ if (res.confirm) {
+
+ }
+ }
})
}
-
- // 加载订单数据
- const loadOrders = async () => {
- try {
- // 调用获取订单列表API
- // const result = await RPC.get('/api/orders')
- // orders.value = result.data
- } catch (error) {
- console.error('加载订单失败:', error)
- uni.showToast({
- title: '加载失败,请重试',
- icon: 'none'
- })
- }
+
+ const page = ref(1)
+ const typeParams = ref('')
+ const loadingStatus = ref('loadmore')
+ const count = ref(0);
+ const getList = () => {
+ uni.showLoading();
+ RPC.post('/membership/order/list', {
+ user_id: userStore.userInfo.id,
+ page:page.value,
+ order_type:typeParams.value,
+ size:20
+ }).then(res => {
+ list.value = [...list.value, ...res.list];
+ count.value = res.total;
+ if (list.value.length >= count.value) {
+ loadingStatus.value = "nomore";
+ } else {
+ loadingStatus.value = "loadmore";
+ }
+ }).catch(() => {
+ loadingStatus.value = "loadmore";
+ }).finally(() => {
+ uni.hideLoading();
+ })
}
onMounted(() => {
- loadOrders()
- })
+
+ })
+
+ onReachBottom(() => {
+ if (list.value.length >= count.value || loadingStatus.value === "loading")
+ return;
+ console.log("上拉加载:");
+ loadingStatus.value = "loading";
+ page.value = ++page.value;
+ getList();
+ });
onShow(() => {
- // 页面显示时刷新订单列表
- loadOrders()
+ // 页面显示时刷新订单列表
+ list.value = []
+ page.value = 1
+ active.value = '全部'
+ typeParams.value = ''
+ getList()
})
diff --git a/pagesA/generate-record/generate-record.vue b/pagesA/generate-record/generate-record.vue
index 4f78ace..f16e877 100644
--- a/pagesA/generate-record/generate-record.vue
+++ b/pagesA/generate-record/generate-record.vue
@@ -74,7 +74,7 @@
-
+
@@ -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 @@
-
-
-
-
-
-
- 当前余额
- ¥{{ currentBalance }}
-
-
-
-
-
-
-
-
-
- 选择充值金额
-
-
- ¥{{ item.value }}
-
-
-
-
-
-
- 自定义金额
-
- ¥
-
-
- 充值金额范围:¥1 - ¥50000
-
-
-
-
-
- 选择支付方式
-
-
-
-
-
-
- 微信支付
- 安全快捷,支持零钱和银行卡
-
-
-
-
-
-
-
-
-
-
- 支付宝
- 便民生活,轻松支付
-
-
-
-
-
-
-
-
-
- 充值说明
-
-
-
- 充值金额将实时到账,可用于购买会员服务
-
-
-
- 充值金额不可提现,请根据需要合理充值
-
-
-
- 如有疑问,请联系客服处理
-
-
-
-
-
-
-
- 充值金额:¥{{ finalAmount }}
-
-
-
- 立即充值
-
-
-
-
-
-
-
-
\ No newline at end of file