consumer模块完成度95%,优化安卓端界面和小程序测试3

This commit is contained in:
cyh666666
2026-03-13 17:12:00 +08:00
parent b2a6e5a142
commit b5c7947ad8
1741 changed files with 3427 additions and 2036 deletions

151
config/consumer/README.md Normal file
View File

@@ -0,0 +1,151 @@
# 消费者端专用配置说明
## 一、配置文件结构
```
mall/
├── pages.json # 公共配置(保持不变)
├── manifest.json # 公共配置(保持不变)
├── config/
│ └── consumer/ # 消费者端专用配置
│ ├── pages.json # 消费者端页面配置
│ ├── manifest.json # 消费者端应用配置
│ └── README.md # 本文档
└── scripts/ # 构建脚本
├── build-consumer.bat # 应用消费者端配置
└── restore-config.bat # 恢复公共配置
```
---
## 二、快速使用
### 方式一:一键切换(推荐)
在 HBuilderX 中打开项目,使用 **外部命令** 功能:
1. 菜单:**工具 → 外部命令 → 自定义外部命令**
2. 添加以下命令:
```
名称: 切换到消费者端配置
命令: scripts\build-consumer.bat
工作目录: ${projectPath}
名称: 恢复公共配置
命令: scripts\restore-config.bat
工作目录: ${projectPath}
```
3. 以后通过菜单 **工具 → 外部命令** 一键切换
### 方式二:手动运行脚本
在项目目录下双击运行:
- `scripts\build-consumer.bat` - 切换到消费者端配置
- `scripts\restore-config.bat` - 恢复公共配置
---
## 三、开发流程
### 3.1 开发消费者端小程序
```
1. 运行 build-consumer.bat切换配置
2. HBuilderX 编译微信小程序
3. 开发调试
4. 运行 restore-config.bat恢复配置
5. 提交代码
```
### 3.2 开发消费者端 App
直接在 HBuilderX 中编译 Android App无需切换配置。
---
## 四、配置文件说明
### 4.1 pages.json
消费者端专用页面配置:
**主包页面(核心页面)**
- 登录注册login, register, forgot-password
- 主要功能index, category, cart, profile
**分包页面(次级页面)**
- 商品product-detail, shop-detail, search
- 订单checkout, payment, orders, order-detail
- 用户settings, wallet, favorites, address-list
- 会员member/index, points/*, coupons
### 4.2 manifest.json
消费者端专用应用配置:
- 应用名称:商城消费者端
- 小程序 AppID需填写
- 分包优化配置
---
## 五、添加新页面
### 5.1 添加消费者端页面
1. 创建页面文件:`pages/mall/consumer/new-page.uvue`
2. 编辑 `config/consumer/pages.json`
```json
{
"path": "new-page",
"style": {
"navigationBarTitleText": "新页面"
}
}
```
### 5.2 添加公共页面
同时更新:
- `config/consumer/pages.json`
- 根目录 `pages.json`
---
## 六、Git 提交规范
```bash
# 只提交消费者端配置
git add config/consumer/
git commit -m "feat(consumer): 添加新页面配置"
# 只提交消费者端代码
git add pages/mall/consumer/
git commit -m "feat(consumer): 添加会员功能"
```
---
## 七、常见问题
### Q1: 编译时提示找不到页面?
检查 `config/consumer/pages.json` 中的页面路径。
### Q2: 忘记恢复配置怎么办?
直接运行 `restore-config.bat` 即可。
### Q3: 如何查看当前使用的是哪个配置?
查看根目录 `pages.json` 的内容,或检查是否存在 `.bak` 备份文件。
---
## 八、注意事项
- ✅ 只修改 `config/consumer/` 目录下的文件
- ❌ 不要修改根目录的 `pages.json``manifest.json`
- ✅ 编译小程序前运行 `build-consumer.bat`
- ✅ 编译完成后运行 `restore-config.bat`

View File

@@ -0,0 +1,82 @@
{
"name": "商城消费者端",
"appid": "__UNI__CONSUMER",
"description": "商城消费者端 - 购物、订单、会员等功能",
"versionName": "1.0.0",
"versionCode": "100",
"transformPx": false,
"app-plus": {
"usingComponents": true,
"nvueStyleCompiler": "uni-app",
"compilerVersion": 3,
"splashscreen": {
"alwaysShowBeforeRender": true,
"waiting": true,
"autoclose": true,
"delay": 0
},
"modules": {},
"distribute": {
"android": {
"permissions": [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.INTERNET\"/>"
]
},
"ios": {},
"sdkConfigs": {}
}
},
"quickapp": {},
"mp-weixin": {
"appid": "",
"setting": {
"urlCheck": false,
"es6": true,
"postcss": true,
"minified": true,
"enhance": true
},
"usingComponents": true,
"optimization": {
"subPackages": true
},
"lazyCodeLoading": "requiredComponents"
},
"mp-alipay": {
"appid": "",
"usingComponents": true
},
"mp-baidu": {
"usingComponents": true
},
"mp-toutiao": {
"usingComponents": true
},
"uniStatistics": {
"enable": false
},
"vueVersion": "3",
"uni-app-x": {},
"h5": {
"title": "商城消费者端",
"router": {
"mode": "hash",
"base": "./"
}
},
"app-android": {
"distribute": {
"modules": {},
"android": {
"usesCleartextTraffic": true
}
}
}
}

248
config/consumer/pages.json Normal file
View File

@@ -0,0 +1,248 @@
{
"pages": [
{
"path": "pages/user/login",
"style": {
"navigationBarTitleText": "用户登录",
"navigationStyle": "custom"
}
},
{
"path": "pages/main/index",
"style": {
"navigationBarTitleText": "首页",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},
{
"path": "pages/main/category",
"style": {
"navigationBarTitleText": "分类",
"navigationStyle": "custom"
}
},
{
"path": "pages/main/cart",
"style": {
"navigationBarTitleText": "购物车",
"navigationStyle": "custom"
}
},
{
"path": "pages/main/profile",
"style": {
"navigationBarTitleText": "我的",
"navigationStyle": "custom"
}
}
],
"subPackages": [
{
"root": "pages/mall/consumer",
"pages": [
{
"path": "settings",
"style": { "navigationBarTitleText": "设置" }
},
{
"path": "wallet",
"style": { "navigationBarTitleText": "我的钱包" }
},
{
"path": "withdraw",
"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/followed-shops",
"style": { "navigationBarTitleText": "关注店铺" }
},
{
"path": "points/index",
"style": { "navigationBarTitleText": "积分管理" }
},
{
"path": "points/signin",
"style": { "navigationBarTitleText": "每日签到" }
},
{
"path": "points/exchange",
"style": { "navigationBarTitleText": "积分兑换" }
},
{
"path": "points/exchange-records",
"style": { "navigationBarTitleText": "兑换记录" }
},
{
"path": "product-reviews",
"style": { "navigationBarTitleText": "商品评价" }
},
{
"path": "my-reviews",
"style": { "navigationBarTitleText": "我的评价" }
},
{
"path": "balance/index",
"style": { "navigationBarTitleText": "我的余额" }
},
{
"path": "share/index",
"style": { "navigationBarTitleText": "我的分享" }
},
{
"path": "share/detail",
"style": { "navigationBarTitleText": "分享详情" }
},
{
"path": "member/index",
"style": { "navigationBarTitleText": "会员中心" }
},
{
"path": "message-detail",
"style": { "navigationBarTitleText": "消息详情" }
},
{
"path": "red-packets/index",
"style": { "navigationBarTitleText": "我的红包" }
},
{
"path": "bank-cards/index",
"style": { "navigationBarTitleText": "银行卡管理" }
},
{
"path": "bank-cards/add",
"style": { "navigationBarTitleText": "添加银行卡" }
}
]
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "商城",
"navigationBarBackgroundColor": "#ffffff",
"backgroundColor": "#f5f5f5"
},
"tabBar": {
"color": "#999999",
"selectedColor": "#ff5000",
"borderStyle": "black",
"backgroundColor": "#ffffff",
"list": [
{
"pagePath": "pages/main/index",
"text": "首页",
"iconPath": "static/tabbar/home.png",
"selectedIconPath": "static/tabbar/home-active.png"
},
{
"pagePath": "pages/main/category",
"text": "分类",
"iconPath": "static/tabbar/category.png",
"selectedIconPath": "static/tabbar/category.png"
},
{
"pagePath": "pages/main/cart",
"text": "购物车",
"iconPath": "static/tabbar/cart.png",
"selectedIconPath": "static/tabbar/cart.png"
},
{
"pagePath": "pages/main/profile",
"text": "我的",
"iconPath": "static/tabbar/user.png",
"selectedIconPath": "static/tabbar/user.png"
}
]
},
"preloadRule": {
"pages/main/index": {
"network": "all",
"packages": ["pages/mall/consumer"]
}
},
"easycom": {
"autoscan": true,
"custom": {
"^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue"
}
},
"optimization": {
"subPackages": true
}
}