3b0f7bb85e3979db46962d6f8ce511a6e92b926b.svn-base 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. <template>
  2. <div>
  3. <div v-if="isShow">
  4. <div v-for="(items,index) in list" :key="items.id" class="mg">
  5. <!-- <div v-for="items in list[index]" :key="items.id"> -->
  6. <div class="row allAlignment box center">
  7. <span>{{items.leagueName}}</span>
  8. <div class="row Match-title-num">
  9. <span>{{items.matchNum}}</span>
  10. </div>
  11. </div>
  12. <div class="Match-box">
  13. <div v-for="(item,index) in items.matchData" :key="item.id" class="Match-box">
  14. <div v-for="(itemList,index) in items.matchData[index]" :key="itemList.id">
  15. <div class="row allAlignment Match-box-top">
  16. <div class="Match-box-top-left">
  17. <span>{{itemList.match_date}}</span>
  18. <span>{{itemList.match_time}}</span>
  19. </div>
  20. <div class="Match-box-top-right row">
  21. <span style="margin-right: .1rem;" class="Match-box-top-num">{{itemList.tag}}</span>
  22. <span style="margin-right: .1rem;">让球</span>
  23. <span style="margin-right: .1rem;">大小</span>
  24. </div>
  25. </div>
  26. <div class="row allAlignment center">
  27. <div class="column average name-box">
  28. <div>{{itemList.home_team}}</div>
  29. <div>{{itemList.guest_team}}</div>
  30. </div>
  31. <div class="Match-list-box row item-center average">
  32. <div v-for="(odds,i) in itemList.oddsData[0]" :key="odds.id" class="match-list">
  33. <div
  34. @click="isclick(index,i)"
  35. class="column center"
  36. :class="items.istrue==i?'active':''"
  37. >
  38. <span style="color:#FD8F26">{{odds.condition}}</span>
  39. <span>{{odds.odds}}</span>
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. <!-- 1x2 -->
  50. <div v-if="!isShow">
  51. <div v-for="(item,index) in list" :key="item.id">
  52. <div class="row allAlignment haderBox center">
  53. <span>{{item.leagueName}}</span>
  54. <div class="Match-title-num">
  55. <span>{{item.matchNum}}</span>
  56. </div>
  57. </div>
  58. <div v-for="(items,$index) in item.matchData" :key="items.id">
  59. <div v-for="itemList in item.matchData[$index]" :key="itemList.id">
  60. <div class="box">
  61. <div class="row allAlignment item-center top-box">
  62. <span>
  63. <i>{{itemList.match_process}}</i>
  64. <b style="color:#F76649;font-weight: normal;">{{itemList.match_time}}</b>
  65. </span>
  66. <span class="top-num">{{itemList.tag}}</span>
  67. </div>
  68. </div>
  69. <div class="box-bottom">
  70. <div class="box row item-center main-box">
  71. <span class="num-box" style="color:#eb921e">{{itemList.home_score}}</span>
  72. &nbsp;&nbsp;{{itemList.home_team}}
  73. </div>
  74. <div class="box row item-center main-box">
  75. <span class="num-box" style="color:#eb921e">{{itemList.guest_score}}</span>
  76. &nbsp;&nbsp;{{itemList.guest_team}}
  77. </div>
  78. <div class="footBox">
  79. <div
  80. class="box row allAlignment bottom-box center"
  81. v-for="(odds,idx) in itemList.oddsData[1]"
  82. :key="odds.id"
  83. >
  84. <div
  85. class="item-center bottom-num"
  86. :class="item.istrueA==true?'active':''"
  87. @click="isclick(idx,1)"
  88. >
  89. <p style="color:#eb921e">{{odds.condition}}</p>
  90. <p>{{odds.odds}}</p>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. </div>
  99. <!-- 独赢盘 -->
  100. <div v-if="noData">
  101. <NotOpend :title="this.info"/>
  102. </div>
  103. </div>
  104. </template>
  105. <script>
  106. import "../css/index.css";
  107. import Bus from "../assets/bus.js";
  108. import NotOpend from "@/components/StNotOpend";
  109. export default {
  110. props: ["gameCode", "name"],
  111. data() {
  112. return {
  113. isShow: true,
  114. list: "",
  115. data: {},
  116. data2: [],
  117. info: "没有相关比赛信息",
  118. noData: false,
  119. timers: true,
  120. getIsShow: true
  121. };
  122. },
  123. components: {
  124. NotOpend
  125. },
  126. methods: {
  127. isclick(i, num) {
  128. this.$set(this.data.list[i], "istrue", (this.data.list[i].istrue = num));
  129. },
  130. // 点击事件确认选中
  131. isclick(index, num) {
  132. if (num == 1) {
  133. this.$set(
  134. this.data2[index],
  135. "istrueA",
  136. this.data2[index].istrueA == true ? false : true
  137. );
  138. } else if (num == 2) {
  139. this.$set(
  140. this.data2[index],
  141. "istrueB",
  142. this.data2[index].istrueB == true ? false : true
  143. );
  144. } else if (num == 3) {
  145. this.$set(
  146. this.data2[index],
  147. "istrueC",
  148. this.data2[index].istrueC == true ? false : true
  149. );
  150. }
  151. },
  152. getAjax() {
  153. this.$http
  154. .get(this.$ports.match.matchState, {
  155. game_code: this.gameCode,
  156. type_code: "StRollBall"
  157. })
  158. .then(res => {
  159. if (res.status == 200 && res.data != [] && res.data != null) {
  160. this.list = res.data.data;
  161. console.log("res", this.list);
  162. Bus.$emit("val", this.name);
  163. } else {
  164. this.list = "";
  165. this.noData = true;
  166. }
  167. })
  168. .catch(res => {});
  169. let _this = this;
  170. setTimeout(() => {
  171. _this.$store.dispatch("GETSHOW", false);
  172. console.log('aaaa')
  173. }, 1000);
  174. }
  175. },
  176. mounted() {
  177. if (this.getIsShow) {
  178. this.$store.dispatch("GETSHOW", true);
  179. this.getIsShow = false;
  180. }
  181. // 接收头部传过来的状态
  182. Bus.$on("show", data => {
  183. console.log("data", data);
  184. this.isShow = data;
  185. });
  186. this.getAjax();
  187. let _this = this;
  188. this.$public.ajaxTimerFun(function(timing) {
  189. if (_this.timers) {
  190. _this.getAjax();
  191. } else {
  192. clearInterval(timing);
  193. }
  194. },(1000*10));
  195. },
  196. beforeDestroy() {
  197. this.timers = false;
  198. }
  199. };
  200. </script>
  201. <style scoped>
  202. .box {
  203. padding: 0 0.32rem;
  204. height: 0.88rem;
  205. font-size: 0.28rem;
  206. background: #f4f4f4;
  207. }
  208. .mg {
  209. margin-bottom: 0.1rem;
  210. }
  211. .Match-title-num {
  212. width: 0.46rem;
  213. height: 0.46rem;
  214. align-items: center;
  215. justify-content: center;
  216. line-height: 0.46rem;
  217. text-align: center;
  218. background: #f76649;
  219. font-size: 0.2rem;
  220. border-radius: 50%;
  221. color: #f5f5f5;
  222. }
  223. .Match-box-top-right > span {
  224. width: 1.07rem;
  225. text-align: center;
  226. }
  227. .Match-box {
  228. padding: 0 0.32rem;
  229. }
  230. .name-box {
  231. height: 1.76rem;
  232. }
  233. .Match-box-top {
  234. height: 0.44rem;
  235. line-height: 0.44rem;
  236. border-bottom: 1px solid #e4e4e4;
  237. font-size: 0.23rem;
  238. }
  239. .Match-box-top-num {
  240. width: 0.64rem;
  241. height: 0.44rem;
  242. background: #ebebeb;
  243. font-size: 0.24rem;
  244. }
  245. .Match-box {
  246. margin-top: 0.12rem;
  247. background: #f8f8f8;
  248. }
  249. .Match-list-box {
  250. width: 35%;
  251. height: 1.76rem;
  252. flex-wrap: wrap;
  253. }
  254. .Match-list-box .match-list div {
  255. width: 1.07rem;
  256. height: 0.8rem;
  257. border: 2px solid #cecece;
  258. border-radius: 0.1rem;
  259. flex-wrap: wrap;
  260. }
  261. .active {
  262. background: #e4e4e4;
  263. }
  264. /* 1x2 */
  265. .top-box {
  266. height: 0.44rem;
  267. font-size: 0.24rem;
  268. background: #fff;
  269. border-bottom: 1px solid #e4e4e4;
  270. }
  271. .box-bottom {
  272. /* height: 2.9rem; */
  273. }
  274. .top-num {
  275. display: inline-block;
  276. width: 0.64rem;
  277. height: 0.44rem;
  278. line-height: 0.44rem;
  279. color: #000000;
  280. text-align: center;
  281. background: #ebebeb;
  282. font-size: 0.24rem;
  283. }
  284. .box {
  285. padding: 0 0.32rem;
  286. background: #fff;
  287. }
  288. .Match-title-num {
  289. width: 0.46rem;
  290. height: 0.46rem;
  291. line-height: 0.46rem;
  292. text-align: center;
  293. background: #f76649;
  294. font-size: 0.26rem;
  295. border-radius: 50%;
  296. color: #e4e4e4;
  297. }
  298. .haderBox {
  299. padding: 0 0.32rem;
  300. height: 0.88rem;
  301. font-size: 0.32rem;
  302. background: #f8f8f8;
  303. }
  304. .main-box {
  305. height: 0.9rem;
  306. background: #fff;
  307. font-size: 0.28rem;
  308. }
  309. .bottom-box {
  310. height: 1.1rem;
  311. background: #fff;
  312. font-size: 0.24rem;
  313. }
  314. .bottom-box div {
  315. width: 1.07rem;
  316. height: 0.76rem;
  317. border: 2px solid #cecece;
  318. border-radius: 0.1rem;
  319. font-size: 0.24rem;
  320. }
  321. .bottom-num {
  322. padding: 0.1rem;
  323. text-align: center;
  324. }
  325. .active {
  326. background: #f76649;
  327. border: 2px solid #f76649 !important;
  328. }
  329. .active > p {
  330. color: #e4e4e4 !important;
  331. }
  332. .num-box {
  333. width: 0.66rem;
  334. height: 0.34rem;
  335. background: #f76649;
  336. border-radius: 0.17rem;
  337. color: #f5f5f5 !important;
  338. line-height: 0.34rem;
  339. text-align: center;
  340. }
  341. .footBox {
  342. display: flex;
  343. flex-wrap: wrap;
  344. align-items: center;
  345. }
  346. .footBox .box {
  347. width: 33%;
  348. text-align: center;
  349. }
  350. </style>