以VUE项目H5唤醒微信举例
步骤一、下载插件
npm install callapp-lib --save
npm install timers --save
步骤二、引入插件
import CallApp from "callapp-lib";
import { setTimeout } from 'timers';
步骤三、在methods 内定义点击事件
openWx () {
const options = {
scheme: { protocol: "weixin" },
intent: {
package: "com.tencent.mm",
scheme: "weixin"
},
//apple store
appstore: "https://itunes.apple.com/cn/app//id414478124?mt=8",
//应用宝
yinyongbao:"https://android.myapp.com/myapp/detail.htm?apkName=com.tencent.mm",
fallback: "https://a.app.qq.com/o/simple.jsp?pkgname=com.tencent.mm" //唤端失败后跳转的地址
};
const callLib = new CallApp(options);
callLib.open({});
}
网友评论