Authored by htoooth

add article content

... ... @@ -72,6 +72,7 @@ export default {
return {
scrollOpts: {
eventPassthrough: 'horizontal',
bounce: false
}
};
},
... ...
... ... @@ -33,33 +33,24 @@ export default {
ArticleFooter,
CommentActionSheet
},
props: {
articleId: {
type: [Number, String],
default() {
return 69156;
}
},
grassId: {
type: [Number, String],
default() {
return 82;
}
}
},
data() {
return {
articleId: 0,
grassId: 0
};
},
mounted() {
},
methods: {
onCommentClick() {
this.$refs.actionSheet.destId = this.grassId;
this.$refs.actionSheet.click();
},
...mapActions(['getDetail']),
fetch(params) {
this.articleId = params.articleId;
this.grassId = params.grassId;
return this.getDetail({
article_id: params.articleId,
grass_id: params.grassId
... ...
<template>
<YohoActionSheet ref="actionSheet" :full="true">
<div class="content">
<!--<template v-if="list.length === 0">-->
<!--<Loading class="loading" :size="50"></Loading>-->
<!--</template>-->
<CommentScrollView ref="commentList" @on-back="onBackClick"></CommentScrollView>
<CommentScrollView ref="commentList" :destId="destId" @on-back="onBackClick"></CommentScrollView>
</div>
</YohoActionSheet>
</template>
... ... @@ -23,12 +19,12 @@ export default {
},
data() {
return {
destId: 0
};
},
methods: {
click() {
this.$refs.actionSheet.show();
this.$refs.commentList.click();
},
onBackClick() {
this.$refs.actionSheet.hide();
... ...
... ... @@ -4,14 +4,9 @@
<div class="back" @click="handleBack">
<i class="iconfont icon-left"></i>
</div>
{{ count }}评论
</div>
<Scroll class="scroll-wrapper" ref="scroll" :options="scrollOptions">
<div v-for="i in list" class="item">huangtao {{i}}</div>
</Scroll>
<div class="footer">
<div class="input">评论</div>
{{ count > 0 ? count + '条' : '' }}评论
</div>
<CommentList class="scroll-wrapper" :dest-id="destId" :column-type="1001" @on-page-change="onPageChange" v-if="destId"></CommentList>
</div>
</template>
... ... @@ -21,6 +16,14 @@ import {Scroll} from 'cube-ui';
export default {
name: 'CommentScrollView',
props: {
destId: {
type: [Number, String],
default() {
return 0;
}
}
},
components: {
Scroll
},
... ... @@ -29,32 +32,16 @@ export default {
list: [],
scrollOptions: {
bounce: false
}
},
count: 0
};
},
computed: {
count() {
return this.list.length > 0 ? this.list.length + '条' : '';
}
},
methods: {
click() {
this.$nextTick(() => {
this.initData();
this.forceUpdate();
}, 1000);
},
forceUpdate() {
this.$refs.scroll.forceUpdate();
},
initData() {
console.log('click')
for (let i = 0; i < 100; i++) {
this.list.push(i);
}
},
handleBack() {
this.$emit('on-back');
},
onPageChange({size}) {
this.count = size;
}
}
};
... ...