callAppBox.vue 1.41 KB
<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") {
					this.callApps.funcs.callApp.schemeLayer(this.callApps.funcs.callAppParams, this.callApps.funcs.callAppCallback);
                    //因小米浏览器未安装APP时点击打开无反应;故判断在小米浏览器打开跳转下载APP页面
//                    var u = navigator.userAgent, app = navigator.appVersion;
//                    if (u.indexOf('XiaoMi') > -1) {
//                        setTimeout(function () {
//                            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>