This commit is contained in:
曹辉 2023-04-12 17:18:33 +08:00
parent e2c8a2ec50
commit f3483776c0
4 changed files with 292 additions and 288 deletions

View File

@ -7,7 +7,6 @@ export function personRevenue(nurseStationPersonId, monthTime, monthStartTime, m
method: 'GET' method: 'GET'
}) })
} }
// 个人中心 我的收益 订单列表分页 // 个人中心 我的收益 订单列表分页
export function personRevenueDetails(pageNum, pageSize, nurseStationPersonId, monthTime, monthStartTime, monthEndTime) { export function personRevenueDetails(pageNum, pageSize, nurseStationPersonId, monthTime, monthStartTime, monthEndTime) {
return request({ return request({

View File

@ -102,9 +102,9 @@
</view> </view>
</u-popup> </u-popup>
<u-mask :show="show" @click="show = false"> <u-mask :show="show" @click="show = false">
<view style="position:absolute;bottom:0;height:800rpx;width:100%;background-color: #fff;" v-if='show'> <view style="position:absolute;bottom:0;height:800rpx;width:100%;background-color: #F4F5F7;" v-if='show'>
<signature @userSignaturePictureUrl='userSignaturePicture' @click.native.stop <signature @userSignaturePictureUrl='userSignaturePicture' @click.native.stop
style='background-color: #F4F5F7;width: 100%;height: 800rpx;'></signature> style='width: 100%;height: 800rpx;'></signature>
</view> </view>
</u-mask> </u-mask>
<u-toast ref="uToast" /> <u-toast ref="uToast" />
@ -131,7 +131,6 @@
serviceEndPictureUrl: null, serviceEndPictureUrl: null,
userSignaturePictureUrl: null, userSignaturePictureUrl: null,
list: { list: {
res: {},
id: null, id: null,
serviceLocationName: null, serviceLocationName: null,
onDutyPictureUrl: null, onDutyPictureUrl: null,

View File

@ -1,5 +1,5 @@
<template> <template>
<view class="signature" style="background-color: #F4F5F7;height: 400rpx;"> <view class="signature" style="background-color: #F4F5F7;height: 800rpx;width: 100%;">
<Signature @init="onSignInit" style='background-color: #fff;height: 700rpx;width: 100%;'></Signature> <Signature @init="onSignInit" style='background-color: #fff;height: 700rpx;width: 100%;'></Signature>
<view class="btns"> <view class="btns">
<button @click="clear">清空</button> <button @click="clear">清空</button>

View File

@ -1,20 +1,13 @@
<template> <template>
<view class="signature-wrap"> <view class="signature-wrap">
<canvas <canvas :canvas-id="cid" :id="cid" @touchstart="onTouchStart" @touchmove="onTouchMove" @touchend="onTouchEnd"
:canvas-id="cid" disable-scroll style="width: 100%;height: 600rpx;"></canvas>
:id="cid"
@touchstart="onTouchStart"
@touchmove="onTouchMove"
@touchend="onTouchEnd"
disable-scroll
style="width: 100%;height: 600rpx;"
></canvas>
<slot /> <slot />
</view> </view>
</template> </template>
<script> <script>
/** /**
* sign canvas 手写签名 * sign canvas 手写签名
* @description 设置线条宽度颜色撤回清空 * @description 设置线条宽度颜色撤回清空
* @tutorial * @tutorial
@ -28,9 +21,11 @@
* @event {Function} init 当创建完 canvas 实例后触发向外提供 canvas实例撤回清空方法 * @event {Function} init 当创建完 canvas 实例后触发向外提供 canvas实例撤回清空方法
* @example <v-sign @init="signInit"></v-sign> * @example <v-sign @init="signInit"></v-sign>
*/ */
import { formatSize } from '../../utils' import {
formatSize
} from '../../utils'
export default { export default {
name: 'v-sign', name: 'v-sign',
props: { props: {
// canvas id // canvas id
@ -85,7 +80,10 @@ export default {
}, },
created() { created() {
// //
const { windowWidth, windowHeight } = uni.getSystemInfoSync() const {
windowWidth,
windowHeight
} = uni.getSystemInfoSync()
this.winWidth = windowWidth this.winWidth = windowWidth
this.winHeight = windowHeight this.winHeight = windowHeight
}, },
@ -111,13 +109,11 @@ export default {
width: this.penLineWidth || this.lineWidth width: this.penLineWidth || this.lineWidth
}, },
// //
coordinates: [ coordinates: [{
{
type: e.type, type: e.type,
x: pos.x, x: pos.x,
y: pos.y y: pos.y
} }]
]
}) })
this.drawLine() this.drawLine()
}, },
@ -240,8 +236,7 @@ export default {
// canvas h5 base64 // canvas h5 base64
canvasToTempFilePath(conf = {}) { canvasToTempFilePath(conf = {}) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.canvasToTempFilePath( uni.canvasToTempFilePath({
{
canvasId: this.cid, canvasId: this.cid,
...conf, ...conf,
success: res => { success: res => {
@ -293,9 +288,18 @@ export default {
* y = (1-t)²*y0 + 2t(1-t)*y1 + *y2 * y = (1-t)²*y0 + 2t(1-t)*y1 + *y2
*/ */
caculateBezier(P0, P2, B, t = 0.5) { caculateBezier(P0, P2, B, t = 0.5) {
const { x: x0, y: y0 } = P0 const {
const { x: x2, y: y2 } = P2 x: x0,
const { x, y } = B y: y0
} = P0
const {
x: x2,
y: y2
} = P2
const {
x,
y
} = B
let x1 = (x - (1 - t) * (1 - t) * x0 - t * t * x2) / (2 * t * (1 - t)) let x1 = (x - (1 - t) * (1 - t) * x0 - t * t * x2) / (2 * t * (1 - t))
let y1 = (y - (1 - t) * (1 - t) * y0 - t * t * y2) / (2 * t * (1 - t)) let y1 = (y - (1 - t) * (1 - t) * y0 - t * t * y2) / (2 * t * (1 - t))
return { return {
@ -304,11 +308,13 @@ export default {
} }
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.signature-wrap { .signature-wrap {
position: relative; position: relative;
} height: 600rpx;
width: 100%;
}
</style> </style>