uniapp内部点击跳转h5页面

在APP内新建一个空白页面用来展示,空白页面里面就一个标签<web-view>

<template>
    <view>
		<web-view :src="url"></web-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				url:''//指向网页跳转的连接
			}
		},
		onLoad(options) {
			var that=this
			that.url=options.url+'?username=*******&password=*******'//携带账号密码,自动登录
		},
		methods: {
			
		}
	}
</script>

APP内部的按钮或者文字,点击了就跳转到h5网页

点击函数:

tiaozhuan(){
	uni.navigateTo({
		url:'/pages/web/web?url=自己h5的地址'
	})
}

APP的权限配置,打开:

<uses-permission android:name="android.permission.INTERNET"/>

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
uni-app中,可以通过以下方法实现跳转页面并携带对象参数: 1. 在跳转前,将需要传递的对象参数转为JSON字符串,然后使用encodeURIComponent进行编码,并拼接在url后面。例如: ``` const url = '/pages/detail/detail'; // 要跳转页面路径 const obj = { id: 123, name: 'test' }; // 要传递的对象参数 const params = encodeURIComponent(JSON.stringify(obj)); // 将对象参数转为JSON字符串,并使用encodeURIComponent编码 uni.navigateTo({ url: `${url}?params=${params}` }); // 跳转页面并传递对象参数 ``` 2. 在跳转后的页面中,通过onLoad事件获取传递的对象参数,并使用decodeURIComponent解码,然后转为对象。例如: ``` // 在detail.vue页面中 <span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [【Web前端uni-app页面跳转uni.navigateTo传递对象参数](https://blog.csdn.net/Dawson_Ho/article/details/126239325)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* [uniapp怎么传跳转页面并传递对象参数](https://blog.csdn.net/weixin_60415789/article/details/130266300)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值