diff --git a/pages/template/long-list/long-list-page.uvue b/pages/template/long-list/long-list-page.uvue
index 63e2334a196b4f53b0c3c02003f8cea3268fcca5..c6ef10aeb7b8ea85c3bb3643c5a87a7a2d2b1397 100644
--- a/pages/template/long-list/long-list-page.uvue
+++ b/pages/template/long-list/long-list-page.uvue
@@ -1,35 +1,32 @@
-
-
-
-
-
+
+
+
+
+
+
+ {{item.plugin_name}}
-
-
- {{item.plugin_name}}
-
-
- {{item.plugin_intro}}
-
- {{convertToStarUnicode(item.score)}}
-
- {{item2}}
-
-
- 更新日期
- {{item.update_date}}
- {{item.author_name}}
-
+
+ {{item.plugin_intro}}
-
-
-
-
+ {{convertToStarUnicode(item.score)}}
+
+ {{item2}}
+
+
+ 更新日期
+ {{item.update_date}}
+ {{item.author_name}}
+
+
+
+
+ {{loadingText}}
+
+
@@ -87,21 +84,32 @@
},
},
created() {
- // TODO 后续通过css加载本地路径
- uni.loadFontFace({
- global: false,
- family: 'UtsIconsFontFamily',
- source: '/static/fonts/icon-star.ttf'
- })
+ this.insertLoadingData()
if (this.preload) {
this.loadData(null)
}
},
methods: {
+ // TODO 目前 list-item 不支持注释节点
+ // 暂时在数据末尾插入一条空数据用于显示 loading
+ insertLoadingData() {
+ const loadingData = {
+ plugin_id: -1,
+ plugin_img_link: '',
+ plugin_name: '',
+ plugin_intro: '',
+ score: 0,
+ tags: [],
+ update_date: '',
+ author_name: '',
+ } as ListItem
+ this.dataList.push(loadingData)
+ },
refreshData(loadComplete : (() => void) | null) {
this.dataList.length = 0
this.$currentPage = 1
+ this.insertLoadingData()
this.loadData(loadComplete)
},
loadData(loadComplete : (() => void) | null) {
@@ -123,7 +131,9 @@
return
}
- this.dataList.push(...responseData.data)
+ // TODO
+ this.dataList.splice(this.dataList.length - 1, 0, ...responseData.data)
+ // this.dataList.push(...responseData.data)
if (responseData.data.length == 0) {
this.isEnded = true
@@ -164,12 +174,11 @@
+
\ No newline at end of file
diff --git a/pages/template/long-list/long-list.uvue b/pages/template/long-list/long-list.uvue
index 1af15922ddf0faa52d44d366928ca4753ecc8112..7dd17a8bfad190d7d98f311568c4d802f8f265f1 100644
--- a/pages/template/long-list/long-list.uvue
+++ b/pages/template/long-list/long-list.uvue
@@ -111,7 +111,7 @@
const deltaY = event.deltaY
const scrollTop = this.$pageScrollView!.scrollTop
- /// 优先处理父容器滚动,父容器不能滚动时在滚动子
+ /// 优先处理父容器滚动,父容器不能滚动时滚动子
// 向上滚动
if (deltaY > 0) {
// 如果父容器 header scrollTop < offsetHeight,先滚动父容器
@@ -220,6 +220,12 @@