deming/components/comment/index.vue

115 lines
2.4 KiB
Vue
Raw Normal View History

2020-07-24 19:48:57 +08:00
<template>
<view class="comment-item">
<view class="user">
<u-avatar :src="content.member_avatar" class="avatar" size="60"></u-avatar>
<text class="name">{{ content.geval_frommembername }}</text>
2020-08-01 16:36:48 +08:00
<u-rate v-if="reply" :disabled='true' :count="count" v-model="rate" size="23" active-color="#FF780F" inactive-color="#F0EDF1" gutter="10"></u-rate>
2020-07-24 19:48:57 +08:00
</view>
<view class="content">
<view class="text">{{ content.geval_content }}</view>
</view>
2020-07-25 15:17:52 +08:00
<view class="image-container">
<image :src="src" v-for="(src, index) in content.geval_image" :key="index"></image>
</view>
2020-07-24 19:48:57 +08:00
<view class="reply" v-if="reply && content.geval_explain">
<view class="title">掌柜回复</view>
<view class="content u-line-4">{{ content.geval_explain }}</view>
</view>
<view class="time" v-if="reply">
<image src="/static/image/common/20.png"></image>
<view class="value">{{ content.geval_addtime }}</view>
</view>
</view>
</template>
<script>
/*
* @description 显示评价
* @property {Boolean} reply 是否显示回复/时间/评分
**/
export default {
data() {
return {
count: 5,
2020-08-01 16:36:48 +08:00
rate: 0,
2020-07-24 19:48:57 +08:00
}
},
props: {
content: Object,
reply: Boolean,
},
created() {
if(this.content.hasOwnProperty('scores_two')) this.rate = this.content.scores_two;
}
};
</script>
<style lang="scss" scoped>
.comment-item {
background-color: #ffffff;
.user {
display: flex;
align-items: center;
margin-bottom: 20rpx;
.name {
margin: 0 20rpx;
font-size: 26rpx;
color: rgba(153,153,153,1);
}
}
.content {
margin-bottom: 20rpx;
.text {
font-size: 26rpx;
color: rgba(51,51,51,1);
line-height: 40rpx;
margin-bottom: 20rpx;
}
> image {
width: 210rpx;
height: 210rpx;
border-radius: 10px;
&:not(:nth-child(3n)) {
margin-right: 30rpx;
}
}
}
2020-07-25 15:17:52 +08:00
.image-container {
margin: 20rpx 0;
> image {
width: 210rpx;
height: 210rpx;
border-radius: 10rpx;
margin-bottom: 20rpx;
&:not(:nth-child(3n)) {
margin-right: 30rpx;
}
}
}
2020-07-24 19:48:57 +08:00
.reply {
padding: 30rpx;
background: rgba(240,238,238,1);
border-radius: 10rpx;
font-size: 24rpx;
color: rgba(102,102,102,1);
margin-bottom: 20rpx;
.title {
margin-bottom: 16rpx;
}
.content {
line-height: 36rpx;
}
}
.time {
display: flex;
align-items: center;
> image {
width: 28rpx;
height: 28rpx;
margin-right: 12rpx;
}
.value {
font-size: 24rpx;
color: rgba(153,153,153,1);
}
}
}
</style>