mainCard.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <swiper class="word-view-swiper-box" :indicator-dots="false" :autoplay="false" :circular="false"
  3. @change="handleSwiperChange" :disable-touch="isPlaying">
  4. <swiper-item>
  5. <view class="swiper-item uni-bg-red">
  6. <xuePage :active-word="activeWord" :active-words="activeWords" @goXiangjie="goXiangjie"
  7. @play-audio="handlePlayAudio" :pageData="pageData"></xuePage>
  8. </view>
  9. </swiper-item>
  10. <swiper-item>
  11. <view class="swiper-item uni-bg-red">
  12. <pinPageVue :active-word="activeWord" :active-words="activeWords" @play-audio="handlePlayAudio">
  13. </pinPageVue>
  14. </view>
  15. </swiper-item>
  16. <swiper-item>
  17. <view class="swiper-item uni-bg-blue">
  18. <readContent :active-word="activeWord" :pageData="pageData" @play-audio="handlePlayAudio"
  19. :active-words="activeWords"></readContent>
  20. </view>
  21. </swiper-item>
  22. <swiper-item>
  23. <view class="swiper-item uni-bg-blue">
  24. <selectPageVue :active-word="activeWord" :active-words="activeWords" @play-audio="handlePlayAudio">
  25. </selectPageVue>
  26. </view>
  27. </swiper-item>
  28. <swiper-item>
  29. <view class="swiper-item uni-bg-blue">
  30. <beiPageVue :active-word="activeWord" :pageData="pageData" :active-words="activeWords"
  31. @play-audio="handlePlayAudio"></beiPageVue>
  32. </view>
  33. </swiper-item>
  34. </swiper>
  35. </template>
  36. <script setup>
  37. import pinPageVue from './pinPage.vue';
  38. import selectPageVue from './selectPage.vue';
  39. import beiPageVue from './beiPage.vue';
  40. import readContent from './readContent.vue';
  41. import xuePage from './xuePage.vue';
  42. import {
  43. ref
  44. } from 'vue';
  45. const props = defineProps({
  46. activeWord: {
  47. type: Object,
  48. },
  49. pageData: {
  50. type: Object,
  51. },
  52. activeWords: {
  53. type: Array
  54. },
  55. isPlaying: Boolean // 新增 isPlaying prop
  56. })
  57. const emits = defineEmits(['play-audio', 'goXiangjie', 'swiper-change'])
  58. function handleSwiperChange(e) {
  59. emits('swiper-change', e.detail.current)
  60. }
  61. function handlePlayAudio({
  62. url,
  63. code
  64. }) {
  65. emits('play-audio', {
  66. url,
  67. code
  68. })
  69. }
  70. function goXiangjie() {
  71. emits('goXiangjie')
  72. }
  73. </script>
  74. <style lang="scss" scoped>
  75. </style>