b29db425aca1ea54d41aba1397c46834edb0e224.svn-base 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  1. <template>
  2. <div>
  3. <div class="Serch">
  4. <div class="Soccer-game row center" >
  5. <div class="Soccer-game-title row center" ><img class="returnimg" :src="img.searchreturn" @click="isreturn()"/>{{Regulations.title}}</div>
  6. <div class="row center" style="height:0.88rem;margin-left:0.1rem;padding:0 0.1rem;" @click="IsSoccerGameClick(isSoccerGameClick)">
  7. <img :class="isSoccerGameClick==true?'Soccer-game-src act':'Soccer-game-src return'" :src="img.Soccerimg1" />
  8. </div>
  9. </div>
  10. <div class="Serch-box">
  11. <div class="Serch-box-home">
  12. <img class="Serch-box-img" :src="img.Serchimg" />
  13. <input v-model="SerchValue" @input="serchchange(SerchValue)" class="Serch-box-input" type="text" placeholder="请输入联赛名称" />
  14. <img class="Serch-box-del" @click="delinputvalue()" v-if="Serchchange==true" :src="img.Serchdel" />
  15. </div>
  16. </div>
  17. </div>
  18. <div class="Soccer-game-box row" v-if="isSoccerGameClick==true">
  19. <p @click="listActive(i.id)" v-for="(i,index) in Regulations.list" :class="listnum==i.id?'active':''">
  20. {{i.name}}
  21. </p>
  22. </div>
  23. <div v-if="this.$route.query.id =='zq'&& this.isTrue == true " class="box">
  24. <div id="NavSlide">
  25. <nav>
  26. <p v-for="(item,$index) in arr" @click="toggle($index,item.id)">
  27. <span :class="{active:$index==active}">{{item.title}}</span>
  28. </p>
  29. </nav>
  30. </div>
  31. </div>
  32. <div class="match" v-if="entryShow">
  33. <yd-accordion accordion >
  34. <div class="matchBox" v-for="items in data" :key = "items.id">
  35. <yd-accordion-item :title= items.region open>
  36. <div class="list">
  37. <div v-for="item in items.league_count" :key="item.lg_id" @click="goMatchInfo(item.lg_id )">
  38. <span>{{item.league}}</span>
  39. <span class="num">{{item.count}}</span>
  40. </div>
  41. </div>
  42. </yd-accordion-item>
  43. </div>
  44. </yd-accordion>
  45. </div>
  46. <div v-if="noData">
  47. <NotOpend :title="this.info"/>
  48. </div>
  49. <!-- 参赛表 -->
  50. <div v-if="!entryShow" class="entry">
  51. <div class="list" v-for="item in entryList.info" :key="item.id" @click="goMatchInfo(item.lg_id,item.code )">
  52. <span>{{item.name}}</span>
  53. <span class="num">{{item.count}}</span>
  54. </div>
  55. </div>
  56. </div>
  57. </template>
  58. <script>
  59. import NotOpend from '@/components/StNotOpend';
  60. import '../css/index.css'
  61. export default {
  62. data() {
  63. return {
  64. SerchValue:"",
  65. data:'',//联赛列表
  66. ballId:'',//球类别名
  67. noData:false,//没有数据为true
  68. datetimeNum:'',//赛事时间
  69. active:0,
  70. listnum:2,//赛事类型
  71. isTrue:true,//显示日期
  72. Serchchange:false,
  73. info:'没有相关联赛信息',
  74. isSoccerGameClick:true,
  75. entryShow:false,//显示参赛表
  76. entryList:'', // 参赛表数据
  77. img:{
  78. Soccerimg1:require("../assets/st-imges/soccer1.png"),
  79. Soccerimg2:require("../assets/st-imges/soccer1.png"),
  80. Serchimg:require("../assets/st-imges/sousuo.png"),
  81. Serchdel:require("../assets/st-imges/del.png"),
  82. searchreturn:require("../assets/st-imges/returnbox.png")
  83. },
  84. Regulations:{
  85. title:" ",
  86. list:[{id:1,name:"参赛表"},{id:2,name:"赛事"},{id:3,name:"冠军盘口"}]
  87. },
  88. active:0,
  89. arr:[{id:'',title:'所有赛事'},{id:'today',title:"今日赛事"}]
  90. }
  91. },
  92. components:{
  93. NotOpend
  94. },
  95. created(){
  96. this.fun_date();
  97. },
  98. methods: {
  99. //设置一周赛事
  100. fun_date:function(){
  101. let date = new Date();
  102. let date2 = new Date(date);
  103. for(let i=1 ;i<7 ;i++){
  104. date2.setDate(date.getDate()+i);
  105. let years=date2.getFullYear();
  106. let month = (date2.getMonth()+1) < 10 ? '0'+(date2.getMonth()+1):(date2.getMonth()+1)
  107. let day = date2.getDate() < 10 ? '0'+date2.getDate() :date2.getDate();
  108. let time2 ={};
  109. time2.id = years+"-"+month+"-"+day;
  110. time2.title = years+"-"+month+"-"+day;
  111. this.arr.push(time2)
  112. if(i == 6){
  113. this.arr.push({id:'morning',title:'早盘'})
  114. }
  115. }
  116. },
  117. //获取数据信息
  118. //game_code=球类型、search=联赛搜索关键字、datetime=日期搜索、event_type=赛事类型
  119. getAjaxInfo:function(url,typeGame,gameType,game_code,search,datetime,event_type){
  120. this.$http.get(url,{typeGame,gameType,search,datetime,event_type}).then(res =>{
  121. this.$store.dispatch('GETSHOW',false);
  122. if(res.status == 200 && res.data.data !=[] && res.data.data != null){
  123. console.log('数据',res.data)
  124. if(this.listnum == 1){
  125. this.entryList = res.data.data;
  126. console.log('entry',this.entryList)
  127. }
  128. this.Regulations.title = res.data.data.type;
  129. if(res.data.data.info.length > 0){
  130. this.data = res.data.data.info
  131. }else{
  132. this.data = '';
  133. this.noData = true;
  134. }
  135. // this.$store.dispatch('GET_BALL_DATA',res.data);//将活动类别存入vuex里面
  136. }
  137. })
  138. },
  139. //获取冠军盘口数据
  140. getChampion:function(game_code,type_code,search){
  141. this.$store.dispatch('GETSHOW',true);
  142. this.$http.get(this.$ports.match.matchState,{type_code:'StChampion',game_code,search}).then(res =>{
  143. console.log('res',res)
  144. if(res.data.status == 1 && res.data.data.length > 0 && res.data.data != null){
  145. this.data = res.data.data;
  146. console.log('res', res)
  147. this.$store.dispatch('GETSHOW',false);
  148. }else{
  149. }
  150. })
  151. },
  152. //显示隐藏赛事类型
  153. IsSoccerGameClick(isclick){
  154. this.isSoccerGameClick = !isclick;
  155. },
  156. //获取input输入的值查询数据
  157. serchchange(val){
  158. if(val.length>=1){
  159. this.Serchchange=true
  160. }else{
  161. this.Serchchange=false
  162. }
  163. if(this.listnum ==2){
  164. this.getAjaxInfo(this.$ports.match.matchData,'',this.$route.query.id,this.$route.query.id,val,this.datetimeNum,this.listnum);
  165. }else if(this.listnum == 3){
  166. this.getChampion(this.$route.query.id,val)
  167. }
  168. },
  169. //删除搜索框数据
  170. delinputvalue(){
  171. this.SerchValue="";
  172. this.Serchchange=false
  173. if(this.listnum == 2){
  174. this.getAjaxInfo(this.$ports.match.matchData,'',this.$route.query.id,this.$route.query.id,'',this.datetimeNum,this.listnum);
  175. }else if(this.listnum == 3){
  176. this.getChampion(this.$route.query.id)
  177. }
  178. },
  179. //切换赛事类型
  180. listActive(id){
  181. if(this.listnum == id) return false;
  182. this.SerchValue = '';
  183. this.listnum = id
  184. if(id ==2){
  185. this.isTrue = true;
  186. this.entryShow = true;
  187. this.getAjaxInfo(this.$ports.match.matchData,'',this.$route.query.id,this.$route.query.id,'',this.datetimeNum,id);
  188. }else{
  189. this.isTrue = false
  190. if(id == 3){
  191. this.entryShow = true;
  192. this.getChampion(this.$route.query.id)
  193. }else if(id == 1){
  194. this.entryShow = false;
  195. this.getAjaxInfo(this.$ports.match.participate,this.$route.query.id);
  196. }
  197. }
  198. },
  199. //切换日期时间
  200. toggle:function(index,id){
  201. this.active=index;
  202. this.datetimeNum = id;
  203. console.log('id',this.datetimeNum)
  204. this.SerchValue = '';
  205. this.getAjaxInfo(this.$ports.match.matchData,'',this.$route.query.id,this.$route.query.id,'',id,this.listnum);
  206. },
  207. //打开联赛投注页面
  208. goMatchInfo:function(sessionId,code){
  209. console.log('code',code)
  210. if(this.listnum == 3){
  211. this.$router.push({path: 'StLeagueList', query:{ game_code:this.ballId,leagueID:sessionId,name:this.Regulations.title,matchDate:this.datetimeNum,code:code,champion:3}});
  212. }else{
  213. this.$router.push({path: 'StLeagueList', query:{ game_code:this.ballId,leagueID:sessionId,name:this.Regulations.title,matchDate:this.datetimeNum,code:code}});
  214. }
  215. },
  216. // 返回上一层页面
  217. isreturn(){
  218. history.go(-1)
  219. }
  220. },
  221. mounted() {
  222. //分球的类型获取默认数据
  223. this.ballId = this.$route.query.id;
  224. //console.log(this.$route.query.id);
  225. this.$store.dispatch('GETSHOW',true);
  226. this.getAjaxInfo(this.$ports.match.matchData,'',this.$route.query.id,this.$store.getters.getBallId);
  227. if(this.listnum == 2){
  228. this.entryShow = true;
  229. }
  230. }
  231. }
  232. </script>
  233. <style scoped>
  234. .act{
  235. transform: rotate(180deg);
  236. transition:.2s;
  237. }
  238. .return{
  239. transform: rotate(0deg);
  240. transition:.2s;
  241. }
  242. .Serch{
  243. height: 0.88rem;
  244. display: flex;
  245. justify-content: space-between;
  246. align-items: center;
  247. background:linear-gradient(to bottom,#6a6a6a,#565656);
  248. color: #F76649;
  249. font-family: 'PingFang-SC-Regular';
  250. padding: 0 0.33rem;
  251. }
  252. .returnimg{
  253. width: .37rem;
  254. height: .3rem;
  255. margin-right: .1rem;
  256. }
  257. .Serch-box{
  258. display: flex;
  259. align-items: center;
  260. }
  261. .Serch-box-input{
  262. width: 3.8rem;
  263. border: none;
  264. position: absolute;
  265. height: 0.44rem;
  266. line-height: 0.44rem;
  267. left: 0.5rem;
  268. color: #aaa;
  269. }
  270. .Serch-box-img{
  271. width: 0.3rem;
  272. height: 0.3rem;
  273. position: absolute;
  274. left: 0.1rem;
  275. top:.06rem;
  276. }
  277. .Serch-box-del{
  278. width: 0.2rem;
  279. height: 0.2rem;
  280. position: absolute;
  281. right: 0.2rem;
  282. }
  283. .Serch-box-home{
  284. height: 0.45rem;
  285. line-height: 0.45rem;
  286. width: 4.73rem;
  287. background: #e4e4e4;
  288. border-radius: 0.2rem;
  289. display: flex;
  290. justify-content: space-around;
  291. align-items: center;
  292. padding-left: 0.1rem;
  293. padding-right: 0.1rem;
  294. position: relative;
  295. }
  296. .Soccer-game-title{
  297. height: 0.88rem;
  298. font-size: 0.3rem;
  299. }
  300. .Soccer-game-box{
  301. height: 0.88rem;
  302. /* padding: 0 0.32rem; */
  303. background-color:#626262;
  304. }
  305. .Soccer-game-box>p{
  306. margin: 0.3rem;
  307. color: #A6A6A6;
  308. }
  309. .Soccer-game-box p.active{
  310. color:#F76649;
  311. }
  312. .Soccer-game-src{
  313. width: 0.25rem;
  314. height: 0.15rem;
  315. /* margin-left: .3rem */
  316. }
  317. .box{
  318. background:#EBEBEB;
  319. padding:0 0.14rem;
  320. }
  321. #NavSlide{
  322. width:100% ;
  323. overflow:hidden;
  324. }
  325. #NavSlide nav{
  326. display: -webkit-box;
  327. display: -ms-flexbox;
  328. display: flex;
  329. -webkit-box-align: middle;
  330. -ms-flex-align: middle;
  331. align-items: middle;
  332. overflow: auto;
  333. }
  334. #NavSlide p{
  335. text-align: center;
  336. font-size: 0.28rem;
  337. -ms-flex-negative: 0;
  338. flex-shrink: 0;
  339. padding:0 0.1rem;
  340. margin:0 0.05rem;
  341. color: #B8B8B8;
  342. height: 0.88rem;
  343. line-height: 0.88rem;
  344. }
  345. /* #NavSlide p a{
  346. color: #E5E5E5;
  347. text-decoration: none;
  348. } */
  349. #NavSlide p span.active{
  350. color:#363636;
  351. }
  352. .yd-cell-box .yd-cell {
  353. z-index: 99;
  354. border-radius: 0.2rem;
  355. }
  356. .matchBox {
  357. margin-bottom: .12rem;
  358. background: #F9F9F9;
  359. padding: 0.27rem 0.34rem 0 0.32rem;
  360. }
  361. div /deep/ .yd-accordion-head{
  362. padding: 0 .13rem 0 0;
  363. }
  364. div /deep/ .yd-accordion-content:after{
  365. height: 0;
  366. }
  367. .match .tit {
  368. display: flex;
  369. justify-content: space-between;
  370. font-size: 0.32rem;
  371. margin-bottom: 0.3rem;
  372. }
  373. .match .list {
  374. overflow: hidden;
  375. transition: all 0.3s cubic-bezier(0.4, 0.6, 0.2, 1);
  376. }
  377. .match .list div {
  378. background: #dcdcdc;
  379. width: 100%;
  380. height: 0.88rem;
  381. padding: 0.26rem 0.56rem 0.3rem .3rem;
  382. display: flex;
  383. align-items: center;
  384. justify-content: space-between;
  385. border-radius: 0.08rem;
  386. margin-bottom: 0.12rem;
  387. }
  388. div /deep/ .yd-accordion-head:after{
  389. height: 0;
  390. }
  391. .match .list span {
  392. color: #333333;
  393. font-size: 0.28rem;
  394. }
  395. .match .list .num {
  396. width: 0.4rem;
  397. height: 0.4rem;
  398. display: inline-block;
  399. line-height: 0.4rem;
  400. text-align: center;
  401. color: #f5f5f5;
  402. border-radius: 50%;
  403. font-size: 0.2rem;
  404. background: #F76649;
  405. }
  406. .yd-accordion {
  407. background:transparent;
  408. }
  409. .match .list div:nth-last-child(1) {
  410. margin-bottom: 0.34rem;
  411. }
  412. div /deep/ .yd-accordion-head,
  413. div /deep/ .yd-accordion-head-content,
  414. div /deep/ .yd-accordion-title,
  415. div /deep/ .yd-accordion-title-full {
  416. height: 0.3rem;
  417. }
  418. div /deep/ .yd-accordion-title {
  419. min-height: 0;
  420. }
  421. div /deep/ .yd-accordion-head {
  422. margin-bottom: 0.3rem;
  423. }
  424. div /deep/ .yd-accordion-head-arrow:after{
  425. border:none;
  426. width: 0.4rem;
  427. height: 0.4rem;
  428. background: url("../assets/st-imges/xiangxia.png") no-repeat;
  429. background-size: 0.4rem 0.4rem;
  430. }
  431. /* 参赛表 */
  432. .entry .list{
  433. height: 1rem;
  434. line-height: 0.6rem;
  435. padding: 0.2rem;
  436. width: 100%;
  437. display: flex;
  438. background: #a0a0a0;
  439. color: #fefefe;
  440. justify-content: space-between;
  441. border-bottom: 1px solid #aaa;
  442. font-size: 0.28rem;
  443. }
  444. .entry .list .num{
  445. margin-top: 0.1rem;
  446. width: 0.4rem;
  447. height: 0.4rem;
  448. display: inline-block;
  449. line-height: 0.4rem;
  450. text-align: center;
  451. color: #f5f5f5;
  452. border-radius: 50%;
  453. font-size: 0.2rem;
  454. background: #F76649;
  455. }
  456. </style>