read.wxml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <!--pages/read/read.wxml-->
  2. <view class="container" style="background-color: {{backgroundColor}}">
  3. <view class="content" wx:if="{{!loading && chapter}}">
  4. <view class="chapter-title">{{chapter.chapterTitle}}</view>
  5. <rich-text
  6. class="chapter-content"
  7. style="font-size: {{fontSize}}rpx;"
  8. nodes="{{chapter.contentText}}"
  9. ></rich-text>
  10. </view>
  11. <!-- 底部操作栏 -->
  12. <view class="toolbar">
  13. <view class="tool-item" bindtap="prevChapter">
  14. <text>上一章</text>
  15. </view>
  16. <view class="tool-item" bindtap="showChapterList">
  17. <text>目录</text>
  18. </view>
  19. <view class="tool-item" bindtap="toggleSettings">
  20. <text>设置</text>
  21. </view>
  22. <view class="tool-item" bindtap="nextChapter">
  23. <text>下一章</text>
  24. </view>
  25. </view>
  26. <!-- 设置面板 -->
  27. <view class="settings-panel" wx:if="{{showSettings}}">
  28. <view class="settings-title">阅读设置</view>
  29. <!-- 字体大小 -->
  30. <view class="setting-item">
  31. <text class="setting-label">字体大小</text>
  32. <view class="font-slider-container">
  33. <slider
  34. class="font-slider"
  35. min="0"
  36. max="10"
  37. value="{{(fontSize - 28) / 2}}"
  38. step="1"
  39. bindchange="adjustFontSize"
  40. show-value="{{false}}"
  41. activeColor="#667eea"
  42. backgroundColor="#e0e0e0"
  43. />
  44. <text class="font-size-text">{{fontSize}}rpx</text>
  45. </view>
  46. </view>
  47. <!-- 背景颜色 -->
  48. <view class="setting-item">
  49. <text class="setting-label">背景颜色</text>
  50. <view class="color-picker">
  51. <view
  52. class="color-item {{backgroundColor === '#fff' ? 'active' : ''}}"
  53. data-color="#fff"
  54. bindtap="changeBackground"
  55. ></view>
  56. <view
  57. class="color-item {{backgroundColor === '#f5f5dc' ? 'active' : ''}}"
  58. data-color="#f5f5dc"
  59. bindtap="changeBackground"
  60. ></view>
  61. <view
  62. class="color-item {{backgroundColor === '#e8f5e9' ? 'active' : ''}}"
  63. data-color="#e8f5e9"
  64. bindtap="changeBackground"
  65. ></view>
  66. <view
  67. class="color-item {{backgroundColor === '#263238' ? 'active' : ''}}"
  68. data-color="#263238"
  69. bindtap="changeBackground"
  70. ></view>
  71. </view>
  72. </view>
  73. </view>
  74. <!-- 遮罩层 -->
  75. <view
  76. class="mask"
  77. wx:if="{{showSettings}}"
  78. bindtap="toggleSettings"
  79. ></view>
  80. </view>