From db95ed1a90a92d88b29eb9c92368b3ca9a446e3f Mon Sep 17 00:00:00 2001 From: wuKong Date: Mon, 29 Dec 2025 18:11:10 +0800 Subject: [PATCH] =?UTF-8?q?feat(promotion):=20=E6=B7=BB=E5=8A=A0=E8=A3=85?= =?UTF-8?q?=E4=BF=AE=E6=A8=A1=E6=9D=BF=E7=B1=BB=E5=9E=8B=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 为 getUsedDiyTemplate 方法添加 type 参数 - 在平台模块中新增 uniPlatform 属性获取 - 重构装修模板适配逻辑以支持平台类型区分 - 更新请求参数传递方式以包含平台类型信息 --- sheep/api/promotion/diy.js | 5 ++++- sheep/platform/index.js | 6 +++++- sheep/store/app.js | 3 ++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/sheep/api/promotion/diy.js b/sheep/api/promotion/diy.js index e524f69b..f7dd2f11 100644 --- a/sheep/api/promotion/diy.js +++ b/sheep/api/promotion/diy.js @@ -1,10 +1,13 @@ import request from '@/sheep/request'; const DiyApi = { - getUsedDiyTemplate: () => { + getUsedDiyTemplate: (type) => { return request({ url: '/promotion/diy-template/used', method: 'GET', + params: { + type + }, custom: { showError: false, showLoading: false, diff --git a/sheep/platform/index.js b/sheep/platform/index.js index bae2b68e..5c01d8fd 100644 --- a/sheep/platform/index.js +++ b/sheep/platform/index.js @@ -23,6 +23,9 @@ const device = uni.getWindowInfo(); const os = uni.getDeviceInfo().platform; +const uniSystemInfo= uni.getSystemInfoSync(); +const uniPlatform = uniSystemInfo?.uniPlatform ?? 'default'; + let name = ''; let provider = ''; let platform = ''; @@ -54,7 +57,7 @@ platform = 'miniProgram'; provider = 'wechat'; // #endif -// #ifdef MP-ALIPAY +// #ifdef MP-ALIPAY name = 'alipayMiniProgram'; platform = 'alipayMiniProgram'; provider = 'alipay'; @@ -177,6 +180,7 @@ const _platform = { os, provider, platform, + uniPlatform, useProvider, checkUpdate, checkNetwork, diff --git a/sheep/store/app.js b/sheep/store/app.js index efd06876..b1a826c0 100644 --- a/sheep/store/app.js +++ b/sheep/store/app.js @@ -182,10 +182,11 @@ const adaptTenant = async () => { /** 初始化装修模版 */ const adaptTemplate = async (appTemplate, templateId) => { + let type = $platform.uniPlatform; const { data: diyTemplate } = templateId ? // 查询指定模板,一般是预览时使用 await DiyApi.getDiyTemplate(templateId) - : await DiyApi.getUsedDiyTemplate(); + : await DiyApi.getUsedDiyTemplate(type); // 模板不存在 if (!diyTemplate) { $router.error('TemplateError');