修改
This commit is contained in:
parent
52ca54dd63
commit
a892d395bf
20
App.vue
20
App.vue
@ -1,7 +1,25 @@
|
|||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
onLaunch: function() {},
|
onLaunch: function() {},
|
||||||
onShow: function() {},
|
onShow: function() {
|
||||||
|
let that = this
|
||||||
|
try {
|
||||||
|
const value = uni.getStorageSync('nursePersonId');
|
||||||
|
if (value) {} else {
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.reLaunch({
|
||||||
|
url: '/pages/login/login'
|
||||||
|
});
|
||||||
|
}, 2000);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.reLaunch({
|
||||||
|
url: '/pages/login/login'
|
||||||
|
});
|
||||||
|
}, 2000);
|
||||||
|
}
|
||||||
|
},
|
||||||
onHide: function() {}
|
onHide: function() {}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
9
api/confirmCompletion/index.js
Normal file
9
api/confirmCompletion/index.js
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import request from "../request.js"
|
||||||
|
|
||||||
|
export function orderConfirm(data) {
|
||||||
|
return request({
|
||||||
|
url: `/nurseApp/personLogin/orderConfirm`,
|
||||||
|
method: 'POST',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
15
components/v-sign/utils.js
Normal file
15
components/v-sign/utils.js
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
/**
|
||||||
|
* 判断是否未数值
|
||||||
|
* @param {Object} val
|
||||||
|
*/
|
||||||
|
export function isNumber(val) {
|
||||||
|
return !isNaN(Number(val))
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理大小单位
|
||||||
|
* @param {Object} val
|
||||||
|
*/
|
||||||
|
export function formatSize(val) {
|
||||||
|
return isNumber(val) ? `${val}rpx` : val
|
||||||
|
}
|
||||||
162
components/v-sign/v-sign-action.vue
Normal file
162
components/v-sign/v-sign-action.vue
Normal file
@ -0,0 +1,162 @@
|
|||||||
|
<template>
|
||||||
|
<view class="v-sign-action" :style="[customStyle]">
|
||||||
|
<view
|
||||||
|
v-for="item in btns"
|
||||||
|
:key="item.label"
|
||||||
|
:class="['btn', { border: border }]"
|
||||||
|
:style="[{ 'margin-right': formatSize(space) }]"
|
||||||
|
@click="onBtnClick(item)"
|
||||||
|
>
|
||||||
|
<image :class="['icon', 'icon-' + item.action]" :src="item.icon"></image>
|
||||||
|
<text class="text">{{ item.label }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
/**
|
||||||
|
* v-sign-action 控制按钮组(v-sign 子组件)
|
||||||
|
* @description 控制 v-sign 组件的一些按钮
|
||||||
|
* @tutorial
|
||||||
|
* @property {Array} actions 按钮配置 所有值: 清空(clear), 撤回(prev) 保存图片(save)
|
||||||
|
* @property {Boolean} border 按钮是否有边框
|
||||||
|
* @property {String/Number} space 按钮间隔
|
||||||
|
* @property {Object} customStyle 根元素自定义样式
|
||||||
|
* @event {Function} 点击对应类型按钮触发对应事件, 例如点击 clear 则触发 clear 事件
|
||||||
|
* @example 示例
|
||||||
|
**/
|
||||||
|
import { formatSize } from './utils'
|
||||||
|
|
||||||
|
// v-sign 父组件提供的接口
|
||||||
|
let vSignInterface
|
||||||
|
// 按钮类型
|
||||||
|
const btn_type = {
|
||||||
|
CLEAR: 'clear', // 清空
|
||||||
|
PREV: 'prev', // 撤回/上一步
|
||||||
|
// NEXT: 'next',
|
||||||
|
SAVE: 'save' // 保存临时图片
|
||||||
|
}
|
||||||
|
const all_action = Object.values(btn_type)
|
||||||
|
const btnsConf = [
|
||||||
|
{
|
||||||
|
label: '清空',
|
||||||
|
action: btn_type.CLEAR,
|
||||||
|
icon: '/static/v-sign/clear.png'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '撤回',
|
||||||
|
action: btn_type.PREV,
|
||||||
|
icon: '/static/v-sign/prev.png'
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// label: '取消撤回',
|
||||||
|
// action: btn_type.NEXT,
|
||||||
|
// icon: '/static/v-sign/next.png'
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
label: '保存',
|
||||||
|
action: btn_type.SAVE,
|
||||||
|
icon: '/static/v-sign/save.png'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: 'v-sign-action',
|
||||||
|
props: {
|
||||||
|
// 按钮配置
|
||||||
|
actions: {
|
||||||
|
type: Array,
|
||||||
|
default: () => all_action
|
||||||
|
},
|
||||||
|
// 按钮是否有边框
|
||||||
|
border: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
// 按钮间隔
|
||||||
|
space: {
|
||||||
|
type: [String, Number],
|
||||||
|
default: 12
|
||||||
|
},
|
||||||
|
// 根元素自定义样式
|
||||||
|
customStyle: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
inject: ['getInterface'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
formatSize
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
btns() {
|
||||||
|
return btnsConf.filter(item => this.actions.includes(item.action))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
vSignInterface = this.getInterface()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async onBtnClick(btn) {
|
||||||
|
// console.log(btn, btn.action)
|
||||||
|
let emit_result
|
||||||
|
switch (btn.action) {
|
||||||
|
case btn_type.CLEAR:
|
||||||
|
vSignInterface.clear()
|
||||||
|
break
|
||||||
|
case btn_type.PREV:
|
||||||
|
vSignInterface.revoke()
|
||||||
|
break
|
||||||
|
// case btn_type.NEXT:
|
||||||
|
// console.log('next')
|
||||||
|
// break
|
||||||
|
case btn_type.SAVE:
|
||||||
|
emit_result = await vSignInterface.canvasToTempFilePath()
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
// console.log(btn.action, emit_result);
|
||||||
|
// 触发按钮对应类型事件
|
||||||
|
this.$emit(btn.action, emit_result)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.v-sign-action {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
.btn {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 12rpx;
|
||||||
|
min-width: 88rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
&:last-child {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
&.border {
|
||||||
|
border: 2rpx solid #666;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
}
|
||||||
|
.icon {
|
||||||
|
width: 28rpx;
|
||||||
|
height: 28rpx;
|
||||||
|
&.icon-clear,
|
||||||
|
&.icon-prev,
|
||||||
|
&.icon-next {
|
||||||
|
margin-right: 4rpx;
|
||||||
|
}
|
||||||
|
&.icon-save {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.text {
|
||||||
|
color: #666;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
211
components/v-sign/v-sign-pen.vue
Normal file
211
components/v-sign/v-sign-pen.vue
Normal file
@ -0,0 +1,211 @@
|
|||||||
|
<template>
|
||||||
|
<view class="v-sign-pen">
|
||||||
|
<view class="label" v-if="label">{{ label }}</view>
|
||||||
|
<view class="options">
|
||||||
|
<view
|
||||||
|
class="opt-item"
|
||||||
|
:style="{
|
||||||
|
minHeight: minWrapHeight,
|
||||||
|
marginRight: space + 'rpx'
|
||||||
|
}"
|
||||||
|
v-for="item in csizes"
|
||||||
|
:key="item.size"
|
||||||
|
@click="onItemClick(item)"
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
:class="type"
|
||||||
|
:style="{
|
||||||
|
border:
|
||||||
|
border && currentSelect.size === item.size
|
||||||
|
? `${borderWidth}rpx solid ${activeColor}`
|
||||||
|
: ''
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<view class="inner" :style="[defaultInnerStyle(item)]"></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
/**
|
||||||
|
* v-sign-pen 画笔(v-sign 子组件)
|
||||||
|
* @description 控制 v-sign 画笔的线宽
|
||||||
|
* @tutorial
|
||||||
|
* @property {String} type 选项样式 line / circle
|
||||||
|
* @property {String} label 标签
|
||||||
|
* @property {Array} sizes 画笔大小数组,单位 px
|
||||||
|
* @property {String} color 选项颜色
|
||||||
|
* @property {String} activeColor 选中项颜色
|
||||||
|
* @property {Boolean} border 选中项是否有边框
|
||||||
|
* @property {Number} borderWidth 边框大小,单位 rpx
|
||||||
|
* @property {String} space 选项间隙,单位 rpx
|
||||||
|
* @property {Number} bigger 圆点变大变粗倍数
|
||||||
|
* @property {Number} minSize 圆点最小大小,单位 px
|
||||||
|
* @event {Function} change 选择画笔大小时触发
|
||||||
|
* @example
|
||||||
|
**/
|
||||||
|
// v-sign 父组件提供的接口
|
||||||
|
let vSignInterface
|
||||||
|
// 选项样式
|
||||||
|
const type_style = {
|
||||||
|
CIRCLE: 'circle',
|
||||||
|
LINE: 'line'
|
||||||
|
}
|
||||||
|
export default {
|
||||||
|
name: 'v-sign-pen',
|
||||||
|
props: {
|
||||||
|
// 选项样式
|
||||||
|
type: {
|
||||||
|
type: String,
|
||||||
|
default: type_style.CIRCLE
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
type: String
|
||||||
|
},
|
||||||
|
// 画笔大小数组,单位是px
|
||||||
|
sizes: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [2, 4, 6, 8, 10]
|
||||||
|
},
|
||||||
|
// 选项颜色
|
||||||
|
color: {
|
||||||
|
type: String,
|
||||||
|
default: '#333'
|
||||||
|
},
|
||||||
|
// 选中项颜色
|
||||||
|
activeColor: {
|
||||||
|
type: String,
|
||||||
|
default: '#333'
|
||||||
|
},
|
||||||
|
// 选中项是否有边框
|
||||||
|
border: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
// 边框大小, 单位 rpx
|
||||||
|
borderWidth: {
|
||||||
|
type: Number,
|
||||||
|
default: 4
|
||||||
|
},
|
||||||
|
// 选项间隙, 单位 rpx
|
||||||
|
space: {
|
||||||
|
type: Number,
|
||||||
|
default: 20
|
||||||
|
},
|
||||||
|
// 圆点变大变粗倍数
|
||||||
|
bigger: {
|
||||||
|
type: Number,
|
||||||
|
default: 2
|
||||||
|
},
|
||||||
|
// 圆点最小大小,单位 px
|
||||||
|
minSize: {
|
||||||
|
type: Number,
|
||||||
|
default: 4
|
||||||
|
}
|
||||||
|
},
|
||||||
|
inject: ['getInterface'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
type_style,
|
||||||
|
currentSelect: null,
|
||||||
|
csizes: [],
|
||||||
|
maxSize: 0,
|
||||||
|
maxCsize: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
minWrapHeight() {
|
||||||
|
let height
|
||||||
|
switch (this.type) {
|
||||||
|
case type_style.CIRCLE:
|
||||||
|
height = this.maxCsize + 10 + 'px'
|
||||||
|
break
|
||||||
|
case type_style.LINE:
|
||||||
|
height = this.maxSize + 4 + 'px'
|
||||||
|
break
|
||||||
|
}
|
||||||
|
return height
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.csizes = this.sizes.map((size, index) => {
|
||||||
|
const csize = (index + 1) * this.bigger + this.minSize
|
||||||
|
this.maxSize = csize > this.maxSize ? csize : this.maxSize
|
||||||
|
this.maxCsize = csize > this.maxCsize ? csize : this.maxCsize
|
||||||
|
return {
|
||||||
|
size,
|
||||||
|
csize
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.currentSelect = this.csizes[0]
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
vSignInterface = this.getInterface()
|
||||||
|
this.setLineWidth()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onItemClick(opt) {
|
||||||
|
this.currentSelect = opt
|
||||||
|
this.setLineWidth()
|
||||||
|
this.$emit('change', opt.size)
|
||||||
|
},
|
||||||
|
setLineWidth() {
|
||||||
|
vSignInterface.setLineWidth(this.currentSelect.size)
|
||||||
|
},
|
||||||
|
defaultInnerStyle(item) {
|
||||||
|
let width
|
||||||
|
let height
|
||||||
|
switch (this.type) {
|
||||||
|
case type_style.CIRCLE:
|
||||||
|
width = `${item.csize}px`
|
||||||
|
height = `${item.csize}px`
|
||||||
|
break
|
||||||
|
case type_style.LINE:
|
||||||
|
width = '20px'
|
||||||
|
height = `${item.size}px`
|
||||||
|
break
|
||||||
|
}
|
||||||
|
const background = this.currentSelect.size === item.size ? this.activeColor : this.color
|
||||||
|
return {
|
||||||
|
width,
|
||||||
|
height,
|
||||||
|
background
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.v-sign-pen {
|
||||||
|
padding: 12rpx;
|
||||||
|
.label {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
.options {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
.opt-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
justify-content: center;
|
||||||
|
&:last-child {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
.circle {
|
||||||
|
border-radius: 50%;
|
||||||
|
padding: 4rpx;
|
||||||
|
.inner {
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.line {
|
||||||
|
padding: 4rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
238
components/v-sign/v-sign.vue
Normal file
238
components/v-sign/v-sign.vue
Normal file
@ -0,0 +1,238 @@
|
|||||||
|
<template>
|
||||||
|
<view class="signature-wrap">
|
||||||
|
<canvas
|
||||||
|
:canvas-id="cid"
|
||||||
|
:id="cid"
|
||||||
|
@touchstart="onTouchStart"
|
||||||
|
@touchmove="onTouchMove"
|
||||||
|
@touchend="onTouchEnd"
|
||||||
|
style="height:600rpx"
|
||||||
|
:style="[{ width: formatSize(width)}, customStyle]"
|
||||||
|
></canvas>
|
||||||
|
<slot />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
/**
|
||||||
|
* sign canvas 手写签名
|
||||||
|
* @description 设置线条宽度、颜色,撤回,清空
|
||||||
|
* @tutorial
|
||||||
|
* @property {String} cid canvas id 不设置则默认为 v-sign-时间戳
|
||||||
|
* @property {String, Number} width canvas 宽度
|
||||||
|
* @property {String, Number} height canvas 高度
|
||||||
|
* @property {Object} customStyle 自定义样式
|
||||||
|
* @property {String} lineColor 画笔颜色
|
||||||
|
* @property {Number} lineWidth 画笔大小,权重大于 v-sign-pen 组件设置的画笔大小
|
||||||
|
* @event {Function} init 当创建完 canvas 实例后触发,向外提供 canvas实例,撤回,清空方法
|
||||||
|
* @example <v-sign @init="signInit"></v-sign>
|
||||||
|
*/
|
||||||
|
import { formatSize } from './utils'
|
||||||
|
// convas 实例
|
||||||
|
let canvasCtx
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'v-sign',
|
||||||
|
props: {
|
||||||
|
// canvas id
|
||||||
|
cid: {
|
||||||
|
type: String,
|
||||||
|
default: `v-sign-${Date.now()}`
|
||||||
|
// required: true
|
||||||
|
},
|
||||||
|
// canvas 宽度
|
||||||
|
width: {
|
||||||
|
type: [String, Number],
|
||||||
|
default: '100%'
|
||||||
|
},
|
||||||
|
// canvas 高度
|
||||||
|
height: {
|
||||||
|
type: [String, Number],
|
||||||
|
default: 300
|
||||||
|
},
|
||||||
|
// 画笔大小,权重大于 v-sign-pen 组件设置的画笔大小
|
||||||
|
lineWidth: {
|
||||||
|
type: Number
|
||||||
|
},
|
||||||
|
// 线颜色
|
||||||
|
lineColor: {
|
||||||
|
type: String,
|
||||||
|
default: '#000'
|
||||||
|
},
|
||||||
|
// canvas自定义样式
|
||||||
|
customStyle: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
provide() {
|
||||||
|
return {
|
||||||
|
getInterface: this.provideInterface
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
formatSize,
|
||||||
|
lineData: [],
|
||||||
|
winWidth: 0,
|
||||||
|
winHeight: 0,
|
||||||
|
penLineWidth: null, // v-sign-pen 组件设置的画笔大小
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
canvasCtx = uni.createCanvasContext(this.cid, this)
|
||||||
|
// 初始化完成,向外暴露接口
|
||||||
|
this.$emit('init', this.provideInterface())
|
||||||
|
// 获取窗口宽高
|
||||||
|
uni.getSystemInfo({
|
||||||
|
success: res => {
|
||||||
|
this.winWidth = res.windowWidth
|
||||||
|
this.winHeight = res.windowHeight
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onTouchStart(e) {
|
||||||
|
const pos = e.touches[0]
|
||||||
|
this.lineData.push({
|
||||||
|
style: {
|
||||||
|
color: this.lineColor,
|
||||||
|
width: this.lineWidth || this.penLineWidth || 4
|
||||||
|
},
|
||||||
|
// 屏幕坐标
|
||||||
|
coordinates: [
|
||||||
|
{
|
||||||
|
type: e.type,
|
||||||
|
x: pos.x,
|
||||||
|
y: pos.y
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
this.drawLine()
|
||||||
|
},
|
||||||
|
onTouchMove(e) {
|
||||||
|
const pos = e.touches[0]
|
||||||
|
this.lineData[this.lineData.length - 1].coordinates.push({
|
||||||
|
type: e.type,
|
||||||
|
x: pos.x,
|
||||||
|
y: pos.y
|
||||||
|
})
|
||||||
|
this.drawLine()
|
||||||
|
},
|
||||||
|
onTouchEnd(e) {
|
||||||
|
// console.log(e.type, e)
|
||||||
|
},
|
||||||
|
// 清空画布
|
||||||
|
clear() {
|
||||||
|
this.lineData = []
|
||||||
|
canvasCtx.clearRect(0, 0, this.winWidth, this.winHeight)
|
||||||
|
canvasCtx.draw()
|
||||||
|
},
|
||||||
|
// 撤销
|
||||||
|
revoke() {
|
||||||
|
this.lineData.pop()
|
||||||
|
this.lineData.forEach((item, index) => {
|
||||||
|
canvasCtx.beginPath()
|
||||||
|
canvasCtx.setLineCap('round')
|
||||||
|
canvasCtx.setStrokeStyle(item.style.color)
|
||||||
|
canvasCtx.setLineWidth(item.style.width)
|
||||||
|
item.coordinates.forEach(pos => {
|
||||||
|
if (pos.type == 'touchstart') {
|
||||||
|
canvasCtx.moveTo(pos.x, pos.y)
|
||||||
|
} else {
|
||||||
|
canvasCtx.lineTo(pos.x, pos.y)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
canvasCtx.stroke()
|
||||||
|
})
|
||||||
|
canvasCtx.draw()
|
||||||
|
},
|
||||||
|
// 绘制线条
|
||||||
|
drawLine() {
|
||||||
|
const lineDataLen = this.lineData.length
|
||||||
|
if (!lineDataLen) return
|
||||||
|
const currentLineData = this.lineData[lineDataLen - 1]
|
||||||
|
const coordinates = currentLineData.coordinates
|
||||||
|
const coordinatesLen = coordinates.length
|
||||||
|
if (!coordinatesLen) return
|
||||||
|
let startPos
|
||||||
|
let endPos
|
||||||
|
if (coordinatesLen < 2) {
|
||||||
|
// only start, no move event
|
||||||
|
startPos = coordinates[coordinatesLen - 1]
|
||||||
|
endPos = { x: startPos.x + 1, y: startPos.y }
|
||||||
|
} else {
|
||||||
|
startPos = coordinates[coordinatesLen - 2]
|
||||||
|
endPos = coordinates[coordinatesLen - 1]
|
||||||
|
}
|
||||||
|
|
||||||
|
const style = currentLineData.style
|
||||||
|
canvasCtx.beginPath()
|
||||||
|
canvasCtx.setLineCap('round')
|
||||||
|
canvasCtx.setStrokeStyle(style.color)
|
||||||
|
canvasCtx.setLineWidth(style.width)
|
||||||
|
canvasCtx.moveTo(startPos.x, startPos.y)
|
||||||
|
canvasCtx.lineTo(endPos.x, endPos.y)
|
||||||
|
// const P1 = this.caculateBezier(startPos, endPos, centerPos)
|
||||||
|
// console.log(P1.x, P1.y)
|
||||||
|
// canvasCtx.moveTo(startPos.x, startPos.y)
|
||||||
|
// canvasCtx.quadraticCurveTo(P1.x, P1.y, endPos.x, endPos.y)
|
||||||
|
canvasCtx.stroke()
|
||||||
|
canvasCtx.draw(true)
|
||||||
|
},
|
||||||
|
canvasToTempFilePath(conf = {}) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
uni.canvasToTempFilePath(
|
||||||
|
{
|
||||||
|
canvasId: this.cid,
|
||||||
|
...conf,
|
||||||
|
success: res => {
|
||||||
|
resolve(res.tempFilePath)
|
||||||
|
},
|
||||||
|
fail: err => {
|
||||||
|
console.log('fail', err)
|
||||||
|
reject(err)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
this
|
||||||
|
)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
setLineWidth(numberVal) {
|
||||||
|
this.penLineWidth = numberVal
|
||||||
|
},
|
||||||
|
provideInterface() {
|
||||||
|
return {
|
||||||
|
cid: this.cid,
|
||||||
|
ctx: canvasCtx,
|
||||||
|
clear: this.clear,
|
||||||
|
revoke: this.revoke,
|
||||||
|
canvasToTempFilePath: this.canvasToTempFilePath,
|
||||||
|
setLineWidth: this.setLineWidth
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 计算二次贝塞尔曲线 控制点 P1
|
||||||
|
* 起点 P0(x0,y0)、控制点P1(x1, y1)、P2(x2, y2)、曲线上任意点B(x, y)
|
||||||
|
* 二次贝塞尔公式:B(t) = (1-t)²P0 + 2t(1-t)P1 + t²P2
|
||||||
|
* 代入坐标得:
|
||||||
|
* x = (1-t)²*x0 + 2t(1-t)*x1 + t²*x2
|
||||||
|
* y = (1-t)²*y0 + 2t(1-t)*y1 + t²*y2
|
||||||
|
*/
|
||||||
|
caculateBezier(P0, P2, B, t = 0.5) {
|
||||||
|
const { x: x0, 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 y1 = (y - (1 - t) * (1 - t) * y0 - t * t * y2) / (2 * t * (1 - t))
|
||||||
|
return { x: x1, y: y1 }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.signature-wrap {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
52
pages.json
52
pages.json
@ -4,13 +4,26 @@
|
|||||||
},
|
},
|
||||||
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
||||||
{
|
{
|
||||||
|
"path": "pages/startup/startup",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "启动页",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/confirmCompletion/confirmCompletion",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "完成确认",
|
||||||
|
"navigationBarBackgroundColor": "#ffffff" //背景颜色
|
||||||
|
}
|
||||||
|
}, {
|
||||||
"path": "pages/login/login",
|
"path": "pages/login/login",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "登录",
|
"navigationBarTitleText": "登录",
|
||||||
"navigationBarBackgroundColor": "#ffffff" ,//背景颜色
|
"navigationBarBackgroundColor": "#ffffff", //背景颜色
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},{
|
}, {
|
||||||
"path": "pages/personal/personal",
|
"path": "pages/personal/personal",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "个人信息",
|
"navigationBarTitleText": "个人信息",
|
||||||
@ -24,13 +37,13 @@
|
|||||||
"navigationBarTitleText": "忘记密码",
|
"navigationBarTitleText": "忘记密码",
|
||||||
"navigationBarBackgroundColor": "#ffffff" //背景颜色
|
"navigationBarBackgroundColor": "#ffffff" //背景颜色
|
||||||
}
|
}
|
||||||
},{
|
}, {
|
||||||
"path": "pages/register/register",
|
"path": "pages/register/register",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "注册账号",
|
"navigationBarTitleText": "注册账号",
|
||||||
"navigationBarBackgroundColor": "#ffffff" //背景颜色
|
"navigationBarBackgroundColor": "#ffffff" //背景颜色
|
||||||
}
|
}
|
||||||
},{
|
}, {
|
||||||
"path": "pages/homepage/homepage",
|
"path": "pages/homepage/homepage",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "泉医到家",
|
"navigationBarTitleText": "泉医到家",
|
||||||
@ -38,21 +51,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/confirmCompletion/confirmCompletion",
|
"path": "pages/taskReturn/taskReturn",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "完成确认",
|
|
||||||
"navigationBarBackgroundColor": "#ffffff" //背景颜色
|
|
||||||
}
|
|
||||||
},{
|
|
||||||
"path" : "pages/taskReturn/taskReturn",
|
|
||||||
"style" :
|
|
||||||
{
|
|
||||||
"navigationBarTitleText": "任务退回",
|
"navigationBarTitleText": "任务退回",
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": false,
|
||||||
"navigationBarBackgroundColor": "#ffffff" //背景颜色
|
"navigationBarBackgroundColor": "#ffffff" //背景颜色
|
||||||
}
|
}
|
||||||
|
|
||||||
},{
|
}, {
|
||||||
"path": "pages/Mymission/Mymission",
|
"path": "pages/Mymission/Mymission",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "我的任务",
|
"navigationBarTitleText": "我的任务",
|
||||||
@ -61,10 +67,9 @@
|
|||||||
"navigationBarBackgroundColor": "#ffffff" //背景颜色
|
"navigationBarBackgroundColor": "#ffffff" //背景颜色
|
||||||
}
|
}
|
||||||
|
|
||||||
},{
|
}, {
|
||||||
"path" : "pages/taskDetails/taskDetails",
|
"path": "pages/taskDetails/taskDetails",
|
||||||
"style" :
|
"style": {
|
||||||
{
|
|
||||||
"navigationBarTitleText": "任务详情",
|
"navigationBarTitleText": "任务详情",
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": false,
|
||||||
"navigationBarBackgroundColor": "#ffffff" //背景颜色
|
"navigationBarBackgroundColor": "#ffffff" //背景颜色
|
||||||
@ -79,18 +84,9 @@
|
|||||||
"navigationBarBackgroundColor": "#ffffff" //背景颜色
|
"navigationBarBackgroundColor": "#ffffff" //背景颜色
|
||||||
// "navigationBarTextStyle": "white"
|
// "navigationBarTextStyle": "white"
|
||||||
}
|
}
|
||||||
},
|
}, {
|
||||||
{
|
"path": "pages/signature/signature",
|
||||||
"path": "pages/startup/startup",
|
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "启动页"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
,{
|
|
||||||
"path" : "pages/confirmCompletion/confirmCompletion",
|
|
||||||
"style" :
|
|
||||||
{
|
|
||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,10 +58,12 @@
|
|||||||
return data => data?.nurseStationSysUserVOList?. [0]?.nurseStationName || ''
|
return data => data?.nurseStationSysUserVOList?. [0]?.nurseStationName || ''
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onShow() {
|
||||||
this.info();
|
let that = this
|
||||||
this.baseurl = baseurl;
|
// try {
|
||||||
const that = this
|
// const value = uni.getStorageSync('nursePersonId');
|
||||||
|
// if (value) {} else {}
|
||||||
|
// } catch (e) {}
|
||||||
try {
|
try {
|
||||||
const value = uni.getStorageSync('phonenumber');
|
const value = uni.getStorageSync('phonenumber');
|
||||||
if (value) {
|
if (value) {
|
||||||
@ -75,7 +77,10 @@
|
|||||||
}
|
}
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
this.myInfo()
|
this.myInfo()
|
||||||
|
this.info();
|
||||||
|
this.baseurl = baseurl;
|
||||||
},
|
},
|
||||||
|
onLoad(options) {},
|
||||||
methods: {
|
methods: {
|
||||||
//上传头像
|
//上传头像
|
||||||
uploadImag() {
|
uploadImag() {
|
||||||
@ -98,11 +103,11 @@
|
|||||||
gofinish() {
|
gofinish() {
|
||||||
var that = this
|
var that = this
|
||||||
uni.uploadFile({
|
uni.uploadFile({
|
||||||
url: baseurl + '/nurseApp/personLogin/updateHeadAvatarHead',
|
url: baseurl + '/nurseApplet/uploadFile/uploadHeadPictureUrl',
|
||||||
filePath: that.appPersonallist.avatar, //file: 二进制(filePath)
|
filePath: that.appPersonallist.avatar, //file: 二进制(filePath)
|
||||||
name: 'file',
|
name: 'file',
|
||||||
formData: { //多余值
|
formData: { //多余值
|
||||||
'userId': that.appPersonallist.userId,
|
'nursePersonId': that.appPersonallist.nursePersonId,
|
||||||
},
|
},
|
||||||
timeout: 5000,
|
timeout: 5000,
|
||||||
success(res) {
|
success(res) {
|
||||||
@ -112,9 +117,13 @@
|
|||||||
that.$refs.uToast.show({
|
that.$refs.uToast.show({
|
||||||
title: '修改成功',
|
title: '修改成功',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
url: '/pages/personal/personal',
|
duration: '1500',
|
||||||
duration: '1500'
|
|
||||||
})
|
})
|
||||||
|
setTimeout(e => {
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1
|
||||||
|
})
|
||||||
|
}, 1500)
|
||||||
} else {
|
} else {
|
||||||
that.$refs.uToast.show({
|
that.$refs.uToast.show({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
<view class="app">
|
<view class="app">
|
||||||
<view class="inputs">
|
<view class="inputs">
|
||||||
<i class="icon"></i>
|
<i class="icon"></i>
|
||||||
<input type="text" name="" id="" class="input" placeholder="请输入搜索内容">
|
<input type="text" name="" v-model='nurseItemName' id="" class="input" placeholder="请输入搜索内容">
|
||||||
</view>
|
</view>
|
||||||
<view class="tab">
|
<view class="tab">
|
||||||
<view class="tab-item" @tap="testTabClick(index)" v-for="(item,index) in tabList"
|
<view class="tab-item" @tap="testTabClick(index)" v-for="(item,index) in tabList"
|
||||||
@ -27,7 +27,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="anniu">
|
<view class="anniu">
|
||||||
<view class="logistics" @tap='gotask(item)'>详情</view>
|
<view class="logistics" @tap='gotask(item)'>详情</view>
|
||||||
<view class="logistics harvest">去完成</view>
|
<view class="logistics harvest" @tap='goconfirmCompletion(item)'>去完成</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="Apayment" v-if='choicetab==1' v-for="(item,uindex) in list" :key="uindex">
|
<view class="Apayment" v-if='choicetab==1' v-for="(item,uindex) in list" :key="uindex">
|
||||||
@ -70,19 +70,33 @@
|
|||||||
}, {
|
}, {
|
||||||
name: "已完成"
|
name: "已完成"
|
||||||
}, ],
|
}, ],
|
||||||
nursePersonId: 2, //护理员id
|
nursePersonId: '', //护理员id
|
||||||
orderStatus: 'NOT_FINISH', // orderStatus:订单状态 未完成:NOT_FINISH,服务完成:COMPLETE
|
orderStatus: 'NOT_FINISH', // orderStatus:订单状态 未完成:NOT_FINISH,服务完成:COMPLETE
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
//未完成任务
|
//未完成任务
|
||||||
list: [],
|
list: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
|
nurseItemName: '',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
nurseItemName() {
|
||||||
|
this.selectMissioninfo()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
//去完成
|
||||||
|
goconfirmCompletion(item) {
|
||||||
|
console.log(item)
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/confirmCompletion/confirmCompletion?orderDetailsId=${item.id}&orderNo=${item.orderNo}`
|
||||||
|
})
|
||||||
|
},
|
||||||
//任务list
|
//任务list
|
||||||
selectMissioninfo() {
|
selectMissioninfo() {
|
||||||
selectMission(this.nursePersonId, this.orderStatus, this.pageNum, this.pageSize).then(res => {
|
selectMission(this.nursePersonId, this.orderStatus, this.pageNum, this.pageSize, this.nurseItemName).then(
|
||||||
|
res => {
|
||||||
this.list = res.rows
|
this.list = res.rows
|
||||||
this.total = res.total
|
this.total = res.total
|
||||||
})
|
})
|
||||||
@ -104,7 +118,8 @@
|
|||||||
} else {
|
} else {
|
||||||
this.orderStatus = 'COMPLETE'
|
this.orderStatus = 'COMPLETE'
|
||||||
}
|
}
|
||||||
selectMission(this.nursePersonId, this.orderStatus, this.pageNum, this.pageSize).then(res => {
|
selectMission(this.nursePersonId, this.orderStatus, this.pageNum, this.pageSize, this.nurseItemName).then(
|
||||||
|
res => {
|
||||||
this.list = res.rows
|
this.list = res.rows
|
||||||
this.total = res.total
|
this.total = res.total
|
||||||
})
|
})
|
||||||
@ -115,14 +130,22 @@
|
|||||||
// })
|
// })
|
||||||
// },
|
// },
|
||||||
},
|
},
|
||||||
onLoad() { //开局调用
|
onShow() { //加载的时候执行(没有次数限制)
|
||||||
this.baseurl = baseurl
|
this.baseurl = baseurl
|
||||||
|
var that = this
|
||||||
|
try {
|
||||||
|
const value = uni.getStorageSync('nursePersonId');
|
||||||
|
if (value) {
|
||||||
|
that.nursePersonId = value
|
||||||
this.selectMissioninfo();
|
this.selectMissioninfo();
|
||||||
|
}
|
||||||
|
} catch (e) {}
|
||||||
},
|
},
|
||||||
onReachBottom() { //下滑加载
|
onReachBottom() { //下滑加载
|
||||||
if (this.list.length >= this.total) {} else {
|
if (this.list.length >= this.total) {} else {
|
||||||
this.pageNum++
|
this.pageNum++
|
||||||
selectMission(this.nursePersonId, this.orderStatus, this.pageNum, this.pageSize).then(res => {
|
selectMission(this.nursePersonId, this.orderStatus, this.pageNum, this.pageSize, this.nurseItemName).then(
|
||||||
|
res => {
|
||||||
res.rows.forEach(e => {
|
res.rows.forEach(e => {
|
||||||
this.list.push(e)
|
this.list.push(e)
|
||||||
})
|
})
|
||||||
@ -131,7 +154,8 @@
|
|||||||
},
|
},
|
||||||
onPullDownRefresh() { //下拉刷新
|
onPullDownRefresh() { //下拉刷新
|
||||||
this.pageNum = 1;
|
this.pageNum = 1;
|
||||||
selectMission(this.nursePersonId, this.orderStatus, this.PageNum, this.PageSize).then(res => {
|
selectMission(this.nursePersonId, this.orderStatus, this.PageNum, this.PageSize, this.nurseItemName).then(
|
||||||
|
res => {
|
||||||
this.list = res.rows
|
this.list = res.rows
|
||||||
this.total = res.total
|
this.total = res.total
|
||||||
})
|
})
|
||||||
|
|||||||
@ -4,12 +4,15 @@
|
|||||||
<view class="attendantImg">
|
<view class="attendantImg">
|
||||||
护理员到岗照片
|
护理员到岗照片
|
||||||
</view>
|
</view>
|
||||||
<view class="uppicture">
|
<view class="uppicture" @tap='uploadonDutyPictureUrl'>
|
||||||
<u-upload class="slot-btn" width="530" height="130"></u-upload>
|
<view class="choice" v-if="!list.onDutyPictureUrl">
|
||||||
|
选择图片
|
||||||
</view>
|
</view>
|
||||||
|
<image v-else :src="list.onDutyPictureUrl" mode=""></image>
|
||||||
|
<!-- <u-upload class="slot-btn" width="530" height="130" ></u-upload> -->
|
||||||
</view>
|
</view>
|
||||||
<view class="picture" style="height: 330rpx;">
|
</view>
|
||||||
|
<!-- <view class="picture" style="height: 330rpx;">
|
||||||
<view class="attendantImg">
|
<view class="attendantImg">
|
||||||
服务进行中视频(不少于1min)<span>*选填</span>
|
服务进行中视频(不少于1min)<span>*选填</span>
|
||||||
</view>
|
</view>
|
||||||
@ -20,15 +23,18 @@
|
|||||||
<image src="../../static/radio.png" mode=""></image>
|
<image src="../../static/radio.png" mode=""></image>
|
||||||
用户不同意拍摄
|
用户不同意拍摄
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
<view class="picture">
|
<view class="picture">
|
||||||
<view class="attendantImg">
|
<view class="attendantImg">
|
||||||
服务结束照片
|
服务结束照片
|
||||||
</view>
|
</view>
|
||||||
<view class="uppicture">
|
<view class="uppicture" @tap='uploadserviceEndPictureUrl'>
|
||||||
<u-upload class="slot-btn" width="530" height="130"></u-upload>
|
<view class="choice" v-if="!list.serviceEndPictureUrl">
|
||||||
|
选择图片
|
||||||
|
</view>
|
||||||
|
<image v-else :src="list.serviceEndPictureUrl" mode=""></image>
|
||||||
|
<!-- <u-upload class="slot-btn" width="530" height="130" ></u-upload> -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="picture" style="height: 350rpx;">
|
<view class="picture" style="height: 350rpx;">
|
||||||
<view class="attendantImg" style="border-bottom: 1rpx solid #BAB7B8;">
|
<view class="attendantImg" style="border-bottom: 1rpx solid #BAB7B8;">
|
||||||
@ -37,39 +43,170 @@
|
|||||||
<view class="receive">
|
<view class="receive">
|
||||||
我确认已接受服务
|
我确认已接受服务
|
||||||
</view>
|
</view>
|
||||||
<view class="uppicture">
|
<view class="uppicture" @tap='show=true'>
|
||||||
<image src="../../static/autograph.png" mode=""></image>
|
<image v-if="!list.userSignaturePictureUrl" style="width: 36rpx;height: 36rpx;margin:8% 0 0 35%"
|
||||||
<span>点此签名</span>
|
src="../../static/autograph.png" mode="">
|
||||||
|
</image>
|
||||||
|
<span v-if="!list.userSignaturePictureUrl">点此签名</span>
|
||||||
|
<image v-else :src="list.userSignaturePictureUrl" mode=""></image>
|
||||||
<!-- <u-upload class="slot-btn" :action="action" :file-list="fileList" width="620" height="130"></u-upload> -->
|
<!-- <u-upload class="slot-btn" :action="action" :file-list="fileList" width="620" height="130"></u-upload> -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="submit">
|
<view class="submit">
|
||||||
<view class="finish">
|
<view class="finish" @tap='buyfinish'>
|
||||||
去完成
|
去完成
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<u-mask :show="show" @click="show = false">
|
||||||
|
<signature @userSignaturePictureUrl='userSignaturePictureUrl' @click.native.stop
|
||||||
|
style='position:absolute;bottom:0%;width: 100%;height: 800rpx;'></signature>
|
||||||
|
</u-mask>
|
||||||
|
<u-toast ref="uToast" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import signature from '../signature/signature.vue'
|
||||||
|
import {
|
||||||
|
orderConfirm
|
||||||
|
} from '@/api/confirmCompletion/index.js'
|
||||||
|
import baseurl from '@/api/baseurl.js'
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
signature
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
show: false,
|
||||||
|
orderNo: null,
|
||||||
|
list: {
|
||||||
|
id: null,
|
||||||
|
onDutyPictureUrl: null,
|
||||||
|
serviceEndPictureUrl: null,
|
||||||
|
userSignaturePictureUrl: null,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
//签名
|
||||||
|
userSignaturePictureUrl(data) {
|
||||||
|
var that = this
|
||||||
|
this.list.userSignaturePictureUrl = data
|
||||||
|
let blob = this.dataURLtoBlob(data);
|
||||||
|
this.show = false
|
||||||
|
},
|
||||||
|
// /base64转二进制
|
||||||
|
dataURLtoBlob(dataurl) {
|
||||||
|
var arr = dataurl.split(","),
|
||||||
|
mime = arr[0].match(/:(.*?);/)[1],
|
||||||
|
bstr = atob(arr[1]),
|
||||||
|
n = bstr.length,
|
||||||
|
u8arr = new Uint8Array(n);
|
||||||
|
while (n--) {
|
||||||
|
u8arr[n] = bstr.charCodeAt(n);
|
||||||
}
|
}
|
||||||
|
return new Blob([u8arr], {
|
||||||
|
type: mime,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//上传头像
|
||||||
|
uploadserviceEndPictureUrl() { //服务结束照片
|
||||||
|
var that = this;
|
||||||
|
uni.chooseImage({
|
||||||
|
count: 1,
|
||||||
|
sizeType: ['original'],
|
||||||
|
sourceType: ['album'],
|
||||||
|
success(res) {
|
||||||
|
that.list.serviceEndPictureUrl = res.tempFilePaths[0]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
uploadonDutyPictureUrl() { //护理员到岗照片
|
||||||
|
var that = this;
|
||||||
|
uni.chooseImage({
|
||||||
|
count: 1,
|
||||||
|
sizeType: ['original'],
|
||||||
|
sourceType: ['album'],
|
||||||
|
success(res) {
|
||||||
|
that.list.onDutyPictureUrl = res.tempFilePaths[0]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//完成
|
||||||
|
buyfinish() {
|
||||||
|
let that = this
|
||||||
|
uni.uploadFile({
|
||||||
|
url: baseurl + '/nurseApplet/uploadFile/uploadPictureUrl',
|
||||||
|
filePath: that.list.serviceEndPictureUrl,
|
||||||
|
name: 'file',
|
||||||
|
formData: {
|
||||||
|
'orderNo': that.orderNo
|
||||||
|
},
|
||||||
|
timeout: 5000,
|
||||||
|
success(res) {
|
||||||
|
that.list.serviceEndPictureUrl = JSON.parse(res.data).imgUrl
|
||||||
|
uni.uploadFile({
|
||||||
|
url: baseurl + '/nurseApplet/uploadFile/uploadPictureUrl',
|
||||||
|
filePath: that.list.userSignaturePictureUrl,
|
||||||
|
name: 'file',
|
||||||
|
formData: {
|
||||||
|
'orderNo': that.orderNo
|
||||||
|
},
|
||||||
|
timeout: 5000,
|
||||||
|
success(res) {
|
||||||
|
that.list.userSignaturePictureUrl = JSON.parse(res.data).imgUrl
|
||||||
|
uni.uploadFile({
|
||||||
|
url: baseurl + '/nurseApplet/uploadFile/uploadPictureUrl',
|
||||||
|
filePath: that.list.onDutyPictureUrl,
|
||||||
|
name: 'file',
|
||||||
|
formData: {
|
||||||
|
'orderNo': that.orderNo
|
||||||
|
},
|
||||||
|
timeout: 5000,
|
||||||
|
success(res) {
|
||||||
|
that.list.onDutyPictureUrl = JSON.parse(res.data).imgUrl
|
||||||
|
orderConfirm(this.list).then(res => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
that.$refs.uToast.show({
|
||||||
|
title: '服务完成',
|
||||||
|
type: 'success',
|
||||||
|
duration: '1500',
|
||||||
|
})
|
||||||
|
setTimeout(e => {
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1
|
||||||
|
})
|
||||||
|
}, 1500)
|
||||||
|
} else {
|
||||||
|
that.$refs.uToast.show({
|
||||||
|
title: res.msg,
|
||||||
|
type: 'error'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
this.list.id = options.orderDetailsId
|
||||||
|
this.orderNo = options.orderNo
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.app {
|
.app {
|
||||||
height: 100%;
|
// height: 100%;
|
||||||
padding: 3%;
|
padding: 3%;
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
|
height: 100vh;
|
||||||
|
background-image: linear-gradient(to bottom, #F4F5F7, #ffffff);
|
||||||
|
|
||||||
.picture {
|
.picture {
|
||||||
width: 95%;
|
width: 95%;
|
||||||
height: 272rpx;
|
height: 272rpx;
|
||||||
@ -78,47 +215,60 @@
|
|||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
|
|
||||||
.attendantImg {
|
.attendantImg {
|
||||||
color: #000000;
|
color: #000000;
|
||||||
height: 88rpx;
|
height: 88rpx;
|
||||||
line-height: 88rpx;
|
line-height: 88rpx;
|
||||||
margin-left: 30rpx;
|
margin-left: 30rpx;
|
||||||
|
|
||||||
span {
|
span {
|
||||||
color: #BAB7B8;
|
color: #BAB7B8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.uppicture {
|
.uppicture {
|
||||||
border: 1rpx dashed #818181;
|
border: 1rpx dashed #818181;
|
||||||
width: 90%;
|
width: 90%;
|
||||||
height: 150rpx;
|
height: 150rpx;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 100%;
|
||||||
|
height: 150rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.choice {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
}
|
||||||
|
|
||||||
::v-deep .u-list-item[data-v-49deb6f2] {
|
::v-deep .u-list-item[data-v-49deb6f2] {
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
image {
|
|
||||||
width: 36rpx;
|
|
||||||
height: 36rpx;
|
|
||||||
margin-left: 40%;
|
|
||||||
margin-top: 8%;
|
|
||||||
}
|
|
||||||
span {
|
span {
|
||||||
|
|
||||||
font-size: 35rpx;
|
font-size: 35rpx;
|
||||||
color: #969394;
|
color: #969394;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.user{
|
|
||||||
|
.user {
|
||||||
height: 88rpx;
|
height: 88rpx;
|
||||||
line-height: 88rpx;
|
line-height: 88rpx;
|
||||||
color: #969394;
|
color: #969394;
|
||||||
margin-left: 30rpx;
|
margin-left: 30rpx;
|
||||||
image{
|
|
||||||
|
image {
|
||||||
width: 34rpx;
|
width: 34rpx;
|
||||||
height: 34rpx;
|
height: 34rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.receive {
|
.receive {
|
||||||
height: 88rpx;
|
height: 88rpx;
|
||||||
line-height: 88rpx;
|
line-height: 88rpx;
|
||||||
@ -127,13 +277,15 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.submit{
|
|
||||||
|
.submit {
|
||||||
height: 68rpx;
|
height: 68rpx;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-left: 60%;
|
margin-left: 60%;
|
||||||
.finish{
|
|
||||||
|
.finish {
|
||||||
width: 217rpx;
|
width: 217rpx;
|
||||||
height: 68rpx;
|
height: 68rpx;
|
||||||
line-height: 68rpx;
|
line-height: 68rpx;
|
||||||
|
|||||||
@ -8,7 +8,6 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class=" item" style="background: #4C7BC9; "@tap='gopersonal'>
|
<view class=" item" style="background: #4C7BC9; "@tap='gopersonal'>
|
||||||
|
|
||||||
<image src="../../static/user.png" mode=""></image>
|
<image src="../../static/user.png" mode=""></image>
|
||||||
<view class="title">
|
<view class="title">
|
||||||
个人信息
|
个人信息
|
||||||
@ -41,18 +40,5 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.app {
|
|
||||||
.cards {
|
|
||||||
height: 1029rpx;
|
|
||||||
|
|
||||||
.item {
|
|
||||||
height: 295rpx;
|
|
||||||
|
|
||||||
.title {
|
|
||||||
width: 80%;
|
|
||||||
top: 60%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -49,14 +49,7 @@
|
|||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
uni.setStorageSync("phonenumber", that.phonenumber)
|
uni.setStorageSync("phonenumber", that.phonenumber)
|
||||||
uni.setStorageSync("password", that.password)
|
uni.setStorageSync("password", that.password)
|
||||||
// uni.setStorage({
|
uni.setStorageSync("nursePersonId", res.data.nursePersonId)
|
||||||
// key: 'phonenumber',
|
|
||||||
// data: that.phonenumber
|
|
||||||
// })
|
|
||||||
// uni.setStorage({
|
|
||||||
// key: 'password',
|
|
||||||
// data: that.password
|
|
||||||
// })
|
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: '登录成功',
|
title: '登录成功',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
@ -74,7 +67,6 @@
|
|||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//跳转注册页
|
//跳转注册页
|
||||||
|
|||||||
@ -36,18 +36,14 @@
|
|||||||
<view class="lefttext">
|
<view class="lefttext">
|
||||||
我的设备
|
我的设备
|
||||||
</view>
|
</view>
|
||||||
<view class="righttext">
|
|
||||||
</view>
|
|
||||||
<image src="../../static/jiantou.png" mode=""></image>
|
<image src="../../static/jiantou.png" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="External">
|
<!-- <view class="External">
|
||||||
<view class="lefttext">
|
<view class="lefttext">
|
||||||
修改密码
|
修改密码
|
||||||
</view>
|
</view>
|
||||||
<view class="righttext">
|
|
||||||
</view>
|
|
||||||
<image src="../../static/jiantou.png" mode=""></image>
|
<image src="../../static/jiantou.png" mode=""></image>
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -120,13 +116,6 @@
|
|||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.righttext {
|
|
||||||
position: absolute;
|
|
||||||
right: 12%;
|
|
||||||
top: 50%;
|
|
||||||
color: #969394;
|
|
||||||
transform: translateY(-50%);
|
|
||||||
}
|
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 18rpx;
|
width: 18rpx;
|
||||||
@ -137,8 +126,7 @@
|
|||||||
transform: translateY(-50%);
|
transform: translateY(-50%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.lefttext,
|
.lefttext {
|
||||||
.righttext {
|
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
49
pages/signature/signature.vue
Normal file
49
pages/signature/signature.vue
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
<template>
|
||||||
|
<view class="" style="background-color: #F4F5F7;">
|
||||||
|
<Signature @init="onSignInit" style='background-color: #fff;'></Signature>
|
||||||
|
<view class="btns">
|
||||||
|
<button @click="clear">清空</button>
|
||||||
|
<button @click="revoke">撤回</button>
|
||||||
|
<button @click="saveTempFilePath">保存</button>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Signature from '@/components/v-sign/v-sign.vue'
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
Signature
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onSignInit(signCtx) {
|
||||||
|
this.signCtx = signCtx
|
||||||
|
},
|
||||||
|
// 清空
|
||||||
|
clear() {
|
||||||
|
this.signCtx.clear()
|
||||||
|
},
|
||||||
|
// 撤回
|
||||||
|
revoke() {
|
||||||
|
this.signCtx.revoke()
|
||||||
|
},
|
||||||
|
// 保存为临时图片路径,h5返回 base64
|
||||||
|
async saveTempFilePath() {
|
||||||
|
const res = await this.signCtx.canvasToTempFilePath()
|
||||||
|
this.$emit('userSignaturePictureUrl', res)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang='scss'>
|
||||||
|
.btns {
|
||||||
|
margin-top: 50rpx;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
width: 30%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -14,18 +14,32 @@
|
|||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
onShow() {
|
||||||
this.info();
|
let that = this
|
||||||
},
|
try {
|
||||||
methods: {
|
const value = uni.getStorageSync('nursePersonId');
|
||||||
info() {
|
if (value) {
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.reLaunch({
|
||||||
|
url: '/pages/homepage/homepage'
|
||||||
|
});
|
||||||
|
}, 2000);
|
||||||
|
} else {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/login/login'
|
url: '/pages/login/login'
|
||||||
});
|
});
|
||||||
}, 2000);
|
}, 2000);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.reLaunch({
|
||||||
|
url: '/pages/login/login'
|
||||||
|
});
|
||||||
|
}, 2000);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
methods: {},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
BIN
static/v-sign/clear.png
Normal file
BIN
static/v-sign/clear.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.3 KiB |
BIN
static/v-sign/next.png
Normal file
BIN
static/v-sign/next.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.1 KiB |
BIN
static/v-sign/prev.png
Normal file
BIN
static/v-sign/prev.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.2 KiB |
BIN
static/v-sign/save.png
Normal file
BIN
static/v-sign/save.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
Loading…
Reference in New Issue
Block a user