6562ad49823e03dae2441b138928f82da53bd59c.svn-base 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <template>
  2. <div class="BallDisc column">
  3. <div class="row allAlignment center box" style="background:#a0a0a0;" @click="jumpBallDisc">
  4. <span class="row center" style="font-size:.3rem;color:#fff; font-weight: bold;">{{titel}}</span>
  5. <div>
  6. <span class="mark row center">{{idx}}</span>
  7. <img src="../assets/st-imges/minRightArrow.png" alt>
  8. </div>
  9. </div>
  10. <div style=" padding: 0 0.3rem;">
  11. <!-- 足球 -->
  12. <BasketballBlock :type="st.type1"></BasketballBlock>
  13. <!-- 篮球 -->
  14. <BasketballBlock :type="st.type2"></BasketballBlock>
  15. <!-- 网球 -->
  16. <BasketballBlock :type="st.type3"></BasketballBlock>
  17. <!-- 棒球 -->
  18. <Tennis></Tennis>
  19. </div>
  20. <div v-if="noData">
  21. <NotOpend :title="this.info"/>
  22. </div>
  23. <!-- <Loading/> -->
  24. </div>
  25. </template>
  26. <script>
  27. import "@/css/index.css";
  28. import BasketballBlock from "@/components/StBasketballBlock";
  29. import Loading from "@/components/StLoading";
  30. import Tennis from "@/components/StTennis";
  31. import NotOpend from "@/components/StNotOpend";
  32. import Bus from "@/assets/bus.js";
  33. export default {
  34. name: "BallDisc",
  35. data() {
  36. return {
  37. data: "",
  38. titel: "滚球盘",
  39. // index: 0,
  40. // 区分接口
  41. st: {
  42. type1: 1,//足球
  43. type2: 2,//篮球
  44. type3: 3,//棒球
  45. },
  46. noData: false,
  47. info: "暂无相关滚球赛事",
  48. zqCondition: false,
  49. bqCondition: false,
  50. wqCondition: false,
  51. lqCondition: false,
  52. idx: "",
  53. timers: true, // 定时器开关
  54. getIsShow:true,
  55. };
  56. },
  57. methods: {
  58. jumpBallDisc: function() {
  59. this.$store.dispatch("GETACTIVITY", "StRollBall");
  60. this.$router.push({
  61. path: "/StRollBallpage",
  62. query: { number: 0, home: true, hmsts: 1 }
  63. });
  64. },
  65. getNumber() {
  66. if (this.idx == 0) {
  67. this.noData = true;
  68. } else {
  69. this.noData = false;
  70. }
  71. },
  72. //获取首页滚球数据
  73. getAjax(){
  74. this.$http.get(this.$ports.home.getRollingBall).then(res => {
  75. if(res.data.status == '1'){
  76. //console.log(res.data.data);
  77. this.$store.dispatch("SET_HOMEROLLBALL",res.data.data);
  78. }
  79. })
  80. }
  81. },
  82. components: {
  83. BasketballBlock,
  84. Tennis,
  85. Loading,
  86. NotOpend
  87. },
  88. mounted() {
  89. if (this.getIsShow) {
  90. this.$store.dispatch("GETSHOW", true);
  91. this.getIsShow = false;
  92. }
  93. if (this.$store.getters.getHeadTitle) {
  94. let title = this.$store.getters.getHeadTitle;
  95. this.idx = title[0].matchNum;
  96. }
  97. //获取数据
  98. this.getAjax();
  99. //获取条数。。
  100. this.getNumber();
  101. let _this = this;
  102. this.$public.ajaxTimerFun(function(timing) {
  103. if (_this.timers) {
  104. _this.getNumber();
  105. _this.getAjax();
  106. } else {
  107. clearInterval(timing);
  108. }
  109. },(1000*10));
  110. },
  111. computed: {
  112. getHeadTit() {
  113. return this.$store.getters.getHeadTitle;
  114. }
  115. },
  116. watch: {
  117. getHeadTit(val) {
  118. this.idx = val[0].matchNum;
  119. }
  120. },
  121. beforeDestroy() {
  122. this.timers = false;
  123. }
  124. };
  125. </script>
  126. <style scoped>
  127. .box {
  128. width: 100%;
  129. padding: 0.28rem 0;
  130. background: #f8f8f8;
  131. padding: 0 0.3rem;
  132. height: 0.88rem;
  133. }
  134. .BallDisc {
  135. font-size: 0.32rem;
  136. background: #f8f8f8;
  137. color: #000000;
  138. margin-bottom: 0.12rem;
  139. }
  140. div /deep/ .tennis .ballBtn {
  141. border-bottom: none;
  142. }
  143. .mark {
  144. position: absolute;
  145. right: 0.8rem;
  146. width: 0.4rem;
  147. height: 0.4rem;
  148. border-radius: 50%;
  149. background: #f76649;
  150. color: floralwhite;
  151. font-size: 0.2rem;
  152. }
  153. </style>