From 2dcd1310974c18a03f0d896789ed883e609b4083 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Thu, 18 Jan 2024 12:47:23 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=E8=B0=83=E6=95=B4=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E5=91=BD=E4=BB=A4=EF=BC=8C=E6=81=A2=E5=A4=8D=20npm=20?= =?UTF-8?q?run=20dev=EF=BC=9B=E5=A6=82=E6=9E=9C=E8=A6=81=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E8=BF=9C=E7=A8=8B=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.local-dev => .env.local | 0 package.json | 6 +++--- .../mall/promotion/combination/combinationRecord.ts | 7 +------ .../record/CombinationRecordListDialog.vue | 11 +---------- src/views/mall/promotion/combination/record/index.vue | 4 +++- 5 files changed, 8 insertions(+), 20 deletions(-) rename .env.local-dev => .env.local (100%) diff --git a/.env.local-dev b/.env.local similarity index 100% rename from .env.local-dev rename to .env.local diff --git a/package.json b/package.json index 5cdca2af..c521cafe 100644 --- a/package.json +++ b/package.json @@ -6,11 +6,11 @@ "private": false, "scripts": { "i": "pnpm install", - "local-dev": "vite --mode local-dev", - "dev": "vite --mode dev", + "dev": "vite --mode local-dev", + "dev-server": "vite --mode dev", "ts:check": "vue-tsc --noEmit", "build:local-dev": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode local-dev", - "build:dev": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode dev", + "build:dev": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode local-dev", "build:test": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode test", "build:stage": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode stage", "build:prod": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode prod", diff --git a/src/api/mall/promotion/combination/combinationRecord.ts b/src/api/mall/promotion/combination/combinationRecord.ts index 90e8937e..b2b7d75f 100644 --- a/src/api/mall/promotion/combination/combinationRecord.ts +++ b/src/api/mall/promotion/combination/combinationRecord.ts @@ -18,15 +18,10 @@ export interface CombinationRecordVO { } // 查询拼团记录列表 -export const getCombinationRecordPage = async (params) => { +export const getCombinationRecordPage = async (params: any) => { return await request.get({ url: '/promotion/combination-record/page', params }) } -// 查询一个拼团的完整拼团记录 -export const getCombinationRecordPageByHeadId = async (params) => { - return await request.get({ url: '/promotion/combination-record/page-by-headId', params }) -} - // 获得拼团记录的概要信息 export const getCombinationRecordSummary = async () => { return await request.get({ url: '/promotion/combination-record/get-summary' }) diff --git a/src/views/mall/promotion/combination/record/CombinationRecordListDialog.vue b/src/views/mall/promotion/combination/record/CombinationRecordListDialog.vue index 2fbde9ea..13e04a13 100644 --- a/src/views/mall/promotion/combination/record/CombinationRecordListDialog.vue +++ b/src/views/mall/promotion/combination/record/CombinationRecordListDialog.vue @@ -53,13 +53,10 @@ import { dateFormatter } from '@/utils/formatTime' import * as CombinationRecordApi from '@/api/mall/promotion/combination/combinationRecord' import { DICT_TYPE } from '@/utils/dict' -import { createImageViewer } from '@/components/ImageViewer' /** 助力列表 */ defineOptions({ name: 'CombinationRecordListDialog' }) -const message = useMessage() // 消息弹窗 - const loading = ref(true) // 列表的加载中 const total = ref(0) // 列表的总页数 const list = ref([]) // 列表的数据 @@ -82,17 +79,11 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗 const getList = async () => { loading.value = true try { - const data = await CombinationRecordApi.getCombinationRecordPageByHeadId(queryParams) + const data = await CombinationRecordApi.getCombinationRecordPage(queryParams) list.value = data.list total.value = data.total } finally { loading.value = false } } -/** 商品图预览 */ -const imagePreview = (imgUrl: string) => { - createImageViewer({ - urlList: [imgUrl] - }) -} diff --git a/src/views/mall/promotion/combination/record/index.vue b/src/views/mall/promotion/combination/record/index.vue index ec06a0b7..8f569a29 100644 --- a/src/views/mall/promotion/combination/record/index.vue +++ b/src/views/mall/promotion/combination/record/index.vue @@ -242,9 +242,11 @@ const getSummary = async () => { recordSummary.value = await CombinationRecordApi.getCombinationRecordSummary() } +/** 查看拼团详情 */ const openRecordListDialog = (row: CombinationRecordApi.CombinationRecordVO) => { - combinationRecordListRef.value?.open(row.headId) + combinationRecordListRef.value?.open(row.headId || row.id) // 多表达式的原因,团长的 headId 为空,就是自身的情况 } + /** 搜索按钮操作 */ const handleQuery = () => { queryParams.value.pageNo = 1