Commit 6f5ee41c authored by ziyu's avatar ziyu

improvement: 信息流优化

parent e1c74aad
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
</template> </template>
<script> <script>
import wepy from '@wepy/core'; import wepy from '@wepy/core';
wepy.component({ wepy.component({
props: { props: {
activityList: { activityList: {
...@@ -39,12 +38,15 @@ ...@@ -39,12 +38,15 @@
activityList(val) { activityList(val) {
let list = val || []; let list = val || [];
this.list = list; this.list = list;
if(list.length < 3) {
this.onActivityChange();
}
} }
}, },
methods: { methods: {
onActivityChange(e) { onActivityChange(e) {
const lastIndex = this.list.length - this.activityDisplayItems; const lastIndex = this.list.length - this.activityDisplayItems;
if (e.$wx.detail.current === lastIndex) { if (!e || e.$wx.detail.current === lastIndex) {
this.isAuto = false; this.isAuto = false;
// 当最后一个出来的时候等一秒再消失 // 当最后一个出来的时候等一秒再消失
setTimeout(() => { setTimeout(() => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment