web-view.uvue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <script setup lang='ts'>
  2. import { ref, onMounted, watchEffect } from 'vue'
  3. import Loading from '@/components/loading.uvue'
  4. import { router } from '@/.cool'
  5. const menu2Items = [
  6. { id: '1', name: '观察', icon: 'https://oss.xiaoxiongcode.com/static/home/kanke.png' },
  7. { id: '2', name: '提问', icon: 'https://oss.xiaoxiongcode.com/static/home/lianxi.png' },
  8. { id: '3', name: '假设', icon: 'https://oss.xiaoxiongcode.com/static/home/shiyan.png' },
  9. { id: '4', name: '实验', icon: 'https://oss.xiaoxiongcode.com/static/home/riji.png' },
  10. { id: '5', name: '总结', icon: 'https://oss.xiaoxiongcode.com/static/home/riji.png' },
  11. { id: '6', name: '拓展', icon: 'https://oss.xiaoxiongcode.com/static/home/riji.png' },
  12. ]
  13. const progress = ref(1)
  14. const webviewSrc = ref('')
  15. const isLoading = ref(true)
  16. onMounted(() => {
  17. webviewSrc.value = router.query().src
  18. progress.value = router.query().progress
  19. })
  20. function handleMessage(e) {
  21. var pages = getCurrentPages();
  22. const prevPage = pages[pages.length - 2];
  23. (prevPage as any).status = "success"
  24. }
  25. </script>
  26. <template>
  27. <Loading v-show="isLoading" />
  28. <view class="w-full h-full" v-show="!isLoading">
  29. <!-- <view class="video-fullscreen_title">
  30. <Back />
  31. <view class="control-progress">
  32. <view class="before"></view>
  33. <view v-for="(item, i) in menu2Items" :key="item.id"
  34. class="px-0 py-3 flex items-center justify-center gap-[5px] relative z-[1]"
  35. :class="{ '!bg-[#fff] rounded-full': progress == i + 1 }">
  36. <cl-image :src="item.icon" mode="heightFix" class="!h-[30px]"></cl-image>
  37. <text class="text-[14px] font-bold" :class="{ '!text-[#2BA0F3]': progress == i + 1 }">{{ item.name
  38. }}</text>
  39. </view>
  40. </view>
  41. </view> -->
  42. <web-view :src="webviewSrc + '?' + Math.random()" class="w-full h-full" @message="handleMessage"></web-view>
  43. </view>
  44. </template>
  45. <style lang="less" scoped></style>