3

盘点:微信小程序跳转H5操作教程

 2 years ago
source link: https://www.laiketui.com/96440.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

盘点:微信小程序跳转H5操作教程

小程序头条, 电商热点 2022年7月13日 18:17 19
盘点:微信小程序跳转H5操作教程

微信小程序能跳转到H5页面吗?当然可以,而且部署起来并不难,使用web-view组件就能做到。在小程序的实际业务开发中,总需要通过跳转到H5页面来满足更多业务场景。以下是微信小程序跳转H5操作教程。

微信小程序跳转H5操作教程

1、配置业务域名

首先登录小程序管理后台,要把跳转到H5网页的接口域名配置支持业务域名,否则是跳转失败的,同时,网页内iframe的域名也需要配置到域名白名单。

注意:这里需要配置HTTPS证书,因为web-view组件的src属性必须要配置https协议的链接才行。

2、部署

在小程序中创建一个文件,放置在域名根目录下,然后在web-view中的wxml中使用web-view标签,在web-view标签上设置的要跳转的H5页面地址即可。示范代码如下:

wxml1:

<view class=”tiaoH51″>

<navigator url=”pageH5″class=”papaa”>

点击跳转到H5页面

</navigator>

</view>

wxml2:

<view class=”container”>

<view class=”pageH5″>

<web-view src=”https://www.baidu.com/”></web-view>

</view>

</view>


<来客推(www.laiketui.com)是国内知名商城系统及商城网站建设提供商,为企业级商家提供零售商城、B2B2C多用户商城系统、社区团购、微信分销系统、小程序商城、商城系统等多端商城网站建设解决方案>

申明:本网站部分文章和图片来源网络编辑,如有侵权及时沟通删除,来客电商原创文章,转载请注明来源。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK