89ba63b30039079b9fa12164a546d58ad0cbadf9.svn-base 17 KB

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