手写签名

This commit is contained in:
bb_pan 2025-08-30 10:13:15 +08:00
parent 66a8af58e8
commit 6ca132970b
3 changed files with 13 additions and 4 deletions

View File

@ -60,6 +60,13 @@ const showToast = ref(false)
const toastMsg = ref('') const toastMsg = ref('')
const memberStore = useMemberStore() const memberStore = useMemberStore()
console.log('🚀 ~ memberStore:', memberStore.userInfo.nickName) console.log('🚀 ~ memberStore:', memberStore.userInfo.nickName)
const nickName = ref('')
if (memberStore.userInfo.nickName && memberStore.userInfo.nickName.length < 5) {
nickName.value = memberStore.userInfo.nickName.split('').join(' ')
console.log('🚀 ~ nickName.value:', nickName.value)
} else {
nickName.value = '正楷字书写'
}
watch( watch(
() => props.modelValue, () => props.modelValue,
@ -119,13 +126,13 @@ const drawBackground = (ctx, width = 100, height = 100) => {
ctx.stroke() ctx.stroke()
// //
ctx.setFontSize(160) ctx.setFontSize(190)
ctx.setFillStyle('rgba(180,180,180,0.25)') ctx.setFillStyle('rgba(180,180,180,0.25)')
ctx.setTextAlign('center') ctx.setTextAlign('center')
ctx.setTextBaseline('middle') ctx.setTextBaseline('middle')
ctx.translate(width / 2, height / 2) ctx.translate(width / 2, height / 2)
ctx.rotate(Math.PI / 2) ctx.rotate(Math.PI / 2)
ctx.fillText(memberStore.userInfo.nickName, 0, 0) ctx.fillText(nickName.value, 0, 0)
ctx.restore() ctx.restore()
// draw() // draw()

View File

@ -34,6 +34,7 @@ import { ref } from 'vue'
import { getInfoByIdApi } from '@/services/materialsStation' import { getInfoByIdApi } from '@/services/materialsStation'
const itemId = ref(null) const itemId = ref(null)
const publishTask = ref(null)
const tableList = ref([]) const tableList = ref([])
onShow(() => { onShow(() => {
@ -43,6 +44,7 @@ onShow(() => {
onLoad((opt) => { onLoad((opt) => {
console.log('🚀 ~ onLoad ~ opt:', opt) console.log('🚀 ~ onLoad ~ opt:', opt)
itemId.value = opt.id itemId.value = opt.id
publishTask.value = opt.publishTask
console.log('🚀 ~ itemId.value:', itemId.value) console.log('🚀 ~ itemId.value:', itemId.value)
// getList() // getList()
}) })
@ -54,7 +56,7 @@ const onScrollTolower = () => {
const getList = async () => { const getList = async () => {
try { try {
const res = await getInfoByIdApi({ id: itemId.value }) const res = await getInfoByIdApi({ id: itemId.value, publishTask: publishTask.value })
tableList.value = res.data tableList.value = res.data
} catch (error) { } catch (error) {
console.log('🚀 ~ getList ~ error:', error) console.log('🚀 ~ getList ~ error:', error)

View File

@ -116,7 +116,7 @@ const getList = async () => {
const handleDetails = (item) => { const handleDetails = (item) => {
console.log('🚀 ~ handleDetails ~ item:', item) console.log('🚀 ~ handleDetails ~ item:', item)
uni.navigateTo({ uni.navigateTo({
url: `/pages/materialsStation/materialClerkConfirms/detailsList?id=${item.id}`, url: `/pages/materialsStation/materialClerkConfirms/detailsList?id=${item.id}&publishTask=${item.publishTask}`,
}) })
} }
</script> </script>