第一步 項目配置 一、編寫app.json 對整個項目的公共配置 1、pages:配置頁面路徑(必須),列出所有的頁面的路徑,所有存在的頁面都需要在此寫出,否則在頁面跳轉的時候會報出找不到頁面的錯誤2、window:窗口配置 ...
2016-12-28 更新到v2.0
2016-11-20
2016-11-21
2016-11-22
2016-11-25
2016-12-03
2016-12-04
2016-12-06
2016-12-14
2016-12-24
github地址:https://github.com/yesifeng/wechat-weapp-movie
提示:v2.0代碼會跟文檔有一些出入,但大部分都是相同的
對整個項目的公共配置
1、pages:配置頁面路徑(必須),列出所有的頁面的路徑,所有存在的頁面都需要在此寫出,否則在頁面跳轉的時候會報出找不到頁面的錯誤
2、window:窗口配置,配置導航及窗口的背景色和文字顏色,還有導航文字和是否允許窗口進行下拉刷新
3、tabBar:tab欄配置,配置tab欄背景色及出現位置,上邊框的顏色(目前只支持黑或白),文字顏色及文字選中顏色,最核心的配置是list即tab欄的列表,官方規定最少2個,最多5個,每個列表項目可配置頁面路徑、文字、圖標及選中時圖標的地址
4、network:網絡配置,配置網絡請求、上傳下載文件、socket連接的超時時間
5、debug:調試模式,建議開發時開啟(true),可以看到頁面注冊、頁面跳轉及數據初始化的信息,另外報錯的錯誤信息也會比較詳細
{
"pages": [
"pages/popular/popular",
"pages/coming/coming",
"pages/top/top",
"pages/search/search",
"pages/filmDetail/filmDetail",
"pages/personDetail/personDetail",
"pages/searchResult/searchResult"
],
"window": {
"navigationBarBackgroundColor": "#47a86c",
"navigationBarTextStyle": "white",
"navigationBarTitleText": "電影推薦",
"backgroundColor": "#fff",
"backgroundTextStyle": "dark"
},
"tabBar": {
"color": "#686868",
"selectedColor": "#47a86c",
"backgroundColor": "#ffffff",
"borderStyle": "white",
"list": [{
"pagePath": "pages/popular/popular",
"iconPath": "dist/images/popular_icon.png",
"selectedIconPath": "dist/images/popular_active_icon.png",
"text": "熱映"
}, {
"pagePath": "pages/coming/coming",
"iconPath": "dist/images/coming_icon.png",
"selectedIconPath": "dist/images/coming_active_icon.png",
"text": "待映"
},{
"pagePath": "pages/search/search",
"iconPath": "dist/images/search_icon.png",
"selectedIconPath": "dist/images/search_active_icon.png",
"text": "搜索"
},
{
"pagePath": "pages/top/top",
"iconPath": "dist/images/top_icon.png",
"selectedIconPath": "dist/images/top_active_icon.png",
"text": "口碑"
}]
},
"networkTimeout": {
"request": 10000,