From e890f87ea274436461aacca1391bb9717240f210 Mon Sep 17 00:00:00 2001 From: zxl <763096477@qq.com> Date: 星期四, 04 九月 2025 14:21:39 +0800 Subject: [PATCH] 商家端订单列表 --- manager/src/views/activity/index.vue | 96 ++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 81 insertions(+), 15 deletions(-) diff --git a/manager/src/views/activity/index.vue b/manager/src/views/activity/index.vue index b19956a..fafe6a6 100644 --- a/manager/src/views/activity/index.vue +++ b/manager/src/views/activity/index.vue @@ -528,6 +528,7 @@ <div class="activity-content" v-html="activityInfo.activityContent || '鏃犲唴瀹�'" + ref="鈥渁ctivityHTMLContent" ></div> </div> </Col> @@ -581,16 +582,15 @@ addActivity, editActivity, delActivityById, + delActivityBatch, activityChangeStatus, activityChangeRecommend, activityMembersPage, auditActivity } from "@/api/activity.js" -import Editor from '@/components/editor/index.vue' import { uploadFileByLmk, delByKey } from "@/api/common.js" import { quillEditor } from 'vue-quill-editor' -import Delta from 'quill-delta' import 'quill/dist/quill.core.css'; import 'quill/dist/quill.snow.css'; import 'quill/dist/quill.bubble.css'; @@ -666,7 +666,7 @@ export default { name: "ActivityManagement", - components: {Editor, quillEditor}, + components: { quillEditor}, data() { return { auditForm: { @@ -844,17 +844,39 @@ } }, { - title: '瀹℃牳', + title: '瀹℃牳鐘舵��', key: 'auditStatus', width: 100, align: 'center', render: (h, params) => { + const status = params.row.auditStatus; + let tagText, tagColor; + + // 鏍规嵁鐘舵�佽缃枃妗堝拰棰滆壊 + switch (status) { + case 0: + tagText = '瀹℃牳涓�'; + tagColor = 'orange'; // 姗欒壊琛ㄧず杩涜涓� + break; + case 1: + tagText = '宸查�氳繃'; + tagColor = 'green'; // 缁胯壊琛ㄧず閫氳繃 + break; + case 2: + tagText = '鏈�氳繃'; + tagColor = 'red'; // 绾㈣壊琛ㄧず鎷掔粷 + break; + default: + tagText = '鏈煡鐘舵��'; + tagColor = 'default'; // 榛樿鐏拌壊 + } + return h('Tag', { props: { - color: params.row.auditStatus === 0 ? 'default' : 'green' - } - }, params.row.auditStatus === 0 ? '鏈鏍�' : '宸插鏍�') - } + color: tagColor, + }, + }, tagText); + }, }, { title: '鐘舵��', @@ -875,6 +897,17 @@ color: currentStatus.color } }, currentStatus.text); + } + }, + { + title: '娲诲姩鎶ュ悕鏃堕棿娈�', + key: 'activityReportTimeRange', + width: 300, + render: (h, params) => { + return h('div', [ + h('div', `寮�濮�: ${this.formatDate(params.row.reportStartTime)}`), + h('div', `缁撴潫: ${this.formatDate(params.row.reportEndTime)}`) + ]) } }, { @@ -981,9 +1014,9 @@ render: (h, params) => { return h('Tag', { props: { - color: params.row.disabled ? 'red' : 'green' + color: params.row.disabled ? 'green' : 'red' //true 姝e父 false琚鐢� } - }, params.row.disabled ? '绂佺敤' : '姝e父') + }, params.row.disabled ? '姝e父' : '绂佺敤') } } ], @@ -1051,7 +1084,6 @@ // 澶卞幓鐒︾偣 onEditorBlur(editor) { - }, // 鑾峰緱鐒︾偣 @@ -1100,7 +1132,6 @@ if (fileType === 'video') { - console.log("鎻掑叆") this.Quill.insertEmbed(index, 'video', { url:url, controls:'controls', @@ -1114,9 +1145,11 @@ this.$Message.warning('涓嶆敮鎸佺殑鏂囦欢绫诲瀷'); return; } + console.log(this.activityFrom.activityContent) this.Quill.setSelection(index + 1); - console.log(this.content) this.$Message.success('涓婁紶鎴愬姛') + }else{ + this.$Message.error(res.msg) } }).catch(() => { this.submitLoading = false @@ -1189,6 +1222,8 @@ this.$Message.success(res.msg); this.getActivityList(); this.closeAuditModel(); + }else{ + this.$Message.error(res.msg) } }) } @@ -1217,7 +1252,19 @@ this.infoModelShow = true this.activityInfo = row this.activityInfo.activityContent = this.escapeStringHTML(this.activityInfo.activityContent); + this.$nextTick(() => { + this.processVideos(); + }); + }, + processVideos() { + const videos = this.$el.querySelectorAll('video'); + videos.forEach(video => { + // 纭繚瑙嗛鍏冪礌鏈夊繀瑕佺殑灞炴�� + video.setAttribute('controls', ''); + video.setAttribute('playsinline', ''); // 閽堝绉诲姩绔� + video.load(); + }); }, // 鑾峰彇瀵屾枃鏈紪杈戝櫒鐨勫唴瀹� // 鍒濆鍖栨暟鎹� @@ -1238,6 +1285,8 @@ statusLoading: false })) this.total = res.total + }else{ + this.$Message.error(res.msg) } }).catch(() => { this.loading = false @@ -1347,7 +1396,7 @@ this.activityFrom.coverType = this.coverType === '杈撳叆鏂囧瓧灏侀潰' ? 'text' : this.file ? this.getFileCategory(this.file.type) : this.activityFrom.coverType - //鍒ゆ柇鏂囧瓧绫诲瀷鏈夌偣闂 + this.$refs.form.validate(valid => { if (valid) { this.submitLoading = true @@ -1370,6 +1419,8 @@ this.$Message.success(res.msg) this.modelClose() this.getActivityList() + }else{ + this.$Message.error(res.msg) } }).catch(() => { this.submitLoading = false @@ -1384,10 +1435,14 @@ title: '纭鍒犻櫎', content: `纭畾瑕佸垹闄ゆ椿鍔� "${row.activityName}" 鍚�?`, onOk: () => { + //TODO 鍏堝垽鏂椿鍔ㄦ槸鍚﹀彂甯冿紝鍙戝竷鍒欓渶瑕佸厛涓嬫灦 + delActivityById(row.id).then(res => { if (res.code === 200) { this.$Message.success(res.msg) this.getActivityList() + }else{ + this.$Message.error(res.msg) } }) } @@ -1396,6 +1451,7 @@ // 鎵归噺鍒犻櫎 delBatch() { + //TODO 鍏堝垽鏂椿鍔ㄦ槸鍚﹀彂甯冿紝鍙戝竷鍒欓渶瑕佸厛涓嬫灦 if (this.selectCount === 0) { this.$Message.warning('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�') return @@ -1405,7 +1461,7 @@ title: '纭鍒犻櫎', content: `纭畾瑕佸垹闄ら�変腑鐨� ${this.selectCount} 鏉℃暟鎹悧?`, onOk: () => { - delActivityBatch({ids: this.selectList}).then(res => { + delActivityBatch(this.selectList).then(res => { if (res.code === 200) { this.$Message.success(res.msg) this.selectList = [] @@ -1432,6 +1488,8 @@ if (res.code === 200) { this.$Message.success(res.msg) row.recommend = recommend + }else{ + this.$Message.error(res.msg) } }).catch(() => { row.recommendLoading = false @@ -1457,6 +1515,8 @@ if (res.code === 200) { this.$Message.success(res.msg) row.publish = publish + }else{ + this.$Message.error(res.msg) } }).catch(() => { row.statusLoading = false @@ -1480,6 +1540,8 @@ if (res.code === 200) { this.membersList = res.data this.memberTotal = res.total + }else{ + this.$Message.error(res.msg) } }).catch(() => { this.membersLoading = false @@ -1545,6 +1607,8 @@ if (res.code === 200) { this.activityFrom.cover = res.data.fileKey this.$Message.success('涓婁紶鎴愬姛') + }else{ + this.$Message.error(res.msg) } }).catch(() => { this.submitLoading = false @@ -1565,6 +1629,8 @@ if (res.code === 200) { this.file = null this.activityFrom.cover = '' + }else{ + this.$Message.error(res.msg) } }) }, -- Gitblit v1.8.0