73942d12a81f98b6c7aed20aeee1ec68403ac81d.svn-base 2.6 KB

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