微信小程序

app.json

pages,window,tabBar,networkTimeout,debug

{

"pages": [

"pages/index/index",

"pages/logs/index"

],

"window": { "navigationBarTitleText": "Demo" },

"tabBar": {

"list": [

{ "pagePath": "pages/index/index", "text": "首页" },

{ "pagePath": "pages/logs/logs", "text": "日志" }

]

},

"networkTimeout": {

"request": 10000,

"downloadFile": 10000

},

"debug": true

}

pages 属性

{

"pages": [

"pages/index/index",

"pages/logs/index"

]

}

windows 属性

navigationBarBackground Color HexColor #000000 导航栏背景颜色,如"#000000"

navigationBarTextStyle String white 导航栏标题颜色,仅支持 black/white

navigationBarTitleText  String 导航栏标题文字内容

navigationStyle String default 导航栏样式,仅支持 default/custom。custom 模式可自定义导航栏,只保留右上角胶囊状的按钮微信版本 6.6.0

backgroundColor HexColor #ffffff  窗口的背景色

backgroundTextStyle String dark 下拉 loading 的样式,仅支持 dark/light

backgroundColorTop String #ffffff 顶部窗口的背景色,仅 iOS 支持微信版本 6.5.16

backgroundColorBottom String # ffffff底部窗口的背景色,仅 iOS 支持微信版本 6.5.16

enablePullDownRefresh Boolean false 是否开启下拉刷新

onReachBottomDistance Number 50 页面上拉触底事件触发时距页面底部距离,单位为px

tabBar

color HexColor 是tab 上的文字默认颜色

selectedColor HexColor是tab 上的文字选中时的颜色

backgroundColor HexColor是tab 的背景色

borderStyle String否blacktabbar上边框的颜色, 仅支持 black/white

list Array是tab 的列表,详见 list 属性说明,最少2个、最多5个 tab

position String否bottom可选值 bottom、top

  "tabBar": {

    "selectedColor": "#1296db",

    "list": [

    {

      "pagePath": "pages/index/index",

      "text": "首页",

      "iconPath": "images/ico-home.png",

      "selectedIconPath": "images/ico-home-d.png"

      },

    {

      "pagePath": "pages/setting/setting",

      "text": "设置",

      "iconPath": "images/ico-setting.png",

      "selectedIconPath": "images/ico-setting-d.png" 

    },

    {

      "pagePath": "pages/help/help",

      "text": "帮助",

      "iconPath": "images/ico-help.png",

      "selectedIconPath": "images/ico-help-d.png" 

  }

  ]

}

networkTimeout

request Number否wx.request的超时时间,单位毫秒,默认为:60000

connectSocket Number否wx.connectSocket的超时时间,单位毫秒,默认为:60000

uploadFile Number否wx.uploadFile的超时时间,单位毫秒,默认为:60000

downloadFile Number否wx.downloadFile的超时时间,单位毫秒,默认为:60000

debug

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

page.json

navigationBarBackgroundColor HexColor#000000导航栏背景颜色,如"#000000"

navigationBarTextStyle String white导航栏标题颜色,仅支持 black/white

navigationBarTitleText String 导航栏标题文字内容

backgroundColor HexColor #ffffff窗口的背景色

backgroundTextStyle String dark下拉 loading 的样式,仅支持 dark/light

enablePullDownRefresh Boolean false是否开启下拉刷新

disableScroll Boolean false设置为 true 则页面整体不能上下滚动;只在 page.json 中有效,无法在 app.json 中设置该项

onReachBottomDistance Number 50页面上拉触底事件触发时距页面底部距离,单位为px

{"navigationBarBackgroundColor":"#ffffff","navigationBarTextStyle":"black","navigationBarTitleText":"微信接口功能演示","backgroundColor":"#eeeeee","backgroundTextStyle":"light"}

你可能感兴趣的:(微信小程序)