This commit is contained in:
2025-05-10 15:59:02 +08:00
parent d6b32af2b2
commit 396fd4b934
21 changed files with 662 additions and 83 deletions

View File

@@ -3,20 +3,38 @@ import XSelect from "../../../components/XSelect/index.vue";
import {reactive, ref} from "vue";
import UploadAvatar from "../../../components/upload/UploadAvatar.vue";
import Api from "../../../api/index.js";
import {Message} from "@arco-design/web-vue";
const {id} = defineProps({
id: {
type: Number,
const emits = defineEmits(['success']);
const {item, material} = defineProps({
item: {
type: Object,
default: null,
},
material: {
type: Object,
default: null,
}
});
const form = reactive({
type: 0,
files: []
is_reply: 0,
pid: null,
files: [],
intro: null,
});
const visible = ref(false);
const success = async () => {
const {msg} = await Api.merchant.addChildrenComment({
id: material.id,
material_id: item.id,
pid: form.pid,
image: form.files,
intro: form.intro,
is_reply: form.is_reply,
});
Message.success(msg);
visible.value = false;
emits('success');
}
</script>
@@ -34,14 +52,18 @@ const success = async () => {
v-model:visible="visible"
@ok="success">
<a-form layout="vertical">
<a-form-item label="是否回复之前评论">
<a-radio-group v-model:model-value="form.type">
<a-form-item label="是否回复之前评论" v-if="item.comment.length !== 0">
<a-radio-group v-model:model-value="form.is_reply">
<a-radio :value="0"></a-radio>
<a-radio :value="1"></a-radio>
</a-radio-group>
</a-form-item>
<a-form-item label="需要回复的评论" v-if="form.type===1">
<x-select api=""></x-select>
<a-form-item label="需要回复的评论" v-if="form.is_reply===1">
<x-select
v-model:model-value="form.pid"
:apiPo="item.id"
:api="Api.merchant.getChildrenComment">
</x-select>
</a-form-item>
<a-form-item label="添加图片">
<UploadAvatar
@@ -50,7 +72,7 @@ const success = async () => {
</UploadAvatar>
</a-form-item>
<a-form-item label="添加文字">
<a-textarea placeholder="请输入评论内容"></a-textarea>
<a-textarea v-model:model-value="form.intro" placeholder="请输入评论内容"></a-textarea>
</a-form-item>
</a-form>
</a-modal>

View File

@@ -1,18 +1,24 @@
<script setup>
import {reactive, ref} from "vue";
import {reactive, ref, watch} from "vue";
import XImage from "../../../components/XImage/Index.vue";
import UploadButton from "../../../components/upload/UploadButton.vue";
import Api from "../../../api/index.js";
import {v4} from "uuid";
import MaterialSource from "./MaterialSource.vue";
import {Message} from "@arco-design/web-vue";
const MaterialSourceRef = ref();
const visible = ref(false);
const targetList = reactive([]);
const {id} = defineProps({
const emits = defineEmits(['success']);
const {id, material} = defineProps({
id: {
type: Number,
default: null,
},
material: {
type: Object,
default: null,
}
});
@@ -23,8 +29,33 @@ const uploadSuccess = (url) => {
});
}
watch(
() => visible.value,
(val) => {
if (val) {
MaterialSourceRef.value.getMaterialList();
targetList.length = 0;
material.material_arr.forEach(v => uploadSuccess(v));
}
}
)
const open = () => {
visible.value = true;
}
defineExpose({
open
});
const success = async () => {
const {msg} = await Api.merchant.editChildrenMaterial({
id: material.id,
image: targetList.map(v => v.image),
});
Message.success(msg);
emits('success');
MaterialSourceRef.value.handleImage();
}
</script>
@@ -44,7 +75,7 @@ const success = async () => {
v-model:visible="visible"
title="添加素材">
<div class="target">
<div class="text-[#1D2129] text-[14px]">已添加5个素材长摁图片可拖动排序</div>
<div class="text-[#1D2129] text-[14px]">已添加{{ targetList.length }}个素材长摁图片可拖动排序</div>
<div class="grid grid-cols-6 mt-[10px] gap-[16px]">
<x-image
@delete="targetList.splice(index,1)"

View File

@@ -1,101 +0,0 @@
<script setup>
import {reactive, ref} from "vue";
import {Message} from "@arco-design/web-vue";
import Api from "../../../api/index.js";
const {money} = defineProps({
money: {
type: Number,
default: null
}
});
const visible = ref(false);
const qrInfo = reactive({});
const open = () => {
if (!money) {
Message.warning('充值金额需大于0元');
return;
}
visible.value = true;
initQR();
}
const initQR = async () => {
const {data} = await Api.merchant.rechargeOrderQR({
money: money,
});
Object.assign(qrInfo, data);
}
</script>
<template>
<a-button type="primary" @click="open">立即充值</a-button>
<a-modal
:footer="false"
id="Alipay-Modal"
title-align="start"
title="支付宝支付"
v-model:visible="visible">
<template v-if="true">
<a-alert>平台提示支付后未出现成功提示点击我已支付刷新充值状态</a-alert>
<div class="py-[24px] px-[20px]">
<div class="flex justify-center gap-[15px]">
支付金额: <span class="text-[rgb(var(--arcoblue-6))]">{{ money }}</span>
</div>
<div class="text-center mt-[20px]">打开支付宝扫描下方二维码支付</div>
<div class="w-[200px] aspect-square mx-auto mt-[5px]">
<img class="w-full h-full object-cover" src="" alt=""/>
</div>
<div class="flex justify-center mt-[5px] flex-col items-center">
<a-link :hoverable="false" style="color: var(--color-neutral-6)">
<icon-sync class="mr-[5px]"/>
点击刷新
</a-link>
<a-button class="mx-auto mt-[20px]" type="primary">我已支付</a-button>
</div>
<div class="mt-[20px] info mb-[40px]">
<div>支付遇到问题?</div>
<div>1请先确认第三方支付网站是否交易完成</div>
<div>2第三方支付网站显示交易成功但账户中没有充值流水请私聊客服</div>
</div>
</div>
</template>
<template v-else>
<div class="py-[24px] px-[20px]">
<a-result status="success" title="充值成功">
<template #subtitle>
支付宝付款200.00
</template>
<template #extra>
<a-space>
<a-button type='primary'>确定</a-button>
</a-space>
</template>
</a-result>
</div>
</template>
</a-modal>
</template>
<style lang="scss" scoped>
.info {
color: rgb(78, 89, 105);
font-size: 14px;
font-weight: 400;
line-height: 22px;
letter-spacing: 0;
text-align: left;
}
</style>
<style lang="scss">
#Alipay-Modal {
.arco-modal-body {
padding: 0;
}
}
</style>

View File

@@ -12,11 +12,14 @@ const {id} = defineProps({
}
});
const getMaterialList = async () => {
const {data} = await Api.merchant.getMaterialList(id);
list.length = 0;
list.push(...data);
}
onMounted(() => {
Api.merchant.getMaterialList(id).then(({data}) => {
list.length = 0;
list.push(...data);
});
getMaterialList();
});
const select = (v) => {
const flag = selectList.value.findIndex(k => k.id === v.id);
@@ -27,11 +30,18 @@ const select = (v) => {
selectList.value.push(v);
}
}
const handle = async () => {
if (type === 0) {
const handleImage = async () => {
if (type.value === 0) {
selectList.value.filter(v => typeof v.id === 'number').forEach(v => {
Api.merchant.delMaterial(v.id);
});
}
}
defineExpose({
getMaterialList,
handleImage
});
</script>
<template>

View File

@@ -0,0 +1,54 @@
<script setup>
import XImage from "../../../components/XImage/Index.vue";
import {ref} from "vue";
const visible = ref(false);
const emits = defineEmits(['edit']);
const {id, material} = defineProps({
id: {
type: Number,
default: null,
},
material: {
type: Object,
default: null,
}
});
const edit = () => {
visible.value = false;
emits('edit');
}
</script>
<template>
<a-button v-if="!$slots.default" type="primary" @click="visible=true">
添加素材
</a-button>
<div @click="visible=true" v-else class="cursor-pointer">
<slot></slot>
</div>
<a-modal
v-model:visible="visible"
title-align="start"
title="素材">
<div class="grid grid-cols-4">
<div v-for="(v, index) in material.material_arr" :key="index"
class="flex flex-col justify-center items-center gap-[10px]">
<x-image :src="v" :hide-delete="true"></x-image>
素材{{ index }}
</div>
</div>
<template #footer>
<div class="flex gap-[12px] justify-end">
<a-button @click="edit">编辑素材</a-button>
<a-button @click="visible=false" type="primary">确定</a-button>
</div>
</template>
</a-modal>
</template>
<style scoped lang="scss">
</style>

View File

@@ -1,6 +1,6 @@
<script setup>
import {reactive} from "vue";
import Alipay from "../../../components/Alipay.vue";
import Alipay from "../../../../../components/Pay/Alipay.vue";
const form = reactive({
money: null,

View File

@@ -1,13 +1,18 @@
<script setup>
import {reactive} from "vue";
import Comment from "../../../../components/Comment/index.vue";
import {reactive, ref} from "vue";
import useTableQuery from "../../../../hooks/useTableQuery.js";
import Api from "../../../../api/index.js";
import {useRoute} from "vue-router";
import MaterialLibrary from "../../components/MaterialLibrary.vue";
import AddMaterial from "../../components/AddMaterial.vue";
import AddComment from "../../components/AddComment.vue";
import XImageSmallList from "../../../../components/XImage/XImageSmallList.vue";
import ViewMaterial from "../../components/ViewMaterial.vue";
import {Message} from "@arco-design/web-vue";
const route = useRoute();
const AddMaterialRef = ref();
const columns = reactive([
{
title: '子任务编号',
@@ -49,13 +54,31 @@ const vo = reactive({
pageSize: 9,
});
const {loading, pagination} = useTableQuery({
const {loading, pagination, fetchData} = useTableQuery({
parameter: po,
api: Api.merchant.getTaskChildrenList,
callback: (data) => {
Object.assign(vo, data);
}
});
const editMaterial = (index) => {
AddMaterialRef.value[index].open();
}
const success = async () => {
const {msg} = await Api.merchant.editChildrenMaterimal({
id: vo.rows[0]?.task_id,
data: vo.rows.map(v => v.childrenMaterial.map(k => ({
id: k.id,
title: k.title,
content: k.content,
tags: k.tags,
}))).flat()
});
Message.success(msg);
await fetchData();
}
</script>
<template>
@@ -63,16 +86,17 @@ const {loading, pagination} = useTableQuery({
<a-card class="flex-grow text-[14px]">
<div class="flex justify-between">
<MaterialLibrary :id="po.id"></MaterialLibrary>
<a-button type="primary">确认修改</a-button>
<a-button type="primary" @click="success">确认修改</a-button>
</div>
<a-table
:data="vo.rows"
:loading="loading"
:columns="columns"
:scroll="{x: 'auto'}"
class="w-full mt-[20px] flex-grow"
@page-change="(e) => pagination.current = e"
:pagination="pagination">
:pagination="false">
<template v-slot:title="{record}">
<div class="flex flex-col gap-[12px]">
<a-input
@@ -100,28 +124,46 @@ const {loading, pagination} = useTableQuery({
</a-input>
</div>
</template>
<template v-slot:material="{record}">
<template v-slot:material="{record, rowIndex}">
<div class="flex flex-col gap-[12px]">
<add-material
v-for="v in record.childrenMaterial"
:id="po.id">
<div class="add-materials">
<icon-plus/>
<div>添加</div>
</div>
</add-material>
<div class="flex gap-[12px]" v-for="v in record.childrenMaterial">
<add-material
ref="AddMaterialRef"
@success="fetchData"
:id="po.id"
:material="v">
<div class="add-materials">
<icon-plus/>
<div>添加</div>
</div>
</add-material>
<view-material
@edit="editMaterial(rowIndex)"
:material="v"
:id="po.id">
<x-image-small-list
:preview="false"
v-if="v.material_arr.length>0"
:list="v.material_arr">
</x-image-small-list>
</view-material>
</div>
</div>
</template>
<template v-slot:pl="{record}">
<div class="flex flex-col gap-[12px]">
<add-comment
v-for="v in record.childrenMaterial"
:id="v.id">
<div class="add-materials">
<icon-plus/>
<div>添加</div>
</div>
</add-comment>
<div v-for="(v, index) in record.childrenMaterial" :key="index" class="flex gap-[12px]">
<add-comment
@success="fetchData"
:material="record"
:item="v">
<div class="add-materials">
<icon-plus/>
<div>添加</div>
</div>
</add-comment>
<comment @success="fetchData" :data="v.comment"></comment>
</div>
</div>
</template>
</a-table>

View File

@@ -6,6 +6,7 @@ import useTableQuery from "../../../../hooks/useTableQuery.js";
import Api from "../../../../api/index.js";
import {toPath} from "../../../../utils/index.js";
import {Message} from "@arco-design/web-vue";
import {usePayTask} from "../../../../hooks/usePayTask.js";
const columns = [
{
@@ -100,13 +101,44 @@ const po = reactive({
wd: null,
});
const {loading, pagination, initFetchData} = useTableQuery({
const {loading, pagination, initFetchData, fetchData} = useTableQuery({
parameter: po,
api: Api.merchant.getTaskList,
callback: (data) => {
Object.assign(vo, data);
}
});
const {open: openPayTask} = usePayTask();
const startTask = async (_value, record) => {
const {status, id} = record;
const showMessageAndFetch = async (msg) => {
Message.success(msg);
await fetchData();
};
if (status === -2 || status === 4) {
const {msg} = await Api.merchant.endTask(id);
await showMessageAndFetch(msg);
} else {
const {data} = await Api.merchant.startTask({id});
openPayTask({
props: {payInfo: data},
success: async () => {
const {msg} = await Api.merchant.moneyToTask(id);
await showMessageAndFetch(msg);
},
});
}
};
const stopTask = async (id) => {
const {msg} = await Api.merchant.stopTask(id);
Message.success(msg);
await fetchData();
}
</script>
<template>
@@ -150,7 +182,8 @@ const {loading, pagination, initFetchData} = useTableQuery({
</template>
<template v-slot:start="{record}">
<a-switch
:disabled="record.status !== -2 || record.status !== 3"
@change="startTask($event, record)"
:disabled="record.status !== -2 && record.status !== 3 && record.status !== 4"
:model-value="record.status === 4">
</a-switch>
</template>
@@ -170,7 +203,9 @@ const {loading, pagination, initFetchData} = useTableQuery({
@click="record.status >= 2 ? toPath('/home/task-center/look-min-task', {id: record.id}) : Message.warning('审核未通过')">
查看子任务
</a-link>
<a-link :hoverable="false" status="danger">终止</a-link>
<a-popconfirm content="确认终止吗?" @ok="stopTask(record.id)">
<a-link :hoverable="false" status="danger">终止</a-link>
</a-popconfirm>
</div>
</template>
<template v-slot:exp>