deming/components/mine/comment/index.vue

76 lines
1.4 KiB
Vue
Raw Normal View History

2020-06-08 07:23:23 +00:00
<template>
<view class="comment">
<view class="user-info">
2020-07-29 11:01:10 +00:00
<image :src="info.member_avatar" class="user-avatar"></image>
<view class="user-name">{{ info.member_nickname }}</view>
2020-06-08 07:23:23 +00:00
</view>
<view class="user-comment">
2020-07-29 11:01:10 +00:00
<view class="text u-line-2">{{ info.comment }}</view>
2020-09-05 06:40:15 +00:00
<view class="image" v-if="info.comment_img">
<image :src="info.comment_img" mode="aspectFit" @click="previewImage(info.comment_img)"></image>
2020-06-08 07:23:23 +00:00
</view>
</view>
</view>
</template>
<script>
export default {
data() {
2020-07-29 11:01:10 +00:00
return {}
},
props: {
info: Object,
2020-09-05 06:26:17 +00:00
},
methods: {
previewImage(urls) {
2020-09-05 06:38:18 +00:00
const imagesUrl = [urls];
2020-09-05 06:26:17 +00:00
uni.previewImage({
2020-09-05 06:38:18 +00:00
urls: imagesUrl,
2020-09-05 06:26:17 +00:00
});
},
2020-06-08 07:23:23 +00:00
}
};
</script>
<style lang="scss" scoped>
.comment {
padding: 30rpx;
width: 750rpx;
background: rgba(255,255,255,1);
.user-info {
display: flex;
align-items: center;
margin-bottom: 19rpx;
.user-avatar {
width: 60rpx;
height: 60rpx;
border-radius: 50%;
margin-right: 20rpx;
}
.user-name {
font-size: 26rpx;
color: rgba(153,153,153,1);
}
}
.user-comment {
.text {
font-size: 26rpx;
color: rgba(51,51,51,1);
line-height: 40rpx;
}
.image {
display: flex;
flex-wrap: wrap;
> image {
2020-09-05 06:26:17 +00:00
margin-top: 20rpx;
2020-06-08 07:23:23 +00:00
width: 210rpx;
height: 210rpx;
border-radius: 10rpx;
margin-bottom: 20rpx;
flex-shrink: 0;
&:not(:nth-child(3n)) {
margin-right: 30rpx;
}
}
}
}
}
</style>