-
- {{ v.id }}.
-
-
-
- 回复{{ v.pid }}:
-
-
-
- 第三个很好用,大家可以在网上搜同款
-
-
+
+
+
+
+ 暂无评论区内容
@@ -107,14 +107,18 @@ const refuseTaskChildren = async () => {
-
-
- 选中
-
-
+
+
+
+
+
-
通过
-
拒绝
+
+ 通过
+
+ 拒绝
+
+
关闭
diff --git a/src/components/XImage/Index.vue b/src/components/XImage/Index.vue
index fc1fb3a..d4b6eb1 100644
--- a/src/components/XImage/Index.vue
+++ b/src/components/XImage/Index.vue
@@ -1,9 +1,11 @@
+
+
+
+
+
+ +{{ list.length - 1 }}
+
+
+
+
+
diff --git a/src/hooks/usePayTask.js b/src/hooks/usePayTask.js
new file mode 100644
index 0000000..cb08781
--- /dev/null
+++ b/src/hooks/usePayTask.js
@@ -0,0 +1,16 @@
+import {createApp} from "vue";
+
+import PayTask from "../components/Pay/PayTask.vue";
+
+export const usePayTask = () => {
+ const container = document.createElement('div');
+ document.body.appendChild(container);
+ const app = createApp(PayTask);
+ const vm = app.mount(container);
+
+ const {open} = vm;
+
+ return {
+ open
+ };
+}
diff --git a/src/pages/merchant/components/AddComment.vue b/src/pages/merchant/components/AddComment.vue
index ae0bd79..00f995e 100644
--- a/src/pages/merchant/components/AddComment.vue
+++ b/src/pages/merchant/components/AddComment.vue
@@ -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');
}
@@ -34,14 +52,18 @@ const success = async () => {
v-model:visible="visible"
@ok="success">
-
-
+
+
否
是
-
-
+
+
+
{
-
+
diff --git a/src/pages/merchant/components/AddMaterial.vue b/src/pages/merchant/components/AddMaterial.vue
index 6b5cf15..bdabbb1 100644
--- a/src/pages/merchant/components/AddMaterial.vue
+++ b/src/pages/merchant/components/AddMaterial.vue
@@ -1,18 +1,24 @@
@@ -44,7 +75,7 @@ const success = async () => {
v-model:visible="visible"
title="添加素材">
-
已添加5个素材(长摁图片可拖动排序)
+
已添加{{ targetList.length }}个素材(长摁图片可拖动排序)
{
+ 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
+});
diff --git a/src/pages/merchant/components/ViewMaterial.vue b/src/pages/merchant/components/ViewMaterial.vue
new file mode 100644
index 0000000..566256f
--- /dev/null
+++ b/src/pages/merchant/components/ViewMaterial.vue
@@ -0,0 +1,54 @@
+
+
+
+
+ 添加素材
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/merchant/pages/my-wallet/components/Recharge.vue b/src/pages/merchant/pages/my-wallet/components/Recharge.vue
index 2b53579..16bbfc9 100644
--- a/src/pages/merchant/pages/my-wallet/components/Recharge.vue
+++ b/src/pages/merchant/pages/my-wallet/components/Recharge.vue
@@ -1,6 +1,6 @@
@@ -63,16 +86,17 @@ const {loading, pagination} = useTableQuery({
pagination.current = e"
- :pagination="pagination">
+ :pagination="false">
-
+
diff --git a/src/pages/merchant/pages/task-center/reward-mission.vue b/src/pages/merchant/pages/task-center/reward-mission.vue
index 25e1421..37fa725 100644
--- a/src/pages/merchant/pages/task-center/reward-mission.vue
+++ b/src/pages/merchant/pages/task-center/reward-mission.vue
@@ -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();
+}
@@ -150,7 +182,8 @@ const {loading, pagination, initFetchData} = useTableQuery({
@@ -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('审核未通过')">
查看子任务
- 终止
+
+ 终止
+
diff --git a/src/utils/index.js b/src/utils/index.js
index bf7f77d..7a2fbd7 100644
--- a/src/utils/index.js
+++ b/src/utils/index.js
@@ -21,3 +21,18 @@ export const baseImage = (url) => {
if (!url) url = '';
return url.startsWith('http') ? url : import.meta.env.VITE_API_URL + url;
}
+
+export const determineMediaType = (url) => {
+ const imageExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.bmp', '.svg'];
+ const videoExtensions = ['.mp4', '.mov', '.avi', '.mkv', '.webm'];
+
+ const extension = url.substring(url.lastIndexOf('.')).toLowerCase();
+
+ if (imageExtensions.includes(extension)) {
+ return 'Image';
+ } else if (videoExtensions.includes(extension)) {
+ return 'Video';
+ } else {
+ return 'Unknown';
+ }
+}