be0b04b52e309253a3a2ac1db57ee8e8ef52fd37.svn-base 19 KB

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