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