e4e522cb7b21ed8b33cc3c7a9ef35c0c52b0e865.svn-base 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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">{{index}}</span>
  7. <img src="../assets/st-imges/minRightArrow.png" alt>
  8. </div>
  9. </div>
  10. <div style=" padding: 0 0.3rem;">
  11. <BasketballBlock :type="st.type1"></BasketballBlock>
  12. <BasketballBlock :type="st.type2"></BasketballBlock>
  13. <BasketballBlock :type="st.type3"></BasketballBlock>
  14. <Tennis></Tennis>
  15. </div>
  16. <div v-if="noData">
  17. <NotOpend :title="this.info"/>
  18. </div>
  19. <!-- <Loading/> -->
  20. </div>
  21. </template>
  22. <script>
  23. import "../css/index.css";
  24. import BasketballBlock from "./StBasketballBlock";
  25. import Loading from "./StLoading";
  26. import Tennis from "./StTennis";
  27. import NotOpend from "@/components/StNotOpend";
  28. export default {
  29. name: "BallDisc",
  30. data() {
  31. return {
  32. data: "",
  33. titel: "滚球盘",
  34. index: 0,
  35. // 区分接口
  36. st: {
  37. type1: 1,
  38. type2: 2,
  39. type3: 3
  40. },
  41. noData: false,
  42. info: "暂无相关滚球赛事",
  43. zqCondition: false,
  44. bqCondition: false,
  45. wqCondition: false,
  46. lqCondition: false,
  47. timers : true // 定时器开关
  48. };
  49. },
  50. methods: {
  51. jumpBallDisc: function() {
  52. this.$router.push({
  53. path: "/StRollBallpage",
  54. query: { number: 0, home: true, hmsts: 1 }
  55. });
  56. // this.$route.query.number
  57. },
  58. noDataShow() {
  59. if (
  60. this.bqCondition == true &&
  61. this.wqCondition == true &&
  62. this.zqCondition == true &&
  63. this.lqCondition == true
  64. ) {
  65. this.noData = true;
  66. } else {
  67. this.noData = false;
  68. }
  69. },
  70. getAjax(){
  71. this.$http.get(this.$ports.home.trollingBall).then(res => {
  72. console.log("zq", res);
  73. if (
  74. res.data.status == 1 &&
  75. res.data.data != null &&
  76. res.data.data.matchData.length > 0
  77. ) {
  78. this.index += res.data.data.matchData.length;
  79. this.zqCondition = false;
  80. if (this.index == NaN) {
  81. this.index = 0;
  82. }
  83. } else {
  84. this.zqCondition = true;
  85. this.noDataShow();
  86. }
  87. });
  88. this.$http.get(this.$ports.home.rollingBall).then(res => {
  89. if (
  90. res.data.status == 1 &&
  91. res.data.data != null &&
  92. res.data.data.matchData.length > 0
  93. ) {
  94. this.index += res.data.data.matchData.length;
  95. this.lqCondition = false;
  96. } else {
  97. this.lqCondition = true;
  98. this.noDataShow();
  99. }
  100. });
  101. this.$http.get(this.$ports.home.wqrollingBall).then(res => {
  102. if (
  103. res.data.status == 1 &&
  104. res.data.data != null &&
  105. res.data.data.matchData.length > 0
  106. ) {
  107. this.index += res.data.data.matchData.length;
  108. this.wqCondition = false;
  109. if (this.index == NaN) {
  110. this.index = 0;
  111. }
  112. } else {
  113. this.wqCondition = true;
  114. this.noDataShow();
  115. }
  116. });
  117. this.$http.get(this.$ports.home.bqrollingBall).then(res => {
  118. if (
  119. res.data.status == 1 &&
  120. res.data.data != null &&
  121. res.data.data.matchData.length > 0
  122. ) {
  123. this.index += res.data.data.matchData.length;
  124. this.bqCondition = false;
  125. if (this.index == NaN) {
  126. this.index = 0;
  127. }
  128. } else {
  129. this.bqCondition = true;
  130. this.noDataShow();
  131. }
  132. });
  133. }
  134. },
  135. components: {
  136. BasketballBlock,
  137. Tennis,
  138. Loading,
  139. NotOpend
  140. },
  141. mounted() {
  142. // 获取条数。。
  143. this.getAjax();
  144. let _this = this;
  145. this.$public.ajaxTimerFun(function(timing){
  146. _this.getAjax();
  147. if (!_this.timers){
  148. clearInterval(timing);
  149. }
  150. })
  151. },
  152. beforeDestroy(){
  153. this.timers = false;
  154. }
  155. };
  156. </script>
  157. <style scoped>
  158. .box {
  159. width: 100%;
  160. padding: 0.28rem 0;
  161. background: #f8f8f8;
  162. padding: 0 0.3rem;
  163. height: 0.88rem;
  164. }
  165. .BallDisc {
  166. font-size: 0.32rem;
  167. background: #f8f8f8;
  168. color: #000000;
  169. margin-bottom: 0.12rem;
  170. }
  171. div /deep/ .tennis .ballBtn {
  172. border-bottom: none;
  173. }
  174. .mark {
  175. position: absolute;
  176. right: 0.8rem;
  177. width: 0.4rem;
  178. height: 0.4rem;
  179. border-radius: 50%;
  180. background: #f76649;
  181. color: floralwhite;
  182. font-size: 0.2rem;
  183. }
  184. </style>