Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
ac1dc62adc
|
@ -46,7 +46,6 @@
|
||||||
</navigator>
|
</navigator>
|
||||||
</nut-form-item>
|
</nut-form-item>
|
||||||
<view style="display: flex; justify-content: center">
|
<view style="display: flex; justify-content: center">
|
||||||
|
|
||||||
<image v-if="_form.assessmentUserSignature" :src="_form.assessmentUserSignature" mode="aspectFit" style="height: 300rpx"></image>
|
<image v-if="_form.assessmentUserSignature" :src="_form.assessmentUserSignature" mode="aspectFit" style="height: 300rpx"></image>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
@ -56,7 +55,6 @@
|
||||||
</navigator>
|
</navigator>
|
||||||
</nut-form-item>
|
</nut-form-item>
|
||||||
<view style="display: flex; justify-content: center">
|
<view style="display: flex; justify-content: center">
|
||||||
|
|
||||||
<image v-if="_form.byAssessmentEnterprisesUnitUserSignature" :src="_form.byAssessmentEnterprisesUnitUserSignature" mode="heightFix" style="height: 300rpx"></image>
|
<image v-if="_form.byAssessmentEnterprisesUnitUserSignature" :src="_form.byAssessmentEnterprisesUnitUserSignature" mode="heightFix" style="height: 300rpx"></image>
|
||||||
</view>
|
</view>
|
||||||
</nut-form>
|
</nut-form>
|
||||||
|
|
|
@ -27,7 +27,6 @@ const _index = ref(0)
|
||||||
import { useDailyStore } from '@/store/daily'
|
import { useDailyStore } from '@/store/daily'
|
||||||
const store = useDailyStore()
|
const store = useDailyStore()
|
||||||
|
|
||||||
|
|
||||||
const width = ref(0)
|
const width = ref(0)
|
||||||
const height = ref(300)
|
const height = ref(300)
|
||||||
const points = ref([]) // 画笔路径点集合
|
const points = ref([]) // 画笔路径点集合
|
||||||
|
@ -40,7 +39,6 @@ useLoad((options) => {
|
||||||
Taro.setNavigationBarTitle({
|
Taro.setNavigationBarTitle({
|
||||||
title: options.name,
|
title: options.name,
|
||||||
})
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
const ctx = ref(null)
|
const ctx = ref(null)
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
@ -110,12 +108,13 @@ const handleConfirm = () => {
|
||||||
|
|
||||||
const tempPath = res.tempFilePath
|
const tempPath = res.tempFilePath
|
||||||
const ctx = Taro.createCanvasContext('camCacnvs', that)
|
const ctx = Taro.createCanvasContext('camCacnvs', that)
|
||||||
|
const scale = 0.5
|
||||||
var targetWidth
|
var targetWidth
|
||||||
var targetHeight
|
var targetHeight
|
||||||
// 前置图片旋转处理 ___________________________________________________________________
|
// 前置图片旋转处理 ___________________________________________________________________
|
||||||
if (direction.value) {
|
if (direction.value) {
|
||||||
targetWidth = height.value * 0.5
|
targetWidth = height.value * scale
|
||||||
targetHeight = width.value * 0.5
|
targetHeight = width.value * scale
|
||||||
// 计算旋转后的外接矩形尺寸
|
// 计算旋转后的外接矩形尺寸
|
||||||
const angle = (270 * Math.PI) / 180 // 逆时针旋转 270 度
|
const angle = (270 * Math.PI) / 180 // 逆时针旋转 270 度
|
||||||
const rotatedWidth = Math.abs(width.value * Math.cos(angle)) + Math.abs(height.value * Math.sin(angle))
|
const rotatedWidth = Math.abs(width.value * Math.cos(angle)) + Math.abs(height.value * Math.sin(angle))
|
||||||
|
@ -129,8 +128,8 @@ const handleConfirm = () => {
|
||||||
ctx.rotate(angle)
|
ctx.rotate(angle)
|
||||||
ctx.drawImage(tempPath, 0, 0, targetHeight, targetWidth)
|
ctx.drawImage(tempPath, 0, 0, targetHeight, targetWidth)
|
||||||
} else {
|
} else {
|
||||||
targetWidth = width.value * 0.5
|
targetWidth = width.value * scale
|
||||||
targetHeight = height.value * 0.5
|
targetHeight = height.value * scale
|
||||||
ctx.drawImage(tempPath, 0, 0, targetWidth, targetHeight)
|
ctx.drawImage(tempPath, 0, 0, targetWidth, targetHeight)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,5 +171,4 @@ const changeDirection = () => {
|
||||||
direction.value = !direction.value
|
direction.value = !direction.value
|
||||||
Taro.vibrateShort({ type: 'medium' }).then()
|
Taro.vibrateShort({ type: 'medium' }).then()
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue