瀏覽代碼

日常开发

linxuxiang 5 月之前
父節點
當前提交
f8af8c0e78
共有 2 個文件被更改,包括 14 次插入17 次删除
  1. 4 3
      src/components/Header/index.vue
  2. 10 14
      src/views/sunshineRun/index.vue

+ 4 - 3
src/components/Header/index.vue

@@ -72,8 +72,9 @@ const { userInfo, timerManager, parameter, date, voice, screen } = toRefs(data);
  * 更新时间
 */
 const setDate = () => {
-  date.value = proxy?.$utils.getDate();
-  setTimeout(setDate, 1000);
+  setInterval(() => {
+    date.value = proxy?.$utils.getDate();
+  }, 1000)
 };
 
 /**
@@ -186,7 +187,7 @@ $waiPadding: 6.51rem;
   }
 }
 
-.logoBox{
+.logoBox {
   display: flex;
 }
 

+ 10 - 14
src/views/sunshineRun/index.vue

@@ -35,11 +35,7 @@
                   </div>
                 </div>
               </div>
-              <div class="right" v-if="['basketballv1', 'footballv1'].includes(parameter.project)">
-                <div class="score">{{ proxy?.$utils.runTime(item.result, true, false) }}
-                </div>
-              </div>
-              <div class="right" v-else>
+              <div class="right">
                 <div class="score">{{ item.result }}
                 </div>
                 <div class="unit">{{ unit }}</div>
@@ -55,20 +51,18 @@
 <script setup name="SunshineRun" lang="ts">
 const { proxy } = getCurrentInstance() as any;
 const router = useRouter();
-const reportScrollRef = ref();
-const myInfo: any = localStorage.getItem("userInfo");
 
 const data = reactive<any>({
-  userInfo: {},//用户信息
-  reportList: [],
+  reportList: [],//排行榜
   date: "",//当前时间
-  screen: true
+  unit: "",//单位
+  screen: true,//全屏控制
 });
 
 const {
-  userInfo,
   reportList,
   date,
+  unit,
   screen
 } = toRefs(data);
 
@@ -76,11 +70,11 @@ const {
  * 更新时间
 */
 const setDate = () => {
-  date.value = proxy?.$utils.getDate();
-  setTimeout(setDate, 1000);
+  setInterval(() => {
+    date.value = proxy?.$utils.getDate();
+  }, 1000)
 };
 
-
 /**
  * 屏幕模式
 */
@@ -142,6 +136,8 @@ onBeforeMount(() => {
   }
   //用户信息
   userInfo.value = JSON.parse(myInfo);
+  //单位
+  unit.value = "米";
 })
 
 onMounted(() => {