From 3063ecb1f2d1a05f968e9b1bd7d15065b2f9d3ab Mon Sep 17 00:00:00 2001 From: Mrx <18278715334@163.com> Date: Wed, 6 May 2026 16:42:58 +0800 Subject: [PATCH] f --- src/pages.json | 2 +- src/pages/promote/report.vue | 30 +++++++++++++++++++++++++++++- vite.config.js | 8 ++++++-- 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/src/pages.json b/src/pages.json index b5eba8b..d5a14ef 100644 --- a/src/pages.json +++ b/src/pages.json @@ -255,4 +255,4 @@ } ] } -} +} \ No newline at end of file diff --git a/src/pages/promote/report.vue b/src/pages/promote/report.vue index bcc55fa..7e5dac2 100644 --- a/src/pages/promote/report.vue +++ b/src/pages/promote/report.vue @@ -27,6 +27,7 @@ const productConfig = ref(null) const fullLink = ref('') const featureData = ref({}) const showQRcode = ref(false) +const showExampleQrPopup = ref(false) const logoMap = { riskassessment: '/static/promote/personal_data_logo.png', @@ -192,7 +193,11 @@ function onUpdateShowQRcode(v) { function toExample() { if (!currentFeature.value) return - uni.showToast({ title: '示例报告功能敬请期待', icon: 'none' }) + showExampleQrPopup.value = true +} + +function closeExampleQrPopup() { + showExampleQrPopup.value = false } onLoad((options) => { @@ -291,6 +296,29 @@ onMounted(() => { @change="onPriceChange" /> + + + + 示例报告 + 请长按识别下方二维码查看示例 + + + + diff --git a/vite.config.js b/vite.config.js index 7f36c85..906dee8 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,6 +1,10 @@ +import path from 'node:path' import { fileURLToPath, URL } from 'node:url' import { defineConfig, loadEnv } from 'vite' + +// 用配置文件所在目录作为项目根,避免从 monorepo 根目录执行命令时 loadEnv 读不到子项目 .env +const projectRoot = path.dirname(fileURLToPath(new URL(import.meta.url))) import Components from '@uni-helper/vite-plugin-uni-components' import { WotResolver } from '@uni-helper/vite-plugin-uni-components/resolvers' import { ZPagingResolver } from '@uni-helper/vite-plugin-uni-components/resolvers' @@ -14,8 +18,8 @@ import Uni from '@uni-helper/plugin-uni' import UnoCSS from 'unocss/vite' export default defineConfig(({ mode }) => { - // 加载环境变量(.env / .env.development / .env.production) - const env = loadEnv(mode, process.cwd(), '') + // 加载环境变量(.env / .env.development / .env.production;.env.local 会覆盖同名字段) + const env = loadEnv(mode, projectRoot, '') const apiUrl = env.VITE_API_URL || '' const apiPrefix = env.VITE_API_PREFIX || '/api'