添加了删除提示

This commit is contained in:
luyuan 2020-11-12 10:30:27 +08:00
parent 77664c98e3
commit fb173c548d
Signed by: theluyuan
GPG Key ID: A7972FD973317FF3
2 changed files with 16 additions and 7 deletions

View File

@ -137,6 +137,7 @@
<script lang="ts"> <script lang="ts">
import { delreply, getcommentlist } from '@/api'; import { delreply, getcommentlist } from '@/api';
import { useI18n } from '@/utils/i18n'; import { useI18n } from '@/utils/i18n';
import { message } from 'ant-design-vue';
import { defineComponent, onMounted, ref } from 'vue'; import { defineComponent, onMounted, ref } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import ReviewItemtwo from "./ReviewItemtwo.vue" import ReviewItemtwo from "./ReviewItemtwo.vue"
@ -219,13 +220,7 @@ export default defineComponent({
replylist.value =await getcommentlist({type: 3,id: e}) replylist.value =await getcommentlist({type: 3,id: e})
ifshow.value = true; ifshow.value = true;
} }
async function del(e?: number){ async function reload() {
console.log(e)
const res=await delreply(e)
}
async function reload() {
if(iszk.value == true){ if(iszk.value == true){
iszk.value = false; iszk.value = false;
if(prop.replyid){ if(prop.replyid){
@ -234,6 +229,17 @@ export default defineComponent({
} }
} }
async function del(e?: number){
console.log(e)
const res=await delreply(e)
if(res.code != 0){
message.error(res.msg)
}
reload()
}
return { return {
stars, stars,

View File

@ -100,6 +100,7 @@
import { delreply } from '@/api'; import { delreply } from '@/api';
import store from '@/store'; import store from '@/store';
import { useI18n } from '@/utils/i18n'; import { useI18n } from '@/utils/i18n';
import { message } from 'ant-design-vue';
import { defineComponent, ref } from 'vue'; import { defineComponent, ref } from 'vue';
export default defineComponent({ export default defineComponent({
@ -139,6 +140,8 @@ export default defineComponent({
const res=await delreply(e) const res=await delreply(e)
if(res.code==0){ if(res.code==0){
context.emit("reload",prop.replyid) context.emit("reload",prop.replyid)
}else {
message.error(res.msg)
} }
console.log(res) console.log(res)