484c2ab90fbf1c7d16cf9ee967e8967ce40d252e.svn-base 16 KB

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