8bd33d9d64fd5abb27a094628354b08b1ef51edb.svn-base 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953
  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;">{{ ballType =='zq' ?'让球':'让分'}} </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. ballType:'',//球类别
  381. };
  382. },
  383. components: {
  384. BettingWindow,
  385. NotOpend,
  386. Loading
  387. },
  388. methods: {
  389. // 返回上一页
  390. isreturn() {
  391. history.go(-1);
  392. },
  393. /******************查询数据*******************/
  394. getmatchInfo(search) {
  395. this.$http
  396. .get(this.$ports.match.participateDtl, {
  397. game_code: this.game_code,
  398. code: this.$route.query.code,
  399. lg_id: this.lg_id,
  400. search
  401. })
  402. .then(res => {
  403. this.codeShow = false;
  404. if (res.data.status == 1) {
  405. // console.log(res.data.data)
  406. this.dataGroup(res.data.data);
  407. // console.log("参赛表单", res.data.data);
  408. // this.data = res.data.data;
  409. }
  410. });
  411. let _this = this;
  412. setTimeout(() => {
  413. _this.$store.dispatch("GETSHOW", false);
  414. }, 1000);
  415. },
  416. /*****************是否显示删除按钮***************/
  417. serchchange(val) {
  418. if (val.length >= 1) {
  419. this.Serchchange = true;
  420. } else {
  421. this.Serchchange = false;
  422. }
  423. },
  424. /********************查询球队*********************/
  425. searchTeam(val) {
  426. let getActivity = this.$store.getters.getActivity;
  427. let matchDate = this.$route.query.matchDate;
  428. if (val.length >= 1) {
  429. this.Serchchange = true;
  430. } else {
  431. this.Serchchange = false;
  432. }
  433. this.getmatchInfo(val);
  434. },
  435. //清空输入
  436. delinputvalue() {
  437. this.SerchValue = "";
  438. this.Serchchange = false;
  439. this.getmatchInfo("");
  440. },
  441. /****************添加、删除vuex投注数据公共方法*******************/
  442. AddDelete: function($index, item, items, name, play_name) {
  443. let match_odds = JSON.stringify(items);
  444. let isAdd = true,
  445. isNew = true;
  446. let matchList = this.$store.getters.getBetting;
  447. let bettingInfo = JSON.parse(match_odds);
  448. bettingInfo.home_team = item.home_team;
  449. bettingInfo.guest_team = item.guest_team;
  450. bettingInfo.lg_id = item.lg_id;
  451. bettingInfo.odds_id = items.id;
  452. bettingInfo.ballId = this.$store.getters.getBallId;
  453. bettingInfo.name = name;
  454. bettingInfo.play_name = play_name;
  455. //添加新的玩法赔率数据
  456. let obj = {
  457. title: bettingInfo.p_code,
  458. data: [bettingInfo]
  459. };
  460. //投注数据处理
  461. if (matchList != null) {
  462. let id = bettingInfo.id;
  463. for (let i = 0; i < matchList.length; i++) {
  464. if (matchList[i].title == bettingInfo.p_code) {
  465. //删除vuex投注数据
  466. matchList[i].data.forEach((res, index) => {
  467. // console.log(res.id,id)
  468. if (res.id == id) {
  469. matchList[i].data.splice(index, 1);
  470. this.$store.dispatch("SET_LIMIT", false);
  471. this.$store.dispatch("BETTING", []);
  472. this.$store.dispatch("BETTING", matchList);
  473. isAdd = false;
  474. isNew = false;
  475. //处理当前页面样式
  476. this.modifyStyle($index, id);
  477. }
  478. });
  479. //添加vuex投注数据
  480. if (isAdd) {
  481. isNew = false;
  482. if (this.$store.getters.getLimit * 1 >= 10) return false;
  483. //处理当前页面样式
  484. this.modifyStyle($index, id);
  485. matchList[i].data.push(bettingInfo);
  486. this.$store.dispatch("BETTING", []);
  487. this.$store.dispatch("BETTING", matchList);
  488. if (this.$store.getters.getIsBetting == "100") return false;
  489. this.$store.dispatch("ISBETTING", 100);
  490. }
  491. break;
  492. }
  493. }
  494. if (isNew) {
  495. matchList.push(obj);
  496. this.$store.dispatch("BETTING", []);
  497. this.$store.dispatch("BETTING", matchList);
  498. this.modifyStyle($index, id);
  499. if (this.$store.getters.getIsBetting == "100") return false;
  500. this.$store.dispatch("ISBETTING", "100");
  501. }
  502. } else {
  503. this.$store.dispatch("BETTING", [obj]);
  504. this.modifyStyle($index, id);
  505. if (this.$store.getters.getIsBetting == "100") return false;
  506. this.$store.dispatch("ISBETTING", "100");
  507. }
  508. },
  509. /*******************修改当前页面样式公共方法********************/
  510. modifyStyle: function($index, id, type = "") {
  511. // console.log($index,id, type)
  512. this.data[$index].match_info.every(e => {
  513. let ret = false;
  514. e.oddsData.every((res, index) => {
  515. if (res.id == id) {
  516. this.$set(res, "isTrue", res.isTrue ? false : true);
  517. ret = true;
  518. return false;
  519. }
  520. return true;
  521. });
  522. });
  523. },
  524. /******************修改投注样式******************/
  525. isBetting($index, item, items, name, play_name) {
  526. if (items.odds <= 0) return false;
  527. this.index = $index;
  528. if (this.data) {
  529. //处理vuex里面数据
  530. this.AddDelete($index, item, items, name, play_name);
  531. //处理当前页面样式
  532. // this.modifyStyle($index,id, type);
  533. }
  534. },
  535. /*******************跳转到赛事详情******************/
  536. matchInfo: function(id) {
  537. this.$router.push({
  538. path: "/StRollBallBettingPage",
  539. query: { gameCode: this.game_code, home: 1, name: this.title }
  540. });
  541. this.$store.dispatch("MACTH_ID", id);
  542. },
  543. /*--------------------------------------------------------------------------------*/
  544. /**
  545. * 赛事赔率玩法数据组合方法
  546. */
  547. dataGroup: function(data) {
  548. //console.log('数据',this.data)
  549. // let homeOdds = [],
  550. // guestOdds = [];
  551. let A, B, C, D;
  552. // console.log('daa',data)
  553. let ball = this.$store.getters.getBallId;
  554. data.forEach(i => {
  555. i.match_info.forEach((column, index) => {
  556. if (column.oddsData == null || column.oddsData.length == 0) {
  557. } else {
  558. column.oddsData.forEach(val => {
  559. if (this.betting.length > 0) {
  560. this.betting.forEach(e => {
  561. e.forEach(item => {
  562. if (val.id == item.id) {
  563. val.isTrue = true;
  564. }
  565. });
  566. });
  567. }
  568. });
  569. }
  570. });
  571. });
  572. // console.log('ddddd',data)
  573. this.data = data;
  574. // console.log('data',this.data)
  575. //更新数据和上一次的数据匹配
  576. let storage = this.previousStorage;
  577. // console.log('storege',storage)
  578. if (storage && storage != null && storage.length > 0) {
  579. this.data.forEach(e => {
  580. e.match_info.forEach(k => {
  581. k.oddsData.forEach(item => {
  582. storage.forEach(a => {
  583. a.forEach(b => {
  584. if (item.id == b.id) {
  585. if (item.odds > b.odds) {
  586. item.change = "add";
  587. } else if (item.odds < b.odds) {
  588. item.change = "red";
  589. } else {
  590. item.change = "";
  591. }
  592. }
  593. });
  594. });
  595. });
  596. });
  597. });
  598. }
  599. this.previousStorage = [];
  600. this.data.forEach(e => {
  601. e.match_info.forEach(k => {
  602. this.previousStorage.push(k.oddsData);
  603. });
  604. });
  605. this.$store.dispatch("GETGAMERATIO", this.data);
  606. }
  607. },
  608. /**
  609. * 计算属性
  610. */
  611. computed: {
  612. //获取投注框删除的投注信息
  613. getDeleteType() {
  614. return this.$store.getters.getDeleteType;
  615. },
  616. getIsBetting() {
  617. return this.$store.getters.getIsBetting;
  618. }
  619. },
  620. /**
  621. * 监听器
  622. */
  623. watch: {
  624. getIsBetting(val) {
  625. this.isBettingWindow = val;
  626. },
  627. // 监听删除投注
  628. getDeleteType(val) {
  629. let flag = true;
  630. this.data.forEach(e => {
  631. if (val == "all") {
  632. e.match_info.forEach(data => {
  633. data.oddsData.forEach((k, i) => {
  634. this.$set(k, "isTrue", false);
  635. });
  636. data.oddsData.forEach((k, i) => {
  637. this.$set(k, "isTrue", false);
  638. });
  639. });
  640. } else {
  641. let showData = true;
  642. e.match_info.forEach((res, index) => {
  643. res.oddsData.forEach((k, i) => {
  644. if (k.id == val) {
  645. this.$set(k, "isTrue", false);
  646. showData = true;
  647. }
  648. });
  649. });
  650. if (showData) {
  651. e.match_info.forEach(data => {
  652. data.oddsData.forEach(item => {
  653. if (item.id == val) {
  654. this.$set(item, "isTrue", false);
  655. }
  656. });
  657. });
  658. }
  659. }
  660. });
  661. }
  662. },
  663. mounted() {
  664. this.$store.dispatch("GETSHOW", true);
  665. // 获取球类,判定状态
  666. let ball = this.$route.query.game_code;
  667. this.ballType = ball;
  668. // 是否展示投注框
  669. if (this.$store.getters.getIsBetting == "100") {
  670. this.isBettingWindow = "100";
  671. }
  672. //获取vuex玩法已投注相对应的数据
  673. let getBetting = this.$store.getters.getBetting;
  674. // if(getBetting){
  675. if (ball == "zq") {
  676. this.ballSelt = 10;
  677. if (getBetting) {
  678. getBetting.forEach((e, index) => {
  679. if ("concede" == e.title || "goal_size" == e.title) {
  680. this.betting.push(e.data);
  681. }
  682. });
  683. }
  684. } else if (ball == "lq") {
  685. this.ballSelt = 10;
  686. if (getBetting) {
  687. getBetting.forEach((e, index) => {
  688. if ("concede" == e.title || "total_size" == e.title) {
  689. this.betting.push(e.data);
  690. }
  691. });
  692. }
  693. } else if (ball == "bq") {
  694. this.ballSelt = 1000;
  695. if (getBetting) {
  696. getBetting.forEach((e, index) => {
  697. if ("capot" == e.title) {
  698. this.betting.push(e.data);
  699. }
  700. });
  701. }
  702. } else if (ball == "wq") {
  703. this.ballSelt = 100;
  704. if (getBetting) {
  705. getBetting.forEach((e, index) => {
  706. if ("dishes" == e.title || "kemp" == e.title) {
  707. this.betting.push(e.data);
  708. }
  709. });
  710. }
  711. }
  712. // }
  713. let _this = this;
  714. this.$public.ajaxTimerFun(function(timing) {
  715. if (_this.timers) {
  716. _this.getmatchInfo("");
  717. } else {
  718. clearInterval(timing);
  719. }
  720. }, 1000 * 10);
  721. // console.log("data", this.data);
  722. /*-----------------------*/
  723. this.getmatchInfo("");
  724. },
  725. beforeDestroy() {
  726. this.timers = false;
  727. }
  728. };
  729. </script>
  730. <style scoped>
  731. .Serch {
  732. height: 0.75rem;
  733. display: flex;
  734. justify-content: space-between;
  735. align-items: center;
  736. background-color: #363636;
  737. color: #fd8f26;
  738. font-family: "PingFang-SC-Regular";
  739. padding: 0 0.32rem;
  740. }
  741. .lock {
  742. background: #f4f4f4;
  743. }
  744. .Serch-box-input {
  745. width: 2rem;
  746. border: none;
  747. position: absolute;
  748. left: 0.5rem;
  749. top: 0.06rem;
  750. }
  751. /* .BettingWindow{
  752. z-index: 10000;
  753. position:fixed;
  754. top:0;
  755. width: 100%;
  756. } */
  757. .Serch-box-img {
  758. width: 0.3rem;
  759. height: 0.3rem;
  760. position: absolute;
  761. left: 0.1rem;
  762. top: 0.06rem;
  763. }
  764. .Serch-box-del {
  765. width: 0.2rem;
  766. height: 0.2rem;
  767. position: absolute;
  768. right: 0.2rem;
  769. }
  770. .Serch-box-home {
  771. height: 0.44rem;
  772. width: 4.73rem;
  773. background: #e4e4e4;
  774. border-radius: 0.2rem;
  775. display: flex;
  776. justify-content: space-around;
  777. align-items: center;
  778. padding-left: 0.1rem;
  779. padding-right: 0.1rem;
  780. position: relative;
  781. }
  782. .box-img {
  783. width: 0.37rem;
  784. height: 0.3rem;
  785. margin-right: 0.18rem;
  786. }
  787. .Soccer-game-title {
  788. display: flex;
  789. color: #f76649;
  790. align-items: center;
  791. width: 1.3rem;
  792. font-size: 0.3rem;
  793. }
  794. .Soccer-game-box {
  795. display: flex;
  796. left: -0.3rem;
  797. top: 0.2rem;
  798. background: #fff;
  799. background: #626262;
  800. color: #a6a6a6;
  801. height: 0.7rem;
  802. align-items: center;
  803. }
  804. .Soccer-game-src {
  805. width: 0.25rem;
  806. height: 0.25rem;
  807. }
  808. .box {
  809. padding: 0 0.32rem;
  810. color: #e1e1df;
  811. height: 0.88rem;
  812. font-size: 0.32rem;
  813. background: linear-gradient(to bottom, #999999, #6a6a6b);
  814. }
  815. .Match-title-num {
  816. width: 0.46rem;
  817. height: 0.46rem;
  818. line-height: 0.46rem;
  819. text-align: center;
  820. background: #f76649;
  821. font-size: 0.26rem;
  822. border-radius: 50%;
  823. color: #f5f5f5;
  824. }
  825. .Match-box-top-right > span {
  826. width: 1.07rem;
  827. text-align: center;
  828. }
  829. .Match-box {
  830. /* height: 2.45rem; */
  831. }
  832. .name-box {
  833. width: 4rem;
  834. height: 1.76rem;
  835. }
  836. .Match-box-top {
  837. height: 0.45rem;
  838. line-height: 0.45rem;
  839. background: #dcdcdc;
  840. font-size: 0.23rem;
  841. padding: 0 0.32rem;
  842. }
  843. .Match-box-top-num {
  844. width: 0.64rem !important;
  845. height: 0.45rem;
  846. background: #ebebeb;
  847. font-size: 0.24rem;
  848. }
  849. .Match-box {
  850. background: #f8f8f8;
  851. }
  852. .Match-bottom-right {
  853. height: 2rem;
  854. width: 2.5rem;
  855. padding: 0.1rem 0.1rem 0 0.14rem;
  856. position: relative;
  857. }
  858. .Match-list-left div {
  859. width: 1.07rem;
  860. height: 0.76rem;
  861. border: 1px solid #e4e4e4;
  862. border-radius: 0.1rem;
  863. padding: 0.1rem;
  864. margin: 0.06rem 0.08rem;
  865. }
  866. .Match-list-right div {
  867. width: 1.07rem;
  868. height: 0.76rem;
  869. border: 1px solid #e4e4e4;
  870. border-radius: 0.1rem;
  871. margin: 0.06rem 0.08rem;
  872. }
  873. .active {
  874. background: #f76649;
  875. border: none;
  876. color: #e1e1df !important;
  877. }
  878. .active span,
  879. .active i {
  880. color: #e1e1df !important;
  881. }
  882. .wqavg {
  883. width: 4.3rem;
  884. }
  885. div .wqMatch-box {
  886. /* height: 0.65rem;
  887. line-height: 0.3rem; */
  888. }
  889. /* 赔率 */
  890. .letballHome,
  891. .letballGuest,
  892. .bigHome,
  893. .bigGuest {
  894. width: 1.07rem;
  895. height: 0.76rem;
  896. border: 1px solid #e4e4e4;
  897. border-radius: 0.1rem;
  898. margin: 0.06rem 0.08rem;
  899. /* padding: 0.1rem 0; */
  900. /* margin: 0.06rem 0.6rem 0.06rem 0; */
  901. text-align: center;
  902. }
  903. .letballGuest {
  904. position: absolute;
  905. bottom: 0.19rem;
  906. }
  907. .bigHome span,
  908. .bigGuest span,
  909. .letballHome span,
  910. .letballGuest span {
  911. display: block;
  912. }
  913. .bigHome {
  914. position: absolute;
  915. right: 0;
  916. top: 0.1rem;
  917. }
  918. .bigGuest {
  919. position: absolute;
  920. right: 0;
  921. top: 0.93rem;
  922. }
  923. .active span {
  924. color: #e1e1df !important;
  925. }
  926. .stardBig {
  927. display: flex;
  928. align-items: center;
  929. justify-content: center;
  930. }
  931. .stardBig .bigSmall {
  932. color: #9b9999;
  933. }
  934. .mg {
  935. margin-top: 0.2rem;
  936. }
  937. </style>