pages.json文件如下:
/**
* WanlShop - App页面配置
* @author zzj
* @creationtime 2022年3月10日12:52:20
* @lasttime 2022年3月10日05:03:23
**/
{
/* 主包 */
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/index",
"style": {
"navigationBarTextStyle": "white", // 状态栏颜色
// #ifdef MP-WEIXIN || MP-ALIPAY || H5
"navigationStyle": "custom",
// #endif
// #ifdef MP-TOUTIAO
"navigationBarTitleText": "",
// #endif
"disableScroll": false,
"enablePullDownRefresh": false,
"titleAlign": "center",
"mp-alipay": { //在支付宝小程序中如果不生效 就加上这两行代码 就会生效啦
"transparentTitle": "always",
"titlePenetrate": "YES"
}
}
},
{
"path": "pages/profile/profile",
"style": {
"navigationBarTitleText": "个人中心",
"navigationBarTextStyle": "black", // 状态栏颜色
"disableScroll": false,
"backgroundColor": "#f7f7f7",
"enablePullDownRefresh": false, //开启上拉
"app-plus": {
"scrollIndicator": "none"
}
}
}
],
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示" // 高速公路行驶持续后台定位
}
},
/*分包*/
"subPackages":[
/* 个人中心 */
{
"root": "pages/address",
"pages": [
{
"path": "address",
"style": {
"navigationBarTitleText": "收货地址",
"enablePullDownRefresh": true, //开启上拉
"onReachBottomDistance": 150, //触发间距
"app-plus": {
"titleNView": {
"type": "float",
"backgroundColor": "",
"blurEffect": "light"
}
},
"h5": {
"titleNView": {
"backgroundColor": "#f7f7f7"
}
}
}
},
{
"path": "addressManage",
"style": {
"navigationBarTitleText": "新增地址",
"enablePullDownRefresh": true, //开启上拉
"onReachBottomDistance": 150, //触发间距
"app-plus": {
"titleNView": {
"type": "float",
"backgroundColor": "",
"blurEffect": "light"
}
},
"h5": {
"titleNView": {
"backgroundColor": "#f7f7f7"
}
}
}
}
]
},
/* 登录 */
{
"root": "pages/login",
"pages": [
{
"path": "login",
"style": {
"navigationBarTitleText": "登录",
"app-plus": {
"titleNView": {
"type": "float",
"backgroundColor": "",
"blurEffect": "light"
}
},
"h5": {
"titleNView": {
"backgroundColor": "#f7f7f7"
}
}
}
}
]
},
/* 个人资料 */
{
"root": "pages/user",
"pages": [
{
"path": "user",
"style": {
"navigationBarTitleText": "个人资料",
"enablePullDownRefresh": true,
"app-plus": {
"titleNView": {
"type": "float",
"backgroundColor": "",
"blurEffect": "light"
}
},
"h5": {
"titleNView": {
"backgroundColor": "#f7f7f7"
}
}
},
"keepAlive": true
}
]
},
/* 我的订单 */
{
"root": "pages/order",
"pages": [
{
"path": "order",
"style": {
"navigationBarTitleText": "我的订单",
"app-plus": {
"titleNView": {
"type": "float",
"backgroundColor": "",
"blurEffect": "light"
}
},
"h5": {
"titleNView": {
"backgroundColor": "#f7f7f7"
}
}
}
},
{
"path": "orderDetail/orderDetail",
"style": {
"navigationBarTitleText": "订单详情",
"app-plus": {
"titleNView": {
"type": "float",
"backgroundColor": "",
"blurEffect": "light"
}
},
"h5": {
"titleNView": {
"backgroundColor": "#f7f7f7"
}
}
}
}
]
},
/* 设置 */
{
"root": "pages/setting",
"pages": [
{
"path": "setting",
"style": {
"navigationBarTitleText": "设置",
"app-plus": {
"titleNView": {
"type": "float",
"backgroundColor": "",
"blurEffect": "light"
}
},
"h5": {
"titleNView": {
"backgroundColor": "#f7f7f7"
}
}
}
}
]
},
/* 详情页 */
{
"root": "pages/posts",
"pages": [
{
"path": "index",
"style": {
"navigationBarTitleText": "详情页",
"app-plus": {
"titleNView": {
"type": "float",
"backgroundColor": "",
"blurEffect": "light"
}
},
"h5": {
"titleNView": {
"backgroundColor": "#f7f7f7"
}
}
},
"keepAlive": true
}
]
},
/* 搜索产品 */
{
"root": "pages/product-search",
"pages": [
{
"path": "product-search",
"style": {
"navigationBarTitleText": "搜索产品",
"app-plus": {
"titleNView": {
"type": "float",
"backgroundColor": "",
"blurEffect": "light"
}
},
"h5": {
"titleNView": {
"backgroundColor": "#f7f7f7"
}
}
},
"keepAlive": true
}
]
},
/* 产品分类 */
{
"root": "pages/product-categories",
"pages": [
{
"path": "product-categories",
"style": {
"navigationBarTitleText": "产品分类",
"app-plus": {
"titleNView": {
"type": "float",
"backgroundColor": "",
"blurEffect": "light"
}
},
"h5": {
"titleNView": {
"backgroundColor": "#f7f7f7"
}
}
},
"keepAlive": true
}
]
},
/* 筛选产品 */
{
"root": "pages/product-filter",
"pages": [
{
"path": "product-filter",
"style": {
"navigationBarTitleText": "筛选",
"app-plus": {
"titleNView": {
"type": "float",
"backgroundColor": "",
"blurEffect": "light"
}
},
"h5": {
"titleNView": {
"backgroundColor": "#f7f7f7"
}
}
},
"keepAlive": true
}
]
},
/* 购物车页面 */
{
"root": "pages/shopping-cart",
"pages": [
{
"path": "shopping-cart",
"style": {
"navigationBarTitleText": "购物车",
"app-plus": {
"titleNView": {
"type": "float",
"backgroundColor": "",
"blurEffect": "light"
}
},
"h5": {
"titleNView": {
"backgroundColor": "#f7f7f7"
}
}
}
}
]
},
/* 支付页面 */
{
"root": "pages/payment",
"pages": [
{
"path": "payment",
"style": {
"navigationBarTitleText": "支付",
"app-plus": {
"titleNView": {
"type": "float",
"backgroundColor": "",
"blurEffect": "light"
}
},
"h5": {
"titleNView": {
"backgroundColor": "#f7f7f7"
}
}
},
"keepAlive": true
}
]
},
/* 我的积分 */
{
"root": "pages/point",
"pages": [
{
"path": "point",
"style": {
"navigationBarTitleText": "我的积分",
"app-plus": {
"titleNView": {
"type": "float",
"backgroundColor": "",
"blurEffect": "light"
}
},
"h5": {
"titleNView": {
"backgroundColor": "#f7f7f7"
}
}
},
"keepAlive": true
}
]
},
/* 修改密码 */
{
"root": "pages/setpwd",
"pages": [
{
"path": "setpwd",
"style": {
"navigationBarTitleText": "修改密码",
"titleAlign": "center",
"app-plus": {
"titleNView": {
"type": "float",
"backgroundColor": "",
"blurEffect": "light"
}
},
"h5": {
"titleNView": {
"backgroundColor": "#f7f7f7"
}
}
},
"keepAlive": true
},
{
"path": "forgetpwd",
"style": {
"navigationBarTitleText": "忘记密码",
"titleAlign": "center",
"app-plus": {
"titleNView": {
"type": "float",
"backgroundColor": "",
"blurEffect": "light"
}
},
"h5": {
"titleNView": {
"backgroundColor": "#f7f7f7"
}
}
},
"keepAlive": true
}
]
},
/* 注册 */
{
"root": "pages/register",
"pages": [
{
"path": "register",
"style": {
"navigationBarTitleText": "用户注册",
"titleAlign": "center",
"app-plus": {
"titleNView": {
"type": "float",
"backgroundColor": "",
"blurEffect": "light"
}
},
"h5": {
"titleNView": {
"backgroundColor": "#f7f7f7"
}
}
},
"keepAlive": true
},
{
"path": "serviceagreement",
"style": {
"navigationBarTitleText": "服务协议",
"app-plus": {
"titleNView": {
"type": "float",
"backgroundColor": "",
"blurEffect": "light"
}
},
"h5": {
"titleNView": {
"backgroundColor": "#f7f7f7"
}
}
}
},
{
"path": "disclaimers",
"style": {
"navigationBarTitleText": "免责申明总则",
"app-plus": {
"titleNView": {
"type": "float",
"backgroundColor": "",
"blurEffect": "light"
}
},
"h5": {
"titleNView": {
"backgroundColor": "#f7f7f7"
}
}
}
}
]
},
/* 动态获取页面 */
{
"root": "pages/preview",
"pages": [
{
"path": "preview",
"style": {
// #ifdef MP-WEIXIN || MP-ALIPAY || H5
"navigationStyle": "custom",
// #endif
// #ifdef MP-TOUTIAO
"navigationBarTitleText": "",
// #endif
"titleAlign": "center",
"mp-alipay": {
"transparentTitle": "always", // 头部透明
"titlePenetrate": "YES", // 导航栏点击穿透
"allowsBounceVertical": "No"
},
"app-plus": {
"titleNView": {
"type": "float",
"backgroundColor": "",
"blurEffect": "light"
}
},
"h5": {
"titleNView": {
"backgroundColor": "#f7f7f7"
}
}
},
"keepAlive": true
}
]
}
],
/* 分包预载配置 */
"preloadRule": {
},
/*按需引入*/
"easycom": {
"autoscan": true,
"custom": {
"^uni-(.*)": "@/uni_modules/uni-$1/components/uni-$1/uni-$1.vue"
}
},
/* 全局页面样式 */
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#F7F7F7", //导航条颜色
"backgroundColor": "#F7F7F7", //页面颜色
"backgroundColorTop": "#F7F7F7", //顶部窗口的背景色
"backgroundColorBottom": "#F7F7F7", //底部窗口的背景色
"app-plus": {
"scrollIndicator": "none",
"animationDuration": 200
}
},
/* 底部菜单 */
"tabBar": {
"color": "#666666", //菜单上的文字默认颜色
"selectedColor": "#3095fb", //菜单上的文字选中时的颜色
"borderStyle": "white", //菜单上边框的颜色,仅支持 black/white
// #ifdef MP
"backgroundColor": "#ffffff",
// #endif
// #ifndef MP
"blurEffect": "extralight",
"fontSize": "11px",
// #endif
// #ifdef APP-PLUS
"spacing": "5px",
// #endif
"list": [
{
"pagePath": "pages/index", //页面路径,必须在 pages 中先定义
"iconPath": "static/images/tabbar/index.png", //建议尺寸为 81px * 81px
"selectedIconPath": "static/images/tabbar/indexHL.png", //建议尺寸为 81px * 81px
"text": "首页" //菜单上按钮文字,在 5+APP 和 H5 平台为非必填。例如中间可放一个没有文字的+号图标
},
{
"pagePath": "pages/profile/profile",
"iconPath": "static/images/tabbar/user.png",
"selectedIconPath": "static/images/tabbar/userHL.png",
"text": "个人中心"
}
]
}
}