index.vue 2.5 KB
<template>
    <div>
        <!-- H5唤起App组件 -->
        <call-app-box v-if="!isCNLive.value" :callApps="$parent.callApps">
        </call-app-box>
        <div class="box">
            <div class="btn_box">
                <div @click="link(1)" class="btn"></div>
                <div @click="link(2)" class="btn"></div>
                <!--<div class="text">-->

                <!--</div>-->
            </div>
            <div class="bottom_box"><div class="bottom_backg"></div></div>
        </div>
    </div>
</template>

<script>
import callAppBox from "@/components/callAppBox/callAppBox";
export default {
    name: "index",
    data() {
        return {};
    },
    components: {
        callAppBox
    },
    created() {
        document.title = "大众体育";
    },
    mounted() {
        // 获取并设置分享参数
        this.$parent.getShareData({
            type: 23,
            id: this.$route.query.appid || 1,
            url: ""
        });
    },
    methods: {
        link(index) {
            // 区分app内点击还是app外点击
            if (!this.isCNLive.value) {
                // 提示app内打开
                this.$parent.callApp();
            } else {
                var items;
                if (index == 1) {
                    items = {
                        title: "线上赛事",
                        type: "29",
                        shop_type: "",
                        to: "0"
                    };
                } else if (index == 2) {
                    items = {
                        title: "线下赛事",
                        type: "30",
                        shop_type:
                            '{"id":"3","title":"\\u7ebf\\u4e0b\\u8d5b\\u4e8b"}',
                        to:
                            this.getParams(this.mode).shop.apiAddress +
                                "/html/sports-china/1/#/" +
                                (this.$route.query.uid
                                    ? "&uid=" + this.$route.query.uid
                                    : "") +
                                "&activityId=" +
                                this.mode ==
                            "prod"
                                ? 92
                                : 77
                    };
                }
                this.$parent.gotoDetail(items);
            }
        }
    }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style rel="stylesheet/less" lang="less" scoped>
@import "./index";
</style>