a424619f1d40bb3fc1a7a71c2b15ddd44f7b606a.svn-base 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. <template>
  2. <div>
  3. <div class="Match" v-for="(i, index) in FootballMatch" :key="i.id">
  4. <div class="Match-top">
  5. <div class="Match-top-left">
  6. {{ i.date }}&emsp;
  7. <span class="Match-top-name">{{ i.time }}</span>
  8. </div>
  9. <div class="Match-top-left-right">
  10. <span class="Match-top-num">{{ i.num }}></span>
  11. <span>让球</span>
  12. <span>大小</span>
  13. </div>
  14. </div>
  15. <div class="Match-bottom">
  16. <div class="Match-bottom-home">
  17. <div class="Match-bottom-home-left">
  18. <span>{{ i.home.title }}</span>
  19. </div>
  20. <div class="Match-bottom-home-right">
  21. <div
  22. :class="i.home.concede.istrue == true ? 'active' : ''"
  23. @click="onhome(index,'home','concede')"
  24. >
  25. <span>{{ i.home.concede.concede1 }}</span>
  26. <span>{{ i.home.concede.concede2 }}</span>
  27. </div>
  28. <div
  29. :class="i.home.size.istrue == true ? 'active' : ''"
  30. @click="onhome(index,'home','size')"
  31. >
  32. <span class="sizehomeA">
  33. <i>{{ i.home.size.size }}</i>
  34. {{ i.home.size.sizetop }}
  35. </span>
  36. <sapn class="sizehomeB">{{ i.home.size.sizebtm }}</sapn>
  37. </div>
  38. </div>
  39. </div>
  40. <div class="Match-bottom-away">
  41. <div class="Match-bottom-away-left">
  42. <span>{{ i.away.title }}</span>
  43. </div>
  44. <div class="Match-bottom-away-right">
  45. <div
  46. :class="i.away.concede.istrue == true ? 'active' : ''"
  47. @click="onhome(index,'away','concede')"
  48. >
  49. <span
  50. style="display: block;width: 100%;text-align: center;color: #FD8F26;"
  51. >
  52. {{ i.away.concede.concedetop }}
  53. </span>
  54. <span>{{ i.away.concede.concedeawaybtm }}</span>
  55. </div>
  56. <div
  57. :class="i.away.size.istrue == true ? 'active' : ''"
  58. @click="onhome(index,'away','size')"
  59. >
  60. <span class="sizeawayA">
  61. <i>{{ i.away.size.size }}</i>
  62. {{ i.away.size.sizetop }}
  63. </span>
  64. <sapn class="sizeawayB">{{ i.away.size.sizebtm }}</sapn>
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </template>
  72. <script>
  73. export default {
  74. data() {
  75. return {
  76. FootballMatch: [
  77. {
  78. id: 1,
  79. date: '21/03',
  80. time: '11:00',
  81. num: '70',
  82. home: {
  83. title: '哈萨克斯坦',
  84. concede: { concede1: '0.81', concede2: '' },
  85. size: {
  86. size: '大',
  87. sizetop: '2/2.5',
  88. sizebtm: '1.12'
  89. }
  90. },
  91. away: {
  92. title: '苏格兰',
  93. concede: { concedetop: '05/1', concedebtm: '1.09' },
  94. size:{
  95. size: '大',
  96. sizetop: '2/2.5',
  97. sizebtm: '1.12'
  98. }
  99. }
  100. },
  101. ]
  102. };
  103. },
  104. methods: {
  105. // 点击更改组件选中状态
  106. onhome(index,home,num) {
  107. // 控制选中更改状态
  108. if(home=='home'){
  109. if(num=='concede'){
  110. this.$set(this.FootballMatch[index].home.concede,'istrue',this.FootballMatch[index].home.concede.istrue==true?false:true)
  111. }else{
  112. this.$set(this.FootballMatch[index].home.size,'istrue',this.FootballMatch[index].home.size.istrue==true?false:true)
  113. }
  114. }else{
  115. if(num=='concede'){
  116. this.$set(this.FootballMatch[index].away.concede,'istrue',this.FootballMatch[index].away.concede.istrue==true?false:true)
  117. }else{
  118. this.$set(this.FootballMatch[index].away.size,'istrue',this.FootballMatch[index].away.size.istrue==true?false:true)
  119. }
  120. }
  121. }
  122. },
  123. mounted() {}
  124. };
  125. </script>
  126. <style scoped="scoped">
  127. .Match {
  128. background: #fff;
  129. margin-top: 0.12rem;
  130. }
  131. .Match-top {
  132. height: 0.44rem;
  133. border-bottom: 1px solid #e4e4e4;
  134. display: flex;
  135. justify-content: space-between;
  136. align-content: center;
  137. font-size: 0.25rem;
  138. display: flex;
  139. line-height: 0.44rem;
  140. }
  141. .Match-top-left {
  142. width: 40%;
  143. height: 100%;
  144. padding-left: 0.32rem;
  145. align-items: center;
  146. line-height: 0.44rem;
  147. }
  148. .Match-top-name {
  149. color: #fd8f26;
  150. }
  151. .Match-top-left-right {
  152. width: 60%;
  153. height: 100%;
  154. padding-right: 0.32rem;
  155. line-height: 0.44rem;
  156. display: flex;
  157. justify-content: space-around;
  158. }
  159. .Match-top-num {
  160. display: inline-block;
  161. width: 0.64rem;
  162. height: 0.44rem;
  163. line-height: 0.44rem;
  164. background: #ebebeb;
  165. text-align: center;
  166. }
  167. .Match-bottom {
  168. height: 1.76rem;
  169. display: flex;
  170. justify-content: space-between;
  171. flex-wrap: wrap;
  172. padding: 0 0.32rem;
  173. align-items: center;
  174. }
  175. .Match-bottom-home,
  176. .Match-bottom-away {
  177. height: 50%;
  178. width: 100%;
  179. display: flex;
  180. justify-content: space-between;
  181. }
  182. .Match-bottom-home div {
  183. height: 100%;
  184. }
  185. .Match-bottom-home-left {
  186. height: 100%;
  187. display: flex;
  188. align-items: center;
  189. color: #333333;
  190. align-content: left;
  191. font-size: 0.28rem;
  192. }
  193. .Match-bottom-home-right {
  194. width: 37%;
  195. display: flex;
  196. justify-content: space-around;
  197. align-items: center;
  198. flex-wrap: wrap;
  199. }
  200. .Match-bottom-home-right div {
  201. display: flex;
  202. align-items: center;
  203. justify-content: center;
  204. flex-wrap: wrap;
  205. width: 1.07rem;
  206. height: 0.76rem;
  207. border: 1px solid #e4e4e4;
  208. margin-top: 0.05rem;
  209. border-radius: 0.1rem;
  210. font-size: 0.25rem;
  211. }
  212. .Match-bottom-home-right div i {
  213. font-style: normal;
  214. color: #aaaaaa;
  215. }
  216. .sizehomeA {
  217. color: #fd8f26;
  218. }
  219. .Match-bottom-away div {
  220. height: 100%;
  221. }
  222. .Match-bottom-away-left {
  223. height: 100%;
  224. display: flex;
  225. align-items: center;
  226. color: #333333;
  227. align-content: left;
  228. font-size: 0.28rem;
  229. }
  230. .Match-bottom-away-right {
  231. width: 37%;
  232. display: flex;
  233. justify-content: space-around;
  234. align-items: center;
  235. flex-wrap: wrap;
  236. }
  237. .Match-bottom-away-right div {
  238. display: flex;
  239. align-items: center;
  240. justify-content: center;
  241. flex-wrap: wrap;
  242. width: 1.07rem;
  243. height: 0.76rem;
  244. border: 1px solid #e4e4e4;
  245. margin-bottom: 0.05rem;
  246. border-radius: 0.1rem;
  247. font-size: 0.25rem;
  248. }
  249. .Match-bottom-away-right div i {
  250. font-style: normal;
  251. color: #aaaaaa;
  252. }
  253. .sizeawayA {
  254. color: #fd8f26;
  255. }
  256. .active {
  257. background-color: #e4e4e4;
  258. }
  259. </style>