5edcbe6d15e491ae5992cc9888fb5a32801f9cab.svn-base 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628
  1. <template>
  2. <div>
  3. <div class="header">
  4. <div class="title">
  5. <div @click="returnEvent()" class="row item-center">
  6. <i class="backSingPage"></i>
  7. <span class="header-title triangle">滚球{{title}}</span>
  8. <span style="color:#333;margin-left:.3rem;">{{data.leagueName}}</span>
  9. </div>
  10. <div>
  11. <i></i>
  12. <div class="redraw">
  13. <i class="refresh"></i>
  14. </div>
  15. </div>
  16. </div>
  17. <!-- 足球头部 -->
  18. <div class="tennisHead" style="padding:0.1rem;">
  19. <!-- <div style="padding:0.1rem;"> -->
  20. <!-- <div class="match"> -->
  21. <!-- <div class="tit">
  22. <span>{{data.leagueName}}</span>
  23. </div>-->
  24. <div class="ballTable">
  25. <div class="listHead row allAlignment">
  26. <div class="txt">
  27. <div class="spanCol">第{{scoreDetails.schedule == "1"?'一' : scoreDetails.schedule =="2" ? "二": scoreDetails.schedule =="3" ? "三": scoreDetails.schedule=="4" ? "四":"五" }}节</div>
  28. <!-- <div class="delay">天气原因延期</div> -->
  29. </div>
  30. <div class="headerTop row rightAlignment">
  31. <span :class="{spanCol:scoreDetails.schedule == 1}" >1</span>
  32. <span :class="{spanCol:scoreDetails.schedule == 2}" >2</span>
  33. <span :class="{spanCol:scoreDetails.schedule == 3}" >3</span>
  34. <span v-if="scoreDetails.best >3" :class="{spanCol:scoreDetails.schedule == 4}" >4</span>
  35. <span v-if="scoreDetails.best >3" :class="{spanCol:scoreDetails.schedule == 5}" >5</span>
  36. <span class="mg-5">分数</span>
  37. <span class="mg-5">盘</span>
  38. <span class="mg-5">总局数</span>
  39. </div>
  40. </div>
  41. <div class="row allAlignment list">
  42. <div class="row">
  43. <!-- <div class="ballhold" style="color: rgb(197, 210, 60);">•</div> -->
  44. <div class="team" style="text-align:left;">{{data.home_team}}</div>
  45. </div>
  46. <div class="score row rightAlignment">
  47. <span :class="{spanCol:scoreDetails.schedule == 1}" > {{scoreDetails.sc_1th_H}}</span>
  48. <span :class="{spanCol:scoreDetails.schedule == 2}" > {{scoreDetails.sc_2th_H}}</span>
  49. <span :class="{spanCol:scoreDetails.schedule == 3}" > {{scoreDetails.sc_3th_H}}</span>
  50. <span v-if="scoreDetails.best >3" :class="{spanCol:scoreDetails.schedule == 4}" > {{scoreDetails.sc_4th_H}}</span>
  51. <span v-if="scoreDetails.best >3" :class="{spanCol:scoreDetails.schedule == 5}" > {{scoreDetails.sc_5th_H}}</span>
  52. <span v-if="scoreDetails" class="mg-5 mark cl" style="background: rgba(255, 165, 0, 0.49);">{{scoreDetails.spot_H}}</span>
  53. <span v-if="scoreDetails" class="mg-5 mark">{{scoreDetails.disc_H}}</span>
  54. <span v-if="scoreDetails" class="mg-5 mark sumCl">{{scoreDetails.game_num_H}}</span>
  55. </div>
  56. </div>
  57. <div class="row allAlignment list">
  58. <div class="row">
  59. <!-- <span class="ballhold" style="color:#fff;">•</span> -->
  60. <span class="team" style="text-align:left;">{{data.guest_team}}</span>
  61. </div>
  62. <div class="score row rightAlignment">
  63. <span :class="{spanCol:scoreDetails.schedule == 1}" > {{scoreDetails.sc_1th_C}}</span>
  64. <span :class="{spanCol:scoreDetails.schedule == 2}" > {{scoreDetails.sc_2th_C}}</span>
  65. <span :class="{spanCol:scoreDetails.schedule == 3}" > {{scoreDetails.sc_3th_C}}</span>
  66. <span v-if="scoreDetails.best >3" :class="{spanCol:scoreDetails.schedule == 4}" > {{scoreDetails.sc_4th_C}}</span>
  67. <span v-if="scoreDetails.best >3" :class="{spanCol:scoreDetails.schedule == 5}" > {{scoreDetails.sc_5th_C}}</span>
  68. <span v-if="scoreDetails" class="mg-5 mark cl" style="background: rgba(255, 165, 0, 0.49);">{{scoreDetails.spot_C}}</span>
  69. <span v-if="scoreDetails" class="mg-5 mark">{{scoreDetails.disc_C}}</span>
  70. <span v-if="scoreDetails" class="mg-5 mark sumCl">{{scoreDetails.game_num_C}}</span>
  71. </div>
  72. </div>
  73. <div></div>
  74. </div>
  75. <!-- </div>
  76. </div>-->
  77. </div>
  78. <div class="welcome row NavSlide">
  79. <nav class="scroll">
  80. <div class="row center" v-for="(itme,$index) in key" @click="toggleNav($index)">
  81. <span :class="{active:$index == active}">{{itme}}</span>
  82. </div>
  83. </nav>
  84. </div>
  85. </div>
  86. <div class="cont">
  87. <!-- 让局 -->
  88. <div v-show=" Single =='让局'|| isAll">
  89. <theBureau/>
  90. <!-- <concede/> -->
  91. </div>
  92. <!-- <letBall/> -->
  93. <!-- 独赢 -->
  94. <div v-show=" Single =='独赢' || isAll">
  95. <winAlone/>
  96. </div>
  97. <!-- 波胆 -->
  98. <div v-show=" Single =='波胆'|| isAll">
  99. <waveBladder/>
  100. </div>
  101. <!-- 总局数:单/双 -->
  102. <div v-show="Single == '总局数:单/双'|| isAll">
  103. <BureauOddEven/>
  104. <!-- <teamTotalScoreSize/> -->
  105. </div>
  106. <!-- 让盘 -->
  107. <div v-show=" Single =='让盘'|| isAll">
  108. <thePlate/>
  109. <!-- <teamTotalScoreSize/> -->
  110. </div>
  111. <!-- 总局数:大/小 -->
  112. <div v-show=" Single =='总局数:大/小'|| isAll">
  113. <BureauSizeOfThe/>
  114. <!-- <teamTotalScoreSize/> -->
  115. </div>
  116. <!-- 角球 -->
  117. <!-- <corner/> -->
  118. <!-- 进球 -->
  119. <!-- <goal/> -->
  120. <!-- 进球半场 -->
  121. <!-- <goalHalfCourt/> -->
  122. <!-- 让盘 -->
  123. <!-- <letPlate/> -->
  124. <!-- 球队得分 -->
  125. <score/>
  126. </div>
  127. </div>
  128. </template>
  129. <script>
  130. import "@/css/index.css";
  131. // import letBall from "@/components/betting/letBall";
  132. import goalsSize from "@/components/betting/goalsSize";
  133. import teamGoalsSize from "@/components/betting/teamGoalsSize";
  134. import teamTotalScoreSize from "@/components/betting/teamTotalScoreSize";
  135. import scoreSingleDouble from "@/components/betting/scoreSingleDouble";
  136. import winAlone from "@/components/betting/winAlone";
  137. import sumGoal from "@/components/betting/sumGoal";
  138. import waveBladder from "@/components/betting/waveBladder";
  139. import goalEntry from "@/components/betting/goalEntry";
  140. // import corner from "@/components/betting/corner";
  141. import halfCount from "@/components/betting/halfCount";
  142. import concede from "@/components/betting/concede";
  143. // import goal from "@/components/betting/goal";
  144. // import goalHalfCourt from "@/components/betting/goalHalfCourt";
  145. // import letPlate from "@/components/betting/letPlate";
  146. import totalScore from "@/components/betting/totalScore";
  147. import score from "@/components/betting/score";
  148. import theBureau from "@/components/betting/theBureau"; //让局
  149. import BureauOddEven from "@/components/betting/BureauOddEven"; //总局数单双
  150. import BureauSizeOfThe from "@/components/betting/BureauSizeOfThe"; //总局数大小
  151. import TopGame from "@/components/betting/TopGame"; //冠军
  152. import thePlate from "@/components/betting/thePlate"; //让盘
  153. export default {
  154. data() {
  155. return {
  156. activity: "", //活动代码
  157. active: 0, // 投注页是否打开
  158. ballCode: "", //球类代码
  159. matchId: "", //赛事idd
  160. data: [], //赛事数据源
  161. scoreDetails:'',//
  162. previousStorage: "", //前一次data储存数据
  163. title: "", //
  164. key: "", //玩法名字
  165. Single: "", //
  166. isAll: true, //
  167. timers: true,
  168. };
  169. },
  170. components: {
  171. // letBall,
  172. goalsSize,
  173. winAlone,
  174. sumGoal,
  175. waveBladder,
  176. goalEntry,
  177. // corner,
  178. halfCount,
  179. concede,
  180. // goal,
  181. // goalHalfCourt,
  182. // letPlate,
  183. totalScore,
  184. score,
  185. scoreSingleDouble,
  186. teamGoalsSize,
  187. teamTotalScoreSize,
  188. BureauOddEven,
  189. BureauSizeOfThe,
  190. theBureau,
  191. TopGame,
  192. thePlate
  193. },
  194. /**
  195. * 页面加载完成挂载
  196. */
  197. mounted() {
  198. this.activity = this.$store.getters.getActivity;
  199. this.ballCode = this.$store.getters.getBallCode;
  200. this.matchId = this.$store.getters.getMatchId;
  201. this.$store.dispatch("SET_BETTING", []); //设置默认值
  202. this.getAjax();
  203. this.gteTitle(this.ballCode, this.activity);
  204. this.$store.dispatch("SET_BETTINGTYPE", 1);
  205. let _this = this;
  206. this.$public.ajaxTimerFun(timing => {
  207. if (_this.timers) {
  208. _this.getAjax();
  209. } else {
  210. clearInterval(timing);
  211. }
  212. }, 10000);
  213. },
  214. beforeDestroy() {
  215. this.timers = false;
  216. },
  217. /***
  218. * 方法
  219. */
  220. methods: {
  221. /*------------------------------------------------ */
  222. //玩法数据请求
  223. getAjax() {
  224. let type = this.activity == "StRollBall" ? 2 : 1;
  225. let data = {
  226. game_code: this.ballCode,
  227. matchID: this.matchId,
  228. status: type,
  229. oddsType: this.activity
  230. };
  231. this.$http.get(this.$ports.gambling.matchOdds, data).then(res => {
  232. if (res.data.status == 1) {
  233. this.data = res.data.data;
  234. let arrayData = [];
  235. let palyCode = this.$store.getters.getPlayAlias;
  236. let key = ["所有盘口"];
  237. // console.log(this.data.p_code_array);
  238. // console.log('1231231',palyCode);
  239. this.data.p_code_array.forEach((e, index) => {
  240. let palyData = [];
  241. //组合玩法title
  242. palyCode.forEach(p => {
  243. // console.log(e,this.ballCode );
  244. if (e == p.odds_code && p.game_code == this.ballCode) {
  245. key.push(p.odds_name);
  246. }
  247. });
  248. //玩法数据分类
  249. this.data.oddsData.forEach(val => {
  250. if (e == val.p_code) {
  251. palyData.push(val);
  252. }
  253. arrayData[index] = palyData;
  254. });
  255. });
  256. //处理赛事比分信息
  257. this.scoreDetails = JSON.parse(this.data.result_mark);
  258. this.scoreDetails.schedule = this.scoreDetails.schedule.replace(/[^0-9]/ig,"");
  259. console.log(this.scoreDetails);
  260. let numArray = [];
  261. // this.scoreDetails.ps.forEach((e,index)=>{
  262. // if(e.p=='ft'){
  263. // this.scoreDetails.ft = e;
  264. // numArray.push(index);
  265. // }
  266. // if(e.p=='ftg'){
  267. // this.scoreDetails.ftg = e;
  268. // numArray.push(index);
  269. // }
  270. // if(e.p=='p'){
  271. // this.scoreDetails.p = e;
  272. // numArray.push(index);
  273. // }
  274. // })
  275. numArray.forEach((e,index)=>{
  276. if(index == 1){
  277. if(numArray[0] < numArray[1]){
  278. this.scoreDetails.ps.splice(e - 1,1)
  279. }else{
  280. this.scoreDetails.ps.splice(e,1)
  281. }
  282. }else if(index == 2){
  283. if(numArray[1] < numArray[2]){
  284. this.scoreDetails.ps.splice(e - 2,1)
  285. }else if(numArray[1] > numArray[2] && numArray[0] < numArray[2]){
  286. this.scoreDetails.ps.splice(e - 1,1)
  287. }else if(numArray[1] > numArray[2] && numArray[0] > numArray[2]){
  288. this.scoreDetails.ps.splice(e,1)
  289. }
  290. }else{
  291. this.scoreDetails.ps.splice(e,1)
  292. }
  293. })
  294. // console.log(arrayData);
  295. //更新数据和上一次的数据匹配
  296. if (
  297. this.previousStorage &&
  298. this.previousStorage.match_id == this.data.match_id &&
  299. this.previousStorage.oddsData.length > 0
  300. ) {
  301. this.$public.oddsDataUpdate(
  302. arrayData,
  303. this.previousStorage.oddsData,
  304. 2
  305. );
  306. }
  307. this.data.oddsData = arrayData;
  308. //储存临时数据
  309. this.previousStorage = this.data;
  310. //rising=上升、falling=下降
  311. this.$store.dispatch("GETGAMERATIO", this.data);
  312. this.key = key;
  313. // console.log(key);
  314. console.log("wq", this.data);
  315. }
  316. });
  317. },
  318. /*---------------------------------------------- */
  319. //获取头部title数据
  320. gteTitle(data, type) {
  321. if (data == "zq") {
  322. this.title = "足球";
  323. } else if (data == "lq") {
  324. this.title = "蓝球";
  325. } else if (data == "wq") {
  326. this.title = "网球";
  327. } else if (data == "bq") {
  328. this.title = "棒球";
  329. }
  330. },
  331. /*--------------------------------------------- */
  332. /**
  333. * 切换玩法类型
  334. */
  335. toggleNav: function(index) {
  336. this.active = index;
  337. if (this.key[index] == "所有盘口") {
  338. this.isAll = true;
  339. } else {
  340. this.isAll = false;
  341. this.Single = this.key[index];
  342. }
  343. },
  344. /*--------------------------------------------- */
  345. /**
  346. * 切换玩法类型
  347. */
  348. returnEvent: function() {
  349. this.$store.dispatch("SET_CONTROLROUTING", "10003");
  350. // this.$store.dispatch("SET_RETURN_EVENT",1);
  351. //console.log(this.$store.getters.getReturnEvent);
  352. }
  353. },
  354. /**
  355. * 计算属性
  356. */
  357. computed: {},
  358. /**
  359. * 监听器
  360. */
  361. watch: {}
  362. };
  363. </script>
  364. <style scoped>
  365. .header {
  366. background: #4b4b4b;
  367. }
  368. .header .title {
  369. font-size: 0.18rem;
  370. /* color: #f76649; */
  371. padding: 0 0.2rem;
  372. /* font-weight: 700; */
  373. height: 0.6rem;
  374. line-height: 0.4rem;
  375. display: flex;
  376. justify-content: space-between;
  377. align-items: center;
  378. }
  379. .header-title {
  380. display: inline-block;
  381. padding: 0 0.05rem;
  382. height: 0.4rem;
  383. text-align: center;
  384. line-height: 0.4rem;
  385. background: #ededed;
  386. color: #f4755b;
  387. border-radius: 0.05rem;
  388. }
  389. .header-title::after {
  390. border-width: 0.08rem;
  391. border-left-color: #ededed;
  392. border-top-color: #ededed;
  393. transform: rotate(135deg);
  394. right: -9%;
  395. top: 28%;
  396. }
  397. .title .backSingPage {
  398. display: inline-block;
  399. background: url("../assets/st-imges/returnimg.png") no-repeat;
  400. /* filter: brightness(2); */
  401. background-size: 100% 100%;
  402. height: 0.28rem;
  403. width: 0.28rem;
  404. vertical-align: middle;
  405. margin-right: 0.16rem;
  406. cursor: pointer;
  407. }
  408. .title {
  409. background: #ababab;
  410. color: #333;
  411. }
  412. .title .backSingPage:hover,
  413. .refresh:hover {
  414. filter: brightness(2);
  415. }
  416. .redraw {
  417. width: 0.3rem;
  418. height: 0.3rem;
  419. background: #666;
  420. cursor: pointer;
  421. text-align: center;
  422. border-radius: 0.05rem;
  423. }
  424. .redraw:hover {
  425. background: #959595;
  426. color: #fff;
  427. }
  428. .refresh {
  429. background: url("../assets/st-imges/redraw.png") no-repeat;
  430. background-size: 100% 100%;
  431. display: inline-block;
  432. width: 0.2rem;
  433. height: 0.2rem;
  434. }
  435. /* 普通赛事头部 */
  436. .ordinaryHead {
  437. background: url("../assets/st-imges/football.png") no-repeat;
  438. background-size: 100% 100%;
  439. /* padding: 0.04rem; */
  440. height: 0.6rem;
  441. line-height: 0.6rem;
  442. }
  443. .ordinaryHead .match {
  444. color: #fff;
  445. }
  446. .ordinaryHead .match .info {
  447. padding: 0 0.2rem;
  448. display: flex;
  449. justify-content: space-between;
  450. align-items: center;
  451. }
  452. .match .time {
  453. font-weight: 400;
  454. color: #bd4700;
  455. margin-left: 0.05rem;
  456. }
  457. .live-score {
  458. padding: 0 8%;
  459. }
  460. .NavSlide {
  461. width: 100%;
  462. overflow: hidden;
  463. font-size: 0.16rem;
  464. height: 0.4rem;
  465. background: #898989;
  466. color: #cdcdcd;
  467. }
  468. .NavSlide nav {
  469. display: -webkit-box;
  470. display: -ms-flexbox;
  471. display: flex;
  472. -webkit-box-align: middle;
  473. -ms-flex-align: middle;
  474. align-items: middle;
  475. overflow: auto;
  476. }
  477. .NavSlide div {
  478. text-align: center;
  479. /* font-size: 0.28rem; */
  480. -ms-flex-negative: 0;
  481. flex-shrink: 0;
  482. padding: 0 0.1rem;
  483. color: #fff;
  484. cursor: pointer;
  485. }
  486. .active {
  487. color: #f76649;
  488. font-weight: 700;
  489. }
  490. .scroll::-webkit-scrollbar {
  491. width: 0;
  492. height: 0;
  493. }
  494. .list {
  495. line-height: 0.4rem;
  496. padding: 0 0.1rem;
  497. color: #fff;
  498. }
  499. .header {
  500. background: #4b4b4b;
  501. }
  502. .header .title {
  503. font-size: 0.18rem;
  504. color: #fe9200;
  505. padding: 0 0.2rem;
  506. font-weight: 700;
  507. height: 0.6rem;
  508. line-height: 0.4rem;
  509. display: flex;
  510. justify-content: space-between;
  511. align-items: center;
  512. }
  513. .title .backSingPage {
  514. display: inline-block;
  515. background: url("../assets/st-imges/returnimg.png") no-repeat;
  516. background-size: 100% 100%;
  517. height: 0.28rem;
  518. width: 0.28rem;
  519. vertical-align: middle;
  520. margin-right: 0.16rem;
  521. cursor: pointer;
  522. }
  523. .title .backSingPage:hover,
  524. .refresh:hover {
  525. filter: brightness(1.5);
  526. }
  527. .redraw {
  528. width: 0.3rem;
  529. height: 0.3rem;
  530. background: #666;
  531. cursor: pointer;
  532. text-align: center;
  533. border-radius: 0.05rem;
  534. }
  535. .redraw:hover {
  536. background: #959595;
  537. color: #fff;
  538. }
  539. .refresh {
  540. background: url("../assets/st-imges/redraw.png") no-repeat;
  541. background-size: 100% 100%;
  542. display: inline-block;
  543. width: 0.2rem;
  544. height: 0.2rem;
  545. }
  546. /* 网球头部 */
  547. .tennisHead {
  548. background: url("../assets/st-imges/tennisball.png") no-repeat;
  549. background-size: 100% 100%;
  550. width: 100%;
  551. height: auto;
  552. }
  553. .match {
  554. color: #fff;
  555. height: auto;
  556. }
  557. .match .tit {
  558. height: 0.32rem;
  559. line-height: 0.32rem;
  560. /* margin-top: -4px; */
  561. }
  562. .ballTable {
  563. background: rgba(0, 0, 0, 0.2);
  564. }
  565. .listHead {
  566. padding: 0 0.1rem;
  567. line-height: 0.5rem;
  568. background: rgba(0, 0, 0, 0.15);
  569. color: #fff;
  570. }
  571. .listHead .spanCol{
  572. color: orange;
  573. }
  574. .sumCl {
  575. color: #ff0;
  576. }
  577. .welcome {
  578. height: 0.5rem;
  579. line-height: 0.5rem;
  580. font-size: 0.16rem;
  581. padding: 0 0.1rem;
  582. background: #898989;
  583. color: #fff;
  584. }
  585. .headerTop {
  586. width: 50%;
  587. }
  588. .score {
  589. width: 50%;
  590. }
  591. .score span {
  592. display: inline-block;
  593. width: 0.3rem;
  594. text-align: center;
  595. }
  596. .score span.mg-5 {
  597. width: 0.7rem;
  598. }
  599. .headerTop span {
  600. display: inline-block;
  601. width: 0.3rem;
  602. text-align: center;
  603. }
  604. .headerTop span.mg-5 {
  605. width: 0.7rem;
  606. }
  607. .mark {
  608. background: hsla(0, 0%, 100%, 0.25);
  609. }
  610. .list {
  611. background: hsla(0, 0%, 100%, 0.2);
  612. }
  613. </style>