2831582e073859f319d5b475457bd638af6a5c6b.svn-base 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <template>
  2. <div>
  3. <div class="title" v-if="isShow">
  4. <span style="font-size:.28rem;color:#F76649;">{{titel}}</span>
  5. </div>
  6. <div
  7. v-for="(item,id) in data"
  8. @click="getInfo(id,item.match_id,item.game_code)"
  9. class="macth row allAlignment"
  10. :key="id"
  11. v-if="isShow"
  12. >
  13. <div class="row">
  14. <div class="column allAlignment center">
  15. <div class="score-icon row center">
  16. <span style=" margin:0.07rem; ">{{item.home_score}}</span>
  17. </div>
  18. <div class="score-icon row center">
  19. <span style=" margin:0.07rem; ">{{item.guest_score}}</span>
  20. </div>
  21. </div>
  22. <div class="team-box column allAlignment">
  23. <span class="teamName">{{item.home_team}}</span>
  24. <span style="font-size:0.2rem;padding:0.06rem 0 ;">vs</span>
  25. <span class="teamName">{{item.guest_team}}</span>
  26. </div>
  27. </div>
  28. <div class="row">
  29. <div class="column allAlignment center">
  30. <span class="macth-time" v-if="item.game_code != 'lq'">{{item.match_process}}</span>
  31. <span class="macth-time" v-else-if="item.game_code == 'lq' && item.match_process == '1'">第一节</span>
  32. <span class="macth-time" v-else-if="item.game_code == 'lq' && item.match_process == '2'">第二节</span>
  33. <span class="macth-time" v-else-if="item.game_code == 'lq' && item.match_process == '3'">第三节</span>
  34. <span class="macth-time" v-else-if="item.game_code == 'lq' && item.match_process == '4'">第四节</span>
  35. <img src="../assets/st-imges/stadium.png" alt>
  36. <span class="macth-time">{{item.match_time ? item.match_time :'00:00'}} </span>
  37. </div>
  38. </div>
  39. </div>
  40. <div class="rolling" v-if="isShow">
  41. <RollingBall :ballName="ball.name" :bm='bm' :name="name" :index="ball.index" :gameCode="gameCode"></RollingBall>
  42. </div>
  43. </div>
  44. </template>
  45. <script>
  46. import "../css/index.css";
  47. import RollingBall from "./StRollingBall";
  48. import Loading from "./StLoading";
  49. export default {
  50. name: "BasketballBlock",
  51. props: ["type"],
  52. data() {
  53. return {
  54. titel: "",
  55. timer: [], //存储时间
  56. idx: "",
  57. isShow: false,
  58. gameCode: "", //球类别名
  59. name: "", //球类名称传值
  60. bm: "gq",
  61. ball: {
  62. name: "",
  63. index: ""
  64. },
  65. data: "",
  66. timers: true, // 定时器
  67. getIsShow:true
  68. };
  69. },
  70. components: {
  71. RollingBall,
  72. Loading
  73. },
  74. methods: {
  75. getInfo: function(val, match_id,game_code) {
  76. this.$store.dispatch("GETACTIVITY", "StRollBall");
  77. //onsole.log("id", val);
  78. this.$router.push({
  79. path: "./StRollBallBettingPage",
  80. query: {
  81. gameCode: this.gameCode,
  82. status: 1,
  83. number: 0,
  84. home: true,
  85. name: this.titel
  86. }
  87. });
  88. this.$store.dispatch('GET_BALL_ID',game_code)
  89. this.$store.dispatch("MACTH_ID", match_id);
  90. },
  91. getAjax: function(data) {
  92. if(data.matchData == 0) return false;
  93. let _this = this;
  94. if (this.type == 1) {
  95. let matchDtat_leng = data.matchData.length;
  96. for(var i = 0; i < matchDtat_leng; i++){
  97. data.matchData[i].game_code = data.game_code;
  98. }
  99. if(matchDtat_leng > 6){
  100. this.data = data.matchData.slice(0,6);
  101. }else{
  102. this.data = data.matchData
  103. }
  104. this.isShow = true;
  105. this.titel = data.gameName;
  106. this.name = this.titel;
  107. this.ball.name = "所有" + this.titel + "滚球";
  108. this.ball.index = data.matchData.length;
  109. this.gameCode = data.game_code;
  110. // let [f, s] = this.data[0].match_time.split(":");
  111. // _this.data.forEach(val => {
  112. // if (val.match_time != "") {
  113. // let [f, s] = val.match_time.split(":");
  114. // this.$public.timer(f, s, function(f, s) {
  115. // val.match_time = f + ":" + s;
  116. // });
  117. // }
  118. // });
  119. } else if (this.type == 2) {
  120. let matchDtat_leng = data.matchData.length;
  121. for(var i = 0; i < matchDtat_leng; i++){
  122. data.matchData[i].game_code = data.game_code;
  123. }
  124. if(matchDtat_leng > 6){
  125. this.data = data.matchData.slice(0,6);
  126. }else{
  127. this.data = data.matchData
  128. }
  129. this.isShow = true;
  130. this.titel = data.gameName;
  131. this.name = this.titel;
  132. this.ball.index = this.data.length;
  133. this.ball.name = "所有" + this.titel + "滚球";
  134. this.gameCode = data.game_code;
  135. } else if (this.type == 3) {
  136. let matchDtat_leng = data.matchData.length;
  137. for(var i = 0; i < matchDtat_leng; i++){
  138. data.matchData[i].game_code = data.game_code;
  139. }
  140. if(matchDtat_leng > 6){
  141. this.data = data.matchData.slice(0,6);
  142. }else{
  143. this.data = data.matchData
  144. }
  145. this.isShow = true;
  146. this.titel = data.gameName;
  147. this.ball.index = this.data.length;
  148. this.name = this.titel;
  149. this.ball.name = "所有" + this.titel + "滚球";
  150. this.gameCode = data.game_code;
  151. }
  152. setTimeout(()=>{
  153. _this.$store.dispatch("GETSHOW", false);
  154. },1000)
  155. }
  156. },
  157. /**
  158. * 计算属性
  159. */
  160. computed: {
  161. getHomeRollBall() {
  162. return this.$store.getters.getHomeRollBall;
  163. },
  164. },
  165. /**
  166. * 监听器
  167. */
  168. watch: {
  169. getHomeRollBall(val){
  170. if(this.type == 1){
  171. this.getAjax(val.zqData);
  172. }else if(this.type == 2){
  173. this.getAjax(val.lqData);
  174. }else if(this.type == 3){
  175. this.getAjax(val.bqData);
  176. }
  177. }
  178. },
  179. mounted() {
  180. if(this.getIsShow){
  181. this.$store.dispatch("GETSHOW", true);
  182. this.getIsShow = false;
  183. }
  184. },
  185. beforeDestroy() {
  186. this.timers = false;
  187. }
  188. };
  189. </script>
  190. <style scoped>
  191. /* .box{
  192. border-bottom: 1px soild red;
  193. } */
  194. .macth {
  195. height: 1.76rem;
  196. margin-top: 0.2rem;
  197. color: #333333;
  198. background: #dcdcdc;
  199. border-radius: 0.08rem;
  200. /* border:2px solid #CECECE; */
  201. padding: 0.24rem;
  202. font-size: 0.22rem;
  203. }
  204. .score-icon {
  205. min-width: 0.66rem;
  206. background: #f76649;
  207. border-radius: 0.17rem;
  208. color: #f5f5f5;
  209. font-size: 0.2rem;
  210. }
  211. .teamName {
  212. font-size: 0.26rem;
  213. }
  214. .team-box {
  215. margin-left: 0.29rem;
  216. max-width: 3.4rem;
  217. }
  218. .macth-time {
  219. font-size: 0.24rem;
  220. }
  221. .title {
  222. padding-top: 0.1rem;
  223. margin: 0.1rem 0;
  224. font-size: 0.28rem;
  225. color: #000000;
  226. }
  227. .rolling {
  228. padding-top: 0.41rem;
  229. padding-bottom: 0.46rem;
  230. }
  231. </style>