<template>
|
<div class='clap_feedback'>
|
<div class="w_row clearfix">
|
<p class="w_col_12">发起人名称:{{detail.sponsorName}}</p>
|
<p class="w_col_12">发起人手机号:{{detail.phone}}</p>
|
<p class="w_col_24">事件详情:{{detail.detail}}</p>
|
<section class="w_col_24 image">
|
<template v-if="(detail.photoPathList || '').indexOf('.mp4')!==-1">
|
<video
|
:controls="true"
|
style="width: 300px;height: 150px"
|
:autoplay="false"
|
:src="detail.photoPathList"
|
>您的浏览器不支持 video 标签。</video>
|
</template>
|
<template v-else>
|
<div
|
class="img"
|
v-for="(i,j) in (detail.photoPathList || '').split(',').filter(k=>{return k!==''})"
|
:key="j+'-image'"
|
><img
|
:src="i"
|
alt=""
|
@click="onScaleImage(j)"
|
></div>
|
</template>
|
|
</section>
|
</div>
|
|
<section class="bottom-line">
|
<p class="label" style="width:105px">是否完成治理:</p>
|
<el-radio-group v-model="government" size="mini">
|
<el-radio label="4" border>是</el-radio>
|
<el-radio label="3" border>否</el-radio>
|
</el-radio-group>
|
<span class="tishi">温馨提示:选择完成治理后,将不能继续反馈</span>
|
</section>
|
|
<section>
|
<p class="label">反馈</p>
|
<article>
|
<el-input
|
type="textarea"
|
cols="15"
|
rows="3"
|
class="m_inp input-text"
|
v-model="text"
|
maxlength="200"
|
show-word-limit
|
placeholder="请输入反馈内容,不超过200个字"
|
></el-input>
|
<span
|
class="col_primary"
|
@click="add"
|
v-if="!show"
|
>上传图片</span>
|
</article>
|
</section>
|
<section
|
class="image"
|
v-if="show"
|
>
|
<div
|
class="img"
|
v-for="(i,j) in images"
|
:key="j+'--image'"
|
>
|
<img
|
:src="i.pic"
|
alt=""
|
@click="onScaleUploadImage(j)"
|
>
|
<span
|
class="del el-icon-close"
|
@click="del(i)"
|
></span>
|
</div>
|
<div class="img" v-if="isShowuploadBtn">
|
<v-u
|
slots
|
@path="onImage"
|
><span
|
class="el-icon-plus"
|
style="font-size:24px"
|
></span></v-u>
|
</div>
|
</section>
|
|
<div class="content-lie">
|
<span class="label" style="width:70px">反馈记录:</span>
|
<div>
|
<article class="back-details" v-for="(text , index) in detail.photoFeedbackList" :key="index">
|
<span class="time">{{text.createAt}}</span>
|
<span class="name">{{text.createByName}}</span>
|
<p class="content">{{text.feedbackContent}}
|
<p class="img-fk">
|
<span v-for="url in text.imgList">
|
<img @click="onScaleImage1(url,text.imgList)" :src="url" alt="">
|
</span>
|
</p>
|
</article>
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import vU from "com/upload/upload1";
|
export default {
|
props: {
|
item: {
|
type: Object,
|
default: () => {
|
return {};
|
},
|
},
|
door: {
|
type: Object,
|
default: () => {
|
return {};
|
},
|
},
|
},
|
components: { vU },
|
data() {
|
return { detail: {}, text: "",government:"3", show: false, images: [] ,isShowuploadBtn:true,};
|
},
|
watch: {
|
item: {
|
handler() {
|
this.setItem();
|
},
|
deep: true,
|
},
|
door: {
|
handler(n) {
|
if (n.r) {
|
this.sub(n.t);
|
}
|
},
|
deep: true,
|
},
|
images: {
|
handler(n) {
|
if (!n.length) {
|
this.show = false;
|
}
|
if(n.length > 8) {
|
this.isShowuploadBtn = false;
|
}
|
},
|
deep: true,
|
},
|
},
|
methods: {
|
del(i) {
|
this.images = this.images.filter((k) => {
|
return k.pic !== i.pic && k.id !== i.id;
|
});
|
},
|
onImage(v) {
|
this.images.push({ pic: v, id: Date.now() });
|
},
|
add() {
|
this.show = true;
|
},
|
// 查看上传大图
|
onScaleUploadImage(j) {
|
this.$store.dispatch("setImage", {
|
time: Date.now(),
|
pic: this.images[j].pic,
|
tool: true,
|
});
|
},
|
// 查看大图
|
onScaleImage(j) {
|
let list = (this.detail.photoPathList || "").split(",");
|
this.$store.dispatch("setImage", {
|
time: Date.now(),
|
pic: list[j],
|
list,
|
tool: true,
|
});
|
},
|
onScaleImage1(j, v){
|
this.$store.dispatch("setImage", {
|
time: Date.now(),
|
pic: j,
|
v,
|
tool: true,
|
});
|
},
|
sub(type) {
|
|
if (!this.text && this.government == '3') {
|
demo.toast("请输入与反馈原因");
|
return 0;
|
}
|
|
if(this.images.length >9) {
|
demo.toast("上传图片不能超过9张");
|
return 0;
|
}
|
|
let o = {
|
id: this.detail.id,
|
type: this.government,
|
sponsorId: this.detail.sponsorId,
|
sponsorName: this.detail.sponsorName,
|
communityId: this.detail.communityId,
|
handlePhotoList: this.images
|
.map((l) => {
|
return l.pic;
|
})
|
.join(","),
|
handleResult: this.text,
|
};
|
// let o = Object.assign(demo.copy(this.detail), {
|
// handlePhotoList: this.images
|
// .map((l) => {
|
// return l.pic;
|
// })
|
// .join(","),
|
// type: "3",
|
// handleResult: this.text,
|
// });
|
this.$api.put("communityactivity/puteasyphoto", o, () => {
|
demo.toast("反馈成功");
|
this.$nextTick(() => {
|
this.$store.dispatch("setFixed", {
|
event: "del",
|
type: type,
|
time: Date.now(),
|
});
|
this.$store.dispatch("setPageReset", "/act_clap");
|
});
|
});
|
},
|
setItem() {
|
if (this.item.id) {
|
this.$api.get(
|
"communityactivity/easyphoto",
|
{ id: this.item.id },
|
(e) => {
|
this.detail = e;
|
if(this.detail.photoFeedbackList){
|
this.detail.photoFeedbackList.map(item=>{
|
item.imgList =item.feedbackImg?item.feedbackImg.split(','):[]
|
})
|
}
|
}
|
);
|
} else {
|
demo.toast("错误活动");
|
}
|
},
|
},
|
mounted() {
|
this.setItem();
|
},
|
};
|
</script>
|
<style lang='less' scoped>
|
.clap_feedback {
|
.img-fk {
|
display: flex;
|
flex-wrap: wrap;
|
span {
|
width: 50px;
|
height: 50px;
|
display:inline-block;
|
overflow: hidden;
|
margin-right: 10px;
|
img {
|
width: 100%;
|
}
|
}
|
}
|
p {
|
font-size: 14px;
|
line-height: 22px;
|
color: #222;
|
margin-bottom: 10px;
|
padding-left: 10px;
|
}
|
.content-lie {
|
display: flex;
|
.label {
|
font-size: 14px;
|
line-height: 22px;
|
color: #222;
|
}
|
article {
|
padding-top: 9px;
|
width: 500px;
|
border-bottom: 1px #eaeaeb solid;
|
}
|
}
|
.back-details {
|
.time {
|
font-size: 13px;
|
color: #888;
|
padding-right: 10px;
|
}
|
.name {
|
font-size: 14px;
|
color: #333;
|
}
|
.content {
|
padding:10px 0
|
}
|
}
|
.bottom-line {
|
padding-top: 20px;
|
.tishi {
|
font-size: 13px;
|
color: #888;
|
line-height: 30px;
|
padding-left: 15px;
|
}
|
}
|
.input-text {
|
width: 340px !important;
|
height: auto;
|
}
|
.content-record {
|
font-size: 14px;
|
line-height: 22px;
|
}
|
textarea.m_inp {
|
resize: none;
|
& + span {
|
vertical-align: bottom;
|
font-size: 14px;
|
cursor: pointer;
|
}
|
}
|
section {
|
display: flex;
|
margin-bottom: 10px;
|
.label {
|
width: 50px;
|
}
|
article {
|
width: calc(~"100% - 100px");
|
}
|
}
|
.image {
|
flex-wrap: wrap;
|
box-sizing: border-box;
|
padding: 0 15px;
|
.img {
|
display: block;
|
width: 78px;
|
height: 66px;
|
line-height: 66px;
|
text-align: center;
|
margin: 2px 12px 12px 0;
|
background-color: #eee;
|
border-radius: 5px;
|
position: relative;
|
color: #999;
|
img {
|
display: block;
|
width: 100%;
|
height: 100%;
|
border-radius: 5px;
|
cursor: pointer;
|
}
|
.del {
|
position: absolute;
|
right: -8px;
|
top: -8px;
|
width: 16px;
|
height: 16px;
|
color: #fff;
|
background-color: tomato;
|
border-radius: 50%;
|
cursor: pointer;
|
}
|
.add {
|
display: block;
|
height: 100%;
|
cursor: pointer;
|
line-height: 66px;
|
font-size: 25px;
|
color: #999;
|
}
|
}
|
}
|
}
|
</style>
|