|
|
@ -14,11 +14,11 @@ |
|
|
|
<view class="title text-overflowRows">{{detail.title}}</view> |
|
|
|
<view class="flex-between"> |
|
|
|
<view class="name"> |
|
|
|
<image src="https://static.ticket.sz-trip.com/tongli/images/index/user.png" mode=""></image> |
|
|
|
<image :src="showImg(detail.author_img)" mode=""></image> |
|
|
|
{{detail.author}} |
|
|
|
</view> |
|
|
|
<view class="other-info"> |
|
|
|
<image @click="likeAricle(detail)" v-if="detail.is_like" :src="showImg('/uploads/20250513/00b5680ca4b62479a59b40786979e3e2.png')" mode=""></image> |
|
|
|
<image @click="likeAricle(detail)" v-if="detail.is_star" :src="showImg('/uploads/20250513/00b5680ca4b62479a59b40786979e3e2.png')" mode=""></image> |
|
|
|
<image @click="likeAricle(detail)" v-else :src="showImg('/uploads/20250513/99e8d59b9692ae73b3204a6cec79611b.png')" mode=""></image> |
|
|
|
<text style="padding-right: 36rpx;">{{handleNum(detail.star)}}</text> |
|
|
|
<image :src="showImg('/uploads/20250513/71acef9a784095e9ba17c88580506705.png')" mode=""></image> |
|
|
@ -50,7 +50,16 @@ |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
likeAricle (item) { |
|
|
|
|
|
|
|
this.Post({article_id: item.id},'/api/article/setArticleStar').then(res => { |
|
|
|
if (res.code == 200 || res.code == 1) { |
|
|
|
this.detail.is_star = !this.detail.is_star |
|
|
|
if (this.detail.is_star) { |
|
|
|
this.detail.star++ |
|
|
|
} else { |
|
|
|
this.detail.star-- |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
handleNum (num) { |
|
|
|
if (num<=0) { return 0 } |
|
|
|