6d4120c067707601c02205e132535fc9168408f5.svn-base 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  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. };
  121. },
  122. components: {
  123. NotOpend
  124. },
  125. methods: {
  126. isclick(i, num) {
  127. this.$set(this.data.list[i], "istrue", (this.data.list[i].istrue = num));
  128. },
  129. // 点击事件确认选中
  130. isclick(index, num) {
  131. if (num == 1) {
  132. this.$set(
  133. this.data2[index],
  134. "istrueA",
  135. this.data2[index].istrueA == true ? false : true
  136. );
  137. } else if (num == 2) {
  138. this.$set(
  139. this.data2[index],
  140. "istrueB",
  141. this.data2[index].istrueB == true ? false : true
  142. );
  143. } else if (num == 3) {
  144. this.$set(
  145. this.data2[index],
  146. "istrueC",
  147. this.data2[index].istrueC == true ? false : true
  148. );
  149. }
  150. },
  151. getAjax(){
  152. this.$http
  153. .get(this.$ports.match.matchState, {
  154. game_code: this.gameCode,
  155. type_code: "StRollBall"
  156. })
  157. .then(res => {
  158. this.$store.dispatch("GETSHOW", false);
  159. if (res.status == 200 && res.data != [] && res.data != null) {
  160. this.list = res.data.data;
  161. console.log("list", this.list);
  162. Bus.$emit("val", this.name);
  163. } else {
  164. this.list = "";
  165. this.noData = true;
  166. }
  167. })
  168. .catch(res => {});
  169. }
  170. },
  171. mounted() {
  172. this.$store.dispatch("GETSHOW", true);
  173. // 接收头部传过来的状态
  174. Bus.$on("show", data => {
  175. console.log("data", data);
  176. this.isShow = data;
  177. });
  178. this.getAjax();
  179. let _this = this;
  180. this.$public.ajaxTimerFun(function(timing) {
  181. _this.getAjax();
  182. if (!_this.timers) {
  183. clearInterval(timing);
  184. }
  185. });
  186. },
  187. beforeDestroy(){
  188. this.timers = false;
  189. }
  190. };
  191. </script>
  192. <style scoped>
  193. .box {
  194. padding: 0 0.32rem;
  195. height: 0.88rem;
  196. font-size: 0.28rem;
  197. background: #f4f4f4;
  198. }
  199. .mg {
  200. margin-bottom: 0.1rem;
  201. }
  202. .Match-title-num {
  203. width: 0.46rem;
  204. height: 0.46rem;
  205. align-items: center;
  206. justify-content: center;
  207. line-height: 0.46rem;
  208. text-align: center;
  209. background: #f76649;
  210. font-size: 0.2rem;
  211. border-radius: 50%;
  212. color: #f5f5f5;
  213. }
  214. .Match-box-top-right > span {
  215. width: 1.07rem;
  216. text-align: center;
  217. }
  218. .Match-box {
  219. padding: 0 0.32rem;
  220. }
  221. .name-box {
  222. height: 1.76rem;
  223. }
  224. .Match-box-top {
  225. height: 0.44rem;
  226. line-height: 0.44rem;
  227. border-bottom: 1px solid #e4e4e4;
  228. font-size: 0.23rem;
  229. }
  230. .Match-box-top-num {
  231. width: 0.64rem;
  232. height: 0.44rem;
  233. background: #ebebeb;
  234. font-size: 0.24rem;
  235. }
  236. .Match-box {
  237. margin-top: 0.12rem;
  238. background: #f8f8f8;
  239. }
  240. .Match-list-box {
  241. width: 35%;
  242. height: 1.76rem;
  243. flex-wrap: wrap;
  244. }
  245. .Match-list-box .match-list div {
  246. width: 1.07rem;
  247. height: 0.8rem;
  248. border: 2px solid #cecece;
  249. border-radius: 0.1rem;
  250. flex-wrap: wrap;
  251. }
  252. .active {
  253. background: #e4e4e4;
  254. }
  255. /* 1x2 */
  256. .top-box {
  257. height: 0.44rem;
  258. font-size: 0.24rem;
  259. background: #fff;
  260. border-bottom: 1px solid #e4e4e4;
  261. }
  262. .box-bottom {
  263. /* height: 2.9rem; */
  264. }
  265. .top-num {
  266. display: inline-block;
  267. width: 0.64rem;
  268. height: 0.44rem;
  269. line-height: 0.44rem;
  270. color: #000000;
  271. text-align: center;
  272. background: #ebebeb;
  273. font-size: 0.24rem;
  274. }
  275. .box {
  276. padding: 0 0.32rem;
  277. background: #fff;
  278. }
  279. .Match-title-num {
  280. width: 0.46rem;
  281. height: 0.46rem;
  282. line-height: 0.46rem;
  283. text-align: center;
  284. background: #f76649;
  285. font-size: 0.26rem;
  286. border-radius: 50%;
  287. color: #e4e4e4;
  288. }
  289. .haderBox {
  290. padding: 0 0.32rem;
  291. height: 0.88rem;
  292. font-size: 0.32rem;
  293. background: #f8f8f8;
  294. }
  295. .main-box {
  296. height: 0.9rem;
  297. background: #fff;
  298. font-size: 0.28rem;
  299. }
  300. .bottom-box {
  301. height: 1.1rem;
  302. background: #fff;
  303. font-size: 0.24rem;
  304. }
  305. .bottom-box div {
  306. width: 1.07rem;
  307. height: 0.76rem;
  308. border: 2px solid #cecece;
  309. border-radius: 0.1rem;
  310. font-size: 0.24rem;
  311. }
  312. .bottom-num {
  313. padding: 0.1rem;
  314. text-align: center;
  315. }
  316. .active {
  317. background: #f76649;
  318. border: 2px solid #f76649 !important;
  319. }
  320. .active > p {
  321. color: #e4e4e4 !important;
  322. }
  323. .num-box {
  324. width: 0.66rem;
  325. height: 0.34rem;
  326. background: #f76649;
  327. border-radius: 0.17rem;
  328. color: #f5f5f5 !important;
  329. line-height: 0.34rem;
  330. text-align: center;
  331. }
  332. .footBox {
  333. display: flex;
  334. flex-wrap: wrap;
  335. align-items: center;
  336. }
  337. .footBox .box {
  338. width: 33%;
  339. text-align: center;
  340. }
  341. </style>