{
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "香喷喷"
}
},
{
"path": "pages/like/like",
"style": {
"navigationBarTitleText": "香喷喷"
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "11",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
},
"tabBar": {
"color": "#666666",
"selectedColor": "#ff4a4a",
"borderStyle": "white",
"backgroundColor": "#ffffff",
"list": [{
"pagePath": "pages/index/index",
"text": "首页",
"iconPath": "./static/footer1.png",
"selectedIconPath": "./static/footer1-sel.png"
},{
"pagePath": "pages/like/like",
"text": "粉丝",
"iconPath": "./static/footer2.png",
"selectedIconPath": "./static/footer2-sel.png"
}]
}
======================================
"tabBar": {
"color": "#7A7E83", //默认文字颜色
"selectedColor": "#3cc51f", //选择后的文字颜色
"borderStyle": "black", //边框颜色
"backgroundColor": "#ffffff", //导航背景颜色
"list": [{
"pagePath": "pages/index/index", //要跳转的路径
"iconPath": "./static/footer1.png", //默认图标
"selectedIconPath": "./static/footer1-sel.png", //激活图标样式
"text": "首页" //要显示的文字
},
========================================================
"pages": [
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "我的" //设置title的名字,有点鸡肋
}
}
]
}
=================获取code 进行用户信息获取存入本地======================
wx.login({
success: function (res) {
uni.setStorageSync('wxcode', res.code); //存入本地
uni.request({
url: wxurl+'/login/getOpenid', //仅为示例,并非真实接口地址。
data: {
code:res.code //利用code发送请求获取微信用户信息
},
method:"POST",
header: {
'custom-header': 'hello' //自定义请求头信息
},
success: (res) => {
console.log(res);
}
});
}
})
==================页面跳转 然后在登录页面判断本地是否存在code 如果存在就直接到主页
uni.switchTab({
url: '/pages/index/index'
});
在跳转页判断本地有没有code
=========横向拉滚动==================
<scroll-view class="box" scroll-x="true">
<view class="box-item">
//这里写内容
</view>
</scroll-view>
.box {
width: 100vw;
height: 400rpx;
white-space: nowrap;
box-sizing: border-box
}
.box-item {
width: 45%;
margin: 20px 18px 0;
box-sizing: border-box;
display: inline-block;
}
微信小程序,配置tabBar
最新推荐文章于 2024-06-01 22:32:51 发布