2***@qq.com
2***@qq.com
  • 发布:2021-11-24 17:30
  • 更新:2021-11-24 18:58
  • 阅读:1498

uniapp小程序跳转到用vue开发的h5页面,h5页面跳回到小程序如何实现?

分类:uni-app

请教官方和大家,请问如何实现用uniapp开发的小程序跳转到用vue开发的h5页面,再从这个h5页面跳回到小程序并传参?

2021-11-24 17:30 负责人:无 分享
已邀请:
小枫叶

小枫叶 - 外包接单加v:wlmk1234567 注明来意

你可以这样实现
先把h5的页面部署,然后得到一个访问地址
然后你把访问地址放到跳转前页面,
然后展示h5页面放一个webview来承接这个链接

jumpwebview(){  
                let url="http://www.baidu.com"  
                uni.navigateTo({  
                    url:"/pages/webview/webview?url="+url  
                })  
            }

承接页面

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

<script>  
    export default {  
        data() {  
            return {  
            content:""    
            }  
        },  
        onLoad(res) {  
            console.log(res.url)  
            this.content = res.url  
        },  
        methods: {  

        }  
    }  
</script>  

<style>  

</style>  
小枫叶

小枫叶 - 外包接单加v:wlmk1234567 注明来意

参考 https://uniapp.dcloud.io/component/web-view

  • 2***@qq.com (作者)

    谢谢解答,小程序跳转h5可以实现,主要是不知道怎么从vue的h5页面跳回到小程序中

    2021-11-25 10:25

  • 132liyh

    回复 2***@qq.com: 微信sdk

    2021-11-25 13:03

  • 132liyh

    https://developers.weixin.qq.com/miniprogram/dev/component/web-view.html

    2021-11-25 13:04

  • 小枫叶

    回复 2***@qq.com: uni,postmessage 给你的那个文档里面有相关的api,仔细查阅

    2021-11-25 14:35

该问题目前已经被锁定, 无法添加新回复