From 575ccb2cfa49a25fb403fd20cb09589145f84c40 Mon Sep 17 00:00:00 2001 From: Zuncle <34310384@qq.com> Date: Tue, 21 Apr 2026 02:08:24 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=9B=92=E6=9F=9C=E6=8E=A5=E5=85=A5?= =?UTF-8?q?=E8=BF=90=E8=B4=B9=E6=A0=A1=E9=AA=8C=E5=B9=B6=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E4=B8=80=E9=94=AE=E5=90=88=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 本次提交同步补齐小程序端对后端新能力的接入,既支持碎片一键合成,也支持盒柜发货前按商品分类动态判断是否必须支付运费。 - 合成页:新增一键合成入口,展示最大可合成次数,并将单次合成与批量合成交互拆分为更清晰的双按钮布局 - 盒柜页:碎片合成区同步支持批量合成,合成成功后同时刷新配方列表与背包数据 - 运费流程:发货前先调用后端运费检查接口,根据“件数不足”或“包含不包邮商品”展示不同确认文案,再决定是否创建运费订单 - API 封装:补充批量合成与运费检查接口,确保前端逻辑与后端规则保持一致 --- api/appUser.js | 4 + api/synthesis.js | 4 + pages-user/synthesis/index.vue | 145 +++++++++++++++++++------ pages/cabinet/index.vue | 186 ++++++++++++++++++++++++--------- 4 files changed, 257 insertions(+), 82 deletions(-) diff --git a/api/appUser.js b/api/appUser.js index e9f7715..b8525dd 100755 --- a/api/appUser.js +++ b/api/appUser.js @@ -154,6 +154,10 @@ export function requestShipping(user_id, ids, address_id) { return authRequest({ url: `/api/app/users/${user_id}/inventory/request-shipping`, method: 'POST', data }) } +export function checkShippingFee(user_id, ids) { + return authRequest({ url: `/api/app/users/${user_id}/inventory/shipping-fee/check`, method: 'POST', data: { inventory_ids: ids } }) +} + export function createShippingFeeOrder(user_id, ids) { return authRequest({ url: `/api/app/users/${user_id}/inventory/shipping-fee/preorder`, method: 'POST', data: { inventory_ids: ids } }) } diff --git a/api/synthesis.js b/api/synthesis.js index 0ba3f93..f6e08c2 100644 --- a/api/synthesis.js +++ b/api/synthesis.js @@ -8,6 +8,10 @@ export function doSynthesis(userId, recipeId) { return authRequest({ url: `/api/app/users/${userId}/synthesis/do`, method: 'POST', data: { recipe_id: recipeId } }) } +export function doBatchSynthesis(userId, recipeId) { + return authRequest({ url: `/api/app/users/${userId}/synthesis/do-batch`, method: 'POST', data: { recipe_id: recipeId } }) +} + export function getSynthesisLogs(userId, page = 1, pageSize = 20) { return authRequest({ url: `/api/app/users/${userId}/synthesis/logs`, method: 'GET', data: { page, page_size: pageSize } }) } diff --git a/pages-user/synthesis/index.vue b/pages-user/synthesis/index.vue index ba2062e..448655d 100644 --- a/pages-user/synthesis/index.vue +++ b/pages-user/synthesis/index.vue @@ -93,16 +93,30 @@ - - {{ getReadyCount(recipe) }}/{{ recipe.materials?.length || 0 }} 材料就绪 - - - {{ synthesizing ? '合成中' : (recipe.can_synthesize ? '合成' : '不足') }} - + + + {{ getReadyCount(recipe) }}/{{ recipe.materials?.length || 0 }} 材料就绪 + + + 最多可合成 {{ getMaxSynthesizeCount(recipe) }} 次 + + + + + {{ synthesizing ? '合成中' : (recipe.can_synthesize ? '单次合成' : '不足') }} + + + {{ batchSynthesizing ? '批量中' : (getMaxSynthesizeCount(recipe) > 0 ? '一键合成' : '不足') }} + + @@ -115,10 +129,11 @@