-
@@ -847,10 +947,12 @@ import {
deleteSystemOtherConfig,
clearBrandLogo,
clearPaymentReceiveQr,
+ getBrandCopy,
getBrandLogo,
getPaymentReceiveQr,
getSystemOtherConfigDetail,
getSystemOtherConfigList,
+ saveBrandCopy,
updateSystemOtherConfig,
uploadBrandLogo,
uploadPaymentReceiveQr,
@@ -862,7 +964,12 @@ import {
brandLogoImages,
clearCachedBrandImage,
rememberBrandImageFile,
+ refreshBrandImages,
} from '@/utils/brandLogo'
+import {
+ DEFAULT_BRAND_COPY,
+ rememberBrandCopy,
+} from '@/utils/brandCopy'
import {
formatWechatTrialResultText,
getOrderNotifySystemSmtp,
@@ -873,6 +980,7 @@ import {
type OrderNotifySystemSmtpStatus,
type WechatOrderNotifyTemplateDto,
} from '@/api/system/wechatOrderNotify'
+import { streamFileBlob } from '@/api/fileStorage'
import { resolveOmsAssetUrl } from '@/api/oms/common'
import { prodApiOrigin } from '@/utils/rewriteBrowserApiPath'
@@ -1382,6 +1490,7 @@ async function openPaymentQrModal() {
}
const brandLogoVisible = ref(false)
+const brandLogoTab = ref<'copy' | 'images'>('copy')
const brandLogoLoading = ref(false)
const brandLogoUrls = reactive({
portal: '',
@@ -1407,34 +1516,92 @@ const brandLogoLocalPreview = reactive
>({
favicon: '',
mascot: '',
})
+const brandCopySaving = ref(false)
+const brandCopyForm = reactive({
+ navName: DEFAULT_BRAND_COPY.navName,
+ navFullName: DEFAULT_BRAND_COPY.navFullName,
+ aiWelcomeTitleZh: DEFAULT_BRAND_COPY.aiWelcomeTitleZh,
+ aiWelcomeTitleShortZh: DEFAULT_BRAND_COPY.aiWelcomeTitleShortZh,
+ aiWelcomeTitleEn: DEFAULT_BRAND_COPY.aiWelcomeTitleEn,
+ aiWelcomeTitleShortEn: DEFAULT_BRAND_COPY.aiWelcomeTitleShortEn,
+})
+
+function applyBrandCopyDto(data?: Record | null) {
+ const next = rememberBrandCopy(data)
+ brandCopyForm.navName = next.navName
+ brandCopyForm.navFullName = next.navFullName
+ brandCopyForm.aiWelcomeTitleZh = next.aiWelcomeTitleZh
+ brandCopyForm.aiWelcomeTitleShortZh = next.aiWelcomeTitleShortZh
+ brandCopyForm.aiWelcomeTitleEn = next.aiWelcomeTitleEn
+ brandCopyForm.aiWelcomeTitleShortEn = next.aiWelcomeTitleShortEn
+}
+
+async function loadBrandCopy() {
+ try {
+ const data = await getBrandCopy()
+ applyBrandCopyDto(data as Record)
+ } catch {
+ applyBrandCopyDto(DEFAULT_BRAND_COPY)
+ }
+}
+
+async function handleBrandCopySave() {
+ brandCopySaving.value = true
+ try {
+ const data = await saveBrandCopy({
+ navName: brandCopyForm.navName,
+ navFullName: brandCopyForm.navFullName,
+ aiWelcomeTitleZh: brandCopyForm.aiWelcomeTitleZh,
+ aiWelcomeTitleShortZh: brandCopyForm.aiWelcomeTitleShortZh,
+ aiWelcomeTitleEn: brandCopyForm.aiWelcomeTitleEn,
+ aiWelcomeTitleShortEn: brandCopyForm.aiWelcomeTitleShortEn,
+ })
+ applyBrandCopyDto(data as Record)
+ Message.success(t('system.otherConfig.brandLogo.copy.saveSuccess'))
+ } catch (e: any) {
+ Message.error(e?.message || t('system.otherConfig.brandLogo.copy.saveFailed'))
+ } finally {
+ brandCopySaving.value = false
+ }
+}
+
+function pickBrandLogoCardUrl(channel: BrandLogoChannel) {
+ // 优先本地上传预览 / 已落地 data URL,避免线上直连 cos.* 证书 CN 不匹配
+ return (
+ brandLogoLocalPreview[channel] ||
+ brandLogoImages[channel] ||
+ brandLogoUrls[channel] ||
+ ''
+ )
+}
const brandLogoCards = computed(() => [
{
channel: 'portal' as BrandLogoChannel,
title: t('system.otherConfig.brandLogo.portal'),
sizeHint: t('system.otherConfig.brandLogo.size.portal'),
- url: brandLogoLocalPreview.portal || brandLogoUrls.portal,
+ url: pickBrandLogoCardUrl('portal'),
uploading: brandLogoUploading.portal,
},
{
channel: 'site' as BrandLogoChannel,
title: t('system.otherConfig.brandLogo.site'),
sizeHint: t('system.otherConfig.brandLogo.size.site'),
- url: brandLogoLocalPreview.site || brandLogoUrls.site,
+ url: pickBrandLogoCardUrl('site'),
uploading: brandLogoUploading.site,
},
{
channel: 'favicon' as BrandLogoChannel,
title: t('system.otherConfig.brandLogo.favicon'),
sizeHint: t('system.otherConfig.brandLogo.size.favicon'),
- url: brandLogoLocalPreview.favicon || brandLogoUrls.favicon,
+ url: pickBrandLogoCardUrl('favicon'),
uploading: brandLogoUploading.favicon,
},
{
channel: 'mascot' as BrandLogoChannel,
title: t('system.otherConfig.brandLogo.mascot'),
sizeHint: t('system.otherConfig.brandLogo.size.mascot'),
- url: brandLogoLocalPreview.mascot || brandLogoUrls.mascot,
+ url: pickBrandLogoCardUrl('mascot'),
uploading: brandLogoUploading.mascot,
},
])
@@ -1444,11 +1611,14 @@ function pickBrandLogoUrl(data: Record | null | undefined, camel: s
return typeof raw === 'string' ? raw : ''
}
-/** 已签名 COS/OSS URL 勿再追加缓存戳,否则验签失败图片空白 */
+/** 同源 file URL 已带 v=;COS 签名 URL 勿再追加缓存戳 */
function resolveBrandLogoDisplayUrl(raw?: string | null) {
const url = resolveOmsAssetUrl(raw)
if (!url) return ''
- if (/[?&](q-sign-algorithm|x-oss-signature|Signature)=/i.test(url)) {
+ if (
+ /[?&](q-sign-algorithm|x-oss-signature|Signature|v)=/i.test(url) ||
+ /\/system\/other-config\/(brand-logo|payment-qr)\/file\b/i.test(url)
+ ) {
return url
}
return `${url}${url.includes('?') ? '&' : '?'}_t=${Date.now()}`
@@ -1471,11 +1641,44 @@ function applyBrandLogoDto(data?: {
brandLogoUrls.mascot = resolveBrandLogoDisplayUrl(pickBrandLogoUrl(row, 'mascotUrl', 'MascotUrl'))
}
+function isCosBrandAssetUrl(url: string): boolean {
+ try {
+ const host = new URL(url).hostname.toLowerCase()
+ return host.startsWith('cos.') || host.includes('myqcloud.com')
+ } catch {
+ return false
+ }
+}
+
+/** 线上 cos 自定义域证书异常时,经 stream 落成本地 blob 预览,避免
直连报错 */
+async function hydrateBrandLogoSafePreviews() {
+ const channels: BrandLogoChannel[] = ['portal', 'site', 'favicon', 'mascot']
+ await Promise.all(
+ channels.map(async (channel) => {
+ if (brandLogoLocalPreview[channel]?.startsWith('blob:')) return
+ if (brandLogoImages[channel]?.startsWith('data:')) return
+ const remote = brandLogoUrls[channel]
+ if (!remote || !isCosBrandAssetUrl(remote)) return
+ try {
+ const blob = await streamFileBlob(remote)
+ if (!blob.type.startsWith('image/') && blob.size <= 0) return
+ const prev = brandLogoLocalPreview[channel]
+ if (prev.startsWith('blob:')) URL.revokeObjectURL(prev)
+ brandLogoLocalPreview[channel] = URL.createObjectURL(blob)
+ } catch {
+ /* 保留远程地址;全局 refreshBrandImages 仍会尝试 data URL */
+ }
+ }),
+ )
+}
+
async function loadBrandLogo() {
brandLogoLoading.value = true
try {
- const data = await getBrandLogo()
- applyBrandLogoDto(data)
+ const [logoData] = await Promise.all([getBrandLogo(), loadBrandCopy()])
+ applyBrandLogoDto(logoData)
+ void refreshBrandImages()
+ await hydrateBrandLogoSafePreviews()
} catch (e: any) {
Message.error(e?.message || t('system.otherConfig.brandLogo.loadFailed'))
} finally {
@@ -1484,6 +1687,7 @@ async function loadBrandLogo() {
}
async function openBrandLogoModal() {
+ brandLogoTab.value = 'copy'
brandLogoVisible.value = true
await loadBrandLogo()
}
@@ -2378,20 +2582,86 @@ onMounted(() => {
min-height: 220px;
}
+.brand-logo-editor {
+ display: flex;
+ flex-direction: column;
+ min-height: 0;
+}
+
+.brand-config-tabs {
+ :deep(.arco-tabs-nav) {
+ margin-bottom: 12px;
+ }
+
+ :deep(.arco-tabs-content) {
+ padding-top: 0;
+ }
+
+ :deep(.arco-tabs-content-item) {
+ padding: 0;
+ }
+}
+
+.brand-copy-pane {
+ display: flex;
+ flex-direction: column;
+ gap: 12px;
+}
+
+.brand-copy-block {
+ padding: 12px;
+ border: 1px solid var(--color-border-2);
+ border-radius: 8px;
+ background: var(--color-fill-1, #f7f8fa);
+}
+
+.brand-copy-block__head {
+ display: flex;
+ align-items: baseline;
+ flex-wrap: wrap;
+ gap: 8px;
+ margin-bottom: 10px;
+
+ strong {
+ font-size: 13px;
+ font-weight: 600;
+ color: var(--color-text-1);
+ }
+
+ span {
+ font-size: 12px;
+ color: var(--color-text-3);
+ }
+}
+
+.brand-copy-item {
+ margin-bottom: 10px;
+
+ :deep(.arco-form-item-label-col > label) {
+ font-size: 12px;
+ }
+}
+
+.brand-copy-actions {
+ display: flex;
+ justify-content: flex-end;
+ padding-top: 4px;
+}
+
.brand-logo-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
- gap: 16px;
+ gap: 12px;
}
.brand-logo-card {
display: flex;
flex-direction: column;
- gap: 12px;
+ gap: 8px;
min-width: 0;
- padding: 16px;
+ padding: 12px;
border: 1px solid var(--color-border-2);
- border-radius: 10px;
+ border-radius: 8px;
background: #fff;
}
@@ -2452,10 +2722,10 @@ onMounted(() => {
flex-direction: column;
align-items: center;
justify-content: center;
- gap: 8px;
+ gap: 6px;
width: 100%;
- min-height: 148px;
- padding: 16px;
+ min-height: 112px;
+ padding: 12px;
border: 1px dashed var(--color-border-3, #c9cdd4);
border-radius: 8px;
background: var(--color-fill-1, #f7f8fa);
@@ -2978,6 +3248,13 @@ onMounted(() => {
padding-bottom: 16px;
}
+:deep(.brand-config-modal .arco-modal-body) {
+ padding-top: 12px;
+ padding-bottom: 16px;
+ max-height: min(72vh, 640px);
+ overflow: auto;
+}
+
@media (max-width: 720px) {
.wechat-notify-layout {
grid-template-columns: 1fr;
diff --git a/src/views/user/invoice/index.vue b/src/views/user/invoice/index.vue
new file mode 100644
index 0000000..7c8a8a2
--- /dev/null
+++ b/src/views/user/invoice/index.vue
@@ -0,0 +1,977 @@
+
+
+
+
+
+
+
+
+
+ {{ p.titleName }}{{ p.isDefault ? ` (${t('finance.invoiceManage.profile.default')})` : '' }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ t('finance.invoiceManage.type.normal') }}
+
+
+ {{ t('finance.invoiceManage.type.special') }}
+
+
+
+
+
+
+
+
+ {{ t('finance.invoiceManage.medium.electronic') }}
+
+
+ {{ t('finance.invoiceManage.medium.paper') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ t('finance.invoiceManage.selectable.empty') }}
+
+
+
+
+ {{ t('finance.invoiceManage.drawer.selectedAmount') }}
+ ¥{{ formatMoney(selectedTotal) }}
+
+
+
+
+
+
+
+
+ {{ detail.applyNo }}
+
+
+ {{ detail.statusName || detail.status }}
+
+
+ {{ detail.titleName }}
+
+
+ ¥{{ formatMoney(detail.amountTotal) }}
+
+
+ {{ detail.invoiceNumber || '--' }}
+
+
+ {{ t('finance.invoiceManage.detail.lines') }}
+
+
+
+
+ ¥{{ formatMoney(record.amount) }}
+
+
+
+
+
+
+
+
+
+
+ {{ t('finance.invoiceManage.profile.empty') }}
+
+
+
+
{{ p.titleName }}
+
+ {{ t('finance.invoiceManage.profile.default') }}
+
+
{{ p.taxNo }}
+
+
+
+ {{ t('common.edit') }}
+
+
+ {{ t('finance.invoiceManage.profile.setDefault') }}
+
+
+ {{ t('common.delete') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ t('finance.invoiceManage.profile.isDefault') }}
+
+
+
+
+
+
+
+
+
+
+
+
+