没改啥

This commit is contained in:
TimSpan 2024-11-13 11:26:27 +08:00
parent c4c2f3cc09
commit a85a9ee17b
2 changed files with 5 additions and 9 deletions

View File

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

View File

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