手写签名
This commit is contained in:
parent
66a8af58e8
commit
6ca132970b
|
|
@ -60,6 +60,13 @@ const showToast = ref(false)
|
|||
const toastMsg = ref('')
|
||||
const memberStore = useMemberStore()
|
||||
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(
|
||||
() => props.modelValue,
|
||||
|
|
@ -119,13 +126,13 @@ const drawBackground = (ctx, width = 100, height = 100) => {
|
|||
ctx.stroke()
|
||||
|
||||
// 正楷体水印
|
||||
ctx.setFontSize(160)
|
||||
ctx.setFontSize(190)
|
||||
ctx.setFillStyle('rgba(180,180,180,0.25)')
|
||||
ctx.setTextAlign('center')
|
||||
ctx.setTextBaseline('middle')
|
||||
ctx.translate(width / 2, height / 2)
|
||||
ctx.rotate(Math.PI / 2)
|
||||
ctx.fillText(memberStore.userInfo.nickName, 0, 0)
|
||||
ctx.fillText(nickName.value, 0, 0)
|
||||
ctx.restore()
|
||||
|
||||
// ⚡ 必须在 draw() 回调里确保画面生效
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ import { ref } from 'vue'
|
|||
import { getInfoByIdApi } from '@/services/materialsStation'
|
||||
|
||||
const itemId = ref(null)
|
||||
const publishTask = ref(null)
|
||||
const tableList = ref([])
|
||||
|
||||
onShow(() => {
|
||||
|
|
@ -43,6 +44,7 @@ onShow(() => {
|
|||
onLoad((opt) => {
|
||||
console.log('🚀 ~ onLoad ~ opt:', opt)
|
||||
itemId.value = opt.id
|
||||
publishTask.value = opt.publishTask
|
||||
console.log('🚀 ~ itemId.value:', itemId.value)
|
||||
// getList()
|
||||
})
|
||||
|
|
@ -54,7 +56,7 @@ const onScrollTolower = () => {
|
|||
|
||||
const getList = async () => {
|
||||
try {
|
||||
const res = await getInfoByIdApi({ id: itemId.value })
|
||||
const res = await getInfoByIdApi({ id: itemId.value, publishTask: publishTask.value })
|
||||
tableList.value = res.data
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ getList ~ error:', error)
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ const getList = async () => {
|
|||
const handleDetails = (item) => {
|
||||
console.log('🚀 ~ handleDetails ~ item:', item)
|
||||
uni.navigateTo({
|
||||
url: `/pages/materialsStation/materialClerkConfirms/detailsList?id=${item.id}`,
|
||||
url: `/pages/materialsStation/materialClerkConfirms/detailsList?id=${item.id}&publishTask=${item.publishTask}`,
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue