当前位置:网站首页>h5 调起小程序
h5 调起小程序
2022-07-15 09:29:00 【推开世界的门】
环境判断,看是不是h5
/** * 环境判断 */
const uaJudge = () => {
let ua = navigator.userAgent.toLowerCase();
if(ua.match(/MicroMessenger/i)=="micromessenger") {
//ios的ua中无miniProgram,但都有MicroMessenger(表示是微信浏览器)
wx.miniProgram.getEnv((res)=>{
if (res.miniprogram) {
console.log("在小程序里");
} else {
console.log("不在小程序里");
showWxApp()
}
})
}else{
console.log('不在微信里');
showWxApp()
}
}
做跳转的话,直接
const showWxApp = () => {
window.location.href = wx_jump_url.value
}
边栏推荐
- The most powerful cluster monitoring system, it always ranks first!
- Analysis of eip-2535 diamond agreement from the Saudi NFT event
- 07 BTC mining development related history
- 【数学建模暑期培训】Matlab之求代数方程的符号解和数值解
- Today, I went to oppo for an interview and got numb...
- 疑似被Apple招安,PlayCover作者删库跑路
- 微信小程序之网易云音乐的实现-云音乐
- 【数学建模暑期培训】Matlab的数据处理
- Unity judges whether the object is in front of the camera and the UI follows the 3D object
- pytest+request+allure+excel接口自动化搭建 从0到1【二 读取Excel Case信息】
猜你喜欢
![[Huawei online battle] download and run Huawei's official unity example code, prompting authentication failure and returning error code 100114](/img/32/7d796399ac996fd7da5609f0252dfb.png)
[Huawei online battle] download and run Huawei's official unity example code, prompting authentication failure and returning error code 100114

【C语言入门】----指针(初阶)

几行汇编几行C实现一个最简单的内核

dlvm-netcore 開源框架

pytest+request+allure+excel接口自动化搭建 从0到1【二 读取Excel Case信息】

Locust Performance Test 1 (Understanding)

从0开始的 TypeScriptの十四:内置工具类型

内核的结构和设计
![Pytest+request+allure+excel interface automatic construction from 0 to 1 [Second, read excel case information]](/img/a9/7d536bf9073266d2f902d36deeaac1.png)
Pytest+request+allure+excel interface automatic construction from 0 to 1 [Second, read excel case information]

For 10 consecutive years, the "most commonly used" programming language for programmers ranked first is....
随机推荐
手把手教你用代码实现SSO单点登录
15.1.2 MySQL - MySQL time and timestamp conversion function, UNIX_ timestamp、from_ unixtime
Go language pointer
系统解决方案
Data Lake (XVII): Flink and iceberg integrate datastream API operations
Gao Fushui in unit testing, pytest framework (II) pre post method and fixture mechanism
Unity judges whether the object is in front of the camera and the UI follows the 3D object
数据湖(十七):Flink与Iceberg整合DataStream API操作
Enterprise naming conventions
The most powerful cluster monitoring system, it always ranks first!
什么是Sectigo?
拼多多关键词搜索接口,商品分类ID搜索商品列表接口,关键词搜索商品销量接口,拼多多销量API接口
Basic use and tutorial of Charles
京东店铺的所有商品API接口(item_search_shop-获得店铺的所有商品API接口),整店商品API接口
Stuck or deadlock events in the use of MySQL Library
使用 docker 搭建 grafana+prometheus 监控数据库资源(贰)
Oracle P8架构师离职,怒喷MySQL是“糟糕的数据库”……
OSPF experiment in mGRE environment
Smart breeding scheme based on Lora gateway
区别go array,slice,map