微信小程序,配置tabBar

{
	"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;
	}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值