提交 233edb64 编写于 作者: H hdx

long-list-page: 调整停止下拉刷新逻辑

上级 518198bf
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<view class="description"> <view class="description">
<text class="description-text">{{item.plugin_intro}}</text> <text class="description-text">{{item.plugin_intro}}</text>
</view> </view>
<text class="icon-star star">{{convertToStarUnicode(item.score)}}</text> <text class="font-star icon-star">{{convertToStarUnicode(item.score)}}</text>
<view class="tag-list"> <view class="tag-list">
<text class="tag-item" v-for="(item2, index2) in item.tags" :key="index2">{{item2}}</text> <text class="tag-item" v-for="(item2, index2) in item.tags" :key="index2">{{item2}}</text>
</view> </view>
...@@ -87,6 +87,7 @@ ...@@ -87,6 +87,7 @@
}, },
}, },
created() { created() {
// TODO 后续通过css加载本地路径
uni.loadFontFace({ uni.loadFontFace({
global: false, global: false,
family: 'UtsIconsFontFamily', family: 'UtsIconsFontFamily',
...@@ -94,16 +95,19 @@ ...@@ -94,16 +95,19 @@
}) })
if (this.preload) { if (this.preload) {
this.loadData() this.loadData(null)
} }
}, },
methods: { methods: {
refreshData() { refreshData() {
this.dataList.length = 0 this.dataList.length = 0
this.$currentPage = 1 this.$currentPage = 1
this.loadData() this.loadData(() => {
// TODO
uni.stopPullDownRefresh()
})
}, },
loadData() { loadData(oncomplete : (() => void) | null) {
if (this.loading || this.isEnded) { if (this.loading || this.isEnded) {
return return
} }
...@@ -135,8 +139,9 @@ ...@@ -135,8 +139,9 @@
}, },
complete: () => { complete: () => {
this.loading = false this.loading = false
// TODO if (oncomplete != null) {
uni.stopPullDownRefresh() oncomplete()
}
} }
}) })
}, },
...@@ -162,6 +167,13 @@ ...@@ -162,6 +167,13 @@
</script> </script>
<style> <style>
.font-star {
font-family: "UtsIconsFontFamily" !important;
/* src: url('~@/static/fonts/icon-star.ttf') format('truetype'); */
font-size: 16px;
font-style: normal;
}
.list { .list {
flex: 1; flex: 1;
background-color: #ffffff; background-color: #ffffff;
...@@ -198,9 +210,6 @@ ...@@ -198,9 +210,6 @@
} }
.icon-star { .icon-star {
font-family: "UtsIconsFontFamily" !important;
font-size: 16px;
font-style: normal;
color: #ffca3e; color: #ffca3e;
letter-spacing: 3px; letter-spacing: 3px;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册