33cda26e95b1b84d217a174a3c8b0bac7339377c.svn-base 3.8 KB

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