1.在 设置-->开发-->服务器域名 修改接口为白名单就可以请求数据
2.在小程序开发工具详情项目设置里,将下方的启用自定义处理命令勾选
小程序请求数据
//在js文件里写
wx.request({
url: '接口路径',
success: function (res) {
console.log(res.data)
}
})
路由跳转Tabbar
selectedColor:指替换的路径
iconPath:原本图标路径
"tabBar": {
"color": "#000000",
"borderStyle": "#000",
"selectedColor": "#9999FF",
"list": [
{
"pagePath":"pages/index/index",
"text": "首页",
"iconPath":"static/home.png",
"selectedIconPath": "static/home-1.png"
},
{
"pagePath":"pages/classify/classify",
"text": "分类",
"iconPath": "static/list.png",
"selectedIconPath": "static/list-1.png"
},
{
"pagePath": "pages/shopcar/shopcar",
"text": "购物车",
"iconPath": "static/shopCar.png",
"selectedIconPath":"static/shopCar-1.png"
},
{
"pagePath": "pages/people/people",
"text": "个人",
"iconPath": "static/user.png",
"selectedIconPath":"static/user-1.png"
}
]
}
网友评论