B/S系统H5怎么嵌入到APP

2025-10-29 08:53:10

1、首先做成HTML的内容,url格式如下:

<a href="[scheme]://[host]/[path]?[query]">点我</a>

1

说明: 

schema: 判断启动的App

host: 标记

path: 标记,可无

query: 传值的(key,value)键值对,可无

B/S系统H5怎么嵌入到APP

2、例如:<a href="myapp://jp.app/openwith?name=zhangsan&age=26">启动应用程序</a>  

B/S系统H5怎么嵌入到APP

3、本例中做如下超链接跳转:

<a href="finance://pay.com/mpos?orderId=1020160126"> Open APP </a>  

1

其中:

schema —- finance 对应Android中 android:schema

host ---  pay.com   对应android中 android:host

B/S系统H5怎么嵌入到APP

4、path ---  mpos   对应android中 android:pathPrefix

query --- orderId=1020160102  为Html链接和APP相互传递的数据,可以在Uri中通过getQueryParameter 方法获取

全部Html源码:

<!DOCTYPE html>  

<html>  

<head>  

<meta charset="UTF-8">  

<title>mpos</title>  

B/S系统H5怎么嵌入到APP

5、<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=0">  

<meta name="imagemode" content="force">  

<meta name="apple-mobile-web-app-capable" content="yes">  

<meta name="apple-mobile-web-app-status-bar-style" content="black">  

<meta name="format-detection" content="telephone=no">  

</head>  

<body>  

<h1>H5打开APP</h1>  

<a href="finance://pay.com/mpos?orderId=102016000"> Open APP </a>  

</body>  

</html>  

B/S系统H5怎么嵌入到APP

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢