From b2c6c61515da8f1a711855e39b2015f30bdcdd13 Mon Sep 17 00:00:00 2001 From: zhangyahui Date: Thu, 7 May 2026 15:53:47 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=20=E5=B0=81=E9=9D=A2=E5=BF=85=E5=A1=AB?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyListings/EditDetail/index.vue | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/views/SellerDashboard/MyListings/EditDetail/index.vue b/src/views/SellerDashboard/MyListings/EditDetail/index.vue index 569001bf..a76419a8 100644 --- a/src/views/SellerDashboard/MyListings/EditDetail/index.vue +++ b/src/views/SellerDashboard/MyListings/EditDetail/index.vue @@ -205,7 +205,9 @@ const videoImageCategories = ["firstFrame", "gif", "video"] as const type VideoImageCategory = (typeof videoImageCategories)[number] - const isVideoImageCategory = (category: ListingDetailImage["category"]): category is VideoImageCategory => + const isVideoImageCategory = ( + category: ListingDetailImage["category"] + ): category is VideoImageCategory => videoImageCategories.includes(category as VideoImageCategory) const normalizeDetailGender = (value: ListingDetailResponse["designFor"]) => { @@ -365,7 +367,7 @@ if (willSelect && listing.firstSelectedIndex === null) { if (target.isVideo) { - message.warning("The first selected item is the main product image. Videos cannot be used.") + message.warning(t("Seller.VideoWarning")) return } listing.mainProductImage = target.url @@ -392,7 +394,11 @@ } const cropType = ref("") - const handleClickCrop = (data: string | null, type: CropType, paramThree: number | unknown[] = []) => { + const handleClickCrop = ( + data: string | null, + type: CropType, + paramThree: number | unknown[] = [] + ) => { // 处理来自TopImageSection的调用: (data, type, list) // 处理来自ApparelSketchList的调用: (data, type, index) const index = typeof paramThree === "number" ? paramThree : undefined @@ -441,10 +447,9 @@ value !== null && value !== undefined && String(value).trim() !== "" const getMissingRequiredField = (item: ListingItem) => { - const cover = item.cover || item.mainProductImage || item.sketch const requiredFields = [ { value: item.sketch, label: t("SellerListEdit.sketch") }, - { value: cover, label: t("SellerListEdit.cover") }, + { value: item.cover, label: t("SellerListEdit.cover") }, { value: item.productName, label: t("SellerListEdit.productName") }, { value: item.price, label: t("SellerListEdit.price") }, { value: item.desc, label: t("SellerListEdit.productDescription") }, @@ -565,7 +570,12 @@ videoSortOrder += 1 const isSelected = Number(!!media.selected) - pushImage("firstFrame", media.firstFrameUrl || media.url, isSelected, videoSortOrder) + pushImage( + "firstFrame", + media.firstFrameUrl || media.url, + isSelected, + videoSortOrder + ) pushImage("gif", media.gifUrl || "", isSelected, videoSortOrder) pushImage("video", media.videoUrl || "", isSelected, videoSortOrder) }) @@ -589,16 +599,10 @@ await fetchUpdateListing(paramsList) } const handleClickMenu = async (status: StatusType) => { - if (status === "draft" && !selectList.value[currentIndex.value].cover) { - message.error("请先完成封面制作") - return - } if (!validatePublishRequired()) return await handleSaveForm(status) if (status === "draft") { - // save draft logic - // console.log("Saving draft...", currentListing.value) ROUTER.push({ name: "Status", params: { status: "draft" }, @@ -608,8 +612,6 @@ } }) } else if (status === "publish") { - // publish logic - // console.log("Publishing...", currentListing.value) ROUTER.push({ name: "Status", params: { status: "publish" },