59d06e8ad46363743333c1164ef2e0e5c1c3ee64.svn-base 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <div>
  3. <yd-accordion>
  4. <!-- 组件标题 -->
  5. <yd-accordion-item class="Match-game" :title="table.title">
  6. <!-- 组件计数单元 -->
  7. <div slot="txt" class="Match-game-stat" v-if="table.census">
  8. 当前总数:{{ table.census }}
  9. </div>
  10. <div style="background: #F0F0F0;">
  11. <p
  12. v-for="(i, index) in table.list"
  13. class="list-row"
  14. :style="i.num ? '' : 'background:#F8F8F8'"
  15. :key="i.id"
  16. >
  17. <span class="The-club">{{ i.Theclub }}</span>
  18. <span
  19. :class="i.istrue== true ? 'active The-club-box' : 'The-club-box'"
  20. @click="Theclubboxclick(index)"
  21. :style="i.num ? '' : 'display:none'"
  22. >
  23. <i style="color: #FD8F26;" v-if="i.num">{{ i.num.num1 }}</i>
  24. <i v-if="i.num"> {{ i.num.num2 }}</i>
  25. </span>
  26. </p>
  27. </div>
  28. </yd-accordion-item>
  29. </yd-accordion>
  30. </div>
  31. </template>
  32. <script>
  33. export default {
  34. data() {
  35. return {
  36. // 组件内部测试状态
  37. table: {
  38. title: '角球:让球-上半场',
  39. census:'',
  40. list:[
  41. {
  42. id: 1,
  43. Theclub: '哈萨克斯坦',
  44. num: {
  45. num1: '0.5/1',
  46. num2: '0.94'
  47. }
  48. },
  49. {
  50. id: 2,
  51. Theclub: '马德里体育会',
  52. num: {
  53. num1: '',
  54. num2: '0.94'
  55. }
  56. },
  57. {
  58. id: 3,
  59. Theclub: '哈萨克斯坦',
  60. num: {
  61. num1: '0.5/1',
  62. num2: '0.94'
  63. }
  64. },
  65. {
  66. id: 4,
  67. Theclub: '马德里体育会',
  68. num: {
  69. num1: '',
  70. num2: '0.94'
  71. }
  72. }
  73. ]
  74. }
  75. };
  76. },
  77. methods: {
  78. // 点击更改组件选中状态
  79. Theclubboxclick(num) {
  80. // 更改组件是否选中
  81. this.$set(this.table.list[num],"istrue",this.table.list[num].istrue==true?false:true)
  82. }
  83. },
  84. mounted() {
  85. }
  86. };
  87. </script>
  88. <style scoped>
  89. div /deep/ .yd-accordion-head-arrow:after {
  90. border: none;
  91. width: 0.5rem;
  92. height: 0.5rem;
  93. background: url(../../assets/st-imges/xiangxia.png) no-repeat;
  94. background-size: 100% 100%;
  95. }
  96. div /deep/ .yd-accordion-head,
  97. div /deep/ .yd-accordion-head-content,
  98. div /deep/ .yd-accordion-title {
  99. height: 0.88rem;
  100. font-size: 0.32rem;
  101. color:#333;
  102. background: #F8F8F8;
  103. }
  104. div /deep/ .yd-accordion-head {
  105. padding: 0 0.32rem;
  106. }
  107. .Match-game {
  108. position: relative;
  109. }
  110. .Match-game-stat {
  111. position: absolute;
  112. right: 1.35rem;
  113. color: #fd8f26;
  114. font-size: 0.23rem;
  115. }
  116. .list-row {
  117. display: flex;
  118. justify-content: space-between;
  119. height: 0.87rem;
  120. background: #f8f8f8;
  121. border-bottom: 1px solid #e4e4e4;
  122. align-items: center;
  123. padding: 0 0.32rem;
  124. }
  125. .The-club{
  126. font-size: .28rem
  127. }
  128. .The-club-box {
  129. display: inline-block;
  130. display: flex;
  131. flex-wrap: wrap;
  132. align-items: center;
  133. justify-content: center;
  134. width: 1.07rem;
  135. height: 0.76rem;
  136. font-size: 0.24rem;
  137. padding: 0.1rem;
  138. border: 2px solid #cecece;
  139. border-radius: 0.1rem;
  140. margin-right: 0.1rem;
  141. }
  142. .active {
  143. background: #F76649;
  144. padding: 0.1rem;
  145. border: 2px solid #F76649;
  146. }
  147. .active i{
  148. color: #f4f4f4 !important;
  149. }
  150. </style>