app.json
file, located in the root directory of the mini program, is used for the global configuration of the TMF mini program. It allows for the determination of page file paths, window performance, network timeout duration, and multi-tab functionality through various settings.app.json
file that includes a selection of commonly used configuration options:{"pages": ["pages/index/index", "pages/logs/index"],"window": {"navigationBarTitleText": "Demo"},"tabBar": {"list": [{"pagePath": "pages/index/index","text": "Homepage"},{"pagePath": "pages/logs/logs","text": "Log"}]},"networkTimeout": {"request": 10000,"downloadFile": 10000},"debug": true,"navigateToMiniProgramAppIdList": ["tmfq0nbl3hxxlv2w7u"],"groupIdList":["123456","34356576","457658769"]}
Attribute | Type | Required | Description |
pages | String Array | Yes | List of Page Paths |
window | Object | No | Global Default Window Performance |
tabBar | Object | No | Performance of the Bottom Tab Bar |
networkTimeout | Object | No | Network timeout period |
requiredBackgroundModes | String Array | No | Capabilities required for backend usage, such as Music Playback |
navigateToMiniProgramAppIdList | String Array | No | |
permission | Object | No | Settings Related to Mini Program Interface Permissions |
darkmode | Boolean | No | Judge whether the current mobile device is in night mode |
.json
, .js
, .wxml
, and .wxss
files for processing.├── app.js├── app.json├── app.wxss├── pages│ │── index│ │ ├── index.wxml│ │ ├── index.js│ │ ├── index.json│ │ └── index.wxss│ └── logs│ ├── logs.wxml│ └── logs.js└── utils
app.json
file:{"pages": ["pages/index/index", "pages/logs/logs"]}
Attribute | Type | Default value | Description |
navigationBarBackgroundColor | HexColor | #000000 | Navigation bar background color, such as #000000. |
navigationBarTextStyle | String | white | Navigation bar title color, only supporting black / white. |
navigationBarTitleText | String | - | Navigation bar's title text content |
navigationStyle | String | default | Navigation bar style, only supports the following values: default: default style; Custom: Customize the navigation bar, retaining only the capsule button in the upper right corner; hide: Custom navigation bar, which can support privacy navigation bar and capsule button. |
backgroundColor | HexColor | #ffffff | Window's background color |
backgroundTextStyle | String | dark | Dropdown loading style, only supporting dark / light. |
backgroundColorTop | String | #ffffff | Top window's background color, only supported on iOS. |
backgroundColorBottom | String | #ffffff | Bottom window's background color, only supported on iOS. |
enablePullDownRefresh | Boolean | false | |
customNavigateBack | Boolean | false | Do you need to intercept the default return of the page (click tabBar to return or slide sideways or back key to return) and use it in conjunction with Page.onCustomBack |
pageOrientation | String | portrait | Screen rotation settings, supporting auto / portrait / landscape. See Responding to Display Area Changes for details. |
navigationStyle
{"window": {"navigationBarBackgroundColor": "#ffffff","navigationBarTextStyle": "black","navigationBarTitleText": "TMF Interface Function Demonstration","backgroundColor": "#eeeeee","backgroundTextStyle": "light"}}
Attribute | Type | Required | Default value | Description |
color | HexColor | Yes | - | Default text color on the tab, only supporting hexadecimal colors. |
selectedColor | HexColor | Yes | - | The color of the text on the tab when selected, only supporting hexadecimal colors. |
backgroundColor | HexColor | Yes | - | Default background color on the tab, only supporting hexadecimal colors. |
borderStyle | String | No | black | The color of the border on the tab bar, only supporting black / white. |
list | Array | Yes | - | The list of tabs, with a minimum of 2 tabs and a maximum of 5 tabs. |
position | String | No | bottom | The position of the tabBar, only supporting bottom / top. |
custom | Boolean | No | false |
Attribute | Type | Required | Description |
pagePath | String | Yes | The page path, which must be defined in the pages beforehand. |
text | String | Yes | Text on the tab button |
iconPath | String | No | The image path, with an icon size limit of 40 kb, is recommended to be 81 px * 81 px, and does not support network images. |
selectedIconPath | String | No | The selected image path, with an icon size limit of 40 kb, is recommended to be 81 px * 81 px, and does not support network images. When the position is set to top, the icon is not displayed. |
Attribute | Type | Required | Default value | Description |
request | Number | No | 60000 | |
uploadFile | Number | No | 60000 |
audio
: Backend music playback.{"pages": ["pages/index/index"],"requiredBackgroundModes": ["audio"]}
Attribute | Type | Required | Default value | Description |
scope.userLocation | PermissionObject | No | - | Declaration of location-related permissions |
Attribute | Type | Required | Default value | Description |
desc | string | Yes | - | The Chinese usage description displayed when the mini program obtains permissions. Maximum of 80 characters |
desc-en | string | Yes | - | The English usage description displayed when the mini program obtains permissions. Maximum of 80 characters |
desc-adesc-ar | string | Yes | - | The Arabic usage description displayed when the mini program obtains permissions. Maximum of 80 characters |
{"pages": ["pages/index/index"],"permission": {"scope.userLocation": {"desc": "Your location information will be used for the display of the mini program's location interface effects,""desc-en": "where are you? do you know","desc-ar":"انا من السعودية"}}}
{"navigationBarBackgroundColor": "#ffffff","navigationBarTextStyle": "black","navigationBarTitleText": "TMF Interface Function Demonstration","backgroundColor": "#eeeeee","backgroundTextStyle": "light"}
Attribute | Type | Default value | Description |
navigationBarBackgroundColor | HexColor | #000000 | Navigation bar background color, such as #000000. |
navigationBarTextStyle | String | white | Navigation bar title color, only supporting black / white. |
navigationBarTitleText | String | - | Navigation bar's title text content |
navigationStyle | String | default | Navigation bar style, only supports the following values: default: default style; Custom: Customize the navigation bar, retaining only the capsule button in the upper right corner; hide: Custom navigation bar, which can support privacy navigation bar and capsule button. |
backgroundColor | HexColor | #ffffff | Window's background color |
backgroundTextStyle | String | dark | Dropdown loading style, only supporting dark / light. |
backgroundColorTop | String | #ffffff | Top window's background color, only supported on iOS. |
backgroundColorBottom | String | #ffffff | Bottom window's background color, only supported on iOS. |
enablePullDownRefresh | Boolean | false | Whether to globally enable pull-down refresh. See Page.onPullDownRefresh for details. |
pageOrientation | String | portrait | Screen rotation settings, supporting auto / portrait / landscape. See "Responding to Display Area Changes" for details. |
Was this page helpful?