UI: 预览环境显示构建时间 + 售价默认299
Some checks failed
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 5s
Test / build-check (push) Successful in 4s
PR Preview / test (pull_request) Successful in 6s
PR Preview / deploy-preview (pull_request) Successful in 9s
Test / e2e-test (push) Has been cancelled

- 预览栏显示部署时间(如 04/11 10:05)
- 售价默认299
- vite构建时注入__BUILD_TIME__

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-11 09:56:16 +00:00
parent b7315219c7
commit d3e3b89701
3 changed files with 10 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
<template> <template>
<div v-if="isPreview" style="background:#e65100;color:white;text-align:center;padding:6px 16px;font-size:13px;font-weight:600;letter-spacing:0.5px;position:sticky;top:0;z-index:100"> <div v-if="isPreview" style="background:#e65100;color:white;text-align:center;padding:6px 16px;font-size:13px;font-weight:600;letter-spacing:0.5px;position:sticky;top:0;z-index:100">
预览环境 · PR #{{ prId }} · 数据为生产副本修改不影响正式环境 预览环境 · PR #{{ prId }} · 数据为生产副本修改不影响正式环境 · {{ buildInfo }}
</div> </div>
<div class="app-header"> <div class="app-header">
<div class="header-inner"> <div class="header-inner">
@@ -116,6 +116,7 @@ const hostname = window.location.hostname
const prMatch = hostname.match(/^pr-(\d+)\./) const prMatch = hostname.match(/^pr-(\d+)\./)
const isPreview = !!prMatch const isPreview = !!prMatch
const prId = prMatch ? prMatch[1] : '' const prId = prMatch ? prMatch[1] : ''
const buildInfo = __BUILD_TIME__ || ''
function handleTabClick(tab) { function handleTabClick(tab) {
if (tab.require === 'login' && !auth.isLoggedIn) { if (tab.require === 'login' && !auth.isLoggedIn) {

View File

@@ -304,7 +304,7 @@ function selectDemoProject() {
packaging_cost: p.packaging_cost || 0, packaging_cost: p.packaging_cost || 0,
labor_cost: p.labor_cost || 0, labor_cost: p.labor_cost || 0,
other_cost: p.other_cost || 0, other_cost: p.other_cost || 0,
selling_price: p.selling_price || 0, selling_price: p.selling_price || 299,
quantity: p.quantity || 1, quantity: p.quantity || 1,
notes: p.notes || '', notes: p.notes || '',
} }
@@ -330,7 +330,7 @@ async function createProject() {
packaging_cost: 0, packaging_cost: 0,
labor_cost: 0, labor_cost: 0,
other_cost: 0, other_cost: 0,
selling_price: 0, selling_price: 299,
quantity: 1, quantity: 1,
notes: '', notes: '',
}), }),
@@ -357,7 +357,7 @@ function selectProject(p) {
packaging_cost: p.packaging_cost || 0, packaging_cost: p.packaging_cost || 0,
labor_cost: p.labor_cost || 0, labor_cost: p.labor_cost || 0,
other_cost: p.other_cost || 0, other_cost: p.other_cost || 0,
selling_price: p.selling_price || 0, selling_price: p.selling_price || 299,
quantity: p.quantity || 1, quantity: p.quantity || 1,
notes: p.notes || '', notes: p.notes || '',
} }

View File

@@ -1,7 +1,12 @@
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue' import vue from '@vitejs/plugin-vue'
const buildTime = new Date().toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit' })
export default defineConfig({ export default defineConfig({
define: {
__BUILD_TIME__: JSON.stringify(buildTime),
},
plugins: [vue()], plugins: [vue()],
server: { server: {
proxy: { proxy: {