detail.uvue 932 B

123456789101112131415161718192021222324252627282930
  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 progress = ref(1)
  6. const webviewSrc = ref('')
  7. var isLoading = ref(true)
  8. onMounted(() => {
  9. webviewSrc.value = 'https://oss.xiaoxiongcode.com/physics-unit-practice/index.html?num=' + router.query().num
  10. })
  11. function handleMessage(e) {
  12. var pages = getCurrentPages();
  13. const prevPage = pages[pages.length - 2];
  14. (prevPage as any).status = "success"
  15. }
  16. function handleLoad() {
  17. isLoading.value = false
  18. console.log('handleLoad')
  19. }
  20. onShow(() => {
  21. var pages = getCurrentPages();
  22. const prevPage = pages[pages.length - 2];
  23. (prevPage as any).status = "test"
  24. })
  25. </script>
  26. <template>
  27. <Loading v-show="isLoading" />
  28. <web-view :src="webviewSrc" class="w-full h-full" @message="handleMessage" @load="handleLoad"></web-view>
  29. </template>
  30. <style lang="less" scoped></style>