19abb016200acd7c2c798b5f037ca918f0bd42ba.svn-base 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951
  1. <template>
  2. <div>
  3. <div>
  4. <div class="Serch row item-center">
  5. <div class="Soccer-game row item-center">
  6. <div
  7. style=" display:flex;align-items:center;justify-content:center;"
  8. class="Soccer-game-title"
  9. @click="isreturn()"
  10. >
  11. <img class="box-img" src="../assets/st-imges/returnbox.png" />
  12. {{this.title}}
  13. </div>
  14. </div>
  15. <div class="Serch-box row item-center">
  16. <div class="Serch-box-home row item-center">
  17. <img class="Serch-box-img" src="../assets/st-imges/sousuo.png" />
  18. <input
  19. v-model="SerchValue"
  20. @keydown="serchchange(SerchValue)"
  21. @input="searchTeam(SerchValue)"
  22. class="Serch-box-input"
  23. type="text"
  24. placeholder="请输入球队名称"
  25. />
  26. <img
  27. class="Serch-box-del"
  28. @click="delinputvalue()"
  29. v-if="Serchchange==true"
  30. src="../assets/st-imges/del.png"
  31. />
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. <div>
  37. <div v-for="(ite,$index) in data" :key="ite.id">
  38. <div class="row allAlignment box center">
  39. <span>{{ite.name_chinese}}</span>
  40. <div class="Match-title-num">
  41. <span>{{ite.count}}</span>
  42. </div>
  43. </div>
  44. <!-- 足球与篮球 -->
  45. <div
  46. v-if="ballSelt == 10"
  47. v-for=" (item,index) in ite.match_info"
  48. :key="index"
  49. class="Match-box"
  50. >
  51. <div class="row allAlignment Match-box-top">
  52. <div class="Match-box-top-left">
  53. <span>{{item.match_date}}</span>
  54. <span>{{item.match_time}}</span>
  55. </div>
  56. <div class="Match-box-top-right row">
  57. <span style="margin-right: .15rem;" class="Match-box-top-num">{{item.tag}}</span>
  58. <span style="margin-right: .15rem;">让球</span>
  59. <span style="margin-right: .15rem;">大小</span>
  60. </div>
  61. </div>
  62. <div
  63. class="row allAlignment center"
  64. @click="matchInfo(item.match_id);"
  65. style="padding:0 .32rem"
  66. >
  67. <div class="column average name-box">
  68. <div>{{item.home_team}}</div>
  69. <div>{{item.guest_team}}</div>
  70. </div>
  71. <div class="Match-bottom-right">
  72. <!-- 主队 -->
  73. <div v-for="(items,indexs) in item.oddsData" :key="indexs">
  74. <!-- 让球 -->
  75. <div class v-if="items.odds_code.startsWith('co')">
  76. <div
  77. :class="{active:items.isTrue,increased_color:items.change == 'add',reduce_color:items.change == 'red'}"
  78. class="letballHome" v-if="items.odds_code.endsWith('h')"
  79. @click.stop="isBetting($index,item,items,item.home_team,'让球')" >
  80. <span style="color: rgb(247, 102, 73); " v-if="items.odds > 0" >{{items.condition}}</span>
  81. <span v-if="items.odds >0" :class="items.condition == '' ? 'mg':''" >{{items.odds}}</span>
  82. <img v-if="items.odds <= 0" style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"/>
  83. <img />
  84. </div>
  85. <div
  86. :class="{active:items.isTrue,increased_color:items.change == 'add',reduce_color:items.change == 'red'}"
  87. class="letballGuest" v-if="items.odds_code.endsWith('g')"
  88. @click.stop="isBetting($index,item,items,item.guest_team,'让球')">
  89. <span style="color: rgb(247, 102, 73); " v-if="items.odds > 0">{{items.condition}}</span>
  90. <span v-if="items.odds >0" :class="items.condition == '' ? 'mg':''" >{{items.odds}}</span>
  91. <img
  92. v-if="items.odds <= 0"
  93. style="width: 0.7rem;height: 0.5rem;"
  94. src="@/assets/st-imges/mima.png"
  95. />
  96. <img />
  97. </div>
  98. </div>
  99. <!-- 足球 大小-->
  100. <div v-if="items.odds_code.startsWith('gs')" class="row bigSmall">
  101. <div
  102. :class="{active:items.isTrue,increased_color:items.change == 'add',reduce_color:items.change == 'red'}"
  103. class="bigHome"
  104. v-if="items.odds_code.endsWith('b')"
  105. @click.stop="isBetting($index,item,items,'大','大小')"
  106. >
  107. <div style="color: rgb(247, 102, 73); " class="stardBig" v-if="items.odds > 0">
  108. <span class="bigSmall">大</span>
  109. <span>{{items.condition}}</span>
  110. </div>
  111. <span
  112. v-if="items.odds >0"
  113. :class="items.condition == '' ? 'mg':''"
  114. >{{items.odds}}</span>
  115. <img
  116. v-if="items.odds <= 0"
  117. style="width: 0.7rem;height: 0.5rem;"
  118. src="@/assets/st-imges/mima.png"
  119. />
  120. <img />
  121. </div>
  122. <div
  123. :class="{active:items.isTrue,increased_color:items.change == 'add',reduce_color:items.change == 'red'}"
  124. class="bigGuest"
  125. v-if="items.odds_code.endsWith('s')"
  126. @click.stop="isBetting($index,item,items,'小','大小')"
  127. >
  128. <div style="color: rgb(247, 102, 73); " class="stardBig" v-if="items.odds > 0">
  129. <span class="bigSmall">小</span>
  130. <span>{{items.condition}}</span>
  131. </div>
  132. <span
  133. v-if="items.odds >0"
  134. :class="items.condition == '' ? 'mg':''"
  135. >{{items.odds}}</span>
  136. <img
  137. v-if="items.odds <= 0"
  138. style="width: 0.7rem;height: 0.5rem;"
  139. src="@/assets/st-imges/mima.png"
  140. />
  141. <img />
  142. </div>
  143. </div>
  144. <div v-if="items.odds_code.startsWith('tn')" class="row bigSmall">
  145. <div
  146. :class="{active:items.isTrue,increased_color:items.change == 'add',reduce_color:items.change == 'red'}"
  147. class="bigHome" v-if="items.odds_code == 'tnb'"
  148. @click.stop="isBetting($index,item,items,'大','大小')" >
  149. <div style="color: rgb(247, 102, 73); " class="stardBig" v-if="items.odds > 0">
  150. <span class="bigSmall">大</span>
  151. <span>{{items.condition}}</span>
  152. </div>
  153. <span v-if="items.odds >0" :class="items.condition == '' ? 'mg':''" >{{items.odds}}</span>
  154. <img v-if="items.odds <= 0"style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png" />
  155. </div>
  156. <div
  157. :class="{active:items.isTrue,increased_color:items.change == 'add',reduce_color:items.change == 'red'}"
  158. class="bigGuest" v-if="items.odds_code == 'tns'"
  159. @click.stop="isBetting($index,item,items,'小','大小')">
  160. <div style="color: rgb(247, 102, 73); " class="stardBig" v-if="items.odds > 0">
  161. <span class="bigSmall">小</span>
  162. <span>{{items.condition}}</span>
  163. </div>
  164. <span v-if="items.odds >0" :class="items.condition == '' ? 'mg':''" >{{items.odds}}</span>
  165. <img v-if="items.odds <= 0" style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"/>
  166. </div>
  167. </div>
  168. </div>
  169. </div>
  170. </div>
  171. </div>
  172. <!-- 网球 -->
  173. <div
  174. v-if="ballSelt == 100"
  175. v-for=" (item,index) in ite.match_info"
  176. :key="index"
  177. class="Match-box"
  178. >
  179. <div class="row allAlignment Match-box-top wqMatch-box">
  180. <div class="Match-box-top-left">
  181. <span>{{item.match_date}}</span>
  182. <span style="color: rgb(253, 143, 38);">{{item.match_time}}</span>
  183. <!-- <div>三盘两胜</div> -->
  184. </div>
  185. <div class="Match-box-top-right row">
  186. <span
  187. style="margin-right: .15rem;height:100%;line-height:0.6rem;"
  188. class="Match-box-top-num"
  189. >{{item.tag}}</span>
  190. <span style="margin-right: .15rem;">独赢盘</span>
  191. <span style="margin-right: .15rem;">让盘</span>
  192. </div>
  193. </div>
  194. <div
  195. class="row allAlignment center"
  196. @click="matchInfo(item.match_id);"
  197. style="padding:0 .32rem"
  198. >
  199. <div class="column average name-box">
  200. <div>{{item.home_team}}</div>
  201. <div>{{item.guest_team}}</div>
  202. </div>
  203. <div class="Match-bottom-right">
  204. <!-- 主队 -->
  205. <div class v-for="(items,indexs) in item.oddsData" :key="indexs">
  206. <div class v-if="items.odds_code.startsWith('c')">
  207. <div
  208. :class="{active:items.isTrue,increased_color:items.change == 'add',reduce_color:items.change == 'red'}"
  209. class="letballHome"
  210. v-if="items.odds_code == 'ch'"
  211. @click.stop="isBetting($index,item,items,item.home_team,'独赢盘')"
  212. >
  213. <span
  214. style="color: rgb(247, 102, 73); "
  215. v-if="items.odds > 0"
  216. >{{items.condition}}</span>
  217. <span
  218. v-if="items.odds >0"
  219. :class="items.condition == '' ? 'mg':''"
  220. >{{items.odds}}</span>
  221. <img
  222. v-if="items.odds <= 0"
  223. style="width: 0.7rem;height: 0.5rem;"
  224. src="@/assets/st-imges/mima.png"
  225. />
  226. </div>
  227. <div
  228. :class="{active:items.isTrue,increased_color:items.change == 'add',reduce_color:items.change == 'red'}"
  229. class="letballGuest"
  230. v-if="items.odds_code == 'cg'"
  231. @click.stop="isBetting($index,item,items,item.guest_team,'独赢盘')"
  232. >
  233. <span
  234. style="color: rgb(247, 102, 73); "
  235. v-if="items.odds > 0"
  236. >{{items.condition}}</span>
  237. <span
  238. v-if="items.odds >0"
  239. :class="items.condition == '' ? 'mg':''"
  240. >{{items.odds}}</span>
  241. <img
  242. v-if="items.odds <= 0"
  243. style="width: 0.7rem;height: 0.5rem;"
  244. src="@/assets/st-imges/mima.png"
  245. />
  246. </div>
  247. </div>
  248. <!-- 让盘 -->
  249. <div
  250. v-if="items.odds_code.startsWith('ld')"
  251. class="row bigSmall"
  252. @click.stop="isBetting($index,item,items,item.home_team,'让盘')"
  253. >
  254. <div
  255. :class="{active:items.isTrue,increased_color:items.change == 'add',reduce_color:items.change == 'red'}"
  256. class="bigHome"
  257. v-if="items.odds_code == 'ldh'"
  258. >
  259. <span
  260. style="color: rgb(247, 102, 73); "
  261. v-if="items.odds > 0"
  262. >{{items.condition}}</span>
  263. <span
  264. v-if="items.odds >0"
  265. :class="items.condition == '' ? 'mg':''"
  266. >{{items.odds}}</span>
  267. <img
  268. v-if="items.odds <= 0"
  269. style="width: 0.7rem;height: 0.5rem;"
  270. src="@/assets/st-imges/mima.png"
  271. />
  272. <img />
  273. </div>
  274. <div
  275. :class="{active:items.isTrue,increased_color:items.change == 'add',reduce_color:items.change == 'red'}"
  276. class="bigGuest"
  277. v-if="items.odds_code == 'ldg'"
  278. @click.stop="isBetting($index,item,items,item.guest_team,'让盘')"
  279. >
  280. <span
  281. style="color: rgb(247, 102, 73); "
  282. v-if="items.odds > 0"
  283. >{{items.condition}}</span>
  284. <span
  285. v-if="items.odds >0"
  286. :class="items.condition == '' ? 'mg':''"
  287. >{{items.odds}}</span>
  288. <img
  289. v-if="items.odds <= 0"
  290. style="width: 0.7rem;height: 0.5rem;"
  291. src="@/assets/st-imges/mima.png"
  292. />
  293. <img />
  294. </div>
  295. </div>
  296. </div>
  297. </div>
  298. </div>
  299. </div>
  300. <!-- 棒球 -->
  301. <div
  302. v-if="ballSelt == 1000"
  303. v-for=" (item,index) in ite.match_info"
  304. :key="index"
  305. class="Match-box"
  306. >
  307. <div class="row allAlignment Match-box-top">
  308. <div class="Match-box-top-left">
  309. <span>{{item.match_date}}</span>
  310. <span>{{item.match_time}}</span>
  311. </div>
  312. <div class="Match-box-top-right row">
  313. <span style="margin-right: .15rem;" class="Match-box-top-num">{{item.tag}}</span>
  314. <span style="margin-right: .15rem;">独赢盘</span>
  315. </div>
  316. </div>
  317. <div
  318. class="row allAlignment center"
  319. @click="matchInfo(item.match_id);"
  320. style="padding:0 .32rem"
  321. >
  322. <div class="column average name-box">
  323. <div>{{item.home_team}}</div>
  324. <div>{{item.guest_team}}</div>
  325. </div>
  326. <div class="Match-bottom-right">
  327. <!-- 主队 -->
  328. <div class="row">
  329. <div class v-for="(items,indexs) in item.oddsData" :key="indexs">
  330. <div v-if="items.odds_code.startsWith('c')" class="row bigSmall">
  331. <div :class="{active:items.isTrue,increased_color:items.change == 'add',reduce_color:items.change == 'red'}"
  332. class="bigHome" v-if="items.odds_code == 'ch'" @click.stop="isBetting($index,item,items,item.home_team,'独赢盘')">
  333. <span style="color: rgb(247, 102, 73); " v-if="items.odds > 0" >{{items.condition}}</span>
  334. <span v-if="items.odds >0" :class="items.condition == '' ? 'mg':''">{{items.odds}}</span>
  335. <img v-if="items.odds <= 0" style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"/>
  336. </div>
  337. <div :class="{active:items.isTrue,increased_color:items.change == 'add',reduce_color:items.change == 'red'}"
  338. class="bigGuest" v-if="items.odds_code == 'cg'"
  339. @click.stop="isBetting($index,item,items,item.guest_team,'独赢盘')">
  340. <span style="color: rgb(247, 102, 73); " v-if="items.odds > 0">{{items.condition}}</span>
  341. <span v-if="items.odds >0" :class="items.condition == '' ? 'mg':''" >{{items.odds}}</span>
  342. <img v-if="items.odds <= 0" style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png" />
  343. </div>
  344. </div>
  345. </div>
  346. </div>
  347. </div>
  348. </div>
  349. </div>
  350. </div>
  351. </div>
  352. <BettingWindow v-show="isBettingWindow == '100'" />
  353. </div>
  354. </template>
  355. <script>
  356. import BettingWindow from "@/components/StBettingWindow";
  357. import NotOpend from "@/components/StNotOpend";
  358. import Loading from "@/components/StLoading";
  359. export default {
  360. name: "entryForm",
  361. data() {
  362. return {
  363. SerchValue: "",
  364. Serchchange: false,
  365. title: this.$route.query.name, //标题
  366. data: "",
  367. game_code: this.$route.query.game_code, //球的类型别名
  368. lg_id: this.$route.query.lg_id, //获取联赛id
  369. isBettingWindow: "-1",
  370. thisNum: 10000,
  371. info: "没有相关联赛信息",
  372. noData: false, //没有数据为true
  373. betting: [], //vuex里面玩法投注数据
  374. timers: true,
  375. index: "",
  376. getIsShow: true,
  377. ballSelt: 0, // 当为10的时候为篮球,足球,100的时候为网球,1000的时候为棒球
  378. // 存储变色数据
  379. previousStorage: []
  380. };
  381. },
  382. components: {
  383. BettingWindow,
  384. NotOpend,
  385. Loading
  386. },
  387. methods: {
  388. // 返回上一页
  389. isreturn() {
  390. history.go(-1);
  391. },
  392. /******************查询数据*******************/
  393. getmatchInfo(search) {
  394. this.$http
  395. .get(this.$ports.match.participateDtl, {
  396. game_code: this.game_code,
  397. code: this.$route.query.code,
  398. lg_id: this.lg_id,
  399. search
  400. })
  401. .then(res => {
  402. this.codeShow = false;
  403. if (res.data.status == 1) {
  404. // console.log(res.data.data)
  405. this.dataGroup(res.data.data);
  406. // console.log("参赛表单", res.data.data);
  407. // this.data = res.data.data;
  408. }
  409. });
  410. let _this = this;
  411. setTimeout(() => {
  412. _this.$store.dispatch("GETSHOW", false);
  413. }, 1000);
  414. },
  415. /*****************是否显示删除按钮***************/
  416. serchchange(val) {
  417. if (val.length >= 1) {
  418. this.Serchchange = true;
  419. } else {
  420. this.Serchchange = false;
  421. }
  422. },
  423. /********************查询球队*********************/
  424. searchTeam(val) {
  425. let getActivity = this.$store.getters.getActivity;
  426. let matchDate = this.$route.query.matchDate;
  427. if (val.length >= 1) {
  428. this.Serchchange = true;
  429. } else {
  430. this.Serchchange = false;
  431. }
  432. this.getmatchInfo(val);
  433. },
  434. //清空输入
  435. delinputvalue() {
  436. this.SerchValue = "";
  437. this.Serchchange = false;
  438. this.getmatchInfo("");
  439. },
  440. /****************添加、删除vuex投注数据公共方法*******************/
  441. AddDelete: function($index, item, items, name, play_name) {
  442. let match_odds = JSON.stringify(items);
  443. let isAdd = true,
  444. isNew = true;
  445. let matchList = this.$store.getters.getBetting;
  446. let bettingInfo = JSON.parse(match_odds);
  447. bettingInfo.home_team = item.home_team;
  448. bettingInfo.guest_team = item.guest_team;
  449. bettingInfo.lg_id = item.lg_id;
  450. bettingInfo.odds_id = items.id;
  451. bettingInfo.ballId = this.$store.getters.getBallId;
  452. bettingInfo.name = name;
  453. bettingInfo.play_name = play_name;
  454. //添加新的玩法赔率数据
  455. let obj = {
  456. title: bettingInfo.p_code,
  457. data: [bettingInfo]
  458. };
  459. //投注数据处理
  460. if (matchList != null) {
  461. let id = bettingInfo.id;
  462. for (let i = 0; i < matchList.length; i++) {
  463. if (matchList[i].title == bettingInfo.p_code) {
  464. //删除vuex投注数据
  465. matchList[i].data.forEach((res, index) => {
  466. // console.log(res.id,id)
  467. if (res.id == id) {
  468. matchList[i].data.splice(index, 1);
  469. this.$store.dispatch("SET_LIMIT", false);
  470. this.$store.dispatch("BETTING", []);
  471. this.$store.dispatch("BETTING", matchList);
  472. isAdd = false;
  473. isNew = false;
  474. //处理当前页面样式
  475. this.modifyStyle($index, id);
  476. }
  477. });
  478. //添加vuex投注数据
  479. if (isAdd) {
  480. isNew = false;
  481. if (this.$store.getters.getLimit * 1 >= 10) return false;
  482. //处理当前页面样式
  483. this.modifyStyle($index, id);
  484. matchList[i].data.push(bettingInfo);
  485. this.$store.dispatch("BETTING", []);
  486. this.$store.dispatch("BETTING", matchList);
  487. if (this.$store.getters.getIsBetting == "100") return false;
  488. this.$store.dispatch("ISBETTING", 100);
  489. }
  490. break;
  491. }
  492. }
  493. if (isNew) {
  494. matchList.push(obj);
  495. this.$store.dispatch("BETTING", []);
  496. this.$store.dispatch("BETTING", matchList);
  497. this.modifyStyle($index, id);
  498. if (this.$store.getters.getIsBetting == "100") return false;
  499. this.$store.dispatch("ISBETTING", "100");
  500. }
  501. } else {
  502. this.$store.dispatch("BETTING", [obj]);
  503. this.modifyStyle($index, id);
  504. if (this.$store.getters.getIsBetting == "100") return false;
  505. this.$store.dispatch("ISBETTING", "100");
  506. }
  507. },
  508. /*******************修改当前页面样式公共方法********************/
  509. modifyStyle: function($index, id, type = "") {
  510. // console.log($index,id, type)
  511. this.data[$index].match_info.every(e => {
  512. let ret = false;
  513. e.oddsData.every((res, index) => {
  514. if (res.id == id) {
  515. this.$set(res, "isTrue", res.isTrue ? false : true);
  516. ret = true;
  517. return false;
  518. }
  519. return true;
  520. });
  521. });
  522. },
  523. /******************修改投注样式******************/
  524. isBetting($index, item, items, name, play_name) {
  525. if (items.odds <= 0) return false;
  526. this.index = $index;
  527. if (this.data) {
  528. //处理vuex里面数据
  529. this.AddDelete($index, item, items, name, play_name);
  530. //处理当前页面样式
  531. // this.modifyStyle($index,id, type);
  532. }
  533. },
  534. /*******************跳转到赛事详情******************/
  535. matchInfo: function(id) {
  536. this.$router.push({
  537. path: "/StRollBallBettingPage",
  538. query: { gameCode: this.game_code, home: 1, name: this.title }
  539. });
  540. this.$store.dispatch("MACTH_ID", id);
  541. },
  542. /*--------------------------------------------------------------------------------*/
  543. /**
  544. * 赛事赔率玩法数据组合方法
  545. */
  546. dataGroup: function(data) {
  547. //console.log('数据',this.data)
  548. // let homeOdds = [],
  549. // guestOdds = [];
  550. let A, B, C, D;
  551. // console.log('daa',data)
  552. let ball = this.$store.getters.getBallId;
  553. data.forEach(i => {
  554. i.match_info.forEach((column, index) => {
  555. if (column.oddsData == null || column.oddsData.length == 0) {
  556. } else {
  557. column.oddsData.forEach(val => {
  558. if (this.betting.length > 0) {
  559. this.betting.forEach(e => {
  560. e.forEach(item => {
  561. if (val.id == item.id) {
  562. val.isTrue = true;
  563. }
  564. });
  565. });
  566. }
  567. });
  568. }
  569. });
  570. });
  571. // console.log('ddddd',data)
  572. this.data = data;
  573. // console.log('data',this.data)
  574. //更新数据和上一次的数据匹配
  575. let storage = this.previousStorage;
  576. // console.log('storege',storage)
  577. if (storage && storage != null && storage.length > 0) {
  578. this.data.forEach(e => {
  579. e.match_info.forEach(k => {
  580. k.oddsData.forEach(item => {
  581. storage.forEach(a => {
  582. a.forEach(b => {
  583. if (item.id == b.id) {
  584. if (item.odds > b.odds) {
  585. item.change = "add";
  586. } else if (item.odds < b.odds) {
  587. item.change = "red";
  588. } else {
  589. item.change = "";
  590. }
  591. }
  592. });
  593. });
  594. });
  595. });
  596. });
  597. }
  598. this.previousStorage = [];
  599. this.data.forEach(e => {
  600. e.match_info.forEach(k => {
  601. this.previousStorage.push(k.oddsData);
  602. });
  603. });
  604. this.$store.dispatch("GETGAMERATIO", this.data);
  605. }
  606. },
  607. /**
  608. * 计算属性
  609. */
  610. computed: {
  611. //获取投注框删除的投注信息
  612. getDeleteType() {
  613. return this.$store.getters.getDeleteType;
  614. },
  615. getIsBetting() {
  616. return this.$store.getters.getIsBetting;
  617. }
  618. },
  619. /**
  620. * 监听器
  621. */
  622. watch: {
  623. getIsBetting(val) {
  624. this.isBettingWindow = val;
  625. },
  626. // 监听删除投注
  627. getDeleteType(val) {
  628. let flag = true;
  629. this.data.forEach(e => {
  630. if (val == "all") {
  631. e.match_info.forEach(data => {
  632. data.oddsData.forEach((k, i) => {
  633. this.$set(k, "isTrue", false);
  634. });
  635. data.oddsData.forEach((k, i) => {
  636. this.$set(k, "isTrue", false);
  637. });
  638. });
  639. } else {
  640. let showData = true;
  641. e.match_info.forEach((res, index) => {
  642. res.oddsData.forEach((k, i) => {
  643. if (k.id == val) {
  644. this.$set(k, "isTrue", false);
  645. showData = true;
  646. }
  647. });
  648. });
  649. if (showData) {
  650. e.match_info.forEach(data => {
  651. data.oddsData.forEach(item => {
  652. if (item.id == val) {
  653. this.$set(item, "isTrue", false);
  654. }
  655. });
  656. });
  657. }
  658. }
  659. });
  660. }
  661. },
  662. mounted() {
  663. this.$store.dispatch("GETSHOW", true);
  664. // 获取球类,判定状态
  665. let ball = this.$route.query.game_code;
  666. // 是否展示投注框
  667. if (this.$store.getters.getIsBetting == "100") {
  668. this.isBettingWindow = "100";
  669. }
  670. //获取vuex玩法已投注相对应的数据
  671. let getBetting = this.$store.getters.getBetting;
  672. // if(getBetting){
  673. if (ball == "zq") {
  674. this.ballSelt = 10;
  675. if (getBetting) {
  676. getBetting.forEach((e, index) => {
  677. if ("concede" == e.title || "goal_size" == e.title) {
  678. this.betting.push(e.data);
  679. }
  680. });
  681. }
  682. } else if (ball == "lq") {
  683. this.ballSelt = 10;
  684. if (getBetting) {
  685. getBetting.forEach((e, index) => {
  686. if ("concede" == e.title || "total_size" == e.title) {
  687. this.betting.push(e.data);
  688. }
  689. });
  690. }
  691. } else if (ball == "bq") {
  692. this.ballSelt = 1000;
  693. if (getBetting) {
  694. getBetting.forEach((e, index) => {
  695. if ("capot" == e.title) {
  696. this.betting.push(e.data);
  697. }
  698. });
  699. }
  700. } else if (ball == "wq") {
  701. this.ballSelt = 100;
  702. if (getBetting) {
  703. getBetting.forEach((e, index) => {
  704. if ("dishes" == e.title || "kemp" == e.title) {
  705. this.betting.push(e.data);
  706. }
  707. });
  708. }
  709. }
  710. // }
  711. let _this = this;
  712. this.$public.ajaxTimerFun(function(timing) {
  713. if (_this.timers) {
  714. _this.getmatchInfo("");
  715. } else {
  716. clearInterval(timing);
  717. }
  718. }, 1000 * 10);
  719. // console.log("data", this.data);
  720. /*-----------------------*/
  721. this.getmatchInfo("");
  722. },
  723. beforeDestroy() {
  724. this.timers = false;
  725. }
  726. };
  727. </script>
  728. <style scoped>
  729. .Serch {
  730. height: 0.75rem;
  731. display: flex;
  732. justify-content: space-between;
  733. align-items: center;
  734. background-color: #363636;
  735. color: #fd8f26;
  736. font-family: "PingFang-SC-Regular";
  737. padding: 0 0.32rem;
  738. }
  739. .lock {
  740. background: #f4f4f4;
  741. }
  742. .Serch-box-input {
  743. width: 2rem;
  744. border: none;
  745. position: absolute;
  746. left: 0.5rem;
  747. top: 0.06rem;
  748. }
  749. /* .BettingWindow{
  750. z-index: 10000;
  751. position:fixed;
  752. top:0;
  753. width: 100%;
  754. } */
  755. .Serch-box-img {
  756. width: 0.3rem;
  757. height: 0.3rem;
  758. position: absolute;
  759. left: 0.1rem;
  760. top: 0.06rem;
  761. }
  762. .Serch-box-del {
  763. width: 0.2rem;
  764. height: 0.2rem;
  765. position: absolute;
  766. right: 0.2rem;
  767. }
  768. .Serch-box-home {
  769. height: 0.44rem;
  770. width: 4.73rem;
  771. background: #e4e4e4;
  772. border-radius: 0.2rem;
  773. display: flex;
  774. justify-content: space-around;
  775. align-items: center;
  776. padding-left: 0.1rem;
  777. padding-right: 0.1rem;
  778. position: relative;
  779. }
  780. .box-img {
  781. width: 0.37rem;
  782. height: 0.3rem;
  783. margin-right: 0.18rem;
  784. }
  785. .Soccer-game-title {
  786. display: flex;
  787. color: #f76649;
  788. align-items: center;
  789. width: 1.3rem;
  790. font-size: 0.3rem;
  791. }
  792. .Soccer-game-box {
  793. display: flex;
  794. left: -0.3rem;
  795. top: 0.2rem;
  796. background: #fff;
  797. background: #626262;
  798. color: #a6a6a6;
  799. height: 0.7rem;
  800. align-items: center;
  801. }
  802. .Soccer-game-src {
  803. width: 0.25rem;
  804. height: 0.25rem;
  805. }
  806. .box {
  807. padding: 0 0.32rem;
  808. color: #e1e1df;
  809. height: 0.88rem;
  810. font-size: 0.32rem;
  811. background: linear-gradient(to bottom, #999999, #6a6a6b);
  812. }
  813. .Match-title-num {
  814. width: 0.46rem;
  815. height: 0.46rem;
  816. line-height: 0.46rem;
  817. text-align: center;
  818. background: #f76649;
  819. font-size: 0.26rem;
  820. border-radius: 50%;
  821. color: #f5f5f5;
  822. }
  823. .Match-box-top-right > span {
  824. width: 1.07rem;
  825. text-align: center;
  826. }
  827. .Match-box {
  828. /* height: 2.45rem; */
  829. }
  830. .name-box {
  831. width: 4rem;
  832. height: 1.76rem;
  833. }
  834. .Match-box-top {
  835. height: 0.45rem;
  836. line-height: 0.45rem;
  837. background: #dcdcdc;
  838. font-size: 0.23rem;
  839. padding: 0 0.32rem;
  840. }
  841. .Match-box-top-num {
  842. width: 0.64rem !important;
  843. height: 0.45rem;
  844. background: #ebebeb;
  845. font-size: 0.24rem;
  846. }
  847. .Match-box {
  848. background: #f8f8f8;
  849. }
  850. .Match-bottom-right {
  851. height: 2rem;
  852. width: 2.5rem;
  853. padding: 0.1rem 0.1rem 0 0.14rem;
  854. position: relative;
  855. }
  856. .Match-list-left div {
  857. width: 1.07rem;
  858. height: 0.76rem;
  859. border: 1px solid #e4e4e4;
  860. border-radius: 0.1rem;
  861. padding: 0.1rem;
  862. margin: 0.06rem 0.08rem;
  863. }
  864. .Match-list-right div {
  865. width: 1.07rem;
  866. height: 0.76rem;
  867. border: 1px solid #e4e4e4;
  868. border-radius: 0.1rem;
  869. margin: 0.06rem 0.08rem;
  870. }
  871. .active {
  872. background: #f76649;
  873. border: none;
  874. color: #e1e1df !important;
  875. }
  876. .active span,
  877. .active i {
  878. color: #e1e1df !important;
  879. }
  880. .wqavg {
  881. width: 4.3rem;
  882. }
  883. div .wqMatch-box {
  884. /* height: 0.65rem;
  885. line-height: 0.3rem; */
  886. }
  887. /* 赔率 */
  888. .letballHome,
  889. .letballGuest,
  890. .bigHome,
  891. .bigGuest {
  892. width: 1.07rem;
  893. height: 0.76rem;
  894. border: 1px solid #e4e4e4;
  895. border-radius: 0.1rem;
  896. margin: 0.06rem 0.08rem;
  897. /* padding: 0.1rem 0; */
  898. /* margin: 0.06rem 0.6rem 0.06rem 0; */
  899. text-align: center;
  900. }
  901. .letballGuest {
  902. position: absolute;
  903. bottom: 0.19rem;
  904. }
  905. .bigHome span,
  906. .bigGuest span,
  907. .letballHome span,
  908. .letballGuest span {
  909. display: block;
  910. }
  911. .bigHome {
  912. position: absolute;
  913. right: 0;
  914. top: 0.1rem;
  915. }
  916. .bigGuest {
  917. position: absolute;
  918. right: 0;
  919. top: 0.93rem;
  920. }
  921. .active span {
  922. color: #e1e1df !important;
  923. }
  924. .stardBig {
  925. display: flex;
  926. align-items: center;
  927. justify-content: center;
  928. }
  929. .stardBig .bigSmall {
  930. color: #9b9999;
  931. }
  932. .mg {
  933. margin-top: 0.2rem;
  934. }
  935. </style>