From 78922a5b9174ece6e97b72da5f3253ec24147d97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=BF=97=E9=B9=8F?= <2916022834@qq.com> Date: Mon, 27 Apr 2026 11:35:09 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=A4=B4=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/seller/index.ts | 5 +- src/tool/https.js | 1 + .../BrandProfile/image-clip.vue | 632 +++++++++--------- .../SellerDashboard/BrandProfile/index.vue | 38 +- 4 files changed, 341 insertions(+), 335 deletions(-) diff --git a/src/store/seller/index.ts b/src/store/seller/index.ts index 3ca93278..a72b3227 100644 --- a/src/store/seller/index.ts +++ b/src/store/seller/index.ts @@ -49,8 +49,11 @@ const seller: Module = { }, set_designerInfo(state: Seller, value: DesignerInfo) { state.designerInfo = { + ...state.designerInfo, ...value, - socialLinks: JSON.parse(value.socialLinks) + } + if (value.socialLinks) { + state.designerInfo.socialLinks = JSON.parse(value.socialLinks) } }, }, diff --git a/src/tool/https.js b/src/tool/https.js index 3c734e5a..ac775971 100644 --- a/src/tool/https.js +++ b/src/tool/https.js @@ -474,6 +474,7 @@ export const Https = { // 卖家端接口 + sellerUploadFile: '/seller/file/upload', // 卖家上传文件 checkSellerDesigner: '/seller/designer/check', // 检查卖家是否为设计师 getSellerApplyStatus: '/seller/designer/apply/status', // 获取卖家申请状态 submitSellerApply: '/seller/designer/apply', // 提交卖家申请 diff --git a/src/views/SellerDashboard/BrandProfile/image-clip.vue b/src/views/SellerDashboard/BrandProfile/image-clip.vue index f0009b42..572eb218 100644 --- a/src/views/SellerDashboard/BrandProfile/image-clip.vue +++ b/src/views/SellerDashboard/BrandProfile/image-clip.vue @@ -7,7 +7,7 @@ crossOrigin="Anonymous" :autoCrop="true" :fixedNumber="ratio" - :fixed="type !== 'apparel' && isProduct" + :fixed="type !== 'apparel'" movable centerBox :fixedBox="fixedBox" @@ -36,361 +36,345 @@ diff --git a/src/views/SellerDashboard/BrandProfile/index.vue b/src/views/SellerDashboard/BrandProfile/index.vue index aed75777..3fbaf999 100644 --- a/src/views/SellerDashboard/BrandProfile/index.vue +++ b/src/views/SellerDashboard/BrandProfile/index.vue @@ -69,13 +69,25 @@ input.click() } + const uploadFile = async (file) => { + const formData = new FormData() + formData.append("file", file) + return Https.axiosPost(Https.httpUrls.sellerUploadFile, formData, { + headers: { + "Content-Type": "multipart/form-data" + } + }) + } + const onChangeBanner = () => { uploadImg(({ url }) => { imageClipDialogRef.value.open( url, - (file) => { - // banner.value = URL.createObjectURL(file) - console.log(URL.createObjectURL(file)) + async (file) => { + store.commit("set_loading", true) + const res = await uploadFile(file) + onSubmit({ brandBanner: res }) + store.commit("set_loading", false) }, { ratio: [40, 7], isPreview: false, title: "Crop Brand Banner" } ) @@ -85,9 +97,11 @@ uploadImg(({ url }) => { imageClipDialogRef.value.open( url, - (file) => { - // avatar.value = URL.createObjectURL(file) - console.log(URL.createObjectURL(file)) + async (file) => { + store.commit("set_loading", true) + const res = await uploadFile(file) + onSubmit({ avatar: res }) + store.commit("set_loading", false) }, { ratio: [1, 1], isPreview: true, title: "Crop Avatar" } ) @@ -99,12 +113,16 @@ const onCancel = () => { isEdit.value = false } - const onSubmit = async () => { - const res = await brandInfoRef.value.submit() + const onSubmit = async (value = null) => { + const res = value ? value : await brandInfoRef.value.submit() const data = { ...designerInfo.value, - ...res, - socialLinks: JSON.stringify(res.socialLinks) + ...res + } + try { + data.socialLinks = JSON.stringify(data.socialLinks) + } catch (error) { + data.socialLinks = JSON.stringify([]) } Https.axiosPut(Https.httpUrls.updateDesignerInfo, data).then((res) => { isEdit.value = false From 9dc25ddcedd24899edeb0150856f77f5d6b6b319 Mon Sep 17 00:00:00 2001 From: "X1627315083@163.com" <1627315083@qq.com> Date: Mon, 27 Apr 2026 11:41:14 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=95=86=E5=93=81?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=92=8C=E6=9B=B4=E6=96=B0=E5=95=86=E5=93=81?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tool/https.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tool/https.js b/src/tool/https.js index ac775971..f88c16ca 100644 --- a/src/tool/https.js +++ b/src/tool/https.js @@ -484,7 +484,8 @@ export const Https = { getSellerOrderList: '/seller/order/page', // 获取卖家订单列表 getListingPopup: '/seller/listing/popup/check', // 获取是否勾选发布作品提示 setListingPopup: '/seller/listing/popup/set', // 设置是否勾选发布作品提示 - + getListingList: '/seller/listing/page', // 获取商品列表,发布和未发布 + putListingStatus: '/seller/listing/status', // 更新商品状态 }, axiosGet(url, config, pathParams) { From f77a2f2e01d8d99d77ecc264ab190861b1e10d5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=BF=97=E9=B9=8F?= <2916022834@qq.com> Date: Mon, 27 Apr 2026 13:17:45 +0800 Subject: [PATCH 3/3] 1 --- .../SellerDashboard/BrandProfile/index.vue | 6 +- src/views/SellerDashboard/MyOrders/index.vue | 61 +++++++++++-------- src/views/SellerDashboard/index.vue | 2 +- 3 files changed, 42 insertions(+), 27 deletions(-) diff --git a/src/views/SellerDashboard/BrandProfile/index.vue b/src/views/SellerDashboard/BrandProfile/index.vue index 3fbaf999..cfc73960 100644 --- a/src/views/SellerDashboard/BrandProfile/index.vue +++ b/src/views/SellerDashboard/BrandProfile/index.vue @@ -25,8 +25,8 @@ -
no data
+
+ +