| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468 |
- <template>
- <div :class="getBettingIsShow?'noscoll':''">
- <div class="lod">
- <Loading></Loading>
- </div>
- <div>
- <SportsHead></SportsHead>
- <div class="Serch">
- <div class="Soccer-game row center">
- <div class="Soccer-game-title row center" @click="isreturn()">
- <img class="returnimg" :src="searchreturn">
- {{name}}
- </div>
- </div>
- </div>
- <div class="gambling" v-show="this.list">
- <div class="leagueMatch">
- <yd-button size="large" @click.native="show = true"></yd-button>
- <div class="leagueName">
- <span>{{list.leagueName}}</span>
- </div>
- <div class="teamName">
- <span>{{list.home_team}}</span>
- <div class="vs">vs</div>
- <span>{{list.guest_team}}</span>
- </div>
- <div class="time">
- <span>{{list.match_ptime? list.match_ptime :list.match_time }}</span>
- </div>
- <div v-if="satatus" class="icon" :class="status == true ? 'rotate':'backRotate'">
- <i></i>
- </div>
- </div>
- <div class="box">
- <div id="NavSlide">
- <nav>
- <p v-for="(item,$index) in key" @click="toggleNav($index)" :key="$index">
- <span :class="{active:$index==active}">{{item}}</span>
- </p>
- </nav>
- </div>
- </div>
- <!-- 模态框 -->
- <yd-popup v-if="satatus" v-model="show" position="center" width="90%">
- <div class="modality">
- <div
- class="list"
- v-for="(item,index) in list.league"
- :key="index"
- @click="check(index,item.match_id)"
- >
- <span :class="list.match_id == item.match_id?'col':''">{{item.home_team}}</span>
- <span :class="list.match_id == item.match_id?'col':''">v</span>
- <span :class="list.match_id == item.match_id?'col':''">{{item.guest_team}}</span>
- </div>
- </div>
- </yd-popup>
- </div>
- <div v-show="isShow">
- <!--让球大小-->
- <div v-show="Single =='让球大小' || isAll ">
- <goal></goal>
- </div>
- <!--独赢-->
- <div v-show="Single =='独赢'|| isAll ">
- <OnlyWin></OnlyWin>
- </div>
- <!--最先/最后进球-->
- <div v-show="Single =='最先/最后进球' || isAll ">
- <StartEnd></StartEnd>
- </div>
- <!-- 总进球数 -->
- <div v-show="Single =='总进球数' || isAll ">
- <GoalSize></GoalSize>
- </div>
- <!-- 波胆 -->
- <div v-show="Single =='波胆' || isAll ">
- <WaveBladder></WaveBladder>
- </div>
- <!--入球数单双-->
- <div v-show="Single =='进球数单双' || isAll ">
- <GoalSingleAndDouble></GoalSingleAndDouble>
- </div>
- <!--半场/全场-->
- <div v-show="Single =='半场/全场'|| isAll ">
- <FullHalf></FullHalf>
- </div>
- <!-- 角球 -->
- <div v-show="Single =='角球' || isAll ">
- <Corner></Corner>
- </div>
- <!-- 球队进球大小 -->
- <div v-show="Single =='球队进球大小' || isAll ">
- <TeamGoalSize></TeamGoalSize>
- </div>
- </div>
- <div v-if="!isShow">
- <NotOpend :title="tipsTitle"></NotOpend>
- </div>
- <StLinkFooter></StLinkFooter>
- <BettingWindow v-if="isBettingWindow== '100'"/>
- </div>
- </div>
- </template>
- <script>
- import Goal from "@/components/StGoal";
- import NotOpend from "@/components/StNotOpend";
- import Loading from "@/components/StLoading";
- import WaveBladder from "@/components/StWaveBladder";
- import StLinkFooter from "@/components/StLinkFooter";
- import SportsHead from "@/components/StSportsHead";
- import OnlyWin from "@/components/StOnlyWin";
- import GoalSize from "@/components/StGoalSize";
- import StartEnd from "@/components/StStartEnd";
- import FullHalf from "@/components/StFullHalf";
- import TeamGoalSize from "@/components/StTeamGoalSize";
- import GoalSingleAndDouble from "@/components/StGoalSingleAndDouble";
- import Corner from "@/components/StCorner";
- import BettingWindow from "@/components/StBettingWindow";
- export default {
- data() {
- return {
- name:this.$route.query.name, // 球名
- searchreturn: require("@/assets/st-imges/returnbox.png"),
- gameCode: this.$route.query.gameCode, //别名
- match_id: "",
- list:'', //数据
- key: [], //存储key值进行判定
- isShow: "", //更具数据是否显示
- getBettingIsShow:false,// 判断投注框背景可否滚动
- status: false,
- tipsTitle: "暂无相关数据信息",
- active: 0,
- // 投注页是否打开
- isBettingWindow: '-1',
- // isIphone: false,//是否ios
- // isAndroid: false,//是否Android
- show: false, //是否显示模态框
- satatus: true,
- isAll: true,
- Single: "",
- timers : true,
- };
- },
- methods: {
- // 返回上一页
- isreturn() {
- history.go(-1);
- },
- getAjax: function(gameCode, match_id,oddsType) {
- this.$store.dispatch("GETSHOW", true);
- this.$http.get(this.$ports.gambling.matchOdds, {
- oddsType,
- game_code: gameCode,
- matchID: match_id
- }).then(res => {
- if (res.data.status == 1 && res.data.data) {
- this.key = [];
- if ( res.data.data.oddsData == [] ||res.data.data.oddsData.length == 0 ||res.data.data.oddsData == null) {
- this.$store.dispatch("GETSHOW", false);
- this.isShow = false;
- return false;
- }
- this.list = res.data.data;
- this.satatus = this.list.league.length >1 ? true :false;
- let arrayData = [];
- let key = Object.keys(res.data.data.p_code_array);
- let values = Object.values(res.data.data.p_code_array);
- this.isShow = true;
- this.key = ["所有盘口"];
- key.forEach((e, index) => {
- this.key.push(values[index]);
- let stripData = [];
- res.data.data.oddsData.forEach(data => {
- if (data.p_code == e) {
- stripData.push(data);
- }
- arrayData[index] = stripData;
- });
- });
- this.list.oddsData = arrayData;
- this.$store.dispatch("GETGAMERATIO", this.list);
- //console.log("数据源", arrayData);
- }
- this.$store.dispatch("GETSHOW", false);
- });
- },
- /**
- * 切换赛事
- */
- check(index, match_id) {
- let oddsType = localStorage.getItem('activity');
- this.show = false;
- if (this.list.match_id == match_id) return false;
- this.$store.dispatch("MACTH_ID", match_id);
- this.getAjax(this.gameCode, match_id,oddsType);
- },
- /**
- * 切换玩法类型
- */
- toggleNav: function(index) {
- this.active = index;
- if (this.key[index] == "所有盘口") {
- this.isAll = true;
- } else {
- this.isAll = false;
- this.Single = this.key[index];
- }
- }
- /**
- // 如果需要区分,则放里面;
- clickApp() {
- let ua = navigator.userAgent.toLowerCase();
- //Android终端
- let isAndroid = ua.indexOf("Android") > -1 || ua.indexOf("Adr") > -1; //Ios终端
- let isiOS = !!ua.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
- if (isWeixinBrowser()) {
- this.$router.push({
- path: "/product"
- });
- } else {
- if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
- //Ios
- console.log("iphone");
- this.iphone = true;
- } else if (/(Android)/i.test(navigator.userAgent)) {
- //Android终端
- console.log("");
- }
- }
- function isWeixinBrowser() {
- return /micromessenger/.test(ua) ? true : false;
- }
- }
- */
- },
- /**
- * 计算属性
- */
- computed: {
- getIsBettingType() {
- return this.$store.getters.getIsBetting;
- },
- // 获取投注框展示状态
- getBettingCase(){
- //console.log(this.$store.getters.getNoRoll,'aaaaa')
- return this.$store.getters.getNoRoll
- },
- },
- /**
- * 监听器
- */
- watch: {
- // 监听投注框开关
- getIsBettingType(val) {
- if(val=='-1'){
- this.$store.dispatch('SET_NOROLL',false)
- }
- this.isBettingWindow = val;
- },
- getBettingCase(val){
- this.getBettingIsShow=val
- },
- },
- /**
- *
- */
- mounted() {
- let _this = this;
- this.match_id = this.$store.getters.getMatchId;
- let oddsType = localStorage.getItem('activity');
- this.$public.ajaxTimerFun(function(timing) {
-
- if (!_this.timers) {
- clearInterval(timing);
- }else{
- _this.getAjax(_this.gameCode, _this.match_id,oddsType);
- }
- });
- this.getAjax(this.gameCode, this.match_id,oddsType);
- if (this.$store.getters.getIsBetting == '100') {
- this.isBettingWindow = 100;
- }
- },
- // /**
- // *
- // */
- // beforeDestroy() {
- // this.timers = false;
- // },
- components: {
- Corner,
- Goal,
- WaveBladder,
- StLinkFooter,
- SportsHead,
- OnlyWin,
- StartEnd,
- GoalSize,
- FullHalf,
- GoalSingleAndDouble,
- TeamGoalSize,
- Loading,
- NotOpend,
- BettingWindow
- }
- };
- </script>
- <style scoped>
- /* 禁止滚动 */
- .noscoll{
- position: fixed;
- width: 100%;
- top: 0;
- left: 0;
- }
- /* 头部 */
- .Serch {
- height: 0.88rem;
- display: flex;
- justify-content: space-between;
- align-items: center;
- background: linear-gradient(to bottom, #6a6a6a, #565656);
- color: #f76649;
- font-family: "PingFang-SC-Regular";
- padding: 0 0.33rem;
- }
- .returnimg {
- width: 0.37rem;
- height: 0.3rem;
- margin-right: 0.1rem;
- }
- .Soccer-game-title {
- height: 0.88rem;
- font-size: 0.3rem;
- }
- .Soccer-game-box {
- height: 0.88rem;
- /* padding: 0 0.32rem; */
- background-color: #626262;
- }
- .gambling {
- background: #f8f8f8;
- }
- .leagueMatch {
- position: relative;
- padding: 0.3rem 0.32rem;
- display: flex;
- justify-content: space-between;
- align-items: center;
- flex-wrap: nowrap;
- border-bottom: 1px solid #e4e4e4;
- background: linear-gradient(to top, #ffe9c9, #fff3e2);
- }
- .leagueMatch div {
- font-size: 0.28rem;
- text-align: left;
- color: #333333;
- }
- .leagueName {
- width: 2.26rem;
- }
- .leagueMatch .teamName {
- text-align: center;
- }
- .teamName .vs {
- text-align: center;
- font-size: 0.24rem;
- color: #fd8f26;
- }
- .leagueMatch .time {
- width: 1.3rem;
- color: #333333;
- font-size: 0.24rem;
- }
- .leagueMatch .icon i {
- display: inline-block;
- width: 0.4rem;
- height: 0.4rem;
- background: url("../../../assets/st-imges/xiangxia.png") no-repeat;
- background-size: 100% 100%;
- transform: rotate(180deg);
- }
- .leagueMatch .rotate {
- transform: rotate(180deg);
- transition: 0.2s;
- }
- .leagueMatch .backRotate {
- transform: rotate(0deg);
- transition: 0.2s;
- }
- .box {
- padding: 0 0.32rem;
- background: #f8f8f8;
- }
- #NavSlide {
- width: 100%;
- overflow: hidden;
- }
- #NavSlide nav {
- display: -webkit-box;
- display: -ms-flexbox;
- display: flex;
- -webkit-box-align: middle;
- -ms-flex-align: middle;
- align-items: middle;
- overflow: auto;
- }
- #NavSlide p {
- text-align: center;
- font-size: 0.28rem;
- -ms-flex-negative: 0;
- flex-shrink: 0;
- padding: 0 0.2rem 0 0;
- margin: 0 0.1rem 0 0;
- color: #b8b8b8;
- height: 0.88rem;
- line-height: 0.88rem;
- }
- /* #NavSlide p a{
- color: #E5E5E5;
- text-decoration: none;
- } */
- #NavSlide p span.active {
- color: #363636;
- }
- #NavSlide .fixadd {
- position: absolute;
- right: -4px;
- background-color: #31c17b;
- }
- button.yd-btn-block {
- background: #f8f8f8;
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- /* z-index: -1; */
- margin: 0;
- opacity: 0;
- }
- .modality {
- text-align: center;
- background: #fbfbfb;
- padding: 0.2rem 0;
- height: 5rem;
- /* overflow: hidden; */
- }
- .modality span {
- color: #000000;
- font-size: 0.28rem;
- }
- .modality div {
- /* margin: 0.06rem 0; */
- padding: 0.2rem 0;
- background: #fbfbfb;
- border-bottom: 1px solid #e4e4e4;
- }
- .modality div .col {
- color: #fd8f26;
- }
- </style>
|