This commit is contained in:
Gdpao
2020-08-05 21:06:29 +08:00
parent a47238a7a4
commit c4c11781fb
15 changed files with 305 additions and 159 deletions

View File

@@ -37,12 +37,13 @@
</template>
<style lang="scss" scoped>
.video-item{
margin-top: 20rpx;
flex-shrink: 0;
width: 335rpx;
box-shadow:0 3rpx 7rpx 0 rgba(153, 153, 153, 0.35);
padding-bottom: 20rpx;
border-radius: 20rpx;
margin-top: 20rpx;
overflow: hidden;
border-radius: 20rpx;
box-shadow:0 3rpx 7rpx 0 rgba(153, 153, 153, 0.35);
.head{
width: 100%;
height: 334rpx;
@@ -195,29 +196,40 @@ export default {
// console.log(this.item);
this.show = -1;
},
watch: {
item(newVal, old) {
// console.log(newVal);
this.item = newVal;
},
deep: true
},
methods: {
showAction() {
this.show = this.show > 0 ? -1 : this.item.article_id;
},
// 点赞
articleLike() {
this.item.is_like = !this.item.is_like;
this.$u.api.articleLike({
article_id: this.item.article_id,
}).then(res => {
console.log(res)
if(res.errCode == 0) {
this.$u.toast(res.message);
this.$emit("getArticlelist");
// this.$emit("getArticlelist");
}
})
},
// 收藏
articleCollect() {
this.item.is_collect = !this.item.is_collect;
this.$u.api.articleCollect({
article_id: this.item.article_id,
}).then(res => {
console.log(res);
if(res.errCode == 0) {
this.$u.toast(res.message);
this.$emit("getArticlelist");
// this.$emit("getArticlelist");
}
})
},