Commit fdccfc6f84dfc38cae46d00735a2f966b63297ef
1 parent
50d68f04
线下赛事跳转传uid和活动id
Showing
1 changed file
with
64 additions
and
66 deletions
src/pages/index/index.vue
| 1 | 1 | <template> |
| 2 | - <div> | |
| 3 | - <!-- H5唤起App组件 --> | |
| 4 | - <call-app-box v-if="!isCNLive.value" | |
| 5 | - :callApps="$parent.callApps"> | |
| 6 | - </call-app-box> | |
| 7 | - <div class="box"> | |
| 8 | - <div class="btn_box"> | |
| 9 | - <div @click="link(1)" class="btn"> | |
| 2 | + <div> | |
| 3 | + <!-- H5唤起App组件 --> | |
| 4 | + <call-app-box v-if="!isCNLive.value" :callApps="$parent.callApps"> | |
| 5 | + </call-app-box> | |
| 6 | + <div class="box"> | |
| 7 | + <div class="btn_box"> | |
| 8 | + <div @click="link(1)" class="btn"></div> | |
| 9 | + <div @click="link(2)" class="btn"></div> | |
| 10 | + <!--<div class="text">--> | |
| 10 | 11 | |
| 11 | - </div> | |
| 12 | - <div @click="link(2)" class="btn"> | |
| 13 | - | |
| 14 | - </div> | |
| 15 | - <!--<div class="text">--> | |
| 16 | - | |
| 17 | - <!--</div>--> | |
| 18 | - </div> | |
| 19 | - <div class="bottom_box"> | |
| 20 | - <div class="bottom_backg"> | |
| 21 | - | |
| 22 | - </div> | |
| 23 | - </div> | |
| 24 | - | |
| 25 | - </div> | |
| 26 | - </div> | |
| 12 | + <!--</div>--> | |
| 13 | + </div> | |
| 14 | + <div class="bottom_box"><div class="bottom_backg"></div></div> | |
| 15 | + </div> | |
| 16 | + </div> | |
| 27 | 17 | </template> |
| 28 | 18 | |
| 29 | 19 | <script> |
| 30 | - import callAppBox from "@/components/callAppBox/callAppBox"; | |
| 31 | - export default { | |
| 32 | - name: 'index', | |
| 33 | - data () { | |
| 34 | - return { | |
| 35 | - | |
| 36 | - } | |
| 20 | +import callAppBox from "@/components/callAppBox/callAppBox"; | |
| 21 | +export default { | |
| 22 | + name: "index", | |
| 23 | + data() { | |
| 24 | + return {}; | |
| 25 | + }, | |
| 26 | + components: { | |
| 27 | + callAppBox | |
| 37 | 28 | }, |
| 38 | - components: { | |
| 39 | - callAppBox | |
| 40 | - }, | |
| 41 | - created(){ | |
| 42 | - document.title = "大众体育" | |
| 29 | + created() { | |
| 30 | + document.title = "大众体育"; | |
| 31 | + }, | |
| 32 | + mounted() { | |
| 33 | + // 获取并设置分享参数 | |
| 34 | + this.$parent.getShareData({ | |
| 35 | + type: 23, | |
| 36 | + id: this.$route.query.appid || 1, | |
| 37 | + url: "" | |
| 38 | + }); | |
| 43 | 39 | }, |
| 44 | - mounted(){ | |
| 45 | - // 获取并设置分享参数 | |
| 46 | - this.$parent.getShareData({ | |
| 47 | - type: 23, | |
| 48 | - id: this.$route.query.appid || 1, | |
| 49 | - url: "" | |
| 50 | - }); | |
| 51 | - }, | |
| 52 | 40 | methods: { |
| 53 | - link(index){ | |
| 41 | + link(index) { | |
| 54 | 42 | // 区分app内点击还是app外点击 |
| 55 | - if(!this.isCNLive.value){ | |
| 43 | + if (!this.isCNLive.value) { | |
| 56 | 44 | // 提示app内打开 |
| 57 | - this.$parent.callApp() | |
| 58 | - }else { | |
| 45 | + this.$parent.callApp(); | |
| 46 | + } else { | |
| 59 | 47 | var items; |
| 60 | - if(index==1){ | |
| 61 | - items={ | |
| 62 | - "title": "线上赛事", | |
| 63 | - "type": "29", | |
| 64 | - "shop_type": "", | |
| 65 | - "to": "0" | |
| 66 | - } | |
| 67 | - }else if(index==2){ | |
| 68 | - items={ | |
| 69 | - "title": "线下赛事", | |
| 70 | - "type": "30", | |
| 71 | - "shop_type": "{\"id\":\"3\",\"title\":\"\\u7ebf\\u4e0b\\u8d5b\\u4e8b\"}", | |
| 72 | - "to": this.getParams(this.mode).shop.apiAddress + "/html/sports-china/1/#/", | |
| 73 | - } | |
| 48 | + if (index == 1) { | |
| 49 | + items = { | |
| 50 | + title: "线上赛事", | |
| 51 | + type: "29", | |
| 52 | + shop_type: "", | |
| 53 | + to: "0" | |
| 54 | + }; | |
| 55 | + } else if (index == 2) { | |
| 56 | + items = { | |
| 57 | + title: "线下赛事", | |
| 58 | + type: "30", | |
| 59 | + shop_type: | |
| 60 | + '{"id":"3","title":"\\u7ebf\\u4e0b\\u8d5b\\u4e8b"}', | |
| 61 | + to: | |
| 62 | + this.getParams(this.mode).shop.apiAddress + | |
| 63 | + "/html/sports-china/1/#/" + | |
| 64 | + (this.$route.query.uid | |
| 65 | + ? "&uid=" + this.$route.query.uid | |
| 66 | + : "") + | |
| 67 | + "&activityId=" + | |
| 68 | + this.mode == | |
| 69 | + "prod" | |
| 70 | + ? 92 | |
| 71 | + : 77 | |
| 72 | + }; | |
| 74 | 73 | } |
| 75 | - this.$parent.gotoDetail(items) | |
| 74 | + this.$parent.gotoDetail(items); | |
| 76 | 75 | } |
| 77 | - | |
| 78 | 76 | } |
| 79 | 77 | } |
| 80 | - } | |
| 78 | +}; | |
| 81 | 79 | </script> |
| 82 | 80 | |
| 83 | 81 | <!-- Add "scoped" attribute to limit CSS to this component only --> |
| 84 | 82 | <style rel="stylesheet/less" lang="less" scoped> |
| 85 | - @import "./index"; | |
| 83 | +@import "./index"; | |
| 86 | 84 | </style> | ... | ... |