|
|
@@ -1,332 +1,348 @@
|
|
1
|
1
|
<template>
|
|
2
|
2
|
<view class="novel-list-page">
|
|
3
|
|
- <!-- 顶部广告(来自Java后台) -->
|
|
4
|
|
- <ad-banner :ads="topAds" />
|
|
|
3
|
+ <!-- 加载状态 -->
|
|
|
4
|
+ <view v-if="loading" class="loading-container">
|
|
|
5
|
+ <uni-icons type="spinner-cycle" size="36" color="var(--primary-color)" class="loading-icon" />
|
|
|
6
|
+ <text>加载中...</text>
|
|
|
7
|
+ </view>
|
|
5
|
8
|
|
|
6
|
|
- <!-- 小说列表 -->
|
|
7
|
|
- <!-- 顶部分类导航 -->
|
|
8
|
|
- <scroll-view scroll-x class="category-nav">
|
|
9
|
|
- <view
|
|
10
|
|
- v-for="category in categories"
|
|
11
|
|
- :key="category.id"
|
|
12
|
|
- class="category-item"
|
|
13
|
|
- :class="{ active: activeCategory === category.id }"
|
|
14
|
|
- @click="changeCategory(category.id)"
|
|
15
|
|
- >
|
|
16
|
|
- {{ category.name }}
|
|
17
|
|
- </view>
|
|
18
|
|
- </scroll-view>
|
|
19
|
|
- <!-- 热门推荐 -->
|
|
20
|
|
- <view class="section">
|
|
21
|
|
- <view class="section-header">
|
|
22
|
|
- <text class="section-title">热门推荐</text>
|
|
23
|
|
- <text class="section-more">更多 ></text>
|
|
24
|
|
- </view>
|
|
25
|
|
- <scroll-view scroll-x class="hot-list">
|
|
|
9
|
+ <!-- 内容区域 -->
|
|
|
10
|
+ <template v-else>
|
|
|
11
|
+ <!-- 顶部广告 -->
|
|
|
12
|
+ <ad-banner v-if="topAds.length" :ads="topAds" />
|
|
|
13
|
+
|
|
|
14
|
+ <!-- 顶部分类导航 -->
|
|
|
15
|
+ <scroll-view scroll-x class="category-nav">
|
|
26
|
16
|
<view
|
|
27
|
|
- v-for="novel in hotNovels"
|
|
28
|
|
- :key="novel.id"
|
|
29
|
|
- class="hot-item"
|
|
30
|
|
- @click="openNovel(novel)"
|
|
|
17
|
+ v-for="category in categories"
|
|
|
18
|
+ :key="category.id"
|
|
|
19
|
+ class="category-item"
|
|
|
20
|
+ :class="{ active: activeCategory === category.id }"
|
|
|
21
|
+ @click="changeCategory(category.id)"
|
|
31
|
22
|
>
|
|
32
|
|
- <image :src="novel.cover" class="hot-cover" />
|
|
33
|
|
- <text class="hot-title">{{ novel.title }}</text>
|
|
|
23
|
+ {{ category.name }}
|
|
34
|
24
|
</view>
|
|
35
|
25
|
</scroll-view>
|
|
36
|
|
- </view>
|
|
37
|
|
-
|
|
38
|
|
- <!-- 分类小说列表 -->
|
|
39
|
|
- <view class="section">
|
|
40
|
|
- <view class="section-header">
|
|
41
|
|
- <text class="section-title">{{ currentCategoryName }}作品</text>
|
|
|
26
|
+
|
|
|
27
|
+ <!-- 空状态 -->
|
|
|
28
|
+ <view v-if="novels.length === 0 && !error" class="empty-container">
|
|
|
29
|
+ <image src="/static/empty-book.png" class="empty-img" />
|
|
|
30
|
+ <text class="empty-text">暂无小说数据</text>
|
|
|
31
|
+ <button class="btn-refresh" @click="loadNovels">重新加载</button>
|
|
42
|
32
|
</view>
|
|
43
|
|
- <view class="novel-grid">
|
|
44
|
|
- <view
|
|
45
|
|
- v-for="novel in novels"
|
|
46
|
|
- :key="novel.id"
|
|
47
|
|
- class="novel-item"
|
|
48
|
|
- @click="openNovel(novel)"
|
|
49
|
|
- >
|
|
50
|
|
- <image :src="novel.cover" class="novel-cover" />
|
|
51
|
|
- <text class="novel-title">{{ novel.title }}</text>
|
|
52
|
|
- <text class="novel-author">{{ novel.author }}</text>
|
|
|
33
|
+
|
|
|
34
|
+ <!-- 错误状态 -->
|
|
|
35
|
+ <view v-if="error" class="error-container">
|
|
|
36
|
+ <uni-icons type="info" size="48" color="var(--error-color)" />
|
|
|
37
|
+ <text class="error-text">{{ error }}</text>
|
|
|
38
|
+ <button class="btn-refresh" @click="loadNovels">重新加载</button>
|
|
|
39
|
+ </view>
|
|
|
40
|
+
|
|
|
41
|
+ <!-- 热门推荐 -->
|
|
|
42
|
+ <view v-if="hotNovels.length > 0" class="section">
|
|
|
43
|
+ <view class="section-header">
|
|
|
44
|
+ <text class="section-title">热门推荐</text>
|
|
|
45
|
+ <text class="section-more" @click="goMore">更多 ></text>
|
|
53
|
46
|
</view>
|
|
|
47
|
+ <scroll-view scroll-x class="hot-list">
|
|
|
48
|
+ <view
|
|
|
49
|
+ v-for="novel in hotNovels"
|
|
|
50
|
+ :key="novel.id"
|
|
|
51
|
+ class="hot-item"
|
|
|
52
|
+ @click="openNovel(novel)"
|
|
|
53
|
+ >
|
|
|
54
|
+ <image :src="getCoverUrl(novel.cover)" class="hot-cover" />
|
|
|
55
|
+ <text class="hot-title">{{ novel.title }}</text>
|
|
|
56
|
+ </view>
|
|
|
57
|
+ </scroll-view>
|
|
54
|
58
|
</view>
|
|
55
|
|
- </view>
|
|
56
|
|
-
|
|
57
|
|
- <!-- 成为签约作家按钮 -->
|
|
58
|
|
- <view class="become-author" @click="applyAuthor">
|
|
59
|
|
- <text>成为签约作家,发布你的作品</text>
|
|
60
|
|
- </view>
|
|
61
|
|
- <!-- 底部广告 -->
|
|
62
|
|
- <ad-banner :ads="bottomAds" />
|
|
|
59
|
+
|
|
|
60
|
+ <!-- 分类小说列表 -->
|
|
|
61
|
+ <view v-if="novels.length > 0" class="section">
|
|
|
62
|
+ <view class="section-header">
|
|
|
63
|
+ <text class="section-title">{{ currentCategoryName }}作品</text>
|
|
|
64
|
+ </view>
|
|
|
65
|
+ <view class="novel-grid">
|
|
|
66
|
+ <view
|
|
|
67
|
+ v-for="(novel, index) in novels"
|
|
|
68
|
+ :key="index"
|
|
|
69
|
+ class="novel-item"
|
|
|
70
|
+ @click="openNovel(novel)"
|
|
|
71
|
+ >
|
|
|
72
|
+ <image :src="getCoverUrl(novel.cover)" class="novel-cover" />
|
|
|
73
|
+ <text class="novel-title">{{ novel.title || '未知标题' }}</text>
|
|
|
74
|
+ <text class="novel-author">{{ novel.author || '未知作者' }}</text>
|
|
|
75
|
+ </view>
|
|
|
76
|
+ </view>
|
|
|
77
|
+ </view>
|
|
|
78
|
+
|
|
|
79
|
+ <!-- 成为签约作家按钮 -->
|
|
|
80
|
+ <view class="become-author" @click="applyAuthor">
|
|
|
81
|
+ <text>成为签约作家,发布你的作品</text>
|
|
|
82
|
+ </view>
|
|
|
83
|
+
|
|
|
84
|
+ <!-- 底部广告 -->
|
|
|
85
|
+ <ad-banner v-if="bottomAds.length" :ads="bottomAds" />
|
|
|
86
|
+ </template>
|
|
63
|
87
|
</view>
|
|
64
|
|
-
|
|
65
|
88
|
</template>
|
|
|
89
|
+
|
|
66
|
90
|
<script>
|
|
|
91
|
+// 确保路径正确
|
|
67
|
92
|
import AdBanner from '@/components/AdBanner';
|
|
68
|
93
|
|
|
69
|
94
|
export default {
|
|
70
|
|
- components: { AdBanner },
|
|
|
95
|
+ components: { AdBanner },
|
|
71
|
96
|
data() {
|
|
72
|
97
|
return {
|
|
73
|
|
- // 确保所有数组初始化为空数组
|
|
74
|
|
- novelList: [], // 存储小说目录数据
|
|
75
|
|
- topAds: [],
|
|
76
|
|
- bottomAds: [],
|
|
77
|
|
- categories: [],
|
|
78
|
|
- activeCategory: 0,
|
|
79
|
|
- hotNovels: [],
|
|
80
|
|
- novels: [],
|
|
81
|
|
- currentCategoryName: '全部'
|
|
82
|
|
-
|
|
|
98
|
+ topAds: [],
|
|
|
99
|
+ bottomAds: [],
|
|
|
100
|
+ categories: [],
|
|
|
101
|
+ activeCategory: 0,
|
|
|
102
|
+ hotNovels: [],
|
|
|
103
|
+ novels: [],
|
|
|
104
|
+ loading: true,
|
|
|
105
|
+ error: null,
|
|
|
106
|
+ currentCategoryName: '全部'
|
|
83
|
107
|
}
|
|
84
|
108
|
},
|
|
85
|
|
- async onLoad() {
|
|
86
|
|
- await this.loadAds();
|
|
87
|
|
- await this.loadNovels();
|
|
88
|
|
- this.loadCategories();
|
|
89
|
|
- this.loadHotNovels();
|
|
90
|
|
- // this.loadNovels();
|
|
|
109
|
+ async mounted() {
|
|
|
110
|
+ await this.initData();
|
|
91
|
111
|
},
|
|
92
|
|
- // onLoad() {
|
|
93
|
|
- // this.loadNovelList();
|
|
94
|
|
- // },
|
|
95
|
112
|
methods: {
|
|
96
|
|
- // 从Java后台加载广告
|
|
|
113
|
+ async initData() {
|
|
|
114
|
+ try {
|
|
|
115
|
+ // 顺序加载数据,避免并行请求冲突
|
|
|
116
|
+ await this.loadCategories();
|
|
|
117
|
+ await this.loadHotNovels();
|
|
|
118
|
+ await this.loadNovels();
|
|
|
119
|
+ await this.loadAds();
|
|
|
120
|
+ } catch (e) {
|
|
|
121
|
+ console.error('初始化失败', e);
|
|
|
122
|
+ this.error = '初始化失败,请检查网络连接';
|
|
|
123
|
+ } finally {
|
|
|
124
|
+ this.loading = false;
|
|
|
125
|
+ }
|
|
|
126
|
+ },
|
|
|
127
|
+
|
|
|
128
|
+ // 加载广告
|
|
97
|
129
|
async loadAds() {
|
|
98
|
|
- const [topRes, bottomRes] = await Promise.all([
|
|
99
|
|
- this.$http.get('/java-api/ad/position?code=TOP_BANNER'),
|
|
100
|
|
- this.$http.get('/java-api/ad/position?code=BOTTOM_BANNER')
|
|
101
|
|
- ]);
|
|
102
|
|
-
|
|
103
|
|
- this.topAds = topRes.data;
|
|
104
|
|
- this.bottomAds = bottomRes.data;
|
|
|
130
|
+ try {
|
|
|
131
|
+ const [topRes, bottomRes] = await Promise.all([
|
|
|
132
|
+ this.$http.get('/java-api/ad/position?code=TOP_BANNER'),
|
|
|
133
|
+ this.$http.get('/java-api/ad/position?code=BOTTOM_BANNER')
|
|
|
134
|
+ ]);
|
|
|
135
|
+
|
|
|
136
|
+ this.topAds = topRes?.data || topRes || [];
|
|
|
137
|
+ this.bottomAds = bottomRes?.data || bottomRes || [];
|
|
|
138
|
+ } catch (e) {
|
|
|
139
|
+ console.error('加载广告失败', e);
|
|
|
140
|
+ }
|
|
105
|
141
|
},
|
|
106
|
|
- applyAuthor() {
|
|
107
|
|
- if (!this.$store.getters.token) {
|
|
108
|
|
- uni.showToast({ title: '请先登录', icon: 'none' });
|
|
109
|
|
- uni.navigateTo({ url: '/pages/login' });
|
|
110
|
|
- return;
|
|
111
|
|
- }
|
|
112
|
|
-
|
|
113
|
|
- uni.navigateTo({ url: '/pages/author/apply' });
|
|
114
|
|
- },
|
|
115
|
|
- async loadCategories() {
|
|
116
|
|
- try {
|
|
117
|
|
- // 从Java后台获取分类
|
|
|
142
|
+
|
|
|
143
|
+ // 加载分类
|
|
|
144
|
+ async loadCategories() {
|
|
|
145
|
+ try {
|
|
118
|
146
|
const res = await this.$http.get('/category/tree');
|
|
119
|
|
- // 确保数据结构正确
|
|
120
|
|
- if (res.data && Array.isArray(res.data)) {
|
|
121
|
|
- // 添加"全部"选项
|
|
122
|
|
- this.categories = [{ id: 0, name: '全部' }];
|
|
123
|
|
-
|
|
124
|
|
- // 递归处理分类树
|
|
125
|
|
- const processCategories = (cats) => {
|
|
126
|
|
- cats.forEach(cat => {
|
|
127
|
|
- this.categories.push({
|
|
128
|
|
- id: cat.id,
|
|
129
|
|
- name: cat.title,
|
|
130
|
|
- children: cat.children
|
|
131
|
|
- });
|
|
132
|
|
- if (cat.children && cat.children.length) {
|
|
133
|
|
- processCategories(cat.children);
|
|
134
|
|
- }
|
|
135
|
|
- });
|
|
136
|
|
- };
|
|
137
|
|
-
|
|
138
|
|
- processCategories(res.data);
|
|
|
147
|
+ // 确保有"全部"选项
|
|
|
148
|
+ this.categories = res?.data ? [{ id: 0, name: '全部' }, ...res.data] : [];
|
|
|
149
|
+ } catch (e) {
|
|
|
150
|
+ console.error('加载分类失败', e);
|
|
|
151
|
+ this.categories = [{ id: 0, name: '全部' }];
|
|
|
152
|
+ }
|
|
|
153
|
+ },
|
|
|
154
|
+
|
|
|
155
|
+ // 加载热门小说
|
|
|
156
|
+ async loadHotNovels() {
|
|
|
157
|
+ try {
|
|
|
158
|
+ const res = await this.$http.get('/api/novel/hot');
|
|
|
159
|
+
|
|
|
160
|
+ // 处理不同API响应格式
|
|
|
161
|
+ if (res?.data?.rows) {
|
|
|
162
|
+ this.hotNovels = res.data.rows;
|
|
|
163
|
+ } else if (Array.isArray(res?.data)) {
|
|
|
164
|
+ this.hotNovels = res.data;
|
|
|
165
|
+ } else if (Array.isArray(res)) {
|
|
|
166
|
+ this.hotNovels = res;
|
|
139
|
167
|
} else {
|
|
140
|
|
- console.warn('分类数据格式不正确');
|
|
|
168
|
+ console.warn('热门小说API返回格式未知', res);
|
|
|
169
|
+ this.hotNovels = [];
|
|
141
|
170
|
}
|
|
142
|
|
- } catch (e) {
|
|
143
|
|
- console.error('加载分类失败', e);
|
|
144
|
|
- }
|
|
145
|
|
- },
|
|
146
|
|
- // 从PHP系统加载小说目录
|
|
147
|
|
- // async loadNovels() {
|
|
148
|
|
- // const res = await this.$http.get('/php-api/novel/list');
|
|
149
|
|
- // this.novelList = res.data;
|
|
150
|
|
- // },
|
|
151
|
|
- async loadHotNovels() {
|
|
152
|
|
- try {
|
|
153
|
|
- // 获取热门小说
|
|
154
|
|
- const res = await this.$http.get('/novel/hot');
|
|
155
|
|
- this.hotNovels = res.data;
|
|
156
|
|
- } catch (e) {
|
|
157
|
|
- console.error('加载热门小说失败', e);
|
|
158
|
|
- }
|
|
159
|
|
- },
|
|
160
|
|
- async loadNovels(categoryId = 0) {
|
|
|
171
|
+ } catch (e) {
|
|
|
172
|
+ console.error('加载热门小说失败', e);
|
|
|
173
|
+ this.hotNovels = [];
|
|
|
174
|
+ }
|
|
|
175
|
+ },
|
|
|
176
|
+
|
|
|
177
|
+ // 加载小说列表
|
|
|
178
|
+ async loadNovels() {
|
|
|
179
|
+ this.loading = true;
|
|
|
180
|
+ this.error = null;
|
|
161
|
181
|
try {
|
|
162
|
|
- const url = categoryId
|
|
163
|
|
- ? `/novel/list?categoryId=${categoryId}`
|
|
164
|
|
- : '/novel/list';
|
|
165
|
|
-
|
|
166
|
|
- const res = await this.$http.get(url);
|
|
167
|
|
- // 确保数据结构正确
|
|
168
|
|
- if (res.rows && Array.isArray(res.rows)) {
|
|
169
|
|
- this.novels = res.rows;
|
|
|
182
|
+ const res = await this.$http.get('/api/novel/list');
|
|
|
183
|
+ console.log('小说列表API响应:', res);
|
|
|
184
|
+
|
|
|
185
|
+ // 处理不同API响应格式
|
|
|
186
|
+ if (res?.data?.rows) {
|
|
|
187
|
+ this.novels = res.data.rows;
|
|
|
188
|
+ } else if (Array.isArray(res?.data)) {
|
|
|
189
|
+ this.novels = res.data;
|
|
|
190
|
+ } else if (res?.data?.list) {
|
|
|
191
|
+ this.novels = res.data.list;
|
|
|
192
|
+ } else if (Array.isArray(res)) {
|
|
|
193
|
+ this.novels = res;
|
|
170
|
194
|
} else {
|
|
171
|
|
- console.warn('小说列表数据格式不正确');
|
|
|
195
|
+ console.warn('小说列表API返回格式未知', res);
|
|
172
|
196
|
this.novels = [];
|
|
|
197
|
+ this.error = '数据格式错误';
|
|
173
|
198
|
}
|
|
174
|
|
-
|
|
175
|
199
|
} catch (e) {
|
|
176
|
|
- uni.showToast({ title: '加载小说失败', icon: 'none' });
|
|
|
200
|
+ console.error('加载小说失败', e);
|
|
|
201
|
+ this.error = '加载失败,请重试';
|
|
|
202
|
+ uni.showToast({
|
|
|
203
|
+ title: '加载失败,请重试',
|
|
|
204
|
+ icon: 'none'
|
|
|
205
|
+ });
|
|
|
206
|
+ this.novels = [];
|
|
|
207
|
+ } finally {
|
|
|
208
|
+ this.loading = false;
|
|
177
|
209
|
}
|
|
178
|
210
|
},
|
|
|
211
|
+
|
|
|
212
|
+ // 封面URL处理
|
|
|
213
|
+ getCoverUrl(cover) {
|
|
|
214
|
+ if (!cover) return '/static/default-cover.jpg';
|
|
|
215
|
+ if (cover.startsWith('http')) return cover;
|
|
|
216
|
+ if (cover.startsWith('/')) return cover;
|
|
|
217
|
+ return `${process.env.VUE_APP_BASE_URL || ''}/uploads/${cover}`;
|
|
|
218
|
+ },
|
|
|
219
|
+
|
|
|
220
|
+ // 其他方法...
|
|
179
|
221
|
changeCategory(categoryId) {
|
|
180
|
222
|
this.activeCategory = categoryId;
|
|
181
|
|
- this.loadNovels(categoryId);
|
|
|
223
|
+ this.currentCategoryName = this.categories.find(c => c.id === categoryId)?.name || '全部';
|
|
|
224
|
+ this.loadNovels();
|
|
182
|
225
|
},
|
|
|
226
|
+
|
|
183
|
227
|
openNovel(novel) {
|
|
184
|
|
- uni.navigateTo({
|
|
185
|
|
- url: `/pages/novel/detail?id=${novel.id}`
|
|
186
|
|
- });
|
|
|
228
|
+ if (novel.id) {
|
|
|
229
|
+ uni.navigateTo({
|
|
|
230
|
+ url: `/pages/novel/detail?id=${novel.id}`
|
|
|
231
|
+ });
|
|
|
232
|
+ } else {
|
|
|
233
|
+ uni.showToast({
|
|
|
234
|
+ title: '小说ID不存在',
|
|
|
235
|
+ icon: 'none'
|
|
|
236
|
+ });
|
|
|
237
|
+ }
|
|
187
|
238
|
},
|
|
|
239
|
+
|
|
188
|
240
|
applyAuthor() {
|
|
189
|
|
- uni.navigateTo({
|
|
190
|
|
- url: '/pages/author/apply'
|
|
191
|
|
- });
|
|
|
241
|
+ if (!this.$store.getters.token) {
|
|
|
242
|
+ uni.showToast({ title: '请先登录', icon: 'none' });
|
|
|
243
|
+ uni.navigateTo({ url: '/pages/login' });
|
|
|
244
|
+ return;
|
|
|
245
|
+ }
|
|
|
246
|
+ uni.navigateTo({ url: '/pages/author/apply' });
|
|
192
|
247
|
},
|
|
193
|
|
- // 打开小说详情页
|
|
194
|
|
- openNovel(novel) {
|
|
|
248
|
+
|
|
|
249
|
+ goMore() {
|
|
195
|
250
|
uni.navigateTo({
|
|
196
|
|
- url: `/pages/novel/detail?id=${novel.id}&title=${encodeURIComponent(novel.title)}`
|
|
|
251
|
+ url: '/pages/novel/more'
|
|
197
|
252
|
});
|
|
198
|
253
|
}
|
|
199
|
254
|
}
|
|
200
|
255
|
}
|
|
201
|
256
|
</script>
|
|
202
|
|
-<style scoped>
|
|
203
|
|
-.become-author {
|
|
204
|
|
- position: fixed;
|
|
205
|
|
- bottom: 120rpx; /* 在TabBar上方 */
|
|
206
|
|
- left: 50%;
|
|
207
|
|
- transform: translateX(-50%);
|
|
208
|
|
- background-color: #3cc51f;
|
|
209
|
|
- color: white;
|
|
210
|
|
- padding: 16rpx 40rpx;
|
|
211
|
|
- border-radius: 50rpx;
|
|
212
|
|
- font-size: 28rpx;
|
|
213
|
|
- box-shadow: 0 4rpx 12rpx rgba(60, 197, 31, 0.3);
|
|
214
|
|
- z-index: 999;
|
|
215
|
|
-}
|
|
216
|
|
-.novel-list-page {
|
|
217
|
|
- padding: 20rpx;
|
|
218
|
|
- padding-bottom: 40rpx;
|
|
219
|
|
-}
|
|
220
|
257
|
|
|
221
|
|
-.category-nav {
|
|
222
|
|
- white-space: nowrap;
|
|
223
|
|
- margin-bottom: 30rpx;
|
|
224
|
|
-}
|
|
225
|
|
-
|
|
226
|
|
-.category-item {
|
|
227
|
|
- display: inline-block;
|
|
228
|
|
- padding: 10rpx 30rpx;
|
|
229
|
|
- margin-right: 20rpx;
|
|
230
|
|
- border-radius: 50rpx;
|
|
231
|
|
- background-color: #f5f5f5;
|
|
232
|
|
- font-size: 28rpx;
|
|
|
258
|
+<style scoped>
|
|
|
259
|
+/* 添加加载状态样式 */
|
|
|
260
|
+.loading-container {
|
|
|
261
|
+ display: flex;
|
|
|
262
|
+ flex-direction: column;
|
|
|
263
|
+ align-items: center;
|
|
|
264
|
+ justify-content: center;
|
|
|
265
|
+ padding: 100rpx 0;
|
|
233
|
266
|
}
|
|
234
|
267
|
|
|
235
|
|
-.category-item.active {
|
|
236
|
|
- background-color: #3cc51f;
|
|
237
|
|
- color: white;
|
|
|
268
|
+.loading-icon {
|
|
|
269
|
+ animation: rotate 1s linear infinite;
|
|
|
270
|
+ margin-bottom: 20rpx;
|
|
238
|
271
|
}
|
|
239
|
272
|
|
|
240
|
|
-.section {
|
|
241
|
|
- margin-bottom: 40rpx;
|
|
|
273
|
+@keyframes rotate {
|
|
|
274
|
+ from { transform: rotate(0deg); }
|
|
|
275
|
+ to { transform: rotate(360deg); }
|
|
242
|
276
|
}
|
|
243
|
277
|
|
|
244
|
|
-.section-header {
|
|
|
278
|
+/* 添加空状态样式 */
|
|
|
279
|
+.empty-container, .error-container {
|
|
245
|
280
|
display: flex;
|
|
246
|
|
- justify-content: space-between;
|
|
|
281
|
+ flex-direction: column;
|
|
247
|
282
|
align-items: center;
|
|
248
|
|
- margin-bottom: 20rpx;
|
|
249
|
|
-}
|
|
250
|
|
-
|
|
251
|
|
-.section-title {
|
|
252
|
|
- font-size: 32rpx;
|
|
253
|
|
- font-weight: bold;
|
|
254
|
|
-}
|
|
255
|
|
-
|
|
256
|
|
-.section-more {
|
|
257
|
|
- font-size: 24rpx;
|
|
258
|
|
- color: #888;
|
|
|
283
|
+ justify-content: center;
|
|
|
284
|
+ padding: 100rpx 0;
|
|
|
285
|
+ text-align: center;
|
|
259
|
286
|
}
|
|
260
|
287
|
|
|
261
|
|
-.hot-list {
|
|
262
|
|
- white-space: nowrap;
|
|
|
288
|
+.empty-img {
|
|
|
289
|
+ width: 200rpx;
|
|
|
290
|
+ height: 200rpx;
|
|
|
291
|
+ opacity: 0.6;
|
|
|
292
|
+ margin-bottom: 40rpx;
|
|
263
|
293
|
}
|
|
264
|
294
|
|
|
265
|
|
-.hot-item {
|
|
266
|
|
- display: inline-block;
|
|
267
|
|
- width: 200rpx;
|
|
268
|
|
- margin-right: 20rpx;
|
|
|
295
|
+.empty-text, .error-text {
|
|
|
296
|
+ font-size: 32rpx;
|
|
|
297
|
+ color: var(--text-color);
|
|
|
298
|
+ margin-bottom: 40rpx;
|
|
269
|
299
|
}
|
|
270
|
300
|
|
|
271
|
|
-.hot-cover {
|
|
272
|
|
- width: 200rpx;
|
|
273
|
|
- height: 280rpx;
|
|
274
|
|
- border-radius: 8rpx;
|
|
|
301
|
+.error-text {
|
|
|
302
|
+ color: var(--error-color);
|
|
275
|
303
|
}
|
|
276
|
304
|
|
|
277
|
|
-.hot-title {
|
|
278
|
|
- display: block;
|
|
279
|
|
- font-size: 26rpx;
|
|
280
|
|
- margin-top: 10rpx;
|
|
281
|
|
- white-space: nowrap;
|
|
282
|
|
- overflow: hidden;
|
|
283
|
|
- text-overflow: ellipsis;
|
|
|
305
|
+.btn-refresh {
|
|
|
306
|
+ background-color: var(--primary-color);
|
|
|
307
|
+ color: white;
|
|
|
308
|
+ width: 60%;
|
|
|
309
|
+ border-radius: 50rpx;
|
|
284
|
310
|
}
|
|
285
|
311
|
|
|
|
312
|
+/* 确保网格布局正确 */
|
|
286
|
313
|
.novel-grid {
|
|
287
|
314
|
display: grid;
|
|
288
|
315
|
grid-template-columns: repeat(3, 1fr);
|
|
289
|
316
|
gap: 20rpx;
|
|
|
317
|
+ padding: 20rpx;
|
|
290
|
318
|
}
|
|
291
|
319
|
|
|
292
|
320
|
.novel-item {
|
|
293
|
|
- text-align: center;
|
|
|
321
|
+ background-color: var(--card-bg);
|
|
|
322
|
+ border-radius: 12rpx;
|
|
|
323
|
+ overflow: hidden;
|
|
|
324
|
+ box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
|
|
294
|
325
|
}
|
|
295
|
326
|
|
|
296
|
327
|
.novel-cover {
|
|
297
|
328
|
width: 100%;
|
|
298
|
329
|
height: 300rpx;
|
|
299
|
|
- border-radius: 8rpx;
|
|
|
330
|
+ background-color: #f5f5f5; /* 添加默认背景 */
|
|
300
|
331
|
}
|
|
301
|
332
|
|
|
302
|
333
|
.novel-title {
|
|
303
|
334
|
display: block;
|
|
304
|
|
- font-size: 26rpx;
|
|
305
|
|
- margin-top: 10rpx;
|
|
|
335
|
+ font-size: 28rpx;
|
|
|
336
|
+ padding: 10rpx 15rpx;
|
|
|
337
|
+ white-space: nowrap;
|
|
306
|
338
|
overflow: hidden;
|
|
307
|
339
|
text-overflow: ellipsis;
|
|
308
|
|
- display: -webkit-box;
|
|
309
|
|
- -webkit-line-clamp: 1;
|
|
310
|
|
- -webkit-box-orient: vertical;
|
|
311
|
340
|
}
|
|
312
|
341
|
|
|
313
|
342
|
.novel-author {
|
|
314
|
343
|
display: block;
|
|
315
|
|
- font-size: 22rpx;
|
|
|
344
|
+ font-size: 24rpx;
|
|
316
|
345
|
color: #888;
|
|
|
346
|
+ padding: 0 15rpx 15rpx;
|
|
317
|
347
|
}
|
|
318
|
|
-
|
|
319
|
|
-.become-author {
|
|
320
|
|
- position: fixed;
|
|
321
|
|
- bottom: 120rpx; /* 在TabBar上方 */
|
|
322
|
|
- left: 50%;
|
|
323
|
|
- transform: translateX(-50%);
|
|
324
|
|
- background-color: #3cc51f;
|
|
325
|
|
- color: white;
|
|
326
|
|
- padding: 16rpx 40rpx;
|
|
327
|
|
- border-radius: 50rpx;
|
|
328
|
|
- font-size: 28rpx;
|
|
329
|
|
- box-shadow: 0 4rpx 12rpx rgba(60, 197, 31, 0.3);
|
|
330
|
|
- z-index: 999;
|
|
331
|
|
-}
|
|
332
|
|
-</style>
|
|
|
348
|
+</style>
|