手写签名
This commit is contained in:
parent
66a8af58e8
commit
6ca132970b
|
|
@ -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() 回调里确保画面生效
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue