This commit is contained in:
bb_pan 2025-06-20 16:22:02 +08:00
parent db7a85fe52
commit b075aec5aa
3 changed files with 115 additions and 115 deletions

View File

@ -31,8 +31,9 @@
</uni-forms-item> </uni-forms-item>
</uni-forms> </uni-forms>
<div style="width: 92%;height: auto;margin: 10px;"> </div>
<uni-table stripe emptyText="暂无更多数据" >
<uni-table border stripe emptyText="暂无更多数据" >
<!-- 表头行 --> <!-- 表头行 -->
<uni-tr> <uni-tr>
<uni-th width="120px" style="font-size: 24rpx;" align="center">设备编码</uni-th> <uni-th width="120px" style="font-size: 24rpx;" align="center">设备编码</uni-th>
@ -59,9 +60,6 @@
</uni-td> </uni-td>
</uni-tr> </uni-tr>
</uni-table> </uni-table>
</div>
</div>
<!-- <div class="btn"> <!-- <div class="btn">
<button class="btn-cont">取消</button> <button class="btn-cont">取消</button>

View File

@ -66,7 +66,8 @@
</uni-col> </uni-col>
</uni-row> </uni-row>
</div> </div>
<div class="table-area"> </div>
<uni-table border stripe emptyText="暂无更多数据"> <uni-table border stripe emptyText="暂无更多数据">
<!-- 表头行 --> <!-- 表头行 -->
<uni-tr> <uni-tr>
@ -135,9 +136,6 @@
</uni-td> </uni-td>
</uni-tr> </uni-tr>
</uni-table> </uni-table>
</div>
</div>
<!-- <div class="footer-btn"> <!-- <div class="footer-btn">
<button class="btn-cont" @click="submitNum">确认</button> <button class="btn-cont" @click="submitNum">确认</button>
</div> --> </div> -->

View File

@ -179,23 +179,27 @@ const onCameraError = (message) => {
console.log('🚀 ~ onCameraError ~ message:', message) console.log('🚀 ~ onCameraError ~ message:', message)
} }
const onCameraSuccess = (file) => { const onCameraSuccess = (file) => {
img.src = file uni.showModal({
let signUrl = '' title: '',
content: file,
})
const signUrl = file
// img.src = file
// console.log('🚀 ~ complete ~ img.src:', img.src) // console.log('🚀 ~ complete ~ img.src:', img.src)
img.onload = () => { // img.onload = () => {
const canvas = document.createElement('canvas') // const canvas = document.createElement('canvas')
canvas.width = img.width // canvas.width = img.width
canvas.height = img.height // canvas.height = img.height
const ctx = canvas.getContext('2d') // const ctx = canvas.getContext('2d')
ctx.drawImage(img, 0, 0) // ctx.drawImage(img, 0, 0)
// WebP 0.8 // // WebP 0.8
signUrl = canvas // signUrl = canvas
.toDataURL('image/webp', 0.8) // .toDataURL('image/webp', 0.8)
.replace(/^data:image\/(jpeg|png|webp);base64,/, '') // .replace(/^data:image\/(jpeg|png|webp);base64,/, '')
// console.log('🚀 ~ WebP base64:', signUrl) // // console.log('🚀 ~ WebP base64:', signUrl)
} // }
try { try {
// const signUrl = webpBase64 // const signUrl = webpBase64