8796718146dc9ac13e7da747301b8045fd148a2d.svn-base 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <template>
  2. <div>
  3. <div v-if="tennisShow">
  4. <h3 style="color:#F76649;">{{title}}</h3>
  5. <div class="tennis">
  6. <div class="tennis-dtl" v-for="(item,index) in dat" :key="index" @click="getInfo(index,item.match_id,item.game_code)">
  7. <div class="teamName">
  8. <span>{{item.home_team}}</span>
  9. <div>vs</div>
  10. <span>{{item.guest_team}}</span>
  11. </div>
  12. <div class="frequency">
  13. <div :class="item.match_process == 1? 'status':''">
  14. <span>第一盘</span>
  15. <span v-if="item.first_inning_score && item.first_inning_score != null">{{item.first_inning_score}}</span>
  16. <span v-else>0 - 0</span>
  17. </div>
  18. <div :class="item.match_process == 2? 'status':''">
  19. <span>第二盘</span>
  20. <span v-if="item.second_inning_score && item.second_inning_score != null">{{item.second_inning_score}}</span>
  21. <span v-else>0 - 0</span>
  22. </div>
  23. <div :class="item.match_process == 3? 'status':''">
  24. <span>第三盘</span>
  25. <span v-if="item.third_inning_score && item.third_inning_score != null">{{item.third_inning_score}}</span>
  26. <span v-else>0 - 0</span>
  27. </div>
  28. </div>
  29. </div>
  30. </div>
  31. <div class="ballBtn">
  32. <rollingBall
  33. :name="name"
  34. :index="ball.index"
  35. :id="ball.id"
  36. :ballName="ball.name"
  37. :gameCode="gameCode"
  38. :bm ="bm"
  39. ></rollingBall>
  40. </div>
  41. </div>
  42. </div>
  43. </template>
  44. <script>
  45. import rollingBall from "@/components/StRollingBall";
  46. export default {
  47. data() {
  48. return {
  49. title: "网球",
  50. tennisShow: false,
  51. selection: true,
  52. ballName: "",
  53. name: "", //球类名称传值
  54. ball: {
  55. name: "",
  56. index: "",
  57. id: ''
  58. },
  59. gameCode: "", //球类别名
  60. dat: [],
  61. getIsShow:true,
  62. bm :'gq'
  63. };
  64. },
  65. components: { rollingBall },
  66. /**
  67. * 计算属性
  68. */
  69. computed: {
  70. getHomeRollBall() {
  71. return this.$store.getters.getHomeRollBall;
  72. },
  73. },
  74. /**
  75. * 监听器
  76. */
  77. watch: {
  78. getHomeRollBall(val){
  79. this.getAjax(val.wqData);
  80. }
  81. },
  82. mounted() {
  83. if (this.getIsShow) {
  84. this.$store.dispatch("GETSHOW", true);
  85. this.getIsShow = false;
  86. }
  87. },
  88. methods: {
  89. getInfo(idx,match_id,game_code){
  90. this.$store.dispatch('GET_BALL_ID',game_code)
  91. this.$store.dispatch("GETACTIVITY", "StRollBall");
  92. this.$router.push({
  93. path: "./StRollBallBettingPage",
  94. query: {
  95. gameCode: this.gameCode,
  96. status: 1,
  97. number: 0,
  98. home: true,
  99. name: this.title
  100. }
  101. });
  102. this.$store.dispatch("MACTH_ID", match_id);
  103. },
  104. getAjax(data) {
  105. if(!data.matchData ) return false
  106. // console.log(data.matchData);
  107. if(data.matchData.length == 0) return false
  108. let dat_length = data.matchData.length;
  109. for(var i = 0; i < dat_length; i++){
  110. data.matchData[i].game_code = data.game_code;
  111. }
  112. if(dat_length > 6){
  113. this.dat = data.matchData.slice(0,6);
  114. }else{
  115. this.dat = data.matchData;
  116. }
  117. this.title = data.gameName;
  118. this.ball.index = this.dat.length;
  119. this.name = this.title;
  120. this.ball.name = "所有" + this.title + "滚球";
  121. this.gameCode = data.game_code;
  122. this.tennisShow = true;
  123. }
  124. }
  125. };
  126. </script>
  127. <style scoped>
  128. .tennis {
  129. margin-top: 0.13rem;
  130. width: 100%;
  131. border-radius: 0.08rem;
  132. /* height: 6.42rem; */
  133. background: #dcdcdc;
  134. /* padding: 0 0.3rem 0 0.35rem; */
  135. margin-bottom: 0.2rem;
  136. padding: 0.3rem;
  137. }
  138. h3 {
  139. text-align: left;
  140. font-size: 0.3rem;
  141. color: #000000;
  142. padding: 0.25rem 0 0.05rem;
  143. font-weight: 500;
  144. }
  145. .tennis-dtl {
  146. width: 100%;
  147. background: #dcdcdc;
  148. border-bottom: 1px solid #e4e4e4;
  149. margin-top: 0.2rem;
  150. /* height: 1.89rem; */
  151. height: auto;
  152. padding: 0.24rem 0.89rem 0.25rem 0.31rem;
  153. position: relative;
  154. display: flex;
  155. justify-content: space-between;
  156. /* align-items: center; */
  157. }
  158. .teamName {
  159. color: #333333;
  160. font-size: 0.28rem;
  161. width: 2.7rem;
  162. text-align: left;
  163. }
  164. .frequency {
  165. width: 1.57rem;
  166. vertical-align: middle;
  167. /* 垂直对齐 */
  168. display: flex;
  169. flex-direction: column;
  170. justify-content: space-between;
  171. }
  172. .frequency div {
  173. display: flex;
  174. justify-content: space-between;
  175. align-items: center;
  176. font-size: 0.24rem;
  177. color: #333333;
  178. }
  179. .frequency div:nth-last-child(1) {
  180. margin-bottom: 0;
  181. }
  182. .frequency .status {
  183. color: #f76649;
  184. }
  185. .tennis-dtl .icon {
  186. width: 0.08rem;
  187. height: 0.08rem;
  188. position: absolute;
  189. top: 0.8rem;
  190. right: 0.33rem;
  191. }
  192. .tennis-dtl .icon i {
  193. display: inline-block;
  194. background: #000000;
  195. width: 0.08rem;
  196. height: 0.08rem;
  197. }
  198. .ballBtn {
  199. padding-top: 0.41rem;
  200. padding-bottom: 0.46rem;
  201. }
  202. </style>