|
|
@ -1,184 +1,85 @@ |
|
|
|
<template> |
|
|
|
<view class="commemt"> |
|
|
|
<view class="comment-list"> |
|
|
|
<commentItem |
|
|
|
v-for="(item,index) in list" |
|
|
|
:key="index" |
|
|
|
:parentId="item.id" |
|
|
|
:sourceType="params.type" |
|
|
|
:sourceId="params.orderId" |
|
|
|
:item="item" /> |
|
|
|
</view> |
|
|
|
<view class="commemt"> |
|
|
|
<view class="comment-list"> |
|
|
|
<commentItem v-for="(item, index) in list" :key="index" :parentId="item.id" :sourceType="params.type" |
|
|
|
:sourceId="params.orderId" :item="item" /> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="submit-box"> |
|
|
|
<view class="top"> |
|
|
|
<button |
|
|
|
class="share" |
|
|
|
open-type="share"> |
|
|
|
<uv-icon |
|
|
|
color="#00cf05" |
|
|
|
size="50rpx" |
|
|
|
name="weixin-fill"></uv-icon> |
|
|
|
</button> |
|
|
|
|
|
|
|
<input type="text" |
|
|
|
disabled |
|
|
|
@click="$refs.popup.open('bottom')" |
|
|
|
:placeholder="'评论给' + params.name" |
|
|
|
v-model="form.userValue"/> |
|
|
|
|
|
|
|
<!-- <view class="submit" |
|
|
|
@click="submit"> |
|
|
|
发布 |
|
|
|
</view> --> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<uv-popup ref="popup" :round="30"> |
|
|
|
<view class="popup"> |
|
|
|
<view class="content-input"> |
|
|
|
<uv-textarea |
|
|
|
v-model="form.userValue" |
|
|
|
:maxlength="200" |
|
|
|
autoHeight |
|
|
|
count |
|
|
|
focus |
|
|
|
:placeholder="'评论给' + params.name"></uv-textarea> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<view class="images box"> |
|
|
|
<uv-upload |
|
|
|
:fileList="fileList" |
|
|
|
:maxCount="imageMax" |
|
|
|
multiple |
|
|
|
width="150rpx" |
|
|
|
height="150rpx" |
|
|
|
@delete="deleteImage" |
|
|
|
@afterRead="afterRead" |
|
|
|
:previewFullImage="true"></uv-upload> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="uni-color-btn" |
|
|
|
@click="submit"> |
|
|
|
发布 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</uv-popup> |
|
|
|
</view> |
|
|
|
<view class="submit-box"> |
|
|
|
<view class="top"> |
|
|
|
<button class="share" open-type="share"> |
|
|
|
<uv-icon color="#00cf05" size="50rpx" name="weixin-fill"></uv-icon> |
|
|
|
</button> |
|
|
|
|
|
|
|
<input type="text" disabled @click="openCommentPublish" :placeholder="'评论给' + params.name" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 评论发布组件 --> |
|
|
|
<commentPublish ref="commentPublish" :params="params" :placeholder="'评论给' + params.name" @success="handleCommentSuccess" /> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import commentItem from './commentItem.vue' |
|
|
|
export default { |
|
|
|
components: { |
|
|
|
commentItem, |
|
|
|
}, |
|
|
|
props: ['list', 'params'], |
|
|
|
data() { |
|
|
|
return { |
|
|
|
form : {}, |
|
|
|
imageMax : 9, |
|
|
|
fileList : [], |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
submit(){ |
|
|
|
|
|
|
|
let data = { |
|
|
|
...this.form, |
|
|
|
...this.params, |
|
|
|
} |
|
|
|
|
|
|
|
if (this.$utils.verificationAll(data, { |
|
|
|
userValue: '说点什么吧', |
|
|
|
type: '缺少type', |
|
|
|
orderId: '缺少orderId', |
|
|
|
})) { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
data.userImage = this.fileList.map((item) => item.url).join(",") |
|
|
|
|
|
|
|
|
|
|
|
this.$api('addComment', data, res => { |
|
|
|
if(res.code == 200){ |
|
|
|
this.$refs.popup.close() |
|
|
|
this.form.userValue = '' |
|
|
|
uni.showToast({ |
|
|
|
title: '发布成功!', |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
this.$emit('getData') |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
deleteImage(e){ |
|
|
|
this.fileList.splice(e.index, 1) |
|
|
|
}, |
|
|
|
afterRead(e){ |
|
|
|
let self = this |
|
|
|
e.file.forEach(file => { |
|
|
|
self.$Oss.ossUpload(file.url).then(url => { |
|
|
|
self.fileList.push({ |
|
|
|
url |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
import commentItem from './commentItem.vue' |
|
|
|
import commentPublish from './commentPublish.vue' |
|
|
|
|
|
|
|
export default { |
|
|
|
components: { |
|
|
|
commentItem, |
|
|
|
commentPublish, |
|
|
|
}, |
|
|
|
props: ['list', 'params'], |
|
|
|
data() { |
|
|
|
return {} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 打开评论发布弹窗 |
|
|
|
openCommentPublish() { |
|
|
|
this.$refs.commentPublish.open() |
|
|
|
}, |
|
|
|
|
|
|
|
// 评论发布成功回调 |
|
|
|
handleCommentSuccess() { |
|
|
|
this.$emit('getData') |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
.commemt{ |
|
|
|
padding-bottom: env(safe-area-inset-bottom); |
|
|
|
} |
|
|
|
.comment-list { |
|
|
|
margin-top: 20rpx; |
|
|
|
padding-bottom: 150rpx; |
|
|
|
} |
|
|
|
.commemt { |
|
|
|
padding-bottom: env(safe-area-inset-bottom); |
|
|
|
} |
|
|
|
|
|
|
|
.submit-box { |
|
|
|
position: fixed; |
|
|
|
bottom: 0; |
|
|
|
left: 0; |
|
|
|
background-color: #fff; |
|
|
|
width: 100%; |
|
|
|
box-shadow: 0 0 6rpx 6rpx #00000011; |
|
|
|
padding-bottom: env(safe-area-inset-bottom); |
|
|
|
.comment-list { |
|
|
|
margin-top: 20rpx; |
|
|
|
padding-bottom: 150rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.top { |
|
|
|
align-items: center; |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
|
.submit-box { |
|
|
|
position: fixed; |
|
|
|
bottom: 0; |
|
|
|
left: 0; |
|
|
|
background-color: #fff; |
|
|
|
width: 100%; |
|
|
|
box-shadow: 0 0 6rpx 6rpx #00000011; |
|
|
|
padding-bottom: env(safe-area-inset-bottom); |
|
|
|
|
|
|
|
input { |
|
|
|
background-color: #f3f3f3; |
|
|
|
width: 460rpx; |
|
|
|
height: 40rpx; |
|
|
|
border-radius: 40rpx; |
|
|
|
margin: 20rpx; |
|
|
|
padding: 20rpx 30rpx; |
|
|
|
font-size: 28rpx; |
|
|
|
} |
|
|
|
.top { |
|
|
|
align-items: center; |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
|
|
|
|
|
.submit {} |
|
|
|
} |
|
|
|
} |
|
|
|
.popup{ |
|
|
|
.content-input{ |
|
|
|
min-height: 400rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.box{ |
|
|
|
padding: 0 20rpx; |
|
|
|
} |
|
|
|
.images{ |
|
|
|
display: flex; |
|
|
|
flex-wrap: wrap; |
|
|
|
padding: 20rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
input { |
|
|
|
background-color: #f3f3f3; |
|
|
|
width: 460rpx; |
|
|
|
height: 40rpx; |
|
|
|
border-radius: 40rpx; |
|
|
|
margin: 20rpx; |
|
|
|
padding: 20rpx 30rpx; |
|
|
|
font-size: 28rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |