3d665138abba0f96d070b8887949382a210983da.svn-base 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <div class="goal">
  3. <yd-accordion :accordion="false">
  4. <yd-accordion-item :title=" '进球' + ':' + '单/双'">
  5. <div style="padding:0 0.32rem;" class="odds" v-for="(item,index) in list" :key="item.id" >
  6. <div class="large" @click="toggle(index)">
  7. <div>大</div>
  8. <div class="ratio" :class = "sel[index] == true ? 'col':''">
  9. <span class = "score">{{item.largeScore}}</span>
  10. <span :class = "item.largeScore || item.smallScore == '' ? '':'largeScore'">{{item.largeOdds}}</span>
  11. </div>
  12. </div>
  13. <div class="small" @click = smallToggle(index)>
  14. <div>小</div>
  15. <div class="ratio" :class = "smallStatus[index] == true ? 'col':''">
  16. <span class = "score">{{item.smallScore}}</span>
  17. <span :class = "item.smallScore || item.smallScore == '' ? '':'smallScore'">{{item.smallOdds}}</span>
  18. </div>
  19. </div>
  20. </div>
  21. </yd-accordion-item>
  22. </yd-accordion>
  23. </div>
  24. </template>
  25. <script>
  26. export default {
  27. // 进球大小单双数
  28. data() {
  29. return {
  30. status: -1,
  31. timer:0,
  32. smallStatus : [],
  33. sel : [],
  34. list:[{
  35. largeScore : '0.5/1',
  36. largeOdds:'0.94',
  37. smallScore : '0.5/1',
  38. smallOdds:'0.94'
  39. }]
  40. }
  41. },
  42. mounted() {
  43. for(var i = 0 ;i < this.list.length; i++){
  44. this.sel.push(false)
  45. this.smallStatus.push(false)
  46. }
  47. },
  48. methods: {
  49. toggle(index){
  50. this.sel[index] = !this.sel[index]
  51. this.$forceUpdate();
  52. },
  53. smallToggle(index){
  54. this.smallStatus[index] = !this.smallStatus[index]
  55. this.$forceUpdate();
  56. }
  57. },
  58. };
  59. </script>
  60. <style scoped>
  61. div /deep/ .yd-accordion-head {
  62. padding: 0 0.32rem;
  63. background: #F8F8F8;
  64. }
  65. div /deep/ .yd-accordion-title {
  66. color: #333333;
  67. font-size: 0.32rem;
  68. }
  69. div /deep/ .yd-accordion-head-arrow:after {
  70. border: none;
  71. width: 0.5rem;
  72. height: 0.5rem;
  73. background: url("../../assets/st-imges/xiangxia.png") no-repeat;
  74. background-size:100% 100%;
  75. }
  76. .odds {
  77. display: flex;
  78. justify-content: space-between;
  79. background: #f8f8f8;
  80. text-align: left;
  81. }
  82. .odds .large,.odds .small {
  83. width: 50%;
  84. display: flex;
  85. justify-content: space-between;
  86. border-right: 1px solid #E4E4E4;
  87. border-bottom: 1px solid #E4E4E4;
  88. }
  89. .odds .small{
  90. border-right: none;
  91. padding-left: 0.16rem;
  92. }
  93. .odds .large div,.odds .small div{
  94. height: 0.88rem;
  95. font-size: 0.24rem;
  96. color: #333333;
  97. }
  98. .odds .large div:nth-child(1),.odds .small div:nth-child(1) {
  99. line-height: 0.88rem;
  100. }
  101. .odds .large .ratio,.odds .small .ratio {
  102. width: 1.07rem;
  103. height: 0.76rem;
  104. border: 2px solid #cecece;
  105. border-radius: 0.1rem;
  106. margin-top: 0.06rem;
  107. text-align: center;
  108. margin-right: 0.14rem;
  109. }
  110. .odds .large .ratio span,.odds .small .ratio span{
  111. font-size: 0.24rem;
  112. }
  113. .odds .large .score,.odds .small .score{
  114. color: #FD8F26;
  115. }
  116. .odds:nth-last-child(1) .large,.odds:nth-last-child(1) .small{
  117. border-bottom: none;
  118. }
  119. .largeScore,.smallScore{
  120. line-height: 0.76rem;
  121. }
  122. .col{
  123. background: #F76649;
  124. border: 2px solid #F76649 !important;
  125. }
  126. .col span{
  127. color: #f4f4f4 !important;
  128. }
  129. .odds .score{
  130. display: block;
  131. margin-top:0.04rem;
  132. }
  133. </style>