8d6dbd9353564983f528d9fdfe2345ab7fd7c889.svn-base 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <template>
  2. <div>
  3. <div v-if="isData">
  4. <div v-if="obj.a">
  5. <div class="tit">
  6. <span>{{'球队得分:'+home_team+'-最后一位数'}}</span>
  7. </div>
  8. <div class="playCode">
  9. <div
  10. class="home flex"
  11. v-for="item in data "
  12. v-if="item.odds_code.startsWith('last_home')"
  13. >
  14. <span class="teamName">{{item.condition}}</span>
  15. <div>
  16. <span class="odds" :class="{chooseStyle:item.isTrue,rising:item.change == 'rising',falling:item.change == 'falling'}">{{item.odds}}</span>
  17. </div>
  18. </div>
  19. </div>
  20. </div>
  21. <div v-if="obj.b">
  22. <div class="tit">
  23. <span>{{'球队得分:'+guest_team+'-最后一位数'}}</span>
  24. </div>
  25. <div class="playCode">
  26. <div
  27. class="home flex"
  28. v-for="item in data "
  29. v-if="item.odds_code.startsWith('last_guest')"
  30. >
  31. <span class="teamName">{{item.condition}}</span>
  32. <div>
  33. <span class="odds" :class="{chooseStyle:item.isTrue,rising:item.change == 'rising',falling:item.change == 'falling'}">{{item.odds}}</span>
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. </template>
  41. <script>
  42. export default {
  43. data() {
  44. return {
  45. title: "last_number",
  46. data: [], //数据源
  47. isData: "", //是否有数据
  48. guest_team: "", //客队名
  49. home_team: "", //主队名
  50. obj: "" ,//
  51. lg_id:'',
  52. };
  53. },
  54. /***
  55. * 方法
  56. */
  57. methods: {
  58. //玩法分类
  59. playGrouping(data) {
  60. let obj = {};
  61. let betting = this.$store.getters.getBetting;
  62. data.forEach(e => {
  63. if(betting.length > 0){
  64. for(let i= 0; i< betting.length; i++){
  65. if(betting[i].title =="last_number" && betting[i].data.length >0){
  66. for(let j = 0 ; j < betting[i].data.length ; j++ ){
  67. if(betting[i].data[j].id == e.id){
  68. this.$set(e,'isTrue',true);
  69. //betting[i].data.splice(j,1);
  70. }
  71. }
  72. break;
  73. }
  74. }
  75. }
  76. e.lg_id = this.lg_id;
  77. if (e.odds_code.startsWith("last_home")) {
  78. obj.a = true;
  79. } else if (e.odds_code.startsWith("last_guest")) {
  80. obj.b = true;
  81. }
  82. });
  83. this.obj = obj;
  84. }
  85. },
  86. /**
  87. * 计算属性
  88. */
  89. computed: {
  90. getGameRatio() {
  91. return this.$store.getters.getGameRatio;
  92. },
  93. //获取投注数据
  94. getBetting(){
  95. return this.$store.getters.getBetting
  96. }
  97. },
  98. /**
  99. * 监听器
  100. */
  101. watch: {
  102. getGameRatio(val) {
  103. this.lg_id = val.lg_id
  104. this.guest_team = val.guest_team;
  105. this.home_team = val.home_team;
  106. val.oddsData.forEach(e => {
  107. if (e[0].p_code == this.title) {
  108. this.data = e;
  109. this.isData = true;
  110. this.playGrouping(this.data);
  111. }
  112. });
  113. //console.log(this.data);
  114. },
  115. //投注数据监听和处理
  116. getBetting(val) {
  117. if (val.length > 0) {
  118. let id = this.$store.getters.getDeleteType;
  119. for (let i = 0; i < val.length; i++) {
  120. if (val[i].title == this.title) {
  121. for (let j = 0; j < this.data.length; j++) {
  122. if (this.data[j].id == id) {
  123. this.$set(this.data[j], "isTrue", false);
  124. break;
  125. }
  126. }
  127. break;
  128. }
  129. }
  130. } else {
  131. for (let j = 0; j < this.data.length; j++) {
  132. if (this.data[j].isTrue) {
  133. this.$set(this.data[j], "isTrue", false);
  134. }
  135. }
  136. }
  137. },
  138. }
  139. };
  140. </script>
  141. <style scoped>
  142. .flex {
  143. display: flex;
  144. justify-content: space-between;
  145. align-items: center;
  146. }
  147. .tit {
  148. background: #373737;
  149. font-size: 0.14rem;
  150. padding: 0 0.1rem;
  151. height: 0.4rem;
  152. line-height: 0.4rem;
  153. color: #b4b4b4;
  154. }
  155. .playCode {
  156. color: rgb(0, 0, 0);
  157. display: flex;
  158. flex-direction: row;
  159. flex-wrap: wrap;
  160. background: #fff;
  161. }
  162. .playCode .home {
  163. width: calc(50% - 1px);
  164. padding: 0 0.1rem;
  165. background: #fff;
  166. border-right: 1px solid #e4e4e4;
  167. border-bottom: 1px solid #e4e4e4;
  168. height: 0.4rem;
  169. line-height: 0.4rem;
  170. }
  171. .playCode .odds {
  172. display: inline-block;
  173. height: 0.3rem;
  174. border: 1px solid #e4e4e4;
  175. width: 0.5rem;
  176. background-color: #fff;
  177. text-align: center;
  178. line-height: 0.23rem;
  179. margin: 7px auto 4px;
  180. padding: 0.04rem;
  181. }
  182. .playCode .odds:hover {
  183. background: orange;
  184. color: #fff;
  185. border-color: orange;
  186. }
  187. .playCode .home:hover {
  188. background: #fff5e9;
  189. }
  190. .condation {
  191. height: 0.4rem;
  192. vertical-align: middle;
  193. color: #bd4700;
  194. padding: 0 0.1rem;
  195. font-size: 0.12rem;
  196. }
  197. </style>