b3822d93dc8e4d5d7da478c890a06d1695e58f16.svn-base 13 KB

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