audio.wxml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <!--pages/audio/audio.wxml-->
  2. <view class="container" wx:if="{{!loading && audio}}">
  3. <!-- 封面和标题 -->
  4. <view class="header">
  5. <image class="cover" src="/images/default-cover.png" mode="aspectFill"></image>
  6. <view class="title">{{audio.chapterTitle}}</view>
  7. <view class="narrator" wx:if="{{audio.narrator}}">播讲:{{audio.narrator}}</view>
  8. </view>
  9. <!-- 播放进度 -->
  10. <view class="progress-section">
  11. <text class="time-text">{{formatTime(currentTime)}}</text>
  12. <slider
  13. class="progress-slider"
  14. min="0"
  15. max="{{duration || 100}}"
  16. value="{{currentTime}}"
  17. step="1"
  18. bindchange="onSeek"
  19. activeColor="#667eea"
  20. backgroundColor="#e0e0e0"
  21. block-color="#667eea"
  22. />
  23. <text class="time-text">{{formatTime(duration)}}</text>
  24. </view>
  25. <!-- 播放控制 -->
  26. <view class="controls">
  27. <view class="control-btn" bindtap="prevChapter">
  28. <text class="icon">◀◀</text>
  29. <text class="label">上一章</text>
  30. </view>
  31. <view class="control-btn play-btn" bindtap="togglePlay">
  32. <text class="icon">{{playing ? '⏸' : '▶'}}</text>
  33. </view>
  34. <view class="control-btn" bindtap="nextChapter">
  35. <text class="icon">▶▶</text>
  36. <text class="label">下一章</text>
  37. </view>
  38. </view>
  39. <!-- 播放设置 -->
  40. <view class="settings">
  41. <view class="setting-item">
  42. <text class="setting-label">播放速度</text>
  43. <slider
  44. class="speed-slider"
  45. min="0.5"
  46. max="2.0"
  47. step="0.25"
  48. value="{{speed}}"
  49. bindchange="changeSpeed"
  50. activeColor="#fff"
  51. backgroundColor="rgba(255,255,255,0.3)"
  52. />
  53. <text class="speed-text">{{speed}}x</text>
  54. </view>
  55. <view class="setting-item">
  56. <button class="chapter-list-btn" bindtap="showChapterList">查看目录</button>
  57. </view>
  58. </view>
  59. </view>
  60. <view class="loading" wx:if="{{loading}}">
  61. <text>加载中...</text>
  62. </view>