e89a4bbbbcae77275879c0d55f86c580a42c1a78.svn-base 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <div class="football" v-loading="ftLoading">
  3. <div v-if="football.length == 0">暂无数据</div>
  4. <div class="game-grid" v-for="(one, inde) of football" :key="inde">
  5. <div class="game-grid-head">
  6. <!-- <img v-if="one.show" src="../../assets/st-imges/jian.png" class="img-size"/>
  7. <img v-else src="../../assets/st-imges/jia.png" class="imgsize" /> -->
  8. <span style='display:inline-block;width: 490px;'>{{one.league_name}}</span>
  9. <span style="display:inline-block;width: 150px">上半场</span>
  10. <span style="display:inline-block;width: 150px">赛果</span>
  11. </div>
  12. <div class="game-grid" v-for="(item, index) of one.match_data" :key="index">
  13. <div class="game-grid-one">
  14. <div class="game-grid-cell">
  15. <div style="width: 100px">
  16. <span>{{item.match_time}}</span>
  17. </div>
  18. </div>
  19. <div class="game-grid-cell">
  20. <div style="width: 400px;font-weight:bold">
  21. {{item.home_team}}
  22. <span style="color: #ff9200">VS</span>
  23. {{item.guest_team}}</div>
  24. </div>
  25. <div class="game-grid-cell">
  26. <div style="width: 150px;">{{item.score_half}}</div>
  27. </div>
  28. <div class="game-grid-cell">
  29. <div style="width: 150px;">{{item.score_full}}</div>
  30. </div>
  31. </div>
  32. <div v-for="(info, ind) of item.play_data" :key="ind" class="game-gird">
  33. <div class="game-grid-one" v-show="info.show">
  34. <div class="game-grid-cell">
  35. <div style="width: 100px">
  36. </div>
  37. </div>
  38. <div class="game-grid-cell">
  39. <div style="width: 400px;">
  40. {{info.play_name}}
  41. <span style="color: #ff9200">:</span>
  42. {{info.play_result}}
  43. </div>
  44. </div>
  45. <div class="game-grid-cell">
  46. <div style="width: 300px"></div>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. <div v-if="football.length == 0" class="no-message">暂无数据</div>
  53. </div>
  54. </template>
  55. <script>
  56. export default {
  57. name: 'football',
  58. props: {
  59. footballData: {
  60. type: Array,
  61. default: ()=>[]
  62. },
  63. loading: {
  64. type: Boolean,
  65. default: false
  66. }
  67. },
  68. data() {
  69. return {
  70. football: [],
  71. ftLoading: false,
  72. show: true,
  73. test: '1'
  74. }
  75. },
  76. watch: {
  77. footballData: {
  78. handler(val) {
  79. if(val) {
  80. this.football = JSON.parse(JSON.stringify(val))
  81. }
  82. },
  83. deep: true
  84. },
  85. loading(val) {
  86. this.ftLoading = val
  87. }
  88. },
  89. boforemounted() {
  90. this.initShow();
  91. },
  92. methods: {
  93. // 默认展开
  94. initShow() {
  95. for(let item of this.football) {
  96. item.show = !item.show;
  97. }
  98. // for(let i=0;i<this.football.length;i++) {
  99. // this.$set(this.football[i], 'show'+i, true)
  100. // }
  101. },
  102. setShow(val, index) {
  103. // console.log('index',index)
  104. // this.initshow = false
  105. // this.show = !this.show
  106. // this.$set(val, 'show', this.show)
  107. // console.log(val)
  108. // console.log('show', this.show, val.show)
  109. val.show = !val.show
  110. }
  111. }
  112. }
  113. </script>
  114. <style scoped>
  115. .game-grid {
  116. box-sizing: border-box;
  117. width: 800px;
  118. border: solid 1px #e3e3e3;
  119. border-top: none;
  120. border-collapse: collapse;
  121. }
  122. .game-grid-head {
  123. position: relative;
  124. width: 100%;
  125. height: 40px;
  126. line-height: 40px;
  127. background-color: #373737;
  128. color: #ffffff;
  129. font-size: 14px;
  130. font-weight: 700;
  131. text-align: center;
  132. }
  133. .img-size {
  134. position: absolute;
  135. height: 10px;
  136. width: 10px;
  137. top: 15px;
  138. left: 10px;
  139. }
  140. .game-grid-one {
  141. display:table-cell;
  142. vertical-align: middle;
  143. text-align: center;
  144. font-size: 13px;
  145. border-collapse: collapse;
  146. }
  147. .game-grid-cell {
  148. display:table-cell;
  149. vertical-align: middle;
  150. text-align: center;
  151. font-size: 13px;
  152. border-collapse: collapse;
  153. padding: 6px 0;
  154. /* border-right: 1px solid #d7d7d7; */
  155. border: 1px solid #d7d7d7;
  156. border-top: none;
  157. }
  158. .no-message {
  159. text-align: center;
  160. margin-top: 50px;
  161. padding-right: 100px;
  162. font-size: 16px;
  163. font-weight: 700;
  164. }
  165. </style>