微信公众号返回到聊天窗口

微信公众号点击按钮关闭浏览器,返回到聊天窗口

dom

1
<button @click="weixinClosePage">返回</button>

js

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//关闭微信页面
weixinClosePage() {
if (typeof WeixinJSBridge == "undefined") {
if (document.addEventListener) {
document.addEventListener(
"WeixinJSBridgeReady",
this.weixin_ClosePage(),
false
);
} else if (document.attachEvent) {
document.attachEvent("WeixinJSBridgeReady", this.weixin_ClosePage());
document.attachEvent("onWeixinJSBridgeReady", this.weixin_ClosePage());
}
} else {
this.weixin_ClosePage();
}
},
weixin_ClosePage(){
WeixinJSBridge.call("closeWindow");
}
更新于

请我喝[茶]~( ̄▽ ̄)~*

Ming Liu 微信支付

微信支付

Ming Liu 支付宝

支付宝

Ming Liu 贝宝

贝宝