update
This commit is contained in:
@@ -6,10 +6,10 @@ import Api from "../../api";
|
||||
import {Message} from "@arco-design/web-vue";
|
||||
import useTableQuery from "../../hooks/useTableQuery.js";
|
||||
import dayjs from "dayjs";
|
||||
import {throttle} from "lodash";
|
||||
import {debounce, throttle} from "lodash";
|
||||
import {useSystemStore} from "../../pinia/SystemStore/index.js";
|
||||
import UploadSlot from "../upload/UploadSlot.vue";
|
||||
import useUploadLength from "../../hooks/useUploadLength.js";
|
||||
import UploadSlot from "../upload/UploadSlot.vue";
|
||||
|
||||
const SystemStore = useSystemStore();
|
||||
const emits = defineEmits(['success']);
|
||||
@@ -44,6 +44,7 @@ const {loading, pagination, initFetchData, fetchData} = useTableQuery({
|
||||
api: SystemStore.isRoot ? Api.admin.getExchangeLogIntervention : Api.merchant.getExchangeLog,
|
||||
callback: (data) => {
|
||||
if (data.rows.length === 0) {
|
||||
if (pagination.current > 1) pagination.current--;
|
||||
} else {
|
||||
tempPage = pagination.current;
|
||||
vo.info = data.info;
|
||||
@@ -59,7 +60,7 @@ const {loading, pagination, initFetchData, fetchData} = useTableQuery({
|
||||
}
|
||||
});
|
||||
|
||||
const send = async () => {
|
||||
const send = debounce(async () => {
|
||||
const {msg} = await Api.merchant.addExchangeLog({
|
||||
id: task.id,
|
||||
...form,
|
||||
@@ -68,7 +69,8 @@ const send = async () => {
|
||||
form.content = null;
|
||||
form.images.length = 0;
|
||||
pagination.current = tempPage;
|
||||
}
|
||||
await fetchData()
|
||||
}, 1000);
|
||||
|
||||
const handleScroll = ({target}) => {
|
||||
const {scrollTop, clientHeight, scrollHeight} = target;
|
||||
@@ -79,97 +81,109 @@ const handleScroll = ({target}) => {
|
||||
}
|
||||
}
|
||||
|
||||
const addIntervention = async () => {
|
||||
const {msg} = await Api.admin.addIntervention({...form, id: task.id,});
|
||||
const addIntervention = debounce(async (id) => {
|
||||
const {msg} = await Api.admin.addInterventionV2({...form, id: id});
|
||||
Message.success(msg);
|
||||
await fetchData();
|
||||
pagination.current = tempPage;
|
||||
await fetchData()
|
||||
emits('success')
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
const intervention = async () => {
|
||||
const {msg} = await Api.merchant.intervention({...form, id: task.id});
|
||||
const intervention = debounce(async () => {
|
||||
const {msg} = await Api.merchant.interventionV2({...form, id: task.id});
|
||||
Message.success(msg);
|
||||
form.content = null;
|
||||
form.images.length = 0;
|
||||
pagination.current = tempPage;
|
||||
await fetchData();
|
||||
emits('success')
|
||||
}
|
||||
}, 1000)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
@scroll="handleScroll"
|
||||
:class="['size-full flex flex-col gap-[30px] overflow-auto', !SystemStore.isRoot ? 'max-h-[600px]' : 'max-h-[800px]']">
|
||||
<div :class="['flex gap-[18px]', v.right === 0 ? 'chat-right' : 'chat-left']" v-for="v in vo.rows">
|
||||
<a-image :src="v.people.avatar" class="rounded-[50%] overflow-hidden" width="64px"
|
||||
height="64px"></a-image>
|
||||
<div class="content-box flex flex-col">
|
||||
<div class="text-[#86909C] text-[12px]">{{ dayjs(v.createtime).format('MM月DD日 HH:mm') }}</div>
|
||||
<div class="bg-white p-[16px] max-w-[330px]">
|
||||
<div v-html="v.content"></div>
|
||||
<div class="flex flex-wrap gap-[12px] mt-[12px]" v-if="v.image_arr.length > 0">
|
||||
<x-image
|
||||
class="flex-shrink-0"
|
||||
v-for="(v, index) in v.image_arr"
|
||||
:hide-delete="true"
|
||||
:key="index"
|
||||
width="50px"
|
||||
height="50px"
|
||||
:src="v">
|
||||
</x-image>
|
||||
<template v-for="v in vo.rows">
|
||||
<div v-if="v.pattern !== 2" :class="['flex gap-[18px]', v.right === 0 ? 'chat-right' : 'chat-left']">
|
||||
<a-image :src="v.people.avatar" class="rounded-[50%] overflow-hidden" width="64px"
|
||||
height="64px"></a-image>
|
||||
<div class="content-box flex flex-col">
|
||||
<div class="text-[#86909C] text-[12px]">{{ dayjs(v.createtime).format('MM月DD日 HH:mm') }}</div>
|
||||
<div class="bg-white p-[16px] max-w-[330px]">
|
||||
<div v-html="v.content"></div>
|
||||
<div class="flex flex-wrap gap-[12px] mt-[12px]" v-if="v.image_arr.length > 0">
|
||||
<x-image
|
||||
class="flex-shrink-0"
|
||||
v-for="(v, index) in v.image_arr"
|
||||
:hide-delete="true"
|
||||
:key="index"
|
||||
width="50px"
|
||||
height="50px"
|
||||
:src="v">
|
||||
</x-image>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
:class="[v.status===0?'text_warn':'',v.status===1?'text_success':'',v.status===-1?'text_error':'', 'text_info']">
|
||||
{{ v.status_text }}
|
||||
</div>
|
||||
<div class="msg-state text-[14px] text-[#1D2129] mt-[4px]">
|
||||
已读
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
:class="[v.status===0?'text_warn':'',v.status===1?'text_success':'',v.status===-1?'text_error':'', 'text_info']">
|
||||
{{ v.status_text }}
|
||||
</div>
|
||||
<div class="msg-state text-[14px] text-[#1D2129] mt-[4px]">
|
||||
已读
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="vo.info?.id" class="flex justify-center">
|
||||
<a-card class="w-[528px]" title="达人发起了平台介入" :header-style="{textAlign: 'center'}">
|
||||
<div class="font-bold text-[#1D2129] mb-[6px]">达人申诉理由:</div>
|
||||
<div class="px-[16px] py-[12px] bg-[#F7F8FA]">
|
||||
<div>
|
||||
{{ vo.info.remark }}
|
||||
<div v-else class="flex justify-center">
|
||||
<a-card class="w-[528px]" :title="`${ v.type === 1 ? '达人' : '商家'}发起了平台介入`"
|
||||
:header-style="{textAlign: 'center'}">
|
||||
<div class="font-bold text-[#1D2129] mb-[6px]">{{ v.type === 1 ? '达人' : '商家' }}申诉理由:</div>
|
||||
<div class="px-[16px] py-[12px] bg-[#F7F8FA]">
|
||||
<div>
|
||||
{{ v.content }}
|
||||
</div>
|
||||
<div class="grid grid-cols-5 gap-[12px] mt-[4px]">
|
||||
<x-image hideDelete v-for="v in v.image_arr" :src="v"></x-image>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid grid-cols-5 gap-[12px] mt-[4px]">
|
||||
<x-image hideDelete v-for="v in vo.info.image_arr" :src="v"></x-image>
|
||||
<div
|
||||
v-if="v.is_handle === 1 || SystemStore.isRoot"
|
||||
class="font-bold text-[#1D2129] mt-[20px] mb-[6px]">平台处理结果:
|
||||
</div>
|
||||
</div>
|
||||
<div class="font-bold text-[#1D2129] mt-[20px] mb-[6px]">平台处理结果:</div>
|
||||
<div id="ROOT" class="flex flex-col justify-center items-center" v-if="SystemStore.isRoot">
|
||||
<a-textarea v-model:model-value="form.content" class="w-full h-[140px]"
|
||||
placeholder="输入平台介入结果"></a-textarea>
|
||||
<div class="flex flex-wrap gap-[16px] mt-[10px] mr-auto">
|
||||
<x-image
|
||||
v-for="(v, index) in form.images"
|
||||
@delete="form.images.splice(index,1)"
|
||||
:key="index"
|
||||
width="32px"
|
||||
height="32px"
|
||||
:src="v">
|
||||
</x-image>
|
||||
<upload-slot @success="(e) => form.images.push(e)">
|
||||
<div
|
||||
class="size-[32px] bg-[#F2F3F5] flex justify-center items-center flex-col rounded-[8px] cursor-pointer">
|
||||
<icon-plus/>
|
||||
</div>
|
||||
</upload-slot>
|
||||
<div id="ROOT" class="flex flex-col justify-center items-center"
|
||||
v-if="SystemStore.isRoot && v.is_handle !== 1">
|
||||
<a-textarea v-model:model-value="form.content" class="w-full h-[140px]"
|
||||
placeholder="输入平台介入结果"></a-textarea>
|
||||
<div class="flex flex-wrap gap-[16px] mt-[10px] mr-auto">
|
||||
<x-image
|
||||
v-for="(v, index) in form.images"
|
||||
@delete="form.images.splice(index,1)"
|
||||
:key="index"
|
||||
width="32px"
|
||||
height="32px"
|
||||
:src="v">
|
||||
</x-image>
|
||||
<upload-slot @success="(e) => form.images.push(e)">
|
||||
<div
|
||||
class="size-[32px] bg-[#F2F3F5] flex justify-center items-center flex-col rounded-[8px] cursor-pointer">
|
||||
<icon-plus/>
|
||||
</div>
|
||||
</upload-slot>
|
||||
</div>
|
||||
<a-button type="primary" class="mt-[10px]" @click="addIntervention(v.id)">平台介入</a-button>
|
||||
</div>
|
||||
<a-button type="primary" class="mt-[10px]" @click="addIntervention">平台介入</a-button>
|
||||
</div>
|
||||
<div v-else class="px-[16px] py-[12px] bg-[#F7F8FA]">
|
||||
<div>
|
||||
{{ vo.info.intro }}
|
||||
<div v-else
|
||||
v-show="v.is_handle === 1 || SystemStore.isRoot"
|
||||
class="px-[16px] py-[12px] bg-[#F7F8FA]">
|
||||
<div>
|
||||
{{ v.reply_conyent }}
|
||||
</div>
|
||||
<div class="grid grid-cols-5 gap-[12px] mt-[4px]">
|
||||
<x-image hideDelete v-for="v in v.reply_image_arr" :src="v"></x-image>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid grid-cols-5 gap-[12px] mt-[4px]">
|
||||
<x-image hideDelete v-for="v in vo.info.intro_image_arr" :src="v"></x-image>
|
||||
</div>
|
||||
</div>
|
||||
</a-card>
|
||||
</div>
|
||||
</a-card>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user