签名倒置问题优化

This commit is contained in:
bb_pan 2025-09-29 10:24:56 +08:00
parent 0eba5a56fe
commit f66c81d03b
1 changed files with 32 additions and 2 deletions

View File

@ -22,7 +22,7 @@
<view class="fun-box-btn clear flex" @click="clear">
<text>清空</text>
</view>
<view class="fun-box-btn confirm flex" @click="confirm">
<view v-if="isLandscape" class="fun-box-btn confirm flex" @click="confirm">
<text>确认</text>
</view>
<view class="fun-box-btn cancel flex" @click="cancel">
@ -38,7 +38,7 @@
</template>
<script setup>
import { ref, reactive, watch, getCurrentInstance } from 'vue'
import { ref, reactive, watch, getCurrentInstance, onMounted, onUnmounted } from 'vue'
import { useMemberStore } from '@/stores'
const emits = defineEmits(['update:modelValue', 'complete'])
@ -71,6 +71,36 @@ if (memberStore.userInfo.nickName && memberStore.userInfo.nickName.length < 5) {
const paths = ref([]) //
const PEN = { width: 6, color: '#000000' } //
const isLandscape = ref(true) //
//
const handleResize = () => {
const { windowWidth, windowHeight } = uni.getSystemInfoSync()
console.log('🚀 ~ handleResize ~ windowWidth, windowHeight:', windowWidth, windowHeight)
isLandscape.value = windowWidth < windowHeight
// canvas
setTimeout(() => {
uni.createSelectorQuery()
.in(_this)
.select('#mycanvas')
.fields({ size: true, rect: true }, (data) => {
if (data) {
drawBackground(canvaCtx, data.width, data.height)
}
})
.exec()
}, 50)
}
onMounted(() => {
uni.onWindowResize(handleResize)
handleResize() //
})
onUnmounted(() => {
uni.offWindowResize(handleResize)
})
watch(
() => props.modelValue,