30030f0f8dbd4fda0f6c5b8cb3efb4b04cf6487d.svn-base 17 KB

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