From 8df649c8ee0c4e853187adf7a8cebbf3028d9185 Mon Sep 17 00:00:00 2001 From: yyx <15348303523@163.com> Date: Fri, 11 Jul 2025 19:04:16 +0800 Subject: [PATCH] =?UTF-8?q?h5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/task/add.vue | 34 ++++++++++++++++------- src/views/task/index.vue | 52 +++++++++++++++++++++++++----------- src/views/user/index.vue | 1 + src/views/user/mass_send.vue | 31 +++++++++++++++++---- vite.config.js | 2 +- 5 files changed, 89 insertions(+), 31 deletions(-) diff --git a/src/views/task/add.vue b/src/views/task/add.vue index 790b032..b03ac80 100644 --- a/src/views/task/add.vue +++ b/src/views/task/add.vue @@ -52,7 +52,7 @@ { router.back() } @@ -107,17 +108,20 @@ const onConfirm = ({ selectedOptions }) => { form.template = selectedOptions[0]?.text; form.temp_id = selectedOptions[0]?.value; showPicker.value = false; - let template = template_info.find(item => item.id == selectedOptions[0]?.value) + let template = template_info?.find(item => item?.id == selectedOptions[0]?.value) console.log(template); - let group_id = JSON.parse(template?.group_ids) - form.times = template?.times + '小时1次' - form.cycle = template?.cycle + '天' - form.price = template?.price - let filter_groups = group_id.map(id => { - return group_info.find(item => item.id == id).tg_name + '@' + group_info.find(item => item.id == id).tg_url - }) - form.group = filter_groups.join(','); + if (template) { + let group_id = template?.group_ids ? JSON.parse(template?.group_ids) : [] + form.times = template?.times + '小时1次' + form.cycle = template?.cycle + '天' + form.price = template?.price + let filter_groups = group_id.map(id => { + return group_info.find(item => item.id == id).tg_name + '@' + group_info.find(item => item.id == id).tg_url + }) + form.group = filter_groups.join(','); + } + }; const onTypeConfirm = ({ selectedOptions }) => { @@ -227,6 +231,13 @@ onBeforeMount(async () => { form.next_run_time = current_task_info.next_run_time form.tg_title = current_task_info.tg_title isEdit.value = true + isView.value = current_task_info.type == 'view' + if (current_task_info.type == 'view') { + task_title.value = '查看任务' + } + if (current_task_info.type == 'edit') { + task_title.value = '编辑任务' + } } }) @@ -244,6 +255,9 @@ const handleConfrimPay = (val = '', type) => { const closePay = () => { router.push('/h5') } +const goBack = () => { + router.push('/h5') +} onMounted(() => { }) diff --git a/src/views/task/index.vue b/src/views/task/index.vue index ec276e8..6a9d7c9 100644 --- a/src/views/task/index.vue +++ b/src/views/task/index.vue @@ -4,6 +4,7 @@
+
任务ID:{{ item.id }}
任务名称:{{ item.title }}
模板名称:{{ item.temp_name }}
模板类型:{{ item.temp_type === 1 ? '预设模板' : '定制模板' }}
@@ -44,23 +45,32 @@ {{order_status?.find(o => o.value == item.order_status)?.label}}
-
- 编辑 - 支付 - 执行 - 暂停 - 删除 +
+
+ 群发记录 +
+
+ 查看 + 编辑 + 支付 + 执行 + 暂停 + 删除 +
+
@@ -180,9 +190,10 @@ const goPage = (url) => { console.log('goPage', url) window.open(url) } -const addTask = (row = '') => { +const addTask = (row = '', type = '') => { console.log('addTask', row) if (row.id) { + row.type = type localStorage.setItem('current_task_info', JSON.stringify(row)) } else { localStorage.removeItem('current_task_info') @@ -249,6 +260,12 @@ const deleteTask = (id) => { }); } +const viewRecord = (row) => { + localStorage.setItem('current_task_id', row.id) + router.push({ + path: '/h5/mass_send', + }) +}