假如我們新建頁面`pages/demo/demo`;
## 注冊頁面
在 `app.json` `pages`中增加`pages/demo/demo`
```
{
"pages": [
"pages/index/index",
"pages/my/my",
"pages/user/setEmail",
"pages/user/setMobile",
"pages/about/update",
"pages/demo/demo" /*這里是增加的 demo 頁面*/
],
"window": {
"backgroundTextStyle": "dark",
"navigationBarBackgroundColor": "white",
"navigationBarTitleText": "ThinkCMF",
"navigationBarTextStyle": "black"
},
"tabBar": {
"color": "#666666",
"selectedColor": "#333333",
"backgroundColor": "#ffffff",
"borderStyle": "#eeeeee",
"list": [
{
"text": "首頁",
"pagePath": "pages/index/index",
"iconPath": "images/icons/home.png",
"selectedIconPath": "images/icons/home_selected.png"
},
{
"text": "我的",
"pagePath": "pages/my/my",
"iconPath": "images/icons/my.png",
"selectedIconPath": "images/icons/my_selected.png"
}
]
},
"debug": true
}
```
## 創建頁面文件
在`pages`目錄下創建`demo/demo.js`文件
```
// 引入 api 類庫,可以頁面中直接使用
var api = require('../../utils/api.js');
// 獲取全局 app 變量
var app = getApp();
Page({
});
```
在`pages`目錄下創建`demo/demo.wxml`文件
```
<view>
hello demo!
</view>
```
## 在底部導航添加 demo 頁
在 app.json tabBar.list 里添加
```
{
"text": "Demo",
"pagePath": "pages/demo/demo",
"iconPath": "images/icons/home.png",
"selectedIconPath": "images/icons/home_selected.png"
},
```
添加以上代碼后:
```
{
"pages": [
"pages/index/index",
"pages/my/my",
"pages/user/setEmail",
"pages/user/setMobile",
"pages/about/update",
"pages/demo/demo"
],
"window": {
"backgroundTextStyle": "dark",
"navigationBarBackgroundColor": "white",
"navigationBarTitleText": "ThinkCMF",
"navigationBarTextStyle": "black"
},
"tabBar": {
"color": "#666666",
"selectedColor": "#333333",
"backgroundColor": "#ffffff",
"borderStyle": "#eeeeee",
"list": [
{
"text": "首頁",
"pagePath": "pages/index/index",
"iconPath": "images/icons/home.png",
"selectedIconPath": "images/icons/home_selected.png"
},
{
"text": "Demo",
"pagePath": "pages/demo/demo",
"iconPath": "images/icons/home.png",
"selectedIconPath": "images/icons/home_selected.png"
},
{
"text": "我的",
"pagePath": "pages/my/my",
"iconPath": "images/icons/my.png",
"selectedIconPath": "images/icons/my_selected.png"
}
]
},
"debug": true
}
```
## 界面演示

- 介紹
- 環境配置
- 規范
- 狀態碼說明
- 參數規范草案
- 版本號
- 控制器
- 資源控制器模板
- 成功返回
- 錯誤返回
- 路由
- 應用
- 基類控制器
- 應用開發流程
- API
- 用戶
- 發送郵箱或手機驗證碼
- 用戶注冊
- 用戶登錄
- 文件上傳
- 密碼修改
- 密碼重置
- 用戶退出
- 用戶手機號綁定
- 用戶郵箱綁定
- 用戶信息獲取
- 用戶信息修改
- 余額記錄(未發布)
- 積分記錄(未發布)
- 余額轉賬(未發布)
- 小程序
- 用戶登錄
- 評論
- 評論列表
- 我的評論列表
- 添加評論
- 刪除評論
- 門戶應用
- 文章
- 文章列表
- 文章列表
- 分類文章列表
- 推薦文章列表
- 會員文章列表
- 會員添加文章
- 會員編輯文章
- 會員刪除文章
- 獲取文章
- 我的文章列表
- 文章搜索
- 文章點贊
- 取消文章點贊
- 文章收藏
- 取消文章收藏
- 分類
- 分類列表
- 獲取分類
- 子分類列表
- 頁面
- 頁面列表
- 獲取頁面
- 標簽
- 熱門標簽列表
- 標簽文章列表
- 幻燈片獲取
- 收藏
- 我的收藏列表
- 添加收藏
- 取消收藏
- 判斷是否已收藏
- 后臺
- 管理員登錄
- 管理員退出
- 模板
- 擴展屬性
- 小程序開發
- 版本發布
- 小程序模板下載
- 演示代碼安裝
- 新建頁面
- API 請求
- 附錄
- 升級日志
- 升級指導