bf75a9be5c4f0a284c3c043d48a6a96a73ecedfd.svn-base 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  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="bqHead zqHead">
  19. <div class="pd-10">
  20. <div class="match">
  21. <div class="tit">
  22. <span>{{data.leagueName}}</span>
  23. <div>
  24. <span class="scene">{{data.match_ptime}}</span>
  25. &nbsp;
  26. <span class="time">{{data.match_time}}</span>
  27. </div>
  28. </div>
  29. <div class="info">
  30. <span>{{data.home_team}}</span>
  31. <span class="live-score">{{data.match_score? data.match_score:'0 - 0' }}</span>
  32. <span>{{data.guest_team}}</span>
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. <div class="welcome row NavSlide">
  38. <nav class="scroll">
  39. <div class="row center" v-for="(itme,$index) in key" @click="toggleNav($index)">
  40. <span :class="{active:$index == active}">{{itme}}</span>
  41. </div>
  42. </nav>
  43. </div>
  44. </div>
  45. <div class="cont">
  46. <!-- <div class="letball"> -->
  47. <!-- 让球 -->
  48. <div v-show=" Single =='让球'|| isAll">
  49. <concede/>
  50. </div>
  51. <!-- 进球:大/小 -->
  52. <div v-show=" Single =='进球:大/小'|| isAll">
  53. <goalsSize/>
  54. </div>
  55. <!-- 总分:大/小 -->
  56. <div v-show=" Single =='总分:大/小'|| isAll">
  57. <totalScore/>
  58. </div>
  59. <!-- <letBall/> -->
  60. <!-- 独赢 -->
  61. <div v-show=" Single =='独赢'|| isAll">
  62. <winAlone/>
  63. </div>
  64. <!-- 波胆 -->
  65. <div v-show=" Single =='波胆'|| isAll">
  66. <waveBladder/>
  67. </div>
  68. <!-- 总进球 -->
  69. <div v-show=" Single =='总进球数'|| isAll">
  70. <sumGoal/>
  71. </div>
  72. <!-- 首粒入球-- -->
  73. <div v-show=" Single =='首粒入球/最后一粒入球'|| isAll">
  74. <goalEntry/>
  75. </div>
  76. <!-- 半场/全场 -->
  77. <div v-show=" Single =='半场/全场'|| isAll">
  78. <halfCount/>
  79. </div>
  80. <!-- 总分:单双 -->
  81. <div v-show="( Single =='总分:单双'|| Single =='进球:单/双' )|| isAll">
  82. <scoreSingleDouble/>
  83. </div>
  84. <!-- 球队进球数:大/小 -->
  85. <div v-show=" Single =='球队进球数:大/小'|| isAll">
  86. <teamGoalsSize/>
  87. </div>
  88. <!-- 球队得分:大/小 足球不显示得分大小-->
  89. <!-- <div v-show=" Single =='球队得分:大/小'|| isAll">
  90. <teamTotalScoreSize/>
  91. </div> -->
  92. <!-- 角球 -->
  93. <!-- <corner/> -->
  94. <!-- 进球 -->
  95. <!-- <goal/> -->
  96. <!-- 进球半场 -->
  97. <!-- <goalHalfCourt/> -->
  98. <!-- 让盘 -->
  99. <!-- <letPlate/> -->
  100. <!-- 球队得分 -->
  101. <score/>
  102. </div>
  103. </div>
  104. </template>
  105. <script>
  106. import "@/css/index.css";
  107. // import letBall from "@/components/betting/letBall";
  108. import goalsSize from "@/components/betting/goalsSize";
  109. import teamGoalsSize from "@/components/betting/teamGoalsSize";
  110. import teamTotalScoreSize from "@/components/betting/teamTotalScoreSize";
  111. import scoreSingleDouble from "@/components/betting/scoreSingleDouble";
  112. import winAlone from "@/components/betting/winAlone";
  113. import sumGoal from "@/components/betting/sumGoal";
  114. import waveBladder from "@/components/betting/waveBladder";
  115. import goalEntry from "@/components/betting/goalEntry";
  116. // import corner from "@/components/betting/corner";
  117. import halfCount from "@/components/betting/halfCount";
  118. import concede from "@/components/betting/concede";
  119. // import goal from "@/components/betting/goal";
  120. // import goalHalfCourt from "@/components/betting/goalHalfCourt";
  121. // import letPlate from "@/components/betting/letPlate";
  122. import totalScore from "@/components/betting/totalScore";
  123. import score from "@/components/betting/score";
  124. export default {
  125. data() {
  126. return {
  127. activity: "", //活动代码
  128. active: 0, // 投注页是否打开
  129. ballCode: "", //球类代码
  130. matchId: "", //赛事idd
  131. data: [], //赛事数据源
  132. previousStorage: "", //前一次data储存数据
  133. title: "", //
  134. key: "", //玩法名字
  135. Single: "", //
  136. isAll: true, //
  137. timers:true,
  138. };
  139. },
  140. components: {
  141. // letBall,
  142. goalsSize,
  143. winAlone,
  144. sumGoal,
  145. waveBladder,
  146. goalEntry,
  147. // corner,
  148. halfCount,
  149. concede,
  150. // goal,
  151. // goalHalfCourt,
  152. // letPlate,
  153. totalScore,
  154. score,
  155. scoreSingleDouble,
  156. teamGoalsSize,
  157. teamTotalScoreSize
  158. },
  159. /**
  160. * 页面加载完成挂载
  161. */
  162. mounted() {
  163. this.activity = this.$store.getters.getActivity;
  164. this.ballCode = this.$store.getters.getBallCode;
  165. this.matchId = this.$store.getters.getMatchId;
  166. this.$store.dispatch("SET_BETTING", []); //设置默认值
  167. this.getAjax();
  168. this.gteTitle(this.ballCode, this.activity);
  169. this.$store.dispatch("SET_BETTINGTYPE", 1);
  170. let _this = this;
  171. this.$public.ajaxTimerFun((timing)=>{
  172. if(_this.timers){
  173. _this.getAjax()
  174. }else{
  175. clearInterval(timing)
  176. }
  177. },10000)
  178. },
  179. beforeDestroy(){
  180. this.timers = false
  181. },
  182. /***
  183. * 方法
  184. */
  185. methods: {
  186. /*------------------------------------------------ */
  187. //玩法数据请求
  188. getAjax() {
  189. let type = this.activity == "StRollBall" ? 2 : 1;
  190. let data = {
  191. game_code: this.ballCode,
  192. matchID: this.matchId,
  193. status: type,
  194. oddsType: this.activity
  195. };
  196. this.$http.get(this.$ports.gambling.matchOdds, data).then(res => {
  197. if (res.data.status == 1) {
  198. this.data = res.data.data;
  199. let arrayData = [];
  200. let palyCode = this.$store.getters.getPlayAlias;
  201. let key = ["所有盘口"];
  202. this.data.p_code_array.forEach((e, index) => {
  203. let palyData = [];
  204. //组合玩法title
  205. palyCode.forEach(p => {
  206. if (e == p.odds_code && p.game_code == this.ballCode) {
  207. key.push(p.odds_name);
  208. }
  209. });
  210. //玩法数据分类
  211. this.data.oddsData.forEach(val => {
  212. if (e == val.p_code) {
  213. palyData.push(val);
  214. }
  215. arrayData[index] = palyData;
  216. });
  217. });
  218. // console.log(arrayData);
  219. //更新数据和上一次的数据匹配
  220. if(this.previousStorage && this.previousStorage.match_id == this.data.match_id && this.previousStorage.oddsData.length > 0){
  221. this.$public.oddsDataUpdate(arrayData,this.previousStorage.oddsData,2);
  222. }
  223. this.data.oddsData = arrayData;
  224. //储存临时数据
  225. this.previousStorage = this.data
  226. //rising=上升、falling=下降
  227. this.$store.dispatch("GETGAMERATIO", this.data);
  228. this.key = key;
  229. // console.log(key);
  230. //console.log(arrayData);
  231. }
  232. });
  233. },
  234. /*---------------------------------------------- */
  235. //获取头部title数据
  236. gteTitle(data, type) {
  237. if (data == "zq") {
  238. this.title = "足球";
  239. } else if (data == "lq") {
  240. this.title = "蓝球";
  241. } else if (data == "wq") {
  242. this.title = "网球";
  243. } else if (data == "bq") {
  244. this.title = "棒球";
  245. }
  246. },
  247. /*--------------------------------------------- */
  248. /**
  249. * 切换玩法类型
  250. */
  251. toggleNav: function(index) {
  252. this.active = index;
  253. if (this.key[index] == "所有盘口") {
  254. this.isAll = true;
  255. } else {
  256. this.isAll = false;
  257. this.Single = this.key[index];
  258. }
  259. },
  260. /*--------------------------------------------- */
  261. /**
  262. * 返回上一级
  263. */
  264. returnEvent: function() {
  265. this.$store.dispatch("SET_CONTROLROUTING", "StRollBall");
  266. // this.$store.dispatch("SET_RETURN_EVENT",1);
  267. //console.log(this.$store.getters.getReturnEvent);
  268. }
  269. },
  270. /**
  271. * 计算属性
  272. */
  273. computed: {},
  274. /**
  275. * 监听器
  276. */
  277. watch: {}
  278. };
  279. </script>
  280. <style scoped>
  281. .header {
  282. background: #4b4b4b;
  283. }
  284. .header .title {
  285. font-size: 0.18rem;
  286. /* color: #f76649; */
  287. padding: 0 0.2rem;
  288. /* font-weight: 700; */
  289. height: 0.6rem;
  290. line-height: 0.4rem;
  291. display: flex;
  292. justify-content: space-between;
  293. align-items: center;
  294. }
  295. .header-title{
  296. display: inline-block;
  297. /* width: .6rem; */
  298. height: .4rem;
  299. padding: 0 0.1rem;
  300. text-align: center;
  301. line-height: .4rem;
  302. background: #ededed;
  303. color: #f4755b;
  304. border-radius: .05rem;
  305. }
  306. .header-title::after{
  307. border-width:.08rem;
  308. border-left-color: #ededed;
  309. border-top-color: #ededed;
  310. transform: rotate(135deg);
  311. /* right: -12%; */
  312. top: 28%;
  313. }
  314. .title .backSingPage {
  315. display: inline-block;
  316. background: url("../assets/st-imges/returnimg.png") no-repeat;
  317. /* filter: brightness(2); */
  318. background-size: 100% 100%;
  319. height: 0.28rem;
  320. width: 0.28rem;
  321. vertical-align: middle;
  322. margin-right: 0.16rem;
  323. cursor: pointer;
  324. }
  325. .title {
  326. background: #ababab;
  327. color: #333;
  328. }
  329. .title .backSingPage:hover,
  330. .refresh:hover {
  331. filter: brightness(2);
  332. }
  333. .redraw {
  334. width: 0.3rem;
  335. height: 0.3rem;
  336. background: #666;
  337. cursor: pointer;
  338. text-align: center;
  339. border-radius: 0.05rem;
  340. }
  341. .redraw:hover {
  342. background: #959595;
  343. color: #fff;
  344. }
  345. .refresh {
  346. background: url("../assets/st-imges/redraw.png") no-repeat;
  347. background-size: 100% 100%;
  348. display: inline-block;
  349. width: 0.2rem;
  350. height: 0.2rem;
  351. }
  352. /* 普通赛事头部 */
  353. .ordinaryHead {
  354. background: url("../assets/st-imges/football.png") no-repeat;
  355. background-size: 100% 100%;
  356. /* padding: 0.04rem; */
  357. height: 0.6rem;
  358. line-height: 0.6rem;
  359. }
  360. .ordinaryHead .match {
  361. color: #fff;
  362. }
  363. .ordinaryHead .match .info {
  364. padding: 0 0.2rem;
  365. display: flex;
  366. justify-content: space-between;
  367. align-items: center;
  368. }
  369. .match .time {
  370. font-weight: 400;
  371. color: #bd4700;
  372. margin-left: 0.05rem;
  373. }
  374. .live-score {
  375. padding: 0 8%;
  376. }
  377. .NavSlide {
  378. width: 100%;
  379. overflow: hidden;
  380. font-size: 0.16rem;
  381. height: 0.4rem;
  382. background: #898989;
  383. color: #cdcdcd;
  384. }
  385. .NavSlide nav {
  386. display: -webkit-box;
  387. display: -ms-flexbox;
  388. display: flex;
  389. -webkit-box-align: middle;
  390. -ms-flex-align: middle;
  391. align-items: middle;
  392. overflow: auto;
  393. }
  394. .NavSlide div {
  395. text-align: center;
  396. /* font-size: 0.28rem; */
  397. -ms-flex-negative: 0;
  398. flex-shrink: 0;
  399. padding: 0 0.1rem;
  400. color: #fff;
  401. cursor: pointer;
  402. }
  403. /* #NavSlide p a{
  404. color: #E5E5E5;
  405. text-decoration: none;
  406. } */
  407. .active {
  408. color: #f76649;
  409. font-weight: 700;
  410. }
  411. .scroll::-webkit-scrollbar {
  412. width: 0;
  413. height: 0;
  414. }
  415. /* 棒球头部 */
  416. .bqHead {
  417. background: url("../assets/st-imges/baseball.png") no-repeat;
  418. background-size: 100% 100%;
  419. font-size: 0.18rem;
  420. }
  421. .zqHead {
  422. color: #fff;
  423. background: url("../assets/st-imges/football.png") no-repeat;
  424. background-size: 100% 100%;
  425. font-size: 0.18rem;
  426. }
  427. .bqHead .pd-10 {
  428. padding: 0.1rem;
  429. }
  430. .bqHead .tit {
  431. display: flex;
  432. align-items: center;
  433. justify-content: space-between;
  434. }
  435. .match .info {
  436. background: rgba(0, 0, 0, 0.5);
  437. height: 0.52rem;
  438. line-height: 0.52rem;
  439. font-size: 15px;
  440. text-align: center;
  441. font-size: 0.18rem;
  442. }
  443. .match .info .pk,
  444. .match .tit .scene {
  445. font-weight: bold;
  446. color: rgb(254, 146, 0);
  447. }
  448. .tit .time {
  449. color: #bd4700;
  450. }
  451. .welcome {
  452. height: 0.36rem;
  453. line-height: 0.36rem;
  454. font-size: 0.16rem;
  455. padding: 0 0.1rem;
  456. background: #4e4e4e;
  457. color: black;
  458. }
  459. </style>