Merge remote-tracking branch 'origin/main'

This commit is contained in:
wangyilin 2024-11-13 11:38:09 +08:00
commit ac1dc62adc
2 changed files with 5 additions and 9 deletions

View File

@ -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>

View File

@ -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>