style: 证书页下载按钮放右上,编号放在图片上方

This commit is contained in:
Nixevol
2026-11-15 14:06:30 +08:00
parent e120ac3e7b
commit e2923df501
2 changed files with 13 additions and 12 deletions
+12 -11
View File
@@ -3,6 +3,9 @@
<header class="subpage-bar"> <header class="subpage-bar">
<button type="button" class="subpage-back" @click="back">{{ t('chain.txBack') }}</button> <button type="button" class="subpage-back" @click="back">{{ t('chain.txBack') }}</button>
<h1>{{ t('chain.certificateView') }}</h1> <h1>{{ t('chain.certificateView') }}</h1>
<button v-if="certificateRecord" type="button" class="des-download" @click="certificateSheet?.download()">
{{ t('chain.certificateDownload') }}
</button>
</header> </header>
<div class="subpage-body"> <div class="subpage-body">
<p v-if="preview" class="subpage-note">{{ t('chain.certificatePreview') }}</p> <p v-if="preview" class="subpage-note">{{ t('chain.certificatePreview') }}</p>
@@ -12,11 +15,6 @@
{{ t('chain.certificateCheckAgain') }} {{ t('chain.certificateCheckAgain') }}
</button> </button>
<template v-else-if="certificateRecord"> <template v-else-if="certificateRecord">
<div 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>
<section class="prove-des"> <section class="prove-des">
<h2 class="des-title"> <h2 class="des-title">
{{ t('chain.certificateChainId') }} {{ t('chain.certificateChainId') }}
@@ -34,8 +32,12 @@
</button> </button>
</h2> </h2>
<p class="des-digest">{{ certificateRecord.digest }}</p> <p class="des-digest">{{ certificateRecord.digest }}</p>
<button type="button" class="des-download" @click="certificateSheet?.download()">{{ t('chain.certificateDownload') }}</button>
</section> </section>
<div 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>
</template> </template>
<div v-else class="subpage-wait"> <div v-else class="subpage-wait">
<div class="certificate-spinner" aria-hidden="true" /> <div class="certificate-spinner" aria-hidden="true" />
@@ -160,12 +162,11 @@ onUnmounted(() => {
<style scoped> <style scoped>
.subpage { max-width: 560px; margin: 0 auto; min-height: 100vh; background: var(--bg); } .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 { position: sticky; top: 0; z-index: 8; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px; background: var(--card-bg); border-bottom: 1px solid var(--border); flex-wrap: nowrap; }
.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; } .prove-des { margin: 4px 0 16px; text-align: left; color: #333; }
.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-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-action { background: var(--brand); color: #fff; border-radius: 6px; padding: 8px 12px; }
.prove-des { margin-top: 20px; text-align: left; color: #333; } .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; }
.des-title { display: flex; align-items: center; margin: 20px 0 12px; padding: 0 8px; border-left: 3px solid #2977f0; font-family: PingFang-SC-Bold, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; font-weight: 700; line-height: 20px; color: #333; letter-spacing: 0.14px; } .des-title { display: flex; align-items: center; margin: 20px 0 12px; padding: 0 8px; border-left: 3px solid #2977f0; font-family: PingFang-SC-Bold, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; font-weight: 700; line-height: 20px; color: #333; letter-spacing: 0.14px; }
.des-title:first-child { margin-top: 0; } .des-title:first-child { margin-top: 0; }
.des-tip { position: relative; display: inline-flex; margin-left: 4px; padding: 0; border: 0; background: transparent; color: #333; cursor: pointer; } .des-tip { position: relative; display: inline-flex; margin-left: 4px; padding: 0; border: 0; background: transparent; color: #333; cursor: pointer; }
@@ -177,7 +178,7 @@ onUnmounted(() => {
.des-hash, .des-digest { margin: 0 0 20px; font-family: PingFangSC-Regular, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; font-weight: 400; line-height: normal; letter-spacing: 0.14px; text-align: left; word-break: break-all; } .des-hash, .des-digest { margin: 0 0 20px; font-family: PingFangSC-Regular, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; font-weight: 400; line-height: normal; letter-spacing: 0.14px; text-align: left; word-break: break-all; }
.des-hash { margin-bottom: 0; color: #2977f0; } .des-hash { margin-bottom: 0; color: #2977f0; }
.des-digest { color: #666; word-break: break-word; } .des-digest { color: #666; word-break: break-word; }
.des-download { min-width: 112px; height: 36px; padding: 6px 16px; border: 1px solid #2977f0; border-radius: 4px; background: #fff; color: #2977f0; font-family: PingFangSC-Regular, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; font-weight: 500; line-height: 14px; cursor: pointer; } .des-download { flex: none; min-width: 112px; height: 36px; padding: 6px 16px; border: 1px solid #2977f0; border-radius: 4px; background: #fff; color: #2977f0; font-family: PingFangSC-Regular, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; font-weight: 500; line-height: 14px; cursor: pointer; }
.des-download:hover { background: rgba(41, 119, 240, 0.06); } .des-download:hover { background: rgba(41, 119, 240, 0.06); }
@media (max-width: 420px) { @media (max-width: 420px) {
.des-pop { left: 0; top: calc(100% + 6px); transform: none; } .des-pop { left: 0; top: calc(100% + 6px); transform: none; }
+1 -1
View File
@@ -8,7 +8,7 @@
扫码页区块链模块底部左侧为“查看存证”、右侧靠右为“查看证书”,均不显示箭头。仅明确 ONCHAIN 且有交易哈希的天河链实物显示证书按钮,未上链或处理中均不显示。仅已激活、正常、已审核通过的实物可申请。普通页面打开、刷新与证书状态 GET 都不会提交存证;后台预览模式按钮禁用,不产生付费副作用。 扫码页区块链模块底部左侧为“查看存证”、右侧靠右为“查看证书”,均不显示箭头。仅明确 ONCHAIN 且有交易哈希的天河链实物显示证书按钮,未上链或处理中均不显示。仅已激活、正常、已审核通过的实物可申请。普通页面打开、刷新与证书状态 GET 都不会提交存证;后台预览模式按钮禁用,不产生付费副作用。
「查看存证」和「查看证书」都进入本平台独立页面,不使用弹窗,手机上按屏幕宽度缩放,证书内部排版不改。证书页底部按天河链说明区展示区块链 ID、SHA256 和下载按钮,说明用悬停提示;哈希只显示文字,不跳转到天河链。证书页文案依次为“正在调取存证数据”“获取存证证书”“正在整理存证证书”。先读取已保存的证书字段,已生成的马上显示。没有时才 POST 申请,并短时间查询几次;仍未完成就停止转圈并提示稍后再查,不再空转数分钟。提交在收到任何响应前就连接失败时,记为未生成并可以重试;请求发出后超时则只查询原操作号,避免重复付费。证书按天河链证书页的版式在浏览器中绘制,下载也由浏览器生成 PNG。之后只读本地。交易详情里的 Gas、发送方和日志在第一次查到前留空,查全后写入本地,之后不再请求天河链。离开页面只停止当前等待,后台已提交任务继续完成。再次进入直接读取数据库已有记录,不重复生成。公开接口不返回天河链网址,客户页面也不能跳转到天河链。 「查看存证」和「查看证书」都进入本平台独立页面,不使用弹窗,手机上按屏幕宽度缩放,证书内部排版不改。证书页顶部右侧是下载按钮。区块链编号和 SHA256 放在证书图片上方,说明用悬停提示;哈希只显示文字,不跳转到天河链。证书页文案依次为“正在调取存证数据”“获取存证证书”“正在整理存证证书”。先读取已保存的证书字段,已生成的马上显示。没有时才 POST 申请,并短时间查询几次;仍未完成就停止转圈并提示稍后再查,不再空转数分钟。提交在收到任何响应前就连接失败时,记为未生成并可以重试;请求发出后超时则只查询原操作号,避免重复付费。证书按天河链证书页的版式在浏览器中绘制,下载也由浏览器生成 PNG。之后只读本地。交易详情里的 Gas、发送方和日志在第一次查到前留空,查全后写入本地,之后不再请求天河链。离开页面只停止当前等待,后台已提交任务继续完成。再次进入直接读取数据库已有记录,不重复生成。公开接口不返回天河链网址,客户页面也不能跳转到天河链。
新证书首次点击时按系统设置 `certificateTextTemplate` 渲染并冻结正文,默认 `{{作品名称}} {{版本}}`,例如“十二生肖莲花手工杯 一个装”。设置入口为“系统设置 → 区块链 → 证书文本模板”,帮助按钮点击后才弹出字段说明。支持 `{{作品名称}}`、`{{版本}}`、`{{追溯码}}`、`{{档案编号}}`、`{{作者}}`,可自由排序、重复使用并插入普通文本或换行。版本按作品模板中显示名为“版本”的字段取值,当前数据键为 `size`,不能硬编码成 `version`。 新证书首次点击时按系统设置 `certificateTextTemplate` 渲染并冻结正文,默认 `{{作品名称}} {{版本}}`,例如“十二生肖莲花手工杯 一个装”。设置入口为“系统设置 → 区块链 → 证书文本模板”,帮助按钮点击后才弹出字段说明。支持 `{{作品名称}}`、`{{版本}}`、`{{追溯码}}`、`{{档案编号}}`、`{{作者}}`,可自由排序、重复使用并插入普通文本或换行。版本按作品模板中显示名为“版本”的字段取值,当前数据键为 `size`,不能硬编码成 `version`。