新讨论测试修改
This commit is contained in:
parent
740ec94346
commit
4250086957
@ -129,7 +129,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- shutAnswerCommentsChild openAnswerCommentsChild -->
|
<!-- shutAnswerCommentsChild openAnswerCommentsChild -->
|
||||||
<div class="comment-text" @click="!item['childState'] ? openAnswerCommentsChild(index) : closeAnswerCommentsChild()">{{ item["content"] }}</div>
|
<div class="comment-text" v-if="item['content']" @click="!item['childState'] ? openAnswerCommentsChild(index) : closeAnswerCommentsChild()">{{ item["content"] }}</div>
|
||||||
<img class="comments-img" @click="handleAnswerText" :src="item.image?.base64 || item.image?.url" v-if="item.image?.url" />
|
<img class="comments-img" @click="handleAnswerText" :src="item.image?.base64 || item.image?.url" v-if="item.image?.url" />
|
||||||
<div class="alreadyVoted" v-if="item.voteoption">已投:{{ item.voteoption }}</div>
|
<div class="alreadyVoted" v-if="item.voteoption">已投:{{ item.voteoption }}</div>
|
||||||
<div class="input-box" v-if="item['childState']">
|
<div class="input-box" v-if="item['childState']">
|
||||||
@ -214,7 +214,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="comment-text" @click="!ite['childState'] ? openAnswerCommentsChild(index, i) : closeAnswerCommentsChild()">
|
<div class="comment-text" v-if="ite['content']" @click="!ite['childState'] ? openAnswerCommentsChild(index, i) : closeAnswerCommentsChild()">
|
||||||
<div class="comments-reply" v-if="ite?.reply?.nickname">@{{ ite?.reply?.nickname }}</div>
|
<div class="comments-reply" v-if="ite?.reply?.nickname">@{{ ite?.reply?.nickname }}</div>
|
||||||
{{ ite["content"] }}
|
{{ ite["content"] }}
|
||||||
</div>
|
</div>
|
||||||
@ -293,6 +293,16 @@
|
|||||||
<img class="detail-img" :src="dialogSrc" />
|
<img class="detail-img" :src="dialogSrc" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<el-dialog v-model="dialogVisible" title="提示" width="500">
|
||||||
|
<span>确定删除该讨论吗?</span>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="confirmCommentDelete">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
@ -319,8 +329,8 @@ let permissions = ref([])
|
|||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// permissions.value = window["permissions"] || []
|
permissions.value = window["permissions"] || []
|
||||||
permissions.value = ["comment.edit", "comment.delete"]
|
// permissions.value = ["comment.edit", "comment.delete"]
|
||||||
}, 1000)
|
}, 1000)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -858,26 +868,39 @@ const handleKeydown = event => {
|
|||||||
window.removeEventListener("keydown", handleKeydown) // 取消监听
|
window.removeEventListener("keydown", handleKeydown) // 取消监听
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let dialogVisible = ref(false)
|
||||||
|
let commemtDelete = {}
|
||||||
// 点击删除
|
// 点击删除
|
||||||
const commentDelete = (token, index, i) => {
|
const commentDelete = (token, index, i) => {
|
||||||
commentDeleteHttp({
|
commemtDelete = {
|
||||||
token,
|
token,
|
||||||
|
index,
|
||||||
|
i,
|
||||||
|
}
|
||||||
|
dialogVisible.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
const confirmCommentDelete = () => {
|
||||||
|
commentDeleteHttp({
|
||||||
|
token: commemtDelete.token,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.code != 200) {
|
if (res.code != 200) {
|
||||||
ElMessage.error(res.message)
|
ElMessage.error(res.message)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i >= 0) {
|
if (commemtDelete.i >= 0) {
|
||||||
commentList.value[index].child.splice(i, 1)
|
commentList.value[commemtDelete.index].child.splice(commemtDelete.i, 1)
|
||||||
commentList.value[index].childnum -= 1
|
commentList.value[commemtDelete.index].childnum -= 1
|
||||||
console.log("childnum", commentList.value[index])
|
|
||||||
} else {
|
} else {
|
||||||
commentComments.value -= commentList.value[index].childnum
|
commentComments.value -= commentList.value[commemtDelete.index].childnum
|
||||||
commentList.value.splice(index, 1)
|
commentList.value.splice(commemtDelete.index, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
commentComments.value -= 1
|
commentComments.value -= 1
|
||||||
|
dialogVisible.value = false
|
||||||
|
|
||||||
|
ElMessage.success(res.message || "操作成功")
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ axios.defaults.withCredentials = true
|
|||||||
axios.interceptors.request.use( //响应拦截
|
axios.interceptors.request.use( //响应拦截
|
||||||
async config => {
|
async config => {
|
||||||
// 开发时登录用的,可以直接替换小程序的 authorization
|
// 开发时登录用的,可以直接替换小程序的 authorization
|
||||||
config['headers']['authorization'] = process.env.NODE_ENV !== "production" && "c1fb97e6994539d87922b1b60c09d43c"
|
config['headers']['authorization'] = process.env.NODE_ENV !== "production" && "287ad69d214c091fe46fbe995b6a8fc5"
|
||||||
return config;
|
return config;
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user