13b4e2ce2cf8b15f0a506c8b14c522cf367059bd.svn-base 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  1. <template>
  2. <div>
  3. <div v-if="noData">
  4. <NotOpend :title="this.info"/>
  5. </div>
  6. <!-- 让球&大小 -->
  7. <div class="match" v-if="isShow && rShow">
  8. <div v-for="(items,index) in letBallData" :key="items.id" class="mg">
  9. <!-- <div v-for="items in list[index]" :key="items.id"> -->
  10. <div class="row allAlignment haderBox center">
  11. <span>{{items.leagueName}}</span>
  12. <div class="row Match-title-num">
  13. <span>{{items.matchNum}}</span>
  14. </div>
  15. </div>
  16. <div class="Match-box">
  17. <div v-for="(itemList,index) in items.matchData" :key="itemList.id" @click="matchInfo(itemList.match_id)">
  18. <div class="row allAlignment Match-box-top">
  19. <div class="Match-box-top-left">
  20. <span>{{itemList.match_date}}</span>
  21. <span class="texttop">{{itemList.match_time}}</span>
  22. </div>
  23. <div class="Match-box-top-right row">
  24. <span style="margin-right: .1rem;" class="Match-box-top-num">{{itemList.tag}}</span>
  25. <span style="margin-right: .1rem;">让球</span>
  26. <span style="margin-right: .1rem;">大小</span>
  27. </div>
  28. </div>
  29. <div class="row allAlignment center listbox">
  30. <div class="column average name-box">
  31. <div>{{itemList.home_team}}</div>
  32. <div>{{itemList.guest_team}}</div>
  33. </div>
  34. <div class="Match-list-box row item-center average">
  35. <div v-for="(odds,i) in itemList.oddsData[0]" :key="odds.id" class="match-list">
  36. <div
  37. @click.stop="isclick(index,i)"
  38. class="column center"
  39. :class="items.istrue == i ?'active':''"
  40. >
  41. <span style="color:#FD8F26">{{odds.condition}}</span>
  42. <span>{{odds.odds}}</span>
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. <!-- 1x2 -->
  52. <div v-if="!isShow && !ishow && rShow">
  53. <div v-for="(item,index) in letBallData" :key="item.id" @click="betting()">
  54. <div class="row allAlignment haderBox center">
  55. <span>{{item.leagueName}}</span>
  56. <div class="Match-title-num">
  57. <span>{{item.matchNum}}</span>
  58. </div>
  59. </div>
  60. <div v-for="(itemList,$index) in item.matchData" :key="itemList.id" @click="matchInfo(itemList.match_id)">
  61. <div class="box">
  62. <div class="row allAlignment item-center top-box">
  63. <span>
  64. <i>{{itemList.match_date}}</i>
  65. <b style="color:#F76649;font-weight: normal;">{{itemList.match_time}}</b>
  66. </span>
  67. <span class="top-num">{{itemList.tag}}</span>
  68. </div>
  69. </div>
  70. <div class="box-bottom">
  71. <div class="box row item-center main-box">
  72. <span v-if="itemList.home_score" class="num-box" style="color:#eb921e">{{itemList.home_score}}</span>
  73. &nbsp;&nbsp;{{itemList.home_team}}
  74. </div>
  75. <div class="box row item-center main-box">
  76. <span v-if="itemList.guest_score? itemList.guest_score:'0'" class="num-box" style="color:#eb921e">{{itemList.guest_score}}</span>
  77. &nbsp;&nbsp;{{itemList.guest_team}}
  78. </div>
  79. <div class="footBox">
  80. <div
  81. class="box row allAlignment bottom-box center"
  82. v-for="(odds,idx) in itemList.oddsData[1]"
  83. :key="odds.id"
  84. >
  85. <div
  86. class="item-center bottom-num"
  87. :class="item.istrueA==true?'active':''"
  88. @click.stop="isClick(idx,1)"
  89. >
  90. <p style="color:#eb921e">{{odds.condition}}</p>
  91. <p>{{odds.odds}}</p>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. </div>
  99. <!-- 独赢盘 -->
  100. <div class="match" v-if="!isShow && ishow && rShow">
  101. <div v-for="(items,index) in letBallData" :key="items.id" class="mg">
  102. <!-- <div v-for="items in list[index]" :key="items.id"> -->
  103. <div class="row allAlignment letBallBox center">
  104. <span>{{items.leagueName}}</span>
  105. <div class="row Match-title-num">
  106. <span>{{items.matchNum}}</span>
  107. </div>
  108. </div>
  109. <div class="Match-box">
  110. <div v-for="(itemList,index) in items.matchData" :key="itemList.id" class="Match-box" @click="matchInfo(itemList.match_id)">
  111. <div class="row allAlignment Match-box-top">
  112. <div class="Match-box-top-left">
  113. <span>{{itemList.match_date}}</span>
  114. <span class="texttop">{{itemList.match_time}}</span>
  115. </div>
  116. <div class="Match-box-top-right row">
  117. <span style="margin-right: .1rem;" class="Match-box-top-num">{{itemList.tag}}</span>
  118. <!-- <span style="margin-right: .1rem;">让球</span> -->
  119. <span style="margin-right: .1rem;">独赢盘</span>
  120. </div>
  121. </div>
  122. <div class="row allAlignment center listbox">
  123. <div class="column average name-box">
  124. <div>{{itemList.home_team}}</div>
  125. <div>{{itemList.guest_team}}</div>
  126. </div>
  127. <div class="Match-list-box row item-center average">
  128. <div v-for="(odds,i) in itemList.oddsData[0]" :key="odds.id" class="match-list">
  129. <div
  130. @click.stop="isclick(index,i)"
  131. class="column center"
  132. :class="items.istrue==i?'active':''"
  133. >
  134. <span style="color:#FD8F26">{{odds.condition}}</span>
  135. <span>{{odds.odds}}</span>
  136. </div>
  137. </div>
  138. </div>
  139. </div>
  140. </div>
  141. </div>
  142. </div>
  143. </div>
  144. <!-- 如过是网球则显示 -->
  145. <div class="match" v-if="isShow && !rShow">
  146. <div v-for="(items,index) in letBallData" :key="items.id" class="mg">
  147. <!-- <div v-for="items in list[index]" :key="items.id"> -->
  148. <div class="row allAlignment letBallBox center">
  149. <span>{{items.leagueName}}</span>
  150. <div class="row Match-title-num">
  151. <span>{{items.matchNum}}</span>
  152. </div>
  153. </div>
  154. <div class="Match-box">
  155. <div v-for="(itemList,index) in items.matchData" :key="itemList.id" class="Match-box" @click="matchInfo(itemList.match_id)">
  156. <div class="row allAlignment Match-box-top">
  157. <div class="Match-box-top-left">
  158. <span>{{itemList.match_date}}</span>
  159. <span class="texttop">{{itemList.match_time}}</span>
  160. </div>
  161. <div class="Match-box-top-right row">
  162. <span style="margin-right: .1rem;" class="Match-box-top-num">{{itemList.tag}}</span>
  163. <span style="margin-right: .1rem;">独赢盘</span>
  164. <span style="margin-right: .1rem;">让盘</span>
  165. </div>
  166. </div>
  167. <div class="row allAlignment center listbox">
  168. <div class="column average name-box">
  169. <div>{{itemList.home_team}}</div>
  170. <div>{{itemList.guest_team}}</div>
  171. </div>
  172. <div class="Match-list-box row item-center average">
  173. <div v-for="(odds,i) in itemList.oddsData[0]" :key="odds.id" class="match-list">
  174. <div
  175. @click.stop="isclick(index,i)"
  176. class="column center"
  177. :class="items.istrue ? 'active':''"
  178. >
  179. <span style="color:#FD8F26">{{odds.condition}}</span>
  180. <span>{{odds.odds}}</span>
  181. </div>
  182. </div>
  183. </div>
  184. </div>
  185. </div>
  186. </div>
  187. </div>
  188. </div>
  189. <div class="BettingWindow" v-if="isWindow">
  190. <BettingWindow />
  191. </div>
  192. </div>
  193. </template>
  194. <script>
  195. import Bus from "../assets/bus.js";
  196. import NotOpend from "@/components/StNotOpend";
  197. import BettingWindow from '@/components/StBettingWindow';
  198. export default {
  199. props: ["gameCode", "name",'ishow'],
  200. components:{NotOpend,BettingWindow},
  201. data() {
  202. return {
  203. show: false, //暂时状态
  204. isShow: true,
  205. noData: true, //显示暂无数据
  206. rShow:true,//是否为棒球与网球,是则不显示
  207. info: "没有相关比赛信息",
  208. status: false,
  209. isWindow :false,//投注组件隐藏
  210. isAjax:false,//开关
  211. list:[],
  212. letBallData: "" ,//让球大小和1X2数据
  213. };
  214. },
  215. /**
  216. * 函数方法
  217. */
  218. methods: {
  219. matchInfo(id){
  220. this.$router.push({path:'/StRollBallBettingPage',query:{gameCode: this.$store.getters.getBallId,number:1,home:true}});
  221. this.$store.dispatch("MACTH_ID",id);
  222. },
  223. //打开联赛投注页面
  224. goMatchInfo: function(leagueId, sessionId) {
  225. //console.log(leagueId, sessionId);
  226. this.$store.dispatch("GETSHOW", true);
  227. Bus.$on("show", data => {
  228. this.isShow = data;
  229. });
  230. },
  231. getAjax: function(game_code,type_code) {
  232. this.$store.dispatch('GETSHOW',true);
  233. if(!game_code || !type_code) return false;
  234. this.$http
  235. .get(this.$ports.match.matchState, {
  236. game_code,
  237. type_code
  238. })
  239. .then(res => {
  240. this.isAjax = true
  241. if(res.data.status == 1 && res.data.data.length >0 && res.data != null){
  242. this.letBallData = res.data.data;
  243. // console.log(' this.letBallData', this.letBallData)
  244. this.noData = false;
  245. }else{
  246. // 是否显示组件
  247. this.noData = true;
  248. //console.log('data',this.noData)
  249. // 每次更新数据没有数据时则置空。
  250. this.letBallData = [];
  251. }
  252. // 状态值数据更改
  253. this.$store.dispatch('GETSHOW',false);
  254. });
  255. },
  256. isClick() {
  257. if(this.$store.getters.getIsBetting==true){
  258. return false
  259. }
  260. this.$store.dispatch('ISBETTING',true)
  261. // this.$set(this.letBallData.matchData[1].oddsData[1][i], "istrue", (this.letBallData.list[i].istrue = num));
  262. },
  263. betting(){
  264. this.isWindow = true;
  265. },
  266. // 点击事件确认选中
  267. isclick(index, num) {
  268. console.log(this.letBallData)
  269. if(this.$store.getters.getIsBetting==true){
  270. return false
  271. }
  272. this.$store.dispatch('ISBETTING',true)
  273. }
  274. },
  275. /**
  276. * 计算属性
  277. */
  278. computed: {
  279. getInfo: function() {
  280. // 监听vuex状态值的改变
  281. this.goMatchInfo();
  282. return {game_code: this.$store.getters.getBallId,type_code:this.$store.getters.getActivity}
  283. },
  284. IsWindow(){
  285. return this.$store.getters.getIsBetting
  286. }
  287. },
  288. watch: {
  289. getInfo(obj) {
  290. if(this.$store.getters.getActivity == "StSoon" || this.$store.getters.getActivity == "StRollBall" ){
  291. if(this.isAjax ){
  292. this.getAjax(obj.game_code,obj.type_code);
  293. }
  294. }
  295. if(obj.game_code == 'wq'){
  296. this.rShow = false;
  297. }else{
  298. this.rShow = true;
  299. }
  300. },
  301. IsWindow(val){
  302. this.isWindow = val;
  303. }
  304. },
  305. mounted(){
  306. this.getAjax(this.$store.getters.getBallId,this.$store.getters.getActivity);
  307. }
  308. };
  309. </script>
  310. <style scoped>
  311. .yd-cell-box .yd-cell {
  312. z-index: 99;
  313. border-radius: 0.2rem;
  314. }
  315. .matchBox {
  316. background: #f9f9f9;
  317. padding: 0.27rem 0.34rem 0 0.32rem;
  318. }
  319. .match .tit {
  320. display: flex;
  321. justify-content: space-between;
  322. font-size: 0.32rem;
  323. margin-bottom: 0.3rem;
  324. }
  325. .match .list {
  326. overflow: hidden;
  327. transition: all 0.3s cubic-bezier(0.4, 0.6, 0.2, 1);
  328. }
  329. .match .list div {
  330. background: #dcdcdc;
  331. width: 100%;
  332. height: 0.88rem;
  333. padding: 0.26rem 0.56rem 0.3rem 0.3rem;
  334. display: flex;
  335. justify-content: space-between;
  336. border-radius: 0.08rem;
  337. margin-bottom: 0.12rem;
  338. }
  339. .match .list span {
  340. color: #333333;
  341. font-size: 0.28rem;
  342. }
  343. .match .list .num {
  344. width: 0.4rem;
  345. height: 0.4rem;
  346. display: inline-block;
  347. line-height: 0.4rem;
  348. text-align: center;
  349. color: #f5f5f5;
  350. border-radius: 50%;
  351. font-size: 0.2rem;
  352. background: #f76649;
  353. }
  354. .yd-accordion {
  355. background: transparent;
  356. }
  357. .match .list div:nth-last-child(1) {
  358. margin-bottom: 0.34rem;
  359. }
  360. div /deep/ .yd-accordion-head,
  361. div /deep/ .yd-accordion-head-content,
  362. div /deep/ .yd-accordion-title,
  363. div /deep/ .yd-accordion-title-full {
  364. height: 0.3rem;
  365. }
  366. div /deep/ .yd-accordion-title {
  367. min-height: 0;
  368. font-size: 0.28rem;
  369. }
  370. div /deep/ .yd-accordion-head {
  371. margin-bottom: 0.3rem;
  372. border: none;
  373. }
  374. .list-box {
  375. border: 2px solid #cecece;
  376. border-radius: 0.2rem;
  377. }
  378. div /deep/ .yd-accordion-head:after {
  379. height: 0px;
  380. }
  381. div /deep/ .yd-accordion-head-arrow:after {
  382. border: none;
  383. width: 0.4rem;
  384. height: 0.4rem;
  385. background: url("../assets/st-imges/xiangxia.png") no-repeat;
  386. background-size: 0.4rem 0.4rem;
  387. }
  388. /* 1x2 */
  389. .top-box {
  390. height: 0.44rem;
  391. font-size: 0.24rem;
  392. background: #fff;
  393. border-bottom: 1px solid #e4e4e4;
  394. }
  395. .box-bottom {
  396. /* height: 2.9rem; */
  397. }
  398. .top-num {
  399. display: inline-block;
  400. width: 0.64rem;
  401. height: 0.44rem;
  402. line-height: 0.44rem;
  403. color: #000000;
  404. text-align: center;
  405. background: #ebebeb;
  406. font-size: 0.24rem;
  407. }
  408. .box {
  409. padding: 0 0.32rem;
  410. background: #fff;
  411. }
  412. .Match-title-num {
  413. width: 0.46rem;
  414. height: 0.46rem;
  415. line-height: 0.46rem;
  416. text-align: center;
  417. background: #f76649;
  418. font-size: 0.26rem;
  419. border-radius: 50%;
  420. color: #e4e4e4;
  421. }
  422. .haderBox {
  423. padding: 0 0.32rem;
  424. height: 0.88rem;
  425. font-size: 0.32rem;
  426. background: #f8f8f8;
  427. }
  428. .main-box {
  429. height: 0.9rem;
  430. background: #fff;
  431. font-size: 0.28rem;
  432. }
  433. .bottom-box {
  434. height: 1.1rem;
  435. background: #fff;
  436. font-size: 0.24rem;
  437. }
  438. .bottom-box div {
  439. width: 1.07rem;
  440. height: 0.76rem;
  441. border: 2px solid #cecece;
  442. border-radius: 0.1rem;
  443. font-size: 0.24rem;
  444. }
  445. .bottom-num {
  446. padding: 0.1rem;
  447. text-align: center;
  448. }
  449. .active {
  450. background: #f76649;
  451. border: 2px solid #f76649 !important;
  452. }
  453. .active > p {
  454. color: #e4e4e4 !important;
  455. }
  456. .num-box {
  457. width: 0.66rem;
  458. height: 0.34rem;
  459. background: #f76649;
  460. border-radius: 0.17rem;
  461. color: #f5f5f5 !important;
  462. line-height: 0.34rem;
  463. text-align: center;
  464. }
  465. .footBox {
  466. display: flex;
  467. flex-wrap: wrap;
  468. align-items: center;
  469. }
  470. .footBox .box {
  471. width: 33%;
  472. text-align: center;
  473. }
  474. /* 让球&大小 */
  475. .letBallBox {
  476. padding: 0 0.32rem;
  477. height: 0.88rem;
  478. font-size: 0.28rem;
  479. background: #f4f4f4;
  480. }
  481. .mg {
  482. margin-bottom: 0.1rem;
  483. }
  484. .Match-title-num {
  485. width: 0.46rem;
  486. height: 0.46rem;
  487. align-items: center;
  488. justify-content: center;
  489. line-height: 0.46rem;
  490. text-align: center;
  491. background: #f76649;
  492. font-size: 0.2rem;
  493. border-radius: 50%;
  494. color: #f5f5f5;
  495. }
  496. .Match-box-top-right > span {
  497. width: 1.07rem;
  498. text-align: center;
  499. }
  500. .listbox{
  501. padding: 0 .32rem;
  502. }
  503. .name-box {
  504. height: 1.76rem;
  505. width: 3.8rem;
  506. }
  507. .Match-box-top {
  508. height: 0.44rem;
  509. padding: 0 0.32rem;
  510. line-height: 0.44rem;
  511. background: #DCDCDC;
  512. font-size: 0.23rem;
  513. }
  514. .Match-box-top-num {
  515. width:0.64rem !important;
  516. height: 0.44rem;
  517. background: #ebebeb;
  518. font-size: 0.24rem;
  519. }
  520. .texttop{
  521. color: #f76649
  522. }
  523. .Match-box {
  524. padding-top: .12rem;
  525. background: #f8f8f8;
  526. }
  527. .Match-list-box {
  528. width: 35%;
  529. height: 1.76rem;
  530. flex-wrap: wrap;
  531. }
  532. .Match-list-box .match-list div {
  533. width: 1.07rem;
  534. height: 0.8rem;
  535. border: 2px solid #cecece;
  536. border-radius: 0.1rem;
  537. flex-wrap: wrap;
  538. }
  539. .active {
  540. background: #e4e4e4;
  541. }
  542. /* 模态框样式 */
  543. .BettingWindow{
  544. z-index: 10000;
  545. position:fixed;
  546. top:0;
  547. width: 100%;
  548. }
  549. </style>