9d4383a64595362b092b9d0760f39b7e33ca927e.svn-base 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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_player_name}}</span>
  9. <div>vs</div>
  10. <span>{{item.guest_player_name}}</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.length == 0) return false
  106. let dat_length = data.matchData.length;
  107. for(var i = 0; i < dat_length; i++){
  108. data.matchData[i].game_code = data.game_code;
  109. }
  110. if(dat_length > 6){
  111. this.dat = data.matchData.slice(0,6);
  112. }else{
  113. this.dat = data.matchData;
  114. }
  115. this.title = data.gameName;
  116. this.ball.index = this.dat.length;
  117. this.name = this.title;
  118. this.ball.name = "所有" + this.title + "滚球";
  119. this.gameCode = data.game_code;
  120. this.tennisShow = true;
  121. }
  122. }
  123. };
  124. </script>
  125. <style scoped>
  126. .tennis {
  127. margin-top: 0.13rem;
  128. width: 100%;
  129. border-radius: 0.08rem;
  130. /* height: 6.42rem; */
  131. background: #dcdcdc;
  132. /* padding: 0 0.3rem 0 0.35rem; */
  133. margin-bottom: 0.2rem;
  134. padding: 0.3rem;
  135. }
  136. h3 {
  137. text-align: left;
  138. font-size: 0.3rem;
  139. color: #000000;
  140. padding: 0.25rem 0 0.05rem;
  141. font-weight: 500;
  142. }
  143. .tennis-dtl {
  144. width: 100%;
  145. background: #dcdcdc;
  146. border-bottom: 1px solid #e4e4e4;
  147. margin-top: 0.2rem;
  148. /* height: 1.89rem; */
  149. height: auto;
  150. padding: 0.24rem 0.89rem 0.25rem 0.31rem;
  151. position: relative;
  152. display: flex;
  153. justify-content: space-between;
  154. /* align-items: center; */
  155. }
  156. .teamName {
  157. color: #333333;
  158. font-size: 0.28rem;
  159. width: 2.7rem;
  160. text-align: left;
  161. }
  162. .frequency {
  163. width: 1.57rem;
  164. vertical-align: middle;
  165. /* 垂直对齐 */
  166. display: flex;
  167. flex-direction: column;
  168. justify-content: space-between;
  169. }
  170. .frequency div {
  171. display: flex;
  172. justify-content: space-between;
  173. align-items: center;
  174. font-size: 0.24rem;
  175. color: #333333;
  176. }
  177. .frequency div:nth-last-child(1) {
  178. margin-bottom: 0;
  179. }
  180. .frequency .status {
  181. color: #f76649;
  182. }
  183. .tennis-dtl .icon {
  184. width: 0.08rem;
  185. height: 0.08rem;
  186. position: absolute;
  187. top: 0.8rem;
  188. right: 0.33rem;
  189. }
  190. .tennis-dtl .icon i {
  191. display: inline-block;
  192. background: #000000;
  193. width: 0.08rem;
  194. height: 0.08rem;
  195. }
  196. .ballBtn {
  197. padding-top: 0.41rem;
  198. padding-bottom: 0.46rem;
  199. }
  200. </style>