feat: 用独立页面展示存证详情并按天河链版式绘制证书
This commit is contained in:
@@ -61,3 +61,6 @@ AGENT.md
|
|||||||
|
|
||||||
# AI 项目记忆已迁移至 MemRelay,本地导出目录不入库
|
# AI 项目记忆已迁移至 MemRelay,本地导出目录不入库
|
||||||
aidocs/
|
aidocs/
|
||||||
|
|
||||||
|
# 临时分析文件
|
||||||
|
/Temp/
|
||||||
|
|||||||
@@ -31,12 +31,6 @@
|
|||||||
<n-descriptions-item v-if="proof?.onchainAt" :label="t('pages.blockchain.onchainAt')">
|
<n-descriptions-item v-if="proof?.onchainAt" :label="t('pages.blockchain.onchainAt')">
|
||||||
{{ fmt(proof.onchainAt) }}
|
{{ fmt(proof.onchainAt) }}
|
||||||
</n-descriptions-item>
|
</n-descriptions-item>
|
||||||
<n-descriptions-item v-if="proof?.explorerUrl" :label="t('pages.blockchain.explorer')">
|
|
||||||
<a :href="proof.explorerUrl" target="_blank" rel="noopener" class="proof-link">
|
|
||||||
{{ t('pages.blockchain.openExplorer') }}
|
|
||||||
<n-icon :component="OpenOutline" />
|
|
||||||
</a>
|
|
||||||
</n-descriptions-item>
|
|
||||||
<n-descriptions-item v-if="failureReason" :label="t('pages.operations.resultReason')">
|
<n-descriptions-item v-if="failureReason" :label="t('pages.operations.resultReason')">
|
||||||
<n-text type="error">{{ failureReason }}</n-text>
|
<n-text type="error">{{ failureReason }}</n-text>
|
||||||
</n-descriptions-item>
|
</n-descriptions-item>
|
||||||
@@ -96,7 +90,7 @@
|
|||||||
import { computed, defineComponent, h, ref, watch } from 'vue';
|
import { computed, defineComponent, h, ref, watch } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { NButton, NIcon } from 'naive-ui';
|
import { NButton, NIcon } from 'naive-ui';
|
||||||
import { CopyOutline, OpenOutline } from '@vicons/ionicons5';
|
import { CopyOutline } from '@vicons/ionicons5';
|
||||||
import { onchainApi, traceCodeApi } from '@/api';
|
import { onchainApi, traceCodeApi } from '@/api';
|
||||||
import { useAuthStore } from '@/stores/auth';
|
import { useAuthStore } from '@/stores/auth';
|
||||||
import { fmt, statusType } from '@/utils/format';
|
import { fmt, statusType } from '@/utils/format';
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ function fixture(state = 'PENDING') {
|
|||||||
const prisma = {
|
const prisma = {
|
||||||
blockchainProof: {
|
blockchainProof: {
|
||||||
updateMany: jest.fn().mockResolvedValue({ count: 1 }),
|
updateMany: jest.fn().mockResolvedValue({ count: 1 }),
|
||||||
|
update: jest.fn().mockResolvedValue(row),
|
||||||
findUniqueOrThrow: jest.fn().mockResolvedValue(row),
|
findUniqueOrThrow: jest.fn().mockResolvedValue(row),
|
||||||
},
|
},
|
||||||
traceCode: { findUnique: jest.fn().mockResolvedValue({ shortCode: '123456000001', status: 'ACTIVE', artwork: { title: '测试作品', archiveNo: 'ARTVERIS-000001', status: 'ACTIVE', auditStatus: 'APPROVED' }, proofs: [row] }) },
|
traceCode: { findUnique: jest.fn().mockResolvedValue({ shortCode: '123456000001', status: 'ACTIVE', artwork: { title: '测试作品', archiveNo: 'ARTVERIS-000001', status: 'ACTIVE', auditStatus: 'APPROVED' }, proofs: [row] }) },
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ export class DepositCertificateService {
|
|||||||
return {
|
return {
|
||||||
status: proof.certificateState === 'READY' && !certificate ? 'FAILED' : proof.certificateState,
|
status: proof.certificateState === 'READY' && !certificate ? 'FAILED' : proof.certificateState,
|
||||||
generatedAt: proof.certificateGeneratedAt,
|
generatedAt: proof.certificateGeneratedAt,
|
||||||
certificate,
|
certificate: certificate && request ? { ...certificate, environment: request.environment } : certificate,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ export interface StoredCertificateView {
|
|||||||
txHash: string;
|
txHash: string;
|
||||||
author: string;
|
author: string;
|
||||||
createdAt: string | null;
|
createdAt: string | null;
|
||||||
|
imageUrl?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 公开页面只接收存证字段。天河链证书网址留在服务端,不进入浏览器。 */
|
/** 公开页面只接收存证字段。天河链证书网址留在服务端,不进入浏览器。 */
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
import { parseChainDetail } from './chain-detail';
|
||||||
|
|
||||||
|
const info = {
|
||||||
|
data: {
|
||||||
|
gasTxUsed: '3388899',
|
||||||
|
fromAddress: '0x85aa7cdeba55cb08427018d066a26719b956ceff',
|
||||||
|
toAddress: '0x8c7df15858ee7c2f51ce74899a6d097ed163443f',
|
||||||
|
timeStamp: 1786261526886,
|
||||||
|
blockHeight: 39944998,
|
||||||
|
inputDataBin: '0xsecret',
|
||||||
|
inputDataDetail: { method: 'mint(address to, string author, string productId, string feature, string initPrice)', methodId: '0xa40d1b10' },
|
||||||
|
inputInfo: [{ name: 'author', type: 'string', data: '黄志伟' }],
|
||||||
|
transactionDetail: [{ fromAddress: '0x0000000000000000000000000000000000000000', toAddress: '0xae3ecbac36b5874b0372686e5b88894c22be4296', contractAddress: '0x8c7df15858ee7c2f51ce74899a6d097ed163443f', tokenId: '3051' }],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
const receipt = {
|
||||||
|
data: [{ logInfo: { address: '0x8c7df15858ee7c2f51ce74899a6d097ed163443f', name: 'Transfer(address from, address to, uint256 tokenId)', data: '0x', topics: ['0xabc'] } }],
|
||||||
|
};
|
||||||
|
|
||||||
|
describe('parseChainDetail', () => {
|
||||||
|
it('keeps gas, sender and logs and drops the raw input binary', () => {
|
||||||
|
const detail = parseChainDetail(info, receipt);
|
||||||
|
expect(detail?.gasUsed).toBe('3388899');
|
||||||
|
expect(detail?.fromAddress).toBe('0x85aa7cdeba55cb08427018d066a26719b956ceff');
|
||||||
|
expect(detail?.logs).toHaveLength(1);
|
||||||
|
expect(detail?.action?.tokenId).toBe('3051');
|
||||||
|
expect(JSON.stringify(detail)).not.toContain('secret');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('stays empty when gas, sender or logs are missing', () => {
|
||||||
|
expect(parseChainDetail({ data: { gasTxUsed: '', fromAddress: info.data.fromAddress } }, receipt)).toBeNull();
|
||||||
|
expect(parseChainDetail(info, { data: [] })).toBeNull();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,109 @@
|
|||||||
|
export interface ChainInputField {
|
||||||
|
name: string;
|
||||||
|
type: string;
|
||||||
|
data: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ChainLogView {
|
||||||
|
address: string;
|
||||||
|
name: string;
|
||||||
|
data: string;
|
||||||
|
topics: string[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ChainDetail {
|
||||||
|
gasUsed: string;
|
||||||
|
fromAddress: string;
|
||||||
|
toAddress: string;
|
||||||
|
timeStamp: string | null;
|
||||||
|
blockHeight: string | null;
|
||||||
|
method: string;
|
||||||
|
methodId: string;
|
||||||
|
inputs: ChainInputField[];
|
||||||
|
logs: ChainLogView[];
|
||||||
|
action: { fromAddress: string; toAddress: string; contractAddress: string; tokenId: string } | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const ADDRESS = /^0x[0-9a-fA-F]{40}$/;
|
||||||
|
|
||||||
|
function text(value: unknown): string {
|
||||||
|
return typeof value === 'string' ? value.trim() : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
export function readStoredChainDetail(raw: unknown): ChainDetail | null {
|
||||||
|
if (!raw || typeof raw !== 'object' || Array.isArray(raw)) return null;
|
||||||
|
const detail = (raw as { chainDetail?: unknown }).chainDetail;
|
||||||
|
if (!detail || typeof detail !== 'object' || Array.isArray(detail)) return null;
|
||||||
|
const row = detail as ChainDetail;
|
||||||
|
if (!row.gasUsed || !ADDRESS.test(row.fromAddress || '') || !Array.isArray(row.logs) || !row.logs.length) return null;
|
||||||
|
return row;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function parseChainDetail(info: unknown, receipt: unknown): ChainDetail | null {
|
||||||
|
const data = info && typeof info === 'object' ? (info as { data?: unknown }).data : null;
|
||||||
|
if (!data || typeof data !== 'object') return null;
|
||||||
|
const row = data as Record<string, unknown>;
|
||||||
|
const gasUsed = text(row.gasTxUsed);
|
||||||
|
const fromAddress = text(row.fromAddress);
|
||||||
|
const logs = Array.isArray(receipt && typeof receipt === 'object' ? (receipt as { data?: unknown }).data : null)
|
||||||
|
? ((receipt as { data: unknown[] }).data)
|
||||||
|
.map((item) => (item && typeof item === 'object' ? (item as { logInfo?: unknown }).logInfo : null))
|
||||||
|
.filter((item): item is Record<string, unknown> => Boolean(item && typeof item === 'object'))
|
||||||
|
.map((item) => ({
|
||||||
|
address: text(item.address),
|
||||||
|
name: text(item.name),
|
||||||
|
data: text(item.data) || '0x',
|
||||||
|
topics: Array.isArray(item.topics) ? item.topics.filter((topic): topic is string => typeof topic === 'string') : [],
|
||||||
|
}))
|
||||||
|
.filter((item) => item.address && item.name && item.topics.length)
|
||||||
|
: [];
|
||||||
|
if (!gasUsed || !ADDRESS.test(fromAddress) || !logs.length) return null;
|
||||||
|
const method = row.inputDataDetail && typeof row.inputDataDetail === 'object'
|
||||||
|
? row.inputDataDetail as { method?: unknown; methodId?: unknown }
|
||||||
|
: {};
|
||||||
|
const action = Array.isArray(row.transactionDetail) ? row.transactionDetail[0] as Record<string, unknown> | undefined : undefined;
|
||||||
|
return {
|
||||||
|
gasUsed,
|
||||||
|
fromAddress,
|
||||||
|
toAddress: text(row.toAddress),
|
||||||
|
timeStamp: row.timeStamp == null ? null : String(row.timeStamp),
|
||||||
|
blockHeight: row.blockHeight == null ? null : String(row.blockHeight),
|
||||||
|
method: text(method.method),
|
||||||
|
methodId: text(method.methodId),
|
||||||
|
inputs: Array.isArray(row.inputInfo)
|
||||||
|
? row.inputInfo.filter((item): item is Record<string, unknown> => Boolean(item && typeof item === 'object')).map((item) => ({
|
||||||
|
name: text(item.name),
|
||||||
|
type: text(item.type),
|
||||||
|
data: text(item.data),
|
||||||
|
}))
|
||||||
|
: [],
|
||||||
|
logs,
|
||||||
|
action: action ? {
|
||||||
|
fromAddress: text(action.fromAddress),
|
||||||
|
toAddress: text(action.toAddress),
|
||||||
|
contractAddress: text(action.contractAddress),
|
||||||
|
tokenId: text(action.tokenId),
|
||||||
|
} : null,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function explorerApiBase(environment: string): string {
|
||||||
|
const host = environment === 'production' ? 'https://explorer.tianhecloud.com' : 'https://test.explorer.tianhecloud.com';
|
||||||
|
return `${host}/api/tichain-browser-new`;
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function loadChainDetail(environment: string, txHash: string, blockHeight: string | null, getter: (url: string) => Promise<unknown> = defaultGet): Promise<ChainDetail | null> {
|
||||||
|
const base = explorerApiBase(environment);
|
||||||
|
const info = await getter(`${base}/transaction/info?txHash=${encodeURIComponent(txHash)}`);
|
||||||
|
const infoData = info && typeof info === 'object' ? (info as { data?: { blockHeight?: unknown } }).data : null;
|
||||||
|
const height = blockHeight || (infoData?.blockHeight == null ? '' : String(infoData.blockHeight));
|
||||||
|
if (!height) return null;
|
||||||
|
const receipt = await getter(`${base}/receipt/info?hash=${encodeURIComponent(txHash)}&height=${encodeURIComponent(height)}`);
|
||||||
|
return parseChainDetail(info, receipt);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function defaultGet(url: string): Promise<unknown> {
|
||||||
|
const response = await fetch(url, { redirect: 'error', signal: AbortSignal.timeout(15_000) });
|
||||||
|
if (!response.ok) return null;
|
||||||
|
return response.json();
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Controller, Get, Param, Query, Req, Res } from '@nestjs/common';
|
import { Controller, Get, Param, Post, Query, Req, Res } from '@nestjs/common';
|
||||||
import { Request, Response } from 'express';
|
import { Request, Response } from 'express';
|
||||||
import { ApiOperation, ApiTags } from '@nestjs/swagger';
|
import { ApiOperation, ApiTags } from '@nestjs/swagger';
|
||||||
import { Throttle } from '@nestjs/throttler';
|
import { Throttle } from '@nestjs/throttler';
|
||||||
@@ -39,6 +39,14 @@ export class PublicTraceController {
|
|||||||
private readonly config: ConfigService,
|
private readonly config: ConfigService,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
@Public()
|
||||||
|
@Post('public/trace/:shortCode/chain-detail')
|
||||||
|
@Throttle({ default: { limit: 10, ttl: 60_000 } })
|
||||||
|
@ApiOperation({ summary: '首次补存交易详情;已存档后只读本地' })
|
||||||
|
chainDetail(@Param('shortCode') shortCode: string) {
|
||||||
|
return this.service.captureChainDetail(shortCode);
|
||||||
|
}
|
||||||
|
|
||||||
@Public()
|
@Public()
|
||||||
@Get('public/trace/:shortCode')
|
@Get('public/trace/:shortCode')
|
||||||
// 公开溯源软限流:每 IP 每分钟 60 次,抑制脚本刷量污染防伪统计与日志
|
// 公开溯源软限流:每 IP 每分钟 60 次,抑制脚本刷量污染防伪统计与日志
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import { SettingsService } from '../settings/settings.service';
|
|||||||
import { REDIS_CLIENT } from '../redis/redis.module';
|
import { REDIS_CLIENT } from '../redis/redis.module';
|
||||||
import { parseUserAgent } from '../common/utils/ua.util';
|
import { parseUserAgent } from '../common/utils/ua.util';
|
||||||
import { readMintView } from './public-mint-view';
|
import { readMintView } from './public-mint-view';
|
||||||
|
import { loadChainDetail, readStoredChainDetail } from './chain-detail';
|
||||||
|
|
||||||
type TraceCodeWithRel = Prisma.TraceCodeGetPayload<{ include: { batch: true; artwork: true } }>;
|
type TraceCodeWithRel = Prisma.TraceCodeGetPayload<{ include: { batch: true; artwork: true } }>;
|
||||||
type ArtworkWithRel = Prisma.ArtworkGetPayload<{
|
type ArtworkWithRel = Prisma.ArtworkGetPayload<{
|
||||||
@@ -422,6 +423,7 @@ export class PublicTraceService {
|
|||||||
productId: mint?.productId ?? code.shortCode,
|
productId: mint?.productId ?? code.shortCode,
|
||||||
feature: mint?.feature ?? null,
|
feature: mint?.feature ?? null,
|
||||||
mintTo: mint?.mintTo ?? null,
|
mintTo: mint?.mintTo ?? null,
|
||||||
|
chainDetail: readStoredChainDetail(proof.rawResponse),
|
||||||
submittedAt: proof.submittedAt,
|
submittedAt: proof.submittedAt,
|
||||||
failureReason: this.publicFailureReason(proof.status, proof.failureReason),
|
failureReason: this.publicFailureReason(proof.status, proof.failureReason),
|
||||||
}
|
}
|
||||||
@@ -429,6 +431,37 @@ export class PublicTraceService {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private readonly chainDetailJobs = new Map<string, Promise<{ complete: boolean; detail: unknown }>>();
|
||||||
|
|
||||||
|
async captureChainDetail(shortCode: string) {
|
||||||
|
const current = this.chainDetailJobs.get(shortCode);
|
||||||
|
if (current) return current;
|
||||||
|
const job = this.captureChainDetailOnce(shortCode).finally(() => this.chainDetailJobs.delete(shortCode));
|
||||||
|
this.chainDetailJobs.set(shortCode, job);
|
||||||
|
return job;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async captureChainDetailOnce(shortCode: string) {
|
||||||
|
if (!TRACE_CODE_PATTERN.test(shortCode)) return { complete: false, detail: null };
|
||||||
|
const code = await this.prisma.traceCode.findUnique({ where: { shortCode }, select: { id: true } });
|
||||||
|
if (!code) return { complete: false, detail: null };
|
||||||
|
const proof = await this.prisma.blockchainProof.findUnique({ where: { traceCodeId: code.id } });
|
||||||
|
const stored = readStoredChainDetail(proof?.rawResponse);
|
||||||
|
if (stored) return { complete: true, detail: stored };
|
||||||
|
if (!proof?.txHash || proof.chainName !== '天河链') return { complete: false, detail: null };
|
||||||
|
const environment = await this.settings.get('tianheEnv');
|
||||||
|
const detail = await loadChainDetail(environment || 'test', proof.txHash, proof.blockHeight == null ? null : proof.blockHeight.toString());
|
||||||
|
if (!detail) return { complete: false, detail: null };
|
||||||
|
const current = proof.rawResponse && typeof proof.rawResponse === 'object' && !Array.isArray(proof.rawResponse)
|
||||||
|
? proof.rawResponse as Record<string, unknown>
|
||||||
|
: {};
|
||||||
|
await this.prisma.blockchainProof.update({
|
||||||
|
where: { id: proof.id },
|
||||||
|
data: { rawResponse: { ...current, chainDetail: detail } as unknown as Prisma.InputJsonValue },
|
||||||
|
});
|
||||||
|
return { complete: true, detail };
|
||||||
|
}
|
||||||
|
|
||||||
private async mintRecipient(proof: { chainName: string | null } | null): Promise<string | null> {
|
private async mintRecipient(proof: { chainName: string | null } | null): Promise<string | null> {
|
||||||
if (proof?.chainName !== '天河链') return null;
|
if (proof?.chainName !== '天河链') return null;
|
||||||
const value = await this.settings.get('tianheWalletAddress');
|
const value = await this.settings.get('tianheWalletAddress');
|
||||||
|
|||||||
@@ -14,7 +14,9 @@
|
|||||||
"@artveris/shared": "workspace:*",
|
"@artveris/shared": "workspace:*",
|
||||||
"axios": "^1.7.9",
|
"axios": "^1.7.9",
|
||||||
"dayjs": "^1.11.13",
|
"dayjs": "^1.11.13",
|
||||||
|
"html2canvas": "^1.4.1",
|
||||||
"photoswipe": "^5.4.4",
|
"photoswipe": "^5.4.4",
|
||||||
|
"qrcode": "^1.5.4",
|
||||||
"vue": "^3.5.13",
|
"vue": "^3.5.13",
|
||||||
"vue-i18n": "^9.14.2",
|
"vue-i18n": "^9.14.2",
|
||||||
"vue-router": "^4.5.0"
|
"vue-router": "^4.5.0"
|
||||||
|
|||||||
+23
-1
@@ -50,6 +50,28 @@ export interface TraceCertificateRecord {
|
|||||||
txHash: string;
|
txHash: string;
|
||||||
author: string;
|
author: string;
|
||||||
createdAt: string | null;
|
createdAt: string | null;
|
||||||
|
environment?: 'test' | 'production';
|
||||||
|
}
|
||||||
|
export interface ChainDetailLog {
|
||||||
|
address: string;
|
||||||
|
name: string;
|
||||||
|
data: string;
|
||||||
|
topics: string[];
|
||||||
|
}
|
||||||
|
export interface ChainDetail {
|
||||||
|
gasUsed: string;
|
||||||
|
fromAddress: string;
|
||||||
|
toAddress: string;
|
||||||
|
timeStamp: string | null;
|
||||||
|
blockHeight: string | null;
|
||||||
|
method: string;
|
||||||
|
methodId: string;
|
||||||
|
inputs: Array<{ name: string; type: string; data: string }>;
|
||||||
|
logs: ChainDetailLog[];
|
||||||
|
action: { fromAddress: string; toAddress: string; contractAddress: string; tokenId: string } | null;
|
||||||
|
}
|
||||||
|
export function fetchChainDetail(shortCode: string): Promise<{ complete: boolean; detail: ChainDetail | null }> {
|
||||||
|
return instance.post(`/public/trace/${encodeURIComponent(shortCode)}/chain-detail`, {}, { timeout: 30_000 }) as unknown as Promise<{ complete: boolean; detail: ChainDetail | null }>;
|
||||||
}
|
}
|
||||||
export interface TraceCertificateResult {
|
export interface TraceCertificateResult {
|
||||||
status: 'NONE' | 'PENDING' | 'SUBMITTING' | 'CHECKING' | 'WAITING' | 'READY' | 'UNKNOWN' | 'FAILED';
|
status: 'NONE' | 'PENDING' | 'SUBMITTING' | 'CHECKING' | 'WAITING' | 'READY' | 'UNKNOWN' | 'FAILED';
|
||||||
@@ -57,7 +79,7 @@ export interface TraceCertificateResult {
|
|||||||
certificate: TraceCertificateRecord | null;
|
certificate: TraceCertificateRecord | null;
|
||||||
}
|
}
|
||||||
export function requestTraceCertificate(shortCode: string): Promise<TraceCertificateResult> {
|
export function requestTraceCertificate(shortCode: string): Promise<TraceCertificateResult> {
|
||||||
return instance.post(`/public/trace/${encodeURIComponent(shortCode)}/certificate`, {}) as unknown as Promise<TraceCertificateResult>;
|
return instance.post(`/public/trace/${encodeURIComponent(shortCode)}/certificate`, {}, { timeout: 90_000 }) as unknown as Promise<TraceCertificateResult>;
|
||||||
}
|
}
|
||||||
export function fetchTraceCertificate(shortCode: string): Promise<TraceCertificateResult> {
|
export function fetchTraceCertificate(shortCode: string): Promise<TraceCertificateResult> {
|
||||||
return instance.get(`/public/trace/${encodeURIComponent(shortCode)}/certificate`) as unknown as Promise<TraceCertificateResult>;
|
return instance.get(`/public/trace/${encodeURIComponent(shortCode)}/certificate`) as unknown as Promise<TraceCertificateResult>;
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 43 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 548 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
@@ -58,8 +58,8 @@
|
|||||||
<span class="chain-v">{{ formatTime(blockchain.onchainAt) }}</span>
|
<span class="chain-v">{{ formatTime(blockchain.onchainAt) }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="chain-actions">
|
<div class="chain-actions">
|
||||||
<button v-if="blockchain.txHash" class="chain-link" @click="openProof">{{ t('chain.explorer') }}</button>
|
<button v-if="blockchain.txHash" class="chain-link" type="button" @click="openProof">{{ t('chain.explorer') }}</button>
|
||||||
<button ref="certificateButton" v-if="canViewCertificate" class="chain-link certificate-link" :disabled="opening || preview" @click="viewCertificate">
|
<button v-if="canViewCertificate" class="chain-link certificate-link" type="button" :disabled="preview" @click="openCertificate">
|
||||||
{{ t('chain.certificateView') }}
|
{{ t('chain.certificateView') }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -67,56 +67,12 @@
|
|||||||
</template>
|
</template>
|
||||||
<div v-else class="chain-empty muted">{{ t('chain.notOnchain') }}</div>
|
<div v-else class="chain-empty muted">{{ t('chain.notOnchain') }}</div>
|
||||||
</section>
|
</section>
|
||||||
<Teleport to="body">
|
|
||||||
<dialog ref="proofDialog" class="tx-dialog" aria-labelledby="proof-dialog-title" @cancel.prevent="closeProof">
|
|
||||||
<h3 id="proof-dialog-title" class="sr-only">{{ t('chain.proofTitle') }}</h3>
|
|
||||||
<trace-tx-detail
|
|
||||||
:tx-hash="blockchain?.txHash"
|
|
||||||
:succeeded="status === 'ONCHAIN'"
|
|
||||||
:status-text="t(`chain.statuses.${status}`)"
|
|
||||||
:block-height="blockchain?.blockHeight"
|
|
||||||
:contract-address="blockchain?.contractAddress"
|
|
||||||
:onchain-at="blockchain?.onchainAt"
|
|
||||||
:token-id="blockchain?.tokenId"
|
|
||||||
:author="blockchain?.author"
|
|
||||||
:product-id="blockchain?.productId || shortCode"
|
|
||||||
:feature="blockchain?.feature"
|
|
||||||
:mint-to="blockchain?.mintTo"
|
|
||||||
@copy="(value) => $emit('copy', value)"
|
|
||||||
@close="closeProof"
|
|
||||||
/>
|
|
||||||
</dialog>
|
|
||||||
<dialog ref="certificateDialog" class="certificate-dialog" aria-labelledby="certificate-dialog-title" @cancel.prevent="closeCertificateDialog">
|
|
||||||
<button class="certificate-close" :aria-label="t('viewer.close')" @click="closeCertificateDialog">×</button>
|
|
||||||
<h3 id="certificate-dialog-title">{{ t('chain.certificateView') }}</h3>
|
|
||||||
<div v-if="!certificateError && !certificateRecord" class="certificate-spinner" aria-hidden="true" />
|
|
||||||
<div class="sheet-body" aria-live="polite">
|
|
||||||
<p v-if="certificateError" role="alert">{{ certificateError }}</p>
|
|
||||||
<div v-else-if="certificateRecord" class="certificate-sheet">
|
|
||||||
<div v-for="row in certificateRows" :key="row.label" class="sheet-row">
|
|
||||||
<span>{{ row.label }}</span>
|
|
||||||
<strong>{{ row.value }}</strong>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<ol v-else class="certificate-steps">
|
|
||||||
<li v-for="(key, index) in certificateSteps" :key="key" :class="{ current: certificatePhase === index, done: certificatePhase > index }">
|
|
||||||
<span aria-hidden="true">{{ certificatePhase > index ? '✓' : index + 1 }}</span>{{ t(key) }}
|
|
||||||
</li>
|
|
||||||
</ol>
|
|
||||||
</div>
|
|
||||||
<div v-if="certificateRecord || (certificateError && retryable)" class="dialog-actions">
|
|
||||||
<button v-if="certificateRecord" class="certificate-retry" type="button" @click="downloadCertificate">{{ t('chain.certificateDownload') }}</button>
|
|
||||||
<button v-else class="certificate-retry" type="button" @click="viewCertificate">{{ t('chain.certificateCheckAgain') }}</button>
|
|
||||||
</div>
|
|
||||||
</dialog>
|
|
||||||
</Teleport>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, onUnmounted, ref, watch } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { fetchTraceCertificate, requestTraceCertificate, type TraceCertificateRecord, type TraceCertificateResult } from '@/api';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
import { downloadCertificatePng } from '@/utils/certificateImage';
|
import type { ChainDetail } from '@/api';
|
||||||
import TraceTxDetail from './TraceTxDetail.vue';
|
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
|
||||||
@@ -147,116 +103,35 @@ const props = defineProps<{
|
|||||||
productId?: string | null;
|
productId?: string | null;
|
||||||
feature?: string | null;
|
feature?: string | null;
|
||||||
mintTo?: string | null;
|
mintTo?: string | null;
|
||||||
|
chainDetail?: ChainDetail | null;
|
||||||
failureReason?: string | null;
|
failureReason?: string | null;
|
||||||
chainName?: string | null;
|
chainName?: string | null;
|
||||||
} | null;
|
} | null;
|
||||||
}>();
|
}>();
|
||||||
defineEmits<{ (event: 'copy', value: string): void }>();
|
defineEmits<{ (event: 'copy', value: string): void }>();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const opening = ref(false);
|
const route = useRoute();
|
||||||
const certificateError = ref('');
|
const router = useRouter();
|
||||||
const canViewCertificate = computed(() => props.blockchain?.status === 'ONCHAIN' && Boolean(props.blockchain.txHash) && props.blockchain.chainName === '天河链');
|
const canViewCertificate = computed(() => props.blockchain?.status === 'ONCHAIN' && Boolean(props.blockchain.txHash) && props.blockchain.chainName === '天河链');
|
||||||
const proofDialog = ref<HTMLDialogElement>();
|
|
||||||
const certificateDialog = ref<HTMLDialogElement>();
|
|
||||||
const certificateButton = ref<HTMLButtonElement>();
|
|
||||||
const certificatePhase = ref(0);
|
|
||||||
const certificateRecord = ref<TraceCertificateRecord | null>(null);
|
|
||||||
const retryable = ref(true);
|
|
||||||
const certificateSteps = ['chain.certificateRetrieving', 'chain.certificateAcquiring', 'chain.certificatePreparing'];
|
|
||||||
let certificateTimer: ReturnType<typeof setTimeout> | undefined;
|
|
||||||
let certificateRun = 0;
|
|
||||||
let certificatePolls = 0;
|
|
||||||
|
|
||||||
function stopCertificateWait() {
|
|
||||||
certificateRun++;
|
|
||||||
if (certificateTimer) clearTimeout(certificateTimer);
|
|
||||||
opening.value = false;
|
|
||||||
}
|
|
||||||
function closeCertificateDialog() {
|
|
||||||
stopCertificateWait();
|
|
||||||
certificateRecord.value = null;
|
|
||||||
certificateDialog.value?.close();
|
|
||||||
certificateButton.value?.focus();
|
|
||||||
}
|
|
||||||
function openProof() {
|
function openProof() {
|
||||||
proofDialog.value?.showModal();
|
const key = `artveris.trace.proof.${props.preview ? 'preview.' : ''}${props.shortCode}`;
|
||||||
|
sessionStorage.setItem(key, JSON.stringify(props.blockchain || null));
|
||||||
|
router.push({
|
||||||
|
name: props.preview ? 'trace-preview-proof' : 'trace-proof',
|
||||||
|
params: { code: props.shortCode },
|
||||||
|
query: props.preview ? { token: route.query.token, state: route.query.state } : {},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
function closeProof() {
|
function openCertificate() {
|
||||||
proofDialog.value?.close();
|
if (props.preview || !canViewCertificate.value) return;
|
||||||
|
router.push({ name: 'trace-certificate', params: { code: props.shortCode } });
|
||||||
}
|
}
|
||||||
function failCertificate(messageKey: string, canRetry = true) {
|
|
||||||
certificateError.value = t(messageKey);
|
|
||||||
retryable.value = canRetry;
|
|
||||||
opening.value = false;
|
|
||||||
}
|
|
||||||
function showCertificateResult(result: TraceCertificateResult, run: number, code: string) {
|
|
||||||
if (run !== certificateRun) return;
|
|
||||||
if (result.status === 'READY' && result.certificate) {
|
|
||||||
certificatePhase.value = 2;
|
|
||||||
certificateRecord.value = result.certificate;
|
|
||||||
opening.value = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (result.status === 'FAILED') return failCertificate('chain.certificateFailed', false);
|
|
||||||
if (result.status === 'UNKNOWN') return failCertificate('chain.certificateDelayed');
|
|
||||||
if (result.status === 'NONE') return failCertificate('chain.certificateUnavailable');
|
|
||||||
certificatePhase.value = 1;
|
|
||||||
if (++certificatePolls >= 60) return failCertificate('chain.certificateDelayed');
|
|
||||||
certificateTimer = setTimeout(async () => {
|
|
||||||
try { showCertificateResult(await fetchTraceCertificate(code), run, code); }
|
|
||||||
catch { if (run === certificateRun) failCertificate('chain.certificateUnavailable'); }
|
|
||||||
}, 5000);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function viewCertificate() {
|
|
||||||
if (opening.value || props.preview || !canViewCertificate.value) return;
|
|
||||||
stopCertificateWait();
|
|
||||||
const run = certificateRun;
|
|
||||||
const code = props.shortCode;
|
|
||||||
certificateError.value = '';
|
|
||||||
certificatePhase.value = 0;
|
|
||||||
certificatePolls = 0;
|
|
||||||
if (!certificateDialog.value?.open) certificateDialog.value?.showModal();
|
|
||||||
opening.value = true;
|
|
||||||
try {
|
|
||||||
const cached = await fetchTraceCertificate(code);
|
|
||||||
if (run !== certificateRun) return;
|
|
||||||
certificatePhase.value = 1;
|
|
||||||
const result = cached.status === 'NONE' || cached.status === 'UNKNOWN'
|
|
||||||
? await requestTraceCertificate(code) : cached;
|
|
||||||
showCertificateResult(result, run, code);
|
|
||||||
} catch {
|
|
||||||
if (run === certificateRun) failCertificate('chain.certificateRequestFailed');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
watch(() => props.shortCode, closeCertificateDialog);
|
|
||||||
onUnmounted(stopCertificateWait);
|
|
||||||
|
|
||||||
const status = computed<ProofStatus>(() => {
|
const status = computed<ProofStatus>(() => {
|
||||||
const value = props.blockchain?.status as ProofStatus | undefined;
|
const value = props.blockchain?.status as ProofStatus | undefined;
|
||||||
return value && STATUSES.has(value) ? value : 'ONCHAIN';
|
return value && STATUSES.has(value) ? value : 'ONCHAIN';
|
||||||
});
|
});
|
||||||
const certificateRows = computed(() => {
|
|
||||||
const record = certificateRecord.value;
|
|
||||||
if (!record) return [];
|
|
||||||
return [
|
|
||||||
{ label: t('chain.certificateContent'), value: record.text },
|
|
||||||
{ label: t('chain.certificateDigest'), value: record.digest },
|
|
||||||
{ label: t('chain.hash'), value: record.txHash },
|
|
||||||
{ label: t('chain.certificateAuthor'), value: record.author },
|
|
||||||
{ label: t('chain.certificateTime'), value: formatTime(record.createdAt) },
|
|
||||||
];
|
|
||||||
});
|
|
||||||
function downloadCertificate() {
|
|
||||||
const record = certificateRecord.value;
|
|
||||||
if (!record) return;
|
|
||||||
downloadCertificatePng({
|
|
||||||
title: t('chain.certificateView'),
|
|
||||||
filename: `certificate-${props.shortCode}.png`,
|
|
||||||
rows: certificateRows.value,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function ellipsis(value?: string | null) {
|
function ellipsis(value?: string | null) {
|
||||||
if (!value) return '-';
|
if (!value) return '-';
|
||||||
return value.length > 16 ? `${value.slice(0, 8)}…${value.slice(-6)}` : value;
|
return value.length > 16 ? `${value.slice(0, 8)}…${value.slice(-6)}` : value;
|
||||||
@@ -369,28 +244,6 @@ function formatTime(value?: string | null) {
|
|||||||
padding: 8px 0;
|
padding: 8px 0;
|
||||||
}
|
}
|
||||||
.chain-actions { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
|
.chain-actions { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
|
||||||
.certificate-link { margin-left: auto; padding: 0; border: 0; background: none; cursor: pointer; font-family: inherit; }
|
.certificate-link { margin-left: auto; }
|
||||||
.certificate-link:disabled { opacity: .55; cursor: default; }
|
.certificate-link:disabled { opacity: .55; cursor: default; }
|
||||||
.tx-dialog { width: min(960px, calc(100vw - 16px)); max-height: calc(100vh - 16px); padding: 0; border: 0; background: transparent; box-shadow: none; overflow: auto; }
|
|
||||||
.tx-dialog::backdrop { background: #0007; }
|
|
||||||
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
|
|
||||||
.certificate-dialog { width: min(420px, calc(100vw - 40px)); max-height: min(640px, calc(100vh - 48px)); box-sizing: border-box; padding: 28px; border: 1px solid var(--border); border-radius: 16px; background: var(--card-bg); color: var(--text); box-shadow: 0 16px 60px #0003; }
|
|
||||||
.certificate-dialog[open] { display: flex; flex-direction: column; }
|
|
||||||
.sheet-body { overflow: auto; min-height: 0; }
|
|
||||||
.sheet-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 8px 0; border-bottom: 1px dashed var(--trace-divider); font-size: 13px; }
|
|
||||||
.sheet-row span { color: var(--muted); }
|
|
||||||
.sheet-row strong { font-weight: 500; word-break: break-all; white-space: pre-wrap; }
|
|
||||||
.dialog-actions { padding-top: 16px; }
|
|
||||||
.certificate-dialog::backdrop { background: #0007; }
|
|
||||||
.certificate-dialog h3 { margin: 0 0 22px; font-size: 18px; }
|
|
||||||
.certificate-close { position: absolute; top: 9px; right: 12px; border: 0; background: transparent; color: var(--muted); font-size: 25px; cursor: pointer; }
|
|
||||||
.certificate-spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--brand); border-radius: 50%; margin: 0 auto 24px; animation: certificate-spin .8s linear infinite; }
|
|
||||||
.certificate-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; font-size: 14px; }
|
|
||||||
.certificate-steps li { display: flex; gap: 12px; align-items: center; color: var(--muted); }
|
|
||||||
.certificate-steps li span { border: 1px solid var(--border); border-radius: 50%; width: 24px; height: 24px; display: grid; place-items: center; flex-shrink: 0; }
|
|
||||||
.certificate-steps li.current { color: var(--text); font-weight: 600; }
|
|
||||||
.certificate-steps li.done { color: var(--brand); }
|
|
||||||
.certificate-retry { border: 0; background: var(--brand); color: white; padding: 9px 18px; border-radius: 6px; cursor: pointer; font: inherit; }
|
|
||||||
@keyframes certificate-spin { to { transform: rotate(360deg); } }
|
|
||||||
@media (prefers-reduced-motion: reduce) { .certificate-spinner { animation: none; } }
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -0,0 +1,103 @@
|
|||||||
|
<template>
|
||||||
|
<div ref="sheet" class="certificate-prove">
|
||||||
|
<div class="cert-logo">
|
||||||
|
<img :src="logoUrl" alt="" />
|
||||||
|
</div>
|
||||||
|
<h1 class="cert-title">区块链存证证书</h1>
|
||||||
|
<p class="cert-notice"> 本证书由天河链签发,证明该文件由作者在存证时间操作上链,且链上内容未经篡改 </p>
|
||||||
|
<div class="row-mod">
|
||||||
|
<p class="row-title">天河链-区块链ID:</p>
|
||||||
|
<p class="row-value"> {{ record.txHash || '未知' }} </p>
|
||||||
|
</div>
|
||||||
|
<div class="row-mod">
|
||||||
|
<p class="row-title">电子证据SHA256值:</p>
|
||||||
|
<p class="row-value"> {{ record.digest || '未知' }} </p>
|
||||||
|
</div>
|
||||||
|
<div class="cert-divider el-divider el-divider--horizontal"></div>
|
||||||
|
<div class="prove-area prove-area-2">
|
||||||
|
<div class="form-mod">
|
||||||
|
<div class="form-item">
|
||||||
|
<div class="form-item-label">作者:</div>
|
||||||
|
<div class="form-item-value"> {{ record.author }} </div>
|
||||||
|
</div>
|
||||||
|
<div class="form-item">
|
||||||
|
<div class="form-item-label">存证时间:</div>
|
||||||
|
<div class="form-item-value"> {{ created }} </div>
|
||||||
|
</div>
|
||||||
|
<div v-if="record.text" class="form-item">
|
||||||
|
<div class="form-item-label">文本内容:</div>
|
||||||
|
<div class="form-item-value"> {{ record.text }} </div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="check-img">
|
||||||
|
<img :src="stampUrl" alt="" height="100%" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="prove-area prove-area-3">
|
||||||
|
<div class="prove-notice">
|
||||||
|
说明:<br /><br />
|
||||||
|
1、本文件通过天河链网络进行存证,链上数据不可删除、不可篡改。<br /><br />
|
||||||
|
2、本文件根据SHA256加密算法加密。
|
||||||
|
</div>
|
||||||
|
<div class="wx-link">
|
||||||
|
<div id="qrcode">
|
||||||
|
<img v-if="qrUrl" :src="qrUrl" alt="" width="88" height="88" />
|
||||||
|
</div>
|
||||||
|
<img class="qrcode-logo" :src="qrLogoUrl" alt="" width="16" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="prove-wrapper"></div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { computed, onMounted, ref } from 'vue';
|
||||||
|
import dayjs from 'dayjs';
|
||||||
|
import QRCode from 'qrcode';
|
||||||
|
import type { TraceCertificateRecord } from '@/api';
|
||||||
|
import logoUrl from '@/assets/certificate/logo.png';
|
||||||
|
import stampUrl from '@/assets/certificate/check.png';
|
||||||
|
import qrLogoUrl from '@/assets/certificate/qr-logo.png';
|
||||||
|
import './certificate-prove.css';
|
||||||
|
|
||||||
|
const props = defineProps<{ record: TraceCertificateRecord }>();
|
||||||
|
const sheet = ref<HTMLElement>();
|
||||||
|
const qrUrl = ref('');
|
||||||
|
const created = computed(() => {
|
||||||
|
if (!props.record.createdAt) return '';
|
||||||
|
const parsed = dayjs(props.record.createdAt);
|
||||||
|
return parsed.isValid() ? parsed.format('YYYY-MM-DD HH:mm:ss') : props.record.createdAt;
|
||||||
|
});
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
const host = props.record.environment === 'test' ? 'https://test.explorer.tianhecloud.com' : 'https://explorer.tianhecloud.com';
|
||||||
|
qrUrl.value = await QRCode.toDataURL(`${host}/#/tiChain/transDetail?hash=${props.record.txHash}`, {
|
||||||
|
width: 88,
|
||||||
|
margin: 0,
|
||||||
|
errorCorrectionLevel: 'H',
|
||||||
|
color: { dark: '#000000', light: '#ffffff' },
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
async function download() {
|
||||||
|
const target = sheet.value;
|
||||||
|
if (!target) return;
|
||||||
|
const host = document.createElement('div');
|
||||||
|
host.style.cssText = 'position:fixed;left:-10000px;top:0;width:508px;height:720px;';
|
||||||
|
const clone = target.cloneNode(true) as HTMLElement;
|
||||||
|
host.appendChild(clone);
|
||||||
|
document.body.appendChild(host);
|
||||||
|
try {
|
||||||
|
const { default: html2canvas } = await import('html2canvas');
|
||||||
|
const canvas = await html2canvas(clone, { scale: 3, backgroundColor: '#e0e0e0', useCORS: true });
|
||||||
|
const link = document.createElement('a');
|
||||||
|
link.href = canvas.toDataURL('image/png');
|
||||||
|
link.download = `${Date.now()}.png`;
|
||||||
|
link.click();
|
||||||
|
} finally {
|
||||||
|
host.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({ download });
|
||||||
|
</script>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="tx-page">
|
<div class="tx-page">
|
||||||
<div class="tx-top">
|
<div class="tx-top">
|
||||||
<h3>{{ t('chain.txTitle') }}</h3>
|
<h3 v-if="showHeading">{{ t('chain.txTitle') }}</h3>
|
||||||
<div class="tx-hashbox">{{ txHash || '-' }}</div>
|
<div class="tx-hashbox">{{ txHash || '-' }}</div>
|
||||||
</div>
|
</div>
|
||||||
<section class="tx-card">
|
<section class="tx-card">
|
||||||
@@ -27,11 +27,24 @@
|
|||||||
<em v-else class="tx-pending">{{ statusText }}</em>
|
<em v-else class="tx-pending">{{ statusText }}</em>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="blockHeight != null" class="tx-row">
|
<div v-if="shownBlock != null && shownBlock !== ''" class="tx-row">
|
||||||
<span>{{ t('chain.blockHeight') }}</span>
|
<span>{{ t('chain.blockHeight') }}</span>
|
||||||
<div class="tx-value">
|
<div class="tx-value">
|
||||||
<b>{{ blockHeight }}</b>
|
<b>{{ shownBlock }}</b>
|
||||||
<button type="button" class="tx-copy" :aria-label="t('chain.copy')" @click="$emit('copy', String(blockHeight))">
|
<button type="button" class="tx-copy" :aria-label="t('chain.copy')" @click="$emit('copy', String(shownBlock))">
|
||||||
|
<CopyIcon />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="tx-row">
|
||||||
|
<span>{{ t('chain.txGas') }}</span>
|
||||||
|
<div class="tx-value"><b>{{ detail?.gasUsed || '' }}</b></div>
|
||||||
|
</div>
|
||||||
|
<div class="tx-row">
|
||||||
|
<span>{{ t('chain.txSender') }}</span>
|
||||||
|
<div class="tx-value">
|
||||||
|
<span class="tx-addr">{{ detail?.fromAddress || '' }}</span>
|
||||||
|
<button v-if="detail?.fromAddress" type="button" class="tx-copy" :aria-label="t('chain.copy')" @click="$emit('copy', detail.fromAddress)">
|
||||||
<CopyIcon />
|
<CopyIcon />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -39,12 +52,14 @@
|
|||||||
<div class="tx-row">
|
<div class="tx-row">
|
||||||
<span>{{ t('chain.txAction') }}</span>
|
<span>{{ t('chain.txAction') }}</span>
|
||||||
<div class="tx-value tx-action">
|
<div class="tx-value tx-action">
|
||||||
{{ t('chain.txIssue') }} <b>{{ tokenId || '-' }}</b>
|
{{ t('chain.txIssue') }} <b>{{ actionToken || '' }}</b>
|
||||||
|
<template v-if="actionFrom">
|
||||||
{{ t('chain.txFromNull') }}
|
{{ t('chain.txFromNull') }}
|
||||||
<span class="tx-addr">{{ zeroAddress }}</span>
|
<span class="tx-addr">{{ actionFrom }}</span>
|
||||||
<template v-if="mintTo">
|
</template>
|
||||||
|
<template v-if="actionTo">
|
||||||
{{ t('chain.txToward') }}
|
{{ t('chain.txToward') }}
|
||||||
<span class="tx-addr">{{ mintTo }}</span>
|
<span class="tx-addr">{{ actionTo }}</span>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -57,11 +72,11 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="contractAddress" class="tx-row">
|
<div v-if="receiver" class="tx-row">
|
||||||
<span>{{ t('chain.txReceiver') }}</span>
|
<span>{{ t('chain.txReceiver') }}</span>
|
||||||
<div class="tx-value">
|
<div class="tx-value">
|
||||||
<span class="tx-addr">{{ contractAddress }}</span>
|
<span class="tx-addr">{{ receiver }}</span>
|
||||||
<button type="button" class="tx-copy" :aria-label="t('chain.copy')" @click="$emit('copy', contractAddress)">
|
<button type="button" class="tx-copy" :aria-label="t('chain.copy')" @click="$emit('copy', receiver)">
|
||||||
<CopyIcon />
|
<CopyIcon />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -73,8 +88,8 @@
|
|||||||
<div class="tx-row tx-input-row">
|
<div class="tx-row tx-input-row">
|
||||||
<span>{{ t('chain.txInput') }}</span>
|
<span>{{ t('chain.txInput') }}</span>
|
||||||
<div class="tx-value">
|
<div class="tx-value">
|
||||||
<div class="tx-method"><i>Method</i><b>{{ mintMethod }}</b></div>
|
<div class="tx-method"><i>Method</i><b>{{ detail?.method || '' }}</b></div>
|
||||||
<div class="tx-method"><i>MethodId</i><b class="mono">{{ mintMethodId }}</b></div>
|
<div class="tx-method"><i>MethodId</i><b class="mono">{{ detail?.methodId || '' }}</b></div>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -103,31 +118,35 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-else class="tx-panel" role="tabpanel">
|
<div v-else class="tx-panel" role="tabpanel">
|
||||||
|
<p v-if="!detail?.logs?.length" class="tx-empty">{{ t('chain.txLogsEmpty') }}</p>
|
||||||
|
<template v-else>
|
||||||
|
<article v-for="(log, logIndex) in detail.logs" :key="logIndex" class="tx-log">
|
||||||
<div class="tx-row">
|
<div class="tx-row">
|
||||||
<span>Address</span>
|
<span>Address</span>
|
||||||
<div class="tx-value"><span class="tx-addr">{{ contractAddress || '-' }}</span></div>
|
<div class="tx-value"><span class="tx-addr">{{ log.address }}</span></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tx-row">
|
<div class="tx-row">
|
||||||
<span>Name</span>
|
<span>Name</span>
|
||||||
<div class="tx-value"><b>Transfer(address from, address to, uint256 tokenId)</b></div>
|
<div class="tx-value"><b>{{ log.name }}</b></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tx-row">
|
<div class="tx-row">
|
||||||
<span>Topics</span>
|
<span>Topics</span>
|
||||||
<div class="tx-value">
|
<div class="tx-value">
|
||||||
<div v-for="(topic, index) in topics" :key="index" class="tx-topic">
|
<div v-for="(topic, index) in log.topics" :key="index" class="tx-topic">
|
||||||
<i>[{{ index }}]</i>
|
<i>[{{ index }}]</i>
|
||||||
<em v-if="index > 0">Dec</em>
|
|
||||||
<span class="mono">{{ topic }}</span>
|
<span class="mono">{{ topic }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tx-row">
|
<div class="tx-row">
|
||||||
<span>Data</span>
|
<span>Data</span>
|
||||||
<div class="tx-value"><b class="mono">0x</b></div>
|
<div class="tx-value"><b class="mono">{{ log.data || '0x' }}</b></div>
|
||||||
</div>
|
</div>
|
||||||
|
</article>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button type="button" class="tx-back" @click="$emit('close')">{{ t('chain.txBack') }}</button>
|
<button v-if="showClose" type="button" class="tx-back" @click="$emit('close')">{{ t('chain.txBack') }}</button>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -136,6 +155,7 @@
|
|||||||
import { computed, defineComponent, h, ref } from 'vue';
|
import { computed, defineComponent, h, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
import type { ChainDetail } from '@/api';
|
||||||
|
|
||||||
const CopyIcon = defineComponent({
|
const CopyIcon = defineComponent({
|
||||||
name: 'CopyIcon',
|
name: 'CopyIcon',
|
||||||
@@ -147,12 +167,7 @@ const CopyIcon = defineComponent({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const ZERO_ADDRESS = '0x' + '0'.repeat(40);
|
const props = withDefaults(defineProps<{
|
||||||
const TRANSFER_TOPIC = '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef';
|
|
||||||
const MINT_METHOD = 'mint(address to, string author, string productId, string feature, string initPrice)';
|
|
||||||
const MINT_METHOD_ID = '0xa40d1b10';
|
|
||||||
|
|
||||||
const props = defineProps<{
|
|
||||||
txHash?: string | null;
|
txHash?: string | null;
|
||||||
succeeded: boolean;
|
succeeded: boolean;
|
||||||
statusText: string;
|
statusText: string;
|
||||||
@@ -164,36 +179,34 @@ const props = defineProps<{
|
|||||||
productId?: string | null;
|
productId?: string | null;
|
||||||
feature?: string | null;
|
feature?: string | null;
|
||||||
mintTo?: string | null;
|
mintTo?: string | null;
|
||||||
}>();
|
detail?: ChainDetail | null;
|
||||||
|
showHeading?: boolean;
|
||||||
|
showClose?: boolean;
|
||||||
|
}>(), { showHeading: true, showClose: true });
|
||||||
defineEmits<{ (event: 'copy', value: string): void; (event: 'close'): void }>();
|
defineEmits<{ (event: 'copy', value: string): void; (event: 'close'): void }>();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const tab = ref<'info' | 'logs'>('info');
|
const tab = ref<'info' | 'logs'>('info');
|
||||||
const zeroAddress = ZERO_ADDRESS;
|
const shownBlock = computed(() => props.detail?.blockHeight || props.blockHeight);
|
||||||
const mintMethod = MINT_METHOD;
|
const receiver = computed(() => props.detail?.toAddress || props.contractAddress || '');
|
||||||
const mintMethodId = MINT_METHOD_ID;
|
const actionToken = computed(() => props.detail?.action?.tokenId || (props.tokenId == null ? '' : String(props.tokenId)));
|
||||||
|
const actionFrom = computed(() => props.detail?.action?.fromAddress || '');
|
||||||
|
const actionTo = computed(() => props.detail?.action?.toAddress || props.mintTo || '');
|
||||||
const timeText = computed(() => {
|
const timeText = computed(() => {
|
||||||
if (!props.onchainAt) return '-';
|
const value = props.detail?.timeStamp || props.onchainAt;
|
||||||
const parsed = dayjs(props.onchainAt);
|
if (!value) return '';
|
||||||
return parsed.isValid() ? parsed.format('YYYY-MM-DD HH:mm:ss') : '-';
|
const numeric = /^\d+$/.test(String(value)) ? Number(value) : value;
|
||||||
|
const parsed = dayjs(numeric);
|
||||||
|
return parsed.isValid() ? parsed.format('YYYY-MM-DD HH:mm:ss') : '';
|
||||||
});
|
});
|
||||||
const inputs = computed(() => [
|
const inputs = computed(() => props.detail?.inputs?.length
|
||||||
{ name: 'to', type: 'address', value: props.mintTo || '-', copy: props.mintTo || '' },
|
? props.detail.inputs.map((row) => ({ ...row, value: row.data, copy: row.data }))
|
||||||
{ name: 'author', type: 'string', value: props.author || '-', copy: props.author || '' },
|
: [
|
||||||
{ name: 'productId', type: 'string', value: props.productId || '-', copy: props.productId || '' },
|
{ name: 'to', type: 'address', value: props.mintTo || '', copy: props.mintTo || '' },
|
||||||
{ name: 'feature', type: 'string', value: props.feature || '-', copy: props.feature || '' },
|
{ name: 'author', type: 'string', value: props.author || '', copy: props.author || '' },
|
||||||
{ name: 'initPrice', type: 'string', value: '-', copy: '' },
|
{ name: 'productId', type: 'string', value: props.productId || '', copy: props.productId || '' },
|
||||||
|
{ name: 'feature', type: 'string', value: props.feature || '', copy: props.feature || '' },
|
||||||
|
{ name: 'initPrice', type: 'string', value: '', copy: '' },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const topics = computed(() => {
|
|
||||||
const token = props.tokenId == null || props.tokenId === '' ? null : String(props.tokenId);
|
|
||||||
return [
|
|
||||||
TRANSFER_TOPIC,
|
|
||||||
ZERO_ADDRESS,
|
|
||||||
props.mintTo || '-',
|
|
||||||
token && /^\d+$/.test(token) ? token : '-',
|
|
||||||
];
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@@ -216,8 +229,8 @@ const topics = computed(() => {
|
|||||||
.tx-copy { width: 22px; height: 22px; border: 0; background: transparent; color: #98a2b3; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
|
.tx-copy { width: 22px; height: 22px; border: 0; background: transparent; color: #98a2b3; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
|
||||||
.tx-method { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 8px; width: 100%; padding: 4px 0; }
|
.tx-method { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 8px; width: 100%; padding: 4px 0; }
|
||||||
.tx-method i { color: #667085; font-style: normal; }
|
.tx-method i { color: #667085; font-style: normal; }
|
||||||
.tx-input-row .tx-value { display: block; }
|
.tx-input-row .tx-value { display: block; overflow-x: auto; }
|
||||||
table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
|
table { width: 100%; min-width: 520px; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
|
||||||
th, td { border-bottom: 1px solid #f2f4f8; text-align: left; padding: 8px 6px; vertical-align: top; }
|
th, td { border-bottom: 1px solid #f2f4f8; text-align: left; padding: 8px 6px; vertical-align: top; }
|
||||||
th { color: #667085; font-weight: 500; }
|
th { color: #667085; font-weight: 500; }
|
||||||
.tx-cell { word-break: break-all; white-space: pre-wrap; }
|
.tx-cell { word-break: break-all; white-space: pre-wrap; }
|
||||||
@@ -225,6 +238,7 @@ th { color: #667085; font-weight: 500; }
|
|||||||
.tx-topic i, .tx-topic em { color: #98a2b3; font-style: normal; flex: none; }
|
.tx-topic i, .tx-topic em { color: #98a2b3; font-style: normal; flex: none; }
|
||||||
.mono { font-family: Consolas, 'SFMono-Regular', monospace; word-break: break-all; }
|
.mono { font-family: Consolas, 'SFMono-Regular', monospace; word-break: break-all; }
|
||||||
.tx-back { margin-top: 18px; border: 0; background: #3b6cff; color: #fff; border-radius: 6px; padding: 8px 18px; font: inherit; cursor: pointer; }
|
.tx-back { margin-top: 18px; border: 0; background: #3b6cff; color: #fff; border-radius: 6px; padding: 8px 18px; font: inherit; cursor: pointer; }
|
||||||
|
.tx-empty { margin: 18px 0; color: #98a2b3; font-size: 14px; }
|
||||||
@media (max-width: 720px) {
|
@media (max-width: 720px) {
|
||||||
.tx-page { padding: 12px; }
|
.tx-page { padding: 12px; }
|
||||||
.tx-top, .tx-row { display: block; }
|
.tx-top, .tx-row { display: block; }
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
.certificate-prove h1,
|
||||||
|
.certificate-prove p { margin: 0; }
|
||||||
|
.certificate-prove .el-divider { background-color: #dcdfe6; position: relative; }
|
||||||
|
.certificate-prove .el-divider--horizontal { display: block; height: 1px; width: 100%; margin: 24px 0; }
|
||||||
|
.certificate-prove{position:relative;height:720px;min-width:508px;background-color:#e0e0e0;text-align:center;padding:60px;background-image:url('../../assets/certificate/prove-bg.png');background-repeat:no-repeat;background-size:auto 100%}
|
||||||
|
.certificate-prove .prove-wrapper{position:absolute;left:0;right:0;bottom:0;top:0;background:transparent;z-index:1}
|
||||||
|
.certificate-prove .cert-logo{height:26px;text-align:center;margin-bottom:17px}
|
||||||
|
.certificate-prove .cert-logo img{height:26px}
|
||||||
|
.certificate-prove .cert-title{font-family:PingFangSC-Semibold;font-size:24px;color:#333;letter-spacing:0;margin-bottom:15.6px}
|
||||||
|
.certificate-prove .cert-notice{font-family:PingFangSC-Regular;font-size:12px;color:#333;letter-spacing:0;word-break:keep-all;width:calc(100% + 60px);transform:translateX(-30px) scale(.833);margin-bottom:40.4px}
|
||||||
|
.certificate-prove .row-mod{font-family:PingFang-SC-Bold;letter-spacing:0;line-height:17px;word-break:break-all;text-align:left;margin-bottom:17px}
|
||||||
|
.certificate-prove .row-mod .row-title{font-size:12px;color:#333}
|
||||||
|
.certificate-prove .row-mod .row-value{width:120%;font-size:12px;transform:translateX(-8.33%) scale(.833);color:#151515}
|
||||||
|
.certificate-prove .cert-divider{margin:20px 0;background:rgba(155,176,207,.4)}
|
||||||
|
.certificate-prove .prove-area{display:flex;width:100%;justify-content:space-between}
|
||||||
|
.certificate-prove .prove-area-2{position:relative;margin-top:94px}
|
||||||
|
.certificate-prove .prove-area-2 .form-mod{flex:1}
|
||||||
|
.certificate-prove .prove-area-2 .check-img{position:absolute;right:0;align-self:center;height:100px;width:100px}
|
||||||
|
.certificate-prove .prove-area-3{margin-top:52px}
|
||||||
|
.certificate-prove .prove-area-3 .prove-notice{flex:1;text-align:left;font-family:PingFangSC-Regular;font-size:12px;color:#666;letter-spacing:0;width:120%;transform:translateX(-8.33%) scale(.833)}
|
||||||
|
.certificate-prove .prove-area-3 .wx-link{width:100px;height:100px;display:flex;justify-content:center;align-items:center;position:relative;border:4px solid #999}
|
||||||
|
.certificate-prove .prove-area-3 .wx-link .qrcode-logo{background:#fff;padding:4px;border-radius:1px;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:16px}
|
||||||
|
.certificate-prove #qrcode{width:88px;height:88px;line-height:0}
|
||||||
|
.certificate-prove #qrcode img{display:block;width:88px;height:88px}
|
||||||
|
.certificate-prove .form-mod{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}
|
||||||
|
.certificate-prove .form-mod .form-item{display:flex;width:100%;margin-bottom:12px}
|
||||||
|
.certificate-prove .form-mod .form-item .form-item-label,.certificate-prove .form-mod .form-item .form-item-value{display:inline-block;font-family:PingFangSC-Regular;font-size:12px;letter-spacing:0;transform:translateX(-8.33%) scale(.833)}
|
||||||
|
.certificate-prove .form-mod .form-item .form-item-label{width:60px;text-align:right;color:#666}
|
||||||
|
.certificate-prove .form-mod .form-item .form-item-value{box-sizing:border-box;padding-left:4px;width:calc(100% - 60px);text-align:left;word-wrap:break-word;color:#000}
|
||||||
|
.certificate-prove .form-mod .form-item:last-child{margin-bottom:0}
|
||||||
|
|
||||||
|
.certificate-prove {
|
||||||
|
width: 508px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-family: Avenir, Helvetica, Arial, sans-serif;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #2c3e50;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
}
|
||||||
@@ -78,6 +78,9 @@
|
|||||||
"txType": "Type",
|
"txType": "Type",
|
||||||
"txData": "Data",
|
"txData": "Data",
|
||||||
"txBack": "Back",
|
"txBack": "Back",
|
||||||
|
"txGas": "Gas used",
|
||||||
|
"txSender": "Sender",
|
||||||
|
"txLogsEmpty": "",
|
||||||
"explorer": "View Proof",
|
"explorer": "View Proof",
|
||||||
"copy": "Copy",
|
"copy": "Copy",
|
||||||
"copied": "Copied",
|
"copied": "Copied",
|
||||||
|
|||||||
@@ -78,6 +78,9 @@
|
|||||||
"txType": "类型",
|
"txType": "类型",
|
||||||
"txData": "数据",
|
"txData": "数据",
|
||||||
"txBack": "返回",
|
"txBack": "返回",
|
||||||
|
"txGas": "Gas花费",
|
||||||
|
"txSender": "发送方",
|
||||||
|
"txLogsEmpty": "",
|
||||||
"explorer": "查看存证",
|
"explorer": "查看存证",
|
||||||
"copy": "复制",
|
"copy": "复制",
|
||||||
"copied": "已复制",
|
"copied": "已复制",
|
||||||
|
|||||||
@@ -4,9 +4,13 @@ export default createRouter({
|
|||||||
history: createWebHashHistory(),
|
history: createWebHashHistory(),
|
||||||
routes: [
|
routes: [
|
||||||
{ path: '/', component: () => import('@/views/Home.vue') },
|
{ path: '/', component: () => import('@/views/Home.vue') },
|
||||||
{ path: '/trace/:code', component: () => import('@/views/Trace.vue') },
|
{ path: '/trace/:code/proof', name: 'trace-proof', component: () => import('@/views/TraceProof.vue') },
|
||||||
|
{ path: '/trace/:code/certificate', name: 'trace-certificate', component: () => import('@/views/TraceCertificate.vue') },
|
||||||
|
{ path: '/trace/:code', name: 'trace', component: () => import('@/views/Trace.vue') },
|
||||||
// 后台预览模式:复用 Trace.vue,凭 ?token= 时间令牌访问,不激活/不计数
|
// 后台预览模式:复用 Trace.vue,凭 ?token= 时间令牌访问,不激活/不计数
|
||||||
{ path: '/trace/preview/:code', component: () => import('@/views/Trace.vue') },
|
{ path: '/trace/preview/:code/proof', name: 'trace-preview-proof', component: () => import('@/views/TraceProof.vue') },
|
||||||
|
{ path: '/trace/preview/:code/certificate', name: 'trace-preview-certificate', component: () => import('@/views/TraceCertificate.vue') },
|
||||||
|
{ path: '/trace/preview/:code', name: 'trace-preview', component: () => import('@/views/Trace.vue') },
|
||||||
{ path: '/:pathMatch(.*)*', redirect: '/' },
|
{ path: '/:pathMatch(.*)*', redirect: '/' },
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,73 +0,0 @@
|
|||||||
export interface CertificateImageInput {
|
|
||||||
title: string;
|
|
||||||
rows: Array<{ label: string; value: string }>;
|
|
||||||
filename: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const FONT = '"Microsoft YaHei", "PingFang SC", sans-serif';
|
|
||||||
|
|
||||||
function wrap(ctx: CanvasRenderingContext2D, value: string, maxWidth: number): string[] {
|
|
||||||
const lines: string[] = [];
|
|
||||||
let line = '';
|
|
||||||
for (const char of Array.from(value || '-')) {
|
|
||||||
const next = line + char;
|
|
||||||
if (line && ctx.measureText(next).width > maxWidth) {
|
|
||||||
lines.push(line);
|
|
||||||
line = char;
|
|
||||||
} else {
|
|
||||||
line = next;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
lines.push(line || '-');
|
|
||||||
return lines;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function downloadCertificatePng(input: CertificateImageInput): void {
|
|
||||||
const width = 750;
|
|
||||||
const pad = 48;
|
|
||||||
const maxWidth = width - pad * 2;
|
|
||||||
const measure = document.createElement('canvas').getContext('2d');
|
|
||||||
if (!measure) return;
|
|
||||||
const lines: Array<{ text: string; font: string; gap: number; color: string }> = [];
|
|
||||||
measure.font = `bold 28px ${FONT}`;
|
|
||||||
for (const text of wrap(measure, input.title, maxWidth)) {
|
|
||||||
lines.push({ text, font: measure.font, gap: 36, color: '#143028' });
|
|
||||||
}
|
|
||||||
for (const row of input.rows) {
|
|
||||||
measure.font = `bold 14px ${FONT}`;
|
|
||||||
lines.push({ text: row.label, font: measure.font, gap: 22, color: '#5c6b66' });
|
|
||||||
measure.font = `16px ${FONT}`;
|
|
||||||
const wrapped = wrap(measure, row.value, maxWidth);
|
|
||||||
wrapped.forEach((text, index) => {
|
|
||||||
lines.push({ text, font: measure.font, gap: index === wrapped.length - 1 ? 28 : 22, color: '#1c1c1c' });
|
|
||||||
});
|
|
||||||
}
|
|
||||||
const height = pad * 2 + lines.reduce((sum, line) => sum + line.gap, 0);
|
|
||||||
const canvas = document.createElement('canvas');
|
|
||||||
canvas.width = width * 2;
|
|
||||||
canvas.height = height * 2;
|
|
||||||
const ctx = canvas.getContext('2d');
|
|
||||||
if (!ctx) return;
|
|
||||||
ctx.scale(2, 2);
|
|
||||||
ctx.fillStyle = '#f7f3ea';
|
|
||||||
ctx.fillRect(0, 0, width, height);
|
|
||||||
ctx.strokeStyle = '#0f766e';
|
|
||||||
ctx.lineWidth = 3;
|
|
||||||
ctx.strokeRect(18, 18, width - 36, height - 36);
|
|
||||||
let y = pad + 8;
|
|
||||||
for (const line of lines) {
|
|
||||||
ctx.font = line.font;
|
|
||||||
ctx.fillStyle = line.color;
|
|
||||||
ctx.fillText(line.text, pad, y);
|
|
||||||
y += line.gap;
|
|
||||||
}
|
|
||||||
canvas.toBlob((blob) => {
|
|
||||||
if (!blob) return;
|
|
||||||
const url = URL.createObjectURL(blob);
|
|
||||||
const link = document.createElement('a');
|
|
||||||
link.href = url;
|
|
||||||
link.download = input.filename;
|
|
||||||
link.click();
|
|
||||||
URL.revokeObjectURL(url);
|
|
||||||
}, 'image/png');
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,145 @@
|
|||||||
|
<template>
|
||||||
|
<div class="subpage">
|
||||||
|
<header class="subpage-bar">
|
||||||
|
<button type="button" class="subpage-back" @click="back">{{ t('chain.txBack') }}</button>
|
||||||
|
<h1>{{ t('chain.certificateView') }}</h1>
|
||||||
|
<button v-if="certificateRecord" type="button" class="subpage-action" @click="certificateSheet?.download()">
|
||||||
|
{{ t('chain.certificateDownload') }}
|
||||||
|
</button>
|
||||||
|
</header>
|
||||||
|
<div class="subpage-body">
|
||||||
|
<p v-if="preview" class="subpage-note">{{ t('chain.certificatePreview') }}</p>
|
||||||
|
<template v-else>
|
||||||
|
<p v-if="certificateError" class="subpage-note" role="alert">{{ certificateError }}</p>
|
||||||
|
<button v-if="certificateError && retryable" type="button" class="subpage-action" @click="load">
|
||||||
|
{{ t('chain.certificateCheckAgain') }}
|
||||||
|
</button>
|
||||||
|
<div v-else-if="certificateRecord" ref="stage" class="cert-stage" :style="{ height: `${720 * scale}px` }">
|
||||||
|
<div class="cert-fit" :style="{ transform: `scale(${scale})` }">
|
||||||
|
<trace-certificate-sheet ref="certificateSheet" :record="certificateRecord" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else class="subpage-wait">
|
||||||
|
<div class="certificate-spinner" aria-hidden="true" />
|
||||||
|
<ol class="certificate-steps">
|
||||||
|
<li v-for="(key, index) in certificateSteps" :key="key" :class="{ current: certificatePhase === index, done: certificatePhase > index }">
|
||||||
|
<span aria-hidden="true">{{ certificatePhase > index ? '✓' : index + 1 }}</span>{{ t(key) }}
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { nextTick, onMounted, onUnmounted, ref } from 'vue';
|
||||||
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { fetchTraceCertificate, requestTraceCertificate, type TraceCertificateRecord, type TraceCertificateResult } from '@/api';
|
||||||
|
import TraceCertificateSheet from '@/components/trace/TraceCertificateSheet.vue';
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
|
const router = useRouter();
|
||||||
|
const { t } = useI18n();
|
||||||
|
const preview = route.name === 'trace-preview-certificate';
|
||||||
|
const code = String(route.params.code || '');
|
||||||
|
const certificateError = ref('');
|
||||||
|
const certificatePhase = ref(0);
|
||||||
|
const certificateRecord = ref<TraceCertificateRecord | null>(null);
|
||||||
|
const certificateSheet = ref<{ download: () => Promise<void> }>();
|
||||||
|
const retryable = ref(true);
|
||||||
|
const certificateSteps = ['chain.certificateRetrieving', 'chain.certificateAcquiring', 'chain.certificatePreparing'];
|
||||||
|
const stage = ref<HTMLElement>();
|
||||||
|
const scale = ref(1);
|
||||||
|
let certificateTimer: ReturnType<typeof setTimeout> | undefined;
|
||||||
|
let certificateRun = 0;
|
||||||
|
let certificatePolls = 0;
|
||||||
|
let observer: ResizeObserver | undefined;
|
||||||
|
|
||||||
|
function back() {
|
||||||
|
const name = preview ? 'trace-preview' : 'trace';
|
||||||
|
if (window.history.state?.back) router.back();
|
||||||
|
else router.push({ name, params: { code }, query: route.query });
|
||||||
|
}
|
||||||
|
function failCertificate(messageKey: string, canRetry = true) {
|
||||||
|
certificateError.value = t(messageKey);
|
||||||
|
retryable.value = canRetry;
|
||||||
|
}
|
||||||
|
async function showCertificateResult(result: TraceCertificateResult, run: number) {
|
||||||
|
if (run !== certificateRun) return;
|
||||||
|
if (result.status === 'READY' && result.certificate) {
|
||||||
|
certificatePhase.value = 2;
|
||||||
|
certificateRecord.value = result.certificate;
|
||||||
|
await nextTick();
|
||||||
|
measure();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (result.status === 'FAILED') return failCertificate('chain.certificateFailed', false);
|
||||||
|
if (result.status === 'UNKNOWN') return failCertificate('chain.certificateDelayed');
|
||||||
|
if (result.status === 'NONE') return failCertificate('chain.certificateUnavailable');
|
||||||
|
certificatePhase.value = 1;
|
||||||
|
if (++certificatePolls >= 60) return failCertificate('chain.certificateDelayed');
|
||||||
|
certificateTimer = setTimeout(async () => {
|
||||||
|
try { showCertificateResult(await fetchTraceCertificate(code), run); }
|
||||||
|
catch { if (run === certificateRun) failCertificate('chain.certificateUnavailable'); }
|
||||||
|
}, 5000);
|
||||||
|
}
|
||||||
|
async function load() {
|
||||||
|
if (preview) return;
|
||||||
|
certificateRun += 1;
|
||||||
|
if (certificateTimer) clearTimeout(certificateTimer);
|
||||||
|
const run = certificateRun;
|
||||||
|
certificateError.value = '';
|
||||||
|
certificateRecord.value = null;
|
||||||
|
certificatePhase.value = 0;
|
||||||
|
certificatePolls = 0;
|
||||||
|
retryable.value = true;
|
||||||
|
try {
|
||||||
|
const cached = await fetchTraceCertificate(code);
|
||||||
|
if (run !== certificateRun) return;
|
||||||
|
certificatePhase.value = 1;
|
||||||
|
const result = cached.status === 'NONE' || cached.status === 'UNKNOWN'
|
||||||
|
? await requestTraceCertificate(code) : cached;
|
||||||
|
showCertificateResult(result, run);
|
||||||
|
} catch {
|
||||||
|
if (run === certificateRun) failCertificate('chain.certificateRequestFailed');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function measure() {
|
||||||
|
const width = stage.value?.clientWidth || 0;
|
||||||
|
scale.value = width > 0 ? Math.min(1, width / 508) : 1;
|
||||||
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
load();
|
||||||
|
observer = new ResizeObserver(measure);
|
||||||
|
observer.observe(document.documentElement);
|
||||||
|
});
|
||||||
|
onUnmounted(() => {
|
||||||
|
certificateRun += 1;
|
||||||
|
if (certificateTimer) clearTimeout(certificateTimer);
|
||||||
|
observer?.disconnect();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.subpage { max-width: 560px; margin: 0 auto; min-height: 100vh; background: var(--bg); }
|
||||||
|
.subpage-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px; background: var(--card-bg); border-bottom: 1px solid var(--border); }
|
||||||
|
.subpage-bar h1 { flex: 1; min-width: 0; margin: 0; font-size: 16px; font-weight: 600; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||||
|
.subpage-bar { flex-wrap: wrap; }
|
||||||
|
.subpage-back, .subpage-action { border: 0; background: transparent; color: var(--brand-2); font: inherit; font-size: 14px; cursor: pointer; padding: 6px 0; }
|
||||||
|
.subpage-action { background: var(--brand); color: #fff; border-radius: 6px; padding: 8px 12px; }
|
||||||
|
.subpage-body { padding: 12px 12px 28px; }
|
||||||
|
.subpage-note { margin: 12px 0; font-size: 14px; line-height: 1.6; }
|
||||||
|
.cert-stage { position: relative; width: 100%; margin: 0 auto; }
|
||||||
|
.cert-fit { position: absolute; left: 50%; top: 0; width: 508px; margin-left: -254px; transform-origin: top center; }
|
||||||
|
.subpage-wait { padding: 12px 4px 24px; }
|
||||||
|
.certificate-spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--brand); border-radius: 50%; margin: 0 auto 24px; animation: certificate-spin .8s linear infinite; }
|
||||||
|
.certificate-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; font-size: 14px; }
|
||||||
|
.certificate-steps li { display: flex; gap: 12px; align-items: center; color: var(--muted); }
|
||||||
|
.certificate-steps li span { border: 1px solid var(--border); border-radius: 50%; width: 24px; height: 24px; display: grid; place-items: center; flex-shrink: 0; }
|
||||||
|
.certificate-steps li.current { color: var(--text); font-weight: 600; }
|
||||||
|
.certificate-steps li.done { color: var(--brand); }
|
||||||
|
@keyframes certificate-spin { to { transform: rotate(360deg); } }
|
||||||
|
@media (prefers-reduced-motion: reduce) { .certificate-spinner { animation: none; } }
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,138 @@
|
|||||||
|
<template>
|
||||||
|
<div class="subpage">
|
||||||
|
<header class="subpage-bar">
|
||||||
|
<button type="button" class="subpage-back" @click="back">{{ t('chain.txBack') }}</button>
|
||||||
|
<h1>{{ t('chain.txTitle') }}</h1>
|
||||||
|
</header>
|
||||||
|
<div v-if="loading" class="subpage-state">
|
||||||
|
<div class="spinner" />
|
||||||
|
<p class="muted">{{ t('state.loading') }}</p>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="missing" class="subpage-state">
|
||||||
|
<p>{{ t('chain.notOnchain') }}</p>
|
||||||
|
</div>
|
||||||
|
<trace-tx-detail
|
||||||
|
v-else
|
||||||
|
:tx-hash="blockchain?.txHash"
|
||||||
|
:succeeded="blockchain?.status === 'ONCHAIN'"
|
||||||
|
:status-text="t(`chain.statuses.${status}`)"
|
||||||
|
:block-height="blockchain?.blockHeight"
|
||||||
|
:contract-address="blockchain?.contractAddress"
|
||||||
|
:onchain-at="blockchain?.onchainAt"
|
||||||
|
:token-id="blockchain?.tokenId"
|
||||||
|
:author="blockchain?.author"
|
||||||
|
:product-id="blockchain?.productId || code"
|
||||||
|
:feature="blockchain?.feature"
|
||||||
|
:mint-to="blockchain?.mintTo"
|
||||||
|
:detail="blockchain?.chainDetail"
|
||||||
|
:show-heading="false"
|
||||||
|
:show-close="false"
|
||||||
|
@copy="copy"
|
||||||
|
@close="back"
|
||||||
|
/>
|
||||||
|
<transition name="toast">
|
||||||
|
<div v-if="toast" class="toast">{{ toast }}</div>
|
||||||
|
</transition>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { computed, onMounted, ref } from 'vue';
|
||||||
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { fetchChainDetail, fetchTrace, fetchTracePreview, type ChainDetail } from '@/api';
|
||||||
|
import TraceTxDetail from '@/components/trace/TraceTxDetail.vue';
|
||||||
|
|
||||||
|
type ProofBlockchain = {
|
||||||
|
status?: string;
|
||||||
|
txHash?: string | null;
|
||||||
|
contractAddress?: string | null;
|
||||||
|
blockHeight?: string | number | null;
|
||||||
|
onchainAt?: string | null;
|
||||||
|
tokenId?: string | number | null;
|
||||||
|
author?: string | null;
|
||||||
|
productId?: string | null;
|
||||||
|
feature?: string | null;
|
||||||
|
mintTo?: string | null;
|
||||||
|
chainDetail?: ChainDetail | null;
|
||||||
|
};
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
|
const router = useRouter();
|
||||||
|
const { t } = useI18n();
|
||||||
|
const preview = route.name === 'trace-preview-proof';
|
||||||
|
const code = String(route.params.code || '');
|
||||||
|
const loading = ref(true);
|
||||||
|
const missing = ref(false);
|
||||||
|
const blockchain = ref<ProofBlockchain | null>(null);
|
||||||
|
const toast = ref('');
|
||||||
|
const status = computed(() => blockchain.value?.status || 'ONCHAIN');
|
||||||
|
|
||||||
|
function storageKey() {
|
||||||
|
return `artveris.trace.proof.${preview ? 'preview.' : ''}${code}`;
|
||||||
|
}
|
||||||
|
function back() {
|
||||||
|
const name = preview ? 'trace-preview' : 'trace';
|
||||||
|
if (window.history.state?.back) router.back();
|
||||||
|
else router.push({ name, params: { code }, query: route.query });
|
||||||
|
}
|
||||||
|
async function copy(text?: string) {
|
||||||
|
if (!text) return;
|
||||||
|
try {
|
||||||
|
await navigator.clipboard.writeText(text);
|
||||||
|
} catch {
|
||||||
|
const area = document.createElement('textarea');
|
||||||
|
area.value = text;
|
||||||
|
document.body.appendChild(area);
|
||||||
|
area.select();
|
||||||
|
document.execCommand('copy');
|
||||||
|
area.remove();
|
||||||
|
}
|
||||||
|
toast.value = t('chain.copied');
|
||||||
|
setTimeout(() => (toast.value = ''), 1500);
|
||||||
|
}
|
||||||
|
onMounted(async () => {
|
||||||
|
const cached = sessionStorage.getItem(storageKey());
|
||||||
|
if (cached) {
|
||||||
|
try { blockchain.value = JSON.parse(cached) as ProofBlockchain; } catch { blockchain.value = null; }
|
||||||
|
}
|
||||||
|
if (!blockchain.value?.txHash) {
|
||||||
|
try {
|
||||||
|
const data = preview
|
||||||
|
? await fetchTracePreview(code, String(route.query.token || ''), route.query.state === 'inactive' ? 'inactive' : 'active')
|
||||||
|
: await fetchTrace(code);
|
||||||
|
blockchain.value = data?.status === 'OK' ? data.blockchain : null;
|
||||||
|
} catch {
|
||||||
|
blockchain.value = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!blockchain.value?.txHash) {
|
||||||
|
missing.value = true;
|
||||||
|
loading.value = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!preview && !blockchain.value.chainDetail) {
|
||||||
|
try {
|
||||||
|
const result = await fetchChainDetail(code);
|
||||||
|
if (result.complete && result.detail) blockchain.value = { ...blockchain.value, chainDetail: result.detail };
|
||||||
|
} catch { /* 查询不到时保留已有字段 */ }
|
||||||
|
}
|
||||||
|
sessionStorage.setItem(storageKey(), JSON.stringify(blockchain.value));
|
||||||
|
loading.value = false;
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.subpage { max-width: 960px; margin: 0 auto; min-height: 100vh; background: #f4f6fa; }
|
||||||
|
.subpage-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px; background: var(--card-bg); border-bottom: 1px solid var(--border); }
|
||||||
|
.subpage-bar { flex-wrap: wrap; }
|
||||||
|
.subpage-bar h1 { flex: 1; min-width: 0; margin: 0; font-size: 16px; font-weight: 600; text-align: left; }
|
||||||
|
.subpage-back { border: 0; background: transparent; color: var(--brand-2); font: inherit; font-size: 14px; cursor: pointer; padding: 6px 0; }
|
||||||
|
.subpage-state { padding: 48px 16px; text-align: center; }
|
||||||
|
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--brand); border-radius: 50%; margin: 0 auto 12px; animation: spin .8s linear infinite; }
|
||||||
|
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: #111827; color: #fff; border-radius: 999px; padding: 8px 14px; font-size: 13px; }
|
||||||
|
@media (max-width: 720px) {
|
||||||
|
.subpage { max-width: none; }
|
||||||
|
}
|
||||||
|
@keyframes spin { to { transform: rotate(360deg); } }
|
||||||
|
</style>
|
||||||
+1
-1
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
扫码页区块链模块底部左侧为“查看存证”、右侧靠右为“查看证书”,均不显示箭头。仅明确 ONCHAIN 且有交易哈希的天河链实物显示证书按钮,未上链或处理中均不显示。仅已激活、正常、已审核通过的实物可申请。普通页面打开、刷新与证书状态 GET 都不会提交存证;后台预览模式按钮禁用,不产生付费副作用。
|
扫码页区块链模块底部左侧为“查看存证”、右侧靠右为“查看证书”,均不显示箭头。仅明确 ONCHAIN 且有交易哈希的天河链实物显示证书按钮,未上链或处理中均不显示。仅已激活、正常、已审核通过的实物可申请。普通页面打开、刷新与证书状态 GET 都不会提交存证;后台预览模式按钮禁用,不产生付费副作用。
|
||||||
|
|
||||||
点击后在当前页面弹出进度窗口,文案依次为“正在调取存证数据”“获取存证证书”“正在整理存证证书”。先读取已保存的证书字段,没有时才 POST 申请并轮询状态;完成后在弹窗内展示存证内容、摘要、交易哈希、作者和生成时间,并可下载本平台生成的证书图片。弹窗可关闭,关闭只停止当前页面等待,后台已提交任务继续完成。再次点击直接读取数据库已有记录,不重复生成。公开接口不返回天河链网址,客户页面也不再跳转到天河链。旧的独立等待页已移除。
|
「查看存证」和「查看证书」都进入本平台独立页面,不使用弹窗,手机上按屏幕宽度缩放,证书内部排版不改。证书页文案依次为“正在调取存证数据”“获取存证证书”“正在整理存证证书”。先读取已保存的证书字段,没有时才 POST 申请并轮询状态;证书按天河链证书页的版式在浏览器中绘制,下载也由浏览器生成 PNG。之后只读本地。交易详情里的 Gas、发送方和日志在第一次查到前留空,查全后写入本地,之后不再请求天河链。离开页面只停止当前等待,后台已提交任务继续完成。再次进入直接读取数据库已有记录,不重复生成。公开接口不返回天河链网址,客户页面也不能跳转到天河链。
|
||||||
|
|
||||||
新证书首次点击时按系统设置 `certificateTextTemplate` 渲染并冻结正文,默认 `{{作品名称}} {{版本}}`,例如“十二生肖莲花手工杯 一个装”。设置入口为“系统设置 → 区块链 → 证书文本模板”,帮助按钮点击后才弹出字段说明。支持 `{{作品名称}}`、`{{版本}}`、`{{追溯码}}`、`{{档案编号}}`、`{{作者}}`,可自由排序、重复使用并插入普通文本或换行。版本按作品模板中显示名为“版本”的字段取值,当前数据键为 `size`,不能硬编码成 `version`。
|
新证书首次点击时按系统设置 `certificateTextTemplate` 渲染并冻结正文,默认 `{{作品名称}} {{版本}}`,例如“十二生肖莲花手工杯 一个装”。设置入口为“系统设置 → 区块链 → 证书文本模板”,帮助按钮点击后才弹出字段说明。支持 `{{作品名称}}`、`{{版本}}`、`{{追溯码}}`、`{{档案编号}}`、`{{作者}}`,可自由排序、重复使用并插入普通文本或换行。版本按作品模板中显示名为“版本”的字段取值,当前数据键为 `size`,不能硬编码成 `version`。
|
||||||
|
|
||||||
|
|||||||
Generated
+42
@@ -218,9 +218,15 @@ importers:
|
|||||||
dayjs:
|
dayjs:
|
||||||
specifier: ^1.11.13
|
specifier: ^1.11.13
|
||||||
version: 1.11.21
|
version: 1.11.21
|
||||||
|
html2canvas:
|
||||||
|
specifier: ^1.4.1
|
||||||
|
version: 1.4.1
|
||||||
photoswipe:
|
photoswipe:
|
||||||
specifier: ^5.4.4
|
specifier: ^5.4.4
|
||||||
version: 5.4.4
|
version: 5.4.4
|
||||||
|
qrcode:
|
||||||
|
specifier: ^1.5.4
|
||||||
|
version: 1.5.4
|
||||||
vue:
|
vue:
|
||||||
specifier: ^3.5.13
|
specifier: ^3.5.13
|
||||||
version: 3.5.39(typescript@5.9.3)
|
version: 3.5.39(typescript@5.9.3)
|
||||||
@@ -1862,6 +1868,10 @@ packages:
|
|||||||
resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==}
|
resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==}
|
||||||
engines: {node: 18 || 20 || >=22}
|
engines: {node: 18 || 20 || >=22}
|
||||||
|
|
||||||
|
base64-arraybuffer@1.0.2:
|
||||||
|
resolution: {integrity: sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==}
|
||||||
|
engines: {node: '>= 0.6.0'}
|
||||||
|
|
||||||
base64-js@1.5.1:
|
base64-js@1.5.1:
|
||||||
resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==}
|
resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==}
|
||||||
|
|
||||||
@@ -2167,6 +2177,9 @@ packages:
|
|||||||
resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==}
|
resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==}
|
||||||
engines: {node: '>= 8'}
|
engines: {node: '>= 8'}
|
||||||
|
|
||||||
|
css-line-break@2.1.0:
|
||||||
|
resolution: {integrity: sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==}
|
||||||
|
|
||||||
css-render@0.15.14:
|
css-render@0.15.14:
|
||||||
resolution: {integrity: sha512-9nF4PdUle+5ta4W5SyZdLCCmFd37uVimSjg1evcTqKJCyvCEEj12WKzOSBNak6r4im4J4iYXKH1OWpUV5LBYFg==}
|
resolution: {integrity: sha512-9nF4PdUle+5ta4W5SyZdLCCmFd37uVimSjg1evcTqKJCyvCEEj12WKzOSBNak6r4im4J4iYXKH1OWpUV5LBYFg==}
|
||||||
|
|
||||||
@@ -2568,6 +2581,10 @@ packages:
|
|||||||
html-escaper@2.0.2:
|
html-escaper@2.0.2:
|
||||||
resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==}
|
resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==}
|
||||||
|
|
||||||
|
html2canvas@1.4.1:
|
||||||
|
resolution: {integrity: sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==}
|
||||||
|
engines: {node: '>=8.0.0'}
|
||||||
|
|
||||||
http-errors@2.0.1:
|
http-errors@2.0.1:
|
||||||
resolution: {integrity: sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==}
|
resolution: {integrity: sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==}
|
||||||
engines: {node: '>= 0.8'}
|
engines: {node: '>= 0.8'}
|
||||||
@@ -3649,6 +3666,9 @@ packages:
|
|||||||
resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==}
|
resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==}
|
||||||
engines: {node: '>=8'}
|
engines: {node: '>=8'}
|
||||||
|
|
||||||
|
text-segmentation@1.0.3:
|
||||||
|
resolution: {integrity: sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==}
|
||||||
|
|
||||||
tinyglobby@0.2.17:
|
tinyglobby@0.2.17:
|
||||||
resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==}
|
resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==}
|
||||||
engines: {node: '>=12.0.0'}
|
engines: {node: '>=12.0.0'}
|
||||||
@@ -3800,6 +3820,9 @@ packages:
|
|||||||
util-deprecate@1.0.2:
|
util-deprecate@1.0.2:
|
||||||
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
|
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
|
||||||
|
|
||||||
|
utrie@1.0.2:
|
||||||
|
resolution: {integrity: sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==}
|
||||||
|
|
||||||
uuid@11.1.1:
|
uuid@11.1.1:
|
||||||
resolution: {integrity: sha512-vIYxrBCC/N/K+Js3qSN88go7kIfNPssr/hHCesKCQNAjmgvYS2oqr69kIufEG+O4+PfezOH4EbIeHCfFov8ZgQ==}
|
resolution: {integrity: sha512-vIYxrBCC/N/K+Js3qSN88go7kIfNPssr/hHCesKCQNAjmgvYS2oqr69kIufEG+O4+PfezOH4EbIeHCfFov8ZgQ==}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
@@ -5884,6 +5907,8 @@ snapshots:
|
|||||||
|
|
||||||
balanced-match@4.0.4: {}
|
balanced-match@4.0.4: {}
|
||||||
|
|
||||||
|
base64-arraybuffer@1.0.2: {}
|
||||||
|
|
||||||
base64-js@1.5.1: {}
|
base64-js@1.5.1: {}
|
||||||
|
|
||||||
baseline-browser-mapping@2.10.40: {}
|
baseline-browser-mapping@2.10.40: {}
|
||||||
@@ -6188,6 +6213,10 @@ snapshots:
|
|||||||
shebang-command: 2.0.0
|
shebang-command: 2.0.0
|
||||||
which: 2.0.2
|
which: 2.0.2
|
||||||
|
|
||||||
|
css-line-break@2.1.0:
|
||||||
|
dependencies:
|
||||||
|
utrie: 1.0.2
|
||||||
|
|
||||||
css-render@0.15.14:
|
css-render@0.15.14:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@emotion/hash': 0.8.0
|
'@emotion/hash': 0.8.0
|
||||||
@@ -6615,6 +6644,11 @@ snapshots:
|
|||||||
|
|
||||||
html-escaper@2.0.2: {}
|
html-escaper@2.0.2: {}
|
||||||
|
|
||||||
|
html2canvas@1.4.1:
|
||||||
|
dependencies:
|
||||||
|
css-line-break: 2.1.0
|
||||||
|
text-segmentation: 1.0.3
|
||||||
|
|
||||||
http-errors@2.0.1:
|
http-errors@2.0.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
depd: 2.0.0
|
depd: 2.0.0
|
||||||
@@ -7881,6 +7915,10 @@ snapshots:
|
|||||||
glob: 7.2.3
|
glob: 7.2.3
|
||||||
minimatch: 3.1.5
|
minimatch: 3.1.5
|
||||||
|
|
||||||
|
text-segmentation@1.0.3:
|
||||||
|
dependencies:
|
||||||
|
utrie: 1.0.2
|
||||||
|
|
||||||
tinyglobby@0.2.17:
|
tinyglobby@0.2.17:
|
||||||
dependencies:
|
dependencies:
|
||||||
fdir: 6.5.0(picomatch@4.0.4)
|
fdir: 6.5.0(picomatch@4.0.4)
|
||||||
@@ -8022,6 +8060,10 @@ snapshots:
|
|||||||
|
|
||||||
util-deprecate@1.0.2: {}
|
util-deprecate@1.0.2: {}
|
||||||
|
|
||||||
|
utrie@1.0.2:
|
||||||
|
dependencies:
|
||||||
|
base64-arraybuffer: 1.0.2
|
||||||
|
|
||||||
uuid@11.1.1: {}
|
uuid@11.1.1: {}
|
||||||
|
|
||||||
v8-compile-cache-lib@3.0.1: {}
|
v8-compile-cache-lib@3.0.1: {}
|
||||||
|
|||||||
Reference in New Issue
Block a user