1ae687aef986c675ea97c0ab57f990c41bbc79b4.svn-base 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684
  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. {{Regulations.title}}
  8. </div>
  9. <div
  10. class="row center"
  11. style="height:0.88rem;margin-left:0.1rem;padding:0 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">
  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. @click="listActive(i.id)"
  42. v-for="(i,index) in Regulations.list"
  43. :key="index"
  44. :class="listnum==i.id?'active':''"
  45. >{{i.name}}</p>
  46. </div>
  47. <div v-if="this.$route.query.id =='zq'&& this.isTrue == true " class="box">
  48. <div id="NavSlide">
  49. <nav style="background:#ebebeb">
  50. <p v-for="(item,$index) in arr" @click="toggle($index,item.id)" :key="$index">
  51. <span :class="{active:$index==active}">{{item.title}}</span>
  52. </p>
  53. </nav>
  54. </div>
  55. </div>
  56. <div class="match" v-if="entryShow">
  57. <yd-accordion accordion>
  58. <div class="matchBox" v-for="items in data" :key="items.id">
  59. <yd-accordion-item :title="items.region" open>
  60. <div class="list">
  61. <div
  62. v-for="item in items.league_count"
  63. :key="item.lg_id"
  64. @click="goMatchInfo(item.lg_id )"
  65. >
  66. <span>{{item.league}}</span>
  67. <span class="num">{{item.count}}</span>
  68. </div>
  69. </div>
  70. </yd-accordion-item>
  71. </div>
  72. </yd-accordion>
  73. </div>
  74. <div v-if="noData">
  75. <NotOpend :title="this.info"/>
  76. </div>
  77. <!-- 参赛表 -->
  78. <div v-if="!entryShow" class="entry">
  79. <div
  80. class="list"
  81. v-for="item in entryList.info"
  82. :key="item.id"
  83. @click="goMatchInfo(item.lg_id,item.code,item.count )"
  84. >
  85. <span>{{item.name}}</span>
  86. <span class="num">{{item.count}}</span>
  87. </div>
  88. </div>
  89. </div>
  90. </template>
  91. <script>
  92. import NotOpend from "@/components/StNotOpend";
  93. import "../css/index.css";
  94. export default {
  95. data() {
  96. return {
  97. SerchValue: "",
  98. data: "", //联赛列表
  99. ballId: "", //球类别名
  100. noData: false, //没有数据为true
  101. datetimeNum: "", //赛事时间
  102. active: 0,
  103. listnum: 2, //赛事类型
  104. isTrue: true, //显示日期
  105. Serchchange: false,
  106. info: "没有相关联赛信息",
  107. isSoccerGameClick: true,
  108. entryShow: false, //显示参赛表
  109. entryList: "", // 参赛表数据
  110. img: {
  111. Soccerimg1: require("../assets/st-imges/soccer1.png"),
  112. Soccerimg2: require("../assets/st-imges/soccer1.png"),
  113. Serchimg: require("../assets/st-imges/sousuo.png"),
  114. Serchdel: require("../assets/st-imges/del.png"),
  115. searchreturn: require("../assets/st-imges/returnbox.png")
  116. },
  117. Regulations: {
  118. title: " ",
  119. list: [
  120. { id: 1, name: "参赛表" },
  121. { id: 2, name: "赛事" },
  122. { id: 3, name: "冠军盘口" }
  123. ]
  124. },
  125. active: 0,
  126. arr: [{ id: "", title: "所有赛事" }, { id: "today", title: "今日赛事" }],
  127. timers: true,
  128. getIsShow:true,
  129. };
  130. },
  131. components: {
  132. NotOpend
  133. },
  134. created() {
  135. this.fun_date();
  136. },
  137. methods: {
  138. //设置一周赛事
  139. fun_date: function() {
  140. let date = new Date();
  141. let MonthNum = 0;
  142. let lastMonth = new Date(date.getFullYear(),date.getMonth() + 1,0).getDate();
  143. for (let i = 1; i < 7; i++) {
  144. let years = date.getFullYear();
  145. let month = date.getMonth() + 1;
  146. let day = date.getDate()+i < 10 ? "0" +(date.getDate()+i) : date.getDate()+i;
  147. if( date.getDate()+i > lastMonth){
  148. MonthNum ++;
  149. month = date.getMonth() + 2;
  150. day = "0" + MonthNum;
  151. }
  152. let time = {};
  153. time.id = years + "-" + month + "-" + day;
  154. time.title = years + "-" + month + "-" + day;
  155. this.arr.push(time);
  156. if (i == 6) {
  157. this.arr.push({ id: "morning", title: "早盘" });
  158. }
  159. }
  160. },
  161. //获取数据信息
  162. //game_code=球类型、search=联赛搜索关键字、datetime=日期搜索、event_type=赛事类型
  163. getAjaxInfo: function(url,typeGame,gameType,game_code,search,datetime,event_type
  164. ) {
  165. this.$http
  166. .get(url, { typeGame, gameType, search, datetime, event_type })
  167. .then(res => {
  168. if (
  169. res.status == 200 &&
  170. res.data.data != [] &&
  171. res.data.data != null
  172. ) {
  173. // console.log("数据", res.data);
  174. this.noData = false;
  175. if (this.listnum == 1) {
  176. this.entryList = res.data.data;
  177. // console.log("entry", this.entryList);
  178. }
  179. this.Regulations.title = res.data.data.type;
  180. if (res.data.data.info.length > 0) {
  181. this.data = res.data.data.info;
  182. } else {
  183. this.data = "";
  184. this.noData = true;
  185. }
  186. // this.$store.dispatch('GET_BALL_DATA',res.data);//将活动类别存入vuex里面
  187. }
  188. });
  189. let _this=this;
  190. setTimeout(()=>{
  191. _this.$store.dispatch('GETSHOW',false);
  192. },1000)
  193. },
  194. //获取冠军盘口数据
  195. getChampion: function(game_code, search) {
  196. this.$store.dispatch("GETSHOW", true);
  197. this.$http
  198. .get(this.$ports.match.matchState, {
  199. type_code: "StChampion",
  200. game_code,
  201. search
  202. })
  203. .then(res => {
  204. this.data = '';
  205. // console.log("res", res);
  206. if (
  207. res.data.status == 1 &&
  208. res.data.data.length > 0 &&
  209. res.data.data != null
  210. ) {
  211. this.data = res.data.data;
  212. this.noData = false;
  213. // console.log("res", res);
  214. } else {
  215. this.noData = true;
  216. }
  217. let _this = this;
  218. setTimeout(function(){
  219. _this.$store.dispatch('GETSHOW',false);
  220. },1000)
  221. });
  222. },
  223. //显示隐藏赛事类型
  224. IsSoccerGameClick(isclick) {
  225. this.isSoccerGameClick = !isclick;
  226. },
  227. //获取input输入的值查询数据
  228. serchchange(val) {
  229. if (val.length >= 1) {
  230. this.Serchchange = true;
  231. } else {
  232. this.Serchchange = false;
  233. }
  234. if (this.listnum == 2) {
  235. this.getAjaxInfo(
  236. this.$ports.match.matchData,
  237. "",
  238. this.$route.query.id,
  239. this.$route.query.id,
  240. val,
  241. this.datetimeNum,
  242. this.listnum
  243. );
  244. } else if (this.listnum == 3) {
  245. this.getChampion(this.$route.query.id, val);
  246. }
  247. },
  248. //删除搜索框数据
  249. delinputvalue() {
  250. this.SerchValue = "";
  251. this.Serchchange = false;
  252. if (this.listnum == 2) {
  253. this.getAjaxInfo(
  254. this.$ports.match.matchData,
  255. "",
  256. this.$route.query.id,
  257. this.$route.query.id,
  258. "",
  259. this.datetimeNum,
  260. this.listnum
  261. );
  262. } else if (this.listnum == 3) {
  263. this.getChampion(this.$route.query.id);
  264. }
  265. },
  266. //切换赛事类型
  267. listActive(id) {
  268. if (this.listnum == id) return false;
  269. this.SerchValue = "";
  270. this.listnum = id;
  271. if (id == 2) {
  272. this.entryList = ''
  273. this.isTrue = true;
  274. this.entryShow = true;
  275. this.getAjaxInfo(
  276. this.$ports.match.matchData,
  277. "",
  278. this.$route.query.id,
  279. this.$route.query.id,
  280. "",
  281. this.datetimeNum,
  282. id
  283. );
  284. }else if(id == 1){
  285. this.isTrue = false;
  286. this.entryShow = false;
  287. this.data = '';
  288. this.getAjaxInfo(this.$ports.match.participate, this.$route.query.id);
  289. }
  290. else {
  291. this.isTrue = false;
  292. this.entryShow = true;
  293. this.getChampion(this.$route.query.id);
  294. }
  295. },
  296. //切换日期时间
  297. toggle: function(index, id) {
  298. this.active = index;
  299. this.datetimeNum = id;
  300. // console.log("id", this.datetimeNum);
  301. this.SerchValue = "";
  302. this.getAjaxInfo(
  303. this.$ports.match.matchData,
  304. "",
  305. this.$route.query.id,
  306. this.$route.query.id,
  307. "",
  308. id,
  309. this.listnum
  310. );
  311. },
  312. //打开联赛投注页面
  313. goMatchInfo: function(sessionId, code,count) {
  314. this.$store.dispatch("GETACTIVITY", 'home')
  315. if(count == 0){
  316. }else{
  317. if (this.listnum == 3) {
  318. this.$router.push({
  319. path: "StLeagueList",
  320. query: {
  321. game_code: this.ballId,
  322. leagueID: sessionId,
  323. name: this.Regulations.title,
  324. matchDate: this.datetimeNum,
  325. code: code,
  326. champion: 3
  327. }
  328. });
  329. } else if (this.listnum == 2) {
  330. this.$router.push({
  331. path: "StLeagueList",
  332. query: {
  333. game_code: this.ballId,
  334. leagueID: sessionId,
  335. name: this.Regulations.title,
  336. matchDate: this.datetimeNum,
  337. code: code,
  338. matchDtl: 2
  339. }
  340. });
  341. } else {
  342. this.$router.push({
  343. path: "StLeagueList",
  344. query: {
  345. game_code: this.ballId,
  346. leagueID: sessionId,
  347. name: this.Regulations.title,
  348. matchDate: this.datetimeNum,
  349. lg_id : '',
  350. code: code,
  351. getIsShow:true,
  352. }
  353. });
  354. }
  355. }
  356. },
  357. // 返回上一层页面
  358. isreturn() {
  359. history.go(-1);
  360. }
  361. },
  362. mounted() {
  363. if(this.getIsShow){
  364. this.$store.dispatch("GETSHOW", true);
  365. this.getIsShow = false;
  366. }
  367. let _this = this;
  368. this.$public.ajaxTimerFun(function(timing) {
  369. if (_this.timers) {
  370. _this.getAjaxInfo(
  371. _this.$ports.match.matchData,
  372. "",
  373. _this.$route.query.id,
  374. _this.$store.getters.getBallId
  375. );
  376. }else{
  377. clearInterval(timing);
  378. }
  379. },(1000*180));
  380. //分球的类型获取默认数据
  381. this.ballId = this.$route.query.id;
  382. //console.log(this.$route.query.id);
  383. this.$store.dispatch("GETSHOW", true);
  384. this.getAjaxInfo(
  385. this.$ports.match.matchData,
  386. "",
  387. this.$route.query.id,
  388. this.$store.getters.getBallId
  389. );
  390. if (this.listnum == 2) {
  391. this.entryShow = true;
  392. }
  393. },
  394. computed: {
  395. changeListNum() {
  396. return this.listnum;
  397. }
  398. },
  399. watch: {
  400. changeListNum(val) {
  401. let _this = this;
  402. this.timers = false;
  403. if (val == 1) {
  404. this.timers = true;
  405. this.$public.ajaxTimerFun(function(timing) {
  406. if (_this.timers) {
  407. _this.getAjaxInfo(
  408. _this.$ports.match.participate,
  409. _this.$route.query.id
  410. );
  411. }else{
  412. clearInterval(timing);
  413. }
  414. },(1000*180));
  415. } else if (val == 2) {
  416. this.timers = true;
  417. this.$public.ajaxTimerFun(function(timing) {
  418. if (_this.timers) {
  419. _this.getAjaxInfo(
  420. _this.$ports.match.matchData,
  421. "",
  422. _this.$route.query.id,
  423. _this.$route.query.id,
  424. "",
  425. _this.datetimeNum,
  426. '2'
  427. );
  428. }else{
  429. clearInterval(timing);
  430. }
  431. },(1000*180));
  432. } else {
  433. this.timers = true;
  434. this.$public.ajaxTimerFun(function(timing) {
  435. if (_this.timers) {
  436. _this.getChampion(_this.$route.query.id);
  437. }else{
  438. clearInterval(timing);
  439. }
  440. },(1000*180));
  441. }
  442. }
  443. },
  444. beforeDestroy() {
  445. this.timers = false;
  446. }
  447. };
  448. </script>
  449. <style scoped>
  450. .act {
  451. transform: rotate(180deg);
  452. transition: 0.2s;
  453. }
  454. .return {
  455. transform: rotate(0deg);
  456. transition: 0.2s;
  457. }
  458. .Serch {
  459. height: 0.88rem;
  460. display: flex;
  461. justify-content: space-between;
  462. align-items: center;
  463. background: linear-gradient(to bottom, #6a6a6a, #565656);
  464. color: #f76649;
  465. font-family: "PingFang-SC-Regular";
  466. padding: 0 0.33rem;
  467. }
  468. .returnimg {
  469. width: 0.37rem;
  470. height: 0.3rem;
  471. margin-right: 0.1rem;
  472. }
  473. .Serch-box {
  474. display: flex;
  475. align-items: center;
  476. }
  477. .Serch-box-input {
  478. width: 3.8rem;
  479. border: none;
  480. position: absolute;
  481. height: 0.44rem;
  482. line-height: 0.44rem;
  483. left: 0.5rem;
  484. color: #aaa;
  485. }
  486. .Serch-box-img {
  487. width: 0.3rem;
  488. height: 0.3rem;
  489. position: absolute;
  490. left: 0.1rem;
  491. top: 0.06rem;
  492. }
  493. .Serch-box-del {
  494. width: 0.2rem;
  495. height: 0.2rem;
  496. position: absolute;
  497. right: 0.2rem;
  498. }
  499. .Serch-box-home {
  500. height: 0.45rem;
  501. line-height: 0.45rem;
  502. width: 4.73rem;
  503. background: #e4e4e4;
  504. border-radius: 0.2rem;
  505. display: flex;
  506. justify-content: space-around;
  507. align-items: center;
  508. padding-left: 0.1rem;
  509. padding-right: 0.1rem;
  510. position: relative;
  511. }
  512. .Soccer-game-title {
  513. height: 0.88rem;
  514. font-size: 0.3rem;
  515. }
  516. .Soccer-game-box {
  517. height: 0.88rem;
  518. /* padding: 0 0.32rem; */
  519. background-color: #626262;
  520. }
  521. .Soccer-game-box > p {
  522. margin: 0.3rem;
  523. color: #a6a6a6;
  524. }
  525. .Soccer-game-box p.active {
  526. color: #f76649;
  527. }
  528. .Soccer-game-src {
  529. width: 0.25rem;
  530. height: 0.15rem;
  531. /* margin-left: .3rem */
  532. }
  533. .box {
  534. background: #ebebeb;
  535. padding: 0 0.14rem;
  536. }
  537. #NavSlide {
  538. width: 100%;
  539. height: .88rem;
  540. overflow: hidden;
  541. background: #ebebeb;
  542. }
  543. #NavSlide nav {
  544. display: -webkit-box;
  545. display: -ms-flexbox;
  546. display: flex;
  547. -webkit-box-align: middle;
  548. -ms-flex-align: middle;
  549. align-items: middle;
  550. overflow: auto;
  551. }
  552. #NavSlide p {
  553. text-align: center;
  554. font-size: 0.28rem;
  555. -ms-flex-negative: 0;
  556. flex-shrink: 0;
  557. padding: 0 0.1rem;
  558. margin: 0 0.05rem;
  559. color: #b8b8b8;
  560. height: 0.88rem;
  561. line-height: 0.88rem;
  562. }
  563. /* #NavSlide p a{
  564. color: #E5E5E5;
  565. text-decoration: none;
  566. } */
  567. #NavSlide p span.active {
  568. color: #363636;
  569. }
  570. .yd-cell-box .yd-cell {
  571. z-index: 99;
  572. border-radius: 0.2rem;
  573. }
  574. .matchBox {
  575. margin-bottom: 0.12rem;
  576. background: #f9f9f9;
  577. padding: 0.27rem 0.34rem 0 0.32rem;
  578. }
  579. div /deep/ .yd-accordion-head {
  580. padding: 0 0.13rem 0 0;
  581. }
  582. div /deep/ .yd-accordion-content:after {
  583. height: 0;
  584. }
  585. .match .tit {
  586. display: flex;
  587. justify-content: space-between;
  588. font-size: 0.32rem;
  589. margin-bottom: 0.3rem;
  590. }
  591. .match .list {
  592. overflow: hidden;
  593. transition: all 0.3s cubic-bezier(0.4, 0.6, 0.2, 1);
  594. }
  595. .match .list div {
  596. background: #dcdcdc;
  597. width: 100%;
  598. height: 0.88rem;
  599. padding: 0.26rem 0.56rem 0.3rem 0.3rem;
  600. display: flex;
  601. align-items: center;
  602. justify-content: space-between;
  603. border-radius: 0.08rem;
  604. margin-bottom: 0.12rem;
  605. }
  606. div /deep/ .yd-accordion-head:after {
  607. height: 0;
  608. }
  609. .match .list span {
  610. color: #333333;
  611. font-size: 0.28rem;
  612. }
  613. .match .list .num {
  614. width: 0.4rem;
  615. height: 0.4rem;
  616. display: inline-block;
  617. line-height: 0.4rem;
  618. text-align: center;
  619. color: #f5f5f5;
  620. border-radius: 50%;
  621. font-size: 0.2rem;
  622. background: #f76649;
  623. }
  624. .yd-accordion {
  625. background: transparent;
  626. }
  627. .match .list div:nth-last-child(1) {
  628. margin-bottom: 0.34rem;
  629. }
  630. div /deep/ .yd-accordion-head,
  631. div /deep/ .yd-accordion-head-content,
  632. div /deep/ .yd-accordion-title,
  633. div /deep/ .yd-accordion-title-full {
  634. height: 0.3rem;
  635. }
  636. div /deep/ .yd-accordion-title {
  637. min-height: 0;
  638. }
  639. div /deep/ .yd-accordion-head {
  640. margin-bottom: 0.3rem;
  641. }
  642. div /deep/ .yd-accordion-head-arrow:after {
  643. border: none;
  644. width: 0.4rem;
  645. height: 0.4rem;
  646. background: url("../assets/st-imges/xiangxia.png") no-repeat;
  647. background-size: 0.4rem 0.4rem;
  648. }
  649. /* 参赛表 */
  650. .entry .list {
  651. height: 1rem;
  652. line-height: 0.6rem;
  653. padding: 0.2rem;
  654. width: 100%;
  655. display: flex;
  656. background: #a0a0a0;
  657. color: #fefefe;
  658. justify-content: space-between;
  659. border-bottom: 1px solid #aaa;
  660. font-size: 0.28rem;
  661. }
  662. .entry .list .num {
  663. margin-top: 0.1rem;
  664. width: 0.4rem;
  665. height: 0.4rem;
  666. display: inline-block;
  667. line-height: 0.4rem;
  668. text-align: center;
  669. color: #f5f5f5;
  670. border-radius: 50%;
  671. font-size: 0.2rem;
  672. background: #f76649;
  673. }
  674. </style>