Kaynağa Gözat

fix: tpagebug

lvkun996 2 yıl önce
ebeveyn
işleme
bceca4cc4c

+ 0 - 2
components.d.ts

@@ -10,8 +10,6 @@ declare module '@vue/runtime-core' {
     LuojigouBoard: typeof import('./src/components/LuojigouBoard/index.vue')['default']
     RouterLink: typeof import('vue-router')['RouterLink']
     RouterView: typeof import('vue-router')['RouterView']
-    VanActionSheet: typeof import('vant/es')['ActionSheet']
-    VanOverlay: typeof import('vant/es')['Overlay']
     VanProgress: typeof import('vant/es')['Progress']
   }
 }

BIN
dist.zip


+ 1 - 1
public/index.html

@@ -5,7 +5,7 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
-    <title><%= htmlWebpackPlugin.options.title %></title>
+    <title>学习计划</title>
   </head>
   <body>
     <noscript>

BIN
src/assets/component/LuojigouBoard/rect.png


BIN
src/assets/component/LuojigouBoard/study1.png


BIN
src/assets/component/LuojigouBoard/study2.png


BIN
src/assets/component/LuojigouBoard/study3.png


+ 2 - 0
src/hook/appHook.ts

@@ -33,6 +33,8 @@ const getToken = () => {
 
   return new Promise( (resolve) => {
     window.returnToken = token => {
+      console.log('app返回token:', token);
+      
       useTokenStore().set(token) 
       resolve(token)
     }

+ 41 - 4
src/hook/index.ts

@@ -1,4 +1,4 @@
-import { onUnmounted, reactive, onMounted } from 'vue'
+import { onUnmounted, reactive, onMounted, watch } from 'vue'
 import { UseAudioFastCall, UseAudioManager, UseScheduler, UseSchedulerFastCall, UseSchedulerOnceProps } from './types'
 import dayjs from 'dayjs'
 
@@ -55,6 +55,10 @@ export const useSchedulerOnce = ({
   }, delay)
 }
 
+
+
+
+
 /**
  * @description 音频 全局共享一个音频 单例
  * @description 音频的duration 需要在oncanplay事件中才能获取到
@@ -69,11 +73,12 @@ export const useAudioManager: UseAudioManager = ({
     src: '',
     playing: false,
     updateTime: '',
-    duration: '',
+    duration: '', 
     percentage: 0,
     play: () => {},
     pause: () => {},
-    onended: () => {}
+    onended: () => {},
+    setPercentage: () => {}
   })
   if (typeof window.$audio === 'object') {
     window.$audio.src = url
@@ -99,6 +104,22 @@ export const useAudioManager: UseAudioManager = ({
       fco.percentage = atx.currentTime / atx.duration
     }
 
+    // ios 下new audio获取音频时长问题
+    atx.onloadedmetadata = () => {
+      console.log('/ ios 下new audio获取音频时长问题:',  dayjs(Math.round(atx.duration) * 1000).format(format));
+      
+      fco.duration = dayjs(Math.round(atx.duration) * 1000).format(format)
+    }
+
+    fco.setPercentage = (percentage: number ) => {
+
+      fco.percentage = percentage
+      
+      atx.currentTime = percentage * atx.duration
+
+      fco.pause()
+    }
+
     fco.play = atx.play.bind(atx)
 
     fco.pause = atx.pause.bind(atx)
@@ -127,6 +148,22 @@ export const useAudioManager: UseAudioManager = ({
 
     onUnmounted(() => {
       fco.pause && fco.pause()
+    })
+
+    watch(
+      () => fco.src,
+      () => {
+        console.log('我触发吗');
+        
+        atx.muted = true
+        atx.play().then(() => atx.pause())
+      }
+    )
+
+    onMounted(() => {
+
+     
+
     })
 
     return [fco, window.$audio]
@@ -336,6 +373,6 @@ export const useLocalStorage = (key: string): [any, (value: any) => void] => {
     return value
   }
   
-  return [ _get(), fn]
+  return [ _get, fn]
 
 }

+ 1 - 0
src/hook/types.d.ts

@@ -28,6 +28,7 @@ export interface UseAudioFastCall {
   updateTime: string | number,
   duration: string | number,
   percentage: number
+  setPercentage:  (percentage: number) => void
   play:() => void,
   pause:() => void,
   onended: ((this: GlobalEventHandlers, ev: Event) => any) | null

+ 13 - 1
src/pages/LearnPlan/components/AbleChart.vue

@@ -3,12 +3,16 @@
   <div class="able-chart" >
     <div class="title" >{{props.title}}</div>
     <div class="able" >
-      <div class="able-item" v-for="item in 5" :key="item" >
+      <div class="able-item" v-for="item in 6" :key="item" >
         <img
           :src=" item > props.count ?  staticImg.ableGrey : staticImg.able" alt=""
         >
+
       </div>
     </div>
+    <img class="study" v-if="index === 0" :src="require('@/assets/component/LuojigouBoard/study1.png')" />
+    <img class="study" v-if="index === 1" :src="require('@/assets/component/LuojigouBoard/study2.png')" />
+    <img class="study" v-if="index === 2" :src="require('@/assets/component/LuojigouBoard/study3.png')" />
   </div>
 </template>
 
@@ -22,6 +26,7 @@ const staticImg = {
 interface IProps {
   title: string,
   count: number | string
+  index: number
 }
 
 const props = defineProps<IProps>()
@@ -39,12 +44,19 @@ const props = defineProps<IProps>()
   display: flex;
   justify-content: space-between;
   align-items: center;
+  background: url('~@/assets/component/LuojigouBoard/rect.png') no-repeat top left;
+  position: relative;
   .title {
     font-size: 14px;
     font-family: PingFangSC-Medium, PingFang SC;
     font-weight: 500;
     color: #FF8024;
   }
+  .study {
+    position: absolute;
+    top: 0;
+    left: 0;
+  }
   .able {
     display: flex;
     display: flex;

+ 1 - 0
src/pages/LearnPlan/main.ts

@@ -5,6 +5,7 @@ import 'lib-flexible'
 import 'normalize.css'
 import * as Pinia from 'pinia'
 import VConsole from 'vconsole'
+import '@/utils/vant'
 // import store from './store'
 
 new VConsole()

+ 1 - 2
src/pages/LearnPlan/public/index.html

@@ -5,14 +5,13 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
-    <title><%= htmlWebpackPlugin.options.title %></title>
+    <title>学习计划</title>
   </head>
   <body>
     <noscript>
       <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
     </noscript>
     <div id="LearnPlan"></div>
-    <script src="https://unpkg.com/@rive-app/canvas@1.0.102"></script>
     <!-- built files will be auto injected -->
   </body>
 </html>

+ 148 - 70
src/pages/LearnPlan/views/LearnReport/index.vue

@@ -25,18 +25,17 @@
       <div class="learn-preview-data" >
         <div class="data-item"  >
           <div class="staticsc" >
-            <!-- <span>{{ state.report?.totalStudyDays}}</span> -->
-            <span>1</span>
+            <span>{{state.report?.totalDuration ? Math.floor( state.report?.totalDuration! / 60) : 0 }}</span>            
             <div class="unit" >分钟</div>
-          </div>
+          </div>  
           <div class="data-item-desc" >
             累计时长
           </div>
         </div>
         <div class="data-item"  >
           <div class="staticsc" >
-            <!-- <span>{{state.report?.totalStars}}</span> -->
-            <span>12</span>
+            <span>{{state.report?.totalStars}}</span>
+        
             <div class="unit" >颗</div>
           </div>
           <div class="data-item-desc" >
@@ -45,8 +44,7 @@
         </div>
         <div class="data-item"  >
           <div class="staticsc" >
-            <!-- <span>{{state.report?.totalQuantity}}</span> -->
-            <span>7</span>
+            <span>{{state.report?.accuracy}}</span>
             <div class="unit" >%</div>
           </div>
           <div class="data-item-desc" >
@@ -57,8 +55,9 @@
       <div class="decator" >
         <img :src="staticImg.decator" alt="">
       </div>
-
-      <div class="audio-play-container" :style="{background: `url(${state.report?.task3Image}) no-repeat top left`}" >
+      <div class="audio-play-container" 
+        :style="{backgroundImage: `url(${state.report?.task3Image}`}"
+      >
         <div v-if="!fco.playing" class="audio-time-total" >
           {{fco.duration}}
         </div>
@@ -66,8 +65,9 @@
           <img :src="staticImg.playButton" alt="">
         </div>
 
-        <div class="play-process"  v-show="fco.playing" >
+        <div class="play-process" ref="playProcessRef"   v-show="fco.playing" >
           <van-progress
+            @click="updatePercentage"
             class="van-progress"
             :percentage="Number(fco.percentage.toFixed(2)) * 100"
             pivot-color="#FF8024"
@@ -93,27 +93,27 @@
         <img :src="staticImg.learnAny" alt="">
         <div class="learn-title" >今日练习分析</div>
       </div>
-
       <div class="able-any" >
         <able-chart
           style="margin-bottom: 12px;"
           :title="item.capability"
+          :index="index"
           :count="item.correctQuantity"
-          v-for="item in state.report?.exerciseCardResultList"
+          v-for="(item, index) in state.report?.exerciseCardResultList"
           :key="item.capability"
         />
       </div>
     </div>
-
+ 
     <!-- 家园共育策略 -->
     <div class="home-strategy learn-modle" >
       <div class="learn-modle-title" >
         <img :src="staticImg.strategy" alt="">
-        <div class="learn-title" >家园共育策略</div>
+        <div class="learn-title" >亲子游戏策略</div>
       </div>
       <div class="strategy" >
         <div class="strategy-item" 
-          v-for="item in state.report?.teachDescription.split('\n').splice(0, state.report?.teachDescription.split('\n').length - 1 )" 
+          v-for="item in state.report?.teachDescription.split('\n').splice(0, state.report?.teachDescription.split('\n').length)" 
           :key="item"
         >
           <div class="dot" ></div>
@@ -149,44 +149,44 @@
 
   </div>
 
-    <van-overlay :show="posterShowState" :lock-scroll="false"  :z-index="10"  @click="posterShowState = false">
-      <div class="wrapper" >
-        <div  class="poster-container" ref="learnReportRef" ></div>
-        <!-- 点击晒报告 晒报告 -->
-        <van-action-sheet :overlay="false" v-model:show="shareShowState" :closeable="false" :z-index="11" title="晒报告">
-          <div class="share-dialog" >
-            <div class="share-content" >
-              <div class="share-item" @click.stop="savePoster">
-                <img :src="staticImg.photo" alt="">
-                <span>保存海报</span>
-              </div>
-              <div class="share-item" @click.stop="shareWx">
-                <img :src="staticImg.wechat" alt="">
-                <span>微信好友</span>
-              </div>
+      <Overlay :show="posterShowState" class="van-overlay" :lock-scroll="false"  :z-index="10"  @click="posterShowState = false">
+        <div class="wrapper">
+          <div  class="poster-container" id="learnReportRef"></div>
+        </div>
+      </Overlay>
+
+      <ActionSheet :overlay="false" :show="posterShowState" :closeable="false" :z-index="11" title="晒报告">
+        <div class="share-dialog" >
+          <div class="share-content" >
+            <div class="share-item" @click.stop="savePoster">
+              <img :src="staticImg.photo" alt="">
+              <span>保存海报</span>
             </div>
-            <div class="cancel-butuon" @click="shareShowState = false" >
-              取消
+            <div class="share-item" @click.stop="shareWx">
+              <img :src="staticImg.wechat" alt="">
+              <span>微信好友</span>
             </div>
           </div>
-        </van-action-sheet>
-      </div>
-      
-    </van-overlay>
-
+          <div class="cancel-butuon" @click="closeModal" >
+            取消
+          </div>
+        </div>
+      </ActionSheet>
   </div>
 
 </template>
 
 <script setup lang="ts">
-import { ref, nextTick, onMounted, computed, watch, reactive } from 'vue'
-import { useAudioManager } from '@/hook/index'
+
+import { ref, nextTick, onMounted, computed, watch, reactive, getCurrentInstance } from 'vue'
+import { useAudioManager, useSchedulerOnce } from '@/hook/index'
 import AbleChart from '../../components/AbleChart.vue'
 import { screenShot, createQrcode } from '@/utils/utils'
 import { getReportByUser, shareUserReport } from "@/api/learnPlan"
 import { useRoute } from 'vue-router'
 import { useAppRouter, useAppFunc } from '@/hook/appHook'
 import { useTokenStore } from '@/store'
+import  { Button, Overlay, ActionSheet } from 'vant'
 
 export interface QueryParams {
   i: string,
@@ -213,12 +213,12 @@ const [fco, atx] = useAudioManager({
 
 const queryParams = useRoute().query as unknown as QueryParams
 
-// queryParams.i = "1630466274125459458"
-// queryParams.u = "1430026961974345730"
+queryParams.i = "1630466274125459458"
+queryParams.u = "1430026961974345730"
 
-console.log(window.location.href);
+const posterScaleRate = ref(window.screen.width / window.screen.height > 0.7 ? 0.22 : 0.3)
 
-console.log("queryParams:", queryParams);
+const userId = ref(queryParams.u)
 
 const appRouter = useAppRouter()
 
@@ -230,18 +230,61 @@ const posterShowState = ref(false)
 
 const shareShowState = ref(false)
 
-const learnReportRef = ref()
+const playProcessRef = ref('')
+
+const learnReportRef = ref('')
 
 const posterblob = ref('')
 
-const playAudio = () => fco.play()
+const playAudio = () => {
+  console.log(Array.from(document.getElementsByClassName('van-progress__pivot'))[0].getBoundingClientRect());
+  
+  fco.play()
+}
 
 const state = reactive<Partial<API.LearnPlan.Task>>({})
 
+const closeModal = () => {
+
+  posterShowState.value = false
+
+}
+
+const initAudioDragEvent = () => {
+  let element = Array.from(document.getElementsByClassName('van-progress__pivot'))[0]
+
+  let start = 0;
+
+  let distance = 0;
+
+  element.addEventListener("touchstart", function(event) {
+    start = event.touches[0].clientX;
+    fco.pause()
+  });
+
+  element.addEventListener("touchmove", function(event) {
+    distance = event.touches[0].clientX - start + 11;
+    console.log(distance);
+    if (distance < 0) {
+      fco.setPercentage(0)
+    } else if (distance  > playProcessRef.value.clientWidth) {
+      fco.setPercentage( 1)
+    } else {
+      fco.setPercentage( distance / playProcessRef.value.clientWidth)
+    }
+    
+  });
+
+
+  element.addEventListener('touchend', function(e) {
+    fco.play()
+  }, false);
+
+}
+
 const openModal = () => {
   posterShowState.value = true
-  shareShowState.value = true
-  _shareUserReport()
+  createPoster()
 }
 
 const savePoster = () => {
@@ -249,47 +292,69 @@ const savePoster = () => {
 }
 
 const _shareUserReport = async () => {
-  const data = await shareUserReport({ "itemId": queryParams.i, "userId": queryParams.u! })
-  console.log(data);
-  createPoster()
+  await shareUserReport({ "itemId": queryParams.i, "userId": queryParams.u! })
+}
+
+const updatePercentage = (e) => {
+
+  const percentage = (e.layerX / playProcessRef.value.clientWidth)
+
+  fco.setPercentage(percentage)
+
 }
 
 // 分享海报到微信
 const shareWx = () => {
   appFunc.shareWx(posterblob.value)
+  _shareUserReport()
 }
 
 // 获取用户报告信息
 const _getReportByUser = async () => {
-  console.log('获取用户报告信息', useTokenStore().get());
-  
   const { data } = await getReportByUser({ "itemId": queryParams.i, "userId": queryParams.u! })
   fco.src = data.report.userLearnShareAudio
   state.report = data.report
+  userId.value = data.userId
+  getQrcodeUrl()
 }
 
 const createPoster = async () => {
-  posterShowState.value = true
+  console.log(posterScaleRate.value);
+  
   nextTick(async () => {
-    if (Array.from(learnReportRef.value.children).length === 0) {
+    console.log(learnReportRef.value);
+    const target = document.getElementById('learnReportRef')!
+    if (Array.from(target!.children).length === 0) {
       const posterEl = await screenShot('learn-report')
-      console.log('posterEl.src:', posterEl.src);
       posterblob.value = posterEl.src
-      posterEl.style.transform = 'scale(0.8)'
-      learnReportRef.value.append(posterEl)
+      posterEl.style.width = window.screen.width * posterScaleRate.value + 'px'
+      target.append(posterEl)
+      state.shared = 1
     }
   })
+
 }
 
 const getQrcodeUrl = async () => {
-  qrcode.value = await createQrcode(window.location.href)
+  qrcode.value = await createQrcode(queryParams.u ? window.location.href :  `${window.location.href}&u=${userId.value}`)
 }
 
 onMounted(async () => {
-  await appRouter.getToken()
+
+  // fco.src = 'https://app-resources-luojigou.luojigou.vip/61b092e0-ed4d-11ed-b1c6-f74dbdb881ba'
+  // console.log(fco.src);
   
-  getQrcodeUrl()
-  _getReportByUser()
+  if (queryParams.u) {
+   _getReportByUser()
+  } else {
+    await appRouter.getToken()
+   _getReportByUser()
+  }
+
+  initAudioDragEvent()
+
+
+
 })
 
 </script>
@@ -311,13 +376,14 @@ onMounted(async () => {
       display: block;
       position: relative;
       top: -20px;
+      object-fit: cover;
     }
     .title-img {
       width: 146px;
       height: 39px;
       display: block;
       position: absolute;
-      top: 78px;
+      top: 98px;
       left: 17px;
     }
     .user-name {
@@ -326,7 +392,7 @@ onMounted(async () => {
       font-weight: 400;
       color: #FFFFFF;
       position: absolute;
-      top: 126px;
+      top: 146px;
       left: 20px;
     }
   }
@@ -412,7 +478,7 @@ onMounted(async () => {
       .data-item {
         .staticsc {
           display: flex;
-          align-items: end;
+          align-items: flex-end;
           span {
             font-size: 36px;
             font-family: DINAlternate-Bold, DINAlternate;
@@ -425,6 +491,9 @@ onMounted(async () => {
             font-family: PingFangSC-Regular, PingFang SC;
             font-weight: 400;
             color: #999999;
+            height: 41px;
+            display: flex;
+            align-items: flex-end;
           }
         }
         .data-item-desc {
@@ -452,12 +521,11 @@ onMounted(async () => {
     .audio-play-container {
       width: 262px;
       height: 277px;
-
       // background-color: #F5F5F5;
       border-radius: 20px;
       margin-top: 30px;
       position: relative;
-      background-size: 100% 100%;
+      background-size: cover;
       .audio-time-total {
         width: 56px;
         height: 24px;
@@ -657,7 +725,7 @@ onMounted(async () => {
   }
 
   .create-poster {
-    width: 375px;
+    width: 100vw;
     height: 88px;
     background: #FEFEFE;
     position: fixed;
@@ -691,14 +759,22 @@ onMounted(async () => {
   }
 }
 
+.van-overlay {
+  width: 100vw;
+  height: 100vh;
+  background-color: rgba(0,0,0,0.4);
+  z-index: 11;
+}
 .wrapper {
     width: 100vw;
     height: 100vh;
     overflow-y: scroll;
     z-index: 40;
     .poster-container {
-      margin-top: -100px;
-      padding-bottom: 300px;
+      position: fixed;
+      left: 50%;
+      top: 6%;
+      transform: translateX(-50%);
     }
   }
 
@@ -715,12 +791,14 @@ onMounted(async () => {
       .share-item {
         display: flex;
         flex-direction: column;
+        justify-content: center;
         margin-top: 18px;
+        align-items: center;
         img {
           width: 51px;
           height: 51px;
           display: block;
-          margin-bottom: 3px;
+          margin-bottom: 6px;
         }
       }
     }

+ 51 - 36
src/pages/LearnPlan/views/TPage/index.vue

@@ -1,10 +1,11 @@
 <template>
-  
   <div class="t-page-v t-page" v-if="dire == 'V'" :style="{background: `url(${staticImg.bgV})`}" >
     <div class="back-icon" >
       <img :src="staticImg.backIcon" alt="" @click="backAppPage" >
     </div>
-    <div id="rive-ani"><canvas width="375" height="375"  id="rive-canvas" style="scale: 0.6;" ></canvas></div>
+    <!-- width="200" height="200" -->
+    <!-- style="scale: 0.6;" -->
+    <div id="rive-ani"><canvas  width="200" height="200"  id="rive-canvas"  ></canvas></div>
     <div class="countdown-container" >
       <div class="countdown" >{{countDown}}s</div>
       <div class="desc" >即将进入下一个环节</div>
@@ -14,20 +15,22 @@
       <learn-plan-button :goPage="pageInfo().next" :title="pageInfo().title" type="forward" />
     </div>
   </div>
-  <div v-else class="t-page-h t-page" :style="{background: `url(${staticImg.bgH})`}">
+  <div v-else class="t-page-h t-page" :style="{backgroundImage: `url(${staticImg.bgH})`}">
     <div class="back-icon" >
       <img :src="staticImg.backIcon" alt="" @click="backAppPage" >
     </div>
-    <div id="rive-ani" >
-      <canvas width="200" height="200"  id="rive-canvas" style="scale: 1;" ></canvas>
-    </div>
-    <div class="countdown-container" >
-      <div class="countdown" >{{countDown}}s</div>
-      <div class="desc" >即将进入下一个环节</div>
-    </div>
-    <div class="opra" >
-      <learn-plan-button :goPage="pageInfo().reload" style="margin-right: 25px;" title="再來一次" type="normal" />
-      <learn-plan-button :goPage="pageInfo().next" :title="pageInfo().title"  type="forward" />
+    <div class="opra-container" >
+      <div id="rive-ani" >
+        <canvas width="200" height="200"  id="rive-canvas" style="scale: 1;" ></canvas>
+      </div>
+      <div class="countdown-container" >
+        <div class="countdown" >{{countDown}}s</div>
+        <div class="desc" >即将进入下一个环节</div>
+      </div>
+      <div class="opra" >
+        <learn-plan-button :goPage="pageInfo().reload" style="margin-right: 25px;" title="再來一次" type="normal" />
+        <learn-plan-button :goPage="pageInfo().next" :title="pageInfo().title"  type="forward" />
+      </div>
     </div>
   </div>
 </template>
@@ -38,10 +41,8 @@ import LearnPlanButton from '../../components/LearnPlanButton.vue'
 import { useAppRouter } from '@/hook/appHook'
 import { useDeviceDire, useScheduler, useSchedulerOnce } from '@/hook/index'
 import { onMounted } from 'vue';
-import { useRouter, useRoute } from "vue-router"
+import { useRoute } from "vue-router"
 import { Rive } from "@rive-app/canvas"
-// console.log('Rive:', Rive);
-// console.log(rive);
 
 const staticImg = {
   backIcon: require('@LP/assets/back-icon.png'),
@@ -53,8 +54,6 @@ const route = useRoute()
 
 let {from} = route.query
 
-
-
 // 来自动画游戏的 进入学一学
 // 来自学一学的 进入讲一讲
 // 来自讲一讲的 进入学习报告
@@ -86,27 +85,33 @@ const countDown = ref(5)
 
 // 1. 初始化rive动画
 const initRive = () => {
+
 console.log(document.getElementById('rive-canvas'));
 
+const canvas = document.getElementById('rive-canvas')
+
+
 const a = new Rive({
-  src: "https://res-game.luojigou.vip/qiqiu2.riv",
-  canvas: document.getElementById('rive-canvas'),
-  autoplay: false,
-  stateMachines: "bumpy",
+  src: "https://res-game.luojigou.vip/qiqiu3.riv",
+  canvas: canvas,
+  autoplay: true,
+  // stateMachines: "bumpy",
   artboard:'reqiqiu-dog',
   onLoad: () => {
-    a.resizeToCanvas()
+    console.log(a);
+    
     a.play('idle')
+    a.resizeToCanvas()
   },
 });
 
 }
 
-direChange((_dire) => {
-  console.log('触发了方向')
-  document.documentElement.style.fontSize = '37.5px'
-  dire.value = _dire
-})
+// direChange((_dire) => {
+//   console.log('触发了方向')
+//   document.documentElement.style.fontSize = '37.5px'
+//   dire.value = _dire
+// })
 
 const [stx] = useScheduler({
   cb: () => {
@@ -149,8 +154,6 @@ const pageInfo = () => {
       break;
   }
 
-
-
   return {
     reload: _reload,
     next: _next,
@@ -159,7 +162,7 @@ const pageInfo = () => {
 }
 
 onMounted(() => {
-  useSchedulerOnce({cb: initRive, delay: 4})
+  useSchedulerOnce({cb: initRive, delay: 100})
 })
 
 
@@ -200,12 +203,13 @@ onMounted(() => {
   position: absolute;
   left: 50%;
   transform: translateX(-50%);
+  top: 2%;
   display: flex;
   justify-content: center;
 }
 
 .t-page-v {
-
+  background-size: cover;
   .back-icon {
     position: fixed;
     top: 50px;
@@ -230,20 +234,31 @@ onMounted(() => {
 }
 
 .t-page-h {
+  background-size: cover;
+  display: flex;
+  justify-content: center;
+  align-items: center;
   .back-icon {
     position: fixed;
     top: 17px;
     left: 42px;
   }
+  .opra-container {
+    position: absolute;
+    height: 1px;
+    width: 100%;
+  }
+  #rive-ani {
+  }
   .countdown-container {
-    position: fixed;
-    top: 216px;
+    position: absolute;
+    bottom: -40px;
     left: 50%;
     transform: translateX(-50%);
   }
   .opra {
-    position: fixed;
-    top: 284px;
+    position: absolute;
+    bottom: -100px;
     left: 50%;
     transform: translateX(-50%);
     display: flex;

+ 1 - 0
src/service/request.ts

@@ -3,6 +3,7 @@ import axios, { AxiosResponse } from 'axios'
 
 
 const baseURL = process.env.NODE_ENV === 'development' ? '/api' : '/zd-api'
+// const baseURL = process.env.NODE_ENV === 'development' ? '/https://open.api.luojigou.vip/' : '/zd-api'
 
 // 'https://open.api.luojigou.vip/'
 

+ 1 - 1
src/store/token.ts

@@ -7,7 +7,7 @@ export const useTokenStore = defineStore(StoreEnum.TOKEN, () => {
   const [ state, setState ] = useLocalStorage(StoreEnum.TOKEN)
 
   return {
-    get: () => state,
+    get: () => state(),
     set: (token: string) => setState(token)
   }
 

+ 6 - 2
src/utils/utils.ts

@@ -9,10 +9,14 @@ import { ScreenShot } from './typing'
  */
 export const screenShot: ScreenShot = async (el) => {
   const _el = typeof el === 'string' ? document.getElementById(el) : el
-
+  const scale = window.devicePixelRatio;
+    // canvas.width = 1000 * scale;
+    // canvas.height = 1000 * scale;
+    // ctx.scale(scale, scale);
   return new Promise((resolve) => {
     html2canvas(_el!, {
-      useCORS: true
+      useCORS: true,
+      scale,
     }).then(canvas => {
       const img = document.createElement('img')
       img.src = canvas.toDataURL('image/png')

+ 1 - 0
src/utils/vant.ts

@@ -1,4 +1,5 @@
 import { createApp } from 'vue'
+
 import {
   Button
 } from 'vant'