f
This commit is contained in:
@@ -27,6 +27,7 @@ const productConfig = ref(null)
|
|||||||
const fullLink = ref('')
|
const fullLink = ref('')
|
||||||
const featureData = ref({})
|
const featureData = ref({})
|
||||||
const showQRcode = ref(false)
|
const showQRcode = ref(false)
|
||||||
|
const showExampleQrPopup = ref(false)
|
||||||
|
|
||||||
const logoMap = {
|
const logoMap = {
|
||||||
riskassessment: '/static/promote/personal_data_logo.png',
|
riskassessment: '/static/promote/personal_data_logo.png',
|
||||||
@@ -192,7 +193,11 @@ function onUpdateShowQRcode(v) {
|
|||||||
|
|
||||||
function toExample() {
|
function toExample() {
|
||||||
if (!currentFeature.value) return
|
if (!currentFeature.value) return
|
||||||
uni.showToast({ title: '示例报告功能敬请期待', icon: 'none' })
|
showExampleQrPopup.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
function closeExampleQrPopup() {
|
||||||
|
showExampleQrPopup.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
@@ -291,6 +296,29 @@ onMounted(() => {
|
|||||||
@change="onPriceChange"
|
@change="onPriceChange"
|
||||||
/>
|
/>
|
||||||
<QRcode :show="showQRcode" :full-link="fullLink" @update:show="onUpdateShowQRcode" />
|
<QRcode :show="showQRcode" :full-link="fullLink" @update:show="onUpdateShowQRcode" />
|
||||||
|
|
||||||
|
<view
|
||||||
|
v-if="showExampleQrPopup"
|
||||||
|
class="fixed inset-0 z-50 flex items-center justify-center bg-black/50"
|
||||||
|
@click.self="closeExampleQrPopup"
|
||||||
|
>
|
||||||
|
<view class="mx-4 rounded-2xl bg-white p-6 shadow-xl" @click.stop>
|
||||||
|
<view class="text-center text-lg font-bold text-gray-800 mb-2">示例报告</view>
|
||||||
|
<view class="text-center text-sm text-gray-500 mb-4">请长按识别下方二维码查看示例</view>
|
||||||
|
<image
|
||||||
|
src="/static/me/official_qrcode.jpg"
|
||||||
|
class="w-56 h-56 mx-auto block rounded-lg bg-gray-100"
|
||||||
|
mode="aspectFit"
|
||||||
|
show-menu-by-longpress
|
||||||
|
/>
|
||||||
|
<button
|
||||||
|
class="mt-4 w-full rounded-full py-2.5 text-base font-medium text-white bg-blue-500"
|
||||||
|
@click="closeExampleQrPopup"
|
||||||
|
>
|
||||||
|
关闭
|
||||||
|
</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
|
import path from 'node:path'
|
||||||
import { fileURLToPath, URL } from 'node:url'
|
import { fileURLToPath, URL } from 'node:url'
|
||||||
|
|
||||||
import { defineConfig, loadEnv } from 'vite'
|
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 Components from '@uni-helper/vite-plugin-uni-components'
|
||||||
import { WotResolver } from '@uni-helper/vite-plugin-uni-components/resolvers'
|
import { WotResolver } from '@uni-helper/vite-plugin-uni-components/resolvers'
|
||||||
import { ZPagingResolver } 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'
|
import UnoCSS from 'unocss/vite'
|
||||||
|
|
||||||
export default defineConfig(({ mode }) => {
|
export default defineConfig(({ mode }) => {
|
||||||
// 加载环境变量(.env / .env.development / .env.production)
|
// 加载环境变量(.env / .env.development / .env.production;.env.local 会覆盖同名字段)
|
||||||
const env = loadEnv(mode, process.cwd(), '')
|
const env = loadEnv(mode, projectRoot, '')
|
||||||
const apiUrl = env.VITE_API_URL || ''
|
const apiUrl = env.VITE_API_URL || ''
|
||||||
const apiPrefix = env.VITE_API_PREFIX || '/api'
|
const apiPrefix = env.VITE_API_PREFIX || '/api'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user