b81062932f557466325dde596a5cc3b4d2a8ed5d.svn-base 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176
  1. <template>
  2. <div>
  3. <div class="Serch">
  4. <div class="Soccer-game row center">
  5. <div class="Soccer-game-title row center">
  6. <img class="returnimg" :src="img.searchreturn" @click="isreturn()">
  7. <span class="tit">{{title}}</span>
  8. </div>
  9. <div
  10. class="row center"
  11. style="height:0.88rem;padding-left:0.1rem;"
  12. @click="IsSoccerGameClick(isSoccerGameClick)"
  13. >
  14. <img
  15. :class="isSoccerGameClick==true?'Soccer-game-src act':'Soccer-game-src return'"
  16. :src="img.Soccerimg1"
  17. >
  18. </div>
  19. </div>
  20. <div class="Serch-box" v-if="searchShow">
  21. <div class="Serch-box-home">
  22. <img class="Serch-box-img" :src="img.Serchimg">
  23. <input
  24. v-model="SerchValue"
  25. @input="serchchange(SerchValue)"
  26. class="Serch-box-input"
  27. type="text"
  28. placeholder="请输入球队名称"
  29. >
  30. <img
  31. class="Serch-box-del"
  32. @click="delinputvalue()"
  33. v-if="Serchchange==true"
  34. :src="img.Serchdel"
  35. >
  36. </div>
  37. </div>
  38. </div>
  39. <div class="Soccer-game-box row" v-if="isSoccerGameClick==true">
  40. <p
  41. class="row item-center"
  42. v-for="(i,index) in Regulations"
  43. @click="listActive(i.id,i.name,i.num,index)"
  44. :key="index"
  45. :class="listnum==i.id?'active':''"
  46. >
  47. {{i.name}}
  48. <span
  49. class="Soccer-game-num"
  50. v-if="i.name!='冠军盘口'"
  51. :class="listnum==i.id?'active':''"
  52. >
  53. <!--Soccer 导航数字 -->
  54. {{i.num}}
  55. </span>
  56. </p>
  57. </div>
  58. <div
  59. v-if="isDataShow"
  60. class="event_prompt row item-center"
  61. >目前暂无可适用的{{event_prompt_name==''?'':event_prompt_name}}赛事</div>
  62. <div v-else class="ChampionsCup_content">
  63. <div v-if="listnum==1"></div>
  64. <div v-if="listnum==2"></div>
  65. <div v-if="listnum==3">
  66. <div v-for=" (item,index) in data.StMorningPlate.matchData" :key="index" class="Match-box">
  67. <div class="row allAlignment Match-box-top">
  68. <div class="Match-box-top-left">
  69. <span>{{item.match_date}}</span>
  70. <span>{{item.match_time}}</span>
  71. </div>
  72. <div class="Match-box-top-right row">
  73. <span style="margin-right: .15rem;" class="Match-box-top-num">{{item.tag}}</span>
  74. <span style="margin-right: .15rem;">让球</span>
  75. <span style="margin-right: .15rem;">大小</span>
  76. </div>
  77. </div>
  78. <div
  79. class="row allAlignment center"
  80. @click="matchInfo(item.match_id);"
  81. style="padding:0 .32rem"
  82. >
  83. <div class="column average name-box">
  84. <div>{{item.home_team}}</div>
  85. <div>{{item.guest_team}}</div>
  86. </div>
  87. <div class="Match-bottom-right">
  88. <!-- 主队 -->
  89. <div class="row">
  90. <div
  91. class="Match-list-left"
  92. v-for="(items,indexs) in item.oddsData.homeOdds"
  93. :key="indexs"
  94. @click.stop="bteBetting(item.match_id,items.id,item.home_team,item.guest_team,item.home_team,items.odds,items.condition,items.odds_only,items.odds_code,'homeOdds',items.p_code,items.status)"
  95. >
  96. <div :class="items.isTrue ? 'activity' : ''" class="column center">
  97. <span style="color:#FD8F26" v-if="items.odds > 0">{{items.condition}}</span>
  98. <span v-if="items.odds >0">{{items.odds}}</span>
  99. <img v-if="items.odds < 0" style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"><img>
  100. </div>
  101. </div>
  102. </div>
  103. <!-- 客队 -->
  104. <div class="row">
  105. <div
  106. class="Match-list-right row"
  107. v-for="(items,indexs) in item.oddsData.guestOdds"
  108. :key="indexs"
  109. @click.stop="bteBetting(item.match_id,items.id,item.home_team,item.guest_team,item.guest_team,items.odds,items.condition,items.odds_only,items.odds_code,'guestOdds',items.p_code,items.status)"
  110. >
  111. <div :class="items.isTrue ? 'activity' : ''" class="column center">
  112. <span v-if="items.odds > 0">
  113. <i style="color:#FD8F26">{{items.condition}}</i>
  114. </span>
  115. <span v-if="items.odds >0">{{items.odds}}</span>
  116. <img v-if="items.odds < 0" style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"><img>
  117. </div>
  118. </div>
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. </div>
  124. <div v-if="listnum==4">
  125. <!-- 冠军组件 -->
  126. <div class="champion">
  127. <div v-for="(item,index) in ChampionData" :key="item.id">
  128. <div class="title">
  129. <span>{{item.name}}</span>
  130. <div class="time">
  131. <!-- <span>2019年5月29日</span> -->
  132. <span>{{item.last_time}}</span>
  133. </div>
  134. </div>
  135. <div v-for="(items,i) in item.data" :key="items.id">
  136. <div class="chmpTit">{{items.title}}</div>
  137. <div v-for="itemList in items.datas" :key="itemList.id">
  138. <div class="list">
  139. <span class="chmName">{{itemList.team}}</span>
  140. <div v-if="items.odds " class="num" @click="championBetting(index,i,itemList.id,itemList.odds,itemList.odds_only,itemList.p_code,itemList.match_id,itemList.odds_code,items.title,itemList.lg_id,itemList.team)" :class="itemList.isTrue ? 'col':''">{{itemList.odds}}</div>
  141. <!-- <div v-else class="ratio column center">
  142. <img style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"><img>
  143. </div> -->
  144. </div>
  145. </div>
  146. </div>
  147. </div>
  148. <!-- <div v-if="noData">
  149. <NotOpend :title="this.info"/>
  150. </div>-->
  151. </div>
  152. </div>
  153. </div>
  154. <div v-show="isBettingWindow == '100'">
  155. <BettingWindow/>
  156. </div>
  157. </div>
  158. </template>
  159. <script>
  160. import "@/css/index.css";
  161. import BettingWindow from "@/components/StBettingWindow";
  162. export default {
  163. name: "ChampionsCup",
  164. components: { BettingWindow },
  165. data() {
  166. return {
  167. title: "",
  168. // 日期时间数组
  169. arr: [],
  170. // 本页面的数据
  171. data: "",
  172. isDataShow: true, //显示无数据
  173. lg_id:'',
  174. scorll: "", //背景滚动
  175. //冠军盘口提示区分盘口名
  176. event_prompt_name: "",
  177. isSoccerGameClick: true,
  178. Serchchange: false,
  179. listnum: 2, //赛事类型
  180. SerchValue: "",
  181. betting: 10000, //vuex里面玩法投注数据
  182. thisNum: 10000, //vuex里面
  183. plateNum:10000, //早盘vuex下标
  184. ChampionData: "", //冠军数据
  185. isBettingWindow: '-1',
  186. searchShow: true,
  187. title: "", //传入最后一页的名字
  188. match_id : '',//赛事Id
  189. game_code :'gj',
  190. img: {
  191. Soccerimg1: require("@/assets/st-imges/soccer1.png"),
  192. Soccerimg2: require("@/assets/st-imges/soccer1.png"),
  193. Serchimg: require("@/assets/st-imges/sousuo.png"),
  194. Serchdel: require("@/assets/st-imges/del.png"),
  195. searchreturn: require("@/assets/st-imges/returnbox.png")
  196. },
  197. Regulations: [
  198. { id: 1, name: "滚球", num: "" },
  199. { id: 2, name: "今日", num: "" },
  200. { id: 3, name: "早盘", num: "" },
  201. { id: 4, name: "冠军盘口" }
  202. ],
  203. };
  204. },
  205. created() {
  206. this.fun_date();
  207. },
  208. methods: {
  209. //冠军盘口投注
  210. championBetting(index,i,id,odds,odds_only,p_code,match_id,odds_code,play_name,lg_id,name){
  211. if(this.$store.getters.getLimit * 1 >= 10){
  212. this.$dialog.alert({mes: '你的注单已达到上限啦!'});
  213. }
  214. // 导入数据
  215. let _this = this;
  216. let isAdd = true;
  217. let bettingInfo = {
  218. id,
  219. home_team: '',
  220. guest_team: '',
  221. name,
  222. odds,
  223. match_id,
  224. condition:'',
  225. ballId:this.$store.getters.getBallId,
  226. odds_code: odds_code,
  227. p_code:'gj',
  228. play_name,
  229. score:'',
  230. bettingTime: "",
  231. odds_only,
  232. lg_id
  233. };
  234. let matchList = this.$store.getters.getBetting;
  235. if(this.thisNum != 10000){
  236. console.log('111', this.thisNum)
  237. //删除vuex投注数据
  238. matchList[this.thisNum].data.forEach((res,index) =>{
  239. if(res.id == id){
  240. console.log(res.id,id)
  241. this.modifyChampionStyle(index,i,id)
  242. matchList[this.thisNum].data.splice(index,1);
  243. this.$store.dispatch("SET_LIMIT", false);
  244. this.$store.dispatch("BETTING", []);
  245. this.$store.dispatch("BETTING", matchList);
  246. isAdd = false;
  247. }
  248. })
  249. //添加vuex投注数据
  250. if(isAdd){
  251. if(this.$store.getters.getLimit * 1 >= 10)return false;
  252. this.modifyChampionStyle(index,i,id)
  253. matchList[this.thisNum].data.push(bettingInfo);
  254. this.$store.dispatch("BETTING", []);
  255. this.$store.dispatch("BETTING", matchList);
  256. if (this.$store.getters.getIsBetting == '100' ) return false;
  257. this.$store.dispatch("ISBETTING",100);
  258. }
  259. }else{
  260. //添加新的玩法赔率数据
  261. let obj = {
  262. title:'gj',
  263. data:[bettingInfo]
  264. };
  265. //console.log(obj);
  266. //判断vuex有误其它玩法数据
  267. if(matchList){
  268. matchList.push(obj);
  269. }else{
  270. this.$store.dispatch("BETTING", [obj]);
  271. }
  272. this.modifyChampionStyle(index,i,id)
  273. if (this.$store.getters.getIsBetting == '100') return false;
  274. this.$store.dispatch("ISBETTING", '100');
  275. }
  276. },
  277. /*-----------------------------------------------------*/
  278. //修改当前页面样式公共方法
  279. modifyChampionStyle:function(index,i,id){
  280. this.ChampionData.forEach(a =>{
  281. a.data.forEach(b =>{
  282. b.datas.every((res,index) =>{
  283. if(res.id == id){
  284. this.$set(res,'isTrue',res.isTrue ? false : true);
  285. this.$forceUpdate();
  286. return false;
  287. }
  288. return true;
  289. })
  290. return true;
  291. })
  292. })
  293. },
  294. /*-------------------------------------*/
  295. // 获取一周赛事
  296. fun_date: function() {
  297. let date = new Date();
  298. let MonthNum = 0;
  299. let lastMonth = new Date(date.getFullYear(),date.getMonth() + 1,0).getDate();
  300. for (let i = 1; i < 7; i++) {
  301. let years = date.getFullYear();
  302. let month = date.getMonth() + 1;
  303. let day = date.getDate()+i < 10 ? "0" + date.getDate()+i : date.getDate()+i;
  304. if( date.getDate()+i > lastMonth){
  305. MonthNum ++;
  306. month = date.getMonth() + 2;
  307. day = "0" + MonthNum;
  308. }
  309. let time2 = {};
  310. time2.id = years + "-" + month + "-" + day;
  311. time2.title = years + "-" + month + "-" + day;
  312. this.arr.push(time2);
  313. if (i == 6) {
  314. this.arr.push({ id: "morning", title: "早盘" });
  315. }
  316. }
  317. },
  318. /*-------------------------------------------*/
  319. //切换赛事类型
  320. listActive(id, name, num, index) {
  321. if (this.listnum == id) return false;
  322. this.SerchValue = "";
  323. let time;
  324. this.listnum = id;
  325. this.event_prompt_name = name;
  326. // 判断冠军杯活动是否有数据
  327. this.isDataShow = num == 0 ? true : false;
  328. //判断是否显示搜索框
  329. if (id != 4) {
  330. this.searchShow = true;
  331. } else{
  332. this.championGroup(this.data.StChampion);
  333. this.searchShow = false;
  334. }
  335. },
  336. /*---------------------------------------------*/
  337. //删除搜索框数据
  338. delinputvalue() {
  339. this.SerchValue = "";
  340. this.Serchchange = false;
  341. this.getAjax();
  342. },
  343. /*---------------------------------------------- */
  344. //
  345. toggle: function(index, id) {
  346. this.active = index;
  347. this.datetimeNum = id;
  348. console.log("id", this.datetimeNum);
  349. this.SerchValue = "";
  350. },
  351. /*----------------------------------------------- */
  352. // 返回上一层页面
  353. isreturn() {
  354. history.go(-1);
  355. },
  356. /*---------------------------------------------- */
  357. //获取input输入的值查询数据
  358. serchchange(val) {
  359. if (val.length >= 1) {
  360. this.Serchchange = true;
  361. } else {
  362. this.Serchchange = false;
  363. }
  364. this.getAjax(val);
  365. },
  366. /*---------------------------------------------- */
  367. //显示隐藏赛事类型
  368. IsSoccerGameClick(isclick) {
  369. this.isSoccerGameClick = !isclick;
  370. },
  371. /*---------------------------------------------- */
  372. //
  373. matchInfo(id) {
  374. this.$router.push({
  375. path: "/StRollBallBettingPage",
  376. query: { gameCode: this.game_code, name: this.title }
  377. });
  378. this.$store.dispatch("MACTH_ID", id);
  379. },
  380. /*---------------------------------------------- */
  381. //获取冠军杯数据
  382. getAjax(search) {
  383. this.$store.dispatch("GETSHOW", true);
  384. this.$http.get(this.$ports.match.ChampionsCup, { search }).then(res => {
  385. this.lg_id=res.data.data.lg_id;
  386. if (res.data.data && res.data.status == 1) {
  387. let resData = res.data.data;
  388. this.data = resData;
  389. //设置冠军杯title信息和数据
  390. this.Regulations.forEach(e => {
  391. if (e.id == 1) {
  392. e.name =resData.StRollBall.typeName;
  393. e.num =resData.StRollBall.matchNum;
  394. } else if (e.id == 2) {
  395. e.name =resData.StToday.typeName;
  396. e.num =resData.StToday.matchNum;
  397. } else if (e.id == 3) {
  398. e.name =resData.StMorningPlate.typeName;
  399. e.num =resData.StMorningPlate.matchNum;
  400. } else if (e.id == 4) {
  401. //console.log(33);
  402. e.name =resData.StChampion.typeName;
  403. e.num =resData.StChampion.matchNum;
  404. }
  405. });
  406. console.log("list", this.Regulations);
  407. // if (this.listnum != 4) {
  408. // this.searchShow = true;
  409. // //this.data = res.data.data;
  410. // }else
  411. if (this.listnum == 4){
  412. this.searchShow = false;
  413. //this.data = res.data.data.StChampion;
  414. let champion = {},
  415. title = "",
  416. stiTime = "",
  417. //matchData = [],
  418. chamData = [];
  419. title = Object.keys(this.data.matchData);
  420. let val = Object.values(this.data.matchData);
  421. title.forEach((e, index) => {
  422. chamData.push({
  423. name: e,
  424. data: val[index]
  425. });
  426. });
  427. chamData.forEach(res => {
  428. res.last_time = res.data.last_time;
  429. let resData = Object.values(res.data);
  430. let resTitle = Object.keys(res.data);
  431. res.data = [];
  432. resTitle.forEach((e, index) => {
  433. if (e !== "last_time") {
  434. res.data.push({
  435. title: e,
  436. datas: resData[index]
  437. });
  438. }
  439. });
  440. });
  441. // this.ChampionData = chamData;
  442. this.championGroup(chamData);
  443. }else if(this.listnum == 3){
  444. if( this.data.StMorningPlate.matchData.length < 1){
  445. this.isDataShow = true;
  446. }else{
  447. this.isDataShow = false;
  448. this.dataGroup(this.data)
  449. }
  450. }
  451. // // 取值出来进行判定
  452. // if (this.data.StMorningPlate.matchData && this.data.StMorningPlate.matchData.length < 1) {
  453. // this.isDataShow = true;
  454. // } else if (this.data.StMorningPlate.matchData && this.data.StMorningPlate.matchData.length > 0) {
  455. // this.isDataShow = false;
  456. // // console.log('dtaa',this.data)
  457. // console.log("找不到", this.data);
  458. // }
  459. // if (this.listnum == 4) {
  460. // if (this.data.StChampion.matchData == null) {
  461. // this.isDataShow = true;
  462. // } else {
  463. // this.isDataShow = false;
  464. // }
  465. // }
  466. }
  467. this.title = res.data.data.leagueName;
  468. let _this = this;
  469. setTimeout(function() {
  470. _this.$store.dispatch("GETSHOW", false);
  471. }, 500);
  472. });
  473. },
  474. /*--------------------------------------------------------------------------------*/
  475. // 添加、删除vuex投注数据公共方法
  476. AddDelete: function(
  477. match_id,
  478. id,
  479. home,
  480. guest,
  481. name,
  482. odds,
  483. condition,
  484. odds_only,
  485. odds_code,
  486. type,
  487. p_code
  488. ) {
  489. console.log(id);
  490. let isAdd = true;
  491. let matchList = this.$store.getters.getBetting;
  492. let bettingInfo = {
  493. id,
  494. home_team: home,
  495. guest_team: guest,
  496. name,
  497. odds,
  498. match_id,
  499. lg_id:this.lg_id,
  500. odds_id:id,
  501. condition,
  502. ballId: this.$store.getters.getBallId,
  503. odds_code: odds_code,
  504. p_code: p_code,
  505. play_name:
  506. odds_code == "concede_home" || odds_code == "concede_guest"
  507. ? "让球"
  508. : "大小",
  509. score: this.score,
  510. bettingTime: "",
  511. odds_only
  512. };
  513. console.log(matchList);
  514. // console.log('11111', this.thisNum)
  515. if (this.plateNum != 10000) {
  516. //删除vuex投注数据
  517. matchList[this.plateNum].data.forEach((res, index) => {
  518. if (res.id == id) {
  519. matchList[this.plateNum].data.splice(index, 1);
  520. // this.$store.dispatch("ISBETTING",false);
  521. this.$store.dispatch("SET_LIMIT", false);
  522. this.$store.dispatch("BETTING", []);
  523. this.$store.dispatch("BETTING", matchList);
  524. isAdd = false;
  525. //处理当前页面样式
  526. this.modifyStyle(id, type);
  527. }
  528. });
  529. //添加vuex投注数据
  530. if (isAdd) {
  531. if (this.$store.getters.getLimit * 1 >= 10) return false;
  532. //处理当前页面样式
  533. this.modifyStyle(id, type);
  534. matchList[this.plateNum].data.push(bettingInfo);
  535. this.$store.dispatch("BETTING", []);
  536. this.$store.dispatch("BETTING", matchList);
  537. if (this.$store.getters.getIsBetting == '100') return false;
  538. this.$store.dispatch("ISBETTING", '100');
  539. }
  540. } else {
  541. //添加新的玩法赔率数据
  542. let obj = {
  543. title: "concede_size",
  544. data: [bettingInfo]
  545. };
  546. //判断vuex有误其它玩法数据
  547. if (matchList) {
  548. matchList.push(obj);
  549. } else {
  550. this.$store.dispatch("BETTING", [obj]);
  551. }
  552. //处理当前页面样式
  553. this.modifyStyle(id, type);
  554. if (this.$store.getters.getIsBetting == '100') return false;
  555. this.$store.dispatch("ISBETTING", '100');
  556. }
  557. },
  558. /*--------------------------------------------------------------------------------*/
  559. //修改当前页面样式公共方法
  560. modifyStyle: function(id, type) {
  561. // console.log(id,type)
  562. // console.log('data', this.data)
  563. // console.log('错值', this.data);
  564. this.data.StMorningPlate.matchData.every(e => {
  565. // console.log('e',e)
  566. // let ret = false;
  567. if (type == "homeOdds") {
  568. e.oddsData.homeOdds.every((res, index) => {
  569. if (res.id == id) {
  570. this.$set(
  571. e.oddsData.homeOdds[index],
  572. "isTrue",
  573. res.isTrue ? false : true
  574. );
  575. // ret = true;
  576. this.$forceUpdate();
  577. return false;
  578. }
  579. return true;
  580. // console.log(e.oddsData.homeOdds[index])
  581. });
  582. } else if (type == "guestOdds") {
  583. e.oddsData.guestOdds.every((res, index) => {
  584. if (res.id == id) {
  585. this.$set(
  586. e.oddsData.guestOdds[index],
  587. "isTrue",
  588. res.isTrue ? false : true
  589. );
  590. // ret = true;
  591. this.$forceUpdate();
  592. return false;
  593. }
  594. return true;
  595. });
  596. }
  597. return true;
  598. if (ret) {
  599. return false;
  600. } else {
  601. return true;
  602. }
  603. });
  604. },
  605. /*--------------------------------------------------------------------------------*/
  606. // 修改投注样式
  607. bteBetting(
  608. match_id,
  609. id,
  610. home,
  611. guest,
  612. name,
  613. odds,
  614. condition,
  615. odds_only,
  616. odds_code,
  617. type,
  618. p_code,
  619. status
  620. ) {
  621. if(odds >0){
  622. if(status == '-1') return false;
  623. if (this.data) {
  624. //处理vuex里面数据
  625. this.AddDelete(
  626. match_id,
  627. id,
  628. home,
  629. guest,
  630. name,
  631. odds,
  632. condition,
  633. odds_only,
  634. odds_code,
  635. type,
  636. p_code
  637. );
  638. //处理当前页面样式
  639. // this.modifyStyle(id, type);
  640. }
  641. }
  642. },
  643. /*--------------------------------------------------------------------------------*/
  644. //早盘赛事赔率玩法数据组合方法
  645. dataGroup: function(data) {
  646. let homeOdds = [],
  647. guestOdds = [];
  648. let A, B, C, D;
  649. this.getTypeBetting('concede_size')
  650. data.StMorningPlate.matchData.forEach((column, index) => {
  651. if (column.oddsData == null || column.oddsData.length == 0) {
  652. column.oddsData = {
  653. homeOdds: [{ status: -1 }, { status: -1 }],
  654. guestOdds: [{ status: -1 }, { status: -1 }]
  655. };
  656. } else {
  657. console.log('1', this.betting)
  658. column.oddsData.forEach(val => {
  659. if (this.betting != 10000) {
  660. this.betting.forEach(e => {
  661. e.data.forEach(k =>{
  662. if (val.id == k.id) {
  663. // console.log('1aval',val.id,k.id)
  664. // val.isTrue = true;
  665. this.$set(val,'isTrue',true);
  666. }
  667. })
  668. });
  669. } else {
  670. val.isTrue = false;
  671. }
  672. if (val.odds_code == "concede_home") {
  673. A = val;
  674. } else if (val.odds_code == "size_home") {
  675. B = val;
  676. } else if (val.odds_code == "concede_guest") {
  677. C = val;
  678. } else if (val.odds_code == "size_guest") {
  679. D = val;
  680. }
  681. });
  682. column.oddsData = {};
  683. column.oddsData.homeOdds = [];
  684. if (A != undefined) {
  685. column.oddsData.homeOdds.push(A);
  686. }
  687. if (B != undefined) {
  688. column.oddsData.homeOdds.push(B);
  689. }
  690. column.oddsData.guestOdds = [];
  691. if (C != undefined) {
  692. column.oddsData.guestOdds.push(C);
  693. }
  694. if (D != undefined) {
  695. column.oddsData.guestOdds.push(D);
  696. }
  697. }
  698. });
  699. this.title = data.typeName;
  700. },
  701. /*--------------------------------------------------- */
  702. //冠军
  703. championGroup(data){
  704. console.log('a1',data)
  705. let champion = {},stiTime = "",chamData = [];
  706. let title = Object.keys(data.matchData);
  707. let val = Object.values(data.matchData);
  708. let championBet = this.getTypeBetting('gj');
  709. title.forEach((e, index) => {
  710. chamData.push({
  711. name: e,
  712. data: val[index]
  713. });
  714. });
  715. chamData.forEach(res => {
  716. res.last_time = res.data.last_time;
  717. let resData = Object.values(res.data);
  718. let resTitle = Object.keys(res.data);
  719. res.data = [];
  720. resTitle.forEach((e, index) => {
  721. if (e !== "last_time") {
  722. if(championBet != '-1'){
  723. championBet.forEach(bet=>{
  724. resData[index].forEach(val =>{
  725. //
  726. if(bet.id == val.id){
  727. //console.log('冠军',val)
  728. val.isTrue = true;
  729. }
  730. })
  731. })
  732. }
  733. res.data.push({
  734. title: e,
  735. datas: resData[index]
  736. });
  737. }
  738. });
  739. });
  740. this.ChampionData = chamData;
  741. console.log('冠军', this.ChampionData);
  742. },
  743. /*------------------------------------------ */
  744. //今日
  745. /*------------------------------------------ */
  746. //滚球
  747. /*--------------------------------------*/
  748. //
  749. /*---------------------------------------*/
  750. //获取vueX相对应投注信息
  751. getTypeBetting:function(type){
  752. let data = '-1';
  753. if(this.betting.length>0){
  754. this.betting.forEach((e,index)=>{
  755. console.log('title',e.title)
  756. if ("concede_size" == e.title) {
  757. this.plateNum = index;
  758. data = e.data;
  759. }else if('gj' == e.title){
  760. this.thisNum = index;
  761. data = e.data;
  762. }
  763. // if(e.title ==type){
  764. // data = e.data;
  765. // this.thisNum =index;
  766. // }
  767. })
  768. }else{
  769. data ='-1'
  770. }
  771. return data;
  772. }
  773. },
  774. mounted() {
  775. // 默认选中数据
  776. this.listnum = 3;
  777. // 获取是否滑动信息
  778. if (this.$public.getCache("box_size") == 1) {
  779. this.isshrink = true;
  780. }
  781. //是否展示投注框
  782. if (this.$store.getters.getIsBetting =='100') {
  783. this.isBettingWindow = '100';
  784. }
  785. //获取vuex玩法已投注相对应的数据
  786. if(this.$store.getters.getBetting){
  787. this.betting = this.$store.getters.getBetting;
  788. }
  789. // if (getBetting) {
  790. // getBetting.forEach((e, index) => {
  791. // ///console.log((e.title).split("_")[1])
  792. // if ("concede_size" == e.title) {
  793. // this.thisNum = index;
  794. // if (e.data.length > 0) {
  795. // this.betting = e.data;
  796. // }
  797. // //console.log('beeeeting',this.betting)
  798. // }else if('gj' == (e.title).split("_")[1]){
  799. // console.log(e);
  800. // this.thisNum = index;
  801. // if (e.data.length > 0) {
  802. // this.betting = e.data;
  803. // console.log('beeeeting',this.betting)
  804. // }
  805. // }
  806. // });
  807. // }
  808. this.getAjax();
  809. },
  810. computed: {
  811. getBetting() {
  812. return this.$store.getters.getBetting;
  813. },
  814. getIsBetting() {
  815. return this.$store.getters.getIsBetting;
  816. },
  817. //获取投注框删除的投注信息
  818. getDeleteType() {
  819. return this.$store.getters.getDeleteType;
  820. }
  821. },
  822. watch: {
  823. // 监听滚动状态变化赋值滚动
  824. getscorllcode(val) {
  825. this.scorll = val;
  826. },
  827. getDeleteType(val) {
  828. let flag = true;
  829. if(this.listnum == 3){
  830. this.data.StMorningPlate.matchData.forEach(e => {
  831. if (val == "all") {
  832. e.oddsData.guestOdds.forEach(data => {
  833. this.$set(data, "isTrue", false);
  834. });
  835. e.oddsData.homeOdds.forEach(data => {
  836. this.$set(data, "isTrue", false);
  837. });
  838. } else {
  839. let showData = true;
  840. e.oddsData.guestOdds.forEach(data => {
  841. if (data.id == val) {
  842. this.$set(data, "isTrue", false);
  843. showData = false;
  844. }
  845. });
  846. if (showData) {
  847. e.oddsData.homeOdds.forEach(data => {
  848. if (data.id == val) {
  849. this.$set(data, "isTrue", false);
  850. }
  851. });
  852. }
  853. }
  854. });
  855. }else if(this.listnum == 4){
  856. this.ChampionData.forEach(e =>{
  857. if(val == 'all'){
  858. e.data.forEach(k =>{
  859. k.datas.forEach(i =>{
  860. this.$set(i,'isTrue',false)
  861. })
  862. })
  863. }else{
  864. let showData = true;
  865. e.data.forEach(k =>{
  866. k.datas.forEach(i =>{
  867. if(i.id == val){
  868. this.$set(i,'isTrue',false)
  869. showData = false;
  870. }
  871. })
  872. })
  873. if(showData){
  874. e.data.forEach(k =>{
  875. k.datas.forEach(i =>{
  876. if(i.id == val){
  877. this.$set(i,'isTrue',false)
  878. }
  879. })
  880. })
  881. }
  882. }
  883. })
  884. }
  885. },
  886. /*--------------------------------------------------------------------------------*/
  887. //获取已投注信息
  888. getBetting(val) {
  889. //获取vuex玩法已投注相对应的数据
  890. if (val) {
  891. val.forEach((e, index) => {
  892. if ("concede_size" == e.title) {
  893. this.plateNum = index;
  894. this.betting = e.data;
  895. }else if('gj' == e.title){
  896. this.thisNum = index;
  897. this.betting = e.data;
  898. // console.log('betting', this.betting)
  899. }
  900. });
  901. }
  902. },
  903. /*--------------------------------------------------------------------------------*/
  904. // 监听投注框开关
  905. getIsBetting(val) {
  906. console.log('val',val)
  907. this.isBettingWindow = val;
  908. }
  909. }
  910. };
  911. </script>
  912. <style scoped>
  913. .event_prompt {
  914. height: 0.88rem;
  915. background: #737373;
  916. color: #a6a6a6;
  917. padding-left: 0.3rem;
  918. }
  919. .Soccer-game-num {
  920. display: inline-block;
  921. width: 0.4rem;
  922. height: 0.4rem;
  923. border-radius: 50%;
  924. background: #a6a6a6;
  925. color: #626262;
  926. margin-left: 0.1rem;
  927. line-height: 0.4rem;
  928. text-align: center;
  929. }
  930. .Soccer-game-num.active {
  931. background: #f76649;
  932. color: #f8f8f8;
  933. }
  934. .activity {
  935. background: #f76649;
  936. border: 2px solid #f76649 !important;
  937. }
  938. .act {
  939. transform: rotate(180deg);
  940. transition: 0.2s;
  941. }
  942. .return {
  943. transform: rotate(0deg);
  944. transition: 0.2s;
  945. }
  946. .Serch {
  947. height: 0.88rem;
  948. display: flex;
  949. justify-content: space-between;
  950. align-items: center;
  951. background: linear-gradient(to bottom, #6a6a6a, #565656);
  952. color: #f76649;
  953. font-family: "PingFang-SC-Regular";
  954. padding: 0 0.33rem;
  955. }
  956. .returnimg {
  957. width: 0.37rem;
  958. height: 0.3rem;
  959. margin-right: 0.1rem;
  960. }
  961. .Serch-box {
  962. display: flex;
  963. align-items: center;
  964. }
  965. .Serch-box-input {
  966. width: 3.8rem;
  967. border: none;
  968. position: absolute;
  969. height: 0.44rem;
  970. line-height: 0.44rem;
  971. left: 0.5rem;
  972. color: #aaa;
  973. }
  974. .Serch-box-img {
  975. width: 0.3rem;
  976. height: 0.3rem;
  977. position: absolute;
  978. left: 0.1rem;
  979. top: 0.06rem;
  980. }
  981. .Serch-box-del {
  982. width: 0.2rem;
  983. height: 0.2rem;
  984. position: absolute;
  985. right: 0.2rem;
  986. }
  987. .Serch-box-home {
  988. height: 0.45rem;
  989. line-height: 0.45rem;
  990. width: 4.2rem;
  991. background: #e4e4e4;
  992. border-radius: 0.2rem;
  993. display: flex;
  994. justify-content: space-around;
  995. align-items: center;
  996. padding-left: 0.1rem;
  997. padding-right: 0.1rem;
  998. position: relative;
  999. }
  1000. .Soccer-game-title {
  1001. height: 0.88rem;
  1002. font-size: 0.23rem;
  1003. }
  1004. .Soccer-game-title .tit {
  1005. font-size: 0.3rem;
  1006. }
  1007. .Soccer-game-box {
  1008. height: 0.88rem;
  1009. background-color: #626262;
  1010. }
  1011. .Soccer-game-box > p {
  1012. margin-left: 0.3rem;
  1013. color: #a6a6a6;
  1014. }
  1015. .Soccer-game-box p.active {
  1016. color: #f76649;
  1017. }
  1018. .Soccer-game-src {
  1019. width: 0.25rem;
  1020. height: 0.15rem;
  1021. /* margin-left: .3rem */
  1022. }
  1023. .Match-title-num {
  1024. width: 0.46rem;
  1025. height: 0.46rem;
  1026. line-height: 0.46rem;
  1027. text-align: center;
  1028. background: #f76649;
  1029. font-size: 0.26rem;
  1030. border-radius: 50%;
  1031. color: #f5f5f5;
  1032. }
  1033. .Match-box-top-right > span {
  1034. width: 1.07rem;
  1035. text-align: center;
  1036. }
  1037. .Match-box {
  1038. height: 2.45rem;
  1039. }
  1040. .name-box {
  1041. height: 1.76rem;
  1042. }
  1043. .Match-box-top {
  1044. height: 0.45rem;
  1045. line-height: 0.45rem;
  1046. background: #dcdcdc;
  1047. font-size: 0.23rem;
  1048. padding: 0 0.32rem;
  1049. }
  1050. .Match-box-top-num {
  1051. width: 0.64rem !important;
  1052. height: 0.45rem;
  1053. background: #ebebeb;
  1054. font-size: 0.24rem;
  1055. }
  1056. .Match-box {
  1057. background: #f8f8f8;
  1058. }
  1059. .Match-bottom-right {
  1060. height: 2rem;
  1061. padding: 0.1rem 0.1rem 0 0.14rem;
  1062. }
  1063. .Match-list-left div {
  1064. width: 1.07rem;
  1065. height: 0.76rem;
  1066. border: 1px solid #e4e4e4;
  1067. border-radius: 0.1rem;
  1068. padding: 0.1rem;
  1069. margin: 0.06rem 0.08rem;
  1070. }
  1071. .Match-list-right div {
  1072. width: 1.07rem;
  1073. height: 0.76rem;
  1074. border: 1px solid #e4e4e4;
  1075. border-radius: 0.1rem;
  1076. margin: 0.06rem 0.08rem;
  1077. }
  1078. /* 冠军 */
  1079. .champion .title {
  1080. height: 1rem;
  1081. padding: 0.15rem 0.2rem;
  1082. background-color: #626262;
  1083. }
  1084. .champion .title span {
  1085. font-size: 0.28rem;
  1086. font-weight: bold;
  1087. color: #e1e1df;
  1088. }
  1089. .champion .title .time span:nth-child(2) {
  1090. color: #f76649;
  1091. }
  1092. .chmpTit {
  1093. height: 0.7rem;
  1094. line-height: 0.7rem;
  1095. padding: 0 0.2rem;
  1096. background: #e4e4e4;
  1097. }
  1098. .champion .list {
  1099. height: 1rem;
  1100. line-height: 0.6rem;
  1101. padding: 0.1rem 0.2rem;
  1102. width: 100%;
  1103. display: -webkit-box;
  1104. display: -ms-flexbox;
  1105. display: flex;
  1106. -webkit-box-pack: justify;
  1107. -ms-flex-pack: justify;
  1108. justify-content: space-between;
  1109. border-bottom: 1px solid #aaa;
  1110. font-size: 0.28rem;
  1111. background: #ffffff;
  1112. }
  1113. .champion .list span:nth-child(1) {
  1114. margin-top: 0.1rem;
  1115. }
  1116. .champion .list .num {
  1117. width: 1.07rem;
  1118. height: 0.76rem;
  1119. border: 1px solid #e4e4e4;
  1120. border-radius: 0.1rem;
  1121. padding: 0.1rem;
  1122. text-align: center;
  1123. }
  1124. .col {
  1125. background: #f76649;
  1126. border: 2px solid #f76649 !important;
  1127. }
  1128. .col span {
  1129. color: #f4f4f4 !important;
  1130. }
  1131. .ratio {
  1132. width: 1rem;
  1133. height: 0.76rem;
  1134. border: 1px solid #cecece;
  1135. margin-right: 0.14rem;
  1136. border-radius: 0.1rem;
  1137. margin: 0.06rem;
  1138. }
  1139. </style>