You've already forked guangan-mp
1.0.0
This commit is contained in:
58
components/i-thumb-list/i-thumb-list.vue
Normal file
58
components/i-thumb-list/i-thumb-list.vue
Normal file
@ -0,0 +1,58 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="p-3 flex flex-row rounded-lg bg-white mt-2" v-for="(item,index) in resdata" :key="index" @click="toShow(item)" style="gap: 20rpx">
|
||||
<view class="flex-0" v-if="item.imgs.length > 0" style="flex-basis: 180rpx;">
|
||||
<image :src="item.imgs[0]" style="width:180rpx;height: 180rpx; border-radius: 16rpx;" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="flex-5 flex flex-column justify-between" style="height: 180rpx;">
|
||||
<view>
|
||||
<text class="font32 line15 text-ellipsis-2">{{item.content}}</text>
|
||||
</view>
|
||||
<view class="flex align-center justify-between">
|
||||
<view class="flex align-center">
|
||||
<image src="../../static/images/icon-time.png" style="height: 20rpx; width: 20rpx;"></image>
|
||||
<text class="font24 text-muted">{{item.create_at}}</text>
|
||||
</view>
|
||||
<view class="flex align-center">
|
||||
<image v-if="item.my_like > 0" src="../../static/images/icon-like.png" style="height: 20rpx; width: 20rpx;"></image>
|
||||
<image v-else src="../../static/images/icon-nolike.png" style="height: 20rpx; width: 20rpx;"></image>
|
||||
<text class="font24 text-muted">{{item.like_count}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name:"i-thumb-list",
|
||||
props:{
|
||||
resdata:{
|
||||
type:Array,
|
||||
default() {
|
||||
return [];
|
||||
},
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
},
|
||||
created() {
|
||||
console.log(this.resdata)
|
||||
},
|
||||
methods:{
|
||||
toShow(item){
|
||||
uni.navigateTo({
|
||||
url:'/pages/thumb/detail?id='+item.id,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
Reference in New Issue
Block a user