(一) 开发工具
小程序开发工具下载地址:
https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html
(二) 构建项目
- 可以新建,也可以导入原有项目
- 需要去注册一个小程序以获得AppId, 当然也可以使用测试号
(三) 小程序配置
3.1 app.json全局配置
小程序根目录下的 app.json
文件用来对微信小程序进行全局配置
https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html
3.2 app.json 配置文件详解
{
// 页面路径
"pages": [
"pages/index/index",
"pages/cart/cart",
"pages/detail/detail",
"pages/my/my",
"pages/demo/demo"
],
// 导航栏配置
"window": {
// 导航栏颜色
"navigationBarBackgroundColor": "#f8f8f8",
// 导航栏文字
"navigationBarTitleText": "花间",
// 导航文字样式
"navigationBarTextStyle": "black",