diff --git a/sheep/api/promotion/diy.js b/sheep/api/promotion/diy.js index f7dd2f11..9a26ffb2 100644 --- a/sheep/api/promotion/diy.js +++ b/sheep/api/promotion/diy.js @@ -1,12 +1,12 @@ import request from '@/sheep/request'; const DiyApi = { - getUsedDiyTemplate: (type) => { + getUsedDiyTemplate: (platform) => { return request({ url: '/promotion/diy-template/used', method: 'GET', params: { - type + platform }, custom: { showError: false, diff --git a/sheep/platform/index.js b/sheep/platform/index.js index 5c01d8fd..079b6d0d 100644 --- a/sheep/platform/index.js +++ b/sheep/platform/index.js @@ -24,7 +24,7 @@ const device = uni.getWindowInfo(); const os = uni.getDeviceInfo().platform; const uniSystemInfo= uni.getSystemInfoSync(); -const uniPlatform = uniSystemInfo?.uniPlatform ?? 'default'; +const uniPlatform = uniSystemInfo?.uniPlatform ?? ''; let name = ''; let provider = ''; diff --git a/sheep/store/app.js b/sheep/store/app.js index f05e9ba7..9e986a8b 100644 --- a/sheep/store/app.js +++ b/sheep/store/app.js @@ -182,10 +182,15 @@ const adaptTenant = async () => { /** 初始化装修模版 */ const adaptTemplate = async (appTemplate, templateId) => { + let platform = $platform.uniPlatform; + // 如果需要其他自定义业务场景 + // #ifdef MP + // platform = 'mp'; + // #endif const { data: diyTemplate } = templateId ? // 查询指定模板,一般是预览时使用 await DiyApi.getDiyTemplate(templateId) - : await DiyApi.getUsedDiyTemplate($platform.uniPlatform); + : await DiyApi.getUsedDiyTemplate(platform); // 模板不存在 if (!diyTemplate) { $router.error('TemplateError');