readPage.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <template>
  2. <view v-html="book_title" :style="{
  3. fontSize:`${config.read_config.fontSizeList[read_setting_data.fontSizeIndex]*1.5}px`,
  4. lineHeight:`${config.read_config.lineHeight * config.read_config.fontSizeList[read_setting_data.fontSizeIndex]}px`,
  5. color:`${font_color}`
  6. }"></view>
  7. <view class="inner-box">
  8. <view class="book-inner"
  9. v-html="text_content"
  10. :style="{
  11. fontSize: `${config.read_config.fontSizeList[read_setting_data.fontSizeIndex]}px`,
  12. lineHeight: `${config.read_config.lineHeight * config.read_config.fontSizeList[read_setting_data.fontSizeIndex]}px`,
  13. color:`${font_color}`
  14. }"></view>
  15. <!-- <image src="../../static/logo.png"></image> -->
  16. </view>
  17. </template>
  18. <script setup lang="ts">
  19. import {defineProps, ref, watch} from 'vue'
  20. import { ReadSetting } from '../../stores/readSetting';
  21. import { config } from '../../config/config';
  22. import { log } from '../../framework/log';
  23. import { tools } from '../../framework/tools';
  24. let {text_content,book_title} = defineProps(['text_content','book_title'])
  25. let read_setting_data = ReadSetting().getReadSetting()
  26. let font_color = ref(tools.getFontColorByMode(read_setting_data.readMode))
  27. function showTopLoading(){
  28. }
  29. function showBottomLoading(){
  30. }
  31. watch(async () => ReadSetting().data.readMode, // 监听的数据源
  32. (newVal, oldVal) => {
  33. font_color.value = tools.getFontColorByMode(ReadSetting().data.readMode)
  34. }
  35. );
  36. defineExpose({ showBottomLoading,showTopLoading });
  37. </script>
  38. <style lang="scss" scoped>
  39. .inner-box {
  40. flex: 1 1 auto;
  41. overflow: hidden;
  42. .book-inner {
  43. text-indent: 2em;
  44. text-align: justify;
  45. }
  46. padding: 5%;
  47. }
  48. </style>