liyongli 2 years ago
parent
commit
6e752bb7de
1 changed files with 34 additions and 1 deletions
  1. 34 1
      src/view/CalligraphyAndPaintingCompetition/index.vue

+ 34 - 1
src/view/CalligraphyAndPaintingCompetition/index.vue

@@ -1,5 +1,12 @@
 <template>
   <div class="CalligraphyAndPaintingCompetition">
+    <div class="total">
+      已有
+      <span class="num">
+        <countTo :startVal="0" :endVal="total" :duration="3000"></countTo>
+      </span>
+      人报名
+    </div>
     <div class="bottom">
       <div class="bottom_item">
         <div class="btn" @click="toDetail = true">活动详情</div>
@@ -99,7 +106,7 @@ import {
   isAndroid,
   isWechat,
 } from '../../utils/isTerminal';
-import { getToupiaoUrl } from '@/api/SilkRoadSpringGala.js';
+import { getTotalNum, getToupiaoUrl } from '@/api/SilkRoadSpringGala.js';
 /**
  * window.$originData.orginParames.title 页面标题
  * window.$originData.orginParames.parameters 固定参数值
@@ -108,7 +115,19 @@ import { getToupiaoUrl } from '@/api/SilkRoadSpringGala.js';
 import logoImage from '@/assets/img/logp.png';
 const toShanshipin = ref(false);
 const toDetail = ref(false);
+const total = ref(0);
 const showWixin = ref(false);
+
+tot();
+window.setInterval(() => tot(), 5000);
+
+function tot() {
+  getTotalNum().then(r => {
+    const res = r || {real: 0, unreal: 0}
+    total.value = Number(res.real || 0) + Number(res.unreal || 0);
+  });
+}
+
 function getDownloadUrl() {
   let url = 'https://ssp.sxtvs.com.cn';
   if (isIpad || isIpod || isIphone)
@@ -269,5 +288,19 @@ function openShanshipinDetail(url = '') {
     width: 100vw;
     height: 100vh;
   }
+
+  .total {
+    color: #fff;
+    position: absolute;
+    top: 50%;
+    left: 50%;
+    transform: translate(-50%, -50%);
+
+    .num {
+      background-color: rgba(0, 0, 0, 0.4);
+      border-radius: 3px;
+      padding: 0.5em;
+    }
+  }
 }
 </style>