This commit is contained in:
bb_pan 2025-07-19 14:09:33 +08:00
parent 3f3638bcab
commit dc44e00aec
4 changed files with 71 additions and 31 deletions

View File

@ -3,7 +3,8 @@
<canvas class="scroll-view" id="mycanvas" canvas-id="mycanvas"
@touchstart="touchstart"
@touchmove="touchmove"
@touchend="touchend"/>
@touchend="touchend"
disable-scroll="true"/>
<view class="fun-box">
<view class="fun-box-btn clear flex" @click="clear">
<text>清空</text>
@ -76,31 +77,67 @@
}
}
//
const draw = ()=> {
let point1 = points[0]
let point2 = points[1]
points.shift()
canvaCtx.moveTo(point1.X, point1.Y)
canvaCtx.lineTo(point2.X, point2.Y)
canvaCtx.stroke()
canvaCtx.draw(true)
// const draw = ()=> {
// let point1 = points[0]
// let point2 = points[1]
// points.shift()
// canvaCtx.moveTo(point1.X, point1.Y)
// canvaCtx.lineTo(point2.X, point2.Y)
// canvaCtx.stroke()
// canvaCtx.draw(true)
// }
const draw = () => {
if (points.length < 2) return;
canvaCtx.beginPath();
canvaCtx.moveTo(points[0].X, points[0].Y);
for (let i = 1; i < points.length; i++) {
canvaCtx.lineTo(points[i].X, points[i].Y);
}
canvaCtx.stroke();
canvaCtx.draw(true);
//
points = [points[points.length - 1]]; //
}
//
const touchend = e=>{
points = [];
}
//
const clear = ()=>{
return uni.getSystemInfo()
.then(res=>{
canvaCtx.clearRect(0, 0, res.windowWidth, res.windowHeight);
canvaCtx.draw(true);
return res
})
.catch(err=>{
// console.log(err);
})
}
// const clear = ()=>{
// return uni.getSystemInfo()
// .then(res=>{
// canvaCtx.clearRect(0, 0, res.windowWidth, res.windowHeight);
// canvaCtx.draw(true);
// return res
// })
// .catch(err=>{
// // console.log(err);
// })
// }
const clear = () => {
return new Promise((resolve, reject) => {
uni.createSelectorQuery()
.in(_this)
.select('#mycanvas') // id canvas
.fields({ size: true, rect: true }, data => {
if (!data) {
reject('Canvas not found')
return
}
const { width, height } = data
// canvas
canvaCtx.clearRect(0, 0, width, height)
canvaCtx.draw(true)
resolve()
})
.exec()
})
}
//
const confirm = ()=>{
uni.canvasToTempFilePath({ canvasId: 'mycanvas', }, _this, _this.parent)

View File

@ -257,7 +257,7 @@ const uploadSignUrl = async (base64Data) => {
<style lang="scss" scoped>
.img {
height: 300px;
height: 500px;
display: flex;
justify-content: center;
align-items: center;
@ -294,7 +294,7 @@ const uploadSignUrl = async (base64Data) => {
}
}
.signature-page {
min-height: 99vh;
min-height: 94vh;
overflow-x: hidden;
overflow-y: auto;
position: relative;

View File

@ -79,24 +79,24 @@
<div class="cont">{{ item.leasePerson }}</div>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<!-- <uni-row :gutter="24">
<uni-col :span="6">预领数量</uni-col>
<uni-col :span="18">
<div class="cont">{{ item.preCountNum }}</div>
</uni-col>
</uni-row>
</uni-row> -->
<uni-row :gutter="24">
<uni-col :span="6">已领数量</uni-col>
<uni-col :span="6">出库数量</uni-col>
<uni-col :span="18">
<div class="cont">{{ item.alNum }}</div>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<!-- <uni-row :gutter="24">
<uni-col :span="6">待领数量</uni-col>
<uni-col :span="18">
<div class="cont">{{ item.preCountNum - item.alNum }}</div>
</uni-col>
</uni-row>
</uni-row> -->
</uni-swipe-action-item>
</uni-swipe-action>
</view>
@ -116,11 +116,14 @@ import { onBackPress } from '@dcloudio/uni-app'
const total = ref(0) //
const active = ref(1) // tap
const tableList = ref([]) //
const dateArray = ref([]) //
const dateArray = ref([
new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000).toISOString().split('T')[0],
new Date().toISOString().split('T')[0],
]) //
//
const queryParams = ref({
startTime: '', //
endTime: '', //
startTime: dateArray.value[0] || '', //
endTime: dateArray.value[1] || '', //
keyWord: '', //
pageNum: 1,
pageSize: 10,

View File

@ -29,7 +29,7 @@ export const getBackInfo = (id,keyWord) => {
export const getProjectList = (data) => {
return http({
method: 'POST',
url: '/material/select/getProjectInfo',
url: '/material/select/getProjectList',
data:data,
})
}