Micro letter against the war of global configuration applet

Procedure global small micro-channel configuration -1

Configuration applet into global configuration, page layout and configuration sitemap

Global Configuration

app.json file to the root directory of the small micro-channel applet for global configuration. Contents of the file into a JSON object with the following attributes:

Attributes Types of Mandatory description Minimum version
pages string[] Yes Page path list
window Object no Global default window performance
tabs Object no The bottom tabbar of performance
networkTimeout Object no Network timeout
debug boolean no Debug mode is turned off by default
functional pages boolean no Whether to enable plug-page feature, disabled by default 2.1.0
subpackages Object[] no Sub-structure configuration 1.7.3
workers string no Worker Code is placed in the directory 1.9.90
requiredBackgroundModes string[] no You need the ability to use the background, such as "music"
plugins Object no To use plug-ins 1.9.6
preloadRule Object no Subcontracting pre-download rules 2.3.0
resizable boolean no iPad applet supports screen rotation, off by default 2.3.0
navigateToMiniProgramAppIdList string[] no Jump need a list of applets, see wx.navigateToMiniProgram 2.4.0
usingComponents Object no Global custom component configuration Developer Tools 1.02.1810190
permission Object no Small program interface permission settings 7.0.0 Client WeChat
sitemap location string Yes Sitemap.json specified location
style string no After the upgrade weui specify style 2.8.0
useExtendedLib Object no Specified extensions need to reference 2.2.1
entranceDeclare Object no With micro-channel message opened applet WeChat client 7.0.9

1.1 pages

Use the specified program which ⼩ ⻚ caging, each entry corresponds ⼀ ⼀ ⻚ screen for a path (including the file name) channel
information. File names do not have to write the file suffix, the framework will automatically look for the position of .json, .js, .wxml,
.wxss four files into ⾏ handle
Configuring pages
the number of ⻚ ⾯, there should be a number of options here
the array of items on behalf of the first frame initial ⻚ ⾯ ⼩ program (therefore especially ⻚). ⼩ program to add / reduce ⻚ ⾯, are subject
to an array of pages into ⾏ modified.

1.2 window

Use to set ⼩ program status bar, navigation bar, title, window-connector background as it appears.

Attributes Types of Defaults description Minimum version
navigationBarBackgroundColor HexColor #000000 Navigation bar background color, such as #000000
navigationBarTextStyle string white Navigation Bar title color, only supports black/white
navigationBarTitleText string Navigation bar title text
navigationStyle string default Navigation bar style, only supports the following values:
defaultdefault style
customcustom navigation bar, leaving only the upper right corner of capsules button. See note 2.
6.6.0 Client WeChat
backgroundColor HexColor #ffffff Background color of the window
backgroundTextStyle string dark Loading the pull-down style, only supports dark/light
backgroundColorTop string #ffffff The background color of the top of the window, only iOS support WeChat client 6.5.16
backgroundColorBottom string #ffffff The background color of the bottom of the window, only iOS support WeChat client 6.5.16
enablePullDownRefresh boolean false Whether to open the global pull-down refresh.
See Page.onPullDownRefresh
onReachBottomDistance number 50 Distance from the bottom of the page, the unit is bottoming px pull the trigger on the event page.
See Page.onReachBottom
pageOrientation string portrait Set screen rotation support auto/ portrait/ landscape
See the display area in response to changes in
2.4.0 (auto) / 2.5.0 (landscape)

1.3 tabs

If the program is a ⼀ ⼩ multi tab to apply it (the client window-connector has a tab at the top or the bottom bar can be switched ⻚
⾯), can be configured to exhibit items specified by the tabBar bar tab, and the tab when the corresponding switch displayed ⻚
⾯.

Attributes Types of Mandatory Defaults description Minimum version
color HexColor Yes The default color for text on the tab, only supports hexadecimal color
selectedColor HexColor Yes When the color of the selected text on the tab, only supports hexadecimal color
backgroundColor HexColor Yes tab background color, only supports hexadecimal color
borderStyle string no black color of the border on the tabbar, only supports black/white
list Array Yes tab lists, detailed listproperties described, at least two, up to five tab
position string no bottom tabBar position, the only support bottom/top
custom boolean no false Custom tabBar, see details 2.5.0
Wherein receiving ⼀ list array, can be configured with a minimum of 2 and a maximum of five tab. tab array sorting order, each item is ⼀ object, attribute values ​​as follows:
Attributes Types of Mandatory Explanation
pagePath string Yes 页面路径,必须在 pages 中先定义
text string tab 上按钮文字
iconPath string 图片路径,icon 大小限制为 40kb,建议尺寸为 81px * 81px,不支持网络图片。
positiontop 时,不显示 icon。
selectedIconPath string 选中时的图片路径,icon 大小限制为 40kb,建议尺寸为 81px * 81px,不支持网络图片。
positiontop 时,不显示 icon。

1.4 networkTimeout

各类⽹络请求的超时时间,单位均为毫秒。

属性 类型 必填 默认值 说明
request number 60000 wx.request 的超时时间,单位:毫秒。
connectSocket number 60000 wx.connectSocket 的超时时间,单位:毫秒。
uploadFile number 60000 wx.uploadFile 的超时时间,单位:毫秒。
downloadFile number 60000 wx.downloadFile 的超时时间,单位:毫秒。

1.5 debug

可以在开发者⼯具中开启 debug 模式,在开发者⼯具的控制台⾯板,调试信息以
info 的形式给出,其信息有 Page 的注册,⻚⾯路由,数据更新,事件触发等。可
以帮助开发者快速定位⼀些常⻅的问题

1.6 functionalPages

插件所有者⼩程序需要设置这⼀项来启⽤插件功能⻚

1.7 permission

⼩程序接⼝权限相关设置。字段类型为 Object,结构为:

属性 类型 必填 默认值 描述
scope.userLocation PermissionObject 位置相关权限声明
PermissionObject structure
Attributes Types of Mandatory Defaults Explanation
desc string Yes Show getting permission to use a small program interface description. A maximum of 30 characters

Because of the outbreak, whether it is work or study have been severely affected. During the epidemic, can not relax at home, this little micro-channel global configuration program, we hope to help everyone

Published an original article · won praise 0 · Views 7

Guess you like

Origin blog.csdn.net/z_ioxxxx/article/details/104463248