uni-app

1 路由的跳转

  

uni.navigateTo({
		url:'/pages/home/search'
});
//非tabBar页面跳转

 

uni.switchTab({
	 url:"/pages/index/index"
})

//非tabBar跳转到tabBar页面

2 请求

uni.request({
				url: 'https://www.easy-mock.com/mock/5cb6c0b0af031b75d25dc1f5/element/historyComtent', //接口地址
				data: {
					type: 1,
					userId:2
				},
				header: {
					'custom-header': 'hello' //自定义请求头信息
				},
				success: (res) => {
					console.log(res.data);
				}
			});

  

 

 

猜你喜欢

转载自www.cnblogs.com/gfweb/p/10724373.html