callAppBox_old.vue
1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<template>
<div class="call-app-box" v-if="callApps">
<div class="box">
<div class="logo-box">
<img src="static/img/call_app_logo.png" class="img" />
</div>
<div class="buttons-box">
<div class="btn btn-default" @click="callApp">打开APP</div>
</div>
</div>
</div>
</template>
<script>
export default {
data: function () {
return {
}
},
props: ["callApps"],
methods: {
/**
* H5唤起App按钮事件
*/
callApp() {
if (typeof this.callApps.funcs === "object" && typeof this.callApps.funcs.callApp === "object" && typeof this.callApps.funcs.callApp.schemeLayer === "function") {
// 上下文
let context = this;
// 跳转连接
let jumpUrl = (this.mode == "prod" ? "https://managemall.cnlive.com/html/leaflet/appDownload.html" : "https://wjjshop.cnlive.com/html/leaflet/appDownloadTest.html");
// 系统判断
if (this.isiPhone.value) {
// OpenInstall唤起
// window.location.href = jumpUrl;
// 唤起App
this.callApps.funcs.callApp.schemeLayer(this.callApps.funcs.callAppParams, this.callApps.funcs.callAppCallback);
} else if (this.isAndroid.value) {
// 唤起App
this.callApps.funcs.callApp.schemeLayer(this.callApps.funcs.callAppParams, this.callApps.funcs.callAppCallback);
window.setTimeout(function() {
// 小米浏览器内,请求PHP页面下载
if (context.isXiaoMi.value) {
window.open("http://wjjh5.cnlive.com/apkdownload.php");
}
}, 2000);
}
}
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style rel="stylesheet/less" lang="less">
@import './callAppBox';
</style>