290e2013bbc6d27df4c7c36da7a05dbf5fb4eb79.svn-base 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  1. <template>
  2. <div :class="getBettingIsShow?'noscoll':''">
  3. <div class="lod">
  4. <Loading></Loading>
  5. </div>
  6. <div>
  7. <SportsHead></SportsHead>
  8. <div class="Serch">
  9. <div class="Soccer-game row center">
  10. <div class="Soccer-game-title row center" @click="isreturn()">
  11. <img class="returnimg" :src="searchreturn">
  12. {{name}}
  13. </div>
  14. </div>
  15. </div>
  16. <div class="gambling" v-show="this.list">
  17. <div class="leagueMatch">
  18. <yd-button size="large" @click.native="show = true"></yd-button>
  19. <div class="leagueName">
  20. <span>{{list.leagueName}}</span>
  21. </div>
  22. <div class="teamName">
  23. <span>{{list.home_team}}</span>
  24. <div class="vs">vs</div>
  25. <span>{{list.guest_team}}</span>
  26. </div>
  27. <div class="time">
  28. <span>{{list.match_ptime? list.match_ptime :list.match_time }}</span>
  29. </div>
  30. <div v-if="satatus" class="icon" :class="status == true ? 'rotate':'backRotate'">
  31. <i></i>
  32. </div>
  33. </div>
  34. <div class="box">
  35. <div id="NavSlide">
  36. <nav>
  37. <p v-for="(item,$index) in key" @click="toggleNav($index)" :key="$index">
  38. <span :class="{active:$index==active}">{{item}}</span>
  39. </p>
  40. </nav>
  41. </div>
  42. </div>
  43. <!-- 模态框 -->
  44. <yd-popup v-if="satatus" v-model="show" position="center" width="90%">
  45. <div class="modality">
  46. <div
  47. class="list"
  48. v-for="(item,index) in list.league"
  49. :key="index"
  50. @click="check(index,item.match_id)"
  51. >
  52. <span :class="list.match_id == item.match_id?'col':''">{{item.home_team}}</span>
  53. <span :class="list.match_id == item.match_id?'col':''">v</span>
  54. <span :class="list.match_id == item.match_id?'col':''">{{item.guest_team}}</span>
  55. </div>
  56. </div>
  57. </yd-popup>
  58. </div>
  59. <div v-show="isShow">
  60. <!--让球大小-->
  61. <div v-show="Single =='让球大小' || isAll ">
  62. <goal></goal>
  63. </div>
  64. <!--独赢-->
  65. <div v-show="Single =='独赢'|| isAll ">
  66. <OnlyWin></OnlyWin>
  67. </div>
  68. <!--最先/最后进球-->
  69. <div v-show="Single =='最先/最后进球' || isAll ">
  70. <StartEnd></StartEnd>
  71. </div>
  72. <!-- 总进球数 -->
  73. <div v-show="Single =='总进球数' || isAll ">
  74. <GoalSize></GoalSize>
  75. </div>
  76. <!-- 波胆 -->
  77. <div v-show="Single =='波胆' || isAll ">
  78. <WaveBladder></WaveBladder>
  79. </div>
  80. <!--入球数单双-->
  81. <div v-show="Single =='进球数单双' || isAll ">
  82. <GoalSingleAndDouble></GoalSingleAndDouble>
  83. </div>
  84. <!--半场/全场-->
  85. <div v-show="Single =='半场/全场'|| isAll ">
  86. <FullHalf></FullHalf>
  87. </div>
  88. <!-- 角球 -->
  89. <div v-show="Single =='角球' || isAll ">
  90. <Corner></Corner>
  91. </div>
  92. <!-- 球队进球大小 -->
  93. <div v-show="Single =='球队进球大小' || isAll ">
  94. <TeamGoalSize></TeamGoalSize>
  95. </div>
  96. </div>
  97. <div v-if="!isShow">
  98. <NotOpend :title="tipsTitle"></NotOpend>
  99. </div>
  100. <StLinkFooter></StLinkFooter>
  101. <BettingWindow v-if="isBettingWindow== '100'"/>
  102. </div>
  103. </div>
  104. </template>
  105. <script>
  106. import Goal from "@/components/StGoal";
  107. import NotOpend from "@/components/StNotOpend";
  108. import Loading from "@/components/StLoading";
  109. import WaveBladder from "@/components/StWaveBladder";
  110. import StLinkFooter from "@/components/StLinkFooter";
  111. import SportsHead from "@/components/StSportsHead";
  112. import OnlyWin from "@/components/StOnlyWin";
  113. import GoalSize from "@/components/StGoalSize";
  114. import StartEnd from "@/components/StStartEnd";
  115. import FullHalf from "@/components/StFullHalf";
  116. import TeamGoalSize from "@/components/StTeamGoalSize";
  117. import GoalSingleAndDouble from "@/components/StGoalSingleAndDouble";
  118. import Corner from "@/components/StCorner";
  119. import BettingWindow from "@/components/StBettingWindow";
  120. export default {
  121. data() {
  122. return {
  123. name:this.$route.query.name, // 球名
  124. searchreturn: require("@/assets/st-imges/returnbox.png"),
  125. gameCode: this.$route.query.gameCode, //别名
  126. match_id: "",
  127. list:'', //数据
  128. key: [], //存储key值进行判定
  129. isShow: "", //更具数据是否显示
  130. getBettingIsShow:false,// 判断投注框背景可否滚动
  131. status: false,
  132. tipsTitle: "暂无相关数据信息",
  133. active: 0,
  134. // 投注页是否打开
  135. isBettingWindow: '-1',
  136. // isIphone: false,//是否ios
  137. // isAndroid: false,//是否Android
  138. show: false, //是否显示模态框
  139. satatus: true,
  140. isAll: true,
  141. Single: "",
  142. timers : true,
  143. };
  144. },
  145. methods: {
  146. // 返回上一页
  147. isreturn() {
  148. history.go(-1);
  149. },
  150. getAjax: function(gameCode, match_id,oddsType) {
  151. this.$store.dispatch("GETSHOW", true);
  152. this.$http.get(this.$ports.gambling.matchOdds, {
  153. oddsType,
  154. game_code: gameCode,
  155. matchID: match_id
  156. }).then(res => {
  157. if (res.data.status == 1 && res.data.data) {
  158. this.key = [];
  159. if ( res.data.data.oddsData == [] ||res.data.data.oddsData.length == 0 ||res.data.data.oddsData == null) {
  160. this.$store.dispatch("GETSHOW", false);
  161. this.isShow = false;
  162. return false;
  163. }
  164. this.list = res.data.data;
  165. this.satatus = this.list.league.length >1 ? true :false;
  166. let arrayData = [];
  167. let key = Object.keys(res.data.data.p_code_array);
  168. let values = Object.values(res.data.data.p_code_array);
  169. this.isShow = true;
  170. this.key = ["所有盘口"];
  171. key.forEach((e, index) => {
  172. this.key.push(values[index]);
  173. let stripData = [];
  174. res.data.data.oddsData.forEach(data => {
  175. if (data.p_code == e) {
  176. stripData.push(data);
  177. }
  178. arrayData[index] = stripData;
  179. });
  180. });
  181. this.list.oddsData = arrayData;
  182. this.$store.dispatch("GETGAMERATIO", this.list);
  183. //console.log("数据源", arrayData);
  184. }
  185. this.$store.dispatch("GETSHOW", false);
  186. });
  187. },
  188. /**
  189. * 切换赛事
  190. */
  191. check(index, match_id) {
  192. let oddsType = localStorage.getItem('activity');
  193. this.show = false;
  194. if (this.list.match_id == match_id) return false;
  195. this.$store.dispatch("MACTH_ID", match_id);
  196. this.getAjax(this.gameCode, match_id,oddsType);
  197. },
  198. /**
  199. * 切换玩法类型
  200. */
  201. toggleNav: function(index) {
  202. this.active = index;
  203. if (this.key[index] == "所有盘口") {
  204. this.isAll = true;
  205. } else {
  206. this.isAll = false;
  207. this.Single = this.key[index];
  208. }
  209. }
  210. /**
  211. // 如果需要区分,则放里面;
  212. clickApp() {
  213. let ua = navigator.userAgent.toLowerCase();
  214. //Android终端
  215. let isAndroid = ua.indexOf("Android") > -1 || ua.indexOf("Adr") > -1; //Ios终端
  216. let isiOS = !!ua.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
  217. if (isWeixinBrowser()) {
  218. this.$router.push({
  219. path: "/product"
  220. });
  221. } else {
  222. if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
  223. //Ios
  224. console.log("iphone");
  225. this.iphone = true;
  226. } else if (/(Android)/i.test(navigator.userAgent)) {
  227. //Android终端
  228. console.log("");
  229. }
  230. }
  231. function isWeixinBrowser() {
  232. return /micromessenger/.test(ua) ? true : false;
  233. }
  234. }
  235. */
  236. },
  237. /**
  238. * 计算属性
  239. */
  240. computed: {
  241. getIsBettingType() {
  242. return this.$store.getters.getIsBetting;
  243. },
  244. // 获取投注框展示状态
  245. getBettingCase(){
  246. //console.log(this.$store.getters.getNoRoll,'aaaaa')
  247. return this.$store.getters.getNoRoll
  248. },
  249. },
  250. /**
  251. * 监听器
  252. */
  253. watch: {
  254. // 监听投注框开关
  255. getIsBettingType(val) {
  256. if(val=='-1'){
  257. this.$store.dispatch('SET_NOROLL',false)
  258. }
  259. this.isBettingWindow = val;
  260. },
  261. getBettingCase(val){
  262. this.getBettingIsShow=val
  263. },
  264. },
  265. /**
  266. *
  267. */
  268. mounted() {
  269. let _this = this;
  270. this.match_id = this.$store.getters.getMatchId;
  271. let oddsType = localStorage.getItem('activity');
  272. this.$public.ajaxTimerFun(function(timing) {
  273. if (!_this.timers) {
  274. clearInterval(timing);
  275. }else{
  276. _this.getAjax(_this.gameCode, _this.match_id,oddsType);
  277. }
  278. });
  279. this.getAjax(this.gameCode, this.match_id,oddsType);
  280. if (this.$store.getters.getIsBetting == '100') {
  281. this.isBettingWindow = 100;
  282. }
  283. },
  284. // /**
  285. // *
  286. // */
  287. // beforeDestroy() {
  288. // this.timers = false;
  289. // },
  290. components: {
  291. Corner,
  292. Goal,
  293. WaveBladder,
  294. StLinkFooter,
  295. SportsHead,
  296. OnlyWin,
  297. StartEnd,
  298. GoalSize,
  299. FullHalf,
  300. GoalSingleAndDouble,
  301. TeamGoalSize,
  302. Loading,
  303. NotOpend,
  304. BettingWindow
  305. }
  306. };
  307. </script>
  308. <style scoped>
  309. /* 禁止滚动 */
  310. .noscoll{
  311. position: fixed;
  312. width: 100%;
  313. top: 0;
  314. left: 0;
  315. }
  316. /* 头部 */
  317. .Serch {
  318. height: 0.88rem;
  319. display: flex;
  320. justify-content: space-between;
  321. align-items: center;
  322. background: linear-gradient(to bottom, #6a6a6a, #565656);
  323. color: #f76649;
  324. font-family: "PingFang-SC-Regular";
  325. padding: 0 0.33rem;
  326. }
  327. .returnimg {
  328. width: 0.37rem;
  329. height: 0.3rem;
  330. margin-right: 0.1rem;
  331. }
  332. .Soccer-game-title {
  333. height: 0.88rem;
  334. font-size: 0.3rem;
  335. }
  336. .Soccer-game-box {
  337. height: 0.88rem;
  338. /* padding: 0 0.32rem; */
  339. background-color: #626262;
  340. }
  341. .gambling {
  342. background: #f8f8f8;
  343. }
  344. .leagueMatch {
  345. position: relative;
  346. padding: 0.3rem 0.32rem;
  347. display: flex;
  348. justify-content: space-between;
  349. align-items: center;
  350. flex-wrap: nowrap;
  351. border-bottom: 1px solid #e4e4e4;
  352. background: linear-gradient(to top, #ffe9c9, #fff3e2);
  353. }
  354. .leagueMatch div {
  355. font-size: 0.28rem;
  356. text-align: left;
  357. color: #333333;
  358. }
  359. .leagueName {
  360. width: 2.26rem;
  361. }
  362. .leagueMatch .teamName {
  363. text-align: center;
  364. }
  365. .teamName .vs {
  366. text-align: center;
  367. font-size: 0.24rem;
  368. color: #fd8f26;
  369. }
  370. .leagueMatch .time {
  371. width: 1.3rem;
  372. color: #333333;
  373. font-size: 0.24rem;
  374. }
  375. .leagueMatch .icon i {
  376. display: inline-block;
  377. width: 0.4rem;
  378. height: 0.4rem;
  379. background: url("../../../assets/st-imges/xiangxia.png") no-repeat;
  380. background-size: 100% 100%;
  381. transform: rotate(180deg);
  382. }
  383. .leagueMatch .rotate {
  384. transform: rotate(180deg);
  385. transition: 0.2s;
  386. }
  387. .leagueMatch .backRotate {
  388. transform: rotate(0deg);
  389. transition: 0.2s;
  390. }
  391. .box {
  392. padding: 0 0.32rem;
  393. background: #f8f8f8;
  394. }
  395. #NavSlide {
  396. width: 100%;
  397. overflow: hidden;
  398. }
  399. #NavSlide nav {
  400. display: -webkit-box;
  401. display: -ms-flexbox;
  402. display: flex;
  403. -webkit-box-align: middle;
  404. -ms-flex-align: middle;
  405. align-items: middle;
  406. overflow: auto;
  407. }
  408. #NavSlide p {
  409. text-align: center;
  410. font-size: 0.28rem;
  411. -ms-flex-negative: 0;
  412. flex-shrink: 0;
  413. padding: 0 0.2rem 0 0;
  414. margin: 0 0.1rem 0 0;
  415. color: #b8b8b8;
  416. height: 0.88rem;
  417. line-height: 0.88rem;
  418. }
  419. /* #NavSlide p a{
  420. color: #E5E5E5;
  421. text-decoration: none;
  422. } */
  423. #NavSlide p span.active {
  424. color: #363636;
  425. }
  426. #NavSlide .fixadd {
  427. position: absolute;
  428. right: -4px;
  429. background-color: #31c17b;
  430. }
  431. button.yd-btn-block {
  432. background: #f8f8f8;
  433. position: absolute;
  434. left: 0;
  435. top: 0;
  436. width: 100%;
  437. height: 100%;
  438. /* z-index: -1; */
  439. margin: 0;
  440. opacity: 0;
  441. }
  442. .modality {
  443. text-align: center;
  444. background: #fbfbfb;
  445. padding: 0.2rem 0;
  446. height: 5rem;
  447. /* overflow: hidden; */
  448. }
  449. .modality span {
  450. color: #000000;
  451. font-size: 0.28rem;
  452. }
  453. .modality div {
  454. /* margin: 0.06rem 0; */
  455. padding: 0.2rem 0;
  456. background: #fbfbfb;
  457. border-bottom: 1px solid #e4e4e4;
  458. }
  459. .modality div .col {
  460. color: #fd8f26;
  461. }
  462. </style>