uniapp扫码多端方案,唤醒方案

297 阅读1分钟

扫一扫:h5方案插件链接+uni.scanCode(OBJECT)组合使用

唤起app:

//     #ifdef APP-PLUS
	showClose: true
	// 调用第三方程序
	if (plus.os.name == "Android") {
		plus.runtime.launchApplication({
			pname: "com.tencent.mm",
			extra: {
				url: "http://www.html5plus.org"
			}
		}, function(e) {
				alert("Open system default browser failed: " + e.message);
					});
		} else if (plus.os.name == "iOS") {
			plus.runtime.launchApplication({
				action: "http://www.html5plus.org"
			}, function(e) {
				alert("Open system default browser failed: " + e.message);
					});
		}
	// #endif
        
       // #ifdef H5
	showClose: true
	window.location.href = "weixin://" //唤起APP

	// #endif