Files
dvcp_v2_wxcp_app/src/project/fd/AppAnswer/answerDetail.vue

142 lines
2.8 KiB
Vue
Raw Normal View History

2023-01-10 10:02:16 +08:00
<template>
<div class="answerDetail">
<div class="head">
<div class="left">
2023-01-11 14:10:31 +08:00
<img :src="info.createUserAvatar" alt="">
2023-01-10 10:02:16 +08:00
<div class="head_avtar">
2023-01-11 14:10:31 +08:00
<h4>{{ info.createUserName }}</h4>
<div class="col-999">{{ info.createUserDeptName }}</div>
2023-01-10 10:02:16 +08:00
</div>
</div>
2023-01-11 14:10:31 +08:00
<div class="right col-999">{{ info.createTime }}</div>
2023-01-10 10:02:16 +08:00
</div>
<div class="content">
2023-01-11 14:10:31 +08:00
{{ info.content }}
</div>
<div class="picture">
<img :src="item.url" v-for="(item,index) in info.files" :key="index" alt=""
@click="preview(info.files, item.url)">
2023-01-10 11:35:04 +08:00
</div>
<div class="btn_box">
2023-01-11 14:10:31 +08:00
<div class="del" @click="deleteBtn(info.id)">删除</div>
<div class="edit" @click="editBtn()">修改</div>
2023-01-10 10:02:16 +08:00
</div>
</div>
</template>
<script>
export default {
name: "answerDetail",
2023-01-10 11:35:04 +08:00
appName: "Ta的回答",
2023-01-10 10:02:16 +08:00
data() {
2023-01-11 14:10:31 +08:00
return {
info: {},
}
2023-01-10 10:02:16 +08:00
},
methods: {
2023-01-11 14:10:31 +08:00
editBtn() {
uni.navigateTo({
url: './answerAdd?data=' + JSON.stringify(this.info)
})
},
2023-01-10 17:59:07 +08:00
deleteBtn(id) {
2023-01-10 11:35:04 +08:00
this.$confirm('确定要删除该回答吗?').then(()=> {
2023-01-11 14:10:31 +08:00
this.$http.post(`/app/applearningquestion/deleteAnswer?id=${id}`).then(res=> {
if(res?.code == 0) {
this.$u.toast('删除成功!')
setTimeout(()=> {
uni.navigateBack()
}, 500)
2023-01-10 17:59:07 +08:00
}
})
})
},
preview(images, img) {
uni.previewImage({
urls: images.map(v => v.url),
current: img
2023-01-10 11:35:04 +08:00
})
},
2023-01-10 10:02:16 +08:00
},
2023-01-11 14:10:31 +08:00
onLoad(o) {
this.info = JSON.parse(o.data)
},
2023-01-10 10:02:16 +08:00
}
</script>
<style lang="scss" scoped>
.answerDetail {
padding: 24px 32px 120px 32px;
box-sizing: border-box;
background: #FFF;
.head {
display: flex;
justify-content: space-between;
.left {
display: flex;
img {
width: 80px;
height: 80px;
margin-right: 16px;
}
.head_avtar {
width: calc(100% - 96px);
}
}
.col-999 {
color: #999999;;
}
}
.content{
width: 100%;
word-break: break-all;
2023-01-10 11:35:04 +08:00
font-size: 28px;
2023-01-10 10:02:16 +08:00
color: #333;
2023-01-10 11:35:04 +08:00
line-height: 44px;
margin-top: 24px;
}
2023-01-11 14:10:31 +08:00
.picture {
margin-top: 24px;
img {
width: 220px;
height: 220px;
margin-right: 8px;
}
}
2023-01-10 11:35:04 +08:00
.btn_box {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 120px;
padding: 16px 32px;
box-sizing: border-box;
display: flex;
2023-01-11 14:10:31 +08:00
background: #f3f5f7;
z-index: 9;
2023-01-10 11:35:04 +08:00
div {
flex: 1;
border-radius: 44px;
text-align: center;
line-height: 88px;
font-size: 34px;
}
.del {
margin-right: 30px;
border: 1px solid #E23C3C;
color: #E23C3C;
}
.edit {
border: 1px solid #3975C6;
color: #3975C6;
}
2023-01-10 10:02:16 +08:00
}
}
</style>