更新记录

1.0(2026-05-29)

@smartwork/contract-sign-ui

uni-app 签署 UI 组件(P1–P3 逐步迁入)。

当前状态

组件 状态
utils/signLandscapeTouch.js ✅ 已迁移
SignPad ✅ P1 已完成(renderjs 画板)
PdfSignViewer ✅ P2 已完成(pdf.js 预览 + 锚点)
ContractSign ✅ P3 已完成(PdfSignViewer + SignPad + 提交)

安装(团队内)

将本目录复制到目标项目的 uni_modules/contract-sign-ui,或在 pages 中相对路径引用 packages/contract-sign-ui

组件 API

PdfSignViewer 快速示例

<PdfSignViewer
  :pdf-url="contract.filePath"
  :sign-position="contract.signPosition"
  :signed-map="signedMap"
  view-only
  @load="({ pageCount, anchors }) => {}"
  @anchor-click="({ anchorId, anchor }) => {}"
/>
<SignPad
  :visible.sync="visible"
  title="请签名"
  :landscape="true"
  pen-color="#000"
  :pen-width="2"
  @export="({ base64, pngBytes, hasStroke }) => { /* ... */ }"
/>
// ref 调用
this.$refs.signPad.open()
this.$refs.signPad.clear()
const { base64, bytes } = await this.$refs.signPad.exportPng()
this.$refs.signPad.close()

renderjs 注意

  • pdf.js worker 版本须与 pdfjs-dist 一致(当前 3.11.174
  • 画板继续用 renderjs + 指令,勿改回 Vue 层 canvas

平台兼容性

@smartwork/contract-sign-ui

uni-app 签署 UI 组件(P1–P3 逐步迁入)。

当前状态

组件 状态
utils/signLandscapeTouch.js ✅ 已迁移
SignPad ✅ P1 已完成(renderjs 画板)
PdfSignViewer ✅ P2 已完成(pdf.js 预览 + 锚点)
ContractSign ✅ P3 已完成(PdfSignViewer + SignPad + 提交)

安装(团队内)

将本目录复制到目标项目的 uni_modules/contract-sign-ui,或在 pages 中相对路径引用 packages/contract-sign-ui

组件 API

PdfSignViewer 快速示例

<PdfSignViewer
  :pdf-url="contract.filePath"
  :sign-position="contract.signPosition"
  :signed-map="signedMap"
  view-only
  @load="({ pageCount, anchors }) => {}"
  @anchor-click="({ anchorId, anchor }) => {}"
/>
<SignPad
  :visible.sync="visible"
  title="请签名"
  :landscape="true"
  pen-color="#000"
  :pen-width="2"
  @export="({ base64, pngBytes, hasStroke }) => { /* ... */ }"
/>
// ref 调用
this.$refs.signPad.open()
this.$refs.signPad.clear()
const { base64, bytes } = await this.$refs.signPad.exportPng()
this.$refs.signPad.close()

renderjs 注意

  • pdf.js worker 版本须与 pdfjs-dist 一致(当前 3.11.174
  • 画板继续用 renderjs + 指令,勿改回 Vue 层 canvas

隐私、权限声明

1. 本插件需要申请的系统权限列表:

w无

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

暂无用户评论。