-```
-
----
-
-## 📊 页面集成状态一览表
-
-| 页面模块 | 文件路径 | 数据源状态 | 说明 |
-| :--- | :--- | :--- | :--- |
-| **首页** | `pages/mall/consumer/index.uvue` | ✅ Real DB | 金刚区、推荐商品已接入 |
-| **搜索** | `pages/mall/consumer/search.uvue` | ✅ Real DB | 关键词搜索、排序、分页正常 |
-| **购物车** | `pages/mall/consumer/cart.uvue` | ✅ Real DB | 加减购、结算校验正常 |
-| **结算台** | `pages/mall/consumer/checkout.uvue` | ✅ Real DB | 地址选择、订单创建正常 |
-| **收银台** | `pages/mall/consumer/payment.uvue` | ✅ Real DB | 读取待付金额,更新支付状态 |
-| **订单列表** | `pages/mall/consumer/orders.uvue` | ✅ Real DB | 状态筛选 (全部/待付/待收/退款) 正常 |
-| **订单详情** | `pages/mall/consumer/order-detail.uvue` | ✅ Real DB | 地址、商品、金额展示正常 |
-| **申请售后** | `pages/mall/consumer/apply-refund.uvue` | ✅ Real DB | **[本次完成]** 关联订单金额,提交至 `ml_refunds` |
-| **在线客服** | `pages/mall/consumer/chat.uvue` | ✅ Real DB | **[本次完成]** 消息收发持久化,支持历史记录 |
-| **消息中心** | `pages/mall/consumer/messages.uvue` | ✅ Real DB | 能够统计未读客服消息数 |
-| **我的评价** | `pages/mall/consumer/review.uvue` | ✅ Real DB | 提交评价至 `ml_product_reviews` |
-
-## 🛠️ 下一步维护建议
-
-1. **异常处理**: 目前部分接口在网络异常时仅打印 `console.error`,建议增加全局统一的 Toasts 提示。
-2. **图片上传**: 目前退款和评价中的图片上传依赖 Mock 或简单路径,需对接真实的 OSS/Supabase Storage 文件上传。
-3. **实时消息**: 目前 `chat.uvue` 使用 polling (轮询) 或手动刷新,Supabase 支持 Realtime Subscription,后续可升级为 WebSocket 实时推送。
diff --git a/mall/pages/mall/consumer/favorites.uvue b/mall/pages/mall/consumer/favorites.uvue
deleted file mode 100644
index bb8abb48..00000000
--- a/mall/pages/mall/consumer/favorites.uvue
+++ /dev/null
@@ -1,309 +0,0 @@
-
-
-
-
- ❤️
- 暂无收藏商品
-
-
-
-
-
-
- {{ product.name }}
- ¥{{ product.price }}
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/mall/consumer/footprint.uvue b/mall/pages/mall/consumer/footprint.uvue
deleted file mode 100644
index 31b97511..00000000
--- a/mall/pages/mall/consumer/footprint.uvue
+++ /dev/null
@@ -1,667 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/mall/consumer/index.uvue b/mall/pages/mall/consumer/index.uvue
deleted file mode 100644
index be9e199f..00000000
--- a/mall/pages/mall/consumer/index.uvue
+++ /dev/null
@@ -1,2259 +0,0 @@
-
-
-
-
-
-
-
-
- 请输入药品名称、症状或品牌
-
-
-
- 🔳
-
-
-
-
- 📷
-
-
-
-
- 搜索
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ category.icon }}
-
- {{ category.name }}
- {{ category.desc }}
-
-
-
-
-
-
- 🏢
-
- {{ brand.name }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 热销
-
-
- {{ product.name }}
-
-
-
-
- ¥
- {{ product.base_price }}
-
-
- ¥{{ product.market_price }}
-
-
-
-
- {{ product.brand_name || product.shop_name || '自营' }}
-
- 已售{{ product.sale_count }}
-
-
-
-
-
- +
- 加入购物车
-
-
-
-
-
-
-
- 正在加载更多商品...
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/mall/pages/mall/consumer/index医药.uvue b/mall/pages/mall/consumer/index医药.uvue
deleted file mode 100644
index 844563ad..00000000
--- a/mall/pages/mall/consumer/index医药.uvue
+++ /dev/null
@@ -1,2168 +0,0 @@
-
-
-
-
-
-
-
-
- 请输入药品名称、症状或品牌
-
-
-
- 🔳
-
-
-
-
- 📷
-
-
-
-
- 搜索
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 💡 按时用药提醒
- 📋 健康记录跟踪
- 🩺 在线问诊咨询
-
-
-
-
-
-
-
-
-
-
- {{ category.icon }}
-
- {{ category.name }}
- {{ category.desc }}
-
-
-
-
-
-
-
-
-
-
-
-
- {{ news.tag }}
- {{ news.title }}
-
-
-
-
-
-
-
-
-
-
-
- 👨⚕️
-
- 在线问诊
- 三甲医生在线
-
-
-
- 📋
-
- 电子处方
- 医生开方购药
-
-
-
- 💊
-
- 非处方药
- 安全自主选购
-
-
-
- 🩺
-
- 健康工具
- 健康管理助手
-
-
-
-
-
-
-
-
-
-
- 热销
-
-
- {{ product.name }}
-
-
-
-
- ¥
- {{ product.base_price }}
-
-
- ¥{{ product.market_price }}
-
-
-
-
- {{ product.brand_name || product.shop_name || '自营' }}
-
- 已售{{ product.sale_count }}
-
-
-
-
-
- +
- 加入购物车
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.icon }}
-
- {{ item.name }}
- {{ item.desc }}
-
-
-
-
-
-
-
-
-
- ⏰
-
- 健康提醒
- 您有1个待用药提醒,点击查看详情
-
-
- 查看
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/mall/pages/mall/consumer/logistics.uvue b/mall/pages/mall/consumer/logistics.uvue
deleted file mode 100644
index 0710effd..00000000
--- a/mall/pages/mall/consumer/logistics.uvue
+++ /dev/null
@@ -1,204 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.desc }}
- {{ item.time }}
-
-
-
-
-
-
-
-
-
-
diff --git a/mall/pages/mall/consumer/messages.uvue b/mall/pages/mall/consumer/messages.uvue
deleted file mode 100644
index e1fdc6ff..00000000
--- a/mall/pages/mall/consumer/messages.uvue
+++ /dev/null
@@ -1,1277 +0,0 @@
-
-
-
-
-
- 消息中心
-
-
- 🧹
- 一键已读
-
-
-
-
-
-
-
-
-
-
-
-
- {{ tab.name }}
- {{ tab.unread > 99 ? '99+' : tab.unread }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ message.icon }}
-
-
-
-
-
-
- {{ message.content }}
- {{ message.lastMessage }}
-
-
- {{ tag }}
-
-
-
-
-
-
- 💡
- 温馨提示:请勿相信任何要求转账、付款的信息,谨防诈骗
-
-
-
-
-
-
-
- 📢
-
-
-
- {{ message.content }}
- 重要
-
-
-
-
-
-
-
-
- 📦
-
-
-
- {{ message.content }}
- 订单号: {{ message.order_no }}
-
- {{ message.statusText }}
-
-
-
-
-
-
-
-
-
- 🎁
-
-
-
- {{ message.content }}
-
- {{ message.coupon }}优惠券
- 有效期至 {{ message.expiry }}
- {{ message.claimed ? '已领取' : '点击领取' }}
-
-
-
-
-
-
-
- 💬
- 暂无消息
- 暂时没有新消息
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/mall/pages/mall/consumer/messages医药.uvue b/mall/pages/mall/consumer/messages医药.uvue
deleted file mode 100644
index b59d1ba1..00000000
--- a/mall/pages/mall/consumer/messages医药.uvue
+++ /dev/null
@@ -1,1277 +0,0 @@
-
-
-
-
-
- 消息中心
-
-
- 🧹
- 一键已读
-
-
-
-
-
-
-
-
-
-
-
-
- {{ tab.name }}
- {{ tab.unread > 99 ? '99+' : tab.unread }}
-
-
-
-
-
-
-
-
-
-
-
-
- 专业医药顾问在线解答,服务时间 9:00-22:00
-
-
-
- 💊
- 用药咨询
-
-
- 📋
- 处方咨询
-
-
- ⚠️
- 副作用咨询
-
-
- 🚚
- 药品配送
-
-
-
-
-
-
-
-
-
- {{ message.icon }}
-
-
-
-
-
-
- {{ message.content }}
- {{ message.lastMessage }}
-
-
- {{ tag }}
-
-
-
-
-
-
- 💡
- 温馨提示:请勿相信任何要求转账、付款的信息,谨防诈骗
-
-
-
-
-
-
-
- 📢
-
-
-
- {{ message.content }}
- 重要
-
-
-
-
-
-
-
-
- 📦
-
-
-
- {{ message.content }}
- 订单号: {{ message.order_no }}
-
- {{ message.statusText }}
-
-
-
-
-
-
-
-
-
- 🎁
-
-
-
- {{ message.content }}
-
- {{ message.coupon }}优惠券
- 有效期至 {{ message.expiry }}
- {{ message.claimed ? '已领取' : '点击领取' }}
-
-
-
-
-
-
-
- 💬
- 暂无消息
- 暂时没有新消息
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/mall/pages/mall/consumer/order-detail.uvue b/mall/pages/mall/consumer/order-detail.uvue
deleted file mode 100644
index 59679592..00000000
--- a/mall/pages/mall/consumer/order-detail.uvue
+++ /dev/null
@@ -1,668 +0,0 @@
-
-
-
-
-
-
-
- {{ getStatusIcon() }}
-
-
- {{ getStatusText() }}
- {{ getStatusDesc() }}
-
-
-
-
-
-
-
- 📍
-
-
- {{ deliveryAddress.name }}
- {{ deliveryAddress.phone }}
-
- {{ getFullAddress(deliveryAddress) }}
-
-
-
-
- 物流单号:
- {{ deliveryInfo.tracking_no }}
- 复制
-
-
-
-
-
-
-
-
-
- {{ item.product_name }}
- {{ getSpecText(item.specifications) }}
-
- ¥{{ item.price }}
- ×{{ item.quantity }}
-
-
-
-
-
-
-
-
- 订单编号
- {{ order.order_no }} 📄
-
-
- 下单时间
- {{ formatTime(order.created_at) }}
-
-
- 支付方式
- {{ getPaymentMethodText(order.payment_method) }}
-
-
- 支付时间
- {{ formatTime(order.paid_at) }}
-
-
- 发货时间
- {{ formatTime(order.shipped_at) }}
-
-
- 完成时间
- {{ formatTime(order.completed_at) }}
-
-
-
-
-
-
- 商品总额
- ¥{{ order.product_amount }}
-
-
- 运费
- +¥{{ order.shipping_fee || 0 }}
-
-
- 优惠金额
- -¥{{ order.discount_amount }}
-
-
- 实付金额
- ¥{{ order.total_amount }}
-
-
-
-
-
-
-
-
- 🎧
- 客服
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/mall/pages/mall/consumer/orders.uvue b/mall/pages/mall/consumer/orders.uvue
deleted file mode 100644
index d64eeb64..00000000
--- a/mall/pages/mall/consumer/orders.uvue
+++ /dev/null
@@ -1,1015 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- {{ tab.name }}
- {{ tab.count }}
-
-
-
-
-
-
-
-
-
- 📦
- 暂无订单
- 去逛逛,发现心仪的商品
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ product.name }}
- {{ product.spec }}
-
-
-
-
-
-
-
-
- 商品合计
- ¥{{ order.product_amount }}
-
-
- 运费
- ¥{{ order.shipping_fee }}
-
-
- 实付款
- ¥{{ order.total_amount }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 加载中...
-
-
-
- 没有更多订单了
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/mall/pages/mall/consumer/payment-success.uvue b/mall/pages/mall/consumer/payment-success.uvue
deleted file mode 100644
index 1cb6e888..00000000
--- a/mall/pages/mall/consumer/payment-success.uvue
+++ /dev/null
@@ -1,190 +0,0 @@
-
-
-
-
- ✓
-
- 支付成功
- 您的订单已支付成功,我们将尽快为您发货
-
-
- 订单编号:{{ orderNo }}
- 支付金额:¥{{ amount.toFixed(2) }}
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/mall/pages/mall/consumer/payment.uvue b/mall/pages/mall/consumer/payment.uvue
deleted file mode 100644
index 19ae75f3..00000000
--- a/mall/pages/mall/consumer/payment.uvue
+++ /dev/null
@@ -1,868 +0,0 @@
-
-
-
-
-
-
- 价格明细
-
-
- 商品总价
- ¥{{ productAmount.toFixed(2) }}
-
-
- 运费
- +¥{{ deliveryFee.toFixed(2) }}
-
-
- 优惠减免
- -¥{{ discountAmount.toFixed(2) }}
-
-
- 应付金额
- ¥{{ amount.toFixed(2) }}
-
-
- 订单号: {{ orderNo }}
-
-
-
-
- 选择支付方式
-
-
-
- {{ getMethodIcon(method.id) }}
-
- {{ method.name }}
- {{ method.description }}
-
-
-
- ✓
-
-
-
-
-
-
-
-
- 账户余额
- ¥{{ userBalance.toFixed(2) }}
-
-
- 余额不足,请选择其他支付方式
-
-
-
-
-
- 请输入支付密码
-
-
- ●
-
-
- 忘记密码?
-
-
-
-
-
-
- 需支付:
- ¥{{ amount.toFixed(2) }}
-
-
-
-
-
-
-
-
- {{ num }}
-
-
-
- 0
-
-
- ⌫
-
-
-
-
-
-
-
-
-
diff --git a/mall/pages/mall/consumer/product-detail.uvue b/mall/pages/mall/consumer/product-detail.uvue
deleted file mode 100644
index 672c13ca..00000000
--- a/mall/pages/mall/consumer/product-detail.uvue
+++ /dev/null
@@ -1,1485 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- {{ currentImageIndex + 1 }} / {{ product.images.length }}
-
-
-
-
-
- ¥{{ product.price }}
- ¥{{ product.original_price }}
-
- {{ product.name }}
- 已售{{ product.sales }}件 · 库存{{ product.stock }}件
-
-
-
-
-
-
- {{ merchant.shop_name }}
-
- 评分: {{ merchant.rating.toFixed(1) }}
- 销量: {{ merchant.total_sales }}
-
-
- 进店 >
-
-
-
-
- 功能主治
- {{ product.usage }}
-
-
-
-
-
- 优惠
-
-
- {{ coupon.name }}
-
-
-
- 领券 >
-
-
-
-
- 商品参数
-
- 规格: {{ product.specification }}
- 有效期: {{ product.expiry_date }}
- 批准文号: {{ product.approval_number }}
-
- >
-
-
-
-
- 规格
- {{ selectedSpec || '请选择规格' }}
- >
-
-
-
-
- 数量
-
-
- -
-
-
-
- +
-
-
- 库存{{ getAvailableStock() }}件
-
-
-
-
- 商品详情
- {{ product.description || '暂无详细描述' }}
-
-
-
-
-
-
-
-
-
-
-
- 💬
- 客服
-
-
- 🛒
- 购物车
-
-
- {{ isFavorite ? '❤️' : '🤍' }}
- {{ isFavorite ? '已收藏' : '收藏' }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ getSkuSpecText(sku) }}
- ¥{{ sku.price }}
- 库存{{ sku.stock }}
-
-
-
-
-
-
-
-
-
-
-
- 规格
- {{ product.specification }}
-
-
- 功能主治
- {{ product.usage }}
-
-
- 副作用
- {{ product.side_effects }}
-
-
- 注意事项
- {{ product.precautions }}
-
-
- 有效期
- {{ product.expiry_date }}
-
-
- 储存条件
- {{ product.storage_conditions }}
-
-
- 批准文号
- {{ product.approval_number }}
-
-
- 标签
- {{ product.tags.join(', ') }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/mall/consumer/profile.uvue b/mall/pages/mall/consumer/profile.uvue
deleted file mode 100644
index 6ac872cc..00000000
--- a/mall/pages/mall/consumer/profile.uvue
+++ /dev/null
@@ -1,1223 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- {{ userInfo.nickname || userInfo.phone }}
-
-
- 积分
- {{ userStats.points }}
-
-
-
- 余额
- ¥{{ userStats.balance }}
-
-
-
- 券
- {{ serviceCounts.coupons }}
-
-
-
-
-
-
- ⚙️
-
-
-
-
-
-
-
-
-
-
- 我的服务
-
-
- 🎫
- 优惠券
- {{ serviceCounts.coupons }}
-
-
- 📍
- 收货地址
-
-
- ❤️
- 我的收藏
- {{ serviceCounts.favorites }}
-
-
-
- 👣
- 浏览足迹
-
-
- 🔄
- 退款/售后
-
-
- 📝
- 评价
-
-
- 🧩
- 我的订阅
-
-
- 📱
- 软件订阅
-
-
-
-
-
-
- 我的订单
-
-
- 📋
- 全部
- {{ orderCounts.total }}
-
-
- 💰
- 待支付
- {{ orderCounts.pending }}
-
-
- 🚚
- 待发货
- {{ orderCounts.toship }}
-
-
- 📦
- 待收货
- {{ orderCounts.shipped }}
-
-
-
-
-
-
-
-
-
- 暂无相关订单记录
-
-
-
-
-
-
-
-
- {{ getOrderTitle(order) }}
- ¥{{ order.actual_amount }}
- {{ formatTime(order.created_at) }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 消费统计
-
- {{ period.label }}
-
-
-
-
- ¥{{ currentStats.total_amount }}
- 总消费
-
-
- {{ currentStats.order_count }}
- 订单数
-
-
- ¥{{ currentStats.avg_amount }}
- 平均消费
-
-
- {{ currentStats.save_amount }}
- 节省金额
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/mall/pages/mall/consumer/refund-review.uvue b/mall/pages/mall/consumer/refund-review.uvue
deleted file mode 100644
index 4e4efb66..00000000
--- a/mall/pages/mall/consumer/refund-review.uvue
+++ /dev/null
@@ -1,163 +0,0 @@
-
-
-
-
-
- 服务评分
-
- ★
-
- {{ ratingText }}
-
-
-
-
-
-
-
-
-
-
-
diff --git a/mall/pages/mall/consumer/refund.uvue b/mall/pages/mall/consumer/refund.uvue
deleted file mode 100644
index 50467c2a..00000000
--- a/mall/pages/mall/consumer/refund.uvue
+++ /dev/null
@@ -1,866 +0,0 @@
-
-
-
-
-
-
-
-
-
- 全部
-
-
- 处理中
- {{ tabCounts.processing }}
-
-
- 已完成
-
-
-
-
-
-
-
- 🔄
- 暂无售后记录
- 您可以在订单详情中申请售后
-
-
-
-
-
-
-
-
- 订单号: {{ refund.order?.order_no }}
- {{ formatTime(refund.order?.created_at) }}
-
-
-
-
-
- {{ getProductName(refund) }}
- 原因: {{ refund.refund_reason }}
-
- 退款金额:
- ¥{{ refund.refund_amount }}
-
-
-
-
-
-
-
-
-
- {{ step.title }}
- {{ step.time }}
- {{ step.desc }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 加载中...
-
-
- 没有更多了
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/mall/consumer/review.uvue b/mall/pages/mall/consumer/review.uvue
deleted file mode 100644
index 8545a314..00000000
--- a/mall/pages/mall/consumer/review.uvue
+++ /dev/null
@@ -1,764 +0,0 @@
-
-
-
-
-
-
-
-
-
- 订单号: {{ order?.order_no }}
- 下单时间: {{ formatTime(order?.created_at) }}
-
-
-
-
-
-
-
-
-
- 评分
-
-
- ⭐
-
-
- {{ getRatingText(ratings[index]) }}
-
-
-
-
-
- {{ contents[index]?.length || 0 }}/500
-
-
-
-
- 上传图片(可选)
-
-
-
- ×
-
-
- +
- 添加图片
-
-
-
-
-
-
-
- 匿名评价
-
-
- 评价内容对其他用户不可见
-
-
-
-
-
-
- 店铺评价
-
- 商品描述相符
-
-
- ⭐
-
-
-
-
- 物流服务
-
-
- ⭐
-
-
-
-
- 服务态度
-
-
- ⭐
-
-
-
-
-
-
-
- 评价须知
- 1. 评价后不可修改,请谨慎评价
- 2. 上传图片需为真实商品照片
- 3. 恶意评价将被删除并限制评价功能
- 4. 优质评价可获得积分奖励
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/mall/consumer/search.uvue b/mall/pages/mall/consumer/search.uvue
deleted file mode 100644
index 5fa88102..00000000
--- a/mall/pages/mall/consumer/search.uvue
+++ /dev/null
@@ -1,1237 +0,0 @@
-
-
-
-
-
-
-
-
- ⚠️
- 加载服务器超时
- 请点击屏幕重试
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item }}
-
- ×
-
-
-
-
-
-
-
-
-
-
- {{ index + 1 }}
- {{ item.keyword }}
- 🔥
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.name }}
-
- ¥
- {{ item.price }}
- 已售{{ item.sales }}
-
-
-
-
-
-
-
-
-
-
-
- 🔍
- {{ suggestion }}
-
-
-
-
-
-
-
-
-
-
-
-
- {{ product.name }}
-
- {{ product.tag }}
-
- {{ product.specification }}
-
-
-
- ¥
- {{ product.price }}
-
-
- +
-
-
-
-
-
-
-
-
- 🤔
- 未找到相关商品
- 换个关键词试试吧
-
-
-
-
-
- 加载中...
-
-
-
- --- 到底了 ---
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/mall/pages/mall/consumer/settings.uvue b/mall/pages/mall/consumer/settings.uvue
deleted file mode 100644
index d26ae394..00000000
--- a/mall/pages/mall/consumer/settings.uvue
+++ /dev/null
@@ -1,858 +0,0 @@
-
-
-
-
-
-
-
-
-
- 账户设置
-
-
- 👤
- 个人资料
- ›
-
-
- 📍
- 收货地址
- ›
-
-
- 🔒
- 修改密码
- ›
-
-
- 📱
- 手机绑定
-
-
- {{ userInfo.phone ? '已绑定' : '未绑定' }}
-
- ›
-
-
-
- 📧
- 邮箱绑定
-
-
- {{ userInfo.email ? '已绑定' : '未绑定' }}
-
- ›
-
-
-
-
-
-
-
- 消息通知
-
-
- 🔔
- 订单消息
-
-
-
- 🎁
- 促销活动
-
-
-
- ⭐
- 评价提醒
-
-
-
-
-
-
-
- 隐私设置
-
-
- 👁️
- 隐藏购物记录
-
-
-
- 🔍
- 允许通过手机号找到我
-
-
-
- 💬
- 接收商家消息
-
-
-
-
-
-
-
- 通用设置
-
-
- 🗑️
- 清除缓存
-
- {{ cacheSize }}
- ›
-
-
-
- 🌐
- 语言设置
-
- {{ currentLanguage }}
- ›
-
-
-
- 🎨
- 主题设置
-
- {{ currentTheme }}
- ›
-
-
-
-
-
-
-
- 我的服务
-
-
- 📝
- 我的评价
- ›
-
-
-
-
-
-
- 关于我们
-
-
- ℹ️
- 关于商城
- ›
-
-
- 📜
- 用户协议
- ›
-
-
- 🛡️
- 隐私政策
- ›
-
-
- 🔄
- 检查更新
-
- {{ appVersion }}
- ›
-
-
-
-
-
-
-
- 客服与反馈
-
-
- 💬
- 联系客服
- ›
-
-
- 📝
- 意见反馈
- ›
-
-
- ⭐
- 给个好评
- ›
-
-
-
-
-
-
-
-
-
-
-
- 注销账号
-
-
-
-
-
-
-
-
diff --git a/mall/pages/mall/consumer/shop-detail.uvue b/mall/pages/mall/consumer/shop-detail.uvue
deleted file mode 100644
index 6210d1b1..00000000
--- a/mall/pages/mall/consumer/shop-detail.uvue
+++ /dev/null
@@ -1,488 +0,0 @@
-
-
-
-
-
-
-
- 全部商品
-
-
-
-
- {{ product.name }}
-
-
- ¥{{ product.price }}
- 已售 {{ product.sales }}
-
-
- 🛒
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/mall/consumer/sql/SUPABASE_CONSUMER_INTEGRATION.md b/mall/pages/mall/consumer/sql/SUPABASE_CONSUMER_INTEGRATION.md
deleted file mode 100644
index f4ef1968..00000000
--- a/mall/pages/mall/consumer/sql/SUPABASE_CONSUMER_INTEGRATION.md
+++ /dev/null
@@ -1,231 +0,0 @@
-# Supabase 消费者端集成指南 (Consumer Frontend Integration Guide)
-
-本文档基于 `complete_mall_database.sql` 数据库设计,为消费者端 (Consumer App) 前端开发提供对接指引。
-
-## 1. 核心表结构概览
-
-所有商城相关表均以 `ml_` 开头。
-
-| 功能模块 | 核心表 | 视图 (推荐使用) | 说明 |
-| :--- | :--- | :--- | :--- |
-| **用户** | `ml_user_profiles`, `ml_user_addresses` | `ml_users_view` | 用户扩展信息、收货地址 |
-| **商品** | `ml_products`, `ml_categories`, `ml_product_skus` | `ml_products_detail_view` | 商品、分类、SKU库存 |
-| **店铺** | `ml_shops` | - | 店铺基础信息 |
-| **购物车** | `ml_shopping_cart` | - | 购物车数据 |
-| **订单** | `ml_orders`, `ml_order_items` | `ml_orders_detail_view` | 订单主表及明细 |
-| **营销** | `ml_user_coupons`, `ml_coupon_templates` | - | 优惠券 |
-| **互动** | `ml_user_favorites`, `ml_product_reviews` | - | 收藏、评价 |
-
----
-
-## 2. 关键业务场景与查询示例
-
-### 2.1 首页展示
-
-#### 获取一级分类
-```typescript
-const { data, error } = await supabase
- .from('ml_categories')
- .select('id, name, icon_url')
- .eq('level', 1)
- .eq('is_active', true)
- .order('sort_order', { ascending: true });
-```
-
-#### 获取热销/推荐商品
-```typescript
-const { data, error } = await supabase
- .from('ml_products')
- .select('id, name, main_image_url, base_price, sale_count')
- .eq('status', 1) // 上架状态
- .eq('is_hot', true) // 热销标记
- .limit(10);
-```
-
-### 2.2 商品详情页
-
-建议优先使用 `ml_products` 表配合关联查询,或者使用视图。
-
-#### 获取商品基础信息
-```typescript
-const { data, error } = await supabase
- .from('ml_products')
- .select(`
- *,
- category:ml_categories(id, name),
- brand:ml_brands(id, name),
- shop:ml_shops(id, shop_name, shop_logo),
- skus:ml_product_skus(*),
- specs:ml_product_specs(*)
- `)
- .eq('id', productId)
- .single();
-```
-
-*注意:`skus` 和 `specs` 是通过外键关联获取的,确保前端处理好 `1:N` 的关系。*
-
-### 2.3 购物车管理
-
-前端需维护购物车逻辑,数据均存储在 `ml_shopping_cart`。
-
-#### 获取我的购物车 (含商品详情)
-**重要**:务必使用内联查询 (`!inner` 或关联) 获取商品最新价格和图片。
-
-```typescript
-const { data, error } = await supabase
- .from('ml_shopping_cart')
- .select(`
- id,
- quantity,
- selected,
- sku_id,
- product:ml_products!inner (
- id,
- name,
- main_image_url,
- base_price, -- 基础价格
- status, -- 检查是否下架
- merchant_id -- 用于店铺分组
- ),
- sku:ml_product_skus (
- id,
- sku_code,
- price, -- SKU价格(如果有)
- specifications,
- stock,
- image_url
- )
- `)
- .eq('user_id', currentUserId)
- .order('created_at', { ascending: false });
-```
-
-#### 店铺分组逻辑 (前端处理)
-前端获取数据后,应根据 `product.merchant_id` 进行分组,并聚合显示店铺名称 (需另外查询或关联 `ml_shops`)。
-
-### 2.4 收货地址
-
-#### 获取地址列表
-```typescript
-const { data, error } = await supabase
- .from('ml_user_addresses')
- .select('*')
- .eq('user_id', currentUserId)
- .eq('status', 1) // 1: 正常
- .order('is_default', { ascending: false }) // 默认地址排最前
- .order('updated_at', { ascending: false });
-```
-
-### 2.5 订单列表
-
-#### 查询我的订单
-```typescript
-const { data, error } = await supabase
- .from('ml_orders')
- .select(`
- id,
- order_no,
- total_amount,
- order_status,
- created_at,
- items:ml_order_items (
- id,
- product_name,
- image_url,
- quantity,
- price,
- specifications
- ),
- shop:ml_shops (
- shop_name
- )
- `)
- .eq('user_id', currentUserId)
- .order('created_at', { ascending: false });
-```
-
----
-
-## 3. RLS (行级安全) 注意事项
-
-数据库已配置 RLS 策略,前端直接调用 Supabase Client 即可,**无需在查询时手动增加 `user_id` 过滤** (除了显式需要对业务逻辑进行过滤的地方,RLS 会自动兜底)。
-
-- **`ml_shopping_cart`**: 用户只能查/改/删自己的购物车记录。
-- **`ml_user_addresses`**: 用户只能查/改/删自己的地址。
-- **`ml_orders`**: 用户只能查看自己的订单。
-- **`ml_products`**: 设置为 `status = 1` 的商品所有人可读。
-
-*确保在 App 启动时正确初始化 Supabase Auth 并处于登录状态。*
-
-## 4. 推荐使用的数据库函数 (RPC)
-
-可以直接通过 ` supabase.rpc('function_name', params)` 调用以下函数:
-
-| 函数名 | 参数 | 描述 |
-| :--- | :--- | :--- |
-| `calculate_cart_total` | `p_user_id` | 计算当前用户购物车选中商品的总金额 (服务端计算更安全) |
-| `get_product_available_stock` | `p_product_id`, `p_sku_id` | 获取特定商品或SKU的实时可用库存 |
-| `get_user_default_address` | `p_user_id` | 快速获取用户的默认收货地址 |
-
-### 调用示例
-```typescript
-// 计算购物车总价
-const { data: total, error } = await supabase
- .rpc('calculate_cart_total', {
- p_user_id: currentUserId
- });
-```
-
-## 5. 类型定义参考 (TypeScript)
-
-为方便前端开发,以下是核心表对应的推荐接口定义:
-
-```typescript
-// 购物车项 (结合了关联查询的结果)
-export interface CartItem {
- id: string;
- quantity: number;
- selected: boolean;
- product: {
- id: string;
- name: string;
- main_image_url: string;
- base_price: number;
- merchant_id: string;
- };
- sku?: {
- id: string;
- price: number;
- specifications: string; // JSON string
- stock: number;
- };
- shop_name?: string; // 前端处理后注入
-}
-
-// 订单结构
-export interface Order {
- id: string;
- order_no: string;
- total_amount: number;
- order_status: number; // 1:待付款 2:待发货 3:待收货 4:已完成 ...
- items: Array<{
- product_name: string;
- image_url: string;
- quantity: number;
- price: number;
- }>;
-}
-```
-
-## 6. 特殊字段说明
-
-- **Product Images**:
- - `main_image_url`: 列表页和购物车主图。
- - `image_urls`: JSONB 数组,用于商品详情轮播图。
-- **Specifications**:
- - 在 `ml_product_skus` 表中 `specifications` 为 JSONB 格式 (例如 `{"color": "红色", "size": "L"}`),前端需解析展示。
-- **Money**:
- - 数据库使用 `DECIMAL`,API 返回为 `number`,建议前端统一处理为两位小数展示。
-
----
-*文档生成日期: 2026-02-02*
diff --git a/mall/pages/mall/consumer/sql/insert_shop_products.sql b/mall/pages/mall/consumer/sql/insert_shop_products.sql
deleted file mode 100644
index 3f107b78..00000000
--- a/mall/pages/mall/consumer/sql/insert_shop_products.sql
+++ /dev/null
@@ -1,114 +0,0 @@
--- =====================================================================================
--- 批量生成商品测试数据 (基于现有的店铺)
--- 说明:为 ml_shops 表中的每个店铺生成 5 个测试商品
--- 前提:ml_shops 表中已有数据
--- =====================================================================================
-
-DO $$
-DECLARE
- shop_rec RECORD;
- cat_id UUID;
- i INTEGER;
- new_product_id UUID;
- v_total_shops INTEGER := 0;
- v_total_products INTEGER := 0;
-BEGIN
- -- 1. 获取一个可用的分类ID (如果没有则创建一个)
- SELECT id INTO cat_id FROM public.ml_categories LIMIT 1;
-
- IF cat_id IS NULL THEN
- RAISE NOTICE '未找到分类,正在创建默认分类...';
- INSERT INTO public.ml_categories (name, slug, level, path)
- VALUES ('测试分类', 'test-category', 1, ARRAY['测试分类'])
- RETURNING id INTO cat_id;
- END IF;
-
- -- 2. 统计现有店铺数量
- SELECT COUNT(*) INTO v_total_shops FROM public.ml_shops;
- RAISE NOTICE '发现 % 个店铺,准备生成商品...', v_total_shops;
-
- -- 3. 遍历所有店铺
- FOR shop_rec IN SELECT merchant_id, shop_name FROM public.ml_shops LOOP
-
- -- 为每个店铺生成 5 个商品
- FOR i IN 1..5 LOOP
-
- -- 插入商品主表
- INSERT INTO public.ml_products (
- merchant_id,
- category_id,
- product_code,
- name,
- subtitle,
- description,
- main_image_url,
- image_urls,
- base_price,
- market_price,
- cost_price,
- total_stock,
- available_stock,
- status, -- 1:上架
- is_new,
- is_hot,
- sale_count, -- 初始销量
- rating_avg, -- 初始评分
- created_at,
- updated_at
- ) VALUES (
- shop_rec.merchant_id,
- cat_id,
- -- 生成唯一的商品编码: PROD + 商家ID前8位 + 序号 + 随机数
- 'PROD-' || substring(shop_rec.merchant_id::text, 1, 8) || '-' || i || '-' || floor(random() * 10000)::text,
- shop_rec.shop_name || ' - 甄选商品 ' || i,
- '测试商品副标题 ' || i || ' | 正品保证 | 极速发货',
- '商品详情
这是 ' || shop_rec.shop_name || ' 的第 ' || i || ' 款测试商品。
商品特点:优质材料,精湛工艺,性价比高。
',
- '/static/images/product/p' || (floor(random() * 4) + 1)::int || '.jpg', -- 随机图片 p1.jpg - p5.jpg
- ('["/static/images/product/p1.jpg", "/static/images/product/p2.jpg", "/static/images/product/p3.jpg"]')::jsonb,
- (floor(random() * 500) + 50)::decimal(10,2), -- 价格 50 - 550
- (floor(random() * 200) + 600)::decimal(10,2), -- 市场价
- (floor(random() * 40) + 10)::decimal(10,2), -- 成本价
- 999, -- 总库存
- 999, -- 可用库存
- 1, -- 状态:上架
- (random() > 0.5), -- 是否新品
- (random() > 0.7), -- 是否热销
- (floor(random() * 1000))::int, -- 随机初始销量
- (4.0 + random())::decimal(3,1), -- 随机评分 4.0 - 5.0
- NOW(),
- NOW()
- ) RETURNING id INTO new_product_id;
-
- -- 插入 SKU (默认生成一个 SKU)
- INSERT INTO public.ml_product_skus (
- product_id,
- sku_code,
- specifications,
- price,
- market_price,
- stock,
- status
- ) VALUES (
- new_product_id,
- 'SKU-' || substring(new_product_id::text, 1, 8),
- '{"默认": "标准规格"}'::jsonb,
- (floor(random() * 500) + 50)::decimal(10,2),
- (floor(random() * 200) + 600)::decimal(10,2),
- 999,
- 1
- );
-
- v_total_products := v_total_products + 1;
-
- END LOOP;
-
- -- 更新店铺的商品统计数量
- UPDATE public.ml_shops
- SET product_count = product_count + 5,
- updated_at = NOW()
- WHERE merchant_id = shop_rec.merchant_id;
-
- END LOOP;
-
- RAISE NOTICE '生成完成!共为 % 个店铺生成了 % 个商品。', v_total_shops, v_total_products;
-END $$;
diff --git a/mall/pages/mall/consumer/subscription/README.md b/mall/pages/mall/consumer/subscription/README.md
deleted file mode 100644
index a769c222..00000000
--- a/mall/pages/mall/consumer/subscription/README.md
+++ /dev/null
@@ -1,16 +0,0 @@
-软件订阅(consumer)
-
-入口:
-- 用户中心 -> 软件订阅
-
-页面:
-- plan-list.uvue:展示可用订阅方案(ml_subscription_plans)
-- plan-detail.uvue:展示某个订阅方案详情
-- subscribe-checkout.uvue:确认支付并创建订阅(写入 ml_user_subscriptions)
-
-依赖表(示例名称,可按实际后端调整):
-- ml_subscription_plans(id, plan_code, name, description, features jsonb, price numeric, currency text, billing_period text, trial_days int, is_active bool, sort_order int, created_at, updated_at)
-- ml_user_subscriptions(id, user_id, plan_id, status text, start_date timestamptz, end_date timestamptz, next_billing_date timestamptz, auto_renew bool, cancel_at_period_end bool, metadata jsonb, created_at, updated_at)
-
-注意:
-- 本实现使用 uni-app-x 兼容组件与 supaClient。实际支付请替换为你们的支付网关,并在后端完成对账与签名校验。
\ No newline at end of file
diff --git a/mall/pages/mall/consumer/subscription/my-subscriptions.uvue b/mall/pages/mall/consumer/subscription/my-subscriptions.uvue
deleted file mode 100644
index 309b447e..00000000
--- a/mall/pages/mall/consumer/subscription/my-subscriptions.uvue
+++ /dev/null
@@ -1,154 +0,0 @@
-
-
-
-
- 加载中...
- 暂无订阅
-
-
-
-
- {{ s['plan']?.['name'] || '订阅' }}
- {{ statusText(s['status'] as string) }}
-
-
- 周期
- {{ (s['plan']?.['billing_period'] === 'yearly') ? '年付' : '月付' }}
-
-
- 价格
- ¥{{ s['plan']?.['price'] }}
-
-
- 开始
- {{ fmt(s['start_date'] as string) }}
-
-
- 下次扣费
- {{ fmt(s['next_billing_date'] as string) }}
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/mall/consumer/subscription/plan-detail.uvue b/mall/pages/mall/consumer/subscription/plan-detail.uvue
deleted file mode 100644
index f8aa063b..00000000
--- a/mall/pages/mall/consumer/subscription/plan-detail.uvue
+++ /dev/null
@@ -1,112 +0,0 @@
-
-
-
- 加载中...
- 未找到该方案
-
- {{ plan['name'] }}
- {{ plan['description'] || '—' }}
-
-
- ¥{{ plan['price'] }}
- /{{ plan['billing_period'] === 'yearly' ? '年' : '月' }}
-
-
-
- 包含功能
-
- • {{ v }}
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/mall/consumer/subscription/plan-list.uvue b/mall/pages/mall/consumer/subscription/plan-list.uvue
deleted file mode 100644
index a003608d..00000000
--- a/mall/pages/mall/consumer/subscription/plan-list.uvue
+++ /dev/null
@@ -1,110 +0,0 @@
-
-
-
-
-
-
-
- {{ p['description'] || '适用于大部分使用场景' }}
-
- ¥{{ p['price'] }}
- /{{ p['billing_period'] === 'yearly' ? '年' : '月' }}
-
-
- • {{ v }}
-
-
-
-
-
-
-
-
- 暂无可用订阅方案
-
-
- 加载中...
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/mall/consumer/subscription/subscribe-checkout.uvue b/mall/pages/mall/consumer/subscription/subscribe-checkout.uvue
deleted file mode 100644
index c6e1c92f..00000000
--- a/mall/pages/mall/consumer/subscription/subscribe-checkout.uvue
+++ /dev/null
@@ -1,164 +0,0 @@
-
-
-
-
- 加载中...
- 未找到订阅方案
-
-
- 方案
- {{ plan['name'] }}
-
-
- 价格
- ¥{{ plan['price'] }} / {{ plan['billing_period'] === 'yearly' ? '年' : '月' }}
-
-
- 试用期
- {{ trialDays }} 天
-
-
- 支付方式
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/mall/consumer/wallet - 副本.uvue b/mall/pages/mall/consumer/wallet - 副本.uvue
deleted file mode 100644
index f51846ce..00000000
--- a/mall/pages/mall/consumer/wallet - 副本.uvue
+++ /dev/null
@@ -1,950 +0,0 @@
-
-
-
-
-
-
-
-
-
- 账户余额
- ¥{{ balance.toFixed(2) }}
-
-
-
-
-
-
-
-
-
- 累计充值
- ¥{{ stats.totalRecharge.toFixed(2) }}
-
-
- 累计消费
- ¥{{ stats.totalConsume.toFixed(2) }}
-
-
- 累计提现
- ¥{{ stats.totalWithdraw.toFixed(2) }}
-
-
-
-
-
-
-
- 🎫
- 优惠券
-
-
- 🧧
- 红包
-
-
- ⭐
- 积分
-
-
- 💳
- 银行卡
-
-
-
-
-
-
-
-
-
-
- 💰
- 暂无交易记录
- 快去使用钱包功能吧
-
-
-
-
-
-
- {{ getTransactionIcon(transaction.type) }}
-
- {{ getTransactionTitle(transaction.type) }}
- {{ formatTime(transaction.created_at) }}
-
-
-
-
-
- {{ transaction.amount > 0 ? '+' : '' }}¥{{ Math.abs(transaction.amount).toFixed(2) }}
-
- 余额: ¥{{ transaction.current_balance.toFixed(2) }}
-
-
-
-
-
-
- 加载中...
-
-
- 没有更多记录了
-
-
-
-
-
- 安全提示
- 1. 请妥善保管您的支付密码
- 2. 不要向他人透露您的账户信息
- 3. 定期修改密码以确保账户安全
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/mall/consumer/wallet.uvue b/mall/pages/mall/consumer/wallet.uvue
deleted file mode 100644
index 13a96272..00000000
--- a/mall/pages/mall/consumer/wallet.uvue
+++ /dev/null
@@ -1,1064 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- 账户余额
- ¥{{ balance.toFixed(2) }}
-
-
-
-
-
-
-
-
-
- 累计充值
- ¥{{ stats.totalRecharge.toFixed(2) }}
-
-
- 累计消费
- ¥{{ stats.totalConsume.toFixed(2) }}
-
-
- 累计提现
- ¥{{ stats.totalWithdraw.toFixed(2) }}
-
-
-
-
-
-
-
- 🎫
- 优惠券
-
-
- 🧧
- 红包
-
-
- ⭐
- 积分
-
-
- 💳
- 银行卡
-
-
-
-
-
-
- 安全提示
- 1. 请妥善保管您的支付密码
- 2. 不要向他人透露您的账户信息
- 3. 定期修改密码以确保账户安全
-
-
-
-
-
-
-
-
-
-
-
- 💰
- 暂无交易记录
- 快去使用钱包功能吧
-
-
-
-
-
-
- {{ getTransactionIcon(transaction.type) }}
-
- {{ getTransactionTitle(transaction.type) }}
- {{ formatTime(transaction.created_at) }}
-
-
-
-
-
- {{ transaction.amount > 0 ? '+' : '' }}¥{{ Math.abs(transaction.amount).toFixed(2) }}
-
- 余额: ¥{{ transaction.current_balance.toFixed(2) }}
-
-
-
-
-
-
- 加载中...
-
-
- 没有更多记录了
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/mall/consumer/wallett.uvue b/mall/pages/mall/consumer/wallett.uvue
deleted file mode 100644
index 8b638472..00000000
--- a/mall/pages/mall/consumer/wallett.uvue
+++ /dev/null
@@ -1,984 +0,0 @@
-
-
-
-
-
-
-
-
-
- 账户余额
- ¥{{ balance.toFixed(2) }}
-
-
-
-
-
-
-
-
-
- 累计充值
- ¥{{ stats.totalRecharge.toFixed(2) }}
-
-
- 累计消费
- ¥{{ stats.totalConsume.toFixed(2) }}
-
-
- 累计提现
- ¥{{ stats.totalWithdraw.toFixed(2) }}
-
-
-
-
-
-
-
- 🎫
- 优惠券
-
-
- 🧧
- 红包
-
-
- ⭐
- 积分
-
-
- 💳
- 银行卡
-
-
-
-
-
-
-
-
-
-
- 💰
- 暂无交易记录
- 快去使用钱包功能吧
-
-
-
-
-
-
- {{ getTransactionIcon(transaction.type) }}
-
- {{ getTransactionTitle(transaction.type) }}
- {{ formatTime(transaction.created_at) }}
-
-
-
-
-
- {{ transaction.amount > 0 ? '+' : '' }}¥{{ Math.abs(transaction.amount).toFixed(2) }}
-
- 余额: ¥{{ transaction.current_balance.toFixed(2) }}
-
-
-
-
-
-
- 加载中...
-
-
- 没有更多记录了
-
-
-
-
-
- 安全提示
- 1. 请妥善保管您的支付密码
- 2. 不要向他人透露您的账户信息
- 3. 定期修改密码以确保账户安全
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/mall/delivery/about.uvue b/mall/pages/mall/delivery/about.uvue
deleted file mode 100644
index 8cf90f4c..00000000
--- a/mall/pages/mall/delivery/about.uvue
+++ /dev/null
@@ -1,293 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 版本: v2.1.5
-
-
-
-
- 快递配送助手
- 专为配送员打造的一站式智能配送平台,提升效率,优化服务体验
-
-
-
-
-
-
-
- 📍
- 智能路线规划
-
-
- 📱
- 实时订单管理
-
-
- 💰
- 在线结算系统
-
-
- ⭐
- 客户评价反馈
-
-
-
-
-
-
-
- 公司名称: 快递科技有限公司
- 成立时间: 2020年
- 总部地点: 深圳市南山区科技园
- 联系电话: 400-123-4567
- 邮箱: support@delivery.com
-
-
-
-
-
-
- v2.1.5 (2026-01-27)
- • 修复了地图定位精度问题\n• 优化了任务分配算法\n• 提升了语音播报稳定性
-
-
- v2.1.4 (2026-01-15)
- • 新增智能语音助手功能\n• 改进了路线导航算法\n• 修复了部分UI显示异常
-
-
- v2.1.3 (2025-12-28)
- • 新增客户满意度评价\n• 优化了离线地图功能\n• 增强了数据同步机制
-
-
-
-
-
- © 2020-2026 快递科技有限公司 版权所有
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/mall/delivery/delivery.md b/mall/pages/mall/delivery/delivery.md
deleted file mode 100644
index 0f8863a2..00000000
--- a/mall/pages/mall/delivery/delivery.md
+++ /dev/null
@@ -1,190 +0,0 @@
-
----
-
-# 🚚 配送端模块项目结构说明(`/pages/mall/delivery/`)
-
-> 本模块为配送员使用的移动端应用核心功能区,涵盖个人中心、任务管理、收入统计、车辆管理等核心功能。
-
----
-
-## 📁 目录结构概览
-
-```
-delivery/
-├── index.uvue # 配送端首页(工作台)
-├── profile.uvue # 个人中心
-├── profile-edit.uvue # 编辑个人信息
-├── settings.uvue # 设置页面
-├── tasks.uvue # 配送任务列表(按状态筛选)
-├── task-detail.uvue # 单个任务详情页
-├── order-history.uvue # 历史订单列表
-├── order-detail.uvue # 订单详情页(从历史或当前跳转)
-├── earnings.uvue # 收入明细
-├── ratings.uvue # 评价记录
-├── vehicle.uvue # 车辆管理主页
-├── vehicle-add.uvue # 添加车辆
-├── vehicle-edit.uvue # 编辑车辆信息
-└── index.uvue # 首页(与上面重复?应统一命名)
-```
-
-> 💡 注:`index.uvue` 出现两次,建议保留一个作为首页入口,另一个可重命名为 `dashboard.uvue` 或 `home.uvue`
-
----
-
-## 🧭 各页面功能说明
-
-### 1. `index.uvue` —— **配送端首页 / 工作台**
-- ✅ 核心入口页面
-- 📍 展示当前任务、今日数据、快捷操作入口
-- 🔄 可跳转到“个人中心”、“任务列表”、“收入明细”等
-
----
-
-### 2. `profile.uvue` —— **个人中心**
-- 👤 显示配送员基本信息(头像、姓名、评分、总单数)
-- 📊 展示今日配送数据(完成单数、收入、里程、准时率)
-- 📈 收入统计图表(最近7天)
-- 🚗 功能菜单:收入明细、车辆管理、评价记录、帮助中心、意见反馈
-
----
-
-### 3. `profile-edit.uvue` —— **编辑个人信息**
-- 🖋️ 修改头像、姓名、身份证号、驾驶证、车辆信息、服务区域等
-- 📱 界面包含表单输入 + 保存按钮
-- ⬅️ 左上角返回按钮(箭头+文字垂直排列)
-- 💾 数据本地模拟或调用API更新
-
----
-
-### 4. `settings.uvue` —— **设置页面**
-- ⚙️ 通用设置项(如通知、隐私、退出登录等)
-- 🔐 安全相关设置(修改密码、绑定手机等)
-- 📲 通常由 `profile.uvue` 中的“⚙️”图标进入
-
----
-
-### 5. `tasks.uvue` —— **配送任务列表**
-- 📋 按状态分类展示任务:
- - 全部任务
- - 待接单
- - 配送中
- - 已完成
-- 🚀 点击任一任务 → 跳转至 `task-detail.uvue`
-- 📈 页面顶部有“工作状态”切换开关(工作中/休息中)
-
----
-
-### 6. `task-detail.uvue` —— **任务详情页**
-- 📍 显示取货地址、送达地址、距离、预计时间
-- 📞 “联系客户”按钮
-- 📝 查看任务详情(可选)
-- ✅ 适用于“当前任务”或“待接单”的操作场景
-
----
-
-### 7. `order-history.uvue` —— **历史订单列表**
-- 📜 展示已完成、已接受、配送中的历史订单
-- 📌 包含订单号、状态、取送货地址、配送费、距离、时间
-- 🔍 点击“查看详情” → 跳转至 `order-detail.uvue`,并携带参数 `?from=history`
-- 📅 支持查看“已完成”的订单(仅显示“联系客服”按钮)
-
----
-
-### 8. `order-detail.uvue` —— **订单详情页(多来源)**
-- 🔄 从 `tasks.uvue` 或 `order-history.uvue` 进入
-- 🎯 **关键逻辑**:
- - 若来自历史订单(`from=history`)且状态为“已完成” → 只显示“联系客服”
- - 若来自历史订单且状态为“进行中” → 显示“接受/拒绝/导航/完成”等操作按钮
- - 若非历史来源 → 显示完整操作按钮
-- 📞 包含联系顾客、联系商家、联系客服三个联系方式
-
----
-
-### 9. `earnings.uvue` —— **收入明细**
-- 💰 展示总收入、用户打赏、商家打赏、总订单数
-- 📊 按订单聚合的收入数据列表
-- 📈 图表展示最近7天收入趋势
-- ➕ 加载更多按钮
-
----
-
-### 10. `ratings.uvue` —— **评价记录**
-- ⭐ 展示用户对配送员的评价
-- 📝 包含评分、评价内容、订单号、时间
-- 📊 统计平均分、好评率等
-
----
-
-### 11. `vehicle.uvue` —— **车辆管理主页**
-- 🚗 列出当前绑定的所有车辆
-- ➕ “添加车辆”按钮
-- 🖋️ 点击车辆 → 跳转至 `vehicle-edit.uvue`
-- 🗑️ 支持删除、设为主用车等操作
-
----
-
-### 12. `vehicle-add.uvue` —— **添加车辆**
-- 📝 表单填写:车牌号、车型、行驶证照片、车辆类型等
-- ✅ 提交后绑定到当前账户
-- ⬅️ 返回车辆管理页
-
----
-
-### 13. `vehicle-edit.uvue` —— **编辑车辆信息**
-- 🖋️ 修改已有车辆信息(车牌、车型、照片等)
-- 📸 支持重新上传行驶证照片
-- ✅ 保存后更新车辆信息
-
----
-
-## 🔄 页面跳转关系图(简化版)
-
-```
-index.uvue
- │
- ├──→ profile.uvue → profile-edit.uvue
- │
- ├──→ tasks.uvue → task-detail.uvue
- │
- ├──→ order-history.uvue → order-detail.uvue (from=history)
- │
- ├──→ earnings.uvue
- │
- ├──→ ratings.uvue
- │
- └──→ vehicle.uvue → vehicle-add.uvue / vehicle-edit.uvue
-```
-
----
-
-## 🎯 设计原则
-
-- ✅ **一致性**:所有页面使用相同导航栏样式(左上角返回按钮 + 居中标题)
-- ✅ **响应式**:适配 H5、APP、小程序等平台
-- ✅ **状态驱动**:根据订单状态动态显示不同操作按钮
-- ✅ **用户体验优先**:历史订单跳转后只显示必要操作,避免冗余按钮
-
----
-
-## 📌 建议优化点
-
-| 问题 | 建议 |
-|------|------|
-| `index.uvue` 重复 | 重命名为 `dashboard.uvue` 或 `home.uvue` |
-| 页面间参数传递 | 使用 `uni.navigateTo({ url: '?param=value' })` 并在 `onLoad` 中接收 |
-| UTS 语法兼容性 | 如遇问题,可临时改用标准 TS 语法调试 |
-
----
-
-## ✅ 总结
-
-这个 `delivery` 模块是一个完整的配送员工作系统,涵盖了:
-
-- **个人管理**(资料、设置)
-- **任务处理**(接单、配送、完成)
-- **数据统计**(收入、评价、历史)
-- **车辆管理**
-
-结构清晰、功能完整,适合用于实际配送平台开发。
-
----
diff --git a/mall/pages/mall/delivery/doc/db-data-generation.md b/mall/pages/mall/delivery/doc/db-data-generation.md
deleted file mode 100644
index abbfabf2..00000000
--- a/mall/pages/mall/delivery/doc/db-data-generation.md
+++ /dev/null
@@ -1,205 +0,0 @@
-## 测试数据生成与验证记录
-
-本文档记录了在本项目中为配送端页面生成并验证测试数据库数据的全过程,包含关键表结构要点、执行的幂等 SQL、遇到的问题及解决办法,以及前端验证步骤,便于回溯和复现。
-
----
-
-**概述**
-
-- 目标:让配送端页面 `pages/mall/delivery/index.uvue` 能读取真实 DB 中的配送任务(`ml_delivery_tasks`)并在附近订单 / 当前任务中展示;为此需要在 DB 中创建或复用 `ak_users`、`ml_delivery_drivers`、`ml_orders`、`ml_delivery_tasks` 的测试数据。
-- 环境:Supabase(Postgres)。建议在 Supabase SQL Editor 中以 `Role = postgres` 执行 SQL 以避免 RLS/触发器引起的权限问题。
-
-**关键表与约束摘要**
-
-- `public.ak_users`:项目用户表,`id` 为主键,`auth_id` 对应 `auth.users.id`。
-- `public.ml_delivery_drivers`:配送员表,重要列:`id`、`user_id` (引用 `ak_users.id`,UNIQUE NOT NULL)、`real_name`、`id_card`。注意:此表没有 `phone` 列(以前曾误以为存在)。
-- `public.ml_orders`:订单表,重要列:`id`、`order_no`(UNIQUE NOT NULL)、`user_id`、`merchant_id`、`shipping_address` (JSONB NOT NULL)、`order_status`。
-- `public.ml_delivery_tasks`:配送任务表,重要列:`id`、`order_id` (UNIQUE NOT NULL,引用 `ml_orders.id`)、`driver_id` (引用 `ml_delivery_drivers.id`)、`pickup_address`/`delivery_address` (JSONB)、`status` (CHECK in (1..6))。注意:联系人信息应内嵌到地址 JSON 中(没有单独 `pickup_contact` 字段)。
-
----
-
-**我执行的主要步骤(已实现的幂等脚本)**
-
-1. 查找或创建 `ak_users`(按 `auth_id` 唯一):避免重复插入,若已存在则复用其 `id`。
-2. 查找或创建 `ml_delivery_drivers`(以 `ak_users.id` 为 `user_id`):注意去掉对不存在列的引用(例如 `phone`)。
-3. 插入两个测试订单(使用唯一 `order_no` 标识,若已存在则跳过),`shipping_address` 使用 JSONB 格式且包含 `contact`/`phone`/`province`/`city`/`detail` 等字段。
-4. 为每个订单创建对应的 `ml_delivery_tasks`:一个保持 `status = 1`(可接单,`driver_id = NULL`),另一个设置 `status = 4` 并分配上步骤创建或找到的 `driver_id`。
-
-下面是我实际使用的幂等 SQL(已去除不存在列并兼容 schema)。在 Supabase SQL Editor 中以 `Role = postgres` 运行整段脚本即可。
-
-```sql
--- 替换 auth_id 为你的 auth.users.id(示例值可替换)
-WITH
-found_user AS (
- SELECT id FROM public.ak_users WHERE auth_id = 'dae9f45b-3955-43ae-992f-a3e24beaa520'
-),
-ins_user AS (
- INSERT INTO public.ak_users (id, auth_id, email, username, created_at)
- SELECT uuid_generate_v4(), 'dae9f45b-3955-43ae-992f-a3e24beaa520', 'test+delivery@example.com', 'test_delivery_user', NOW()
- WHERE NOT EXISTS (SELECT 1 FROM found_user)
- RETURNING id
-),
-user_id AS (
- SELECT id FROM ins_user
- UNION ALL
- SELECT id FROM found_user
- LIMIT 1
-),
-
-found_driver AS (
- SELECT id, user_id FROM public.ml_delivery_drivers WHERE user_id = (SELECT id FROM user_id) LIMIT 1
-),
-ins_driver AS (
- INSERT INTO public.ml_delivery_drivers (id, user_id, real_name, id_card, created_at)
- SELECT uuid_generate_v4(), (SELECT id FROM user_id), '张师傅', 'ID-TEST-0001', NOW()
- WHERE NOT EXISTS (SELECT 1 FROM found_driver)
- RETURNING id, user_id
-),
-driver_row AS (
- SELECT id, user_id FROM ins_driver
- UNION ALL
- SELECT id, user_id FROM found_driver
- LIMIT 1
-),
-
-ins_order_1 AS (
- INSERT INTO public.ml_orders (
- order_no, user_id, merchant_id,
- product_amount, shipping_fee, total_amount,
- shipping_address, created_at, updated_at
- )
- SELECT
- 'TEST-DELIV-20260202-001',
- (SELECT id FROM user_id),
- (SELECT id FROM user_id),
- 88.00, 12.00, 100.00,
- ('{"contact":"李小明","phone":"13800000002","province":"上海市","city":"上海市","district":"浦东新区","street":"测试路100号","detail":"5楼502室","lat":31.2000,"lng":121.5000}')::jsonb,
- NOW(), NOW()
- WHERE NOT EXISTS (SELECT 1 FROM public.ml_orders WHERE order_no = 'TEST-DELIV-20260202-001')
- RETURNING id, order_no, order_status
-),
-sel_order_1 AS (
- SELECT id, order_no FROM ins_order_1
- UNION ALL
- SELECT id, order_no FROM public.ml_orders WHERE order_no = 'TEST-DELIV-20260202-001'
- LIMIT 1
-),
-
-ins_task_1 AS (
- INSERT INTO public.ml_delivery_tasks (
- order_id, pickup_address, delivery_address, delivery_fee, status, created_at, updated_at
- )
- SELECT
- (SELECT id FROM sel_order_1),
- ('{"contact":"商家小二","phone":"13900000002","street":"商家路1號","city":"上海市","detail":"商家门店A"}')::jsonb,
- ('{"contact":"李小明","phone":"13800000002","street":"测试路100号","city":"上海市","detail":"5楼502室"}')::jsonb,
- 12.00,
- 1,
- NOW(), NOW()
- WHERE NOT EXISTS (
- SELECT 1 FROM public.ml_delivery_tasks dt WHERE dt.order_id = (SELECT id FROM sel_order_1)
- )
- RETURNING id, order_id, status, driver_id
-),
-
-ins_order_2 AS (
- INSERT INTO public.ml_orders (
- order_no, user_id, merchant_id,
- product_amount, shipping_fee, total_amount,
- shipping_address, created_at, updated_at
- )
- SELECT
- 'TEST-DELIV-20260202-002',
- (SELECT id FROM user_id),
- (SELECT id FROM user_id),
- 59.00, 8.00, 67.00,
- ('{"contact":"王小红","phone":"13800000003","province":"上海市","city":"上海市","district":"闵行区","street":"示例街20号","detail":"2幢101室","lat":31.1000,"lng":121.4000}')::jsonb,
- NOW(), NOW()
- WHERE NOT EXISTS (SELECT 1 FROM public.ml_orders WHERE order_no = 'TEST-DELIV-20260202-002')
- RETURNING id, order_no, order_status
-),
-sel_order_2 AS (
- SELECT id, order_no FROM ins_order_2
- UNION ALL
- SELECT id, order_no FROM public.ml_orders WHERE order_no = 'TEST-DELIV-20260202-002'
- LIMIT 1
-),
-
-ins_task_2 AS (
- INSERT INTO public.ml_delivery_tasks (
- order_id, driver_id, pickup_address, delivery_address,
- delivery_fee, status, assigned_at, picked_at, created_at, updated_at
- )
- SELECT
- (SELECT id FROM sel_order_2),
- (SELECT id FROM driver_row),
- ('{"contact":"商家B","phone":"13900000003","street":"商家街2號","city":"上海市","detail":"商家门店B"}')::jsonb,
- ('{"contact":"王小红","phone":"13800000003","street":"示例街20号","city":"上海市","detail":"2幢101室"}')::jsonb,
- 8.00,
- 4,
- NOW(), NOW(), NOW(), NOW()
- WHERE NOT EXISTS (
- SELECT 1 FROM public.ml_delivery_tasks dt WHERE dt.order_id = (SELECT id FROM sel_order_2)
- )
- RETURNING id, order_id, status, driver_id
-)
-
-SELECT
- (SELECT id FROM user_id) AS ak_user_id,
- (SELECT id FROM driver_row) AS delivery_driver_id,
- (SELECT id FROM sel_order_1) AS order1_id,
- (SELECT order_no FROM sel_order_1) AS order1_no,
- (SELECT id FROM sel_order_2) AS order2_id,
- (SELECT order_no FROM sel_order_2) AS order2_no,
- (SELECT id FROM ins_task_1) AS task1_id,
- (SELECT id FROM ins_task_2) AS task2_id;
-```
-
----
-
-**常见错误与处理**
-
-- 错误:列不存在(例如 `address` / `phone` / `pickup_contact`)。处理:核对 `complete_mall_database.sql` 中的表结构,确认应使用 `shipping_address`、并将联系人内嵌到 JSON 中。
-- 错误:插入触发 FK 或 NOT NULL 违规(23503 / 23502)。处理:按顺序插入依赖表或使用已存在的 FK 值(例如先查找 `ak_users` 再插入 driver)。
-- 错误:唯一约束冲突(23505,例如 `ml_delivery_tasks.order_id` 唯一)。处理:脚本使用 `WHERE NOT EXISTS` 与 `ORDER_NO` 检查以避免重复插入。
-- 无行返回(UPDATE/SELECT 返回 “Success. No rows returned”):可能因为复制 id 时包含不可见字符,或 WHERE 条件不匹配。建议先用 `SELECT` 按 `order_no` 查找 task,再用 `UPDATE ... FROM public.ml_orders WHERE order_no = '...' RETURNING ...` 更新并检查返回值。
-
----
-
-**前端验证(我在 `pages/mall/delivery/index.uvue` 已加入日志)**
-
-1. 刷新配送端页面(或重新打开),观察控制台日志:
- - `loadDriverInfo` 日志:应输出 `driverInfo`,例如打印 `loadDriverInfo: try user_id=... res=...`。
- - `loadCurrentTask` 日志:输出查询结果 `loadCurrentTask: driverId=... res=...`,若 driver 有未完成任务(status < 5),`currentTask` 会被设置。
- - `loadAvailableOrders` 日志:输出 `loadAvailableOrders: query result=...`,用于验证 `status = 1` 且 `driver_id IS NULL` 的任务是否列出。
-
-2. 若需要把某条 `ml_delivery_tasks` 的 `status` 改为 4(分配给司机),可运行:
-
-```sql
-UPDATE public.ml_delivery_tasks dt
-SET status = 4,
- driver_id = '',
- assigned_at = NOW(),
- updated_at = NOW()
-FROM public.ml_orders o
-WHERE dt.order_id = o.id
- AND o.order_no = 'TEST-DELIV-20260202-001'
-RETURNING dt.id, dt.order_id, dt.status, dt.driver_id, dt.assigned_at, dt.updated_at;
-```
-
-执行后刷新前端并贴回 `loadCurrentTask` / `loadAvailableOrders` 的日志,以便确认页面行为。
-
----
-
-**附:运行建议与注意事项**
-
-- 优先在 Supabase SQL Editor 中以 `Role = postgres` 执行插入与更新脚本,能避免 RLS 导致的“无行返回”。
-- 若需要创建 `ml_order_items`,需先确保 `ml_products` 存在或用最小 mock 产品插入,否则会触发 FK 约束错误。为减少依赖,我先仅创建 `ml_orders` 与 `ml_delivery_tasks`。
-- 保持 `order_no` 的唯一性(测试用的 `order_no` 推荐加时间戳或前缀 `TEST-`)。
-
-如需我把脚本扩展为同时创建 `ml_products` / `ml_order_items`(以便测试完整订单页),或希望我直接在 repo 中加入一个可执行的 SQL 脚本文件,请回复我想要的范围,我来补充。
-
----
-
-作者:自动化助手(配合用户执行并记录)
-日期:2026-02-02
diff --git a/mall/pages/mall/delivery/doc/delivery.md b/mall/pages/mall/delivery/doc/delivery.md
deleted file mode 100644
index afa66568..00000000
--- a/mall/pages/mall/delivery/doc/delivery.md
+++ /dev/null
@@ -1,170 +0,0 @@
-# Delivery 模块 — 总体架构
-
-## 概要
-本文件给出配送(delivery)模块的总体架构说明,覆盖前端视图组件、后端数据表与 API 交互、关键业务流、并发/事务策略与建议改进方向,便于开发者与运维快速理解与修改。
-
-## 架构概览
-- 前端(Uni-app / .uvue 组件):负责页面渲染、用户交互与轻量校验,主要文件位于 `pages/mall/delivery/`。
-- 后端(Supabase/Postgres + RPC):负责数据持久化、原子操作、权限校验与并发控制。建议将关键并发操作(例如“接单”)放在后端 RPC/函数中执行。
-- 数据层(Postgres 表):主表包括 `ml_orders`、`ml_order_items`、`ml_shops`、`ml_delivery_tasks`、`ml_delivery_drivers` 等。
-- 通信:前端通过 Supabase 客户端或后端 HTTP RPC 调用进行读写;推荐对写操作使用后端受限 RPC,减小竞态风险。
-
-## 前端组件映射(关键文件)
-- 入口与导航:`pages/mall/delivery/index.uvue`(模块入口)
-- 任务列表 / 历史:`pages/mall/delivery/tasks.uvue`、`pages/mall/delivery/order-history.uvue`
-- 任务详情 / 订单详情:`pages/mall/delivery/task-detail.uvue`、`pages/mall/delivery/order-detail.uvue`
-- 配送员信息:`pages/mall/delivery/profile.uvue` / `profile-edit.uvue`
-- 收益 / 统计:`pages/mall/delivery/earnings.uvue`
-- 车辆管理:`pages/mall/delivery/vehicle.uvue`、`vehicle-add.uvue`、`vehicle-edit.uvue`
-- 帮助/反馈/测试:`help-center.uvue`、`feedback.uvue`、`test.uvue`
-
-对应文档(开发说明)位于 `pages/mall/delivery/doc/`,每个视图对应一个 `.md` 说明文件(例如 `order-detail.md`、`tasks.md` 等)。
-
-## 数据模型(常用字段 / 表)
-- `ml_orders`: id, cid, order_no, user_id, merchant_id, order_status / status, total_amount, shipping_fee, paid_amount, shipping_address, remark, created_at
-- `ml_order_items`: id, order_id, product_id, product_name, quantity, price, image_url
-- `ml_shops`: id, merchant_id, shop_name, contact_name, contact_phone, address
-- `ml_delivery_tasks`: id, order_id, driver_id, status, distance, estimated_time, pickup_time, delivered_time, created_at
-- `ml_delivery_drivers`: id, user_id, vehicle_id, status
-
-字段命名在代码中可能存在兼容写法(如 `order_status` vs `status`、`shipping_fee` vs `delivery_fee`),建议在前端统一使用一个转换函数 `normalizeOrderRow(row)` 做映射。
-
-## 关键业务流(简要)
-- 接单(Accept)
- - 不要在前端直接做盲写;推荐后端 RPC 原子化操作:
- - SQL 示例(后端执行):
- ```sql
- UPDATE ml_delivery_tasks
- SET driver_id = $1, status = 2
- WHERE order_id = $2 AND (driver_id IS NULL OR driver_id = '')
- RETURNING *;
- ```
- - 前端调用 RPC:根据返回行数判断是否接单成功;若返回 0 行则提示“已被其他配送员接单”。
-
-- 确认取货 / 确认送达
- - 后端更新 `ml_delivery_tasks` 的时间戳字段(`pickup_time` / `delivered_time`)并更新 `ml_orders.order_status`,前端在成功回调后同步 UI 状态并展示时间戳。
-
-- 读取详情页(order-detail)
- - 并行查询 `ml_orders`, `ml_order_items`, `ml_shops`, `ml_delivery_tasks` 并合并结果,务必对空值做兼容处理(地址可能是字符串或对象)。
-
-## 并发与事务策略
-- 将所有会改变接单归属或状态的操作放在数据库事务或后端函数中执行,前端仅调用并根据返回结果更新 UI。
-- 使用行级条件(`WHERE driver_id IS NULL` / `WHERE order_status = expected`)与 `RETURNING` 判断是否成功,避免乐观锁冲突。
-- 在前端增加防重(loading 标志位、按钮禁用)和超时重试策略,并记录幂等请求 ID(如必要)。
-
-## 错误处理与监控
-- 前端对所有写操作展示用户友好错误(网络错误 / 已被接单 / 权限不足)。
-- 后端应记录关键操作日志(接单、拒单、确认取货/送达),并导出指标(接单失败率、并发冲突数)。
-
-## 权限与安全
-- 接单/确认类操作必须在后端校验当前用户是合法配送员(基于 `ml_delivery_drivers.user_id`),并确保 RPC 仅对认证用户开放。
-
-## 开发与测试建议
-- 在 `pages/mall/delivery/test/create_test_orders.sql` 中准备自动化测试数据,用于本地/CI 环境的集成测试。
-- 在前端加入单元测试/集成测试用例,模拟并发接单场景,验证后端 RPC 行为。
-
-## 建议改进(优先级)
-- 高:把接单逻辑迁移为后端 RPC,前端只调用并根据返回结果更新 UI。
-- 高:在所有变更接口返回受影响行数与最新状态,便于前端做幂等与回退。
-- 中:统一并导出状态常量(例如 `ORDER_STATUS`)供前端与文档引用,避免魔法数字。
-- 中:为详情页加入字段规范示例(在 `order-detail.md` 中补充),并同步到 API 文档。
-
----
-
-(如需将 `order-detail.uvue` 的接单逻辑改为调用 RPC 并添加 loading 状态,我可以继续提交补丁。)
-# Delivery 模块文档
-
-本文档为 `pages/mall/delivery` 模块的开发与运维手册,已按与 `analytics` 模块相近的结构补充:概览、文件清单、技术特性、页面架构、实现要点、部署与测试建议、下一步计划与代码质量指引。
-
-## 概览
-配送端(Delivery)面向配送员,覆盖:司机状态管理、任务与订单流转、配送记录/历史、收入统计、个人资料与车辆管理、帮助与反馈。页面既包含前端聚合逻辑,也与后端(Supabase / RPC)交互实现关键业务。
-
-## 文件清单(快速索引)
-
-- [about.uvue](pages/mall/delivery/about.uvue) — 关于我们(静态)
-- [index.uvue](pages/mall/delivery/index.uvue) — 配送端首页(司机信息、今日统计、可接订单)
-- [tasks.uvue](pages/mall/delivery/tasks.uvue) — 任务列表(筛选、分页)
-- [task-detail.uvue](pages/mall/delivery/task-detail.uvue) — 任务详情(联系、取货、完成)
-- [order-detail.uvue](pages/mall/delivery/order-detail.uvue) — 订单详情(多表聚合、状态流转)
-- [order-history.uvue](pages/mall/delivery/order-history.uvue) — 历史订单(本地合并刚完成订单显示)
-- [earnings.uvue](pages/mall/delivery/earnings.uvue) — 收入明细(按 `order_no` 聚合)
-- [profile.uvue](pages/mall/delivery/profile.uvue) — 个人中心与入口
-- [profile-edit.uvue](pages/mall/delivery/profile-edit.uvue) — 编辑资料(头像、服务区域)
-- [vehicle.uvue](pages/mall/delivery/vehicle.uvue) — 车辆管理(列表/新增/编辑)
-- [vehicle-add.uvue](pages/mall/delivery/vehicle-add.uvue) — 添加车辆表单
-- [vehicle-edit.uvue](pages/mall/delivery/vehicle-edit.uvue) — 编辑车辆
-- [feedback.uvue](pages/mall/delivery/feedback.uvue) — 意见反馈(图片、关联订单)
-- [help-center.uvue](pages/mall/delivery/help-center.uvue) — 帮助中心/FAQ
-- [ratings.uvue](pages/mall/delivery/ratings.uvue) — 评价记录(分页/筛选)
-- [settings.uvue](pages/mall/delivery/settings.uvue) — 设置页
-- [test.uvue](pages/mall/delivery/test.uvue) — Supabase 连接/权限诊断
-
-## 技术特性
-
-- UTS / Uni-app 页面实现(`.uvue`),兼容 UTS Android 规范(类型定义、UTSJSONObject 使用等)。
-- 使用 `supa`(项目内 Supabase 封装)进行数据读取、RPC 调用与认证。示例:`supa.from('ml_delivery_tasks')`、`supa.rpc('rpc_analytics_top_products', params)`(analytics 模式的参考)。
-- 本模块使用本地存储做页面间临时数据传递(`uni.setStorageSync`),并在部分页面(如 `vehicle`、`order-history`)合并本地临时项以支持无后端或原型场景。
-- 对接建议:关键写操作(接单/状态变更)必须依赖后端原子性保护(事务或 WHERE driver_id IS NULL 的更新语句)。
-
-## 页面架构与实现要点
-
-- 首页(`index.uvue`):聚合 `driver`、`todayStats`、`currentTask` 与 `availableOrders`;包含 `_transformTask` 用于兼容多种地址/联系人字段格式。
-- 订单详情(`order-detail.uvue`):按 id 格式选择查询字段(`id`/`cid`/`order_no`),并联查 `ml_order_items`, `ml_shops`, `ml_delivery_tasks`;提供接单/拒单/确认取货/确认送达等操作。
-- 任务流(`tasks` / `task-detail`):任务筛选(待接单/进行中/已完成)与详情页的状态变更操作;完成时应记录时间戳与凭证以便对账。
-- 收入(`earnings`):前端按 `order_no` 聚合并补齐来源类型,建议后端提供已聚合接口以提升性能与准确性。
-- 个人/车辆页:使用图片上传、表单校验与本地缓存作为临时方案;生产应对接车辆管理 API 并保存到服务端。
-
-## 典型 DB / RPC 示例
-
-Supabase (supa) 示例:
-```
-// 查询司机信息
-await supa.from('ml_delivery_drivers').select('*').eq('user_id', userId).limit(1).execute()
-
-// 查询可接任务(示例)
-await supa.from('ml_delivery_tasks').select('*').is('driver_id', null).eq('status', 1).order('created_at', { ascending: false }).range(offset, offset+size-1).execute()
-
-// 接单(需后端并发保护)
-await supa.from('ml_delivery_tasks').update({ driver_id: driverId, status: 2 }).eq('id', taskId).eq('driver_id', null).execute()
-```
-
-## 样式与 UI 设计
-
-- 推荐采用与 `analytics` 模块相同的卡片式布局与 KPI 卡片样式(便于统一风格);关键组件(任务卡、订单明细卡、统计卡)应抽象成可复用组件以减少重复代码。
-
-## 部署与配置
-
-- 环境变量:确认 `SUPA_URL`/`SUPA_KEY` 在 `ak/config.uts` 或环境配置中正确配置。
-- 本地测试:使用 `pages/mall/delivery/test.uvue` 验证 Supabase 连接与权限(避免在仓库暴露明文 key)。
-
-## 测试建议
-
-- 功能测试:接单并发测试、状态流转(取货/送达)、图片上传与表单校验、分页与历史数据展示。
-- 兼容性:Android/不同屏幕尺寸测试(UTS Android 兼容性须验证)。
-- 性能:大量任务/历史记录分页测试,收入聚合在后端做性能验证。
-
-## 下一步计划
-
-1. 抽取并复用 UI 组件(任务卡、订单详情卡、统计 KPI 卡)。
-2. 将前端聚合逻辑(如 `earnings`)迁移或补充后端聚合接口以提升性能。
-3. 用后端事务或乐观锁增强接单并发保护,并在前端实现失败回退提示。
-4. 添加自动化测试用例覆盖关键流程(接单/确认/拒单/结算)。
-
----
-Generated on: 2026-02-02
-## 快速参考(已合并页摘要)
-
-- `about.uvue`:关于我们(静态信息,运营可从 CMS 拉取版本/更新日志)。
-- `help-center.uvue`:帮助中心 / FAQ(本地数组或后端搜索,支持分类与全文检索)。
-- `settings.uvue`:设置页(通知、语言、隐私、登出),存储建议使用 `uni.setStorageSync` + 后端同步。
-- `feedback.uvue`:意见反馈(文本 + 图片 + 关联订单),图片需先上传再提交 URL。
-- `ratings.uvue`:评价记录列表(分页筛选,可能需要后端审核/屏蔽)。
-- `profile.uvue` / `profile-edit.uvue`:个人中心与编辑(头像上传、服务区域、车辆信息),建议在保存后同步刷新缓存。
-- `vehicle*.uvue`:车辆管理相关(列表/新增/编辑),当前以本地存储为演示,生产应对接 REST 接口并做权限校验。
-
-(已把上述 per-page md 移动到 `pages/mall/delivery/doc/archive/`,保留历史版本以便追溯。)
-
----
-Generated on: 2026-02-02
----
-Generated on: 2026-02-02
diff --git a/mall/pages/mall/delivery/doc/earnings.md b/mall/pages/mall/delivery/doc/earnings.md
deleted file mode 100644
index c8b8a825..00000000
--- a/mall/pages/mall/delivery/doc/earnings.md
+++ /dev/null
@@ -1,89 +0,0 @@
-# earnings.uvue — 收入明细
-
-## 概要
-按 `order_no` 聚合展示配送员收入明细(配送费、用户打赏、商家打赏),支持分页加载与按时间区间统计。
-
-## 数据结构
-- `EarningItem`
- - `id: string`
- - `order_no: string`
- - `date: string`
- - `amount: number`
- - `source: 'delivery_fee' | 'user_tip' | 'merchant_tip' | string`
- - `distance?: number`
-
-- `OrderEarning`
- - `order_no: string`
- - `date: string`
- - `distance?: number`
- - `totalAmount: number`
- - `details: EarningItem[]`
-
-## 关键方法
-- `loadAllEarnings()`
- - 从后端或本地数据源取原始 `EarningItem[]`,按 `order_no` 聚合成 `OrderEarning[]`。
- - 对每个 `OrderEarning.details` 补齐三类来源占位项(amount=0),以保证前端渲染顺序稳定。
-
-- `calculateTotalStats()`
- - 计算 `totalEarnings`, `totalUserTips`, `totalMerchantTips`。
-
-- `loadPage()` / `loadMore()`
- - 基于 `pageSize` 控制分页渲染,避免一次性载入全部历史记录。
-
-## 聚合示例(核心)
-```
-const orderMap = new Map()
-raw.forEach(item => {
- let order = orderMap.get(item.order_no)
- if (!order) {
- order = { order_no: item.order_no, date: item.date, distance: item.distance, totalAmount: 0, details: [] }
- orderMap.set(item.order_no, order)
- }
- order.totalAmount += Number(item.amount || 0)
- order.details.push(item)
-})
-// 补齐三类来源
-orderMap.forEach(order => {
- const has = type => order.details.some(d => d.source === type)
- ;['delivery_fee','merchant_tip','user_tip'].forEach(t => { if (!has(t)) order.details.push({ id: `${order.order_no}_${t}`, order_no: order.order_no, amount: 0, source: t }) })
-})
-const result = Array.from(orderMap.values())
-```
-
-## 接口 / DB 建议
-- 推荐后端提供按订单聚合的接口:
- - GET `/api/driver/{id}/earnings?start=&end=&page=&size=`
- - 返回 `OrderEarning[]` 已聚合的数据以减轻前端压力
-
-## 数据源更新:包含已接订单(Accepted)
-- 需求说明:为了与“历史订单”页面保持一致,收入统计应包含配送员已接取(accepted/assigned)的订单,不仅限于已完成订单。也就是说,只要 `ml_delivery_tasks` 中 `driver_id` = 当前司机且 `status >= 2`(已接取或进行中),其对应的订单都应计入收入统计范围。
-
-- 推荐 Supabase 查询示例(后端或前端按需实现):
-
-```
--- 查询分配给当前司机且已接取的任务对应的订单ID
-SELECT DISTINCT order_id FROM ml_delivery_tasks WHERE driver_id = :driverId AND status >= 2;
-
--- 基于 order_id 查询订单及收入项(示例:ml_orders + ml_delivery_tips)
-SELECT o.id,o.order_no,o.created_at,o.distance,o.delivery_fee, t.amount as tip_amount, 'user_tip' as tip_source
-FROM ml_orders o
-LEFT JOIN ml_delivery_tips t ON t.order_id = o.id
-WHERE o.id IN ()
-ORDER BY o.created_at DESC
-LIMIT :size OFFSET :offset;
-```
-
-- 若在前端直接使用 `supabase-js`:
-
-```js
-const taskRes = await supa.from('ml_delivery_tasks').select('order_id').eq('driver_id', uid).gte('status', 2).execute()
-const orderIds = taskRes.data.map(r => r.order_id)
-const ordersRes = await supa.from('ml_orders').select('*,ml_delivery_tips(*)').in('id', orderIds).order('created_at',{ascending:false}).limit(size).execute()
-```
-
-注意:若订单很多,务必在后端做分页/聚合以减轻客户端开销。
-
-## 注意事项
-- 在金额计算中使用整数 cents 或 BigInt 或固定小数处理,避免浮点误差。
-- 大量数据应后端分页/聚合并支持过滤(按时间、按来源)。
-
diff --git a/mall/pages/mall/delivery/doc/index.md b/mall/pages/mall/delivery/doc/index.md
deleted file mode 100644
index dbea39f3..00000000
--- a/mall/pages/mall/delivery/doc/index.md
+++ /dev/null
@@ -1,63 +0,0 @@
-# index.uvue — 配送端首页
-
-## 概要
-配送员主界面,包含司机信息、在线/离线切换、今日统计、当前配送任务、附近可接订单与快捷入口。
-
-## 数据结构
-- DeliveryDriverType (来自 `ml_delivery_drivers`)
- - id, user_id, real_name, avatar_url, work_status, vehicle_type, vehicle_number, rating, service_areas, ...
-
-- CurrentTaskType / AvailableOrderType
- - id, order_no, status, pickup_address, delivery_address, pickup_contact, delivery_contact, delivery_fee, distance, estimated_time, created_at
-
-## 关键方法
-- `onLoad()`
- - 调用 `getCurrentUser()` 确保用户上下文可用
- - 执行:`loadDriverInfo()`, `loadTodayStats()`, `loadCurrentTask()`, `loadAvailableOrders()`
-
-- `loadDriverInfo()`
- - 从 `ml_delivery_drivers` 表按 `user_id` 查询并更新 `driverInfo`。
-
-- `loadTodayStats()`
- - 查询 `ml_delivery_tasks` 在当天范围内的记录,计算完成订单数、总收入、配送里程等。
-
-- `loadCurrentTask()`
- - 查询 `ml_delivery_tasks` 中 driver_id 的未完成任务(status < 5),并取最新一条作为当前任务。
-
-- `loadAvailableOrders()`
- - 若 `isOnline` 且无 `currentTask`,从 `ml_delivery_tasks` 查询 `driver_id IS NULL` 且 status=1 的订单列表(可按地理位置筛选)。
-
-- `_transformTask(task)`
- - 兼容处理 `pickup_address` / `delivery_address` 与 `pickup_contact` 的多种格式(对象或 JSON 字符串),输出页面期望结构。
-
-## 关键 DB 查询 示例
-```
-await supa.from('ml_delivery_drivers').select('*').eq('user_id', userId).limit(1).execute()
-
-await supa.from('ml_delivery_tasks')
- .select('id,delivery_fee,distance,created_at,status')
- .eq('driver_id', driverId)
- .gte('created_at', start)
- .lte('created_at', end)
- .execute()
-```
-
-## 交互与状态流
-- `toggleWorkStatus()`:切换 `isOnline` 并调用 `startWork()` / `stopWork()`。上线时会刷新可接订单列表。
-- 接单/开始取货/确认取货/开始配送/确认送达等均通过对 `ml_delivery_tasks` 的 `update` 操作变更 `status`,并在成功后更新本地 `currentTask`。
-
-## 注意事项
-- 高并发接单场景需后端保证原子性(乐观锁或 DB 事务)以防止竞单冲突。
-- `loadAvailableOrders()` 最好按司机服务区域与距离筛选,并使用分页/实时推送代替频繁轮询。
-- 日志(console.log)语句便于调试,但生产环境建议使用集中化日志系统。
-# index.uvue — 配送端首页
-
-页面目的:配送员主界面,展示司机资料、工作状态、今日统计、当前任务与可接订单。
-
-关键点:
-- 数据加载:`onLoad()` 调用 `getCurrentUser()` 后依次调用 `loadDriverInfo()`, `loadTodayStats()`, `loadCurrentTask()`, `loadAvailableOrders()`。
-- Supabase 交互:通过 `supa.from(...).select(...).eq(...).execute()` 查询 `ml_delivery_drivers`、`ml_delivery_tasks` 等表。
-- 兼容解析:`_transformTask(task)` 将 DB 返回的地址/contact 字段兼容解析为页面所需结构(处理字符串或对象)。
-- 操作:接单/开始取货/确认取货/开始配送/确认送达等,会调用 supa 更新 `ml_delivery_tasks` 状态并同步页面状态。
-
-注意:对 supa 操作有大量 try/catch,页面对无用户 ID 情况做了保护,适合直接对接真实后端。
diff --git a/mall/pages/mall/delivery/doc/more-orders.md b/mall/pages/mall/delivery/doc/more-orders.md
deleted file mode 100644
index 6c627aca..00000000
--- a/mall/pages/mall/delivery/doc/more-orders.md
+++ /dev/null
@@ -1,118 +0,0 @@
-## 目的
-
-当“附近订单”过多时,在主页面展示前 N 条(当前为 20 条),需要提供“更多”入口,跳转到单独页面展示所有可接取的订单并支持翻页/上拉加载。
-
-## 路由与文件
-
-- 主入口:在 `pages/mall/delivery/index.uvue` 的“附近订单”区块新增“更多”按钮,导航到新页面。
-- 新页面文件:`pages/mall/delivery/all.uvue`(建议路径)
-- 文档说明文件:`pages/mall/delivery/doc/more-orders.md`(本文件)
-
-## 用户流程
-
-1. 用户在 `index.uvue` 看到“附近订单”列表(最多 20 条)。
-2. 当可接取订单数量 >= 20 时,显示“更多”按钮。
-3. 点击“更多”跳转到 `all.uvue`,展示可接取订单的完整列表(分页或无限滚动)。
-4. 用户可在新页面接受订单或刷新列表。
-
-## 后端 / 查询设计(示例:Supabase 客户端)
-
-- 建议分页参数:`pageSize = 50`(可配置)。
-- 前端通过 offset/pagination 请求:
-
-示例(首次加载 page=0, size=50):
-
-```ts
-const page = 0
-const size = 50
-const res = await supa.from('ml_delivery_tasks')
- .select('*')
- .is('driver_id', 'null')
- .eq('status', 1)
- .order('created_at', { ascending: false })
- .range(page*size, page*size + size - 1)
- .execute()
-```
-
-- 翻页时将 `page` 增加;上拉加载时继续请求下一段 `range`。
-- 后端/数据库建议对 `ml_delivery_tasks` 建立索引(status, driver_id, created_at)以加速查询。
-
-## 前端实现建议
-
-- `index.uvue`:在 `availableOrders` 列表下方加入:
-
- - 条件显示:`availableOrders.length >= 20` 时显示“更多”按钮。
- - 点击处理函数:`uni.navigateTo({ url: '/pages/mall/delivery/all' })`。
-
-- `all.uvue` 页面职责:
- - 使用与 `index.uvue` 相同的 `supa` 客户端和 `_transformTask` 方法复用数据格式化逻辑。
- - 支持分页(page + pageSize)或无限滚动(onReachBottom 加载下一页)。
- - 显示空状态、加载中状态和错误提示。
-
-示例数据加载片段(伪代码):
-
-```ts
-data() { return { page: 0, pageSize: 50, items: [], loading: false, finished: false } }
-async loadPage() {
- if (this.loading || this.finished) return
- this.loading = true
- const res = await supa.from('ml_delivery_tasks')
- .select('*')
- .is('driver_id', 'null')
- .eq('status', 1)
- .order('created_at', { ascending: false })
- .range(this.page * this.pageSize, (this.page+1)*this.pageSize - 1)
- .execute()
- const rows = Array.isArray(res.data) ? res.data : []
- if (rows.length < this.pageSize) this.finished = true
- this.items.push(...rows.map(r => this._transformTask(r)))
- this.page += 1
- this.loading = false
-}
-```
-
-## 并发与安全
-
-- 接单时应在服务器端/数据库层做原子性判断,避免竞态:
-
- - 示例(伪 SQL):
- UPDATE ml_delivery_tasks
- SET driver_id = :driverId, status = 2
- WHERE id = :taskId AND driver_id IS NULL AND status = 1
- RETURNING id
-
-- 前端在发起“接受订单”请求后,基于返回结果确认是否成功;若失败需提示用户订单已被接取。
-
-## 接受标准/验收条件
-
-- 在 `index.uvue` 点击“更多”能跳转到 `all.uvue`。
-- `all.uvue` 能正确加载 >20 条可接订单并支持继续加载直到无更多数据。
-- 接单操作的竞态由后端或事务性查询处理,前端能正确反馈成功/失败。
-
-## 测试数据与验证
-
-- 使用现有文档 `doc_mall/database/realistic_mock_data.sql` 创建若干测试订单;也可循环插入多条 `ml_delivery_tasks`(status=1, driver_id=NULL)用于分页测试。
-
-示例快速生成(Postgres 伪 SQL):
-
-```sql
-INSERT INTO public.ml_delivery_tasks (order_id, pickup_address, delivery_address, delivery_fee, status, created_at, updated_at)
-SELECT uuid_generate_v4(), '{"detail":"店铺"}'::jsonb, '{"detail":"用户地址"}'::jsonb, 5.0, 1, NOW() - (i || ' minutes')::interval, NOW()
-FROM generate_series(1,200) as s(i);
-```
-
-## 开发任务清单(简要)
-
-1. 在 `pages/mall/delivery/index.uvue` 增加“更多”按钮並导航。
-2. 新建 `pages/mall/delivery/all.uvue`,实现分页/上拉加载并复用 `_transformTask`。
-3. 后端或 DB 层确保接单操作的原子性。
-4. 编写 E2E 或手动测试脚本验证加载与接单行为。
-
-## 是否需要我实现?
-
-如果你需要,我可以:
-- 直接在 `index.uvue` 添加“更多”按钮示例(小改动)。
-- 新增 `pages/mall/delivery/all.uvue` 的样板实现并提交 PR 样例。
-
----
-文档已创建:`pages/mall/delivery/doc/more-orders.md`
diff --git a/mall/pages/mall/delivery/doc/order-detail.md b/mall/pages/mall/delivery/doc/order-detail.md
deleted file mode 100644
index 31408d88..00000000
--- a/mall/pages/mall/delivery/doc/order-detail.md
+++ /dev/null
@@ -1,51 +0,0 @@
-# order-detail.uvue — 订单详情
-
-## 概要
-展示单笔订单全部信息并提供状态流转(接单、确认取货、确认送达、拒单等)。页面会联合查询 `ml_orders`、`ml_order_items`、`ml_shops` 与 `ml_delivery_tasks`。
-
-## 数据结构(常用字段)
-- `Order`
- - `id: string | number`
- - `order_no: string`
- - `cid?: number` (兼容旧字段)
- - `shipping_address | pickup_address`: object/string
- - `shipping_fee`, `total_amount`, `status`
-
-- `OrderItem`
- - `id`, `order_id`, `product_name`, `qty`, `price`
-
-- `DeliveryTask`
- - `id`, `order_id`, `driver_id`, `status`, `accepted_at`, `picked_at`, `delivered_at`
-
-## 关键方法
-- `onLoad(options)`
- - 解析 `options.id` 与 `options.status`,调用 `loadOrderDetail(id)`。
-
-- `loadOrderDetail(id)`
- - 判断 ID 类型(UUID / 数字 / 非数字)以决定查询字段(`id`、`cid`、`order_no`)。
- - 并行查询 `ml_orders`, `ml_order_items`, `ml_shops`, `ml_delivery_tasks` 并合并到页面状态。
-
-- `acceptOrder()` / `rejectOrder(reason)`
- - accept: 尝试对 `ml_delivery_tasks` 执行 `update driver_id` 操作并设置 `status=2`(处理中),需要后端并发保护。
- - reject: 增加拒单原因到 `ml_delivery_tasks` 或 `order_notes` 并回滚本地 UI 状态。
-
-- `confirmPickup()` / `confirmDelivery()`
- - 根据 `task.id` 更新相应时间戳字段(`picked_at`/`delivered_at`)并设置状态(例如 `status=3/4`)。
-
-## 示例:按 id 类型查询(伪代码)
-```
-let q = supa.from('ml_orders').select('*')
-if (isUUID(id)) q = q.eq('id', id)
-else if (isNumeric(id)) q = q.eq('cid', id)
-else q = q.eq('order_no', id)
-const { data: order } = await q.limit(1).execute()
-```
-
-## 事务与并发注意
-- 接单场景应使用后端原子性检查(数据库事务或行级乐观锁)以避免多司机同时接单。
-- 前端接单流程:先尝试 update(带 where driver_id IS NULL),若返回 0 row affected 则提示已被接单。
-
-## 错误处理与回退
-- 捕获所有 supa 调用错误并将友好错误展示给用户(例如:'网络错误,请稍后重试')。
-- 对可能缺失的字段(地址为字符串或对象)使用 `_transformAddress()` 做兼容处理。
-
diff --git a/mall/pages/mall/delivery/doc/order-history.md b/mall/pages/mall/delivery/doc/order-history.md
deleted file mode 100644
index b46ea431..00000000
--- a/mall/pages/mall/delivery/doc/order-history.md
+++ /dev/null
@@ -1,31 +0,0 @@
-# order-history.uvue — 历史订单
-
-## 概要
-显示配送员历史订单(已完成/已取消等),并支持按时间范围过滤、分页和插入刚完成订单以做到“即时显示”。
-
-## 数据结构
-- `HistoryOrder`
- - `order_no`, `id`, `status`, `delivered_at`, `total_amount`, `shop_name`
-
-## 关键方法
-- `loadOrderHistory({start,end,page,size})`
- - 优先按 `ml_delivery_tasks` 中与 `driver_id` 相关的 `order_id` 拉取任务记录,再批量查询 `ml_orders` 获取详情。
- - 若后端支持直接按 `driver_id` 返回已完成订单则调用后端聚合接口更高效。
-
-- `checkForNewCompletedOrder()`
- - 从 `uni.getStorageSync('completed_order_for_history')` 读取并合并到 `orderHistory` 顶部,随后清除本地缓存键。
-
-## DB 查询示例(伪 SQL / supa)
-```
-const tasks = await supa.from('ml_delivery_tasks').select('order_id,delivered_at').eq('driver_id', driverId).eq('status', 4).order('delivered_at', { ascending: false }).limit(100).execute()
-const orders = await supa.from('ml_orders').select('*').in('id', tasks.map(t=>t.order_id)).execute()
-```
-
-## 分页与筛选
-- 使用后端分页(`page/size`),前端仅负责渲染和“加载更多”。
-- 支持按日期区间和商家名模糊搜索。
-
-## 注意事项
-- 当从本地合并刚完成订单时,去重逻辑必不可少(按 `order_no` 或 `id`)。
-- 对于大量历史数据,应依赖后端支持归档与按需加载。错误/异常应有兜底 UI(空状态/重试按钮)。
-
diff --git a/mall/pages/mall/delivery/doc/profile-edit.md b/mall/pages/mall/delivery/doc/profile-edit.md
deleted file mode 100644
index 9a6ffa14..00000000
--- a/mall/pages/mall/delivery/doc/profile-edit.md
+++ /dev/null
@@ -1,25 +0,0 @@
-# profile-edit.uvue — 编辑资料
-
-## 概要
-编辑配送员个人资料(姓名、电话、头像、服务区域、车辆信息等),并将修改提交到后端保存。
-
-## 数据结构
-- `ProfileForm`
- - `real_name`, `phone`, `avatar_url`, `service_areas[]`, `vehicle`{
- `type`, `model`, `plate_no`
- }
-
-## 关键方法
-- `chooseAvatar()`:`uni.chooseImage` 获取本地图片并调用 `uploadAvatar()` 上传。
-- `uploadAvatar(file)`:上传到文件存储并返回 URL,更新 `form.avatar_url`。
-- `saveProfile()`:表单校验后调用后端 API 更新 `ml_delivery_drivers` 或 `users` 表。
-
-## 接口示例
-```
-await api.put('/driver/profile', { ...form })
-```
-
-## 注意事项
-- 上传图片应限制大小并在客户端压缩以减少带宽。
-- 服务区域通常是数组或 GeoJSON,保存时与后端约定格式以支持范围匹配。
-
diff --git a/mall/pages/mall/delivery/doc/profile.md b/mall/pages/mall/delivery/doc/profile.md
deleted file mode 100644
index 8886c566..00000000
--- a/mall/pages/mall/delivery/doc/profile.md
+++ /dev/null
@@ -1,26 +0,0 @@
-# profile.uvue — 个人中心
-
-## 概要
-配送员个人中心,展示司机基本信息、当前工作状态、统计摘要(今日订单/收入)、常用入口(车辆管理/收入/设置/帮助)以及最近任务预览。
-
-## 数据结构
-- `DriverInfo`
- - `id`, `user_id`, `real_name`, `avatar_url`, `work_status`, `rating`, `vehicle`(简要信息)
-
-## 关键方法
-- `loadDriverInfo()`:从 `ml_delivery_drivers` 或 `users` 表加载司机信息并设置 `driverInfo`。
-- `toggleWorkStatus()`:切换上线/下线并触发 `loadAvailableOrders()`(上线时)。
-- `relocate()`:请求定位权限并更新司机服务位置(可调用后端保存)。
-
-## 交互示例
-```
-async toggleWorkStatus() {
- await supa.from('ml_delivery_drivers').update({ work_status: newStatus }).eq('id', driverInfo.id)
- this.driverInfo.work_status = newStatus
-}
-```
-
-## 注意事项
-- 工作状态变更应通知后端并尽量在服务端发出状态变更事件(WebSocket/推送)。
-- 个人信息编辑应跳转到 `profile-edit`,并在保存后同步更新本页缓存。
-
diff --git a/mall/pages/mall/delivery/earnings.uvue b/mall/pages/mall/delivery/earnings.uvue
deleted file mode 100644
index c3bfc49a..00000000
--- a/mall/pages/mall/delivery/earnings.uvue
+++ /dev/null
@@ -1,542 +0,0 @@
-
-
-
-
-
-
-
-
- ¥{{ totalEarnings }}
- 总收入
-
-
- ¥{{ totalUserTips }}
- 用户打赏
-
-
- ¥{{ totalMerchantTips }}
- 商家打赏
-
-
- {{ totalOrders }}
- 总订单数
-
-
-
-
-
-
-
-
-
-
- 订单收入:
- ¥{{ order.totalAmount.toFixed(2) }}
-
-
-
-
- 订单号: {{ order.order_no }}
- 时间: {{ formatTime(order.date) }}
- 距离: {{ order.distance }}km
-
-
-
-
-
- {{ getSourceText(detail.source) }}
- +¥{{ detail.amount.toFixed(2) }}
-
-
-
-
-
-
-
- 暂无收入记录
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/mall/delivery/feedback.uvue b/mall/pages/mall/delivery/feedback.uvue
deleted file mode 100644
index e11134d7..00000000
--- a/mall/pages/mall/delivery/feedback.uvue
+++ /dev/null
@@ -1,451 +0,0 @@
-
-
-
-
-
-
-
-
-
- 问题类型
-
- {{ feedbackTypes[selectedTypeIndex] }}
-
-
-
-
-
- 标题
-
-
-
-
-
- 详细内容
-
-
-
-
-
- 上传截图(可选)
-
- 🖼️
- 点击上传截图
- 支持 JPG/PNG,最多3张
-
-
-
-
-
-
- ×
-
-
-
-
-
-
- 关联订单号(可选)
-
-
- {{ selectedOrderIndex === -1 ? '请选择订单' : orderOptions[selectedOrderIndex] }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/mall/delivery/help-center.uvue b/mall/pages/mall/delivery/help-center.uvue
deleted file mode 100644
index 7b7b63c2..00000000
--- a/mall/pages/mall/delivery/help-center.uvue
+++ /dev/null
@@ -1,524 +0,0 @@
-
-
-
-
-
-
-
-
- 🔍
-
-
-
-
-
-
-
-
- {{ cat.name }}
-
-
-
-
-
-
-
-
- 搜索结果:{{ searchResults.length }} 条
- 清除
-
-
-
-
-
-
-
- {{ item.content }}
-
-
-
-
-
-
- ❓
- 暂无匹配结果
- 请尝试更换关键词,或查看以下热门问题
-
- 热门问题:
- 如何接单?
- 配送超时怎么办?
- 如何联系客户?
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/mall/delivery/index.uvue b/mall/pages/mall/delivery/index.uvue
deleted file mode 100644
index cd916250..00000000
--- a/mall/pages/mall/delivery/index.uvue
+++ /dev/null
@@ -1,1221 +0,0 @@
-
-
-
-
-
-
-
-
- 今日数据
-
-
- {{ todayStats.completed_orders }}
- 完成订单
-
-
- ¥{{ todayStats.total_earning }}
- 总收入
-
-
- {{ todayStats.total_distance }}km
- 配送距离
-
-
- {{ todayStats.avg_rating }}
- 平均评分
-
-
-
-
-
-
- 当前任务
-
-
-
-
-
- 📍
-
- 取货地址
- {{ currentTask.pickup_address.detail }}
- 联系人: {{ currentTask.pickup_contact.name }} {{ currentTask.pickup_contact.phone }}
-
-
-
-
-
-
- 🏠
-
- 收货地址
- {{ currentTask.delivery_address.detail }}
- 联系人: {{ currentTask.delivery_contact.name }} {{ currentTask.delivery_contact.phone }}
-
-
-
-
-
- 配送费: ¥{{ currentTask.delivery_fee }}
- 预计距离: {{ currentTask.distance }}km
- 预计时间: {{ currentTask.estimated_time }}分钟
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 暂无可接取订单
- 请保持在线状态,有新订单会自动推送
-
-
-
-
-
-
-
- 📍
- {{ order.pickup_address.area }}
-
- →
-
- 🏠
- {{ order.delivery_address.area }}
-
-
-
-
- 距离: {{ order.distance }}km
- 预计: {{ order.estimated_time }}分钟
- 下单: {{ formatTime(order.created_at) }}
-
-
-
-
-
-
-
-
-
-
-
- 快捷功能
-
-
- 📋
- 历史订单
-
-
- 💰
- 收入明细
-
-
- 👤
- 个人资料
-
-
- ⚙️
- 设置
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/mall/delivery/order-detail.uvue b/mall/pages/mall/delivery/order-detail.uvue
deleted file mode 100644
index d58fb0e4..00000000
--- a/mall/pages/mall/delivery/order-detail.uvue
+++ /dev/null
@@ -1,937 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- 待接单
-
-
-
-
- 已接单
-
-
-
-
- 取货中
-
-
-
-
- 已取货
-
-
-
-
- 已送达
-
-
- {{ getStatusDesc() }}
-
-
-
-
- 配送信息
-
-
- 📦
-
- 取货地址
- {{ merchant.contact_name }} · {{ merchant.contact_phone }}
- {{ pickupAddress }}
-
-
-
-
-
-
-
-
- 🏠
-
- 送货地址
- {{ getDeliveryAddress().name }} · {{ getDeliveryAddress().phone }}
- {{ getDeliveryAddress().detail }}
-
-
-
-
-
-
-
- 配送距离:
- {{ deliveryInfo.distance }}km
- 预计时长:
- {{ deliveryInfo.estimated_time }}分钟
-
-
-
-
-
- 订单商品
-
- {{ merchant.shop_name }}
- 订单号:{{ order.order_no }}
-
-
-
-
-
- {{ item.product_name }}
- {{ getSpecText(item.sku_specifications) }}
-
- ¥{{ item.price }}
- ×{{ item.quantity }}
-
-
-
-
-
-
- 商品总额
- ¥{{ order.total_amount }}
-
-
- 配送费
- ¥{{ order.delivery_fee }}
-
-
- 实付金额
- ¥{{ order.actual_amount }}
-
-
-
-
-
-
- 配送备注
-
- 顾客备注:
- {{ customerNote || '无备注' }}
-
-
- 商家备注:
- {{ merchantNote || '无备注' }}
-
-
-
- 配送备注:
-
-
-
-
- 配送备注:
- {{ deliveryNote }}
-
-
-
-
-
- 联系方式
-
-
- 📞
-
- 联系顾客
- {{ getDeliveryAddress().phone }}
-
-
-
- 🏪
-
- 联系商家
- {{ merchant.contact_phone }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/mall/delivery/order-history.uvue b/mall/pages/mall/delivery/order-history.uvue
deleted file mode 100644
index 137a0879..00000000
--- a/mall/pages/mall/delivery/order-history.uvue
+++ /dev/null
@@ -1,513 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 📍
-
- 取货地址
- {{ order.pickup_address.detail }}
- 联系人: {{ order.pickup_contact.name }} {{ order.pickup_contact.phone }}
-
-
-
-
-
-
- 🏠
-
- 收货地址
- {{ order.delivery_address.detail }}
- 联系人: {{ order.delivery_contact.name }} {{ order.delivery_contact.phone }}
-
-
-
-
-
- 配送费: ¥{{ order.delivery_fee }}
- 预计距离: {{ order.distance }}km
- 预计时间: {{ order.estimated_time }}分钟
-
-
-
-
-
-
-
-
-
-
- 暂无历史订单
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/mall/delivery/profile-edit.uvue b/mall/pages/mall/delivery/profile-edit.uvue
deleted file mode 100644
index 62d82af5..00000000
--- a/mall/pages/mall/delivery/profile-edit.uvue
+++ /dev/null
@@ -1,439 +0,0 @@
-
-
-
-
-
-
-
-
-
- 头像
-
-
- 点击更换
-
-
-
-
-
- 姓名
-
-
-
-
-
- 身份证号
-
-
-
-
-
- 驾驶证号
-
-
-
-
-
- 车辆类型
-
- {{ formData.vehicle_type ? vehicleTypes[vehicleTypeIndex] : '请选择车辆类型' }}
-
-
-
-
-
- 车牌号
-
-
-
-
-
- 服务区域
-
-
- {{ area }}
- ×
-
-
- +
- 添加区域
-
-
-
-
-
-
- 联系电话
-
-
-
-
-
-
-
- 添加服务区域
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/mall/delivery/profile.uvue b/mall/pages/mall/delivery/profile.uvue
deleted file mode 100644
index b35cba79..00000000
--- a/mall/pages/mall/delivery/profile.uvue
+++ /dev/null
@@ -1,822 +0,0 @@
-
-
-
-
-
-
-
-
- 工作状态
-
-
- {{ workStatus === 1 ? '工作中' : '休息中' }}
-
-
-
-
-
-
- 📍 {{ currentLocation }}
-
- ↻
-
-
-
-
-
-
-
- 配送任务
-
-
- 📋
- 全部任务
- {{ taskCounts.total }}
-
-
- ⏳
- 待接单
- {{ taskCounts.pending }}
-
-
- 🚚
- 配送中
- {{ taskCounts.ongoing }}
-
-
- ✅
- 已完成
- {{ taskCounts.completed }}
-
-
-
-
-
-
- 今日配送
-
-
- {{ todayStats.deliveries }}
- 完成单数
-
-
- ¥{{ todayStats.earnings }}
- 配送收入
-
-
- {{ todayStats.distance }}km
- 配送里程
-
-
- {{ todayStats.efficiency }}%
- 准时率
-
-
-
-
-
-
- 当前任务
-
-
-
-
- 📍
-
- 取货地址
- {{ getAddressText(currentTask.pickup_address) }}
-
-
-
-
- 🏠
-
- 送达地址
- {{ getAddressText(currentTask.delivery_address) }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 订单: {{ task.order_id.slice(-6) }}
- 配送费: ¥{{ task.delivery_fee }}
-
-
- {{ formatTime(task.created_at) }}
- {{ getTaskStatusText(task.status) }}
-
-
-
-
- 暂无最近任务
-
-
-
-
-
-
-
-
-
- {{ day.day }}
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/mall/delivery/ratings.uvue b/mall/pages/mall/delivery/ratings.uvue
deleted file mode 100644
index aa27e5ee..00000000
--- a/mall/pages/mall/delivery/ratings.uvue
+++ /dev/null
@@ -1,202 +0,0 @@
-
-
-
-
-
-
- ‹
-
-
-
- 4.9
-
- ★
- ★
- ★
- ★
- ★
-
- 共收到 128 条评价
-
-
-
-
- 好评率
- 96.1%
-
-
-
-
-
-
-
- {{ t.label }}
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ tag }}
-
-
-
- 正在加载…
- 已加载全部
-
-
-
- 📝
- 暂无评价记录
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/mall/delivery/settings.uvue b/mall/pages/mall/delivery/settings.uvue
deleted file mode 100644
index 4fbef3c1..00000000
--- a/mall/pages/mall/delivery/settings.uvue
+++ /dev/null
@@ -1,494 +0,0 @@
-
-
-
-
-
-
-
-
-
- 基础设置
-
-
- 深色模式
-
-
-
-
- 自动更新
-
-
-
-
- 语言
- {{ selectedLanguage }}
- ›
-
-
-
-
-
- 通知设置
-
-
- 订单通知
-
-
-
-
- 系统通知
-
-
-
-
- 通知时段
- {{ notificationTimeRange }}
- ›
-
-
-
-
-
- 隐私与安全
-
-
- 修改密码
- ›
-
-
-
- 位置共享
-
-
-
-
- 清除缓存
- {{ cacheSize }}
- ›
-
-
-
-
-
- 关于与帮助
-
-
- 关于我们
- {{ appVersion }}
- ›
-
-
-
- 帮助中心
- ›
-
-
-
- 意见反馈
- ›
-
-
-
-
-
-
-
-
-
-
-
-
- 选择语言
-
-
- {{ lang.label }}
-
-
-
-
-
-
-
-
-
-
-
-
- 选择通知时段
-
- 从
-
- {{ startTime }}
-
- 到
-
- {{ endTime }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/mall/delivery/task-detail.uvue b/mall/pages/mall/delivery/task-detail.uvue
deleted file mode 100644
index 28069e57..00000000
--- a/mall/pages/mall/delivery/task-detail.uvue
+++ /dev/null
@@ -1,428 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- 取货地址:
- {{ getAddressText(task?.pickup_address) }}
-
-
- 送达地址:
- {{ getAddressText(task?.delivery_address) }}
-
-
- 距离:
- {{ task.distance }}km
-
-
- 预计时间:
- {{ task.estimated_time }}分钟
-
-
- 配送费:
- ¥{{ task.delivery_fee }}
-
-
- 创建时间:
- {{ formatTime(task.created_at) }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/mall/delivery/tasks.uvue b/mall/pages/mall/delivery/tasks.uvue
deleted file mode 100644
index 5b762b69..00000000
--- a/mall/pages/mall/delivery/tasks.uvue
+++ /dev/null
@@ -1,433 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- 取货: {{ getAddressText(task.pickup_address) }}
- 距离: {{ task.distance }}km
-
-
-
-
-
-
-
-
-
- 暂无{{ getTitle() }}任务
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/mall/delivery/test.uvue b/mall/pages/mall/delivery/test.uvue
deleted file mode 100644
index ed67b4e9..00000000
--- a/mall/pages/mall/delivery/test.uvue
+++ /dev/null
@@ -1,418 +0,0 @@
-
-
-
-
-
- 当前配置:
- URL: {{ config.url }}
- Key: {{ config.keyMasked }}
-
-
-
-
-
-
-
- 测试结果
-
- {{ result.success ? '✅' : '❌' }}
- {{ result.name }}
- {{ result.message }}
- {{ result.errorDetails }}
-
-
-
-
- 单项测试
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/mall/delivery/vehicle-add.uvue b/mall/pages/mall/delivery/vehicle-add.uvue
deleted file mode 100644
index 1a7f129c..00000000
--- a/mall/pages/mall/delivery/vehicle-add.uvue
+++ /dev/null
@@ -1,320 +0,0 @@
-
-
-
-
-
-
-
-
-
- 车牌号
-
-
-
-
-
- 车辆类型
-
- {{ formData.vehicle_type ? vehicleTypes[vehicleTypeIndex] : '请选择车辆类型' }}
-
-
-
-
-
- 车辆品牌
-
-
-
-
-
- 车辆颜色
-
-
-
-
-
- 车辆照片
-
-
- 点击上传车辆照片
-
-
-
-
-
- 备注
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/mall/delivery/vehicle-edit.uvue b/mall/pages/mall/delivery/vehicle-edit.uvue
deleted file mode 100644
index 7bac8680..00000000
--- a/mall/pages/mall/delivery/vehicle-edit.uvue
+++ /dev/null
@@ -1,379 +0,0 @@
-
-
-
-
-
-
-
-
-
- 车牌号
-
-
-
-
-
- 车辆类型
-
- {{ formData.vehicle_type ? vehicleTypes[vehicleTypeIndex] : '请选择车辆类型' }}
-
-
-
-
-
- 车辆品牌
-
-
-
-
-
- 车辆颜色
-
-
-
-
-
- 车辆照片
-
-
- 点击上传车辆照片
-
-
-
-
-
- 备注
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/mall/delivery/vehicle.uvue b/mall/pages/mall/delivery/vehicle.uvue
deleted file mode 100644
index 14f95eee..00000000
--- a/mall/pages/mall/delivery/vehicle.uvue
+++ /dev/null
@@ -1,338 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- 🚗
-
- 车牌号: {{ vehicle.plate_number }}
- 车型: {{ vehicle.vehicle_type_name }}
- 状态: {{ getVehicleStatusText(vehicle.status) }}
-
-
-
-
-
-
-
-
-
-
-
- 暂无车辆信息
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/mall/mall.md b/mall/pages/mall/mall.md
deleted file mode 100644
index aacc76f6..00000000
--- a/mall/pages/mall/mall.md
+++ /dev/null
@@ -1,1063 +0,0 @@
-# 电商商城系统完整需求文档
-
-## 1. 项目概述
-
-## 📋 文档内容概览
-
-### 🎯 核心特性
-- **6个客户端应用**: 消费者端、商家端、配送端、管理端、客服端、数据分析端
-- **完整功能模块**: 用户管理、商品管理、订单系统、配送系统等
-- **优惠券系统**: 8种券类型、多种发放机制、完整使用流程
-- **智能配送**: 配送员管理、智能调度、实时追踪、费用计算
-
-### 🗄️ 数据库设计
-- **15+核心数据表**: 涵盖用户、商家、商品、订单、配送、支付等
-- **完整SQL建表语句**: 每个表都包含详细字段定义
-- **关系设计**: 合理的外键关系和数据完整性约束
-
-### 🛠️ 技术栈
-- **前端**: uni-app-x + Pinia + 自定义组件库
-- **后端**: Node.js + Fastify + Kafka
-- **数据库**: PostgreSQL (Supabase)
-- **实时通信**: Supabase Realtime
-- **支付**: 微信支付/支付宝集成
-
-### 🚀 实施计划
-- **4个阶段**: 总计6.5个月开发周期
-- **详细时间线**: 从基础平台到完整上线
-- **风险评估**: 技术、业务、合规风险应对策略
-
-### 📈 扩展规划
-- **功能扩展**: 直播带货、积分商城、会员体系
-- **技术升级**: 微服务架构、AI推荐、大数据分析
-
-
-### 1.1 项目背景
-
-构建一个完整的电商商城平台,支持多端应用,包含商品销售、订单管理、配送服务、优惠券营销等完整电商功能。
-
-### 1.2 系统架构
-
-- **技术栈**: uni-app-x + Supabase + Node.js + Fastify + Kafka
-- **数据库**: PostgreSQL (Supabase)
-- **消息队列**: Apache Kafka
-- **实时通信**: Supabase Realtime
-
-## 2. 客户端应用规划
-
-### 2.1 消费者端 (Consumer App)
-
-**目标用户**: 普通消费者
-
-**主要功能**:
-
-- 用户注册/登录/个人中心
-- 商品浏览、搜索、筛选
-- 购物车管理
-- 订单下单、支付、追踪
-- 优惠券领取和使用
-- 收货地址管理
-- 评价和反馈
-- 客服咨询
-
-### 2.2 商家端 (Merchant App)
-
-**目标用户**: 入驻商家
-
-**主要功能**:
-
-- 商家注册审核
-- 店铺装修和管理
-- 商品上架、编辑、库存管理
-- 订单处理和发货
-- 营销活动创建
-- 数据统计分析
-- 客服管理
-- 财务结算
-
-### 2.3 配送端 (Delivery App)
-
-**目标用户**: 配送员
-
-**主要功能**:
-
-- 配送员注册和认证
-- 接单和路线规划
-- 实时位置追踪
-- 订单状态更新
-- 配送完成确认
-- 收入统计
-- 评价管理
-
-### 2.4 后台管理端 (Admin Panel)
-
-**目标用户**: 平台管理员
-
-**主要功能**:
-
-- 用户管理 (消费者/商家/配送员)
-- 商品审核和分类管理
-- 订单监控和处理
-- 优惠券系统管理
-- 配送网络管理
-- 数据统计和报表
-- 财务管理
-- 系统配置
-
-### 2.5 客服端 (Customer Service App)
-
-**目标用户**: 客服人员
-
-**主要功能**:
-
-- 多渠道客服工作台
-- 实时聊天和消息处理
-- 订单问题处理
-- 退换货处理
-- 投诉和纠纷处理
-- 客户信息查询
-- 服务质量统计
-
-### 2.6 数据分析端 (Analytics Dashboard)
-
-**目标用户**: 运营和分析师
-
-**主要功能**:
-
-- 实时数据大屏
-- 销售数据分析
-- 用户行为分析
-- 商家表现分析
-- 配送效率分析
-- 优惠券效果分析
-- 预测分析和建议
-
-## 3. 核心功能模块
-
-### 3.1 用户管理系统
-
-```sql
--- 用户基础表
-CREATE TABLE users (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- phone VARCHAR(20) UNIQUE NOT NULL,
- email VARCHAR(255) UNIQUE,
- password_hash VARCHAR(255) NOT NULL,
- nickname VARCHAR(100),
- avatar_url TEXT,
- gender INTEGER DEFAULT 0,
- birthday DATE,
- user_type INTEGER NOT NULL DEFAULT 1,
- status INTEGER DEFAULT 1,
- created_at TIMESTAMPTZ DEFAULT NOW(),
- updated_at TIMESTAMPTZ DEFAULT NOW()
-);
-
--- 用户地址表
-CREATE TABLE user_addresses (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- user_id UUID REFERENCES users(id),
- name VARCHAR(100) NOT NULL,
- phone VARCHAR(20) NOT NULL,
- province VARCHAR(50) NOT NULL,
- city VARCHAR(50) NOT NULL,
- district VARCHAR(50) NOT NULL,
- detail_address TEXT NOT NULL,
- is_default BOOLEAN DEFAULT FALSE,
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-```
-
-### 3.2 商家管理系统
-
-```sql
--- 商家信息表
-CREATE TABLE merchants (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- user_id UUID REFERENCES users(id),
- shop_name VARCHAR(200) NOT NULL,
- shop_logo TEXT,
- shop_banner TEXT,
- shop_description TEXT,
- business_license VARCHAR(100),
- contact_name VARCHAR(100),
- contact_phone VARCHAR(20),
- business_hours JSONB,
- shop_status INTEGER DEFAULT 1,
- rating DECIMAL(3,2) DEFAULT 5.0,
- total_sales INTEGER DEFAULT 0,
- created_at TIMESTAMPTZ DEFAULT NOW(),
- updated_at TIMESTAMPTZ DEFAULT NOW()
-);
-```
-
-### 3.3 商品管理系统
-
-```sql
--- 商品分类表
-CREATE TABLE categories (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- name VARCHAR(100) NOT NULL,
- parent_id UUID REFERENCES categories(id),
- icon_url TEXT,
- sort_order INTEGER DEFAULT 0,
- is_active BOOLEAN DEFAULT TRUE,
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-
--- 商品表
-CREATE TABLE products (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- merchant_id UUID REFERENCES merchants(id),
- category_id UUID REFERENCES categories(id),
- name VARCHAR(200) NOT NULL,
- description TEXT,
- images JSONB,
- price DECIMAL(10,2) NOT NULL,
- original_price DECIMAL(10,2),
- stock INTEGER DEFAULT 0,
- sales INTEGER DEFAULT 0,
- status INTEGER DEFAULT 1,
- specifications JSONB,
- attributes JSONB,
- created_at TIMESTAMPTZ DEFAULT NOW(),
- updated_at TIMESTAMPTZ DEFAULT NOW()
-);
-
--- 商品SKU表
-CREATE TABLE product_skus (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- product_id UUID REFERENCES products(id),
- sku_code VARCHAR(100) UNIQUE NOT NULL,
- specifications JSONB,
- price DECIMAL(10,2) NOT NULL,
- stock INTEGER DEFAULT 0,
- image_url TEXT,
- status INTEGER DEFAULT 1,
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-```
-
-### 3.4 购物车系统
-
-```sql
--- 购物车表
-CREATE TABLE shopping_cart (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- user_id UUID REFERENCES users(id),
- product_id UUID REFERENCES products(id),
- sku_id UUID REFERENCES product_skus(id),
- quantity INTEGER NOT NULL DEFAULT 1,
- selected BOOLEAN DEFAULT TRUE,
- created_at TIMESTAMPTZ DEFAULT NOW(),
- updated_at TIMESTAMPTZ DEFAULT NOW(),
- UNIQUE(user_id, sku_id)
-);
-```
-
-## 4. 优惠券系统详细设计
-
-### 4.1 优惠券类型
-
-1. **满减券**: 满X元减Y元
-2. **折扣券**: 享受X折优惠
-3. **免运费券**: 免配送费
-4. **新人券**: 新用户专享
-5. **会员券**: 会员等级专享
-6. **品类券**: 特定商品分类可用
-7. **商家券**: 指定商家可用
-8. **限时券**: 限定时间内使用
-
-### 4.2 优惠券数据模型
-
-```sql
--- 优惠券模板表
-CREATE TABLE coupon_templates (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- name VARCHAR(200) NOT NULL,
- description TEXT,
- coupon_type INTEGER NOT NULL,
- discount_type INTEGER NOT NULL,
- discount_value DECIMAL(10,2) NOT NULL,
- min_order_amount DECIMAL(10,2) DEFAULT 0,
- max_discount_amount DECIMAL(10,2),
- total_quantity INTEGER,
- per_user_limit INTEGER DEFAULT 1,
- usage_limit INTEGER DEFAULT 1,
- merchant_id UUID REFERENCES merchants(id),
- category_ids JSONB,
- product_ids JSONB,
- user_type_limit INTEGER,
- start_time TIMESTAMPTZ NOT NULL,
- end_time TIMESTAMPTZ NOT NULL,
- status INTEGER DEFAULT 1,
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-
--- 用户优惠券表
-CREATE TABLE user_coupons (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- user_id UUID REFERENCES users(id),
- template_id UUID REFERENCES coupon_templates(id),
- coupon_code VARCHAR(50) UNIQUE NOT NULL,
- status INTEGER DEFAULT 1,
- used_at TIMESTAMPTZ,
- order_id UUID,
- received_at TIMESTAMPTZ DEFAULT NOW(),
- expire_at TIMESTAMPTZ NOT NULL
-);
-
--- 优惠券使用记录表
-CREATE TABLE coupon_usage_logs (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- user_coupon_id UUID REFERENCES user_coupons(id),
- order_id UUID NOT NULL,
- discount_amount DECIMAL(10,2) NOT NULL,
- used_at TIMESTAMPTZ DEFAULT NOW()
-);
-```
-
-### 4.3 优惠券发放机制
-
-1. **主动领取**: 用户在优惠券中心领取
-2. **自动发放**: 注册、首单、生日等触发
-3. **活动赠送**: 参与活动获得
-4. **邀请奖励**: 邀请好友注册
-5. **客服赠送**: 客服手动发放
-6. **积分兑换**: 使用积分兑换
-
-## 5. 订单管理系统
-
-### 5.1 订单数据模型
-
-```sql
--- 订单主表
-CREATE TABLE orders (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- order_no VARCHAR(50) UNIQUE NOT NULL,
- user_id UUID REFERENCES users(id),
- merchant_id UUID REFERENCES merchants(id),
- status INTEGER NOT NULL DEFAULT 1,
- total_amount DECIMAL(10,2) NOT NULL,
- discount_amount DECIMAL(10,2) DEFAULT 0,
- delivery_fee DECIMAL(10,2) DEFAULT 0,
- actual_amount DECIMAL(10,2) NOT NULL,
- payment_method INTEGER,
- payment_status INTEGER DEFAULT 1,
- delivery_address JSONB NOT NULL,
- delivery_time TIMESTAMPTZ,
- remark TEXT,
- paid_at TIMESTAMPTZ,
- shipped_at TIMESTAMPTZ,
- delivered_at TIMESTAMPTZ,
- created_at TIMESTAMPTZ DEFAULT NOW(),
- updated_at TIMESTAMPTZ DEFAULT NOW()
-);
-
--- 订单商品表
-CREATE TABLE order_items (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- order_id UUID REFERENCES orders(id),
- product_id UUID REFERENCES products(id),
- sku_id UUID REFERENCES product_skus(id),
- product_name VARCHAR(200) NOT NULL,
- sku_specifications JSONB,
- price DECIMAL(10,2) NOT NULL,
- quantity INTEGER NOT NULL,
- total_amount DECIMAL(10,2) NOT NULL,
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-
--- 订单状态变更记录
-CREATE TABLE order_status_logs (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- order_id UUID REFERENCES orders(id),
- status INTEGER NOT NULL,
- remark TEXT,
- operator_id UUID,
- operator_type INTEGER,
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-```
-
-## 6. 配送系统详细设计
-
-### 6.1 配送员管理
-
-```sql
--- 配送员信息表
-CREATE TABLE delivery_drivers (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- user_id UUID REFERENCES users(id),
- real_name VARCHAR(100) NOT NULL,
- id_card VARCHAR(20) NOT NULL,
- driver_license VARCHAR(50),
- vehicle_type INTEGER NOT NULL,
- vehicle_number VARCHAR(20),
- work_status INTEGER DEFAULT 1,
- current_location POINT,
- service_areas JSONB,
- rating DECIMAL(3,2) DEFAULT 5.0,
- total_orders INTEGER DEFAULT 0,
- auth_status INTEGER DEFAULT 1,
- created_at TIMESTAMPTZ DEFAULT NOW(),
- updated_at TIMESTAMPTZ DEFAULT NOW()
-);
-```
-
-### 6.2 配送订单管理
-
-```sql
--- 配送任务表
-CREATE TABLE delivery_tasks (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- order_id UUID REFERENCES orders(id),
- driver_id UUID REFERENCES delivery_drivers(id),
- pickup_address JSONB NOT NULL,
- delivery_address JSONB NOT NULL,
- distance DECIMAL(8,2),
- estimated_time INTEGER,
- delivery_fee DECIMAL(10,2) NOT NULL,
- status INTEGER DEFAULT 1,
- pickup_time TIMESTAMPTZ,
- delivered_time TIMESTAMPTZ,
- delivery_code VARCHAR(6),
- remark TEXT,
- created_at TIMESTAMPTZ DEFAULT NOW(),
- updated_at TIMESTAMPTZ DEFAULT NOW()
-);
-
--- 配送轨迹表
-CREATE TABLE delivery_tracks (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- task_id UUID REFERENCES delivery_tasks(id),
- driver_id UUID REFERENCES delivery_drivers(id),
- location POINT NOT NULL,
- address_description TEXT,
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-```
-
-### 6.3 配送费计算规则
-
-```sql
--- 配送费规则表
-CREATE TABLE delivery_fee_rules (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- name VARCHAR(100) NOT NULL,
- base_fee DECIMAL(10,2) NOT NULL,
- base_distance DECIMAL(5,2) NOT NULL,
- additional_fee_per_km DECIMAL(10,2) NOT NULL,
- time_multiplier JSONB,
- weather_multiplier DECIMAL(3,2) DEFAULT 1.0,
- min_fee DECIMAL(10,2) NOT NULL,
- max_fee DECIMAL(10,2),
- service_areas JSONB,
- is_active BOOLEAN DEFAULT TRUE,
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-```
-
-### 6.4 智能配送调度
-
-**调度算法要素**:
-
-1. **距离优先**: 就近分配配送员
-2. **实时位置**: 基于GPS实时位置
-3. **负载均衡**: 考虑配送员当前订单数
-4. **时效要求**: 优先处理紧急订单
-5. **用户评价**: 优先分配高评分配送员
-6. **区域熟悉度**: 优先分配熟悉区域的配送员
-
-## 7. 支付系统
-
-### 7.1 支付方式
-
-- 微信支付
-- 支付宝
-- 银联云闪付
-- 平台余额支付
-- 优惠券抵扣
-
-### 7.2 支付数据模型
-
-```sql
--- 支付记录表
-CREATE TABLE payments (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- payment_no VARCHAR(50) UNIQUE NOT NULL,
- order_id UUID REFERENCES orders(id),
- user_id UUID REFERENCES users(id),
- payment_method INTEGER NOT NULL,
- amount DECIMAL(10,2) NOT NULL,
- status INTEGER DEFAULT 1,
- third_party_no VARCHAR(100),
- paid_at TIMESTAMPTZ,
- refunded_at TIMESTAMPTZ,
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-
--- 退款记录表
-CREATE TABLE refunds (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- refund_no VARCHAR(50) UNIQUE NOT NULL,
- payment_id UUID REFERENCES payments(id),
- order_id UUID REFERENCES orders(id),
- amount DECIMAL(10,2) NOT NULL,
- reason TEXT,
- status INTEGER DEFAULT 1,
- operator_id UUID,
- refunded_at TIMESTAMPTZ,
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-```
-
-## 8. 评价系统
-
-### 8.1 评价数据模型
-
-```sql
--- 评价表
-CREATE TABLE reviews (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- order_id UUID REFERENCES orders(id),
- user_id UUID REFERENCES users(id),
- merchant_id UUID REFERENCES merchants(id),
- product_id UUID REFERENCES products(id),
- driver_id UUID REFERENCES delivery_drivers(id),
- rating INTEGER NOT NULL CHECK (rating >= 1 AND rating <= 5),
- content TEXT,
- images JSONB,
- reply_content TEXT,
- reply_time TIMESTAMPTZ,
- is_anonymous BOOLEAN DEFAULT FALSE,
- status INTEGER DEFAULT 1,
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-```
-
-## 9. 消息通知系统
-
-### 9.1 消息类型
-
-- 订单状态变更通知
-- 优惠券到期提醒
-- 配送进度通知
-- 营销活动推送
-- 系统公告
-
-### 9.2 消息数据模型
-
-```sql
--- 消息模板表
-CREATE TABLE message_templates (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- name VARCHAR(100) NOT NULL,
- type INTEGER NOT NULL,
- title VARCHAR(200) NOT NULL,
- content TEXT NOT NULL,
- push_channels JSONB,
- is_active BOOLEAN DEFAULT TRUE,
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-
--- 用户消息表
-CREATE TABLE user_messages (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- user_id UUID REFERENCES users(id),
- template_id UUID REFERENCES message_templates(id),
- title VARCHAR(200) NOT NULL,
- content TEXT NOT NULL,
- type INTEGER NOT NULL,
- is_read BOOLEAN DEFAULT FALSE,
- extra_data JSONB,
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-```
-
-## 10. 数据统计分析
-
-### 10.1 统计指标
-
-**运营指标**:
-
-- GMV(成交总额)
-- 订单量和转化率
-- 用户活跃度
-- 客单价
-- 复购率
-
-**商家指标**:
-
-- 销售额和利润
-- 商品销量排行
-- 评价和服务质量
-- 库存周转率
-
-**配送指标**:
-
-- 配送时效
-- 配送费用
-- 配送员效率
-- 客户满意度
-
-### 10.2 统计数据模型
-
-```sql
--- 日常统计表
-CREATE TABLE daily_statistics (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- stat_date DATE NOT NULL,
- merchant_id UUID REFERENCES merchants(id),
- total_orders INTEGER DEFAULT 0,
- total_amount DECIMAL(12,2) DEFAULT 0,
- total_users INTEGER DEFAULT 0,
- new_users INTEGER DEFAULT 0,
- total_products INTEGER DEFAULT 0,
- avg_order_amount DECIMAL(10,2) DEFAULT 0,
- created_at TIMESTAMPTZ DEFAULT NOW(),
- UNIQUE(stat_date, merchant_id)
-);
-```
-
-## 11. API接口设计
-
-### 11.1 RESTful API规范
-
-```http
-GET /api/v1/products # 获取商品列表
-POST /api/v1/products # 创建商品
-GET /api/v1/products/:id # 获取商品详情
-PUT /api/v1/products/:id # 更新商品
-DELETE /api/v1/products/:id # 删除商品
-
-GET /api/v1/orders # 获取订单列表
-POST /api/v1/orders # 创建订单
-GET /api/v1/orders/:id # 获取订单详情
-PUT /api/v1/orders/:id/status # 更新订单状态
-
-GET /api/v1/coupons # 获取优惠券列表
-POST /api/v1/coupons/receive # 领取优惠券
-GET /api/v1/coupons/my # 我的优惠券
-```
-
-### 11.2 实时推送接口
-
-```text
-# Supabase Realtime Channels
-orders:user_id={user_id} # 用户订单状态推送
-delivery:task_id={task_id} # 配送进度推送
-messages:user_id={user_id} # 消息通知推送
-```
-
-## 12. 技术实现要点
-
-### 12.1 前端技术栈 (uni-app-x)
-
-- **组件库**: 自定义UI组件库
-- **状态管理**: Pinia
-- **路由管理**: uni-app页面路由
-- **网络请求**: 封装的请求库
-- **实时通信**: Supabase Realtime
-- **地图服务**: 高德地图/百度地图
-- **支付集成**: 微信支付/支付宝SDK
-
-### 12.2 后端技术栈
-
-```javascript
-// Fastify服务器配置
-const fastify = require('fastify')({ logger: true });
-
-// 注册插件
-await fastify.register(require('@fastify/cors'));
-await fastify.register(require('@fastify/jwt'));
-await fastify.register(require('@fastify/rate-limit'));
-
-// 数据库连接
-const { createClient } = require('@supabase/supabase-js');
-const supabase = createClient(process.env.SUPABASE_URL, process.env.SUPABASE_ANON_KEY);
-
-// Kafka配置
-const kafka = require('kafkajs').kafka({
- clientId: 'mall-app',
- brokers: [process.env.KAFKA_BROKER]
-});
-```
-
-### 12.3 数据库优化
-
-- 建立合适的索引
-- 分区存储大表
-- 读写分离
-- 缓存热点数据
-
-### 12.4 安全措施
-
-- JWT身份认证
-- API接口限流
-- 数据加密传输
-- 敏感信息脱敏
-- 权限控制
-
-## 13. 项目实施计划
-
-### 13.1 第一阶段 (2个月) - 基础平台
-
-- [ ] 用户系统 (注册/登录/权限)
-- [ ] 商品管理系统
-- [ ] 基础订单流程
-- [ ] 支付系统集成
-- [ ] 后台管理基础功能
-
-### 13.2 第二阶段 (1.5个月) - 营销功能
-
-- [ ] 优惠券系统完整实现
-- [ ] 购物车优化
-- [ ] 商家端完整功能
-- [ ] 消息通知系统
-- [ ] 评价系统
-
-### 13.3 第三阶段 (2个月) - 配送系统
-
-- [ ] 配送员管理
-- [ ] 智能配送调度
-- [ ] 实时位置追踪
-- [ ] 配送费用计算
-- [ ] 配送端App完整功能
-
-### 13.4 第四阶段 (1个月) - 优化完善
-
-- [ ] 数据统计分析
-- [ ] 性能优化
-- [ ] 压力测试
-- [ ] 客服系统
-- [ ] 上线部署
-
-## 14. 风险评估与应对
-
-### 14.1 技术风险
-
-- **并发处理**: 使用Kafka消息队列处理高并发
-- **数据一致性**: 采用事务和分布式锁
-- **系统可用性**: 服务熔断和降级策略
-
-### 14.2 业务风险
-
-- **支付安全**: 严格的支付流程和风控
-- **库存管理**: 实时库存同步机制
-- **配送时效**: 智能调度和应急预案
-
-### 14.3 合规风险
-
-- **数据隐私**: 遵循数据保护法规
-- **电商资质**: 确保平台运营资质
-- **税务合规**: 完善的财务和税务系统
-
-## 15. 后续扩展规划
-
-### 15.1 功能扩展
-
-- 直播带货功能
-- 团购/秒杀活动
-- 积分商城
-- 会员体系
-- 供应链管理
-
-### 15.2 技术扩展
-
-- 微服务架构升级
-- 人工智能推荐
-- 大数据分析平台
-- 多租户支持
-- 国际化支持
-
----
-
-**文档版本**: v1.0
-**更新时间**: 2025年6月8日
-**负责人**: 开发团队
-**审核人**: 产品经理
-
-## 16. NFC校园应用扩展模块
-
-### 16.1 项目整合架构
-
-**统一用户系统**:
-- 复用mall项目的users表作为基础用户表
-- 扩展school_users表存储校园特有信息
-- 统一认证和权限管理
-
-**模块化设计**:
-```
-mall-project/
-├── modules/
-│ ├── ecommerce/ # 电商模块
-│ ├── nfc-campus/ # NFC校园模块
-│ └── shared/ # 共享模块
-├── database/
-│ ├── ecommerce.sql # 电商相关表
-│ ├── nfc.sql # NFC相关表
-│ └── shared.sql # 共享表(users等)
-└── api/
- ├── ecommerce/ # 电商API
- ├── nfc/ # NFC API
- └── auth/ # 统一认证API
-```
-
-### 16.2 统一用户数据模型
-
-```sql
--- 扩展现有users表,支持多种用户类型
-ALTER TABLE users ADD COLUMN user_types JSONB DEFAULT '[]'; -- 用户可以有多种类型
-ALTER TABLE users ADD COLUMN school_info JSONB; -- 学校相关信息
-ALTER TABLE users ADD COLUMN parent_id UUID REFERENCES users(id); -- 家长关联
-
--- 学校用户扩展表(复用users表)
-CREATE TABLE school_user_profiles (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- user_id UUID REFERENCES users(id) UNIQUE,
- student_number VARCHAR(20) UNIQUE, -- 学号/工号
- department VARCHAR(100), -- 院系/部门
- class_grade VARCHAR(50), -- 班级/年级
- school_user_type INTEGER NOT NULL, -- 1:学生 2:教师 3:员工 4:家长
- enrollment_date DATE, -- 入学/入职日期
- graduation_date DATE, -- 毕业/离职日期
- emergency_contact JSONB, -- 紧急联系人信息
- medical_info JSONB, -- 健康信息(可选)
- created_at TIMESTAMPTZ DEFAULT NOW(),
- updated_at TIMESTAMPTZ DEFAULT NOW()
-);
-
--- NFC卡片关联到统一用户系统
-CREATE TABLE nfc_cards (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- card_number VARCHAR(32) UNIQUE NOT NULL,
- user_id UUID REFERENCES users(id), -- 关联到统一用户表
- card_type INTEGER NOT NULL DEFAULT 1,
- balance DECIMAL(10,2) DEFAULT 0.00,
- status INTEGER DEFAULT 1,
- daily_limit DECIMAL(10,2) DEFAULT 100.00,
- expire_date DATE,
- created_at TIMESTAMPTZ DEFAULT NOW(),
- updated_at TIMESTAMPTZ DEFAULT NOW()
-);
-```
-
-### 16.3 业务场景整合
-
-**电商+校园场景结合**:
-
-1. **校园电商** - 学生可在校园商城购买学习用品、生活用品
-2. **家长代付** - 家长为孩子的电商订单和NFC充值代付
-3. **积分互通** - 电商积分可用于NFC消费,NFC消费获得电商积分
-4. **统一钱包** - 电商余额和NFC余额统一管理
-5. **数据分析** - 综合分析学生消费行为(线上+线下)
-
-### 16.4 扩展应用架构
-
-```javascript
-// 统一的应用入口配置
-const appModules = {
- ecommerce: {
- enabled: true,
- routes: '/mall/*',
- permissions: ['consumer', 'merchant', 'admin']
- },
- nfcCampus: {
- enabled: true,
- routes: '/campus/*',
- permissions: ['student', 'teacher', 'parent', 'canteen', 'admin']
- },
- unified: {
- enabled: true,
- routes: '/user/*',
- permissions: ['all']
- }
-}
-
-// 统一权限管理
-const permissions = {
- // 电商权限
- 'ecommerce.consumer': '电商消费者',
- 'ecommerce.merchant': '电商商家',
- 'ecommerce.delivery': '电商配送员',
-
- // 校园权限
- 'campus.student': '学生',
- 'campus.teacher': '教师',
- 'campus.parent': '家长',
- 'campus.canteen': '餐厅商户',
- 'campus.librarian': '图书管理员',
-
- // 统一权限
- 'system.admin': '系统管理员',
- 'finance.manager': '财务管理员'
-}
-```
-
-### 16.5 移动端应用架构
-
-**统一App方案**:
-```
-Mall+ App (超级应用)
-├── 首页 (根据用户类型显示不同内容)
-├── 电商模块
-│ ├── 商品浏览
-│ ├── 购物车
-│ └── 订单管理
-├── 校园模块
-│ ├── NFC钱包
-│ ├── 门禁权限
-│ ├── 消费记录
-│ └── 图书借阅
-├── 统一功能
-│ ├── 用户中心
-│ ├── 消息通知
-│ ├── 客服支持
-│ └── 设置
-└── 家长专区 (仅家长可见)
- ├── 孩子监控
- ├── 代付充值
- └── 消费分析
-```
-
-**多端应用策略**:
-- **消费者端**: 电商功能 + 学生校园功能
-- **商户端**: 电商商户 + 校园商户(餐厅/小卖部)
-- **管理端**: 统一管理电商和校园业务
-- **家长端**: 专门的家长监控和代付功能
-
-### 16.6 技术栈统一
-
-**前端技术栈**:
-- **框架**: uni-app-x (支持多端)
-- **状态管理**: Pinia (模块化状态管理)
-- **UI组件**: 统一设计系统
-- **路由**: 模块化路由配置
-
-**后端技术栈**:
-- **框架**: Node.js + Fastify (复用现有)
-- **数据库**: PostgreSQL + Supabase (扩展表结构)
-- **缓存**: Redis (共享缓存)
-- **消息队列**: Kafka (处理电商+NFC交易)
-
-### 16.7 数据库整合方案
-
-```sql
--- 统一订单系统(支持电商订单和NFC消费)
-CREATE TABLE unified_orders (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- order_no VARCHAR(50) UNIQUE NOT NULL,
- order_type INTEGER NOT NULL, -- 1:电商订单 2:NFC消费 3:充值订单
- user_id UUID REFERENCES users(id),
- amount DECIMAL(10,2) NOT NULL,
- status INTEGER NOT NULL,
- payment_method INTEGER,
-
- -- 电商订单特有字段
- merchant_id UUID REFERENCES merchants(id),
- delivery_address JSONB,
- delivery_fee DECIMAL(10,2) DEFAULT 0,
-
- -- NFC消费特有字段
- terminal_id VARCHAR(50),
- location VARCHAR(200),
- card_id UUID REFERENCES nfc_cards(id),
-
- -- 通用字段
- extra_data JSONB, -- 存储特殊数据
- created_at TIMESTAMPTZ DEFAULT NOW(),
- updated_at TIMESTAMPTZ DEFAULT NOW()
-);
-
--- 统一钱包系统
-CREATE TABLE unified_wallets (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- user_id UUID REFERENCES users(id) UNIQUE,
- ecommerce_balance DECIMAL(10,2) DEFAULT 0.00, -- 电商余额
- nfc_balance DECIMAL(10,2) DEFAULT 0.00, -- NFC余额
- points_balance INTEGER DEFAULT 0, -- 积分余额
- frozen_amount DECIMAL(10,2) DEFAULT 0.00, -- 冻结金额
- total_recharge DECIMAL(12,2) DEFAULT 0.00, -- 累计充值
- total_consume DECIMAL(12,2) DEFAULT 0.00, -- 累计消费
- created_at TIMESTAMPTZ DEFAULT NOW(),
- updated_at TIMESTAMPTZ DEFAULT NOW()
-);
-
--- 统一消息系统
-CREATE TABLE unified_messages (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- user_id UUID REFERENCES users(id),
- message_type INTEGER NOT NULL, -- 1:电商 2:校园 3:系统
- business_type INTEGER NOT NULL, -- 具体业务类型
- title VARCHAR(200) NOT NULL,
- content TEXT NOT NULL,
- is_read BOOLEAN DEFAULT FALSE,
- extra_data JSONB,
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-```
-
-### 16.8 实施计划调整
-
-**整合开发计划 (5个月)**:
-
-**第一阶段 (1个月) - 用户系统整合**:
-- [ ] 扩展现有users表支持多用户类型
-- [ ] 创建school_user_profiles表
-- [ ] 统一认证和权限系统
-- [ ] 数据迁移和兼容性测试
-
-**第二阶段 (1.5个月) - NFC核心功能**:
-- [ ] NFC卡片管理系统
-- [ ] 基础消费功能
-- [ ] 充值系统整合
-- [ ] 门禁管理基础功能
-
-**第三阶段 (1.5个月) - 业务场景实现**:
-- [ ] 饭堂消费系统
-- [ ] 小卖部购物系统
-- [ ] 完整门禁管理
-- [ ] 图书借阅系统
-
-**第四阶段 (1个月) - 整合优化**:
-- [ ] 统一移动端App开发
-- [ ] 电商+校园业务整合
-- [ ] 数据分析和报表
-- [ ] 性能优化和测试
-
-### 16.9 成本效益分析
-
-**整合方案 vs 独立项目**:
-
-| 项目 | 整合方案 | 独立项目 |
-|------|---------|----------|
-| 开发成本 | 60% | 100% |
-| 维护成本 | 40% | 100% |
-| 用户体验 | 更好(统一) | 一般(分散) |
-| 数据价值 | 更高(整合) | 较低(孤立) |
-| 业务协同 | 强 | 弱 |
-
-**节省成本**:
-- 用户系统复用: 节省40万开发成本
-- 基础设施共享: 节省每年50万运维成本
-- 统一维护: 节省30%人力成本
-- 业务协同: 预期增加20%业务收入
-
-### 16.10 风险控制
-
-**技术风险**:
-- **模块耦合**: 采用微服务架构,模块间松耦合
-- **性能影响**: 数据库分表分库,缓存优化
-- **系统复杂度**: 完善的文档和测试覆盖
-
-**业务风险**:
-- **权限混乱**: 严格的权限隔离和审计
-- **数据安全**: 按模块进行数据加密和访问控制
-- **用户体验**: 模块化UI设计,按用户类型展示
-
-## 🎯 结论
-
-**强烈推荐采用整合方案**,将NFC校园应用作为Mall项目的一个核心模块来开发。这样不仅能最大化复用现有资源,还能创造出更强的业务协同效应,为未来的扩展奠定坚实基础。
-
-整合后的项目将成为一个**校园+电商超级平台**,覆盖学生的学习、生活、消费全场景,具有更大的商业价值和发展潜力!
diff --git a/mall/pages/mall/merchant/index.uvue b/mall/pages/mall/merchant/index.uvue
deleted file mode 100644
index e1a3a7a6..00000000
--- a/mall/pages/mall/merchant/index.uvue
+++ /dev/null
@@ -1,677 +0,0 @@
-
-
-
-
-
-
-
-
- 今日数据
-
-
- {{ todayStats.orders }}
- 订单数
-
-
- ¥{{ todayStats.sales }}
- 销售额
-
-
- {{ todayStats.visitors }}
- 访客数
-
-
- {{ todayStats.conversion }}
- 转化率
-
-
-
-
-
-
- 待处理
-
-
- 📦
- 待发货订单
- {{ pendingCounts.pending_shipment }}
-
-
- ↩️
- 退款处理
- {{ pendingCounts.refund_requests }}
-
-
- ⚠️
- 库存预警
- {{ pendingCounts.low_stock }}
-
-
- 💬
- 待回复评价
- {{ pendingCounts.pending_reviews }}
-
-
-
-
-
-
- 快捷功能
-
-
- ➕
- 添加商品
-
-
- 📋
- 订单管理
-
-
- 📦
- 商品管理
-
-
- 🎯
- 营销活动
-
-
- 📊
- 数据统计
-
-
- 💰
- 财务结算
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.product_name }}
- {{ item.sku_specifications || '' }}
- ¥{{ item.price }} × {{ item.quantity }}
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/mall/pages/mall/merchant/product-detail.uvue b/mall/pages/mall/merchant/product-detail.uvue
deleted file mode 100644
index 577b0987..00000000
--- a/mall/pages/mall/merchant/product-detail.uvue
+++ /dev/null
@@ -1,707 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- +
-
-
-
-
-
- 商品名称
- {{ product.name }}
-
-
- 商品描述
- {{ product.description || '暂无描述' }}
-
-
- 商品价格
- ¥{{ product.price }}
-
-
- 原价
- ¥{{ product.original_price || '未设置' }}
-
-
- 库存数量
- {{ product.stock }}件
-
-
- 销量
- {{ product.sales }}件
-
-
- 商品状态
-
- {{ product.status === 1 ? '上架' : '下架' }}
-
-
-
-
-
-
-
-
-
-
- 暂无规格,点击添加规格
-
-
-
-
- {{ sku.sku_code }}
- {{ getSkuSpecText(sku) }}
-
-
- ¥{{ sku.price }}
- 库存: {{ sku.stock }}
-
- {{ sku.status === 1 ? '启用' : '禁用' }}
-
-
-
- 编辑
- 删除
-
-
-
-
-
-
-
-
-
-
- {{ salesData.today_sales }}
- 今日销量
-
-
- {{ salesData.week_sales }}
- 本周销量
-
-
- {{ salesData.month_sales }}
- 本月销量
-
-
- ¥{{ salesData.total_revenue }}
- 总收入
-
-
-
-
-
-
-
-
-
-
- {{ reviewData.average_rating.toFixed(1) }}
-
- ★
-
- {{ reviewData.total_reviews }}条评价
-
-
-
-
-
-
- {{ review.content }}
- {{ formatTime(review.created_at) }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/mall/pages/mall/merchant/profile.uvue b/mall/pages/mall/merchant/profile.uvue
deleted file mode 100644
index c7932f25..00000000
--- a/mall/pages/mall/merchant/profile.uvue
+++ /dev/null
@@ -1,761 +0,0 @@
-
-
-
-
-
-
-
-
- 订单管理
-
-
- 📋
- 全部订单
- {{ orderCounts.total }}
-
-
- 💰
- 待发货
- {{ orderCounts.pending }}
-
-
- 🚚
- 已发货
- {{ orderCounts.shipped }}
-
-
- ↩️
- 退款
- {{ orderCounts.refund }}
-
-
-
-
-
-
- 今日经营
-
-
- ¥{{ todayStats.revenue }}
- 营业额
-
-
- {{ todayStats.orders }}
- 订单数
-
-
- {{ todayStats.visitors }}
- 访客数
-
-
- {{ todayStats.conversion }}%
- 转化率
-
-
-
-
-
-
-
-
-
-
-
- ¥{{ order.actual_amount }}
- {{ formatTime(order.created_at) }}
-
-
-
-
- 暂无最近订单
-
-
-
-
-
- 商品管理
-
-
- 📦
- 商品管理
- {{ productStats.total }}
-
-
- 📊
- 库存管理
- {{ productStats.lowStock }}
-
-
- 🎉
- 促销活动
- {{ promotionStats.active }}
-
-
- ⭐
- 评价管理
- {{ reviewStats.pending }}
-
-
-
-
-
-
-
-
-
- 本周销售趋势
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/mall/pages/mall/nfc/admin/index.uvue b/mall/pages/mall/nfc/admin/index.uvue
deleted file mode 100644
index 7c0cf32c..00000000
--- a/mall/pages/mall/nfc/admin/index.uvue
+++ /dev/null
@@ -1,837 +0,0 @@
-
-
-
-
-
-
-
-
-
- {{ statsData.totalUsers }}
- 总用户数
- +{{ statsData.userGrowth }}%
-
-
-
-
-
-
-
-
- {{ statsData.todayTransactions }}
- 今日交易
-
- {{ statsData.transactionGrowth > 0 ? '+' : '' }}{{ statsData.transactionGrowth }}%
-
-
-
-
-
-
-
-
-
- ¥{{ statsData.todayRevenue }}
- 今日营收
- +{{ statsData.revenueGrowth }}%
-
-
-
-
-
-
-
-
- {{ statsData.onlineDevices }}/{{ statsData.totalDevices }}
- 在线设备
-
- {{ (100 - deviceOfflineRate).toFixed(1) }}%
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ service.name }}
-
-
- CPU: {{ service.cpu }}%
- 内存: {{ service.memory }}%
- 响应: {{ service.responseTime }}ms
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ alert.title }}
- {{ alert.description }}
- {{ formatTime(alert.time) }}
-
-
-
-
-
-
-
-
-
-
- 快速操作
-
-
-
- 用户管理
-
-
-
- 卡片管理
-
-
-
- 财务管理
-
-
-
- 设备管理
-
-
-
- 数据报表
-
-
-
- 系统配置
-
-
-
- 安全监控
-
-
-
- 应急控制
-
-
-
-
-
-
- 数据概览
-
-
-
-
-
-
-
-
- 消费分布
-
-
-
- 设备状态
-
-
-
-
-
-
-
- 系统信息
-
-
- 系统版本
- v2.1.0
-
-
- 数据库
- PostgreSQL 14.2
-
-
- 在线时长
- {{ systemUptime }}
-
-
- 存储使用
- {{ storageUsage }}%
-
-
-
-
-
-
-
-
-
diff --git a/mall/pages/mall/nfc/librarian/index.uvue b/mall/pages/mall/nfc/librarian/index.uvue
deleted file mode 100644
index 8b894cc0..00000000
--- a/mall/pages/mall/nfc/librarian/index.uvue
+++ /dev/null
@@ -1,1251 +0,0 @@
-
-
-
-
-
-
-
- 图书馆状态
-
-
- {{ libraryData.currentReaders }}
- 在馆人数
-
-
- {{ libraryData.availableSeats }}
- 可用座位
-
-
- {{ libraryData.todayBorrows }}
- 今日借阅
-
-
- {{ libraryData.todayReturns }}
- 今日归还
-
-
-
-
-
-
- 快速操作
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ task.title }}
- {{ task.description }}
- {{ formatTime(task.createTime) }}
-
-
-
-
-
-
-
-
- 借阅统计
-
- 今日
- 本周
- 本月
-
-
-
-
-
-
-
- {{ item.label }}
- {{ item.value }}
-
-
-
-
-
-
-
-
-
-
-
-
- {{ book.title }}
- {{ book.author }}
-
-
- 借阅
- {{ book.borrowCount }}
-
-
- 库存
- {{ book.available }}/{{ book.total }}
-
-
-
-
-
-
-
-
-
-
- 最近活动
-
-
-
- {{ formatActivityTime(activity.time) }}
-
-
- 《{{ activity.bookTitle }}》
-
- {{ activity.details }}
-
-
-
-
-
-
-
-
- 管理功能
-
-
-
- 图书目录
-
-
-
-
- 读者管理
-
-
-
-
- 逾期管理
-
- {{ overdueCount }}
-
-
-
-
-
- 预约管理
-
- {{ reservationCount }}
-
-
-
-
-
- 库存管理
-
-
-
-
- 门禁管理
-
-
-
-
- 数据报表
-
-
-
-
- 系统设置
-
-
-
-
-
-
-
-
-
-
- {{ floor.name }}
-
-
-
-
-
- {{ currentFloorData.total }}
- 总座位
-
-
- {{ currentFloorData.occupied }}
- 已占用
-
-
- {{ currentFloorData.available }}
- 可用
-
-
- {{ currentFloorData.reserved }}
- 已预约
-
-
-
-
-
-
- 系统通知
-
-
-
-
-
-
- {{ notification.title }}
- {{ notification.message }}
-
- {{ formatTime(notification.time) }}
-
-
-
-
-
-
-
-
-
diff --git a/mall/pages/mall/nfc/merchant/pos-cashier.uvue b/mall/pages/mall/nfc/merchant/pos-cashier.uvue
deleted file mode 100644
index d76c8c20..00000000
--- a/mall/pages/mall/nfc/merchant/pos-cashier.uvue
+++ /dev/null
@@ -1,857 +0,0 @@
-
-
-
-
-
- 终端: {{ terminalInfo.id }}
- {{ terminalInfo.merchantName }}
-
-
-
- NFC
-
-
- 网络
-
-
-
-
-
-
-
-
-
-
- {{ item.name }}
- {{ item.spec }}
-
-
-
- {{ item.quantity }}
-
-
-
- ¥{{ item.price.toFixed(2) }}
- ¥{{ (item.price * item.quantity).toFixed(2) }}
-
-
-
-
-
- 暂无商品,请扫码或手动添加
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 共{{ totalQuantity }}件商品
-
-
- 总计:
- ¥{{ totalAmount.toFixed(2) }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 请顾客将校园卡或手机靠近读卡器
- 支付金额: ¥{{ totalAmount.toFixed(2) }}
-
-
-
-
-
-
-
-
- 支付成功
- ¥{{ lastTransaction.amount }}
-
- 订单号: {{ lastTransaction.orderNo }}
- 支付方式: {{ lastTransaction.paymentMethod }}
- 交易时间: {{ formatTime(lastTransaction.time) }}
-
-
-
-
-
-
-
-
-
-
diff --git a/mall/pages/mall/nfc/nfc-modules-guide.md b/mall/pages/mall/nfc/nfc-modules-guide.md
deleted file mode 100644
index 147c419e..00000000
--- a/mall/pages/mall/nfc/nfc-modules-guide.md
+++ /dev/null
@@ -1,142 +0,0 @@
-# NFC校园系统身份模块功能说明
-
-## 📋 身份模块概览
-
-为NFC校园系统设计了7个身份模块,每个模块功能周全但操作简单,确保各类用户都能高效使用系统。
-
-## 🎓 学生端 (pages-student.json)
-
-### 核心功能
-- **校园卡管理**: 余额查询、充值、卡片状态
-- **消费服务**: 饭堂点餐、小卖部购物、NFC/扫码支付
-- **校园生活**: 图书借阅、进出记录、营养分析
-- **便民功能**: 付款码、交易记录、帮助中心
-
-### 特色设计
-- 蓝色主题色调,符合学生群体审美
-- 4个主要Tab:首页、饭堂、校园卡、记录
-- 支持NFC快速支付和二维码备用支付
-
-## 👨👩👧👦 家长端 (pages-parent.json)
-
-### 核心功能
-- **孩子监控**: 多个孩子管理、消费监控、进出提醒
-- **财务管理**: 代充值、消费限额设置、月度报告
-- **健康关怀**: 营养报告、用餐分析、健康建议
-- **安全保障**: 紧急联系、异常告警、位置提醒
-
-### 特色设计
-- 橙色温馨主题,体现家长关爱
-- 重点突出监控和营养功能
-- 简化操作流程,适合各年龄段家长
-
-## 👨🏫 教师端 (pages-teacher.json)
-
-### 核心功能
-- **学生管理**: 班级学生、消费统计、考勤管理
-- **教学辅助**: 图书管理、访客审批、权限管理
-- **数据分析**: 班级报告、消费趋势、出勤统计
-- **应急功能**: 紧急开门、消息通知、安全管理
-
-### 特色设计
-- 绿色专业主题,体现教育工作者形象
-- 工作台式设计,功能分类清晰
-- 突出数据分析和班级管理
-
-## 🏪 商户端 (pages-merchant.json)
-
-### 核心功能
-- **收银管理**: POS收银台、菜品/商品管理、库存控制
-- **营销推广**: 促销活动、顾客分析、会员管理
-- **数据统计**: 销售分析、财务报表、日结算
-- **设备维护**: 设备状态监控、故障报修
-
-### 特色设计
-- 橙色商业主题,突出商业属性
-- 收银功能优先级最高
-- 数据可视化展示,便于经营决策
-
-## 🛡️ 管理员端 (pages-admin.json)
-
-### 核心功能
-- **系统管理**: 用户管理、卡片管理、商户管理
-- **设备管控**: 设备管理、门禁控制、安全监控
-- **财务监管**: 资金管理、财务报表、风险控制
-- **应急处理**: 应急控制、操作日志、系统配置
-
-### 特色设计
-- 红色权威主题,体现管理权限
-- 功能最全面,权限最高
-- 突出安全和财务管理
-
-## 🔒 安保端 (pages-security.json)
-
-### 核心功能
-- **安全监控**: 实时监控、门禁日志、访客管理
-- **应急响应**: 紧急告警、事件报告、应急处置
-- **巡逻管理**: 巡逻路线、值班安排、设备检查
-- **通信协调**: 对讲通信、监控调度、手动控制
-
-### 特色设计
-- 紫色安全主题,突出安保职能
-- 实时性要求高,支持快速响应
-- 告警功能突出,便于及时处理
-
-## 📚 图书管理员端 (pages-librarian.json)
-
-### 核心功能
-- **图书管理**: 图书入库、分类管理、检索查询
-- **借还服务**: 借阅办理、归还处理、续借管理
-- **读者服务**: 读者管理、逾期处理、预约服务
-- **数据统计**: 借阅统计、热门图书、阅读推广
-
-### 特色设计
-- 青绿色文化主题,体现知识属性
-- 服务功能优先,操作流程简化
-- 突出数据统计和阅读推广
-
-## 🎨 设计原则
-
-### 功能设计原则
-1. **角色专业化**: 每个身份模块针对特定工作场景设计
-2. **操作简化**: 常用功能不超过3步操作
-3. **权限分离**: 严格按照角色权限设计功能边界
-4. **数据安全**: 敏感操作需要二次确认
-
-### 界面设计原则
-1. **色彩区分**: 每个身份使用不同主题色
-2. **布局统一**: 采用底部Tab + 顶部导航的统一结构
-3. **图标语义**: 功能图标具有明确的语义化含义
-4. **响应式**: 适配不同屏幕尺寸和设备
-
-### 用户体验原则
-1. **学习成本低**: 界面直观,功能归类合理
-2. **操作效率高**: 高频功能放在显著位置
-3. **容错性强**: 重要操作有确认和撤销机制
-4. **反馈及时**: 操作结果实时反馈给用户
-
-## 🔗 模块间协作
-
-### 数据共享
-- 统一用户身份系统
-- 共享NFC卡片数据
-- 统一交易记录
-- 共享设备状态
-
-### 权限管理
-- 基于角色的权限控制(RBAC)
-- 数据访问范围限制
-- 操作审计日志
-- 敏感功能多重验证
-
-### 业务协同
-- 学生消费 → 商户收入 → 财务结算
-- 门禁记录 → 安保监控 → 家长提醒
-- 图书借阅 → 逾期管理 → 费用扣除
-- 设备故障 → 维修申请 → 状态更新
-
----
-
-**设计目标**: 构建一个功能完整、操作简单、安全可靠的校园NFC生态系统
-**技术特点**: 模块化设计、权限分离、数据共享、安全优先
-**用户价值**: 提升校园生活便利性,增强安全管理水平,优化运营效率
diff --git a/mall/pages/mall/nfc/nfc.md b/mall/pages/mall/nfc/nfc.md
deleted file mode 100644
index 9eab57d8..00000000
--- a/mall/pages/mall/nfc/nfc.md
+++ /dev/null
@@ -1,1174 +0,0 @@
-# NFC校园应用系统完整需求文档
-
-## 1. 项目概述
-
-### 📋 文档内容概览
-
-### 🎯 核心特性
-- **4个应用场景**: 饭堂消费、小卖部购物、门禁管理、图书借阅
-- **3种支付方式**: NFC卡片、手机NFC、二维码扫码
-- **完整管理系统**: 卡片管理、消费记录、充值系统、权限控制
-- **多端应用**: 学生端、商户端、管理端、家长端
-
-### 🗄️ 数据库设计
-- **12+核心数据表**: NFC卡片、消费记录、门禁日志、充值记录等
-- **完整SQL建表语句**: 每个表都包含详细字段定义
-- **安全设计**: 加密存储、权限控制、交易验证
-
-### 🛠️ 技术栈
-- **前端**: uni-app-x + NFC API + 自定义组件
-- **后端**: Node.js + Fastify + Redis
-- **数据库**: PostgreSQL (Supabase)
-- **硬件集成**: NFC读卡器、门禁设备、POS机
-- **安全**: AES加密、数字签名、防重放攻击
-
-### 🚀 实施计划
-- **3个阶段**: 总计4个月开发周期
-- **详细时间线**: 从基础NFC到完整校园应用
-- **硬件配置**: NFC设备选型和部署方案
-
-### 📈 扩展规划
-- **功能扩展**: 考勤打卡、健康码、停车管理
-- **技术升级**: 生物识别、AI分析、IoT集成
-
-## 2. NFC应用场景详细设计
-
-### 2.1 饭堂消费系统
-
-**应用场景**: 学校食堂就餐支付
-
-**主要功能**:
-- NFC卡片/手机快速支付
-- 菜品选择和计价
-- 营养分析和建议
-- 消费记录查询
-- 家长消费监控
-- 食堂营收统计
-
-**业务流程**:
-1. 学生持NFC卡/手机到饭堂
-2. 选择菜品,POS机显示金额
-3. 刷卡/碰一碰完成支付
-4. 系统自动扣款并记录
-5. 打印小票或推送电子凭证
-
-### 2.2 小卖部购物系统
-
-**应用场景**: 校内便利店商品购买
-
-**主要功能**:
-- 商品扫码或手动录入
-- NFC快速结算
-- 库存实时更新
-- 促销活动支持
-- 会员积分累积
-- 销售数据分析
-
-**业务流程**:
-1. 商品扫码添加到购物车
-2. 确认购买清单和金额
-3. NFC支付完成交易
-4. 库存自动减少
-5. 生成销售记录
-
-### 2.3 门禁管理系统
-
-**应用场景**: 宿舍、教学楼、实验室等区域门禁
-
-**主要功能**:
-- 身份识别和权限验证
-- 进出记录实时记录
-- 访客临时授权
-- 异常行为告警
-- 门禁日志查询
-- 安全统计报告
-
-**业务流程**:
-1. 学生/教职工刷卡/手机
-2. 系统验证身份和权限
-3. 门禁设备执行开门/拒绝
-4. 记录进出时间和地点
-5. 异常情况实时告警
-
-### 2.4 图书借阅系统
-
-**应用场景**: 图书馆图书借还
-
-**主要功能**:
-- 图书借阅和归还
-- 借阅期限管理
-- 逾期费用计算
-- 预约排队功能
-- 阅读记录统计
-- 推荐书目推送
-
-**业务流程**:
-1. 扫描图书条码/RFID
-2. 刷学生卡确认身份
-3. 系统检查借阅权限
-4. 自动记录借阅信息
-5. 设置归还提醒
-
-## 3. 核心功能模块
-
-### 3.1 NFC卡片管理系统
-
-```sql
--- NFC卡片主表
-CREATE TABLE nfc_cards (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- card_number VARCHAR(32) UNIQUE NOT NULL,
- card_type INTEGER NOT NULL DEFAULT 1, -- 1:学生卡 2:教师卡 3:访客卡
- user_id UUID REFERENCES users(id),
- user_type INTEGER NOT NULL, -- 1:学生 2:教师 3:员工 4:访客
- balance DECIMAL(10,2) DEFAULT 0.00,
- status INTEGER DEFAULT 1, -- 1:正常 2:挂失 3:冻结 4:注销
- expire_date DATE,
- encrypted_data TEXT, -- 加密的卡片数据
- security_code VARCHAR(64), -- 安全校验码
- daily_limit DECIMAL(10,2) DEFAULT 100.00,
- created_at TIMESTAMPTZ DEFAULT NOW(),
- updated_at TIMESTAMPTZ DEFAULT NOW(),
- last_used_at TIMESTAMPTZ
-);
-
--- 卡片权限表
-CREATE TABLE card_permissions (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- card_id UUID REFERENCES nfc_cards(id),
- permission_type INTEGER NOT NULL, -- 1:门禁 2:消费 3:借阅
- location_id UUID, -- 具体位置ID(如特定门禁点)
- start_time TIME, -- 允许使用开始时间
- end_time TIME, -- 允许使用结束时间
- valid_days JSONB, -- 有效星期 [1,2,3,4,5] 周一到周五
- is_active BOOLEAN DEFAULT TRUE,
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-
--- 用户信息表(学生/教师)
-CREATE TABLE school_users (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- user_number VARCHAR(20) UNIQUE NOT NULL, -- 学号/工号
- name VARCHAR(100) NOT NULL,
- id_card VARCHAR(20),
- phone VARCHAR(20),
- email VARCHAR(100),
- department VARCHAR(100), -- 院系/部门
- class_grade VARCHAR(50), -- 班级/年级
- user_type INTEGER NOT NULL, -- 1:学生 2:教师 3:员工
- status INTEGER DEFAULT 1,
- avatar_url TEXT,
- created_at TIMESTAMPTZ DEFAULT NOW(),
- updated_at TIMESTAMPTZ DEFAULT NOW()
-);
-```
-
-### 3.2 消费记录系统
-
-```sql
--- 消费交易表
-CREATE TABLE nfc_transactions (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- transaction_no VARCHAR(50) UNIQUE NOT NULL,
- card_id UUID REFERENCES nfc_cards(id),
- user_id UUID REFERENCES school_users(id),
- merchant_id UUID, -- 商户ID(饭堂、小卖部等)
- transaction_type INTEGER NOT NULL, -- 1:消费 2:充值 3:退款
- amount DECIMAL(10,2) NOT NULL,
- balance_before DECIMAL(10,2) NOT NULL,
- balance_after DECIMAL(10,2) NOT NULL,
- location VARCHAR(100), -- 消费地点
- terminal_id VARCHAR(50), -- 终端设备ID
- description TEXT,
- extra_data JSONB, -- 额外数据(如购买商品详情)
- status INTEGER DEFAULT 1, -- 1:成功 2:失败 3:撤销
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-
--- 消费明细表(用于详细商品记录)
-CREATE TABLE transaction_items (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- transaction_id UUID REFERENCES nfc_transactions(id),
- item_type INTEGER NOT NULL, -- 1:菜品 2:商品 3:服务费
- item_id UUID, -- 商品/菜品ID
- item_name VARCHAR(200) NOT NULL,
- quantity INTEGER DEFAULT 1,
- unit_price DECIMAL(10,2) NOT NULL,
- total_price DECIMAL(10,2) NOT NULL,
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-```
-
-### 3.3 门禁系统
-
-```sql
--- 门禁设备表
-CREATE TABLE access_devices (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- device_id VARCHAR(50) UNIQUE NOT NULL,
- device_name VARCHAR(100) NOT NULL,
- location VARCHAR(200) NOT NULL,
- building VARCHAR(100),
- floor INTEGER,
- room VARCHAR(50),
- device_type INTEGER NOT NULL, -- 1:刷卡器 2:人脸识别 3:指纹
- ip_address INET,
- status INTEGER DEFAULT 1, -- 1:在线 2:离线 3:故障
- firmware_version VARCHAR(20),
- last_heartbeat TIMESTAMPTZ,
- created_at TIMESTAMPTZ DEFAULT NOW(),
- updated_at TIMESTAMPTZ DEFAULT NOW()
-);
-
--- 门禁记录表
-CREATE TABLE access_logs (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- device_id UUID REFERENCES access_devices(id),
- card_id UUID REFERENCES nfc_cards(id),
- user_id UUID REFERENCES school_users(id),
- access_type INTEGER NOT NULL, -- 1:进入 2:离开
- access_result INTEGER NOT NULL, -- 1:成功 2:权限不足 3:卡片异常 4:设备故障
- location VARCHAR(200),
- door_name VARCHAR(100),
- access_time TIMESTAMPTZ DEFAULT NOW(),
- photo_url TEXT, -- 抓拍照片URL
- remark TEXT
-);
-
--- 访客管理表
-CREATE TABLE visitors (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- visitor_name VARCHAR(100) NOT NULL,
- id_card VARCHAR(20) NOT NULL,
- phone VARCHAR(20) NOT NULL,
- company VARCHAR(200),
- visit_purpose TEXT,
- host_user_id UUID REFERENCES school_users(id),
- temp_card_id UUID REFERENCES nfc_cards(id),
- visit_start_time TIMESTAMPTZ NOT NULL,
- visit_end_time TIMESTAMPTZ NOT NULL,
- actual_leave_time TIMESTAMPTZ,
- status INTEGER DEFAULT 1, -- 1:预约 2:已到达 3:已离开 4:逾期
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-```
-
-### 3.4 充值系统
-
-```sql
--- 充值记录表
-CREATE TABLE recharge_records (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- recharge_no VARCHAR(50) UNIQUE NOT NULL,
- card_id UUID REFERENCES nfc_cards(id),
- user_id UUID REFERENCES school_users(id),
- recharge_type INTEGER NOT NULL, -- 1:现金 2:银行卡 3:微信 4:支付宝 5:批量
- amount DECIMAL(10,2) NOT NULL,
- balance_before DECIMAL(10,2) NOT NULL,
- balance_after DECIMAL(10,2) NOT NULL,
- operator_id UUID, -- 操作员ID
- terminal_id VARCHAR(50), -- 充值终端
- payment_method INTEGER,
- third_party_no VARCHAR(100), -- 第三方支付单号
- remark TEXT,
- status INTEGER DEFAULT 1, -- 1:成功 2:失败 3:退款
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-
--- 充值终端表
-CREATE TABLE recharge_terminals (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- terminal_id VARCHAR(50) UNIQUE NOT NULL,
- terminal_name VARCHAR(100) NOT NULL,
- location VARCHAR(200) NOT NULL,
- terminal_type INTEGER NOT NULL, -- 1:自助机 2:人工窗口 3:手机充值
- status INTEGER DEFAULT 1,
- operator_id UUID REFERENCES school_users(id),
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-```
-
-### 3.5 图书借阅系统
-
-```sql
--- 图书信息表
-CREATE TABLE books (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- isbn VARCHAR(20) UNIQUE,
- title VARCHAR(300) NOT NULL,
- author VARCHAR(200),
- publisher VARCHAR(200),
- category_id UUID,
- location VARCHAR(100), -- 书架位置
- total_copies INTEGER DEFAULT 1,
- available_copies INTEGER DEFAULT 1,
- status INTEGER DEFAULT 1, -- 1:正常 2:维修 3:下架
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-
--- 借阅记录表
-CREATE TABLE book_borrowings (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- book_id UUID REFERENCES books(id),
- card_id UUID REFERENCES nfc_cards(id),
- user_id UUID REFERENCES school_users(id),
- borrow_date DATE DEFAULT CURRENT_DATE,
- due_date DATE NOT NULL,
- return_date DATE,
- renew_count INTEGER DEFAULT 0,
- overdue_fee DECIMAL(10,2) DEFAULT 0,
- status INTEGER DEFAULT 1, -- 1:借阅中 2:已归还 3:逾期 4:丢失
- librarian_id UUID,
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-```
-
-## 4. 商户管理系统
-
-### 4.1 饭堂管理
-
-```sql
--- 饭堂商户表
-CREATE TABLE canteen_merchants (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- merchant_code VARCHAR(20) UNIQUE NOT NULL,
- merchant_name VARCHAR(100) NOT NULL,
- location VARCHAR(200) NOT NULL,
- business_hours JSONB, -- 营业时间
- contact_person VARCHAR(100),
- contact_phone VARCHAR(20),
- settlement_account VARCHAR(100), -- 结算账户
- commission_rate DECIMAL(5,4) DEFAULT 0.0200, -- 佣金比例
- status INTEGER DEFAULT 1,
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-
--- 菜品管理表
-CREATE TABLE canteen_dishes (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- merchant_id UUID REFERENCES canteen_merchants(id),
- dish_code VARCHAR(20),
- dish_name VARCHAR(100) NOT NULL,
- category VARCHAR(50), -- 荤菜、素菜、汤、主食等
- price DECIMAL(8,2) NOT NULL,
- nutrition_info JSONB, -- 营养成分信息
- allergen_info JSONB, -- 过敏原信息
- is_available BOOLEAN DEFAULT TRUE,
- daily_limit INTEGER, -- 每日限量
- sold_count INTEGER DEFAULT 0, -- 已售数量
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-
--- POS终端表
-CREATE TABLE pos_terminals (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- terminal_id VARCHAR(50) UNIQUE NOT NULL,
- merchant_id UUID REFERENCES canteen_merchants(id),
- terminal_name VARCHAR(100),
- location VARCHAR(200),
- nfc_reader_id VARCHAR(50), -- NFC读卡器设备ID
- ip_address INET,
- status INTEGER DEFAULT 1, -- 1:在线 2:离线 3:故障
- last_heartbeat TIMESTAMPTZ,
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-```
-
-### 4.2 小卖部管理
-
-```sql
--- 小卖部商户表
-CREATE TABLE shop_merchants (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- merchant_code VARCHAR(20) UNIQUE NOT NULL,
- merchant_name VARCHAR(100) NOT NULL,
- location VARCHAR(200) NOT NULL,
- business_hours JSONB,
- contact_person VARCHAR(100),
- contact_phone VARCHAR(20),
- license_number VARCHAR(100), -- 营业执照号
- status INTEGER DEFAULT 1,
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-
--- 商品管理表
-CREATE TABLE shop_products (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- merchant_id UUID REFERENCES shop_merchants(id),
- product_code VARCHAR(50) UNIQUE NOT NULL,
- barcode VARCHAR(50), -- 商品条码
- product_name VARCHAR(200) NOT NULL,
- category VARCHAR(100),
- brand VARCHAR(100),
- specification VARCHAR(100), -- 规格
- purchase_price DECIMAL(10,2), -- 进价
- selling_price DECIMAL(10,2) NOT NULL, -- 售价
- stock_quantity INTEGER DEFAULT 0,
- min_stock INTEGER DEFAULT 0, -- 最低库存预警
- status INTEGER DEFAULT 1,
- created_at TIMESTAMPTZ DEFAULT NOW(),
- updated_at TIMESTAMPTZ DEFAULT NOW()
-);
-
--- 库存记录表
-CREATE TABLE inventory_records (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- product_id UUID REFERENCES shop_products(id),
- record_type INTEGER NOT NULL, -- 1:入库 2:出库 3:盘点 4:损耗
- quantity INTEGER NOT NULL,
- unit_cost DECIMAL(10,2),
- total_cost DECIMAL(10,2),
- stock_before INTEGER,
- stock_after INTEGER,
- operator_id UUID,
- remark TEXT,
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-```
-
-## 5. 安全与加密机制
-
-### 5.1 NFC安全协议
-
-```sql
--- 安全密钥表
-CREATE TABLE security_keys (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- key_type INTEGER NOT NULL, -- 1:主密钥 2:会话密钥 3:设备密钥
- key_name VARCHAR(100) NOT NULL,
- key_value TEXT NOT NULL, -- 加密存储的密钥
- algorithm VARCHAR(50) DEFAULT 'AES-256',
- expire_date DATE,
- status INTEGER DEFAULT 1,
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-
--- 交易验证表
-CREATE TABLE transaction_verifications (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- transaction_id UUID REFERENCES nfc_transactions(id),
- verification_code VARCHAR(64) NOT NULL,
- mac_value VARCHAR(64), -- 消息认证码
- timestamp_signature VARCHAR(64), -- 时间戳签名(防重放)
- device_signature VARCHAR(64), -- 设备签名
- verification_result INTEGER, -- 1:通过 2:失败 3:可疑
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-```
-
-### 5.2 防欺诈机制
-
-**风控规则**:
-1. **单笔限额**: 根据卡片类型设置单笔消费上限
-2. **日消费限额**: 每日总消费额度控制
-3. **异常交易检测**: 短时间内多次交易告警
-4. **地理位置验证**: 不合理的位置跳跃检测
-5. **设备指纹**: 绑定常用消费终端
-
-## 5.3 银行级安全保护方案
-
-### 5.3.1 多层安全架构
-
-**第一层 - 网络安全**:
-- **VPN专网**: 所有终端设备通过专用VPN连接
-- **防火墙集群**: 多重防火墙过滤异常流量
-- **入侵检测**: 24小时实时监控异常访问
-- **DDoS防护**: 分布式拒绝服务攻击防护
-
-```sql
--- 网络安全配置表
-CREATE TABLE network_security_configs (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- config_type INTEGER NOT NULL, -- 1:防火墙规则 2:VPN配置 3:访问白名单
- config_name VARCHAR(100) NOT NULL,
- config_value JSONB NOT NULL,
- is_active BOOLEAN DEFAULT TRUE,
- created_at TIMESTAMPTZ DEFAULT NOW(),
- updated_at TIMESTAMPTZ DEFAULT NOW()
-);
-
--- 安全事件日志表
-CREATE TABLE security_incident_logs (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- incident_type INTEGER NOT NULL, -- 1:异常登录 2:可疑交易 3:系统入侵 4:数据泄露
- severity_level INTEGER NOT NULL, -- 1:低 2:中 3:高 4:严重
- source_ip INET,
- target_system VARCHAR(100),
- attack_method VARCHAR(200),
- detected_by VARCHAR(100), -- 检测系统
- status INTEGER DEFAULT 1, -- 1:待处理 2:处理中 3:已解决 4:误报
- description TEXT,
- response_actions JSONB,
- resolved_at TIMESTAMPTZ,
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-```
-
-**第二层 - 应用安全**:
-- **双因子认证**: 手机短信+密码/生物识别
-- **JWT令牌**: 30分钟自动过期,刷新机制
-- **API签名**: 所有接口请求数字签名验证
-- **权限最小化**: 基于角色的细粒度权限控制
-
-**第三层 - 数据安全**:
-- **字段级加密**: 敏感数据AES-256加密存储
-- **密钥分离**: 加密密钥与数据分离存储
-- **数据脱敏**: 日志和备份中敏感信息脱敏
-- **审计追踪**: 所有操作完整审计日志
-
-### 5.3.2 资金安全保障
-
-```sql
--- 资金池管理表
-CREATE TABLE fund_pools (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- pool_type INTEGER NOT NULL, -- 1:在途资金 2:备付金 3:风险准备金
- bank_account VARCHAR(50) NOT NULL,
- bank_name VARCHAR(100) NOT NULL,
- balance DECIMAL(15,2) DEFAULT 0.00,
- frozen_amount DECIMAL(15,2) DEFAULT 0.00,
- daily_limit DECIMAL(15,2) NOT NULL,
- status INTEGER DEFAULT 1,
- last_reconcile_time TIMESTAMPTZ,
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-
--- 资金变动记录表
-CREATE TABLE fund_movements (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- movement_no VARCHAR(50) UNIQUE NOT NULL,
- pool_id UUID REFERENCES fund_pools(id),
- movement_type INTEGER NOT NULL, -- 1:充值入账 2:消费出账 3:退款 4:调账
- amount DECIMAL(12,2) NOT NULL,
- balance_before DECIMAL(15,2) NOT NULL,
- balance_after DECIMAL(15,2) NOT NULL,
- related_transaction_id UUID,
- bank_serial_no VARCHAR(100), -- 银行流水号
- operator_id UUID,
- approval_status INTEGER DEFAULT 1, -- 1:待审核 2:已审核 3:已拒绝
- approved_by UUID,
- approved_at TIMESTAMPTZ,
- remark TEXT,
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-
--- 对账记录表
-CREATE TABLE reconciliation_records (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- reconcile_date DATE NOT NULL,
- reconcile_type INTEGER NOT NULL, -- 1:日对账 2:周对账 3:月对账
- system_balance DECIMAL(15,2) NOT NULL,
- bank_balance DECIMAL(15,2) NOT NULL,
- difference_amount DECIMAL(12,2) DEFAULT 0.00,
- transaction_count INTEGER DEFAULT 0,
- discrepancy_count INTEGER DEFAULT 0,
- status INTEGER DEFAULT 1, -- 1:平账 2:不平账 3:调账中
- reconcile_file_url TEXT,
- operator_id UUID,
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-```
-
-**资金安全措施**:
-1. **银行存管**: 与银行合作,资金存管分离
-2. **实时对账**: 每小时自动对账,发现差异立即告警
-3. **风险准备金**: 设立5%风险准备金,防范资金风险
-4. **多重审批**: 大额资金变动需要多级审批
-5. **资金监控**: 24小时资金流水监控,异常冻结
-
-### 5.3.3 交易安全机制
-
-```sql
--- 风控规则表
-CREATE TABLE risk_control_rules (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- rule_name VARCHAR(100) NOT NULL,
- rule_type INTEGER NOT NULL, -- 1:用户行为 2:交易金额 3:设备指纹 4:时间窗口
- rule_conditions JSONB NOT NULL, -- 规则条件配置
- risk_level INTEGER NOT NULL, -- 1:低风险 2:中风险 3:高风险
- action_type INTEGER NOT NULL, -- 1:放行 2:人工审核 3:自动拒绝 4:临时冻结
- is_active BOOLEAN DEFAULT TRUE,
- hit_count INTEGER DEFAULT 0,
- created_at TIMESTAMPTZ DEFAULT NOW(),
- updated_at TIMESTAMPTZ DEFAULT NOW()
-);
-
--- 风险评估记录表
-CREATE TABLE risk_assessments (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- transaction_id UUID REFERENCES nfc_transactions(id),
- user_id UUID REFERENCES school_users(id),
- risk_score DECIMAL(5,2) NOT NULL, -- 风险评分 0-100
- risk_level INTEGER NOT NULL,
- triggered_rules JSONB, -- 触发的风险规则
- assessment_result INTEGER NOT NULL, -- 1:通过 2:人工审核 3:拒绝
- manual_review_by UUID,
- review_result INTEGER,
- review_reason TEXT,
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-```
-
-**交易风控策略**:
-1. **实时风控**: 每笔交易实时风险评估
-2. **机器学习**: AI模型识别异常交易模式
-3. **黑名单机制**: 高风险用户和设备黑名单
-4. **交易限额**: 动态调整个人交易限额
-5. **异常冻结**: 可疑交易自动冻结,人工审核
-
-### 5.3.4 数据加密存储
-
-```sql
--- 加密配置表
-CREATE TABLE encryption_configs (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- table_name VARCHAR(100) NOT NULL,
- column_name VARCHAR(100) NOT NULL,
- encryption_algorithm VARCHAR(50) DEFAULT 'AES-256-GCM',
- key_version INTEGER DEFAULT 1,
- is_active BOOLEAN DEFAULT TRUE,
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-
--- 密钥管理表(密钥本身加密存储在专用HSM中)
-CREATE TABLE encryption_keys (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- key_name VARCHAR(100) UNIQUE NOT NULL,
- key_version INTEGER NOT NULL,
- key_type INTEGER NOT NULL, -- 1:数据加密 2:传输加密 3:签名密钥
- algorithm VARCHAR(50) NOT NULL,
- key_status INTEGER DEFAULT 1, -- 1:活跃 2:轮换中 3:已废弃
- created_at TIMESTAMPTZ DEFAULT NOW(),
- expires_at TIMESTAMPTZ NOT NULL,
- last_rotated_at TIMESTAMPTZ
-);
-```
-
-**加密策略**:
-- **卡号加密**: 所有卡号AES-256-GCM加密存储
-- **余额加密**: 账户余额字段加密,防止篡改
-- **身份信息**: 姓名、身份证号等PII信息加密
-- **密钥轮换**: 每3个月自动轮换密钥
-- **HSM设备**: 硬件安全模块管理密钥
-
-## 5.4 容灾备份方案
-
-### 5.4.1 数据备份策略
-
-```sql
--- 备份任务配置表
-CREATE TABLE backup_configurations (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- backup_name VARCHAR(100) NOT NULL,
- backup_type INTEGER NOT NULL, -- 1:全量备份 2:增量备份 3:差异备份
- backup_scope INTEGER NOT NULL, -- 1:全库 2:关键表 3:指定表
- target_tables JSONB,
- schedule_cron VARCHAR(50) NOT NULL, -- cron表达式
- retention_days INTEGER DEFAULT 30,
- storage_location VARCHAR(200),
- encryption_enabled BOOLEAN DEFAULT TRUE,
- compression_enabled BOOLEAN DEFAULT TRUE,
- is_active BOOLEAN DEFAULT TRUE,
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-
--- 备份执行记录表
-CREATE TABLE backup_execution_logs (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- config_id UUID REFERENCES backup_configurations(id),
- backup_file_path TEXT NOT NULL,
- backup_size_mb DECIMAL(10,2),
- start_time TIMESTAMPTZ NOT NULL,
- end_time TIMESTAMPTZ,
- status INTEGER NOT NULL, -- 1:成功 2:失败 3:部分成功
- error_message TEXT,
- verification_status INTEGER, -- 1:已验证 2:验证失败 3:未验证
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-```
-
-**备份方案**:
-
-| 备份类型 | 频率 | 保留期 | 存储位置 | 加密 |
-|---------|------|--------|----------|------|
-| 实时备份 | 每5分钟 | 24小时 | 本地SSD | AES-256 |
-| 增量备份 | 每小时 | 7天 | 异地机房 | AES-256 |
-| 全量备份 | 每日3:00 | 30天 | 云存储 | AES-256 |
-| 归档备份 | 每月 | 7年 | 冷存储 | AES-256 |
-
-### 5.4.2 灾难恢复方案
-
-```sql
--- 灾难恢复配置表
-CREATE TABLE disaster_recovery_configs (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- site_name VARCHAR(100) NOT NULL,
- site_type INTEGER NOT NULL, -- 1:主站点 2:热备站点 3:冷备站点
- location VARCHAR(200) NOT NULL,
- capacity_percentage INTEGER DEFAULT 100, -- 容量百分比
- rto_minutes INTEGER NOT NULL, -- 恢复时间目标(分钟)
- rpo_minutes INTEGER NOT NULL, -- 恢复点目标(分钟)
- auto_failover BOOLEAN DEFAULT FALSE,
- health_check_url TEXT,
- last_health_check TIMESTAMPTZ,
- status INTEGER DEFAULT 1, -- 1:正常 2:异常 3:维护中
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-
--- 故障切换记录表
-CREATE TABLE failover_logs (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- failover_type INTEGER NOT NULL, -- 1:计划内切换 2:自动故障切换 3:手动紧急切换
- source_site_id UUID REFERENCES disaster_recovery_configs(id),
- target_site_id UUID REFERENCES disaster_recovery_configs(id),
- trigger_reason TEXT,
- start_time TIMESTAMPTZ NOT NULL,
- end_time TIMESTAMPTZ,
- data_loss_minutes INTEGER DEFAULT 0,
- recovery_status INTEGER NOT NULL, -- 1:成功 2:失败 3:部分成功
- affected_services JSONB,
- operator_id UUID,
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-```
-
-**容灾架构**:
-- **主数据中心**: 承载100%业务流量
-- **热备中心**: 实时数据同步,RTO<15分钟
-- **冷备中心**: 定期数据同步,RTO<4小时
-- **云备份**: 每日备份到云存储,RTO<24小时
-
-### 5.4.3 业务连续性保障
-
-**关键业务优先级**:
-1. **P0 - 核心交易**: NFC支付、余额查询(必须99.9%可用)
-2. **P1 - 门禁管理**: 身份验证、进出记录(必须99.5%可用)
-3. **P2 - 充值服务**: 在线充值、资金管理(必须99%可用)
-4. **P3 - 统计报表**: 数据分析、运营报表(可降级)
-
-**降级策略**:
-- **离线模式**: 终端设备本地缓存,网络恢复后同步
-- **只读模式**: 故障时只允许查询,禁止交易
-- **限流模式**: 高峰时段限制并发交易数量
-- **人工模式**: 极端情况下切换到人工处理
-
-## 5.5 成本合理的安全方案
-
-### 5.5.1 基础设施成本(3年总成本)
-
-| 项目 | 配置 | 数量 | 单价(万元) | 总价(万元) |
-|------|------|------|-----------|-----------|
-| **数据库服务器** | 64核/512GB/SSD 10TB | 2台 | 15 | 30 |
-| **应用服务器** | 32核/128GB/SSD 2TB | 4台 | 8 | 32 |
-| **备份服务器** | 16核/64GB/HDD 20TB | 2台 | 5 | 10 |
-| **网络安全设备** | 防火墙+IDS+VPN | 1套 | 25 | 25 |
-| **HSM硬件** | 密钥管理设备 | 1台 | 35 | 35 |
-| **机房托管** | 电力+网络+维护 | 3年 | 8/年 | 24 |
-| **云备份存储** | 100TB冷存储 | 3年 | 2/年 | 6 |
-| **安全软件许可** | 防病毒+监控+审计 | 3年 | 10/年 | 30 |
-| **基础设施总计** | - | - | - | **192万** |
-
-### 5.5.2 人力成本(年)
-
-| 岗位 | 人数 | 年薪(万元) | 总计(万元) |
-|------|------|-----------|-----------|
-| 安全架构师 | 1 | 45 | 45 |
-| 运维工程师 | 2 | 25 | 50 |
-| 安全运营师 | 1 | 35 | 35 |
-| DBA工程师 | 1 | 40 | 40 |
-| **人力年成本** | 5 | - | **170万** |
-
-### 5.5.3 运营成本(年)
-
-| 项目 | 费用(万元/年) |
-|------|-------------|
-| 电费网费 | 15 |
-| 安全审计 | 12 |
-| 渗透测试 | 8 |
-| 保险费用 | 20 |
-| 应急响应 | 10 |
-| **运营年成本** | **65万** |
-
-### 5.5.4 总成本汇总(3年)
-
-| 成本类型 | 金额(万元) | 占比 |
-|---------|-----------|------|
-| 基础设施(3年) | 192 | 26% |
-| 人力成本(3年) | 510 | 69% |
-| 运营成本(3年) | 195 | 26% |
-| **总计** | **897万** | 100% |
-| **年平均成本** | **299万** | - |
-
-### 5.5.5 投资回报分析
-
-**成本节省**:
-- 现金管理成本节省: 20万/年
-- 人工对账成本节省: 15万/年
-- 错账纠纷处理节省: 10万/年
-- 审计合规成本节省: 8万/年
-
-**风险防范价值**:
-- 避免资金损失: 预期防范损失100万/年
-- 避免合规罚款: 预期避免罚款50万/年
-- 品牌声誉保护: 无法量化,价值巨大
-
-**总收益**: 年节省成本53万 + 风险防范价值150万 = 203万/年
-**ROI**: (203-299)/299 = -32%(第一年)
-**盈亏平衡点**: 约1.5年
-
-### 5.5.6 成本优化建议
-
-**阶段性部署**:
-1. **第一年**: 部署核心安全措施(60%成本)
-2. **第二年**: 完善监控和备份(30%成本)
-3. **第三年**: 高级安全功能(10%成本)
-
-**共享资源**:
-- 与其他校园系统共享基础设施
-- 多个学校联合采购降低成本
-- 使用云服务替代部分硬件投资
-
-**关键安全投入优先级**:
-1. **核心数据加密**: 必须投入
-2. **实时备份系统**: 必须投入
-3. **基础监控告警**: 必须投入
-4. **高级威胁检测**: 可后续升级
-5. **AI风控模型**: 可后续升级
-
-这个方案在保证银行级安全的前提下,通过合理的分期投入和资源共享,将年度安全投入控制在合理范围内,同时确保了资金安全和业务连续性。
-## 6. 数据分析与报表
-
-### 6.1 消费行为分析
-
-```sql
--- 消费统计表
-CREATE TABLE consumption_statistics (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- stat_date DATE NOT NULL,
- user_id UUID REFERENCES school_users(id),
- merchant_id UUID,
- total_transactions INTEGER DEFAULT 0,
- total_amount DECIMAL(10,2) DEFAULT 0,
- avg_amount DECIMAL(10,2) DEFAULT 0,
- peak_hour INTEGER, -- 消费高峰时段
- favorite_category VARCHAR(100), -- 偏好品类
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-
--- 商户营收统计
-CREATE TABLE merchant_revenue_stats (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- stat_date DATE NOT NULL,
- merchant_id UUID NOT NULL,
- total_transactions INTEGER DEFAULT 0,
- total_revenue DECIMAL(12,2) DEFAULT 0,
- commission_amount DECIMAL(10,2) DEFAULT 0,
- top_selling_items JSONB,
- peak_hours JSONB,
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-```
-
-### 6.2 门禁分析
-
-```sql
--- 门禁统计表
-CREATE TABLE access_statistics (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- stat_date DATE NOT NULL,
- device_id UUID REFERENCES access_devices(id),
- total_accesses INTEGER DEFAULT 0,
- successful_accesses INTEGER DEFAULT 0,
- failed_accesses INTEGER DEFAULT 0,
- peak_hour INTEGER,
- unique_users INTEGER DEFAULT 0,
- created_at TIMESTAMPTZ DEFAULT NOW()
-);
-```
-
-## 7. 移动应用设计
-
-### 7.1 学生端 App
-
-**主要功能**:
-- 卡片余额查询
-- 消费记录查看
-- 在线充值
-- 门禁权限查看
-- 图书借阅记录
-- 营养报告
-- 消费分析
-
-**NFC功能**:
-- 手机NFC支付
-- 虚拟校园卡
-- 快速身份验证
-
-### 7.2 家长端 App
-
-**主要功能**:
-- 孩子消费监控
-- 余额不足提醒
-- 充值代缴
-- 消费限额设置
-- 营养分析报告
-- 进出校门提醒
-
-### 7.3 商户端 App
-
-**主要功能**:
-- 收银结算
-- 销售统计
-- 库存管理
-- 营业分析
-- 设备状态监控
-
-### 7.4 管理端 Web
-
-**主要功能**:
-- 用户管理
-- 卡片管理
-- 商户管理
-- 设备管理
-- 财务结算
-- 数据报表
-- 系统配置
-
-## 8. 硬件设备集成
-
-### 8.1 NFC读卡器
-
-**技术规格**:
-- 支持ISO14443 Type A/B
-- 支持Mifare Classic/Plus/DESFire
-- 支持NFC Forum Type 1-4
-- 读卡距离: 0-10cm
-- 通信接口: USB/RS232/TCP/IP
-
-**设备清单**:
-- 饭堂POS机: 50台
-- 小卖部收银机: 20台
-- 门禁读卡器: 200台
-- 图书馆设备: 10台
-- 充值终端: 30台
-
-### 8.2 门禁设备
-
-**设备类型**:
-- 单门门禁控制器
-- 双门门禁控制器
-- 闸机通道设备
-- 电子门锁
-
-**功能特性**:
-- 支持多种识别方式
-- 防跟随功能
-- 强制关门功能
-- 远程控制开门
-- 实时状态监控
-
-### 8.3 充值设备
-
-**自助充值机**:
-- 现金收款模块
-- 银行卡读卡器
-- NFC读写器
-- 凭条打印机
-- 触摸显示屏
-
-## 9. API接口设计
-
-### 9.1 NFC交易接口
-
-```http
-POST /api/v1/nfc/transaction
-Content-Type: application/json
-
-{
- "card_number": "1234567890123456",
- "amount": 15.50,
- "merchant_id": "canteen001",
- "terminal_id": "pos001",
- "items": [
- {
- "item_id": "dish001",
- "name": "红烧肉",
- "quantity": 1,
- "price": 12.00
- },
- {
- "item_id": "dish002",
- "name": "米饭",
- "quantity": 1,
- "price": 3.50
- }
- ],
- "timestamp": "2025-07-16T12:30:00Z",
- "signature": "abc123def456..."
-}
-```
-
-### 9.2 门禁验证接口
-
-```http
-POST /api/v1/access/verify
-Content-Type: application/json
-
-{
- "device_id": "door001",
- "card_number": "1234567890123456",
- "access_type": 1,
- "timestamp": "2025-07-16T08:00:00Z",
- "signature": "xyz789uvw012..."
-}
-```
-
-### 9.3 余额查询接口
-
-```http
-GET /api/v1/nfc/balance?card_number=1234567890123456
-
-Response:
-{
- "status": "success",
- "data": {
- "card_number": "1234567890123456",
- "balance": 156.80,
- "status": 1,
- "daily_used": 25.50,
- "daily_limit": 100.00
- }
-}
-```
-
-## 10. 数据同步与备份
-
-### 10.1 实时同步机制
-
-- **Redis缓存**: 热点数据缓存
-- **消息队列**: 异步处理交易
-- **数据库同步**: 主从复制
-- **离线缓存**: 网络异常时本地缓存
-
-### 10.2 备份策略
-
-- **全量备份**: 每日凌晨全量备份
-- **增量备份**: 每小时增量备份
-- **异地备份**: 关键数据异地存储
-- **恢复测试**: 定期恢复测试
-
-## 11. 项目实施计划
-
-### 11.1 第一阶段 (1.5个月) - 基础平台
-
-- [ ] NFC卡片管理系统
-- [ ] 用户身份管理
-- [ ] 基础消费功能
-- [ ] 充值系统
-- [ ] 安全加密机制
-
-### 11.2 第二阶段 (1.5个月) - 应用场景
-
-- [ ] 饭堂消费系统
-- [ ] 小卖部购物系统
-- [ ] 门禁管理系统
-- [ ] 移动端App开发
-
-### 11.3 第三阶段 (1个月) - 扩展功能
-
-- [ ] 图书借阅系统
-- [ ] 数据分析报表
-- [ ] 家长监控功能
-- [ ] 系统优化测试
-
-## 12. 成本预算
-
-### 12.1 硬件成本
-
-| 设备类型 | 数量 | 单价(元) | 总价(元) |
-|---------|------|----------|----------|
-| NFC读卡器 | 100台 | 800 | 80,000 |
-| 门禁控制器 | 200台 | 1,200 | 240,000 |
-| POS终端 | 70台 | 2,500 | 175,000 |
-| 自助充值机 | 30台 | 8,000 | 240,000 |
-| 网络设备 | 1套 | 50,000 | 50,000 |
-| **硬件总计** | - | - | **785,000** |
-
-### 12.2 软件开发成本
-
-| 项目 | 人月 | 单价(元/月) | 总价(元) |
-|------|------|-------------|----------|
-| 后端开发 | 8 | 25,000 | 200,000 |
-| 前端开发 | 6 | 20,000 | 120,000 |
-| 移动端开发 | 4 | 22,000 | 88,000 |
-| 测试 | 2 | 18,000 | 36,000 |
-| **软件总计** | - | - | **444,000** |
-
-### 12.3 运维成本 (年)
-
-| 项目 | 费用(元/年) |
-|------|-------------|
-| 服务器托管 | 120,000 |
-| 带宽费用 | 60,000 |
-| 维护服务 | 100,000 |
-| **年运维总计** | **280,000** |
-
-## 13. 风险评估
-
-### 13.1 技术风险
-
-- **NFC兼容性**: 不同设备间兼容性问题
-- **网络稳定性**: 校园网络中断影响
-- **数据安全**: 敏感信息泄露风险
-
-### 13.2 运营风险
-
-- **用户接受度**: 师生使用习惯培养
-- **设备故障**: 硬件设备维护保养
-- **资金安全**: 充值资金监管
-
-### 13.3 应对措施
-
-- 多重备份和容灾机制
-- 完善的培训和支持体系
-- 严格的资金监管制度
-- 24小时技术支持服务
-
-## 14. 效益分析
-
-### 14.1 经济效益
-
-- **减少现金管理成本**: 每年节省约20万元
-- **提高收银效率**: 缩短排队时间50%
-- **减少差错率**: 避免找零错误
-- **数据化管理**: 提升运营效率
-
-### 14.2 社会效益
-
-- **提升用户体验**: 快速便捷的消费体验
-- **健康饮食指导**: 营养分析和建议
-- **校园安全**: 完善的门禁管理
-- **绿色环保**: 减少纸质票据
-
-## 15. 后续扩展
-
-### 15.1 功能扩展
-
-- **考勤打卡**: 教师员工考勤管理
-- **健康码集成**: 防疫健康管理
-- **停车管理**: 校园车辆管理
-- **会议签到**: 会议活动管理
-
-### 15.2 技术升级
-
-- **生物识别**: 人脸、指纹识别
-- **AI分析**: 智能推荐和预测
-- **IoT集成**: 物联网设备管理
-- **区块链**: 交易数据不可篡改
-
----
-
-**文档版本**: v1.0
-**更新时间**: 2025年7月16日
-**负责人**: NFC项目组
-**审核人**: 技术总监
diff --git a/mall/pages/mall/nfc/pages-admin.json b/mall/pages/mall/nfc/pages-admin.json
deleted file mode 100644
index e3a4efe9..00000000
--- a/mall/pages/mall/nfc/pages-admin.json
+++ /dev/null
@@ -1,183 +0,0 @@
-{
- "pages": [
- {
- "path": "pages/mall/nfc/admin/index",
- "style": {
- "navigationBarTitleText": "系统管理",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/admin/user-management",
- "style": {
- "navigationBarTitleText": "用户管理",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/admin/card-management",
- "style": {
- "navigationBarTitleText": "卡片管理",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/admin/merchant-management",
- "style": {
- "navigationBarTitleText": "商户管理",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/admin/device-management",
- "style": {
- "navigationBarTitleText": "设备管理",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/admin/financial-management",
- "style": {
- "navigationBarTitleText": "财务管理",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/admin/access-control",
- "style": {
- "navigationBarTitleText": "门禁管理",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/admin/security-monitor",
- "style": {
- "navigationBarTitleText": "安全监控",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/admin/data-reports",
- "style": {
- "navigationBarTitleText": "数据报表",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/admin/system-config",
- "style": {
- "navigationBarTitleText": "系统配置",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/admin/logs",
- "style": {
- "navigationBarTitleText": "操作日志",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/admin/emergency-control",
- "style": {
- "navigationBarTitleText": "应急控制",
- "backgroundColor": "#fff3cd"
- }
- }
- ],
- "subPackages": [
- {
- "root": "pages/mall/nfc/admin",
- "pages": [
- {
- "path": "user-detail",
- "style": {
- "navigationBarTitleText": "用户详情"
- }
- },
- {
- "path": "card-detail",
- "style": {
- "navigationBarTitleText": "卡片详情"
- }
- },
- {
- "path": "merchant-detail",
- "style": {
- "navigationBarTitleText": "商户详情"
- }
- },
- {
- "path": "device-detail",
- "style": {
- "navigationBarTitleText": "设备详情"
- }
- },
- {
- "path": "financial-detail",
- "style": {
- "navigationBarTitleText": "财务详情"
- }
- },
- {
- "path": "security-detail",
- "style": {
- "navigationBarTitleText": "安全详情"
- }
- },
- {
- "path": "batch-operations",
- "style": {
- "navigationBarTitleText": "批量操作"
- }
- }
- ]
- }
- ],
- "tabBar": {
- "color": "#999999",
- "selectedColor": "#dc3545",
- "backgroundColor": "#FFFFFF",
- "borderStyle": "black",
- "list": [
- {
- "pagePath": "pages/mall/nfc/admin/index",
- "text": "总览",
- "iconPath": "static/icons/dashboard.png",
- "selectedIconPath": "static/icons/dashboard-active.png"
- },
- {
- "pagePath": "pages/mall/nfc/admin/user-management",
- "text": "用户",
- "iconPath": "static/icons/users.png",
- "selectedIconPath": "static/icons/users-active.png"
- },
- {
- "pagePath": "pages/mall/nfc/admin/financial-management",
- "text": "财务",
- "iconPath": "static/icons/finance.png",
- "selectedIconPath": "static/icons/finance-active.png"
- },
- {
- "pagePath": "pages/mall/nfc/admin/security-monitor",
- "text": "安全",
- "iconPath": "static/icons/security.png",
- "selectedIconPath": "static/icons/security-active.png"
- }
- ]
- },
- "globalStyle": {
- "navigationBarTextStyle": "black",
- "navigationBarTitleText": "系统管理",
- "navigationBarBackgroundColor": "#FFFFFF",
- "backgroundColor": "#f8f9fa"
- }
-}
diff --git a/mall/pages/mall/nfc/pages-librarian.json b/mall/pages/mall/nfc/pages-librarian.json
deleted file mode 100644
index fd9a783a..00000000
--- a/mall/pages/mall/nfc/pages-librarian.json
+++ /dev/null
@@ -1,169 +0,0 @@
-{
- "pages": [
- {
- "path": "pages/mall/nfc/librarian/index",
- "style": {
- "navigationBarTitleText": "图书管理",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/librarian/book-management",
- "style": {
- "navigationBarTitleText": "图书管理",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/librarian/borrowing-service",
- "style": {
- "navigationBarTitleText": "借还服务",
- "backgroundColor": "#ffffff"
- }
- },
- {
- "path": "pages/mall/nfc/librarian/reader-management",
- "style": {
- "navigationBarTitleText": "读者管理",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/librarian/overdue-management",
- "style": {
- "navigationBarTitleText": "逾期管理",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/librarian/inventory-check",
- "style": {
- "navigationBarTitleText": "盘点管理",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/librarian/statistics",
- "style": {
- "navigationBarTitleText": "统计报表",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/librarian/book-search",
- "style": {
- "navigationBarTitleText": "图书检索",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/librarian/reading-promotion",
- "style": {
- "navigationBarTitleText": "阅读推广",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/librarian/equipment-status",
- "style": {
- "navigationBarTitleText": "设备状态",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/librarian/reservation-management",
- "style": {
- "navigationBarTitleText": "预约管理",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/librarian/settings",
- "style": {
- "navigationBarTitleText": "系统设置",
- "backgroundColor": "#f8f9fa"
- }
- }
- ],
- "subPackages": [
- {
- "root": "pages/mall/nfc/librarian",
- "pages": [
- {
- "path": "book-detail",
- "style": {
- "navigationBarTitleText": "图书详情"
- }
- },
- {
- "path": "reader-detail",
- "style": {
- "navigationBarTitleText": "读者详情"
- }
- },
- {
- "path": "borrowing-detail",
- "style": {
- "navigationBarTitleText": "借阅详情"
- }
- },
- {
- "path": "book-add",
- "style": {
- "navigationBarTitleText": "新增图书"
- }
- },
- {
- "path": "batch-operations",
- "style": {
- "navigationBarTitleText": "批量操作"
- }
- }
- ]
- }
- ],
- "tabBar": {
- "color": "#999999",
- "selectedColor": "#20c997",
- "backgroundColor": "#FFFFFF",
- "borderStyle": "black",
- "list": [
- {
- "pagePath": "pages/mall/nfc/librarian/index",
- "text": "首页",
- "iconPath": "static/icons/library-home.png",
- "selectedIconPath": "static/icons/library-home-active.png"
- },
- {
- "pagePath": "pages/mall/nfc/librarian/borrowing-service",
- "text": "借还",
- "iconPath": "static/icons/borrow.png",
- "selectedIconPath": "static/icons/borrow-active.png"
- },
- {
- "pagePath": "pages/mall/nfc/librarian/book-management",
- "text": "图书",
- "iconPath": "static/icons/books.png",
- "selectedIconPath": "static/icons/books-active.png"
- },
- {
- "pagePath": "pages/mall/nfc/librarian/statistics",
- "text": "统计",
- "iconPath": "static/icons/chart.png",
- "selectedIconPath": "static/icons/chart-active.png"
- }
- ]
- },
- "globalStyle": {
- "navigationBarTextStyle": "black",
- "navigationBarTitleText": "图书管理",
- "navigationBarBackgroundColor": "#FFFFFF",
- "backgroundColor": "#f8f9fa"
- }
-}
diff --git a/mall/pages/mall/nfc/pages-merchant.json b/mall/pages/mall/nfc/pages-merchant.json
deleted file mode 100644
index 2afd8255..00000000
--- a/mall/pages/mall/nfc/pages-merchant.json
+++ /dev/null
@@ -1,168 +0,0 @@
-{
- "pages": [
- {
- "path": "pages/mall/nfc/merchant/index",
- "style": {
- "navigationBarTitleText": "商户工作台",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/merchant/pos-cashier",
- "style": {
- "navigationBarTitleText": "收银台",
- "backgroundColor": "#ffffff"
- }
- },
- {
- "path": "pages/mall/nfc/merchant/menu-management",
- "style": {
- "navigationBarTitleText": "菜品管理",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/merchant/inventory",
- "style": {
- "navigationBarTitleText": "库存管理",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/merchant/sales-statistics",
- "style": {
- "navigationBarTitleText": "销售统计",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/merchant/daily-settlement",
- "style": {
- "navigationBarTitleText": "日结算",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/merchant/transaction-records",
- "style": {
- "navigationBarTitleText": "交易记录",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/merchant/equipment-status",
- "style": {
- "navigationBarTitleText": "设备状态",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/merchant/promotion",
- "style": {
- "navigationBarTitleText": "促销活动",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/merchant/customer-analysis",
- "style": {
- "navigationBarTitleText": "顾客分析",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/merchant/financial-report",
- "style": {
- "navigationBarTitleText": "财务报表",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/merchant/settings",
- "style": {
- "navigationBarTitleText": "店铺设置",
- "backgroundColor": "#f8f9fa"
- }
- }
- ],
- "subPackages": [
- {
- "root": "pages/mall/nfc/merchant",
- "pages": [
- {
- "path": "dish-detail",
- "style": {
- "navigationBarTitleText": "菜品详情"
- }
- },
- {
- "path": "product-detail",
- "style": {
- "navigationBarTitleText": "商品详情"
- }
- },
- {
- "path": "transaction-detail",
- "style": {
- "navigationBarTitleText": "交易详情"
- }
- },
- {
- "path": "equipment-detail",
- "style": {
- "navigationBarTitleText": "设备详情"
- }
- },
- {
- "path": "promotion-create",
- "style": {
- "navigationBarTitleText": "创建促销"
- }
- }
- ]
- }
- ],
- "tabBar": {
- "color": "#999999",
- "selectedColor": "#fd7e14",
- "backgroundColor": "#FFFFFF",
- "borderStyle": "black",
- "list": [
- {
- "pagePath": "pages/mall/nfc/merchant/index",
- "text": "首页",
- "iconPath": "static/icons/home.png",
- "selectedIconPath": "static/icons/home-active.png"
- },
- {
- "pagePath": "pages/mall/nfc/merchant/pos-cashier",
- "text": "收银",
- "iconPath": "static/icons/cashier.png",
- "selectedIconPath": "static/icons/cashier-active.png"
- },
- {
- "pagePath": "pages/mall/nfc/merchant/sales-statistics",
- "text": "统计",
- "iconPath": "static/icons/statistics.png",
- "selectedIconPath": "static/icons/statistics-active.png"
- },
- {
- "pagePath": "pages/mall/nfc/merchant/settings",
- "text": "设置",
- "iconPath": "static/icons/settings.png",
- "selectedIconPath": "static/icons/settings-active.png"
- }
- ]
- },
- "globalStyle": {
- "navigationBarTextStyle": "black",
- "navigationBarTitleText": "商户工作台",
- "navigationBarBackgroundColor": "#FFFFFF",
- "backgroundColor": "#f8f9fa"
- }
-}
diff --git a/mall/pages/mall/nfc/pages-parent.json b/mall/pages/mall/nfc/pages-parent.json
deleted file mode 100644
index c39a2b77..00000000
--- a/mall/pages/mall/nfc/pages-parent.json
+++ /dev/null
@@ -1,154 +0,0 @@
-{
- "pages": [
- {
- "path": "pages/mall/nfc/parent/index",
- "style": {
- "navigationBarTitleText": "孩子校园生活",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/parent/children-list",
- "style": {
- "navigationBarTitleText": "我的孩子",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/parent/child-detail",
- "style": {
- "navigationBarTitleText": "孩子详情",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/parent/consumption-monitor",
- "style": {
- "navigationBarTitleText": "消费监控",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/parent/recharge-for-child",
- "style": {
- "navigationBarTitleText": "代充值",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/parent/spending-limit",
- "style": {
- "navigationBarTitleText": "消费限额",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/parent/nutrition-report",
- "style": {
- "navigationBarTitleText": "营养报告",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/parent/access-alerts",
- "style": {
- "navigationBarTitleText": "进出提醒",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/parent/monthly-report",
- "style": {
- "navigationBarTitleText": "月度报告",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/parent/alert-settings",
- "style": {
- "navigationBarTitleText": "提醒设置",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/parent/emergency-contact",
- "style": {
- "navigationBarTitleText": "紧急联系",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/parent/feedback",
- "style": {
- "navigationBarTitleText": "意见反馈",
- "backgroundColor": "#f8f9fa"
- }
- }
- ],
- "subPackages": [
- {
- "root": "pages/mall/nfc/parent",
- "pages": [
- {
- "path": "consumption-detail",
- "style": {
- "navigationBarTitleText": "消费详情"
- }
- },
- {
- "path": "nutrition-detail",
- "style": {
- "navigationBarTitleText": "营养详情"
- }
- },
- {
- "path": "access-detail",
- "style": {
- "navigationBarTitleText": "进出详情"
- }
- }
- ]
- }
- ],
- "tabBar": {
- "color": "#999999",
- "selectedColor": "#FF6B35",
- "backgroundColor": "#FFFFFF",
- "borderStyle": "black",
- "list": [
- {
- "pagePath": "pages/mall/nfc/parent/index",
- "text": "首页",
- "iconPath": "static/icons/home.png",
- "selectedIconPath": "static/icons/home-active.png"
- },
- {
- "pagePath": "pages/mall/nfc/parent/consumption-monitor",
- "text": "消费监控",
- "iconPath": "static/icons/monitor.png",
- "selectedIconPath": "static/icons/monitor-active.png"
- },
- {
- "pagePath": "pages/mall/nfc/parent/nutrition-report",
- "text": "营养报告",
- "iconPath": "static/icons/nutrition.png",
- "selectedIconPath": "static/icons/nutrition-active.png"
- },
- {
- "pagePath": "pages/mall/nfc/parent/alert-settings",
- "text": "设置",
- "iconPath": "static/icons/settings.png",
- "selectedIconPath": "static/icons/settings-active.png"
- }
- ]
- },
- "globalStyle": {
- "navigationBarTextStyle": "black",
- "navigationBarTitleText": "家长监控",
- "navigationBarBackgroundColor": "#FFFFFF",
- "backgroundColor": "#f8f9fa"
- }
-}
diff --git a/mall/pages/mall/nfc/pages-security.json b/mall/pages/mall/nfc/pages-security.json
deleted file mode 100644
index 5c6f8191..00000000
--- a/mall/pages/mall/nfc/pages-security.json
+++ /dev/null
@@ -1,170 +0,0 @@
-{
- "pages": [
- {
- "path": "pages/mall/nfc/security/index",
- "style": {
- "navigationBarTitleText": "安保工作台",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/security/real-time-monitor",
- "style": {
- "navigationBarTitleText": "实时监控",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/security/access-logs",
- "style": {
- "navigationBarTitleText": "门禁日志",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/security/visitor-management",
- "style": {
- "navigationBarTitleText": "访客管理",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/security/emergency-alerts",
- "style": {
- "navigationBarTitleText": "紧急告警",
- "enablePullDownRefresh": true,
- "backgroundColor": "#fff3cd"
- }
- },
- {
- "path": "pages/mall/nfc/security/patrol-routes",
- "style": {
- "navigationBarTitleText": "巡逻路线",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/security/incident-reports",
- "style": {
- "navigationBarTitleText": "事件报告",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/security/camera-control",
- "style": {
- "navigationBarTitleText": "监控调度",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/security/device-status",
- "style": {
- "navigationBarTitleText": "设备状态",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/security/manual-control",
- "style": {
- "navigationBarTitleText": "手动控制",
- "backgroundColor": "#fff3cd"
- }
- },
- {
- "path": "pages/mall/nfc/security/duty-schedule",
- "style": {
- "navigationBarTitleText": "值班安排",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/security/communication",
- "style": {
- "navigationBarTitleText": "对讲通信",
- "backgroundColor": "#f8f9fa"
- }
- }
- ],
- "subPackages": [
- {
- "root": "pages/mall/nfc/security",
- "pages": [
- {
- "path": "visitor-detail",
- "style": {
- "navigationBarTitleText": "访客详情"
- }
- },
- {
- "path": "incident-detail",
- "style": {
- "navigationBarTitleText": "事件详情"
- }
- },
- {
- "path": "device-detail",
- "style": {
- "navigationBarTitleText": "设备详情"
- }
- },
- {
- "path": "patrol-detail",
- "style": {
- "navigationBarTitleText": "巡逻详情"
- }
- },
- {
- "path": "emergency-response",
- "style": {
- "navigationBarTitleText": "应急响应"
- }
- }
- ]
- }
- ],
- "tabBar": {
- "color": "#999999",
- "selectedColor": "#6f42c1",
- "backgroundColor": "#FFFFFF",
- "borderStyle": "black",
- "list": [
- {
- "pagePath": "pages/mall/nfc/security/index",
- "text": "总览",
- "iconPath": "static/icons/security-home.png",
- "selectedIconPath": "static/icons/security-home-active.png"
- },
- {
- "pagePath": "pages/mall/nfc/security/real-time-monitor",
- "text": "监控",
- "iconPath": "static/icons/monitor.png",
- "selectedIconPath": "static/icons/monitor-active.png"
- },
- {
- "pagePath": "pages/mall/nfc/security/visitor-management",
- "text": "访客",
- "iconPath": "static/icons/visitor.png",
- "selectedIconPath": "static/icons/visitor-active.png"
- },
- {
- "pagePath": "pages/mall/nfc/security/emergency-alerts",
- "text": "告警",
- "iconPath": "static/icons/alert.png",
- "selectedIconPath": "static/icons/alert-active.png"
- }
- ]
- },
- "globalStyle": {
- "navigationBarTextStyle": "black",
- "navigationBarTitleText": "安保工作台",
- "navigationBarBackgroundColor": "#FFFFFF",
- "backgroundColor": "#f8f9fa"
- }
-}
diff --git a/mall/pages/mall/nfc/pages-student.json b/mall/pages/mall/nfc/pages-student.json
deleted file mode 100644
index 8e7dc8f1..00000000
--- a/mall/pages/mall/nfc/pages-student.json
+++ /dev/null
@@ -1,168 +0,0 @@
-{
- "pages": [
- {
- "path": "pages/mall/nfc/student/index",
- "style": {
- "navigationBarTitleText": "校园生活",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/student/card-info",
- "style": {
- "navigationBarTitleText": "我的校园卡",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/student/balance",
- "style": {
- "navigationBarTitleText": "余额查询",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/student/recharge",
- "style": {
- "navigationBarTitleText": "在线充值",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/student/transactions",
- "style": {
- "navigationBarTitleText": "消费记录",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/student/canteen",
- "style": {
- "navigationBarTitleText": "饭堂消费",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/student/shop",
- "style": {
- "navigationBarTitleText": "小卖部",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/student/library",
- "style": {
- "navigationBarTitleText": "图书借阅",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/student/access-log",
- "style": {
- "navigationBarTitleText": "进出记录",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/student/nutrition",
- "style": {
- "navigationBarTitleText": "营养分析",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/student/settings",
- "style": {
- "navigationBarTitleText": "设置",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/student/help",
- "style": {
- "navigationBarTitleText": "帮助中心",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/student/nfc-pay",
- "style": {
- "navigationBarTitleText": "NFC支付",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/student/qr-code",
- "style": {
- "navigationBarTitleText": "付款码",
- "backgroundColor": "#000000"
- }
- }
- ],
- "subPackages": [
- {
- "root": "pages/mall/nfc/student",
- "pages": [
- {
- "path": "transaction-detail",
- "style": {
- "navigationBarTitleText": "交易详情"
- }
- },
- {
- "path": "meal-detail",
- "style": {
- "navigationBarTitleText": "用餐详情"
- }
- },
- {
- "path": "book-detail",
- "style": {
- "navigationBarTitleText": "借阅详情"
- }
- }
- ]
- }
- ],
- "tabBar": {
- "color": "#999999",
- "selectedColor": "#007AFF",
- "backgroundColor": "#FFFFFF",
- "borderStyle": "black",
- "list": [
- {
- "pagePath": "pages/mall/nfc/student/index",
- "text": "首页",
- "iconPath": "static/icons/home.png",
- "selectedIconPath": "static/icons/home-active.png"
- },
- {
- "pagePath": "pages/mall/nfc/student/canteen",
- "text": "饭堂",
- "iconPath": "static/icons/restaurant.png",
- "selectedIconPath": "static/icons/restaurant-active.png"
- },
- {
- "pagePath": "pages/mall/nfc/student/card-info",
- "text": "校园卡",
- "iconPath": "static/icons/card.png",
- "selectedIconPath": "static/icons/card-active.png"
- },
- {
- "pagePath": "pages/mall/nfc/student/transactions",
- "text": "记录",
- "iconPath": "static/icons/history.png",
- "selectedIconPath": "static/icons/history-active.png"
- }
- ]
- },
- "globalStyle": {
- "navigationBarTextStyle": "black",
- "navigationBarTitleText": "校园生活",
- "navigationBarBackgroundColor": "#FFFFFF",
- "backgroundColor": "#f8f9fa"
- }
-}
diff --git a/mall/pages/mall/nfc/pages-teacher.json b/mall/pages/mall/nfc/pages-teacher.json
deleted file mode 100644
index 893f28f4..00000000
--- a/mall/pages/mall/nfc/pages-teacher.json
+++ /dev/null
@@ -1,162 +0,0 @@
-{
- "pages": [
- {
- "path": "pages/mall/nfc/teacher/index",
- "style": {
- "navigationBarTitleText": "教师工作台",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/teacher/card-info",
- "style": {
- "navigationBarTitleText": "我的教师卡",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/teacher/access-permissions",
- "style": {
- "navigationBarTitleText": "门禁权限",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/teacher/student-management",
- "style": {
- "navigationBarTitleText": "学生管理",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/teacher/attendance",
- "style": {
- "navigationBarTitleText": "考勤打卡",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/teacher/class-consumption",
- "style": {
- "navigationBarTitleText": "班级消费",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/teacher/library-management",
- "style": {
- "navigationBarTitleText": "图书管理",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/teacher/visitor-approval",
- "style": {
- "navigationBarTitleText": "访客审批",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/teacher/emergency-unlock",
- "style": {
- "navigationBarTitleText": "紧急开门",
- "backgroundColor": "#fff3cd"
- }
- },
- {
- "path": "pages/mall/nfc/teacher/reports",
- "style": {
- "navigationBarTitleText": "数据报告",
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/teacher/notifications",
- "style": {
- "navigationBarTitleText": "消息通知",
- "enablePullDownRefresh": true,
- "backgroundColor": "#f8f9fa"
- }
- },
- {
- "path": "pages/mall/nfc/teacher/settings",
- "style": {
- "navigationBarTitleText": "设置",
- "backgroundColor": "#f8f9fa"
- }
- }
- ],
- "subPackages": [
- {
- "root": "pages/mall/nfc/teacher",
- "pages": [
- {
- "path": "student-detail",
- "style": {
- "navigationBarTitleText": "学生详情"
- }
- },
- {
- "path": "visitor-detail",
- "style": {
- "navigationBarTitleText": "访客详情"
- }
- },
- {
- "path": "attendance-detail",
- "style": {
- "navigationBarTitleText": "考勤详情"
- }
- },
- {
- "path": "class-report",
- "style": {
- "navigationBarTitleText": "班级报告"
- }
- }
- ]
- }
- ],
- "tabBar": {
- "color": "#999999",
- "selectedColor": "#28a745",
- "backgroundColor": "#FFFFFF",
- "borderStyle": "black",
- "list": [
- {
- "pagePath": "pages/mall/nfc/teacher/index",
- "text": "工作台",
- "iconPath": "static/icons/workspace.png",
- "selectedIconPath": "static/icons/workspace-active.png"
- },
- {
- "pagePath": "pages/mall/nfc/teacher/student-management",
- "text": "学生管理",
- "iconPath": "static/icons/students.png",
- "selectedIconPath": "static/icons/students-active.png"
- },
- {
- "pagePath": "pages/mall/nfc/teacher/attendance",
- "text": "考勤",
- "iconPath": "static/icons/attendance.png",
- "selectedIconPath": "static/icons/attendance-active.png"
- },
- {
- "pagePath": "pages/mall/nfc/teacher/reports",
- "text": "报告",
- "iconPath": "static/icons/report.png",
- "selectedIconPath": "static/icons/report-active.png"
- }
- ]
- },
- "globalStyle": {
- "navigationBarTextStyle": "black",
- "navigationBarTitleText": "教师工作台",
- "navigationBarBackgroundColor": "#FFFFFF",
- "backgroundColor": "#f8f9fa"
- }
-}
diff --git a/mall/pages/mall/nfc/parent/index.uvue b/mall/pages/mall/nfc/parent/index.uvue
deleted file mode 100644
index 49dcfe15..00000000
--- a/mall/pages/mall/nfc/parent/index.uvue
+++ /dev/null
@@ -1,635 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- {{ child.name }}
- 余额: ¥{{ child.balance }}
-
-
-
-
-
-
- 今日概况
-
-
- ¥{{ todayData.consumption }}
- 今日消费
-
- {{ todayData.change > 0 ? '+' : '' }}{{ todayData.change }}%
-
-
-
- {{ todayData.meals }}
- 用餐次数
-
-
- {{ todayData.accessCount }}
- 进出次数
-
-
-
-
-
-
-
-
- 代充值
-
-
-
- 消费限额
-
-
-
- 营养报告
-
-
-
- 位置提醒
-
-
-
-
-
-
-
-
-
- {{ item.merchant }}
- {{ formatTime(item.time) }}
-
-
- -¥{{ item.amount.toFixed(2) }}
- 余额: ¥{{ item.balanceAfter }}
-
-
-
-
-
-
-
- 营养健康
-
-
-
-
-
-
- 今日卡路里
- {{ nutritionData.calories }}kcal
-
-
- 营养均衡
- {{ nutritionData.balance }}%
-
-
- 健康评分
- {{ nutritionData.score }}分
-
-
-
-
-
-
-
- 安全提醒
-
-
-
- {{ alert.title }}
- {{ formatTime(alert.time) }}
-
- {{ alert.status }}
-
-
-
-
-
-
-
-
diff --git a/mall/pages/mall/nfc/security/index.uvue b/mall/pages/mall/nfc/security/index.uvue
deleted file mode 100644
index bebd8557..00000000
--- a/mall/pages/mall/nfc/security/index.uvue
+++ /dev/null
@@ -1,1100 +0,0 @@
-
-
-
-
-
-
-
- 实时监控
-
-
-
- {{ monitoringData.accessPoints.active }}/{{ monitoringData.accessPoints.total }}
- 在线门禁点
-
-
-
-
- {{ monitoringData.todayAccess }}
- 人次
-
-
-
-
- {{ monitoringData.currentInCampus }}
- 人员
-
-
-
-
- {{ monitoringData.alerts }}
- 待处理
-
-
-
-
-
-
- 紧急功能
-
-
-
- 紧急封锁
-
-
-
-
- 紧急开启
-
-
-
-
- 火警响应
-
-
-
-
- 紧急呼叫
-
-
-
-
-
-
-
-
-
-
- {{ visitorData.todayTotal }}
- 今日访客
-
-
- {{ visitorData.currentInside }}
- 在校访客
-
-
- {{ visitorData.pendingApproval }}
- 待审批
-
-
-
-
-
-
-
- {{ visitor.name }}
- {{ visitor.purpose }}
- {{ formatTime(visitor.enterTime) }}
-
-
- {{ getVisitorStatusText(visitor.status) }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ formatLogTime(log.time) }}
-
- {{ log.location }}
- {{ log.description }}
-
- {{ log.details }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 门禁控制
-
-
-
-
- 视频监控
-
-
-
-
- 巡逻路线
-
-
-
-
- 事件上报
-
-
-
-
-
-
- 班次信息
-
-
- 当前班次
- {{ shiftInfo.current }}
-
-
- 上班时间
- {{ shiftInfo.startTime }}
-
-
- 下班时间
- {{ shiftInfo.endTime }}
-
-
- 交班人员
- {{ shiftInfo.nextGuard }}
-
-
-
-
-
-
-
-
- 紧急联系
-
-
-
-
-
-
- {{ contact.name }}
- {{ contact.number }}
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/mall/pages/mall/nfc/student/index.uvue b/mall/pages/mall/nfc/student/index.uvue
deleted file mode 100644
index bc7cb4a9..00000000
--- a/mall/pages/mall/nfc/student/index.uvue
+++ /dev/null
@@ -1,373 +0,0 @@
-
-
-
-
-
-
-
- {{ userInfo.name }}
- 学号: {{ userInfo.studentId }}
- {{ userInfo.class }}
-
-
-
- 余额
- ¥{{ userInfo.balance }}
-
-
-
-
-
-
-
- NFC支付
-
-
-
- 付款码
-
-
-
- 充值
-
-
-
- 消费记录
-
-
-
-
-
- 校园服务
-
-
-
- 饭堂消费
-
-
-
- 小卖部
-
-
-
- 图书借阅
-
-
-
- 进出记录
-
-
-
-
-
-
- 今日数据
-
-
- {{ todayData.consumption }}
- 今日消费
-
-
- {{ todayData.transactions }}
- 交易次数
-
-
- {{ todayData.access }}
- 进出次数
-
-
-
-
-
-
- 营养分析
-
-
- 今日卡路里
- {{ nutritionData.calories }}kcal
-
-
- 营养均衡度
- {{ nutritionData.balance }}%
-
-
-
-
-
-
-
-
-
diff --git a/mall/pages/mall/nfc/student/nfc-pay.uvue b/mall/pages/mall/nfc/student/nfc-pay.uvue
deleted file mode 100644
index caeb12f7..00000000
--- a/mall/pages/mall/nfc/student/nfc-pay.uvue
+++ /dev/null
@@ -1,452 +0,0 @@
-
-
-
-
-
- {{ statusText }}
- {{ statusDesc }}
-
-
-
-
-
- ¥
- {{ paymentAmount.toFixed(2) }}
-
- {{ merchantName }}
-
-
-
-
-
-
-
-
-
-
- 当前余额
- ¥{{ userBalance.toFixed(2) }}
-
-
-
-
- 最近交易
-
-
- {{ item.merchant }}
- {{ formatTime(item.time) }}
-
- -¥{{ item.amount.toFixed(2) }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/mall/pages/mall/nfc/teacher/index.uvue b/mall/pages/mall/nfc/teacher/index.uvue
deleted file mode 100644
index 326321ca..00000000
--- a/mall/pages/mall/nfc/teacher/index.uvue
+++ /dev/null
@@ -1,912 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- {{ course.startTime }}-{{ course.endTime }}
- {{ getCourseStatus(course) }}
-
-
- {{ course.name }}
- {{ course.location }}
- {{ course.studentCount }}人
-
-
-
-
-
-
-
-
- 班级概览
-
-
- {{ classStats.totalStudents }}
- 管理学生
-
-
- {{ classStats.presentToday }}
- 今日出勤
-
-
- {{ classStats.avgConsumption }}
- 日均消费
-
-
- {{ classStats.pendingApprovals }}
- 待审批
-
-
-
-
-
-
- 快速功能
-
-
-
- 学生管理
-
- {{ newStudentNotifications }}
-
-
-
-
-
- 考勤管理
-
-
-
-
- 班级消费
-
-
-
-
- 访客审批
-
- {{ pendingVisitors }}
-
-
-
-
-
- 图书管理
-
-
-
-
- 数据报告
-
-
-
-
- 紧急开门
-
-
-
-
- 消息通知
-
- {{ unreadNotifications }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ activity.description }}
-
-
- {{ detail }}
-
-
-
-
- {{ getActivityStatusText(activity.status) }}
-
-
-
-
-
-
-
- 门禁权限
-
-
- 教师办公室
- 有权限
-
-
- 实验室A101
- 有权限
-
-
- 会议室301
- 申请中
-
-
- 图书馆管理区
- 无权限
-
-
-
-
-
-
-
- 重要通知
-
-
-
-
-
-
- {{ message.title }}
- {{ message.preview }}
-
-
- {{ formatTime(message.time) }}
-
-
-
-
-
-
-
-
-
-
diff --git a/mall/pages/mall/pages.json b/mall/pages/mall/pages.json
deleted file mode 100644
index 69ddaca0..00000000
--- a/mall/pages/mall/pages.json
+++ /dev/null
@@ -1,515 +0,0 @@
-{
- "easycom": {
- "autoscan": true,
- "custom": {
- "^mall-(.*)": "@/components/mall/$1.uvue"
- }
- },
- "pages": [
- {
- "path": "pages/mall/admin/index",
- "style": {
- "navigationBarTitleText": "管理后台",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "pages/mall/consumer/index",
- "style": {
- "navigationBarTitleText": "商城首页",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "pages/user/boot",
- "style": {
- "navigationBarTitleText": ""
- }
- },
- {
- "path": "pages/user/login",
- "style": {
- "navigationBarTitleText": "登录"
- }
- },
- {
- "path": "pages/user/register",
- "style": {
- "navigationBarTitleText": "注册"
- }
- },
- {
- "path": "pages/user/forgot-password",
- "style": {
- "navigationBarTitleText": "忘记密码"
- }
- },
- {
- "path": "pages/user/terms",
- "style": {
- "navigationBarTitleText": "用户协议与隐私政策"
- }
- },
- {
- "path": "pages/user/center",
- "style": {
- "navigationBarTitleText": "用户中心"
- }
- },
- {
- "path": "pages/user/profile",
- "style": {
- "navigationBarTitleText": "个人资料"
- }
- },
- {
- "path": "pages/mall/merchant/index",
- "style": {
- "navigationBarTitleText": "商家中心",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "pages/mall/delivery/index",
- "style": {
- "navigationBarTitleText": "配送中心",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "pages/mall/service/index",
- "style": {
- "navigationBarTitleText": "客服工作台",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "pages/mall/analytics/index",
- "style": {
- "navigationBarTitleText": "数据分析",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "pages/mall/consumer/product-detail",
- "style": {
- "navigationBarTitleText": "商品详情",
- "enablePullDownRefresh": false
- }
- },
- {
- "path": "pages/mall/consumer/order-detail",
- "style": {
- "navigationBarTitleText": "订单详情",
- "enablePullDownRefresh": false
- }
- },
- {
- "path": "pages/mall/consumer/shop-detail",
- "style": {
- "navigationBarTitleText": "店铺详情",
- "enablePullDownRefresh": false
- }
- },
- {
- "path": "pages/mall/merchant/product-detail",
- "style": {
- "navigationBarTitleText": "商品管理详情",
- "enablePullDownRefresh": false
- }
- },
- {
- "path": "pages/mall/merchant/order-detail",
- "style": {
- "navigationBarTitleText": "订单详情",
- "enablePullDownRefresh": false
- }
- },
- {
- "path": "pages/mall/merchant/shop-setting",
- "style": {
- "navigationBarTitleText": "店铺设置",
- "enablePullDownRefresh": false
- }
- },
- {
- "path": "pages/mall/delivery/order-detail",
- "style": {
- "navigationBarTitleText": "配送订单详情",
- "enablePullDownRefresh": false
- }
- },
- {
- "path": "pages/mall/delivery/route-detail",
- "style": {
- "navigationBarTitleText": "配送路线详情",
- "enablePullDownRefresh": false
- }
- },
- {
- "path": "pages/mall/admin/user-detail",
- "style": {
- "navigationBarTitleText": "用户详情",
- "enablePullDownRefresh": false
- }
- },
- {
- "path": "pages/mall/admin/merchant-detail",
- "style": {
- "navigationBarTitleText": "商家详情",
- "enablePullDownRefresh": false
- }
- },
- {
- "path": "pages/mall/admin/system-monitor",
- "style": {
- "navigationBarTitleText": "系统监控详情",
- "enablePullDownRefresh": false
- }
- },
- {
- "path": "pages/mall/service/ticket-detail",
- "style": {
- "navigationBarTitleText": "工单详情",
- "enablePullDownRefresh": false
- }
- },
- {
- "path": "pages/mall/service/user-detail",
- "style": {
- "navigationBarTitleText": "用户详情",
- "enablePullDownRefresh": false
- }
- },
- {
- "path": "pages/mall/service/chat",
- "style": {
- "navigationBarTitleText": "在线客服",
- "enablePullDownRefresh": false
- }
- },
- {
- "path": "pages/mall/analytics/report-detail",
- "style": {
- "navigationBarTitleText": "报表详情",
- "enablePullDownRefresh": false
- }
- },
- {
- "path": "pages/mall/analytics/data-detail",
- "style": {
- "navigationBarTitleText": "数据分析详情",
- "enablePullDownRefresh": false
- }
- },
- {
- "path": "pages/mall/analytics/insight-detail",
- "style": {
- "navigationBarTitleText": "数据洞察详情",
- "enablePullDownRefresh": false
- }
- }
- ],
- "subPackages": [
- {
- "root": "pages/mall/consumer",
- "pages": [
- {
- "path": "product-detail",
- "style": {
- "navigationBarTitleText": "商品详情"
- }
- },
- {
- "path": "category",
- "style": {
- "navigationBarTitleText": "商品分类"
- }
- },
- {
- "path": "cart",
- "style": {
- "navigationBarTitleText": "购物车"
- }
- },
- {
- "path": "checkout",
- "style": {
- "navigationBarTitleText": "确认订单"
- }
- },
- {
- "path": "orders",
- "style": {
- "navigationBarTitleText": "我的订单"
- }
- },
- {
- "path": "profile",
- "style": {
- "navigationBarTitleText": "个人中心"
- }
- },
- {
- "path": "coupons",
- "style": {
- "navigationBarTitleText": "我的优惠券"
- }
- },
- {
- "path": "address",
- "style": {
- "navigationBarTitleText": "收货地址"
- }
- },
- {
- "path": "subscription/plan-list",
- "style": {
- "navigationBarTitleText": "软件订阅"
- }
- },
- {
- "path": "subscription/plan-detail",
- "style": {
- "navigationBarTitleText": "订阅详情"
- }
- },
- {
- "path": "subscription/subscribe-checkout",
- "style": {
- "navigationBarTitleText": "确认订阅"
- }
- },
- {
- "path": "subscription/my-subscriptions",
- "style": {
- "navigationBarTitleText": "我的订阅"
- }
- }
- ]
- },
- {
- "root": "pages/mall/merchant",
- "pages": [
- {
- "path": "products",
- "style": {
- "navigationBarTitleText": "商品管理"
- }
- },
- {
- "path": "orders",
- "style": {
- "navigationBarTitleText": "订单管理"
- }
- },
- {
- "path": "statistics",
- "style": {
- "navigationBarTitleText": "数据统计"
- }
- },
- {
- "path": "promotions",
- "style": {
- "navigationBarTitleText": "营销活动"
- }
- },
- {
- "path": "finance",
- "style": {
- "navigationBarTitleText": "财务结算"
- }
- },
- {
- "path": "settings",
- "style": {
- "navigationBarTitleText": "店铺设置"
- }
- }
- ]
- },
- {
- "root": "pages/mall/delivery",
- "pages": [
- {
- "path": "order-history",
- "style": {
- "navigationBarTitleText": "配送记录"
- }
- },
- {
- "path": "earnings",
- "style": {
- "navigationBarTitleText": "收入明细"
- }
- },
- {
- "path": "profile",
- "style": {
- "navigationBarTitleText": "个人资料"
- }
- },
- {
- "path": "settings",
- "style": {
- "navigationBarTitleText": "设置"
- }
- }
- ]
- },
- {
- "root": "pages/mall/admin",
- "pages": [
- {
- "path": "homePage/index",
- "style": {
- "navigationBarTitleText": "管理后台首页"
- }
- }
- ]
- },
- {
- "root": "pages/mall/service",
- "pages": [
- {
- "path": "conversation",
- "style": {
- "navigationBarTitleText": "客服会话"
- }
- },
- {
- "path": "order-inquiry",
- "style": {
- "navigationBarTitleText": "订单查询"
- }
- },
- {
- "path": "refund-process",
- "style": {
- "navigationBarTitleText": "退款处理"
- }
- },
- {
- "path": "knowledge-base",
- "style": {
- "navigationBarTitleText": "知识库"
- }
- },
- {
- "path": "performance-report",
- "style": {
- "navigationBarTitleText": "绩效报表"
- }
- }
- ]
- },
- {
- "root": "pages/mall/analytics",
- "pages": [
- {
- "path": "sales-report",
- "style": {
- "navigationBarTitleText": "销售报表"
- }
- },
- {
- "path": "user-analysis",
- "style": {
- "navigationBarTitleText": "用户分析"
- }
- },
- {
- "path": "product-insights",
- "style": {
- "navigationBarTitleText": "商品洞察"
- }
- },
- {
- "path": "market-trends",
- "style": {
- "navigationBarTitleText": "市场趋势"
- }
- },
- {
- "path": "custom-report",
- "style": {
- "navigationBarTitleText": "自定义报表"
- }
- }
- ]
- }
- ],
- "tabBar": {
- "custom": true,
- "color": "#7A7E83",
- "selectedColor": "#3cc51f",
- "borderStyle": "black",
- "backgroundColor": "#ffffff",
- "list": [
- {
- "pagePath": "pages/mall/consumer/index",
- "iconPath": "static/tab-home.png",
- "selectedIconPath": "static/tab-home-current.png",
- "text": "首页"
- },
- {
- "pagePath": "pages/mall/consumer/category",
- "iconPath": "static/tab-category.png",
- "selectedIconPath": "static/tab-category-current.png",
- "text": "分类"
- },
- {
- "pagePath": "pages/mall/consumer/cart",
- "iconPath": "static/tab-cart.png",
- "selectedIconPath": "static/tab-cart-current.png",
- "text": "购物车"
- },
- {
- "pagePath": "pages/mall/consumer/profile",
- "iconPath": "static/tab-profile.png",
- "selectedIconPath": "static/tab-profile-current.png",
- "text": "我的"
- }
- ]
- },
- "globalStyle": {
- "navigationBarTextStyle": "black",
- "navigationBarTitleText": "商城系统",
- "navigationBarBackgroundColor": "#F8F8F8",
- "backgroundColor": "#F8F8F8"
- },
- "condition": {
- "current": 0,
- "list": [
- {
- "name": "管理端首页",
- "path": "pages/mall/admin/index"
- },
- {
- "name": "消费者端首页",
- "path": "pages/mall/consumer/index"
- },
- {
- "name": "启动页(登录态判断)",
- "path": "pages/user/boot"
- },
- {
- "name": "商家端首页",
- "path": "pages/mall/merchant/index"
- },
- {
- "name": "配送端首页",
- "path": "pages/mall/delivery/index"
- },
- {
- "name": "客服端首页",
- "path": "pages/mall/service/index"
- },
- {
- "name": "数据分析端首页",
- "path": "pages/mall/analytics/index"
- }
- ]
- }
-}
\ No newline at end of file
diff --git a/mall/pages/mall/service/index.uvue b/mall/pages/mall/service/index.uvue
deleted file mode 100644
index 5dbf19c5..00000000
--- a/mall/pages/mall/service/index.uvue
+++ /dev/null
@@ -1,1001 +0,0 @@
-
-
-
-
-
-
-
-
- 今日工作统计
-
-
- {{ todayStats.handled_conversations }}
- 处理会话
-
-
- {{ todayStats.resolved_issues }}
- 解决问题
-
-
- {{ todayStats.avg_response_time }}s
- 平均响应
-
-
- {{ todayStats.satisfaction_rate }}%
- 满意度
-
-
-
-
-
-
-
-
-
- 💬
- 当前没有待处理会话
- {{ isOnline ? '请保持在线,等待用户咨询' : '请上线接受用户咨询' }}
-
-
-
-
-
-
- {{ conversation.last_message }}
- {{ formatTime(conversation.last_message_time) }}
-
-
-
-
-
-
-
-
-
-
-
- 快速处理
-
-
- 📋
- 订单查询
-
-
- 💰
- 退款处理
-
-
- ⚠️
- 投诉处理
-
-
- 📚
- 知识库
-
-
- 💬
- 快捷回复
-
-
- ⬆️
- 问题升级
-
-
-
-
-
-
-
-
-
- 暂无待办事项
-
-
-
-
- {{ todo.title }}
- {{ todo.description }}
- 截止: {{ formatDeadline(todo.deadline) }}
-
-
- {{ getTodoPriorityText(todo.priority) }}
-
-
-
-
-
-
-
- 常用功能
-
-
- 📝
- 会话记录
-
-
- 📊
- 绩效报表
-
-
- 🎓
- 培训中心
-
-
- 💡
- 意见反馈
-
-
-
-
-
-
-
-
-
diff --git a/mall/pages/mall/service/profile.uvue b/mall/pages/mall/service/profile.uvue
deleted file mode 100644
index 7b35140d..00000000
--- a/mall/pages/mall/service/profile.uvue
+++ /dev/null
@@ -1,997 +0,0 @@
-
-
-
-
-
-
-
-
- 服务状态
-
-
- {{ onlineStatus === 1 ? '在线服务' : '离线状态' }}
-
-
-
-
-
- 当前排队: {{ queueCount }}人
-
-
-
-
-
-
- 工单处理
-
-
- 📋
- 全部工单
- {{ ticketCounts.total }}
-
-
- ⏳
- 待处理
- {{ ticketCounts.pending }}
-
-
- 🔄
- 处理中
- {{ ticketCounts.processing }}
-
-
- ✅
- 已完成
- {{ ticketCounts.completed }}
-
-
-
-
-
-
- 今日服务
-
-
- {{ todayStats.tickets }}
- 处理工单
-
-
- {{ todayStats.satisfaction }}%
- 满意度
-
-
- {{ todayStats.avgTime }}min
- 平均响应
-
-
- {{ todayStats.onlineTime }}h
- 在线时长
-
-
-
-
-
-
- 当前处理
-
-
-
- {{ currentTicket.title }}
- {{ currentTicket.description }}
-
-
- 客户: {{ currentTicket.user_name }}
- {{ formatTime(currentTicket.created_at) }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ ticket.title }}
- {{ getTicketStatusText(ticket.status) }}
-
-
- {{ ticket.user_name }}
- {{ formatTime(ticket.created_at) }}
-
-
-
-
- 暂无最近工单
-
-
-
-
-
-
-
-
- {{ serviceRating }}
- 综合评分
-
- ★
-
-
-
-
- {{ item.score }}星
-
-
-
- {{ item.count }}
-
-
-
-
-
-
-
- 知识库
-
-
- 📖
- 常见问题
-
-
- 📋
- 订单问题
-
-
- 💳
- 支付问题
-
-
- 🚚
- 配送问题
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/mall/pages/mall/service/ticket-detail.uvue b/mall/pages/mall/service/ticket-detail.uvue
deleted file mode 100644
index 6bf5b50b..00000000
--- a/mall/pages/mall/service/ticket-detail.uvue
+++ /dev/null
@@ -1,919 +0,0 @@
-
-
-
-
-
-
- {{ ticket.title }}
-
- {{ getCategoryText() }}
- {{ getPriorityText() }}
- {{ formatTime(ticket.created_at) }}
-
-
-
-
-
- 用户信息
-
-
-
- {{ user.nickname || user.phone }}
- {{ user.phone }}
- {{ user.email || '未设置邮箱' }}
-
-
-
-
-
-
-
-
-
-
- 问题描述
- {{ ticket.description }}
-
-
- 相关附件
-
-
- {{ getAttachmentIcon(attachment) }}
- {{ getAttachmentName(attachment) }}
-
-
-
-
-
-
-
- 处理记录
-
- 暂无处理记录
-
-
-
-
- {{ getLogActionText(log.action) }}
- {{ log.content }}
-
-
-
-
-
- 相关订单
-
-
-
- ¥{{ relatedOrder.actual_amount }}
- {{ formatTime(relatedOrder.created_at) }}
-
-
-
-
-
-
- 解决方案建议
-
- {{ suggestion.title }}
- {{ suggestion.description }}
-
-
-
-
-
- 处理操作
-
-
- 快速回复
-
- {{ reply }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/mall/pages/minimal.uvue b/mall/pages/minimal.uvue
deleted file mode 100644
index 1cfca8a3..00000000
--- a/mall/pages/minimal.uvue
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
- Minimal Test Page
- This is a minimal test page to check if uni-app-x compilation works.
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/sense/senseDataService.uts b/mall/pages/sense/senseDataService.uts
deleted file mode 100644
index bf9a50fe..00000000
--- a/mall/pages/sense/senseDataService.uts
+++ /dev/null
@@ -1,132 +0,0 @@
-import supabase, { supaReady } from '@/components/supadb/aksupainstance.uts'
-import type { DeviceInfo, DeviceParams } from './types.uts'
-
-// 服务响应类型
-export type ServiceResponse = {
- error: Error | null
- data: T | null
-}
-
-// 设备数据服务类
-export class SenseDataService {
- // 表名常量(根据实际数据库表名调整)
- private static readonly TABLE_NAME = 'sense_devices'
-
- /**
- * 获取设备列表
- */
- static async getDevices(params: DeviceParams): Promise>> {
- try {
- await supaReady
- const res = await supabase.from(SenseDataService.TABLE_NAME)
- .select('*', {})
- .eq('user_id', params.user_id)
- .execute()
-
- if (res.status >= 200 && res.status < 300 && res.data != null) {
- const data = res.data as any
- const devices = Array.isArray(data) ? data as Array : []
- return { error: null, data: devices }
- } else {
- return {
- error: new Error(`获取设备列表失败: ${res.status}`),
- data: null
- }
- }
- } catch (error) {
- return {
- error: error instanceof Error ? error : new Error(String(error)),
- data: null
- }
- }
- }
-
- /**
- * 绑定新设备
- */
- static async bindDevice(deviceData: UTSJSONObject): Promise> {
- try {
- await supaReady
- const res = await supabase.from(SenseDataService.TABLE_NAME)
- .insert(deviceData)
- .select('*', {})
- .single()
- .execute()
-
- if (res.status >= 200 && res.status < 300 && res.data != null) {
- const device = res.data as DeviceInfo
- return { error: null, data: device }
- } else {
- return {
- error: new Error(`绑定设备失败: ${res.status}`),
- data: null
- }
- }
- } catch (error) {
- return {
- error: error instanceof Error ? error : new Error(String(error)),
- data: null
- }
- }
- }
-
- /**
- * 解绑设备
- */
- static async unbindDevice(deviceId: string): Promise> {
- try {
- await supaReady
- const res = await supabase.from(SenseDataService.TABLE_NAME)
- .delete()
- .eq('id', deviceId)
- .execute()
-
- if (res.status >= 200 && res.status < 300) {
- return { error: null, data: null }
- } else {
- return {
- error: new Error(`解绑设备失败: ${res.status}`),
- data: null
- }
- }
- } catch (error) {
- return {
- error: error instanceof Error ? error : new Error(String(error)),
- data: null
- }
- }
- }
-
- /**
- * 更新设备配置
- */
- static async updateDevice(deviceId: string, configData: UTSJSONObject): Promise> {
- try {
- await supaReady
- const res = await supabase.from(SenseDataService.TABLE_NAME)
- .update(configData)
- .eq('id', deviceId)
- .select('*', {})
- .single()
- .execute()
-
- if (res.status >= 200 && res.status < 300 && res.data != null) {
- const device = res.data as DeviceInfo
- return { error: null, data: device }
- } else {
- return {
- error: new Error(`更新设备配置失败: ${res.status}`),
- data: null
- }
- }
- } catch (error) {
- return {
- error: error instanceof Error ? error : new Error(String(error)),
- data: null
- }
- }
- }
-}
-
-// 导出类型
-export type { DeviceParams }
diff --git a/mall/pages/sense/types.uts b/mall/pages/sense/types.uts
deleted file mode 100644
index c5255450..00000000
--- a/mall/pages/sense/types.uts
+++ /dev/null
@@ -1,16 +0,0 @@
-// 设备信息类型
-export type DeviceInfo = {
- id: string
- device_name?: string
- status?: string // 'online' | 'offline' | 其他状态
- user_id?: string
- // 可根据实际需求添加更多字段
- [key: string]: any
-}
-
-// 设备查询参数类型
-export type DeviceParams = {
- user_id: string
- // 可根据实际需求添加更多查询参数
- [key: string]: any
-}
diff --git a/mall/pages/test-minimal.uvue b/mall/pages/test-minimal.uvue
deleted file mode 100644
index e360fb92..00000000
--- a/mall/pages/test-minimal.uvue
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
- Hello World
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/user/bind-email.uvue b/mall/pages/user/bind-email.uvue
deleted file mode 100644
index a14235e2..00000000
--- a/mall/pages/user/bind-email.uvue
+++ /dev/null
@@ -1,179 +0,0 @@
-
-
-
-
- 邮箱
-
-
-
- 验证码
-
- {{ counting ? `${count}s` : '获取验证码' }}
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/user/bind-phone.uvue b/mall/pages/user/bind-phone.uvue
deleted file mode 100644
index db7b454b..00000000
--- a/mall/pages/user/bind-phone.uvue
+++ /dev/null
@@ -1,180 +0,0 @@
-
-
-
-
- 手机号
-
-
-
- 验证码
-
- {{ counting ? `${count}s` : '获取验证码' }}
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/user/boot.uvue b/mall/pages/user/boot.uvue
deleted file mode 100644
index a1f43b55..00000000
--- a/mall/pages/user/boot.uvue
+++ /dev/null
@@ -1,177 +0,0 @@
-
-
-
-
-
-
- Mall
- 正品保障 · 省心售后
-
-
-
-
-
- 正在检查登录状态…
- 通常数秒内自动进入首页或登录页
-
-
-
- 前往登录
- 我要注册
-
-
-
-
-
-
-
-
diff --git a/mall/pages/user/center.uvue b/mall/pages/user/center.uvue
deleted file mode 100644
index 9dd1c7c0..00000000
--- a/mall/pages/user/center.uvue
+++ /dev/null
@@ -1,686 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/user/change-password.uvue b/mall/pages/user/change-password.uvue
deleted file mode 100644
index 73feed5a..00000000
--- a/mall/pages/user/change-password.uvue
+++ /dev/null
@@ -1,128 +0,0 @@
-
-
-
-
- 旧密码
-
-
-
- 新密码
-
-
-
- 确认密码
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/user/forgot-password.uvue b/mall/pages/user/forgot-password.uvue
deleted file mode 100644
index 82988416..00000000
--- a/mall/pages/user/forgot-password.uvue
+++ /dev/null
@@ -1,495 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- Akmon
- {{ $t('user.forgot_password.title') }}
- {{ $t('user.forgot_password.subtitle') }}
-
-
-
-
-
-
-
-
-
- {{ $t('user.forgot_password.remember_password') }}
- {{ $t('user.forgot_password.login') }}
-
-
-
-
-
- ✓
- {{ $t('user.forgot_password.email_sent_title') }}
- {{ $t('user.forgot_password.email_sent_message') }}
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/user/login.uvue b/mall/pages/user/login.uvue
deleted file mode 100644
index 27e158f1..00000000
--- a/mall/pages/user/login.uvue
+++ /dev/null
@@ -1,656 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- APP 扫码登录
-
-
- 打开 APP 扫一扫
- 查看教程
-
-
-
-
-
- 二维码占位
- 220×220
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 密码登录
-
-
-
-
- 短信登录
-
-
-
-
-
-
-
-
- account = e.detail.value"
- />
-
-
- password = e.detail.value"
- />
-
-
-
-
-
- account = e.detail.value"
- />
-
-
-
- captcha = e.detail.value"
- />
-
- {{ codeText }}
-
-
-
-
-
-
- 登录
-
-
-
-
-
-
- 微信登录
-
-
- |
-
-
-
- QQ登录
-
-
- |
-
- 忘记密码
-
- |
-
- 立即注册
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/mall/pages/user/loginn.uvue b/mall/pages/user/loginn.uvue
deleted file mode 100644
index 19d645e8..00000000
--- a/mall/pages/user/loginn.uvue
+++ /dev/null
@@ -1,690 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- Trainning Monitor
- {{ $t('user.login.title') }}
- {{ $t('user.login.subtitle') }}
-
-
-
-
-
-
-
-
- {{ $t('user.login.or_login_with') }}
-
-
-
-
-
-
-
-
-
- {{ $t('user.login.no_account') }}
- {{ $t('user.login.register_now') }}
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/user/profile.uvue b/mall/pages/user/profile.uvue
deleted file mode 100644
index 28a5b2a9..00000000
--- a/mall/pages/user/profile.uvue
+++ /dev/null
@@ -1,1070 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ $t('user.profile.loading') }}
-
-
-
-
- {{ $t('user.profile.load_error') }}
-
-
-
-
-
-
-
- >
-
-
-
-
-
-
-
- {{ $t('user.profile.save_success') }}
-
-
- {{ saveError }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mall/pages/user/register.uvue b/mall/pages/user/register.uvue
deleted file mode 100644
index 5a210293..00000000
--- a/mall/pages/user/register.uvue
+++ /dev/null
@@ -1,538 +0,0 @@
-
-
-
-
-
-
-
- 注册账号
-
-
-
-
-
-
-
- email = e.detail.value"
- class="input-field"
- />
-
-
-
-
-
-
-
- password = e.detail.value"
- class="input-field"
- />
-
-
-
-
-
-
-
- confirmPassword = e.detail.value"
- class="input-field"
- />
-
-
-
-
-
-
- 注册
-
-
-
-
- 已有账号?
- 立即登录
-
-
-
-
-
-
-
- 已阅读并同意
- 《用户协议》
- 与
- 《隐私协议》
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/mall/pages/user/terms.uvue b/mall/pages/user/terms.uvue
deleted file mode 100644
index 8418059a..00000000
--- a/mall/pages/user/terms.uvue
+++ /dev/null
@@ -1,131 +0,0 @@
-
-
-
- 返回
- 用户协议与隐私政策
-
-
-
-
-
- 用户协议
- 1. 本应用为商城系统示例/项目使用。
-
- 2. 你在使用本应用服务时,应遵守法律法规与平台规则。
-
- 3. 账号与密码由你自行保管,因泄露造成的损失由你自行承担。
-
-
-
-
- 隐私政策
- 1. 我们可能会收集你提供的邮箱等信息,用于账号注册与登录。
-
- 2. 我们会采取合理的安全措施保护你的信息安全。
-
- 3. 你可以在账号相关页面申请修改或删除个人信息(以实际功能为准)。
-
-
-
-
-
-
-
-
-
-
-
diff --git a/mall/pages/user/test/CONFIG_CHANGED.md b/mall/pages/user/test/CONFIG_CHANGED.md
deleted file mode 100644
index 0e983ccf..00000000
--- a/mall/pages/user/test/CONFIG_CHANGED.md
+++ /dev/null
@@ -1,100 +0,0 @@
-# Supabase 配置已修改
-
-## ✅ 已完成的修改
-
-已修改 `supabase_pro/.env` 文件:
-
-```env
-ENABLE_EMAIL_AUTOCONFIRM=true # 从 false 改为 true
-```
-
-## 🔄 下一步操作
-
-### 重启 Supabase Auth 服务
-
-修改配置后,**必须重启服务**才能生效:
-
-```bash
-cd supabase_pro
-docker-compose restart auth
-```
-
-或者重启整个 Supabase:
-
-```bash
-docker-compose restart
-```
-
-### 验证配置
-
-```bash
-# 检查配置是否已修改
-grep ENABLE_EMAIL_AUTOCONFIRM supabase_pro/.env
-```
-
-应该显示:`ENABLE_EMAIL_AUTOCONFIRM=true`
-
----
-
-## 📝 配置说明
-
-### 当前配置
-
-- ✅ `ENABLE_EMAIL_SIGNUP=true` - 允许邮箱注册
-- ✅ `ENABLE_EMAIL_AUTOCONFIRM=true` - **跳过邮件验证**,注册后立即可以登录
-
-### 效果
-
-1. **注册时**:
- - 用户填写邮箱和密码
- - 点击注册
- - Supabase 直接创建用户(不发送邮件)
- - 返回 session,用户自动登录
-
-2. **登录时**:
- - 使用注册的邮箱和密码
- - 可以直接登录(无需邮箱确认)
-
----
-
-## 🧪 测试步骤
-
-1. **重启服务**(如果还没重启)
- ```bash
- cd supabase_pro
- docker-compose restart auth
- ```
-
-2. **测试注册**:
- - 在前端注册新用户
- - 应该看到 "注册成功" 提示
- - 自动跳转到登录页面(或直接进入应用)
-
-3. **测试登录**:
- - 使用注册的邮箱和密码登录
- - 应该可以成功登录
-
-4. **验证数据库**:
- ```sql
- -- 检查新注册的用户
- SELECT id, email, email_confirmed_at, created_at
- FROM auth.users
- ORDER BY created_at DESC
- LIMIT 5;
-
- -- 检查 ak_users 表
- SELECT id, email, username, created_at
- FROM ak_users
- ORDER BY created_at DESC
- LIMIT 5;
- ```
-
----
-
-## ⚠️ 重要提示
-
-- **修改配置后必须重启服务**,否则配置不会生效
-- 如果重启后仍然无法注册,检查服务日志:
- ```bash
- docker-compose logs auth
- ```
diff --git a/mall/pages/user/test/DEBUG_SIGNUP.md b/mall/pages/user/test/DEBUG_SIGNUP.md
deleted file mode 100644
index 30ac5940..00000000
--- a/mall/pages/user/test/DEBUG_SIGNUP.md
+++ /dev/null
@@ -1,167 +0,0 @@
-# 注册问题调试指南
-
-## 🔍 当前问题
-
-修改配置后,注册仍然没有创建用户记录。
-
-## 📋 检查清单
-
-### 1. 确认配置已修改并重启服务
-
-```bash
-# 检查配置
-cd supabase_pro
-grep ENABLE_EMAIL_AUTOCONFIRM .env
-# 应该显示: ENABLE_EMAIL_AUTOCONFIRM=true
-
-# 重启服务(必须)
-docker-compose restart auth
-# 或者
-docker-compose restart
-```
-
-### 2. 检查 Supabase 服务是否正常运行
-
-```bash
-cd supabase_pro
-docker-compose ps
-```
-
-确保 `auth` 服务状态为 `Up`。
-
-### 3. 检查服务日志
-
-```bash
-# 查看 auth 服务日志
-docker-compose logs auth --tail=50
-
-# 查看是否有错误
-docker-compose logs auth | grep -i error
-```
-
-### 4. 验证配置是否生效
-
-在 Supabase Dashboard (http://192.168.1.61:3000) 的 SQL Editor 中执行:
-
-```sql
--- 检查当前配置(需要访问 GoTrue 配置)
--- 注意:这个查询可能无法直接执行,但可以通过 API 检查
-```
-
-或者直接测试注册,查看返回结果。
-
----
-
-## 🔧 调试步骤
-
-### 步骤 1:检查前端配置
-
-确认 `ak/config.uts` 中的配置正确:
-
-```typescript
-export const SUPA_URL: string = 'http://192.168.1.61:8000'
-export const SUPA_KEY: string = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
-```
-
-### 步骤 2:测试注册并查看日志
-
-1. 打开浏览器开发者工具(F12)
-2. 切换到 Console 标签
-3. 尝试注册新用户
-4. 查看控制台输出:
- - `📝 signUp HTTP 状态码: ...`
- - `📝 注册返回结果: ...`
- - `📝 错误代码: ...`
- - `✅ 找到 user 字段: ...` 或 `⚠️ 未找到 user 信息`
-
-### 步骤 3:检查返回结果
-
-根据控制台日志,判断:
-
-**情况 A:HTTP 状态码 200,有 user 字段**
-- ✅ 注册成功
-- 检查 `ak_users` 表是否有记录
-- 如果没有,检查 `ensureUserProfile` 是否被调用
-
-**情况 B:HTTP 状态码 500,错误信息包含 "confirmation email"**
-- ❌ 配置未生效或服务未重启
-- 需要重启 Supabase Auth 服务
-
-**情况 C:HTTP 状态码 400,错误信息包含 "already registered"**
-- ⚠️ 用户已存在
-- 尝试登录或使用其他邮箱
-
----
-
-## 🐛 常见问题
-
-### 问题 1:配置已修改但服务未重启
-
-**症状**:仍然返回 500 错误
-
-**解决**:
-```bash
-cd supabase_pro
-docker-compose restart auth
-# 等待几秒钟让服务启动
-docker-compose ps # 确认服务已启动
-```
-
-### 问题 2:服务重启失败
-
-**检查**:
-```bash
-docker-compose logs auth
-```
-
-**可能原因**:
-- 配置文件语法错误
-- 端口被占用
-- Docker 服务未运行
-
-### 问题 3:注册成功但 ak_users 没有记录
-
-**检查**:
-1. 查看控制台是否有 `✅ 用户资料创建成功` 日志
-2. 如果没有,检查 `ensureUserProfile` 是否被调用
-3. 检查 RLS 策略和触发器是否已创建
-
----
-
-## 📝 已改进的代码
-
-1. **`signUp` 方法**:
- - ✅ 添加 HTTP 状态码检查
- - ✅ 添加详细日志
- - ✅ 返回错误信息时包含状态码
-
-2. **注册页面**:
- - ✅ 添加更详细的日志输出
- - ✅ 检查所有可能的返回结构
- - ✅ 明确错误提示
-
----
-
-## 🎯 下一步操作
-
-1. **重启 Supabase Auth 服务**(如果还没重启)
-2. **测试注册**,查看控制台日志
-3. **根据日志判断问题**:
- - 如果 HTTP 状态码是 200 且有 user,说明注册成功
- - 如果 HTTP 状态码是 500,说明配置未生效,需要重启服务
- - 如果 HTTP 状态码是 400,可能是用户已存在或其他错误
-
-4. **检查数据库**:
- ```sql
- -- 检查 auth.users
- SELECT id, email, email_confirmed_at, created_at
- FROM auth.users
- ORDER BY created_at DESC
- LIMIT 5;
-
- -- 检查 ak_users
- SELECT id, email, username, created_at
- FROM ak_users
- ORDER BY created_at DESC
- LIMIT 5;
- ```
diff --git a/mall/pages/user/test/EMAIL_CONFIG_FIX.md b/mall/pages/user/test/EMAIL_CONFIG_FIX.md
deleted file mode 100644
index 0dad7735..00000000
--- a/mall/pages/user/test/EMAIL_CONFIG_FIX.md
+++ /dev/null
@@ -1,121 +0,0 @@
-# 注册邮件发送失败问题修复指南
-
-## 🔍 问题描述
-
-注册时出现错误:`Error sending confirmation email` (500 Internal Server Error)
-
-**原因**:
-- Supabase 配置了 `ENABLE_EMAIL_AUTOCONFIRM=false`,需要发送确认邮件
-- SMTP 配置使用的是假服务(`supabase-mail`, `fake_mail_user`),无法发送邮件
-- 当 Supabase 尝试发送邮件时失败,返回 500 错误
-
-## ✅ 解决方案
-
-### 方案一:启用自动确认(推荐,开发环境)
-
-修改 `supabase_pro/.env` 文件:
-
-```env
-## Email auth
-ENABLE_EMAIL_SIGNUP=true
-ENABLE_EMAIL_AUTOCONFIRM=true # 改为 true,跳过邮件验证
-```
-
-**优点**:
-- 注册后立即可以登录,无需邮件验证
-- 适合开发和测试环境
-
-**缺点**:
-- 生产环境建议使用真实的邮件服务
-
----
-
-### 方案二:配置真实的 SMTP 服务
-
-修改 `supabase_pro/.env` 文件,配置真实的 SMTP 服务:
-
-```env
-## Email auth
-ENABLE_EMAIL_SIGNUP=true
-ENABLE_EMAIL_AUTOCONFIRM=false
-SMTP_ADMIN_EMAIL=your-admin@example.com
-SMTP_HOST=smtp.example.com # 真实的 SMTP 服务器
-SMTP_PORT=587 # 或 465 (SSL)
-SMTP_USER=your-smtp-user
-SMTP_PASS=your-smtp-password
-SMTP_SENDER_NAME=Your App Name
-```
-
-**常用 SMTP 服务**:
-- Gmail: `smtp.gmail.com:587`
-- 163: `smtp.163.com:465`
-- QQ: `smtp.qq.com:587`
-- SendGrid, Mailgun 等第三方服务
-
----
-
-### 方案三:使用 Supabase 本地邮件服务(开发环境)
-
-如果使用 Docker Compose 运行 Supabase,可以使用内置的邮件服务:
-
-1. 确保 `supabase-mail` 服务正常运行
-2. 检查邮件服务日志:
- ```bash
- docker-compose logs supabase-mail
- ```
-3. 如果服务未运行,启动它:
- ```bash
- docker-compose up -d supabase-mail
- ```
-
----
-
-## 🔧 已实施的代码修复
-
-已改进注册页面的错误处理:
-
-1. **检查邮件发送失败错误**:如果返回 500 错误且错误信息包含 "confirmation email",会给出友好提示
-2. **即使邮件发送失败,用户可能已创建**:提示用户稍后尝试登录
-3. **改进错误提示**:更清晰的错误信息
-
----
-
-## 📝 验证步骤
-
-1. **修改配置后,重启 Supabase**:
- ```bash
- cd supabase_pro
- docker-compose restart auth
- ```
-
-2. **测试注册**:
- - 尝试注册新用户
- - 如果使用 `ENABLE_EMAIL_AUTOCONFIRM=true`,应该立即可以登录
- - 如果使用真实 SMTP,检查邮箱是否收到确认邮件
-
-3. **检查数据库**:
- ```sql
- -- 检查 auth.users 表中是否有新用户
- SELECT id, email, email_confirmed_at, created_at
- FROM auth.users
- ORDER BY created_at DESC
- LIMIT 5;
-
- -- 检查 ak_users 表中是否有对应记录
- SELECT id, email, username, created_at
- FROM ak_users
- ORDER BY created_at DESC
- LIMIT 5;
- ```
-
----
-
-## 🎯 推荐配置(开发环境)
-
-```env
-## Email auth
-ENABLE_EMAIL_SIGNUP=true
-ENABLE_EMAIL_AUTOCONFIRM=true # 开发环境跳过邮件验证
-```
-
-这样注册后可以立即登录,无需等待邮件确认。
diff --git a/mall/pages/user/test/IMMEDIATE_FIX.md b/mall/pages/user/test/IMMEDIATE_FIX.md
deleted file mode 100644
index 4e072b39..00000000
--- a/mall/pages/user/test/IMMEDIATE_FIX.md
+++ /dev/null
@@ -1,115 +0,0 @@
-# 立即修复注册问题
-
-## 🚨 当前问题
-
-注册时返回 500 错误,Supabase 中没有创建用户记录。
-
-**原因**:
-- `ENABLE_EMAIL_AUTOCONFIRM=false` - 需要发送确认邮件
-- SMTP 配置错误(`supabase-mail` 服务无法发送邮件)
-- 当邮件发送失败时,Supabase 不会创建用户
-
-## ✅ 立即解决方案
-
-### 步骤 1:修改 Supabase 配置
-
-编辑文件:`supabase_pro/.env`
-
-找到这一行:
-```env
-ENABLE_EMAIL_AUTOCONFIRM=false
-```
-
-改为:
-```env
-ENABLE_EMAIL_AUTOCONFIRM=true
-```
-
-### 步骤 2:重启 Supabase Auth 服务
-
-```bash
-cd supabase_pro
-docker-compose restart auth
-```
-
-或者重启整个 Supabase:
-```bash
-docker-compose restart
-```
-
-### 步骤 3:验证配置
-
-```bash
-# 检查配置是否生效
-grep ENABLE_EMAIL_AUTOCONFIRM supabase_pro/.env
-```
-
-应该显示:`ENABLE_EMAIL_AUTOCONFIRM=true`
-
-### 步骤 4:测试注册
-
-1. 在前端注册新用户
-2. 应该看到 "注册成功" 提示
-3. 自动跳转到登录页面
-4. 使用注册的邮箱和密码登录
-5. 应该可以成功登录
-
----
-
-## 🔍 验证用户是否创建
-
-在 Supabase Dashboard (http://192.168.1.61:3000) 的 SQL Editor 中执行:
-
-```sql
--- 检查最新注册的用户
-SELECT id, email, email_confirmed_at, created_at
-FROM auth.users
-ORDER BY created_at DESC
-LIMIT 5;
-
--- 检查 ak_users 表
-SELECT id, email, username, created_at
-FROM ak_users
-ORDER BY created_at DESC
-LIMIT 5;
-```
-
----
-
-## 📝 配置说明
-
-### 开发环境推荐配置
-
-```env
-## Email auth
-ENABLE_EMAIL_SIGNUP=true
-ENABLE_EMAIL_AUTOCONFIRM=true # 跳过邮件验证,注册后立即可以登录
-```
-
-**优点**:
-- ✅ 注册后立即可以登录
-- ✅ 无需配置 SMTP 服务
-- ✅ 适合开发和测试
-
-### 生产环境配置
-
-如果需要邮件验证,配置真实的 SMTP 服务:
-
-```env
-ENABLE_EMAIL_AUTOCONFIRM=false
-SMTP_HOST=smtp.example.com
-SMTP_PORT=587
-SMTP_USER=your-smtp-user
-SMTP_PASS=your-smtp-password
-```
-
----
-
-## ⚠️ 重要提示
-
-**修改配置后必须重启 Supabase Auth 服务**,否则配置不会生效。
-
-```bash
-cd supabase_pro
-docker-compose restart auth
-```
diff --git a/mall/pages/user/test/QUICK_FIX.md b/mall/pages/user/test/QUICK_FIX.md
deleted file mode 100644
index 184941cd..00000000
--- a/mall/pages/user/test/QUICK_FIX.md
+++ /dev/null
@@ -1,121 +0,0 @@
-# 注册后数据未存储到数据库 - 快速修复指南
-
-## 🔍 问题原因
-
-当前配置 `ENABLE_EMAIL_AUTOCONFIRM=false`,注册后:
-- ✅ `auth.users` 表中会创建用户记录
-- ❌ 没有 session(不自动登录)
-- ❌ 没有 token
-- ❌ RLS 策略阻止插入 `ak_users`(因为 `auth.uid()` 返回 null)
-
-## ✅ 解决方案(两种方式)
-
-### 方式一:使用数据库触发器(推荐,完全自动化)
-
-**优点**:注册时自动创建 `ak_users` 记录,无需前端处理
-
-**执行步骤**:
-
-1. **在 Supabase Dashboard (http://192.168.1.61:3000) 中打开 SQL Editor**
-
-2. **执行 `USER_AUTH_SCHEMA.sql`**
- - 创建 `ak_users` 表和 RLS 策略
- - 创建 `upsert_user_profile` RPC 函数
-
-3. **执行 `USER_AUTH_TRIGGER.sql`**
- - 创建触发器,在 `auth.users` 插入时自动创建 `ak_users` 记录
-
-4. **验证**
- ```sql
- -- 检查触发器是否存在
- SELECT tgname FROM pg_trigger WHERE tgname = 'on_auth_user_created';
-
- -- 检查函数是否存在
- SELECT proname FROM pg_proc WHERE proname = 'handle_new_user';
- ```
-
-5. **测试**
- - 在前端注册一个新用户
- - 检查 `ak_users` 表是否有新记录:
- ```sql
- SELECT * FROM ak_users ORDER BY created_at DESC LIMIT 5;
- ```
-
----
-
-### 方式二:仅使用 RPC 函数(如果触发器无法创建)
-
-**执行步骤**:
-
-1. **在 Supabase Dashboard 中执行 `USER_AUTH_SCHEMA.sql`**
-
-2. **验证 RPC 函数**
- ```sql
- -- 检查函数是否存在
- SELECT proname FROM pg_proc WHERE proname = 'upsert_user_profile';
-
- -- 检查权限
- SELECT grantee, privilege_type
- FROM information_schema.routine_privileges
- WHERE routine_name = 'upsert_user_profile';
- ```
-
-3. **测试注册**
- - 前端代码会自动调用 `upsert_user_profile` RPC 函数
- - 检查 `ak_users` 表是否有新记录
-
----
-
-## 🔧 如果数据仍然没有存储
-
-### 检查清单
-
-1. **确认 RPC 函数已创建**
- ```sql
- SELECT proname, prosrc FROM pg_proc WHERE proname = 'upsert_user_profile';
- ```
- 如果返回空,说明函数未创建,需要执行 `USER_AUTH_SCHEMA.sql`
-
-2. **确认触发器已创建**(如果使用了方式一)
- ```sql
- SELECT tgname, tgenabled FROM pg_trigger WHERE tgname = 'on_auth_user_created';
- ```
- 如果返回空,需要执行 `USER_AUTH_TRIGGER.sql`
-
-3. **检查浏览器控制台**
- - 打开浏览器开发者工具
- - 查看 Console 标签
- - 注册时应该看到:
- - `注册返回结果: {...}`
- - `✅ 用户资料创建成功: ...` 或 `⚠️ 用户资料创建失败`
-
-4. **检查 RPC 调用错误**
- - 如果看到 `RPC 创建用户资料失败`,检查:
- - RPC 函数是否存在
- - 函数参数是否正确
- - 网络请求是否成功
-
----
-
-## 📝 当前代码逻辑
-
-注册流程:
-1. 调用 `supa.signUp()` → 在 `auth.users` 中创建用户
-2. 获取 `user` 对象
-3. 调用 `ensureUserProfile(user)` → 内部调用 `upsert_user_profile` RPC 函数
-4. RPC 函数使用 `SECURITY DEFINER` → 绕过 RLS,创建 `ak_users` 记录
-
-**如果 RPC 函数不存在**,会回退到直接插入,但会失败(因为 RLS 阻止)。
-
----
-
-## 🎯 推荐操作
-
-**立即执行**:
-
-1. 在 Supabase Dashboard 执行 `pages/user/test/USER_AUTH_SCHEMA.sql`
-2. 在 Supabase Dashboard 执行 `pages/user/test/USER_AUTH_TRIGGER.sql`
-3. 测试注册功能
-4. 检查 `ak_users` 表是否有新记录
-
-**如果触发器创建失败**(权限问题),只执行 `USER_AUTH_SCHEMA.sql` 也可以,前端会使用 RPC 函数。
diff --git a/mall/pages/user/test/QUICK_FIX_SIGNUP_LOGIN.md b/mall/pages/user/test/QUICK_FIX_SIGNUP_LOGIN.md
deleted file mode 100644
index 12172425..00000000
--- a/mall/pages/user/test/QUICK_FIX_SIGNUP_LOGIN.md
+++ /dev/null
@@ -1,166 +0,0 @@
-# 注册和登录问题快速修复指南
-
-## 🔍 当前问题
-
-1. **注册时**:返回 500 错误 `Error sending confirmation email`
-2. **登录时**:返回 400 错误 `Invalid login credentials`
-
-**根本原因**:
-- `ENABLE_EMAIL_AUTOCONFIRM=false` - 需要邮件确认才能登录
-- SMTP 配置是假的(`supabase-mail`, `fake_mail_user`),无法发送邮件
-- 即使注册时邮件发送失败,用户可能已在 `auth.users` 中创建,但因为邮箱未确认,无法登录
-
----
-
-## ✅ 立即解决方案(推荐)
-
-### 修改 Supabase 配置
-
-编辑 `supabase_pro/.env` 文件:
-
-```env
-## Email auth
-ENABLE_EMAIL_SIGNUP=true
-ENABLE_EMAIL_AUTOCONFIRM=true # 改为 true,跳过邮件验证
-```
-
-### 重启 Supabase Auth 服务
-
-```bash
-cd supabase_pro
-docker-compose restart auth
-```
-
-### 验证
-
-1. **测试注册**:注册新用户,应该立即可以登录
-2. **测试登录**:使用注册的邮箱和密码登录
-
----
-
-## 🔧 如果用户已创建但邮箱未确认
-
-如果之前注册的用户因为邮件发送失败而无法登录,可以手动确认邮箱:
-
-### 方法一:在 Supabase Dashboard 中手动确认
-
-1. 打开 Supabase Dashboard: http://192.168.1.61:3000
-2. 进入 **Authentication** → **Users**
-3. 找到对应的用户
-4. 点击用户,在详情页中点击 **Confirm Email** 按钮
-
-### 方法二:使用 SQL 手动确认
-
-在 Supabase Dashboard 的 SQL Editor 中执行:
-
-```sql
--- 查找未确认的用户
-SELECT id, email, email_confirmed_at, created_at
-FROM auth.users
-WHERE email_confirmed_at IS NULL
-ORDER BY created_at DESC;
-
--- 手动确认邮箱(替换 'user-email@example.com' 为实际邮箱)
-UPDATE auth.users
-SET email_confirmed_at = NOW()
-WHERE email = 'user-email@example.com'
- AND email_confirmed_at IS NULL;
-```
-
----
-
-## 📝 已改进的错误处理
-
-### 注册页面
-- ✅ 检测邮件发送失败错误(500 + "confirmation email")
-- ✅ 即使邮件发送失败,也会提示用户稍后尝试登录
-- ✅ 更友好的错误提示
-
-### 登录页面
-- ✅ 检测邮箱未确认错误
-- ✅ 检测凭证错误
-- ✅ 更清晰的错误提示
-
----
-
-## 🎯 推荐配置(开发环境)
-
-```env
-## Email auth
-ENABLE_EMAIL_SIGNUP=true
-ENABLE_EMAIL_AUTOCONFIRM=true # 开发环境跳过邮件验证
-```
-
-**优点**:
-- 注册后立即可以登录
-- 无需配置 SMTP 服务
-- 适合开发和测试
-
-**注意**:生产环境建议使用真实的 SMTP 服务并启用邮件验证。
-
----
-
-## 🔍 验证步骤
-
-### 1. 检查配置是否生效
-
-```bash
-# 检查环境变量
-cd supabase_pro
-grep ENABLE_EMAIL_AUTOCONFIRM .env
-```
-
-应该显示:`ENABLE_EMAIL_AUTOCONFIRM=true`
-
-### 2. 测试注册流程
-
-1. 在前端注册新用户
-2. 应该看到 "注册成功" 提示
-3. 自动跳转到登录页面
-4. 使用注册的邮箱和密码登录
-5. 应该可以成功登录
-
-### 3. 检查数据库
-
-```sql
--- 检查新注册的用户
-SELECT id, email, email_confirmed_at, created_at
-FROM auth.users
-ORDER BY created_at DESC
-LIMIT 5;
-
--- 检查 ak_users 表
-SELECT id, email, username, created_at
-FROM ak_users
-ORDER BY created_at DESC
-LIMIT 5;
-```
-
----
-
-## 🐛 如果仍然无法登录
-
-### 检查用户是否已创建
-
-```sql
--- 检查用户是否存在
-SELECT id, email, email_confirmed_at, encrypted_password IS NOT NULL as has_password
-FROM auth.users
-WHERE email = 'your-email@example.com';
-```
-
-### 如果用户存在但未确认
-
-使用上面的 SQL 手动确认邮箱。
-
-### 如果用户不存在
-
-重新注册,确保配置 `ENABLE_EMAIL_AUTOCONFIRM=true` 已生效。
-
----
-
-## 📚 相关文档
-
-- `EMAIL_CONFIG_FIX.md` - 详细的邮件配置说明
-- `QUICK_FIX.md` - 注册数据存储问题修复
-- `README.md` - 用户认证相关 SQL 文件说明
diff --git a/mall/pages/user/test/README.md b/mall/pages/user/test/README.md
deleted file mode 100644
index aabf1789..00000000
--- a/mall/pages/user/test/README.md
+++ /dev/null
@@ -1,208 +0,0 @@
-# 用户认证相关 SQL 文件说明
-
-> 本目录包含用户登录/注册相关的数据库表结构和触发器。
-
-## 📁 文件说明
-
-### 1. `USER_AUTH_SCHEMA.sql` ⭐ **第一步**
-
-创建用户认证相关的表结构:
-
-- **`ak_users`** - 业务用户资料表(与 `auth.users` 关联)
-- **`users`** - 轻量用户表(用于统计)
-- **`user_sessions`** - 用户会话表(用于在线统计)
-- **RLS 策略** - 行级安全策略
-- **触发器** - 自动更新 `updated_at` 字段
-- **RPC 函数** - `upsert_user_profile`(用于创建/更新用户资料,绕过 RLS)
-
-**执行顺序**:首次部署时执行
-
-**执行方式**:在 Supabase Dashboard 的 SQL Editor 中执行
-
----
-
-### 2. `USER_AUTH_TRIGGER.sql` ⭐ **第二步(推荐)**
-
-创建数据库触发器,在 `auth.users` 表插入新用户时自动创建 `ak_users` 记录。
-
-**优点**:
-- 完全自动化,无需前端处理
-- 即使邮箱验证开启也能正常工作
-- 不依赖前端 token
-
-**执行顺序**:在 `USER_AUTH_SCHEMA.sql` 之后执行
-
-**执行方式**:在 Supabase Dashboard 的 SQL Editor 中执行(需要 superuser 权限,Dashboard 默认有)
-
-**注意**:如果无法创建触发器(权限问题),可以跳过此文件,使用 RPC 函数方案。
-
----
-
-### 3. `USER_AUTH_TEST_DATA.sql`(可选)
-
-插入测试用户数据,用于开发和测试。
-
-**执行顺序**:在表结构创建后执行
-
----
-
-## 🚀 快速部署
-
-### 方式一:使用触发器(推荐)
-
-1. **执行表结构**
- ```sql
- -- 在 Supabase Dashboard 执行
- -- 复制 pages/user/test/USER_AUTH_SCHEMA.sql 的内容并执行
- ```
-
-2. **创建触发器**
- ```sql
- -- 在 Supabase Dashboard 执行
- -- 复制 pages/user/test/USER_AUTH_TRIGGER.sql 的内容并执行
- ```
-
-3. **验证**
- ```sql
- -- 检查函数是否存在
- SELECT * FROM pg_proc WHERE proname = 'upsert_user_profile';
-
- -- 检查触发器是否存在(如果执行了 USER_AUTH_TRIGGER.sql)
- SELECT * FROM pg_trigger WHERE tgname = 'on_auth_user_created';
- ```
-
-### 方式二:仅使用 RPC 函数(如果触发器无法创建)
-
-1. **执行表结构**
- ```sql
- -- 在 Supabase Dashboard 执行
- -- 复制 pages/user/test/USER_AUTH_SCHEMA.sql 的内容并执行
- ```
-
-2. **验证 RPC 函数**
- ```sql
- -- 检查函数是否存在
- SELECT * FROM pg_proc WHERE proname = 'upsert_user_profile';
- ```
-
----
-
-## 🔧 工作原理
-
-### 方案一:数据库触发器(推荐)
-
-1. 用户注册 → Supabase Auth 在 `auth.users` 表中创建记录
-2. 数据库触发器自动执行 → 在 `ak_users` 表中创建对应记录
-3. 前端无需处理 → 用户资料自动创建
-
-### 方案二:RPC 函数
-
-1. 用户注册 → 前端获取 user 对象
-2. 前端调用 `ensureUserProfile()` → 内部调用 `upsert_user_profile` RPC 函数
-3. RPC 函数使用 `SECURITY DEFINER` → 绕过 RLS 策略,创建用户资料
-
----
-
-## ⚠️ 重要说明
-
-### RLS 策略
-
-`ak_users` 表已启用 RLS,策略如下:
-
-- **SELECT**:用户只能查看自己的资料(`auth.uid() = id`)
-- **INSERT**:用户只能插入自己的资料(`auth.uid() = id`)
-- **UPDATE**:用户只能更新自己的资料(`auth.uid() = id`)
-
-### 注册时的问题
-
-注册时,如果邮箱验证未开启,Supabase 会返回 session,此时有 token,可以直接插入。
-
-如果邮箱验证已开启,注册后没有 session,此时没有 token,`auth.uid()` 返回 `null`,RLS 策略会阻止插入。
-
-**解决方案**:
-1. ✅ 使用数据库触发器(自动创建,无需 token)
-2. ✅ 使用 `SECURITY DEFINER` RPC 函数(绕过 RLS)
-3. ⚠️ 用户登录后自动创建(在 `getCurrentUser` 中处理)
-
----
-
-## 🔍 验证和测试
-
-### 测试注册流程
-
-1. **注册新用户**
- - 在前端注册页面输入邮箱和密码
- - 点击注册
-
-2. **检查数据库**
- ```sql
- -- 检查 auth.users 表中是否有新用户
- SELECT id, email, created_at FROM auth.users ORDER BY created_at DESC LIMIT 5;
-
- -- 检查 ak_users 表中是否有对应记录
- SELECT id, email, username, created_at FROM ak_users ORDER BY created_at DESC LIMIT 5;
- ```
-
-3. **如果 ak_users 中没有记录**
- - 检查是否执行了 `USER_AUTH_TRIGGER.sql`
- - 检查触发器是否创建成功
- - 检查 RPC 函数是否创建成功
- - 查看浏览器控制台的错误信息
-
----
-
-## 📚 相关文件
-
-- `pages/user/register.uvue` - 注册页面
-- `pages/user/login.uvue` - 登录页面
-- `utils/sapi.uts` - `ensureUserProfile` 函数
-- `utils/store.uts` - `getCurrentUser` 函数(登录后自动创建资料)
-
----
-
-## 🐛 故障排查
-
-### 问题:注册后 `ak_users` 表中没有记录
-
-**可能原因**:
-1. 未执行 `USER_AUTH_SCHEMA.sql`(RPC 函数不存在)
-2. 未执行 `USER_AUTH_TRIGGER.sql`(触发器不存在)
-3. RLS 策略阻止插入(没有 token)
-4. 邮箱验证已开启,注册后没有 session
-
-**解决方案**:
-1. 执行 `USER_AUTH_SCHEMA.sql` 创建 RPC 函数
-2. 执行 `USER_AUTH_TRIGGER.sql` 创建触发器(推荐)
-3. 或者等待用户登录后自动创建(在 `getCurrentUser` 中处理)
-
-### 问题:RPC 函数调用失败
-
-**检查**:
-```sql
--- 检查函数是否存在
-SELECT proname, prosrc FROM pg_proc WHERE proname = 'upsert_user_profile';
-
--- 检查权限
-SELECT grantee, privilege_type
-FROM information_schema.routine_privileges
-WHERE routine_name = 'upsert_user_profile';
-```
-
-**解决**:重新执行 `USER_AUTH_SCHEMA.sql` 中的函数创建部分。
-
----
-
-## ✅ 下一步
-
-执行完 SQL 文件后:
-
-1. **测试注册功能**
- - 在前端注册新用户
- - 检查 `ak_users` 表中是否有新记录
-
-2. **测试登录功能**
- - 使用注册的账号登录
- - 检查是否能正常获取用户资料
-
-3. **检查前端页面**
- - 个人中心页面是否能正常显示用户信息
diff --git a/mall/pages/user/test/USER_AUTH_SCHEMA.sql b/mall/pages/user/test/USER_AUTH_SCHEMA.sql
deleted file mode 100644
index e44292e3..00000000
--- a/mall/pages/user/test/USER_AUTH_SCHEMA.sql
+++ /dev/null
@@ -1,145 +0,0 @@
--- ============================================
--- 用户登录 / 注册 - 核心用户资料表结构(创建版 / Create-only)
--- ============================================
--- 用途:创建核心业务用户资料表(ak_users)及其相关函数和 RLS 策略。
--- 特点:
--- 1. 不做 DROP/DELETE/TRUNCATE(不清空数据)
--- 2. 通过 IF NOT EXISTS + 系统表判断,实现可重复执行
--- 3. 职责单一:只负责 ak_users,不涉及其他基础表
--- 4. 依赖:应在基础表(01_create_tables.sql)之后执行
--- ============================================
-
--- ============================================
--- 1. 业务用户资料表 ak_users
--- ============================================
-
-CREATE TABLE IF NOT EXISTS public.ak_users (
- id uuid primary key,
- username text,
- email text,
- gender text,
- birthday date,
- height_cm numeric,
- weight_kg numeric,
- bio text,
- avatar_url text,
- preferred_language text,
- role text,
- school_id text,
- grade_id text,
- class_id text,
- created_at timestamptz default now(),
- updated_at timestamptz default now()
-);
-
--- 中文注释
-COMMENT ON TABLE public.ak_users IS '业务用户资料表(与 auth.users 一一对应)';
-COMMENT ON COLUMN public.ak_users.id IS '用户ID(等于 auth.users.id)';
-COMMENT ON COLUMN public.ak_users.username IS '用户名/昵称';
-COMMENT ON COLUMN public.ak_users.email IS '邮箱';
-COMMENT ON COLUMN public.ak_users.gender IS '性别';
-COMMENT ON COLUMN public.ak_users.birthday IS '生日';
-COMMENT ON COLUMN public.ak_users.height_cm IS '身高(厘米)';
-COMMENT ON COLUMN public.ak_users.weight_kg IS '体重(公斤)';
-COMMENT ON COLUMN public.ak_users.bio IS '个人简介';
-COMMENT ON COLUMN public.ak_users.avatar_url IS '头像地址';
-COMMENT ON COLUMN public.ak_users.preferred_language IS '偏好语言';
-COMMENT ON COLUMN public.ak_users.role IS '角色(如 customer/merchant/admin 等)';
-COMMENT ON COLUMN public.ak_users.school_id IS '学校ID(可选)';
-COMMENT ON COLUMN public.ak_users.grade_id IS '年级ID(可选)';
-COMMENT ON COLUMN public.ak_users.class_id IS '班级ID(可选)';
-COMMENT ON COLUMN public.ak_users.created_at IS '创建时间';
-COMMENT ON COLUMN public.ak_users.updated_at IS '更新时间';
-
--- 为 ak_users 添加 updated_at 触发器
--- 注意:通用函数 update_updated_at_column() 在 01_create_tables.sql 中创建
-DO $$
-BEGIN
- IF NOT EXISTS (SELECT 1 FROM pg_trigger WHERE tgname = 'update_ak_users_updated_at') THEN
- EXECUTE 'CREATE TRIGGER update_ak_users_updated_at BEFORE UPDATE ON public.ak_users FOR EACH ROW EXECUTE FUNCTION public.update_updated_at_column()';
- END IF;
-END $$;
-
--- ============================================
--- 2. 行级安全策略(RLS)
--- ============================================
-
--- 启用 RLS
-ALTER TABLE public.ak_users ENABLE ROW LEVEL SECURITY;
-
--- 仅允许本人读写自己的资料
-DO $$
-BEGIN
- IF NOT EXISTS (SELECT 1 FROM pg_policies WHERE schemaname='public' AND tablename='ak_users' AND policyname='ak_users_self_select') THEN
- EXECUTE 'CREATE POLICY "ak_users_self_select" ON public.ak_users FOR SELECT USING (auth.uid() = id)';
- END IF;
- IF NOT EXISTS (SELECT 1 FROM pg_policies WHERE schemaname='public' AND tablename='ak_users' AND policyname='ak_users_self_insert') THEN
- EXECUTE 'CREATE POLICY "ak_users_self_insert" ON public.ak_users FOR INSERT WITH CHECK (auth.uid() = id)';
- END IF;
- IF NOT EXISTS (SELECT 1 FROM pg_policies WHERE schemaname='public' AND tablename='ak_users' AND policyname='ak_users_self_update') THEN
- EXECUTE 'CREATE POLICY "ak_users_self_update" ON public.ak_users FOR UPDATE USING (auth.uid() = id)';
- END IF;
-END $$;
-
--- ============================================
--- 3. 相关函数
--- ============================================
-
--- 函数1:手动初始化/更新用户资料(可选,供前端调用)
-CREATE OR REPLACE FUNCTION public.upsert_user_profile(
- p_user_id uuid,
- p_email text,
- p_username text default null
-)
-RETURNS public.ak_users
-LANGUAGE plpgsql
-SECURITY DEFINER
-SET search_path = public
-AS $$
-DECLARE
- v_username text := coalesce(p_username, split_part(p_email, '@', 1), 'user');
- v_result public.ak_users;
-BEGIN
- -- 插入或更新用户资料
- INSERT INTO public.ak_users (id, email, username)
- VALUES (p_user_id, p_email, v_username)
- ON CONFLICT (id) DO UPDATE
- SET
- email = excluded.email,
- username = coalesce(excluded.username, ak_users.username)
- RETURNING * INTO v_result;
-
- RETURN v_result;
-END;
-$$;
-
--- 函数2:供 auth.users 触发器使用,自动创建用户资料
-CREATE OR REPLACE FUNCTION public.handle_new_user()
-RETURNS trigger
-LANGUAGE plpgsql
-SECURITY DEFINER
-SET search_path = public
-AS $$
-BEGIN
- BEGIN
- INSERT INTO public.ak_users (id, email, username)
- VALUES (NEW.id, NEW.email, COALESCE(SPLIT_PART(NEW.email, '@', 1), 'user'))
- ON CONFLICT (id) DO NOTHING;
- EXCEPTION WHEN OTHERS THEN
- -- 重要:不要因为业务表写入失败而阻断 auth.users 的注册事务
- RAISE WARNING 'handle_new_user failed: %', SQLERRM;
- END;
-
- RETURN NEW;
-END;
-$$;
-
--- ============================================
--- 4. 函数授权
--- ============================================
-
--- upsert_user_profile 只允许已登录用户调用
-REVOKE ALL ON FUNCTION public.upsert_user_profile(uuid, text, text) FROM PUBLIC;
-GRANT EXECUTE ON FUNCTION public.upsert_user_profile(uuid, text, text) TO authenticated;
-
--- handle_new_user 是触发器函数,由系统内部调用,无需对任何角色授权
diff --git a/mall/pages/user/test/USER_AUTH_TEST_DATA.sql b/mall/pages/user/test/USER_AUTH_TEST_DATA.sql
deleted file mode 100644
index c0d560d1..00000000
--- a/mall/pages/user/test/USER_AUTH_TEST_DATA.sql
+++ /dev/null
@@ -1,35 +0,0 @@
--- ============================================
--- 用户登录 / 注册 测试数据
--- 位置:pages/user/test/USER_AUTH_TEST_DATA.sql
--- 用途:
--- - 准备少量业务侧测试数据,方便前端联调登录/个人中心
--- - 注意:Supabase 的 auth.users 建议通过实际“注册”流程生成,这里不直接插入
--- ============================================
-
--- 1. 如果你已经通过注册页创建了账号(auth.users 中有记录),
--- 可以在 ak_users 中补充一条测试资料:
--- 把 '00000000-0000-0000-0000-000000000001' 替换成自己 auth.users 里的 id。
-
-insert into public.ak_users (id, username, email, role)
-values
- ('00000000-0000-0000-0000-000000000001', 'demo_user', 'demo@example.com', 'analyst')
-on conflict (id) do update
-set
- username = excluded.username,
- email = excluded.email,
- role = excluded.role;
-
--- 2. 可选:补充 users / user_sessions 基础数据,方便分析模块统计演示
-
-insert into public.users (id, email, nickname)
-values
- ('00000000-0000-0000-0000-000000000001', 'demo@example.com', 'Demo 分析师')
-on conflict (id) do update
-set
- email = excluded.email,
- nickname = excluded.nickname;
-
-insert into public.user_sessions (user_id, session_token, is_active)
-values
- ('00000000-0000-0000-0000-000000000001', 'demo-session-token', true);
-
diff --git a/mall/pages/user/test/USER_AUTH_TRIGGER.sql b/mall/pages/user/test/USER_AUTH_TRIGGER.sql
deleted file mode 100644
index 7ecd7ccd..00000000
--- a/mall/pages/user/test/USER_AUTH_TRIGGER.sql
+++ /dev/null
@@ -1,89 +0,0 @@
--- ============================================
--- 自动创建 ak_users 记录的触发器
--- ============================================
--- 位置:pages/user/test/USER_AUTH_TRIGGER.sql
--- 用途:当 auth.users 表中创建新用户时,自动在 ak_users 表中创建对应的业务资料记录
---
--- 执行方式:
--- 在 Supabase Dashboard 的 SQL Editor 中执行此文件
--- 需要 superuser 权限(Dashboard 默认有)
--- ============================================
-
--- 触发器函数 `public.handle_new_user()` 的定义在 `USER_AUTH_SCHEMA.sql` 中完成。
--- 这里仅负责在 auth.users 上创建触发器(避免重复定义函数导致版本不一致)。
-
--- 兼容处理:如果 `public.handle_new_user()` 尚未创建(例如先执行了本文件),则在此处补齐创建。
--- 说明:这里采用“存在则跳过”的创建方式,不会覆盖已有实现。
-DO $$
-BEGIN
- IF NOT EXISTS (
- SELECT 1
- FROM pg_proc p
- JOIN pg_namespace n ON n.oid = p.pronamespace
- WHERE n.nspname = 'public'
- AND p.proname = 'handle_new_user'
- ) THEN
- EXECUTE $fn$
- CREATE FUNCTION public.handle_new_user()
- RETURNS TRIGGER
- LANGUAGE plpgsql
- SECURITY DEFINER
- SET search_path = public
- AS $body$
- BEGIN
- BEGIN
- INSERT INTO public.ak_users (id, email, username)
- VALUES (
- NEW.id,
- NEW.email,
- COALESCE(SPLIT_PART(NEW.email, '@', 1), 'user')
- )
- ON CONFLICT (id) DO NOTHING;
- EXCEPTION WHEN OTHERS THEN
- RAISE WARNING 'handle_new_user failed: %', SQLERRM;
- END;
-
- RETURN NEW;
- END;
- $body$;
- $fn$;
- END IF;
-END $$;
-
--- 在 auth.users 表上创建触发器
--- 注意:这个触发器会在每次 auth.users 插入新记录时自动执行
-DO $$
-BEGIN
- IF NOT EXISTS (SELECT 1 FROM pg_trigger WHERE tgname = 'on_auth_user_created') THEN
- EXECUTE 'CREATE TRIGGER on_auth_user_created AFTER INSERT ON auth.users FOR EACH ROW EXECUTE FUNCTION public.handle_new_user()';
- END IF;
-END $$;
-
--- ============================================
--- 验证触发器
--- ============================================
--- 执行以下查询验证触发器是否创建成功:
--- SELECT * FROM pg_trigger WHERE tgname = 'on_auth_user_created';
--- SELECT * FROM pg_proc WHERE proname = 'handle_new_user';
-
--- ============================================
--- 测试触发器(可选)
--- ============================================
--- 注意:以下测试代码会创建一个测试用户,执行前请确认
---
--- 1. 通过 Supabase Auth API 注册一个新用户
--- 2. 检查 ak_users 表中是否自动创建了对应的记录
---
--- 或者手动测试(需要 admin 权限):
--- INSERT INTO auth.users (id, email, encrypted_password, email_confirmed_at, created_at, updated_at)
--- VALUES (
--- gen_random_uuid(),
--- 'test@example.com',
--- crypt('password', gen_salt('bf')),
--- NOW(),
--- NOW(),
--- NOW()
--- );
---
--- 然后检查 ak_users 表:
--- SELECT * FROM ak_users WHERE email = 'test@example.com';
diff --git a/mall/pages/user/types.uts b/mall/pages/user/types.uts
deleted file mode 100644
index da697683..00000000
--- a/mall/pages/user/types.uts
+++ /dev/null
@@ -1,31 +0,0 @@
-// 用户基础信息类型
-export type UserProfile ={
- id?: string;
- username: string;
- email: string;
- gender?: string;
- birthday?: string;
- height_cm?: number;
- weight_kg?: number;
- bio?: string;
- avatar_url?: string;
- preferred_language?: string;
- role?:string;
- school_id?: string; // 所属学校ID
- grade_id?: string; // 所属年级ID
- class_id?: string; // 所属班级ID
-}
-
-// 语言选项类型 - 对应 ak_languages 表
-export type LanguageOption = {
- id: string; // UUID
- code: string; // 语言代码,如 'zh-CN', 'en-US'
- name: string; // 英文名称
- native_name: string; // 本地语言名称
-}
-
-export type UserStats = {
- trainings: number;
- points: number;
- streak: number;
-}
\ No newline at end of file
diff --git a/mall/pages_default_temp.json b/mall/pages_default_temp.json
deleted file mode 100644
index 896c6e7c..00000000
--- a/mall/pages_default_temp.json
+++ /dev/null
@@ -1,1320 +0,0 @@
-{
- "pages": [
- {
- "path": "pages/mall/admin/homePage/index",
- "style": {
- "navigationBarTitleText": "绠$悊鍚庡彴",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "pages/user/login",
- "style": {
- "navigationBarTitleText": "鐢ㄦ埛鐧诲綍",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "pages/user/boot",
- "style": {
- "navigationBarTitleText": ""
- }
- },
- {
- "path": "pages/user/register",
- "style": {
- "navigationBarTitleText": "娉ㄥ唽"
- }
- },
- {
- "path": "pages/user/forgot-password",
- "style": {
- "navigationBarTitleText": "蹇樿瀵嗙爜"
- }
- },
- {
- "path": "pages/user/terms",
- "style": {
- "navigationBarTitleText": "鐢ㄦ埛鍗忚涓庨殣绉佹斂绛?
- }
- },
- {
- "path": "pages/user/center",
- "style": {
- "navigationBarTitleText": "鐢ㄦ埛涓績"
- }
- },
- {
- "path": "pages/user/profile",
- "style": {
- "navigationBarTitleText": "涓汉璧勬枡"
- }
- },
- {
- "path": "pages/mall/consumer/index",
- "style": {
- "navigationBarTitleText": "棣栭〉",
- "navigationStyle": "custom",
- "enablePullDownRefresh": true
- }
- },
- {
- "path": "pages/mall/consumer/category",
- "style": {
- "navigationBarTitleText": "鍒嗙被"
- }
- },
- {
- "path": "pages/mall/consumer/messages",
- "style": {
- "navigationBarTitleText": "娑堟伅",
- "enablePullDownRefresh": true
- }
- },
- {
- "path": "pages/mall/consumer/cart",
- "style": {
- "navigationBarTitleText": "璐墿杞?
- }
- },
- {
- "path": "pages/mall/consumer/profile",
- "style": {
- "navigationBarTitleText": "鎴戠殑"
- }
- }
- ],
- "subPackages": [
- {
- "root": "pages/mall/consumer",
- "pages": [
- {
- "path": "settings",
- "style": {
- "navigationBarTitleText": "璁剧疆"
- }
- },
- {
- "path": "wallet",
- "style": {
- "navigationBarTitleText": "鎴戠殑閽卞寘"
- }
- },
- {
- "path": "search",
- "style": {
- "navigationBarTitleText": "鎼滅储",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "product-detail",
- "style": {
- "navigationBarTitleText": "鍟嗗搧璇︽儏"
- }
- },
- {
- "path": "shop-detail",
- "style": {
- "navigationBarTitleText": "搴楅摵璇︽儏"
- }
- },
- {
- "path": "coupons",
- "style": {
- "navigationBarTitleText": "鎴戠殑浼樻儬鍒?
- }
- },
- {
- "path": "favorites",
- "style": {
- "navigationBarTitleText": "鎴戠殑鏀惰棌"
- }
- },
- {
- "path": "footprint",
- "style": {
- "navigationBarTitleText": "鎴戠殑瓒宠抗"
- }
- },
- {
- "path": "address-list",
- "style": {
- "navigationBarTitleText": "鏀惰揣鍦板潃"
- }
- },
- {
- "path": "address-edit",
- "style": {
- "navigationBarTitleText": "缂栬緫鍦板潃"
- }
- },
- {
- "path": "checkout",
- "style": {
- "navigationBarTitleText": "纭璁㈠崟"
- }
- },
- {
- "path": "payment",
- "style": {
- "navigationBarTitleText": "鏀堕摱鍙?
- }
- },
- {
- "path": "payment-success",
- "style": {
- "navigationBarTitleText": "鏀粯鎴愬姛",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "orders",
- "style": {
- "navigationBarTitleText": "鎴戠殑璁㈠崟",
- "enablePullDownRefresh": true
- }
- },
- {
- "path": "order-detail",
- "style": {
- "navigationBarTitleText": "璁㈠崟璇︽儏"
- }
- },
- {
- "path": "logistics",
- "style": {
- "navigationBarTitleText": "鐗╂祦璇︽儏"
- }
- },
- {
- "path": "review",
- "style": {
- "navigationBarTitleText": "璇勪环鏅掑崟"
- }
- },
- {
- "path": "refund",
- "style": {
- "navigationBarTitleText": "閫€娆?鍞悗"
- }
- },
- {
- "path": "apply-refund",
- "style": {
- "navigationBarTitleText": "鐢宠鍞悗"
- }
- },
- {
- "path": "refund-review",
- "style": {
- "navigationBarTitleText": "鏈嶅姟璇勪环"
- }
- },
- {
- "path": "chat",
- "style": {
- "navigationBarTitleText": "瀹㈡湇鑱婂ぉ",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "subscription/plan-list",
- "style": {
- "navigationBarTitleText": "杞欢璁㈤槄"
- }
- },
- {
- "path": "subscription/plan-detail",
- "style": {
- "navigationBarTitleText": "璁㈤槄璇︽儏"
- }
- },
- {
- "path": "subscription/subscribe-checkout",
- "style": {
- "navigationBarTitleText": "纭璁㈤槄"
- }
- },
- {
- "path": "subscription/my-subscriptions",
- "style": {
- "navigationBarTitleText": "鎴戠殑璁㈤槄"
- }
- }
- ]
- },
- {
- "root": "pages/mall/delivery",
- "pages": [
- {
- "path": "index",
- "style": {
- "navigationBarTitleText": "閰嶉€佷腑蹇?,
- "navigationStyle": "custom"
- }
- },
- {
- "path": "order-detail",
- "style": {
- "navigationBarTitleText": "璁㈠崟璇︽儏椤?,
- "navigationStyle": "custom"
- }
- },
- {
- "path": "profile",
- "style": {
- "navigationBarTitleText": "閰嶉€佷釜浜轰腑蹇?,
- "navigationStyle": "custom"
- }
- },
- {
- "path": "order-history",
- "style": {
- "navigationBarTitleText": "鍘嗗彶璁板綍",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "earnings",
- "style": {
- "navigationBarTitleText": "鏀跺叆鏄庣粏",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "tasks",
- "style": {
- "navigationBarTitleText": "鍏ㄩ儴浠诲姟",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "task-detail",
- "style": {
- "navigationBarTitleText": "浠诲姟璇︽儏",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "profile-edit",
- "style": {
- "navigationBarTitleText": "缂栬緫涓汉璧勬枡",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "ratings",
- "style": {
- "navigationBarTitleText": "璇勪环",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "vehicle",
- "style": {
- "navigationBarTitleText": "杞﹁締绠$悊",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "vehicle-add",
- "style": {
- "navigationBarTitleText": "娣诲姞杞﹁締",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "vehicle-edit",
- "style": {
- "navigationBarTitleText": "缂栬緫杞﹁締",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "settings",
- "style": {
- "navigationBarTitleText": "璁剧疆",
- "navigationStyle": "custom"
- }
- }
- ]
- },
- {
- "root": "pages/mall/analytics",
- "pages": [
- {
- "path": "index",
- "style": {
- "navigationBarTitleText": "鏁版嵁鍒嗘瀽",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "profile",
- "style": {
- "navigationBarTitleText": "鏁版嵁鍒嗘瀽涓汉涓績"
- }
- },
- {
- "path": "sales-report",
- "style": {
- "navigationBarTitleText": "閿€鍞姤琛?
- }
- },
- {
- "path": "user-analysis",
- "style": {
- "navigationBarTitleText": "鐢ㄦ埛鍒嗘瀽"
- }
- },
- {
- "path": "product-insights",
- "style": {
- "navigationBarTitleText": "鍟嗗搧娲炲療"
- }
- },
- {
- "path": "delivery-analysis",
- "style": {
- "navigationBarTitleText": "閰嶉€佹晥鐜囧垎鏋?
- }
- },
- {
- "path": "coupon-analysis",
- "style": {
- "navigationBarTitleText": "浼樻儬鍒告晥鏋滃垎鏋?
- }
- },
- {
- "path": "market-trends",
- "style": {
- "navigationBarTitleText": "甯傚満瓒嬪娍"
- }
- },
- {
- "path": "custom-report",
- "style": {
- "navigationBarTitleText": "鑷畾涔夋姤琛?
- }
- },
- {
- "path": "report-detail",
- "style": {
- "navigationBarTitleText": "鎶ヨ〃璇︽儏",
- "enablePullDownRefresh": false
- }
- },
- {
- "path": "data-detail",
- "style": {
- "navigationBarTitleText": "鏁版嵁鍒嗘瀽璇︽儏",
- "enablePullDownRefresh": false
- }
- },
- {
- "path": "insight-detail",
- "style": {
- "navigationBarTitleText": "鏁版嵁娲炲療璇︽儏",
- "enablePullDownRefresh": false
- }
- },
- {
- "path": "test/test-connection",
- "style": {
- "navigationBarTitleText": "Supabase 杩炴帴娴嬭瘯"
- }
- }
- ]
- },
- {
- "root": "pages/mall/admin",
- "pages": [
- {
- "path": "content/index",
- "style": {
- "navigationBarTitleText": "鏂囩珷绠$悊",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "article/index",
- "style": {
- "navigationBarTitleText": "鏂囩珷绠$悊",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "article/category",
- "style": {
- "navigationBarTitleText": "鏂囩珷鍒嗙被",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "article/create",
- "style": {
- "navigationBarTitleText": "娣诲姞鏂囩珷",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "article/edit",
- "style": {
- "navigationBarTitleText": "缂栬緫鏂囩珷",
- "navigationStyle": "custom"
- }
- },
-
- {
- "path": "service/index",
- "style": {
- "navigationBarTitleText": "瀹㈡湇鍒楄〃",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "service/script",
- "style": {
- "navigationBarTitleText": "瀹㈡湇璇濇湳",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "service/message",
- "style": {
- "navigationBarTitleText": "鐢ㄦ埛鐣欒█",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "service/autoReply",
- "style": {
- "navigationBarTitleText": "鑷姩鍥炲",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "service/config",
- "style": {
- "navigationBarTitleText": "瀹㈡湇閰嶇疆",
- "navigationStyle": "custom"
- }
- },
-
- {
- "path": "design/index",
- "style": {
- "navigationBarTitleText": "椤甸潰瑁呬慨",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "design/homepage",
- "style": {
- "navigationBarTitleText": "棣栭〉瑁呬慨",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "design/category",
- "style": {
- "navigationBarTitleText": "鍒嗙被椤佃淇?,
- "navigationStyle": "custom"
- }
- },
- {
- "path": "design/product",
- "style": {
- "navigationBarTitleText": "鍟嗗搧椤佃淇?,
- "navigationStyle": "custom"
- }
- },
- {
- "path": "design/custom",
- "style": {
- "navigationBarTitleText": "鑷畾涔夐〉闈?,
- "navigationStyle": "custom"
- }
- },
- {
- "path": "design/templates",
- "style": {
- "navigationBarTitleText": "妯℃澘搴?,
- "navigationStyle": "custom"
- }
- },
- {
- "path": "design/components",
- "style": {
- "navigationBarTitleText": "缁勪欢搴?,
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/data/city-data",
- "style": {
- "navigationBarTitleText": "鍩庡競鏁版嵁",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/data/clear-data",
- "style": {
- "navigationBarTitleText": "娓呴櫎鏁版嵁",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/data/logistics-company",
- "style": {
- "navigationBarTitleText": "鐗╂祦鍏徃",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/dev-config/category",
- "style": {
- "navigationBarTitleText": "閰嶇疆鍒嗙被",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/dev-config/combination-data",
- "style": {
- "navigationBarTitleText": "缁勫悎鏁版嵁",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/dev-config/cron-job",
- "style": {
- "navigationBarTitleText": "瀹氭椂浠诲姟",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/dev-config/custom-event",
- "style": {
- "navigationBarTitleText": "鑷畾浜嬩欢",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/dev-config/module-config",
- "style": {
- "navigationBarTitleText": "妯″潡閰嶇疆",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/dev-config/permission",
- "style": {
- "navigationBarTitleText": "鏉冮檺缁存姢",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/dev-tools/api",
- "style": {
- "navigationBarTitleText": "鎺ュ彛绠$悊",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/dev-tools/codegen",
- "style": {
- "navigationBarTitleText": "浠g爜鐢熸垚",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/dev-tools/data-dict",
- "style": {
- "navigationBarTitleText": "鏁版嵁瀛楀吀",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/dev-tools/database",
- "style": {
- "navigationBarTitleText": "鏁版嵁搴撶鐞?,
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/dev-tools/file",
- "style": {
- "navigationBarTitleText": "鏂囦欢绠$悊",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/external/account",
- "style": {
- "navigationBarTitleText": "璐﹀彿绠$悊",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/i18n/language-detail",
- "style": {
- "navigationBarTitleText": "璇█璇︽儏",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/i18n/language-list",
- "style": {
- "navigationBarTitleText": "璇█鍒楄〃",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/i18n/region-list",
- "style": {
- "navigationBarTitleText": "鍦板尯鍒楄〃",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/i18n/translate-config",
- "style": {
- "navigationBarTitleText": "缈昏瘧閰嶇疆",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/security/online-upgrade",
- "style": {
- "navigationBarTitleText": "鍦ㄧ嚎鍗囩骇",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/security/refresh-cache",
- "style": {
- "navigationBarTitleText": "鍒锋柊缂撳瓨",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/security/system-log",
- "style": {
- "navigationBarTitleText": "绯荤粺鏃ュ織",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/system-info",
- "style": {
- "navigationBarTitleText": "绯荤粺淇℃伅",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/index",
- "style": {
- "navigationBarTitleText": "钀ラ攢绠$悊",
- "navigationStyle": "custom"
- }
- },
-
- {
- "path": "marketing/coupon/list",
- "style": {
- "navigationBarTitleText": "浼樻儬鍒稿垪琛?,
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/coupon/receive",
- "style": {
- "navigationBarTitleText": "鐢ㄦ埛棰嗗彇璁板綍",
- "navigationStyle": "custom"
- }
- },
-
- {
- "path": "marketing/points/index",
- "style": {
- "navigationBarTitleText": "绉垎绠$悊",
- "navigationStyle": "custom"
- }
- },
-
- {
- "path": "marketing/points/stats",
- "style": {
- "navigationBarTitleText": "绉垎缁熻",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/points/goods",
- "style": {
- "navigationBarTitleText": "绉垎鍟嗗搧",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/points/order",
- "style": {
- "navigationBarTitleText": "绉垎璁㈠崟",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/points/record",
- "style": {
- "navigationBarTitleText": "绉垎璁板綍",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/points/config",
- "style": {
- "navigationBarTitleText": "绉垎閰嶇疆",
- "navigationStyle": "custom"
- }
- },
-
- {
- "path": "marketing/lottery/list",
- "style": {
- "navigationBarTitleText": "鎶藉鍒楄〃",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/lottery/config",
- "style": {
- "navigationBarTitleText": "鎶藉閰嶇疆",
- "navigationStyle": "custom"
- }
- },
-
- {
- "path": "marketing/groupbuy/goods",
- "style": {
- "navigationBarTitleText": "鎷煎洟鍟嗗搧",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/groupbuy/list",
- "style": {
- "navigationBarTitleText": "鎷煎洟鍒楄〃",
- "navigationStyle": "custom"
- }
- },
-
- {
- "path": "marketing/seckill/goods",
- "style": {
- "navigationBarTitleText": "绉掓潃鍟嗗搧",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/seckill/list",
- "style": {
- "navigationBarTitleText": "绉掓潃鍒楄〃",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/seckill/config",
- "style": {
- "navigationBarTitleText": "绉掓潃閰嶇疆",
- "navigationStyle": "custom"
- }
- },
-
- {
- "path": "marketing/member/type",
- "style": {
- "navigationBarTitleText": "浼氬憳绫诲瀷",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/member/rights",
- "style": {
- "navigationBarTitleText": "浼氬憳鏉冪泭",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/member/card",
- "style": {
- "navigationBarTitleText": "鍗″瘑浼氬憳",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/member/record",
- "style": {
- "navigationBarTitleText": "浼氬憳璁板綍",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/member/config",
- "style": {
- "navigationBarTitleText": "浼氬憳閰嶇疆",
- "navigationStyle": "custom"
- }
- },
-
- {
- "path": "marketing/live/room",
- "style": {
- "navigationBarTitleText": "鐩存挱闂寸鐞?,
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/live/goods",
- "style": {
- "navigationBarTitleText": "鐩存挱鍟嗗搧绠$悊",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/live/anchor",
- "style": {
- "navigationBarTitleText": "涓绘挱绠$悊",
- "navigationStyle": "custom"
- }
- },
-
- {
- "path": "marketing/recharge/amount",
- "style": {
- "navigationBarTitleText": "鍏呭€奸噾棰濊缃?,
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/recharge/config",
- "style": {
- "navigationBarTitleText": "鍏呭€奸厤缃?,
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/recharge/record",
- "style": {
- "navigationBarTitleText": "鍏呭€艰褰?,
- "navigationStyle": "custom"
- }
- },
-
- {
- "path": "marketing/signin/rule",
- "style": {
- "navigationBarTitleText": "绛惧埌瑙勫垯",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/signin/record",
- "style": {
- "navigationBarTitleText": "绛惧埌璁板綍",
- "navigationStyle": "custom"
- }
- },
-
- {
- "path": "marketing/newcomer",
- "style": {
- "navigationBarTitleText": "鏂颁汉绀?,
- "navigationStyle": "custom"
- }
- },
-
- {
- "path": "order/order-statistics/index",
- "style": {
- "navigationBarTitleText": "璁㈠崟缁熻",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "order/order-management/index",
- "style": {
- "navigationBarTitleText": "璁㈠崟绠$悊",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "order/aftersales-order/index",
- "style": {
- "navigationBarTitleText": "鍞悗璁㈠崟",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "order/cashier-order/index",
- "style": {
- "navigationBarTitleText": "鏀堕摱璁㈠崟",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "order/write-off-records/index",
- "style": {
- "navigationBarTitleText": "鏍搁攢璁板綍",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "order/order-configuration/index",
- "style": {
- "navigationBarTitleText": "璁㈠崟閰嶇疆",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "product/product-classification/index",
- "style": {
- "navigationBarTitleText": "鍟嗗搧鍒嗙被",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "product/product-label/index",
- "style": {
- "navigationBarTitleText": "鍟嗗搧鏍囩",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "product/product-management/index",
- "style": {
- "navigationBarTitleText": "鍟嗗搧绠$悊",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "product/product-param/index",
- "style": {
- "navigationBarTitleText": "鍟嗗搧鍙傛暟",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "product/product-protection/index",
- "style": {
- "navigationBarTitleText": "鍟嗗搧淇濋殰",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "product/product-reviews/index",
- "style": {
- "navigationBarTitleText": "鍟嗗搧瀹℃牳"
- }
- },
- {
- "path": "product/product-specifications/index",
- "style": {
- "navigationBarTitleText": "鍟嗗搧瑙勬牸",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "product/product-statistics/index",
- "style": {
- "navigationBarTitleText": "鍟嗗搧缁熻",
- "navigationStyle": "custom"
- }
- },
-
- {
- "path": "subscription/plan-management",
- "style": {
- "navigationBarTitleText": "璁㈤槄鏂规绠$悊"
- }
- },
- {
- "path": "subscription/user-subscriptions",
- "style": {
- "navigationBarTitleText": "鐢ㄦ埛璁㈤槄绠$悊"
- }
- },
- {
- "path": "system/index",
- "style": {
- "navigationBarTitleText": "绯荤粺璁剧疆",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/agreement-settings",
- "style": {
- "navigationBarTitleText": "鍗忚璁剧疆",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/api/collect",
- "style": {
- "navigationBarTitleText": "鍟嗗搧閲囬泦閰嶇疆",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/api/logistics",
- "style": {
- "navigationBarTitleText": "鐗╂祦鏌ヨ閰嶇疆",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/api/pay",
- "style": {
- "navigationBarTitleText": "鍟嗗煄鏀粯閰嶇疆",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/api/sms",
- "style": {
- "navigationBarTitleText": "鐭俊鎺ュ彛閰嶇疆",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/api/storage",
- "style": {
- "navigationBarTitleText": "绯荤粺瀛樺偍閰嶇疆",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/api/waybill",
- "style": {
- "navigationBarTitleText": "鐢靛瓙闈㈠崟閰嶇疆",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/api/yht/config",
- "style": {
- "navigationBarTitleText": "涓€鍙烽€氶厤缃?,
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/api/yht/page",
- "style": {
- "navigationBarTitleText": "涓€鍙烽€氶〉闈?,
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/message-management",
- "style": {
- "navigationBarTitleText": "娑堟伅绠$悊",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/permission/admin-list",
- "style": {
- "navigationBarTitleText": "绠$悊鍛樺垪琛?,
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/permission/permission-setting",
- "style": {
- "navigationBarTitleText": "鏉冮檺璁剧疆",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/permission/role",
- "style": {
- "navigationBarTitleText": "瑙掕壊绠$悊",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/receipt-settings",
- "style": {
- "navigationBarTitleText": "灏忕エ閰嶇疆",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/shipping/courier",
- "style": {
- "navigationBarTitleText": "閰嶉€佸憳绠$悊",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/shipping/freight-template",
- "style": {
- "navigationBarTitleText": "杩愯垂妯℃澘",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/shipping/pickup/points",
- "style": {
- "navigationBarTitleText": "鎻愯揣鐐?,
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/shipping/pickup/verifiers",
- "style": {
- "navigationBarTitleText": "鏍搁攢鍛?,
- "navigationStyle": "custom"
- }
- },
- {
- "path": "user/user-management/index",
- "style": {
- "navigationBarTitleText": "鐢ㄦ埛绠$悊",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "user/user-grouping/index",
- "style": {
- "navigationBarTitleText": "鐢ㄦ埛鍒嗙粍",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "user/user-label/index",
- "style": {
- "navigationBarTitleText": "鐢ㄦ埛鏍囩",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "user/user-level/index",
- "style": {
- "navigationBarTitleText": "鐢ㄦ埛绛夌骇",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "user/user-configuration/index",
- "style": {
- "navigationBarTitleText": "鐢ㄦ埛閰嶇疆",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "user/user-statistics/index",
- "style": {
- "navigationBarTitleText": "鐢ㄦ埛缁熻",
- "navigationStyle": "custom"
- }
- }
- ]
- },
- {
- "root": "pages/mall/merchant",
- "pages": [
- {
- "path": "index",
- "style": {
- "navigationBarTitleText": "鍟嗗涓績",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "product-detail",
- "style": {
- "navigationBarTitleText": "鍟嗗搧绠$悊璇︽儏",
- "enablePullDownRefresh": false
- }
- },
- {
- "path": "profile",
- "style": {
- "navigationBarTitleText": "涓汉璧勬枡"
- }
- }
- ]
- },
- {
- "root": "pages/mall/service",
- "pages": [
- {
- "path": "index",
- "style": {
- "navigationBarTitleText": "瀹㈡湇宸ヤ綔鍙?,
- "navigationStyle": "custom"
- }
- },
- {
- "path": "profile",
- "style": {
- "navigationBarTitleText": "瀹㈡湇涓汉涓績"
- }
- },
- {
- "path": "ticket-detail",
- "style": {
- "navigationBarTitleText": "宸ュ崟璇︽儏",
- "enablePullDownRefresh": false
- }
- }
- ]
- }
- ],
- "tabBar": {
- "color": "#999999",
- "selectedColor": "#ff5000",
- "backgroundColor": "#ffffff",
- "borderStyle": "black",
- "list": [
- {
- "pagePath": "pages/mall/consumer/index",
- "text": "棣栭〉",
- "iconPath": "static/tabbar/home.png",
- "selectedIconPath": "static/tabbar/home-active.png"
- },
- {
- "pagePath": "pages/mall/consumer/category",
- "text": "鍒嗙被",
- "iconPath": "static/tabbar/category.png",
- "selectedIconPath": "static/tabbar/category-active.png"
- },
- {
- "pagePath": "pages/mall/consumer/messages",
- "text": "娑堟伅",
- "iconPath": "static/tabbar/messages.png",
- "selectedIconPath": "static/tabbar/messages-active.png"
- },
- {
- "pagePath": "pages/mall/consumer/cart",
- "text": "璐墿杞?,
- "iconPath": "static/tabbar/cart.png",
- "selectedIconPath": "static/tabbar/cart-active.png"
- },
- {
- "pagePath": "pages/mall/consumer/profile",
- "text": "鎴戠殑",
- "iconPath": "static/tabbar/profile.png",
- "selectedIconPath": "static/tabbar/profile-active.png"
- }
- ]
- },
- "globalStyle": {
- "navigationBarTextStyle": "black",
- "navigationBarTitleText": "mall",
- "navigationBarBackgroundColor": "#FFFFFF",
- "backgroundColor": "#F8F8F8"
- }
-}
-
diff --git a/mall/pages_utf8_temp.json b/mall/pages_utf8_temp.json
deleted file mode 100644
index 5cbfe244..00000000
--- a/mall/pages_utf8_temp.json
+++ /dev/null
@@ -1,1320 +0,0 @@
-{
- "pages": [
- {
- "path": "pages/mall/admin/homePage/index",
- "style": {
- "navigationBarTitleText": "管理后台",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "pages/user/login",
- "style": {
- "navigationBarTitleText": "用户登录",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "pages/user/boot",
- "style": {
- "navigationBarTitleText": ""
- }
- },
- {
- "path": "pages/user/register",
- "style": {
- "navigationBarTitleText": "注册"
- }
- },
- {
- "path": "pages/user/forgot-password",
- "style": {
- "navigationBarTitleText": "忘记密码"
- }
- },
- {
- "path": "pages/user/terms",
- "style": {
- "navigationBarTitleText": "用户协议与隐私政策"
- }
- },
- {
- "path": "pages/user/center",
- "style": {
- "navigationBarTitleText": "用户中心"
- }
- },
- {
- "path": "pages/user/profile",
- "style": {
- "navigationBarTitleText": "个人资料"
- }
- },
- {
- "path": "pages/mall/consumer/index",
- "style": {
- "navigationBarTitleText": "首页",
- "navigationStyle": "custom",
- "enablePullDownRefresh": true
- }
- },
- {
- "path": "pages/mall/consumer/category",
- "style": {
- "navigationBarTitleText": "分类"
- }
- },
- {
- "path": "pages/mall/consumer/messages",
- "style": {
- "navigationBarTitleText": "消息",
- "enablePullDownRefresh": true
- }
- },
- {
- "path": "pages/mall/consumer/cart",
- "style": {
- "navigationBarTitleText": "购物车"
- }
- },
- {
- "path": "pages/mall/consumer/profile",
- "style": {
- "navigationBarTitleText": "我的"
- }
- }
- ],
- "subPackages": [
- {
- "root": "pages/mall/consumer",
- "pages": [
- {
- "path": "settings",
- "style": {
- "navigationBarTitleText": "设置"
- }
- },
- {
- "path": "wallet",
- "style": {
- "navigationBarTitleText": "我的钱包"
- }
- },
- {
- "path": "search",
- "style": {
- "navigationBarTitleText": "搜索",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "product-detail",
- "style": {
- "navigationBarTitleText": "商品详情"
- }
- },
- {
- "path": "shop-detail",
- "style": {
- "navigationBarTitleText": "店铺详情"
- }
- },
- {
- "path": "coupons",
- "style": {
- "navigationBarTitleText": "我的优惠券"
- }
- },
- {
- "path": "favorites",
- "style": {
- "navigationBarTitleText": "我的收藏"
- }
- },
- {
- "path": "footprint",
- "style": {
- "navigationBarTitleText": "我的足迹"
- }
- },
- {
- "path": "address-list",
- "style": {
- "navigationBarTitleText": "收货地址"
- }
- },
- {
- "path": "address-edit",
- "style": {
- "navigationBarTitleText": "编辑地址"
- }
- },
- {
- "path": "checkout",
- "style": {
- "navigationBarTitleText": "确认订单"
- }
- },
- {
- "path": "payment",
- "style": {
- "navigationBarTitleText": "收银台"
- }
- },
- {
- "path": "payment-success",
- "style": {
- "navigationBarTitleText": "支付成功",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "orders",
- "style": {
- "navigationBarTitleText": "我的订单",
- "enablePullDownRefresh": true
- }
- },
- {
- "path": "order-detail",
- "style": {
- "navigationBarTitleText": "订单详情"
- }
- },
- {
- "path": "logistics",
- "style": {
- "navigationBarTitleText": "物流详情"
- }
- },
- {
- "path": "review",
- "style": {
- "navigationBarTitleText": "评价晒单"
- }
- },
- {
- "path": "refund",
- "style": {
- "navigationBarTitleText": "退款/售后"
- }
- },
- {
- "path": "apply-refund",
- "style": {
- "navigationBarTitleText": "申请售后"
- }
- },
- {
- "path": "refund-review",
- "style": {
- "navigationBarTitleText": "服务评价"
- }
- },
- {
- "path": "chat",
- "style": {
- "navigationBarTitleText": "客服聊天",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "subscription/plan-list",
- "style": {
- "navigationBarTitleText": "软件订阅"
- }
- },
- {
- "path": "subscription/plan-detail",
- "style": {
- "navigationBarTitleText": "订阅详情"
- }
- },
- {
- "path": "subscription/subscribe-checkout",
- "style": {
- "navigationBarTitleText": "确认订阅"
- }
- },
- {
- "path": "subscription/my-subscriptions",
- "style": {
- "navigationBarTitleText": "我的订阅"
- }
- }
- ]
- },
- {
- "root": "pages/mall/delivery",
- "pages": [
- {
- "path": "index",
- "style": {
- "navigationBarTitleText": "配送中心",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "order-detail",
- "style": {
- "navigationBarTitleText": "订单详情页",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "profile",
- "style": {
- "navigationBarTitleText": "配送个人中心",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "order-history",
- "style": {
- "navigationBarTitleText": "历史记录",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "earnings",
- "style": {
- "navigationBarTitleText": "收入明细",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "tasks",
- "style": {
- "navigationBarTitleText": "全部任务",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "task-detail",
- "style": {
- "navigationBarTitleText": "任务详情",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "profile-edit",
- "style": {
- "navigationBarTitleText": "编辑个人资料",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "ratings",
- "style": {
- "navigationBarTitleText": "评价",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "vehicle",
- "style": {
- "navigationBarTitleText": "车辆管理",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "vehicle-add",
- "style": {
- "navigationBarTitleText": "添加车辆",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "vehicle-edit",
- "style": {
- "navigationBarTitleText": "编辑车辆",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "settings",
- "style": {
- "navigationBarTitleText": "设置",
- "navigationStyle": "custom"
- }
- }
- ]
- },
- {
- "root": "pages/mall/analytics",
- "pages": [
- {
- "path": "index",
- "style": {
- "navigationBarTitleText": "数据分析",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "profile",
- "style": {
- "navigationBarTitleText": "数据分析个人中心"
- }
- },
- {
- "path": "sales-report",
- "style": {
- "navigationBarTitleText": "销售报表"
- }
- },
- {
- "path": "user-analysis",
- "style": {
- "navigationBarTitleText": "用户分析"
- }
- },
- {
- "path": "product-insights",
- "style": {
- "navigationBarTitleText": "商品洞察"
- }
- },
- {
- "path": "delivery-analysis",
- "style": {
- "navigationBarTitleText": "配送效率分析"
- }
- },
- {
- "path": "coupon-analysis",
- "style": {
- "navigationBarTitleText": "优惠券效果分析"
- }
- },
- {
- "path": "market-trends",
- "style": {
- "navigationBarTitleText": "市场趋势"
- }
- },
- {
- "path": "custom-report",
- "style": {
- "navigationBarTitleText": "自定义报表"
- }
- },
- {
- "path": "report-detail",
- "style": {
- "navigationBarTitleText": "报表详情",
- "enablePullDownRefresh": false
- }
- },
- {
- "path": "data-detail",
- "style": {
- "navigationBarTitleText": "数据分析详情",
- "enablePullDownRefresh": false
- }
- },
- {
- "path": "insight-detail",
- "style": {
- "navigationBarTitleText": "数据洞察详情",
- "enablePullDownRefresh": false
- }
- },
- {
- "path": "test/test-connection",
- "style": {
- "navigationBarTitleText": "Supabase 连接测试"
- }
- }
- ]
- },
- {
- "root": "pages/mall/admin",
- "pages": [
- {
- "path": "content/index",
- "style": {
- "navigationBarTitleText": "文章管理",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "article/index",
- "style": {
- "navigationBarTitleText": "文章管理",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "article/category",
- "style": {
- "navigationBarTitleText": "文章分类",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "article/create",
- "style": {
- "navigationBarTitleText": "添加文章",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "article/edit",
- "style": {
- "navigationBarTitleText": "编辑文章",
- "navigationStyle": "custom"
- }
- },
-
- {
- "path": "service/index",
- "style": {
- "navigationBarTitleText": "客服列表",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "service/script",
- "style": {
- "navigationBarTitleText": "客服话术",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "service/message",
- "style": {
- "navigationBarTitleText": "用户留言",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "service/autoReply",
- "style": {
- "navigationBarTitleText": "自动回复",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "service/config",
- "style": {
- "navigationBarTitleText": "客服配置",
- "navigationStyle": "custom"
- }
- },
-
- {
- "path": "design/index",
- "style": {
- "navigationBarTitleText": "页面装修",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "design/homepage",
- "style": {
- "navigationBarTitleText": "首页装修",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "design/category",
- "style": {
- "navigationBarTitleText": "分类页装修",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "design/product",
- "style": {
- "navigationBarTitleText": "商品页装修",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "design/custom",
- "style": {
- "navigationBarTitleText": "自定义页面",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "design/templates",
- "style": {
- "navigationBarTitleText": "模板库",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "design/components",
- "style": {
- "navigationBarTitleText": "组件库",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/data/city-data",
- "style": {
- "navigationBarTitleText": "城市数据",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/data/clear-data",
- "style": {
- "navigationBarTitleText": "清除数据",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/data/logistics-company",
- "style": {
- "navigationBarTitleText": "物流公司",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/dev-config/category",
- "style": {
- "navigationBarTitleText": "配置分类",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/dev-config/combination-data",
- "style": {
- "navigationBarTitleText": "组合数据",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/dev-config/cron-job",
- "style": {
- "navigationBarTitleText": "定时任务",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/dev-config/custom-event",
- "style": {
- "navigationBarTitleText": "自定事件",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/dev-config/module-config",
- "style": {
- "navigationBarTitleText": "模块配置",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/dev-config/permission",
- "style": {
- "navigationBarTitleText": "权限维护",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/dev-tools/api",
- "style": {
- "navigationBarTitleText": "接口管理",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/dev-tools/codegen",
- "style": {
- "navigationBarTitleText": "代码生成",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/dev-tools/data-dict",
- "style": {
- "navigationBarTitleText": "数据字典",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/dev-tools/database",
- "style": {
- "navigationBarTitleText": "数据库管理",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/dev-tools/file",
- "style": {
- "navigationBarTitleText": "文件管理",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/external/account",
- "style": {
- "navigationBarTitleText": "账号管理",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/i18n/language-detail",
- "style": {
- "navigationBarTitleText": "语言详情",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/i18n/language-list",
- "style": {
- "navigationBarTitleText": "语言列表",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/i18n/region-list",
- "style": {
- "navigationBarTitleText": "地区列表",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/i18n/translate-config",
- "style": {
- "navigationBarTitleText": "翻译配置",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/security/online-upgrade",
- "style": {
- "navigationBarTitleText": "在线升级",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/security/refresh-cache",
- "style": {
- "navigationBarTitleText": "刷新缓存",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/security/system-log",
- "style": {
- "navigationBarTitleText": "系统日志",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "maintain/system-info",
- "style": {
- "navigationBarTitleText": "系统信息",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/index",
- "style": {
- "navigationBarTitleText": "营销管理",
- "navigationStyle": "custom"
- }
- },
-
- {
- "path": "marketing/coupon/list",
- "style": {
- "navigationBarTitleText": "优惠券列表",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/coupon/receive",
- "style": {
- "navigationBarTitleText": "用户领取记录",
- "navigationStyle": "custom"
- }
- },
-
- {
- "path": "marketing/points/index",
- "style": {
- "navigationBarTitleText": "积分管理",
- "navigationStyle": "custom"
- }
- },
-
- {
- "path": "marketing/points/stats",
- "style": {
- "navigationBarTitleText": "积分统计",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/points/goods",
- "style": {
- "navigationBarTitleText": "积分商品",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/points/order",
- "style": {
- "navigationBarTitleText": "积分订单",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/points/record",
- "style": {
- "navigationBarTitleText": "积分记录",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/points/config",
- "style": {
- "navigationBarTitleText": "积分配置",
- "navigationStyle": "custom"
- }
- },
-
- {
- "path": "marketing/lottery/list",
- "style": {
- "navigationBarTitleText": "抽奖列表",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/lottery/config",
- "style": {
- "navigationBarTitleText": "抽奖配置",
- "navigationStyle": "custom"
- }
- },
-
- {
- "path": "marketing/groupbuy/goods",
- "style": {
- "navigationBarTitleText": "拼团商品",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/groupbuy/list",
- "style": {
- "navigationBarTitleText": "拼团列表",
- "navigationStyle": "custom"
- }
- },
-
- {
- "path": "marketing/seckill/goods",
- "style": {
- "navigationBarTitleText": "秒杀商品",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/seckill/list",
- "style": {
- "navigationBarTitleText": "秒杀列表",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/seckill/config",
- "style": {
- "navigationBarTitleText": "秒杀配置",
- "navigationStyle": "custom"
- }
- },
-
- {
- "path": "marketing/member/type",
- "style": {
- "navigationBarTitleText": "会员类型",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/member/rights",
- "style": {
- "navigationBarTitleText": "会员权益",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/member/card",
- "style": {
- "navigationBarTitleText": "卡密会员",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/member/record",
- "style": {
- "navigationBarTitleText": "会员记录",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/member/config",
- "style": {
- "navigationBarTitleText": "会员配置",
- "navigationStyle": "custom"
- }
- },
-
- {
- "path": "marketing/live/room",
- "style": {
- "navigationBarTitleText": "直播间管理",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/live/goods",
- "style": {
- "navigationBarTitleText": "直播商品管理",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/live/anchor",
- "style": {
- "navigationBarTitleText": "主播管理",
- "navigationStyle": "custom"
- }
- },
-
- {
- "path": "marketing/recharge/amount",
- "style": {
- "navigationBarTitleText": "充值金额设置",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/recharge/config",
- "style": {
- "navigationBarTitleText": "充值配置",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/recharge/record",
- "style": {
- "navigationBarTitleText": "充值记录",
- "navigationStyle": "custom"
- }
- },
-
- {
- "path": "marketing/signin/rule",
- "style": {
- "navigationBarTitleText": "签到规则",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "marketing/signin/record",
- "style": {
- "navigationBarTitleText": "签到记录",
- "navigationStyle": "custom"
- }
- },
-
- {
- "path": "marketing/newcomer",
- "style": {
- "navigationBarTitleText": "新人礼",
- "navigationStyle": "custom"
- }
- },
-
- {
- "path": "order/order-statistics/index",
- "style": {
- "navigationBarTitleText": "订单统计",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "order/order-management/index",
- "style": {
- "navigationBarTitleText": "订单管理",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "order/aftersales-order/index",
- "style": {
- "navigationBarTitleText": "售后订单",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "order/cashier-order/index",
- "style": {
- "navigationBarTitleText": "收银订单",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "order/write-off-records/index",
- "style": {
- "navigationBarTitleText": "核销记录",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "order/order-configuration/index",
- "style": {
- "navigationBarTitleText": "订单配置",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "product/product-classification/index",
- "style": {
- "navigationBarTitleText": "商品分类",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "product/product-label/index",
- "style": {
- "navigationBarTitleText": "商品标签",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "product/product-management/index",
- "style": {
- "navigationBarTitleText": "商品管理",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "product/product-param/index",
- "style": {
- "navigationBarTitleText": "商品参数",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "product/product-protection/index",
- "style": {
- "navigationBarTitleText": "商品保障",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "product/product-reviews/index",
- "style": {
- "navigationBarTitleText": "商品审核"
- }
- },
- {
- "path": "product/product-specifications/index",
- "style": {
- "navigationBarTitleText": "商品规格",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "product/product-statistics/index",
- "style": {
- "navigationBarTitleText": "商品统计",
- "navigationStyle": "custom"
- }
- },
-
- {
- "path": "subscription/plan-management",
- "style": {
- "navigationBarTitleText": "订阅方案管理"
- }
- },
- {
- "path": "subscription/user-subscriptions",
- "style": {
- "navigationBarTitleText": "用户订阅管理"
- }
- },
- {
- "path": "system/index",
- "style": {
- "navigationBarTitleText": "系统设置",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/agreement-settings",
- "style": {
- "navigationBarTitleText": "协议设置",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/api/collect",
- "style": {
- "navigationBarTitleText": "商品采集配置",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/api/logistics",
- "style": {
- "navigationBarTitleText": "物流查询配置",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/api/pay",
- "style": {
- "navigationBarTitleText": "商城支付配置",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/api/sms",
- "style": {
- "navigationBarTitleText": "短信接口配置",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/api/storage",
- "style": {
- "navigationBarTitleText": "系统存储配置",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/api/waybill",
- "style": {
- "navigationBarTitleText": "电子面单配置",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/api/yht/config",
- "style": {
- "navigationBarTitleText": "一号通配置",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/api/yht/page",
- "style": {
- "navigationBarTitleText": "一号通页面",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/message-management",
- "style": {
- "navigationBarTitleText": "消息管理",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/permission/admin-list",
- "style": {
- "navigationBarTitleText": "管理员列表",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/permission/permission-setting",
- "style": {
- "navigationBarTitleText": "权限设置",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/permission/role",
- "style": {
- "navigationBarTitleText": "角色管理",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/receipt-settings",
- "style": {
- "navigationBarTitleText": "小票配置",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/shipping/courier",
- "style": {
- "navigationBarTitleText": "配送员管理",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/shipping/freight-template",
- "style": {
- "navigationBarTitleText": "运费模板",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/shipping/pickup/points",
- "style": {
- "navigationBarTitleText": "提货点",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "system/shipping/pickup/verifiers",
- "style": {
- "navigationBarTitleText": "核销员",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "user/user-management/index",
- "style": {
- "navigationBarTitleText": "用户管理",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "user/user-grouping/index",
- "style": {
- "navigationBarTitleText": "用户分组",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "user/user-label/index",
- "style": {
- "navigationBarTitleText": "用户标签",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "user/user-level/index",
- "style": {
- "navigationBarTitleText": "用户等级",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "user/user-configuration/index",
- "style": {
- "navigationBarTitleText": "用户配置",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "user/user-statistics/index",
- "style": {
- "navigationBarTitleText": "用户统计",
- "navigationStyle": "custom"
- }
- }
- ]
- },
- {
- "root": "pages/mall/merchant",
- "pages": [
- {
- "path": "index",
- "style": {
- "navigationBarTitleText": "商家中心",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "product-detail",
- "style": {
- "navigationBarTitleText": "商品管理详情",
- "enablePullDownRefresh": false
- }
- },
- {
- "path": "profile",
- "style": {
- "navigationBarTitleText": "个人资料"
- }
- }
- ]
- },
- {
- "root": "pages/mall/service",
- "pages": [
- {
- "path": "index",
- "style": {
- "navigationBarTitleText": "客服工作台",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "profile",
- "style": {
- "navigationBarTitleText": "客服个人中心"
- }
- },
- {
- "path": "ticket-detail",
- "style": {
- "navigationBarTitleText": "工单详情",
- "enablePullDownRefresh": false
- }
- }
- ]
- }
- ],
- "tabBar": {
- "color": "#999999",
- "selectedColor": "#ff5000",
- "backgroundColor": "#ffffff",
- "borderStyle": "black",
- "list": [
- {
- "pagePath": "pages/mall/consumer/index",
- "text": "首页",
- "iconPath": "static/tabbar/home.png",
- "selectedIconPath": "static/tabbar/home-active.png"
- },
- {
- "pagePath": "pages/mall/consumer/category",
- "text": "分类",
- "iconPath": "static/tabbar/category.png",
- "selectedIconPath": "static/tabbar/category-active.png"
- },
- {
- "pagePath": "pages/mall/consumer/messages",
- "text": "消息",
- "iconPath": "static/tabbar/messages.png",
- "selectedIconPath": "static/tabbar/messages-active.png"
- },
- {
- "pagePath": "pages/mall/consumer/cart",
- "text": "购物车",
- "iconPath": "static/tabbar/cart.png",
- "selectedIconPath": "static/tabbar/cart-active.png"
- },
- {
- "pagePath": "pages/mall/consumer/profile",
- "text": "我的",
- "iconPath": "static/tabbar/profile.png",
- "selectedIconPath": "static/tabbar/profile-active.png"
- }
- ]
- },
- "globalStyle": {
- "navigationBarTextStyle": "black",
- "navigationBarTitleText": "mall",
- "navigationBarBackgroundColor": "#FFFFFF",
- "backgroundColor": "#F8F8F8"
- }
-}
-
diff --git a/mall/platformConfig.json b/mall/platformConfig.json
deleted file mode 100644
index 482d68a5..00000000
--- a/mall/platformConfig.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "targets": [
- "APP-ANDROID"
- ]
-}
\ No newline at end of file
diff --git a/mall/refactor-script.ps1 b/mall/refactor-script.ps1
deleted file mode 100644
index 107f4f92..00000000
--- a/mall/refactor-script.ps1
+++ /dev/null
@@ -1,63 +0,0 @@
-# Admin Pages Refactoring Helper Script
-# 用于快速识别需要修改的文件模式
-
-$adminPath = "d:\骅锋\mall\pages\mall\admin"
-
-# 获取所有 .uvue 文件
-$files = Get-ChildItem -Path $adminPath -Recurse -Filter "*.uvue" | Select-Object FullName, Name
-
-# 统计不同的文件类型/模式
-$patterns = @{}
-
-foreach ($file in $files) {
- $content = Get-Content $file.FullName -Raw
-
- # 检测模式
- if ($content -match '\.Page\s*\{') {
- $patterns["PascalCase_Classes"] += 1
- }
- if ($content -match '#ffffff') {
- $patterns["Hardcoded_Colors"] += 1
- }
- if ($content -match 'background:\s*#') {
- $patterns["Hardcoded_BG"] += 1
- }
- if ($content -match 'lang="scss"') {
- $patterns["Has_SCSS_Lang"] += 1
- }
- if ($content -match 'color:\s*#999') {
- $patterns["Gray_Color"] += 1
- }
-}
-
-Write-Host "Pattern Analysis Results:"
-$patterns | ForEach-Object {
- Write-Host "$($_.Name): $($_.Value)"
-}
-
-# 分组输出需要修改的文件
-Write-Host "`nFiles by Category:`n"
-
-# P0 Priority (已完成)
-$p0Files = @(
- "user-management.uvue",
- "product-management.uvue",
- "order-management.uvue",
- "system-settings.uvue",
- "marketing-management.uvue"
-)
-
-# P1 Priority (maintain 文件夹)
-Write-Host "P1 Files (maintain/):"
-Get-ChildItem -Path "$adminPath\maintain" -Recurse -Filter "*.uvue" |
- Where-Object { $_.Name -ne "system-info.uvue" } |
- ForEach-Object { Write-Host " - $($_.FullName -replace [regex]::Escape($adminPath), '')" }
-
-# 其他需要修改的文件
-Write-Host "`nOther files (P2+):"
-Get-ChildItem -Path $adminPath -Recurse -Filter "*.uvue" |
- Where-Object {
- $_.FullName -notmatch "maintain" -and
- $p0Files -notcontains $_.Name
- } |
- ForEach-Object { Write-Host " - $($_.FullName -replace [regex]::Escape($adminPath), '')" }
diff --git a/mall/services/analytics/auth.uts b/mall/services/analytics/auth.uts
deleted file mode 100644
index a40c882d..00000000
--- a/mall/services/analytics/auth.uts
+++ /dev/null
@@ -1,21 +0,0 @@
-import supa from '@/components/supadb/aksupainstance.uts'
-
-export function getUserIdOrNull(): string | null {
- try {
- const sessionInfo = supa.getSession()
- if (sessionInfo == null || sessionInfo.user == null) return null
- const userObj = sessionInfo.user as any
- if (userObj.getString != null) {
- return (userObj.getString('id') as string | null)
- }
- if (userObj.id != null) {
- return String(userObj.id)
- }
- if (typeof userObj === 'object' && 'id' in userObj) {
- return String((userObj as any).id)
- }
- return null
- } catch (e) {
- return null
- }
-}
diff --git a/mall/services/analytics/authGuard.uts b/mall/services/analytics/authGuard.uts
deleted file mode 100644
index e1543599..00000000
--- a/mall/services/analytics/authGuard.uts
+++ /dev/null
@@ -1,20 +0,0 @@
-import { getUserIdOrNull } from './auth.uts'
-import { toLoginWithRedirect, getCurrentPageUrlWithQuery } from '@/utils/authRedirect.uts'
-
-export type EnsureLoginOptions = {
- redirectUrl?: string
- toastTitle?: string
-}
-
-export function ensureAnalyticsLogin(opts?: EnsureLoginOptions): boolean {
- const uid = getUserIdOrNull()
- if (uid != null && uid !== '') return true
-
- const target = (opts?.redirectUrl != null && opts?.redirectUrl?.length > 0)
- ? opts?.redirectUrl as string
- : getCurrentPageUrlWithQuery()
-
- uni.showToast({ title: opts?.toastTitle ?? '请先登录', icon: 'none' })
- toLoginWithRedirect(target)
- return false
-}
diff --git a/mall/services/analytics/couponAnalysisService.uts b/mall/services/analytics/couponAnalysisService.uts
deleted file mode 100644
index b20e4d06..00000000
--- a/mall/services/analytics/couponAnalysisService.uts
+++ /dev/null
@@ -1,42 +0,0 @@
-import { computeDateRange, toDateOnly } from './dateRange.uts'
-import { rpcOrEmptyArray, rpcOrNull } from './rpc.uts'
-
-export type CouponAnalysisData = {
- overviewRow: UTSJSONObject | null
- typeList: Array
- channelList: Array
- trendList: Array
- conversionList: Array
-}
-
-export async function fetchCouponAnalysis(period: string, range?: { start: string; end: string } | null): Promise {
- let startIso: string;
- let endIso: string;
-
- if (range != null && range.start && range.end) {
- startIso = range.start;
- endIso = range.end;
- } else {
- const computedRange = computeDateRange(period)
- startIso = computedRange.startIso
- endIso = computedRange.endIso
- }
-
- const p_start_date = toDateOnly(startIso)
- const p_end_date = toDateOnly(endIso)
-
- const params = {
- p_start_date,
- p_end_date
- } as any
-
- const [overviewRow, typeList, channelList, trendList, conversionList] = await Promise.all([
- rpcOrNull('rpc_analytics_coupon_overview', params),
- rpcOrEmptyArray('rpc_analytics_coupon_by_type', params),
- rpcOrEmptyArray('rpc_analytics_coupon_by_channel', params),
- rpcOrEmptyArray('rpc_analytics_coupon_trend', params),
- rpcOrEmptyArray('rpc_analytics_coupon_conversion', params)
- ])
-
- return { overviewRow, typeList, channelList, trendList, conversionList }
-}
diff --git a/mall/services/analytics/customReportService.uts b/mall/services/analytics/customReportService.uts
deleted file mode 100644
index abbe7451..00000000
--- a/mall/services/analytics/customReportService.uts
+++ /dev/null
@@ -1,91 +0,0 @@
-import { rpcOrEmptyArray, rpcOrValue } from './rpc.uts'
-
-export type CustomReportListItem = {
- id: string
- title: string
- description: string
- period: string
- updated_at: string
-}
-
-export type CreateCustomReportParams = {
- title: string
- description: string
- period: string
- metrics: Array
- chartType: string
-}
-
-export type UpdateCustomReportParams = {
- reportId: string
- title: string
- description: string | null
- period: string | null
-}
-
-function safeString(v: any): string {
- return v != null ? `${v}` : ''
-}
-
-// 改造:不再直查 analytics_reports 表,统一通过 RPC 获取当前用户的报表列表
-export async function listCustomReports(ownerUserId: string): Promise> {
- // rpc_get_custom_reports 基于 auth.uid() 过滤,无需额外参数,这里保留签名用于兼容调用方
- const rows = await rpcOrEmptyArray('rpc_get_custom_reports', {} as any)
- const list: Array = []
- for (let i = 0; i < rows.length; i++) {
- const r: any = rows[i]
- list.push({
- id: safeString(r.getAny?.('id') ?? r.getString?.('id')),
- title: safeString(r.getAny?.('title') ?? r.getString?.('title')),
- description: safeString(r.getAny?.('description') ?? r.getString?.('description')),
- period: safeString(r.getAny?.('period') ?? r.getString?.('period')),
- updated_at: safeString(r.getAny?.('updated_at') ?? r.getString?.('updated_at'))
- })
- }
- return list
-}
-
-// 改造:RPC 参数改为 p_definition(JSONB),承载 period/metrics/chartType
-export async function createCustomReport(params: CreateCustomReportParams): Promise {
- const definition = {
- period: params.period,
- metrics: params.metrics,
- chartType: params.chartType || 'line'
- }
-
- const data = await rpcOrValue('rpc_create_custom_report', {
- p_title: params.title,
- p_description: params.description || '',
- p_definition: definition
- } as any)
-
- if (data == null) {
- throw new Error('保存失败:未返回报表ID')
- }
-
- return `${data}`
-}
-
-export async function updateCustomReport(params: UpdateCustomReportParams): Promise {
- // 注意:旧 UI 只传 title/description/period,这里把 period 合并进 definition
- const definition = {
- period: params.period
- }
-
- await rpcOrValue('rpc_update_custom_report', {
- p_report_id: params.reportId,
- p_title: params.title,
- p_description: params.description,
- p_definition: definition
- } as any)
-
- return true
-}
-
-export async function deleteCustomReport(reportId: string): Promise {
- await rpcOrValue('rpc_delete_custom_report', {
- p_report_id: reportId
- } as any)
-
- return true
-}
diff --git a/mall/services/analytics/dashboardService.uts b/mall/services/analytics/dashboardService.uts
deleted file mode 100644
index b9f550d6..00000000
--- a/mall/services/analytics/dashboardService.uts
+++ /dev/null
@@ -1,145 +0,0 @@
-import { computeDateRange, toDateOnly } from './dateRange.uts'
-import { rpcOrEmptyArray, rpcOrNull, rpcOrValue } from './rpc.uts'
-
-export type TrendData = { x: Array; gmv: Array; orders: Array }
-export type SegmentItem = { name: string; value: number }
-export type TrafficItem = { name: string; value: number }
-export type TopProductItem = { id: string; rank: number; name: string; sales: number }
-export type TopMerchantItem = { id: string; rank: number; name: string; sales: number; growth: number }
-
-function safeNumber(v: any): number {
- const n = Number(v)
- return isFinite(n) ? n : 0
-}
-
-export async function fetchDashboardTrend(period: string, range?: { start: string; end: string } | null): Promise {
- let startIso: string;
- let endIso: string;
-
- if (range != null && range.start && range.end) {
- startIso = range.start;
- endIso = range.end;
- } else {
- const computedRange = computeDateRange(period)
- startIso = computedRange.startIso
- endIso = computedRange.endIso
- }
-
- const p_start_date = toDateOnly(startIso)
- const p_end_date = toDateOnly(endIso)
-
- const rows = await rpcOrEmptyArray('rpc_analytics_sales_trend', {
- p_start_date,
- p_end_date
- } as any)
-
- const x: Array = []
- const gmv: Array = []
- const orders: Array = []
- for (let i = 0; i < rows.length; i++) {
- const row: any = rows[i]
- const d = `${row.getAny?.('date') ?? ''}`
- x.push(d.length >= 10 ? d.slice(5) : d)
- gmv.push(safeNumber(row.getAny?.('gmv') ?? 0))
- orders.push(safeNumber(row.getAny?.('orders') ?? 0))
- }
- return { x, gmv, orders }
-}
-
-export async function fetchDashboardRealtime(): Promise {
- const [kpiRow, onlineUsersVal] = await Promise.all([
- rpcOrNull('rpc_analytics_realtime_kpis', {} as any),
- rpcOrValue('rpc_analytics_online_users', {} as any)
- ])
-
- const obj: any = kpiRow != null ? kpiRow : ({} as any)
-
- return {
- gmv: Math.round(safeNumber(obj.getAny?.('gmv') ?? 0)),
- gmv_growth: safeNumber(obj.getAny?.('gmv_growth') ?? 0),
- orders: Math.round(safeNumber(obj.getAny?.('orders') ?? 0)),
- order_growth: safeNumber(obj.getAny?.('order_growth') ?? 0),
- online_users: Math.round(safeNumber(onlineUsersVal ?? 0)),
- conversion_rate: safeNumber(obj.getAny?.('conversion_rate') ?? 0),
- conversion_growth: safeNumber(obj.getAny?.('conversion_growth') ?? 0)
- }
-}
-
-export async function fetchDashboardTopProducts(period: string, limit: number = 50): Promise> {
- const { startIso, endIso } = computeDateRange(period)
- const rows = await rpcOrEmptyArray('rpc_analytics_top_products', {
- p_start_date: toDateOnly(startIso),
- p_end_date: toDateOnly(endIso),
- p_limit: limit
- } as any)
-
- const list: Array = []
- for (let i = 0; i < rows.length; i++) {
- const row: any = rows[i]
- list.push({
- id: `${row.getAny?.('id') ?? i}`,
- rank: i + 1,
- name: `${row.getAny?.('name') ?? '未知商品'}`,
- sales: safeNumber(row.getAny?.('sales') ?? 0)
- })
- }
- return list
-}
-
-export async function fetchDashboardTopMerchants(period: string, limit: number = 50): Promise> {
- const { startIso, endIso } = computeDateRange(period)
- const rows = await rpcOrEmptyArray('rpc_analytics_top_merchants', {
- p_start_date: toDateOnly(startIso),
- p_end_date: toDateOnly(endIso),
- p_limit: limit
- } as any)
-
- const list: Array = []
- for (let i = 0; i < rows.length; i++) {
- const row: any = rows[i]
- list.push({
- id: `${row.getAny?.('id') ?? i}`,
- rank: i + 1,
- name: `${row.getAny?.('name') ?? row.getAny?.('shop_name') ?? '未知商家'}`,
- sales: safeNumber(row.getAny?.('sales') ?? 0),
- growth: safeNumber(row.getAny?.('growth') ?? 0)
- })
- }
- return list
-}
-
-export async function fetchDashboardUserSegments(period: string): Promise> {
- const { startIso, endIso } = computeDateRange(period)
- const rows = await rpcOrEmptyArray('rpc_analytics_user_segments', {
- p_start_date: toDateOnly(startIso),
- p_end_date: toDateOnly(endIso)
- } as any)
-
- const list: Array = []
- for (let i = 0; i < rows.length; i++) {
- const row: any = rows[i]
- list.push({
- name: `${row.getAny?.('name') ?? row.getAny?.('segment_name') ?? row.getAny?.('label') ?? '未知'}`,
- value: safeNumber(row.getAny?.('value') ?? row.getAny?.('count') ?? row.getAny?.('amount') ?? 0)
- })
- }
- return list
-}
-
-export async function fetchDashboardTrafficSources(period: string): Promise> {
- const { startIso, endIso } = computeDateRange(period)
- const rows = await rpcOrEmptyArray('rpc_analytics_traffic_sources', {
- p_start_date: toDateOnly(startIso),
- p_end_date: toDateOnly(endIso)
- } as any)
-
- const list: Array = []
- for (let i = 0; i < rows.length; i++) {
- const row: any = rows[i]
- list.push({
- name: `${row.getAny?.('name') ?? row.getAny?.('source_name') ?? row.getAny?.('label') ?? '未知'}`,
- value: safeNumber(row.getAny?.('value') ?? row.getAny?.('count') ?? row.getAny?.('amount') ?? 0)
- })
- }
- return list
-}
diff --git a/mall/services/analytics/dataDetailService.uts b/mall/services/analytics/dataDetailService.uts
deleted file mode 100644
index 6a3065cf..00000000
--- a/mall/services/analytics/dataDetailService.uts
+++ /dev/null
@@ -1,58 +0,0 @@
-import { rpcOrEmptyArray, rpcOrNull } from './rpc.uts'
-
-export type ReportInfo = {
- id: string
- title: string
- description: string
- definition: any
- updated_at: string
-}
-
-function safeString(v: any): string {
- return v != null ? `${v}` : ''
-}
-
-// 改造:调用 rpc_data_detail_report_info
-export async function fetchReportInfo(reportId: string): Promise {
- const row = await rpcOrNull('rpc_data_detail_report_info', {
- p_report_id: reportId
- } as any)
-
- if (row == null) return null
-
- return {
- id: safeString(row.getAny?.('id')),
- title: safeString(row.getAny?.('title')),
- description: safeString(row.getAny?.('description')),
- definition: row.getAny?.('definition'),
- updated_at: safeString(row.getAny?.('updated_at'))
- }
-}
-
-// 改造:调用 rpc_data_detail_rows
-export async function fetchReportRows(reportId: string, params: any): Promise> {
- const result = await rpcOrNull('rpc_data_detail_rows', {
- p_report_id: reportId,
- p_params: params
- } as any)
-
- if (result == null) return []
- const anyData = result as any
- return Array.isArray(anyData) ? (anyData as Array) : ([] as Array)
-}
-
-// 保留调用,但 RPC 是模拟数据
-export async function fetchDrilldown(reportId: string, itemId: string): Promise> {
- return await rpcOrEmptyArray('rpc_data_detail_drill_items', {
- p_report_id: reportId,
- p_item_id: itemId
- } as any)
-}
-
-// 保留调用,但 RPC 是模拟数据
-export async function fetchComparison(itemId: string, period: string): Promise> {
- return await rpcOrEmptyArray('rpc_data_detail_compare_gmv', {
- p_item_id: itemId,
- p_period: period
- } as any)
-}
diff --git a/mall/services/analytics/dateRange.uts b/mall/services/analytics/dateRange.uts
deleted file mode 100644
index 28705069..00000000
--- a/mall/services/analytics/dateRange.uts
+++ /dev/null
@@ -1,15 +0,0 @@
-export type DateRange = { startIso: string; endIso: string }
-
-export function computeDateRange(period: string): DateRange {
- const now = new Date()
- const start = new Date(now.getTime())
- if (period === '7d') start.setDate(start.getDate() - 7)
- else if (period === '30d') start.setDate(start.getDate() - 30)
- else if (period === '90d') start.setDate(start.getDate() - 90)
- else if (period === '1y') start.setFullYear(start.getFullYear() - 1)
- return { startIso: start.toISOString(), endIso: now.toISOString() }
-}
-
-export function toDateOnly(iso: string): string {
- return iso.length >= 10 ? iso.substring(0, 10) : iso
-}
diff --git a/mall/services/analytics/deliveryAnalysisService.uts b/mall/services/analytics/deliveryAnalysisService.uts
deleted file mode 100644
index ff1233fc..00000000
--- a/mall/services/analytics/deliveryAnalysisService.uts
+++ /dev/null
@@ -1,36 +0,0 @@
-import { computeDateRange } from './dateRange.uts'
-import { rpcOrEmptyArray } from './rpc.uts'
-
-export type DeliveryAnalysisData = {
- trendList: Array
- topList: Array
- startIso: string
- endIso: string
-}
-
-export async function fetchDeliveryAnalysis(period: string, range?: { start: string; end: string } | null): Promise {
- let startIso: string;
- let endIso: string;
-
- if (range != null && range.start && range.end) {
- startIso = range.start;
- endIso = range.end;
- } else {
- const computedRange = computeDateRange(period)
- startIso = computedRange.startIso
- endIso = computedRange.endIso
- }
-
- const trendList = await rpcOrEmptyArray('rpc_delivery_efficiency_daily', {
- p_start: startIso,
- p_end: endIso
- } as any)
-
- const topList = await rpcOrEmptyArray('rpc_delivery_efficiency_top_drivers', {
- p_start: startIso,
- p_end: endIso,
- p_limit: 10
- } as any)
-
- return { trendList, topList, startIso, endIso }
-}
diff --git a/mall/services/analytics/errorMapper.uts b/mall/services/analytics/errorMapper.uts
deleted file mode 100644
index fe1872e9..00000000
--- a/mall/services/analytics/errorMapper.uts
+++ /dev/null
@@ -1,53 +0,0 @@
-export type AnalyticsErrorContext = {
- action?: string
- fallbackMessage?: string
-}
-
-export function mapAnalyticsError(err: any, ctx?: AnalyticsErrorContext): string {
- const fallback = ctx?.fallbackMessage ?? '操作失败'
-
- try {
- if (err == null) return fallback
-
- // string
- if (typeof err === 'string') {
- const s = err.trim()
- return s.length > 0 ? s : fallback
- }
-
- // Error
- const eAny = err as any
- const msg: string = (eAny?.message != null ? String(eAny.message) : '')
- const code: string = (eAny?.code != null ? String(eAny.code) : '')
- const status: number | null = (typeof eAny?.status === 'number' ? (eAny.status as number) : null)
-
- // RPC not found / route not found
- if (status === 404) {
- return '功能尚未部署(RPC 未创建)'
- }
-
- // auth
- if (code === 'P0001' || msg.includes('用户未登录') || msg.toLowerCase().includes('not logged') || msg.toLowerCase().includes('jwt')) {
- return '请先登录'
- }
-
- // permission
- if (msg.includes('无权限') || msg.toLowerCase().includes('permission') || msg.toLowerCase().includes('forbidden')) {
- return '无权限操作'
- }
-
- // not found
- if (msg.includes('不存在') || msg.toLowerCase().includes('not found')) {
- return '数据不存在或已删除'
- }
-
- // fallback to message
- if (msg.trim().length > 0) {
- return msg
- }
-
- return fallback
- } catch (e) {
- return fallback
- }
-}
diff --git a/mall/services/analytics/insightDetailService.uts b/mall/services/analytics/insightDetailService.uts
deleted file mode 100644
index 58492237..00000000
--- a/mall/services/analytics/insightDetailService.uts
+++ /dev/null
@@ -1,67 +0,0 @@
-import supa from '@/components/supadb/aksupainstance.uts'
-
-export type InsightDetail = {
- id: string
- report_id: string
- type: string
- impact: string
- title: string
- content: string
- created_at: string
-}
-
-export type RelatedReport = {
- id: string
- title: string
- type: string
- period: string
- generated_at: string
-}
-
-export async function fetchInsightDetail(insightId: string): Promise {
- const res: any = await supa
- .from('analytics_insights')
- .select('id, report_id, type, impact, title, content, created_at')
- .eq('id', insightId)
- .single()
-
- if (res?.error != null) {
- throw res.error
- }
-
- const it: any = res.data
- if (it == null) return null
-
- return {
- id: `${it.id}`,
- report_id: `${it.report_id || ''}`,
- type: `${it.type || 'info'}`,
- impact: `${it.impact || 'medium'}`,
- title: `${it.title || ''}`,
- content: `${it.content || ''}`,
- created_at: `${it.created_at || ''}`
- }
-}
-
-export async function fetchRelatedReport(reportId: string): Promise {
- const rRes: any = await supa
- .from('analytics_reports')
- .select('id, title, type, period, generated_at')
- .eq('id', reportId)
- .single()
-
- if (rRes?.error != null) {
- throw rRes.error
- }
-
- const r: any = rRes.data
- if (r == null) return null
-
- return {
- id: `${r.id}`,
- title: `${r.title}`,
- type: `${r.type}`,
- period: `${r.period}`,
- generated_at: `${r.generated_at || ''}`
- }
-}
diff --git a/mall/services/analytics/marketTrendsService.uts b/mall/services/analytics/marketTrendsService.uts
deleted file mode 100644
index 866fd1a6..00000000
--- a/mall/services/analytics/marketTrendsService.uts
+++ /dev/null
@@ -1,64 +0,0 @@
-import { computeDateRange, toDateOnly } from './dateRange.uts'
-import { rpcOrEmptyArray } from './rpc.uts'
-
-export type MarketTrendsData = {
- trendRows: Array
- categoryRows: Array
- seasonalRows: Array
- priceRows: Array
- competitionRows: Array
- startIso: string
- endIso: string
-}
-
-export async function fetchMarketTrends(period: string, range?: { start: string; end: string } | null): Promise {
- let startIso: string;
- let endIso: string;
-
- if (range != null && range.start && range.end) {
- startIso = range.start;
- endIso = range.end;
- } else {
- const computedRange = computeDateRange(period)
- startIso = computedRange.startIso
- endIso = computedRange.endIso
- }
-
- const startDate = toDateOnly(startIso)
- const endDate = toDateOnly(endIso)
-
- const trendRows = await rpcOrEmptyArray('rpc_analytics_market_trend_daily', {
- p_start: startIso,
- p_end: endIso
- } as UTSJSONObject)
-
- const categoryRows = await rpcOrEmptyArray('rpc_analytics_category_sales', {
- p_start_date: startDate,
- p_end_date: endDate
- } as UTSJSONObject)
-
- const seasonalRows = await rpcOrEmptyArray('rpc_analytics_seasonal_trend', {
- p_start_date: startDate,
- p_end_date: endDate
- } as UTSJSONObject)
-
- const priceRows = await rpcOrEmptyArray('rpc_analytics_price_trend', {
- p_start: startIso,
- p_end: endIso
- } as UTSJSONObject)
-
- const competitionRows = await rpcOrEmptyArray('rpc_analytics_competition_share', {
- p_start_date: startDate,
- p_end_date: endDate
- } as UTSJSONObject)
-
- return {
- trendRows,
- categoryRows,
- seasonalRows,
- priceRows,
- competitionRows,
- startIso,
- endIso
- }
-}
diff --git a/mall/services/analytics/productInsightsService.uts b/mall/services/analytics/productInsightsService.uts
deleted file mode 100644
index fa4e2000..00000000
--- a/mall/services/analytics/productInsightsService.uts
+++ /dev/null
@@ -1,163 +0,0 @@
-import { computeDateRange, toDateOnly } from './dateRange.uts'
-import { rpcOrEmptyArray, rpcOrNull } from './rpc.uts'
-
-export type ProductOverview = {
- total_products: number
- product_growth: number
- hot_products: number
- turnover_rate: number
- turnover_growth: number
- avg_stock: number
- stock_growth: number
-}
-
-export type ProductRank = { id: string; rank: number; name: string; sales: number; growth: number }
-
-export type ProductTrendRow = { date: string; gmv: number; qty: number; orders: number }
-
-function safeNumber(v: any): number {
- const n = Number(v)
- return isFinite(n) ? n : 0
-}
-
-export async function fetchProductOverview(period: string, range?: { start: string; end: string } | null): Promise {
- let startIso: string;
- let endIso: string;
-
- if (range != null && range.start && range.end) {
- startIso = range.start;
- endIso = range.end;
- } else {
- const computedRange = computeDateRange(period)
- startIso = computedRange.startIso
- endIso = computedRange.endIso
- }
-
- const row = await rpcOrNull('rpc_product_insights_overview', {
- p_start: toDateOnly(startIso),
- p_end: toDateOnly(endIso)
- } as any)
-
- const obj: any = row != null ? row : ({} as any)
- return {
- total_products: safeNumber(obj.getAny?.('total_products') ?? 0),
- product_growth: safeNumber(obj.getAny?.('product_growth') ?? 0),
- hot_products: safeNumber(obj.getAny?.('hot_products') ?? 0),
- turnover_rate: safeNumber(obj.getAny?.('turnover_rate') ?? 0),
- turnover_growth: safeNumber(obj.getAny?.('turnover_growth') ?? 0),
- avg_stock: safeNumber(obj.getAny?.('avg_stock') ?? 0),
- stock_growth: safeNumber(obj.getAny?.('stock_growth') ?? 0)
- }
-}
-
-export async function fetchTopProducts(period: string, limit: number = 10, range?: { start: string; end: string } | null): Promise> {
- let startIso: string;
- let endIso: string;
-
- if (range != null && range.start && range.end) {
- startIso = range.start;
- endIso = range.end;
- } else {
- const computedRange = computeDateRange(period)
- startIso = computedRange.startIso
- endIso = computedRange.endIso
- }
-
- const rows = await rpcOrEmptyArray('rpc_analytics_top_products', {
- p_start_date: toDateOnly(startIso),
- p_end_date: toDateOnly(endIso),
- p_limit: limit
- } as any)
-
- const list: Array = []
- for (let i = 0; i < rows.length; i++) {
- const r: any = rows[i]
- list.push({
- id: `${r.getAny?.('id') ?? i}`,
- rank: i + 1,
- name: `${r.getAny?.('name') ?? '未知商品'}`,
- sales: safeNumber(r.getAny?.('sales') ?? 0),
- growth: safeNumber(r.getAny?.('growth') ?? 0)
- })
- }
- return list
-}
-
-export async function fetchProductTrend(period: string, productId: string, range?: { start: string; end: string } | null): Promise> {
- let startIso: string;
- let endIso: string;
-
- if (range != null && range.start && range.end) {
- startIso = range.start;
- endIso = range.end;
- } else {
- const computedRange = computeDateRange(period)
- startIso = computedRange.startIso
- endIso = computedRange.endIso
- }
-
- const rows = await rpcOrEmptyArray('rpc_analytics_product_trend', {
- p_start_date: toDateOnly(startIso),
- p_end_date: toDateOnly(endIso),
- p_product_id: productId
- } as any)
-
- const out: Array = []
- for (let i = 0; i < rows.length; i++) {
- const r: any = rows[i]
- const date = `${r.getAny?.('date') ?? ''}`
- out.push({
- date,
- gmv: safeNumber(r.getAny?.('gmv') ?? 0),
- qty: safeNumber(r.getAny?.('qty') ?? 0),
- orders: safeNumber(r.getAny?.('orders') ?? 0)
- })
- }
- return out
-}
-
-export async function fetchCategorySales(period: string, range?: { start: string; end: string } | null): Promise> {
- let startIso: string;
- let endIso: string;
-
- if (range != null && range.start && range.end) {
- startIso = range.start;
- endIso = range.end;
- } else {
- const computedRange = computeDateRange(period)
- startIso = computedRange.startIso
- endIso = computedRange.endIso
- }
-
- return await rpcOrEmptyArray('rpc_analytics_category_sales', {
- p_start_date: toDateOnly(startIso),
- p_end_date: toDateOnly(endIso)
- } as any)
-}
-
-export async function fetchStockInsights(period: string): Promise> {
- return await rpcOrEmptyArray('rpc_product_insights_stock', {} as any)
-}
-
-export async function fetchPriceTrend(period: string, range?: { start: string; end: string } | null): Promise> {
- let startIso: string;
- let endIso: string;
-
- if (range != null && range.start && range.end) {
- startIso = range.start;
- endIso = range.end;
- } else {
- const computedRange = computeDateRange(period)
- startIso = computedRange.startIso
- endIso = computedRange.endIso
- }
-
- return await rpcOrEmptyArray('rpc_analytics_price_trend', {
- p_start: startIso,
- p_end: endIso
- } as any)
-}
-
-export async function fetchReviewInsights(): Promise> {
- return await rpcOrEmptyArray('rpc_product_insights_reviews', {} as any)
-}
diff --git a/mall/services/analytics/reportDetailService.uts b/mall/services/analytics/reportDetailService.uts
deleted file mode 100644
index ea72f6cd..00000000
--- a/mall/services/analytics/reportDetailService.uts
+++ /dev/null
@@ -1,146 +0,0 @@
-import supa from '@/components/supadb/aksupainstance.uts'
-
-export type AnalyticsReport = {
- id: string
- title: string
- type: string
- period: string
- generated_at: string
- description: string
-}
-
-export type AnalyticsReportMetric = {
- key: string
- label: string
- value: number
- format: string
- icon: string
- color: string
- change: number
-}
-
-export type AnalyticsReportRow = {
- row_date: string
- gmv: number
- orders: number
- users: number
- conversion: number
- avg_order_amount: number
-}
-
-export type AnalyticsInsight = {
- id: string
- type: string
- title: string
- content: string
- impact: string
-}
-
-export type AnalyticsRelatedReport = AnalyticsReport
-
-function safeNumber(v: any): number {
- const n = Number(v)
- return isFinite(n) ? n : 0
-}
-
-export async function fetchReport(reportId: string): Promise {
- const reportRes: any = await supa
- .from('analytics_reports')
- .select('id, title, type, period, generated_at, description')
- .eq('id', reportId)
-
- if (reportRes?.error != null) throw reportRes.error
-
- const rows: Array = Array.isArray(reportRes.data) ? (reportRes.data as Array) : []
- if (rows.length === 0) return null
- const r = rows[0]
- return {
- id: `${r.id}`,
- title: `${r.title}`,
- type: `${r.type}`,
- period: `${r.period}`,
- generated_at: `${r.generated_at}`,
- description: `${r.description || ''}`
- }
-}
-
-export async function fetchReportMetrics(reportId: string): Promise> {
- const metricRes: any = await supa
- .from('analytics_report_metrics')
- .select('metric_key, metric_label, metric_value_num, format, icon, color, change_pct')
- .eq('report_id', reportId)
-
- if (metricRes?.error != null) throw metricRes.error
-
- const metricRows: Array = Array.isArray(metricRes.data) ? (metricRes.data as Array) : []
- return metricRows.map((m: any) => ({
- key: `${m.metric_key}`,
- label: `${m.metric_label}`,
- value: safeNumber(m.metric_value_num),
- format: `${m.format || 'number'}`,
- icon: `${m.icon || '📊'}`,
- color: `${m.color || '#4caf50'}`,
- change: safeNumber(m.change_pct)
- }))
-}
-
-export async function fetchReportRows(reportId: string): Promise> {
- const rowsRes: any = await supa
- .from('analytics_report_rows')
- .select('row_date, gmv, orders, users, conversion, avg_order_amount')
- .eq('report_id', reportId)
- .order('row_date', { ascending: true } as any)
-
- if (rowsRes?.error != null) throw rowsRes.error
-
- const rows: Array = Array.isArray(rowsRes.data) ? (rowsRes.data as Array) : []
- return rows.map((row: any) => ({
- row_date: `${row.row_date}`,
- gmv: safeNumber(row.gmv),
- orders: safeNumber(row.orders),
- users: safeNumber(row.users),
- conversion: safeNumber(row.conversion),
- avg_order_amount: safeNumber(row.avg_order_amount)
- }))
-}
-
-export async function fetchReportInsights(reportId: string): Promise> {
- const insightRes: any = await supa
- .from('analytics_insights')
- .select('id, type, title, content, impact')
- .eq('report_id', reportId)
- .order('created_at', { ascending: false } as any)
-
- if (insightRes?.error != null) throw insightRes.error
-
- const insRows: Array = Array.isArray(insightRes.data) ? (insightRes.data as Array) : []
- return insRows.map((it: any) => ({
- id: `${it.id}`,
- type: `${it.type || 'info'}`,
- title: `${it.title}`,
- content: `${it.content}`,
- impact: `${it.impact || 'medium'}`
- }))
-}
-
-export async function fetchRelatedReports(reportType: string, excludeReportId: string): Promise> {
- const relatedRes: any = await supa
- .from('analytics_reports')
- .select('id, title, type, period, generated_at, description')
- .eq('type', reportType)
- .neq('id', excludeReportId)
- .order('generated_at', { ascending: false } as any)
- .limit(3 as any)
-
- if (relatedRes?.error != null) throw relatedRes.error
-
- const relRows: Array = Array.isArray(relatedRes.data) ? (relatedRes.data as Array) : []
- return relRows.map((it: any) => ({
- id: `${it.id}`,
- title: `${it.title}`,
- type: `${it.type}`,
- period: `${it.period}`,
- generated_at: `${it.generated_at}`,
- description: `${it.description || ''}`
- }))
-}
diff --git a/mall/services/analytics/rpc.uts b/mall/services/analytics/rpc.uts
deleted file mode 100644
index e791e4df..00000000
--- a/mall/services/analytics/rpc.uts
+++ /dev/null
@@ -1,42 +0,0 @@
-import supa, { ensureSupabaseReady } from '@/components/supadb/aksupainstance.uts'
-
-export async function rpcOrEmptyArray(functionName: string, params: UTSJSONObject): Promise> {
- await ensureSupabaseReady()
- const res: any = await supa.rpc(functionName, params)
- if (res?.status === 404) {
- return [] as Array
- }
- if (res?.error != null) {
- throw res.error
- }
- const anyData = res.data as any
- return Array.isArray(anyData) ? (anyData as Array) : ([] as Array)
-}
-
-export async function rpcOrNull(functionName: string, params: UTSJSONObject): Promise {
- await ensureSupabaseReady()
- const res: any = await supa.rpc(functionName, params)
- if (res?.status === 404) {
- return null
- }
- if (res?.error != null) {
- throw res.error
- }
- const anyData = res.data as any
- if (Array.isArray(anyData)) {
- return anyData.length > 0 ? (anyData[0] as UTSJSONObject) : null
- }
- return anyData != null ? (anyData as UTSJSONObject) : null
-}
-
-export async function rpcOrValue(functionName: string, params: UTSJSONObject): Promise {
- await ensureSupabaseReady()
- const res: any = await supa.rpc(functionName, params)
- if (res?.status === 404) {
- return null
- }
- if (res?.error != null) {
- throw res.error
- }
- return res.data
-}
diff --git a/mall/services/analytics/salesReportService.uts b/mall/services/analytics/salesReportService.uts
deleted file mode 100644
index 197f831f..00000000
--- a/mall/services/analytics/salesReportService.uts
+++ /dev/null
@@ -1,152 +0,0 @@
-import { computeDateRange, toDateOnly } from './dateRange.uts'
-import { rpcOrEmptyArray, rpcOrNull } from './rpc.uts'
-
-export type TrendData = { x: Array; gmv: Array; orders: Array }
-
-export type SalesKpis = {
- gmv: number
- gmv_growth: number
- orders: number
- order_growth: number
- conversion_rate: number
- conversion_growth: number
- avg_order_amount: number
- avg_order_growth: number
-}
-
-export type ProductRank = { id: string; rank: number; name: string; sales: number }
-export type MerchantRank = { id: string; rank: number; name: string; sales: number; growth: number }
-
-function safeNumber(v: any): number {
- const n = Number(v)
- return isFinite(n) ? n : 0
-}
-
-export async function fetchSalesKpis(period: string, range?: { start: string; end: string } | null): Promise {
- let startIso: string;
- let endIso: string;
-
- if (range != null && range.start && range.end) {
- startIso = range.start;
- endIso = range.end;
- } else {
- const computedRange = computeDateRange(period);
- startIso = computedRange.startIso;
- endIso = computedRange.endIso;
- }
- const row = await rpcOrNull('rpc_analytics_sales_kpis', {
- p_start_date: toDateOnly(startIso),
- p_end_date: toDateOnly(endIso)
- } as any)
-
- const obj: any = row != null ? row : ({} as any)
- const gmv = safeNumber(obj.getAny?.('gmv') ?? 0)
- const orders = safeNumber(obj.getAny?.('orders') ?? 0)
- const avgOrder = orders > 0 ? gmv / orders : 0
-
- return {
- gmv: Math.round(gmv),
- gmv_growth: safeNumber(obj.getAny?.('gmv_growth') ?? 0),
- orders: Math.round(orders),
- order_growth: safeNumber(obj.getAny?.('order_growth') ?? 0),
- conversion_rate: safeNumber(obj.getAny?.('conversion_rate') ?? 0),
- conversion_growth: safeNumber(obj.getAny?.('conversion_growth') ?? 0),
- avg_order_amount: avgOrder,
- avg_order_growth: safeNumber(obj.getAny?.('avg_order_growth') ?? obj.getAny?.('gmv_growth') ?? 0)
- }
-}
-
-export async function fetchSalesTrend(period: string, range?: { start: string; end: string } | null): Promise {
- let startIso: string;
- let endIso: string;
-
- if (range != null && range.start && range.end) {
- startIso = range.start;
- endIso = range.end;
- } else {
- const computedRange = computeDateRange(period);
- startIso = computedRange.startIso;
- endIso = computedRange.endIso;
- }
- const rows = await rpcOrEmptyArray('rpc_analytics_sales_trend', {
- p_start_date: toDateOnly(startIso),
- p_end_date: toDateOnly(endIso)
- } as any)
-
- const x: Array = []
- const gmvArr: Array = []
- const orderArr: Array = []
-
- for (let i = 0; i < rows.length; i++) {
- const r: any = rows[i]
- const d = `${r.getAny?.('date') ?? ''}`
- x.push(d.length >= 10 ? d.slice(5) : d)
- gmvArr.push(safeNumber(r.getAny?.('gmv') ?? 0))
- orderArr.push(safeNumber(r.getAny?.('orders') ?? 0))
- }
-
- return { x, gmv: gmvArr, orders: orderArr }
-}
-
-export async function fetchSalesTopProducts(period: string, limit: number = 50, range?: { start: string; end: string } | null): Promise> {
- let startIso: string;
- let endIso: string;
-
- if (range != null && range.start && range.end) {
- startIso = range.start;
- endIso = range.end;
- } else {
- const computedRange = computeDateRange(period);
- startIso = computedRange.startIso;
- endIso = computedRange.endIso;
- }
- const rows = await rpcOrEmptyArray('rpc_analytics_top_products', {
- p_start_date: toDateOnly(startIso),
- p_end_date: toDateOnly(endIso),
- p_limit: limit
- } as any)
-
- const list: Array = []
- for (let i = 0; i < rows.length; i++) {
- const r: any = rows[i]
- list.push({
- id: `${r.getAny?.('id') ?? i}`,
- rank: i + 1,
- name: `${r.getAny?.('name') ?? ''}`,
- sales: safeNumber(r.getAny?.('sales') ?? 0)
- })
- }
- return list
-}
-
-export async function fetchSalesTopMerchants(period: string, limit: number = 50, range?: { start: string; end: string } | null): Promise> {
- let startIso: string;
- let endIso: string;
-
- if (range != null && range.start && range.end) {
- startIso = range.start;
- endIso = range.end;
- } else {
- const computedRange = computeDateRange(period);
- startIso = computedRange.startIso;
- endIso = computedRange.endIso;
- }
- const rows = await rpcOrEmptyArray('rpc_analytics_top_merchants', {
- p_start_date: toDateOnly(startIso),
- p_end_date: toDateOnly(endIso),
- p_limit: limit
- } as any)
-
- const list: Array = []
- for (let i = 0; i < rows.length; i++) {
- const r: any = rows[i]
- list.push({
- id: `${r.getAny?.('id') ?? i}`,
- rank: i + 1,
- name: `${r.getAny?.('name') ?? ''}`,
- sales: safeNumber(r.getAny?.('sales') ?? 0),
- growth: safeNumber(r.getAny?.('growth') ?? 0)
- })
- }
- return list
-}
diff --git a/mall/services/analytics/userAnalysisService.uts b/mall/services/analytics/userAnalysisService.uts
deleted file mode 100644
index 4d294e5c..00000000
--- a/mall/services/analytics/userAnalysisService.uts
+++ /dev/null
@@ -1,121 +0,0 @@
-import { computeDateRange, toDateOnly } from './dateRange.uts'
-import { rpcOrEmptyArray, rpcOrNull } from './rpc.uts'
-
-// --- Type Definitions ---
-
-export type UserKpis = {
- total_users: number
- user_growth: number
- new_users: number
- new_user_growth: number
- active_users: number // DAU
- active_growth: number
- paid_users: number
- paid_growth: number
- new_user_conversion_rate: number
- repurchase_rate: number
-}
-
-export type UserGrowthTrend = {
- dates: Array
- newUsers: Array
- activeUsers: Array
-}
-
-export type UserActivity = {
- dau: number
- wau: number
- mau: number
-}
-
-export type UserRetention = {
- days: Array // e.g., '次日', '3日', '7日', '14日', '30日'
- rates: Array
-}
-
-export type NewVsOldComparison = {
- categories: Array // e.g., 'GMV', '订单数', '客单价'
- newUserData: Array
- oldUserData: Array
-}
-
-// --- Helper ---
-
-function safeNumber(v: any): number {
- const n = Number(v)
- return isFinite(n) ? n : 0
-}
-
-// --- Service Functions ---
-
-export async function fetchUserKpis(period: string): Promise {
- const { startIso, endIso } = computeDateRange(period)
- const row = await rpcOrNull('rpc_analytics_user_kpis', {
- p_start_date: toDateOnly(startIso),
- p_end_date: toDateOnly(endIso)
- } as any)
-
- const obj: any = row != null ? row : ({} as any)
- return {
- total_users: safeNumber(obj.getAny?.('total_users') ?? 0),
- user_growth: safeNumber(obj.getAny?.('user_growth') ?? 0),
- new_users: safeNumber(obj.getAny?.('new_users') ?? 0),
- new_user_growth: safeNumber(obj.getAny?.('new_user_growth') ?? 0),
- active_users: safeNumber(obj.getAny?.('active_users') ?? 0),
- active_growth: safeNumber(obj.getAny?.('active_growth') ?? 0),
- paid_users: safeNumber(obj.getAny?.('paid_users') ?? 0), // Placeholder
- paid_growth: safeNumber(obj.getAny?.('paid_growth') ?? 0), // Placeholder
- new_user_conversion_rate: safeNumber(obj.getAny?.('new_user_conversion_rate') ?? 0), // Placeholder
- repurchase_rate: safeNumber(obj.getAny?.('repurchase_rate') ?? 0)
- }
-}
-
-export async function fetchUserGrowthTrend(period: string): Promise {
- const { startIso, endIso } = computeDateRange(period)
- const rows = await rpcOrEmptyArray('rpc_analytics_user_growth_trend', {
- p_start_date: toDateOnly(startIso),
- p_end_date: toDateOnly(endIso)
- } as any)
-
- const dates: Array = []
- const newUsers: Array = []
- const activeUsers: Array