Compare commits

..

No commits in common. 'cec3c6a31b3d677667c2caf4b20a0b2c47c9ff13' and 'a2e0a686d7a1171e17e8f60779c9c6ba50bb7bdd' have entirely different histories.

@ -27,30 +27,30 @@
<view class="post_box" v-for="(item, index) in posts" :key="index">
<view class="post_top_box">
<view class="post_avatar_box">
<image class="post_avatar" :src=item.avatar mode="widthFix"></image>
<image class="post_avatar" src="../../../../static/homepages/community/community/pictures/dog_image.png" mode="widthFix"></image>
</view>
<view class="post_info">
<view class="post_name">{{item.name}}</view>
<view class="post_date">{{item.date}}</view>
<view class="post_name">puppy</view>
<view class="post_date">2024年11月13日</view>
</view>
</view>
<view class="post_word_box">{{item.word}}</view>
<view class="post_word_box">今天去海边锻炼看见的真是太美了啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊</view>
<view class="post_images_box">
<community_image_box class="post_images" :imgList='item.imgList' :num='item.imgList.length'></community_image_box>
<community_image_box class="post_images" :imgList='imgList' :num='imgList.length'></community_image_box>
</view>
<view class="post_bottom_box">
<view class="comments_box">
<image class="chat_icon" src="../../../../static/homepages/community/community/pictures/chat_icon.png" mode="widthFix"></image>
<view class="comments_num">{{item.comments_num}}</view>
<view class="comments_num">10</view>
</view>
<view class="like_box">
<image
class="love_icon"
:src=getLikeImage(index)
src="../../../../static/homepages/community/community/pictures/love_image.png"
mode="widthFix"
@click="likeClick(index)"
@click="likeClick"
></image>
<view class="like_num">{{item.like_num}}</view>
<view class="like_num">122</view>
</view>
</view>
</view>
@ -70,79 +70,30 @@ export default {
return {
posts:[
{
avatar:'../../../../static/homepages/community/community/pictures/dog_image.png',
name:'cat',
date:'2024年9月31日',
word:'今天去海边锻炼看见的,真是太美了啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊',
imgList:[
'../../../../static/homepages/community/community/pictures/dog_image.png',
'../../../../static/homepages/community/community/pictures/dog_image.png',
'../../../../static/homepages/community/community/pictures/dog_image.png',
'../../../../static/homepages/community/community/pictures/dog_image.png',
],
comments_num:1,
like_num:100,
islike:false,
content:''
},
{
avatar:'../../../../static/homepages/community/community/pictures/dog_image.png',
name:'puppy',
date:'2024年11月13日',
word:'今天去海边锻炼看见的,真是太美了',
imgList:[
'../../../../static/homepages/community/community/pictures/dog_image.png',
'../../../../static/homepages/community/community/pictures/dog_image.png',
'../../../../static/homepages/community/community/pictures/dog_image.png',
],
comments_num:12,
like_num:17,
islike:false,
content:''
},
{
avatar:'../../../../static/homepages/community/community/pictures/dog_image.png',
name:'cat',
date:'2024年10月13日',
word:'今天去海边锻炼看见的',
imgList:[
'../../../../static/homepages/community/community/pictures/dog_image.png',
'../../../../static/homepages/community/community/pictures/dog_image.png',
],
comments_num:10,
like_num:100,
islike:false,
content:''
},
{
avatar:'../../../../static/homepages/community/community/pictures/dog_image.png',
name:'cat',
date:'2024年1月13日',
word:'今天去锻炼',
imgList:[
'../../../../static/homepages/community/community/pictures/dog_image.png',
],
comments_num:10,
like_num:100,
islike:false,
content:''
},
],
imgList: [
'../../../../static/homepages/community/community/pictures/dog_image.png',
'../../../../static/homepages/community/community/pictures/dog_image.png',
'../../../../static/homepages/community/community/pictures/dog_image.png',
'../../../../static/homepages/community/community/pictures/dog_image.png',
]
};
},
mounted(){
this.getAllPost()
},
computed:{
likeImages() {
return this.posts.map((post, index) => ({
index,
image: post.islike ? '../../../../static/homepages/community/community/pictures/red_love_image.png' : '../../../../static/homepages/community/community/pictures/love_image.png'
}));
}
},
methods:{
getLikeImage(index) {
//TODO:
const item = this.likeImages.find(item => item.index === index);
return item ? item.image : '';
},
getAllPost(){
//TODO:
const app = getApp()
@ -159,9 +110,8 @@ export default {
},
})
},
likeClick(index){
likeClick(){
//TODO:
this.posts[index].islike = this.posts[index].islike ? false:true
},
toAddPostPage(){
//TODO:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Loading…
Cancel
Save