| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <!--pages/detail/detail.wxml-->
- <view class="container" wx:if="{{!loading && content}}">
- <!-- 封面和基本信息 -->
- <view class="header">
- <view class="cover-wrapper">
- <image
- class="cover"
- src="{{content.coverUrl}}"
- mode="aspectFill"
- lazy-load="{{true}}"
- binderror="onCoverError"
- wx:if="{{content.coverUrl}}"
- ></image>
- <view class="cover-placeholder" wx:else>
- <text class="cover-text">{{content.title}}</text>
- </view>
- </view>
- <view class="info">
- <view class="title">{{content.title}}</view>
- <view class="author">作者:{{content.author || '未知'}}</view>
- <view class="meta">
- <text class="type">{{content.contentType === 1 ? '电子书' : '听书'}}</text>
- <text class="chapters">{{content.totalChapters || 0}}章</text>
- <text class="status">{{content.status === 1 ? '连载中' : '已完结'}}</text>
- </view>
- <view class="publisher" wx:if="{{content.publisher}}">
- 出版社:{{content.publisher}}
- </view>
- </view>
- </view>
- <!-- 简介 -->
- <view class="description">
- <view class="section-title">简介</view>
- <view class="desc-text">{{content.description || '暂无简介'}}</view>
- </view>
- <!-- 章节列表 -->
- <view class="chapter-section" wx:if="{{chapters.length > 0}}">
- <view class="section-title">
- <text>目录</text>
- <text class="chapter-count">共{{chapters.length}}章</text>
- </view>
- <view class="chapter-list" wx:if="{{showChapterList}}">
- <view
- class="chapter-item"
- wx:for="{{chapters}}"
- wx:key="chapterId"
- wx:for-item="chapter"
- wx:for-index="index"
- data-index="{{index}}"
- bindtap="selectChapter"
- >
- <text class="chapter-number">{{index + 1}}</text>
- <text class="chapter-title">{{chapter.chapterTitle || chapter.title}}</text>
- <text class="chapter-free" wx:if="{{chapter.isFree === 1}}">免费</text>
- </view>
- </view>
- <view class="chapter-preview" wx:else>
- <view
- class="chapter-item"
- wx:for="{{chapters}}"
- wx:key="chapterId"
- wx:for-item="chapter"
- wx:for-index="index"
- data-index="{{index}}"
- bindtap="selectChapter"
- >
- <text class="chapter-number">{{index + 1}}</text>
- <text class="chapter-title">{{chapter.chapterTitle || chapter.title}}</text>
- <text class="chapter-free" wx:if="{{chapter.isFree === 1}}">免费</text>
- </view>
- </view>
- </view>
-
- <!-- 无章节提示 -->
- <view class="no-chapters" wx:if="{{!loading && chapters.length === 0}}">
- <text>暂无章节</text>
- </view>
- <!-- 操作按钮 -->
- <view class="actions">
- <button class="action-btn" bindtap="toggleBookshelf">
- <text class="btn-icon">{{inBookshelf ? '✓' : '+'}}</text>
- <text>{{inBookshelf ? '已在书架' : '加入书架'}}</text>
- </button>
- <button class="action-btn primary" bindtap="startRead">
- {{contentType === 1 ? '开始阅读' : '开始听书'}}
- </button>
- <button class="action-btn" bindtap="toggleChapterList" wx:if="{{chapters.length > 0}}">
- {{showChapterList ? '收起' : '目录'}}
- </button>
- </view>
- </view>
- <view class="loading" wx:if="{{loading}}">
- <text>加载中...</text>
- </view>
|