This commit is contained in:
曹辉 2022-11-10 10:51:44 +08:00
parent 52ca54dd63
commit a892d395bf
19 changed files with 1014 additions and 151 deletions

20
App.vue
View File

@ -1,7 +1,25 @@
<script>
export default {
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() {}
}
</script>

View File

@ -0,0 +1,9 @@
import request from "../request.js"
export function orderConfirm(data) {
return request({
url: `/nurseApp/personLogin/orderConfirm`,
method: 'POST',
data
})
}

View 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
}

View 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>

View 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>

View 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 + *x2
* y = (1-t)²*y0 + 2t(1-t)*y1 + *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>

View File

@ -4,13 +4,26 @@
},
"pages": [ //pageshttps://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",
"style": {
"navigationBarTitleText": "登录",
"navigationBarBackgroundColor": "#ffffff" ,//
"navigationBarBackgroundColor": "#ffffff", //
"navigationStyle": "custom"
}
},{
}, {
"path": "pages/personal/personal",
"style": {
"navigationBarTitleText": "个人信息",
@ -24,13 +37,13 @@
"navigationBarTitleText": "忘记密码",
"navigationBarBackgroundColor": "#ffffff" //
}
},{
}, {
"path": "pages/register/register",
"style": {
"navigationBarTitleText": "注册账号",
"navigationBarBackgroundColor": "#ffffff" //
}
},{
}, {
"path": "pages/homepage/homepage",
"style": {
"navigationBarTitleText": "泉医到家",
@ -38,38 +51,30 @@
}
},
{
"path": "pages/confirmCompletion/confirmCompletion",
"path": "pages/taskReturn/taskReturn",
"style": {
"navigationBarTitleText": "完成确认",
"navigationBarBackgroundColor": "#ffffff" //
}
},{
"path" : "pages/taskReturn/taskReturn",
"style" :
{
"navigationBarTitleText": "任务退回",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#ffffff" //
}
},{
"path": "pages/Mymission/Mymission",
"style": {
"navigationBarTitleText": "我的任务",
"navigationBarTitleText": "任务退回",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#ffffff" //
}
},{
"path" : "pages/taskDetails/taskDetails",
"style" :
{
"navigationBarTitleText": "任务详情",
"enablePullDownRefresh": false,
}, {
"path": "pages/Mymission/Mymission",
"style": {
"navigationBarTitleText": "我的任务",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#ffffff" //
}
}
}, {
"path": "pages/taskDetails/taskDetails",
"style": {
"navigationBarTitleText": "任务详情",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#ffffff" //
}
},
{
"path": "pages/Modifyinformation/Modifyinformation",
@ -79,24 +84,15 @@
"navigationBarBackgroundColor": "#ffffff" //
// "navigationBarTextStyle": "white"
}
},
{
"path": "pages/startup/startup",
}, {
"path": "pages/signature/signature",
"style": {
"navigationBarTitleText": "启动页"
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/confirmCompletion/confirmCompletion",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
],
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",

View File

@ -58,10 +58,12 @@
return data => data?.nurseStationSysUserVOList?. [0]?.nurseStationName || ''
},
},
onLoad(options) {
this.info();
this.baseurl = baseurl;
const that = this
onShow() {
let that = this
// try {
// const value = uni.getStorageSync('nursePersonId');
// if (value) {} else {}
// } catch (e) {}
try {
const value = uni.getStorageSync('phonenumber');
if (value) {
@ -75,7 +77,10 @@
}
} catch (e) {}
this.myInfo()
this.info();
this.baseurl = baseurl;
},
onLoad(options) {},
methods: {
//
uploadImag() {
@ -98,11 +103,11 @@
gofinish() {
var that = this
uni.uploadFile({
url: baseurl + '/nurseApp/personLogin/updateHeadAvatarHead',
url: baseurl + '/nurseApplet/uploadFile/uploadHeadPictureUrl',
filePath: that.appPersonallist.avatar, //file: (filePath)
name: 'file',
formData: { //
'userId': that.appPersonallist.userId,
'nursePersonId': that.appPersonallist.nursePersonId,
},
timeout: 5000,
success(res) {
@ -112,9 +117,13 @@
that.$refs.uToast.show({
title: '修改成功',
type: 'success',
url: '/pages/personal/personal',
duration: '1500'
duration: '1500',
})
setTimeout(e => {
uni.navigateBack({
delta: 1
})
}, 1500)
} else {
that.$refs.uToast.show({
title: res.msg,

View File

@ -2,7 +2,7 @@
<view class="app">
<view class="inputs">
<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 class="tab">
<view class="tab-item" @tap="testTabClick(index)" v-for="(item,index) in tabList"
@ -27,7 +27,7 @@
</view>
<view class="anniu">
<view class="logistics" @tap='gotask(item)'>详情</view>
<view class="logistics harvest">去完成</view>
<view class="logistics harvest" @tap='goconfirmCompletion(item)'>去完成</view>
</view>
</view>
<view class="Apayment" v-if='choicetab==1' v-for="(item,uindex) in list" :key="uindex">
@ -70,22 +70,36 @@
}, {
name: "已完成"
}, ],
nursePersonId: 2, //id
nursePersonId: '', //id
orderStatus: 'NOT_FINISH', // orderStatus: NOT_FINISHCOMPLETE
pageNum: 1,
pageSize: 10,
//
list: [],
total: 0,
nurseItemName: '',
}
},
watch: {
nurseItemName() {
this.selectMissioninfo()
}
},
methods: {
//
goconfirmCompletion(item) {
console.log(item)
uni.navigateTo({
url: `/pages/confirmCompletion/confirmCompletion?orderDetailsId=${item.id}&orderNo=${item.orderNo}`
})
},
//list
selectMissioninfo() {
selectMission(this.nursePersonId, this.orderStatus, this.pageNum, this.pageSize).then(res => {
this.list = res.rows
this.total = res.total
})
selectMission(this.nursePersonId, this.orderStatus, this.pageNum, this.pageSize, this.nurseItemName).then(
res => {
this.list = res.rows
this.total = res.total
})
},
//
gotask(item) {
@ -104,10 +118,11 @@
} else {
this.orderStatus = 'COMPLETE'
}
selectMission(this.nursePersonId, this.orderStatus, this.pageNum, this.pageSize).then(res => {
this.list = res.rows
this.total = res.total
})
selectMission(this.nursePersonId, this.orderStatus, this.pageNum, this.pageSize, this.nurseItemName).then(
res => {
this.list = res.rows
this.total = res.total
})
},
// goorderdetails() {
// uni.navigateTo({
@ -115,26 +130,35 @@
// })
// },
},
onLoad() { //
onShow() { //
this.baseurl = baseurl
this.selectMissioninfo();
var that = this
try {
const value = uni.getStorageSync('nursePersonId');
if (value) {
that.nursePersonId = value
this.selectMissioninfo();
}
} catch (e) {}
},
onReachBottom() { //
if (this.list.length >= this.total) {} else {
this.pageNum++
selectMission(this.nursePersonId, this.orderStatus, this.pageNum, this.pageSize).then(res => {
res.rows.forEach(e => {
this.list.push(e)
selectMission(this.nursePersonId, this.orderStatus, this.pageNum, this.pageSize, this.nurseItemName).then(
res => {
res.rows.forEach(e => {
this.list.push(e)
})
})
})
}
},
onPullDownRefresh() { //
this.pageNum = 1;
selectMission(this.nursePersonId, this.orderStatus, this.PageNum, this.PageSize).then(res => {
this.list = res.rows
this.total = res.total
})
selectMission(this.nursePersonId, this.orderStatus, this.PageNum, this.PageSize, this.nurseItemName).then(
res => {
this.list = res.rows
this.total = res.total
})
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000);

View File

@ -4,31 +4,37 @@
<view class="attendantImg">
护理员到岗照片
</view>
<view class="uppicture">
<u-upload class="slot-btn" width="530" height="130"></u-upload>
<view class="uppicture" @tap='uploadonDutyPictureUrl'>
<view class="choice" v-if="!list.onDutyPictureUrl">
选择图片
</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 class="picture" style="height: 330rpx;">
<view class="attendantImg">
服务进行中视频不少于1min<span>*选填</span>
</view>
<view class="uppicture">
<u-upload class="slot-btn" width="530" height="130"></u-upload>
<u-upload class="slot-btn" width="530" height="130"></u-upload>
</view>
<view class="user">
<image src="../../static/radio.png" mode=""></image>
用户不同意拍摄
</view>
</view>
</view> -->
<view class="picture">
<view class="attendantImg">
服务结束照片
</view>
<view class="uppicture">
<u-upload class="slot-btn" width="530" height="130"></u-upload>
<view class="uppicture" @tap='uploadserviceEndPictureUrl'>
<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 class="picture" style="height: 350rpx;">
<view class="attendantImg" style="border-bottom: 1rpx solid #BAB7B8;">
@ -37,39 +43,170 @@
<view class="receive">
我确认已接受服务
</view>
<view class="uppicture">
<image src="../../static/autograph.png" mode=""></image>
<span>点此签名</span>
<view class="uppicture" @tap='show=true'>
<image v-if="!list.userSignaturePictureUrl" style="width: 36rpx;height: 36rpx;margin:8% 0 0 35%"
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> -->
</view>
</view>
<view class="submit">
<view class="finish">
<view class="finish" @tap='buyfinish'>
去完成
</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>
</template>
<script>
import signature from '../signature/signature.vue'
import {
orderConfirm
} from '@/api/confirmCompletion/index.js'
import baseurl from '@/api/baseurl.js'
export default {
components: {
signature
},
data() {
return {
show: false,
orderNo: null,
list: {
id: null,
onDutyPictureUrl: null,
serviceEndPictureUrl: null,
userSignaturePictureUrl: null,
},
}
},
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>
<style lang="scss">
.app {
height: 100%;
// height: 100%;
padding: 3%;
font-size: 36rpx;
height: 100vh;
background-image: linear-gradient(to bottom, #F4F5F7, #ffffff);
.picture {
width: 95%;
height: 272rpx;
@ -78,47 +215,60 @@
border-radius: 20px;
margin: 0 auto;
margin-bottom: 20rpx;
.attendantImg {
color: #000000;
height: 88rpx;
line-height: 88rpx;
margin-left: 30rpx;
span {
color: #BAB7B8;
}
}
.uppicture {
border: 1rpx dashed #818181;
width: 90%;
height: 150rpx;
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] {
background: #FFFFFF;
}
image {
width: 36rpx;
height: 36rpx;
margin-left: 40%;
margin-top: 8%;
}
span {
font-size: 35rpx;
color: #969394;
}
}
.user{
.user {
height: 88rpx;
line-height: 88rpx;
color: #969394;
margin-left: 30rpx;
image{
image {
width: 34rpx;
height: 34rpx;
}
}
.receive {
height: 88rpx;
line-height: 88rpx;
@ -127,20 +277,22 @@
}
}
.submit{
.submit {
height: 68rpx;
font-size: 32rpx;
color: #FFFFFF;
text-align: center;
margin-left: 60%;
.finish{
.finish {
width: 217rpx;
height: 68rpx;
line-height: 68rpx;
background: #4C7BC9;
border-radius: 26rpx;
margin-left: 30rpx;
}
}
}

View File

@ -8,7 +8,6 @@
</view>
</view>
<view class=" item" style="background: #4C7BC9; "@tap='gopersonal'>
<image src="../../static/user.png" mode=""></image>
<view class="title">
个人信息
@ -41,18 +40,5 @@
</script>
<style lang="scss">
.app {
.cards {
height: 1029rpx;
.item {
height: 295rpx;
.title {
width: 80%;
top: 60%;
}
}
}
}
</style>

View File

@ -49,14 +49,7 @@
if (res.code == 200) {
uni.setStorageSync("phonenumber", that.phonenumber)
uni.setStorageSync("password", that.password)
// uni.setStorage({
// key: 'phonenumber',
// data: that.phonenumber
// })
// uni.setStorage({
// key: 'password',
// data: that.password
// })
uni.setStorageSync("nursePersonId", res.data.nursePersonId)
this.$refs.uToast.show({
title: '登录成功',
type: 'success',
@ -74,7 +67,6 @@
type: 'error'
})
}
})
},
//

View File

@ -36,18 +36,14 @@
<view class="lefttext">
我的设备
</view>
<view class="righttext">
</view>
<image src="../../static/jiantou.png" mode=""></image>
</view>
<view class="External">
<!-- <view class="External">
<view class="lefttext">
修改密码
</view>
<view class="righttext">
</view>
<image src="../../static/jiantou.png" mode=""></image>
</view>
</view> -->
</view>
</template>
@ -120,13 +116,6 @@
border-radius: 20rpx;
position: relative;
.righttext {
position: absolute;
right: 12%;
top: 50%;
color: #969394;
transform: translateY(-50%);
}
image {
width: 18rpx;
@ -137,8 +126,7 @@
transform: translateY(-50%);
}
.lefttext,
.righttext {
.lefttext {
display: inline-block;
}
}

View 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>

View File

@ -14,18 +14,32 @@
};
},
created() {
this.info();
},
methods: {
info() {
onShow() {
let that = this
try {
const value = uni.getStorageSync('nursePersonId');
if (value) {
setTimeout(() => {
uni.reLaunch({
url: '/pages/homepage/homepage'
});
}, 2000);
} else {
setTimeout(() => {
uni.reLaunch({
url: '/pages/login/login'
});
}, 2000);
}
} catch (e) {
setTimeout(() => {
uni.reLaunch({
url: '/pages/login/login'
});
}, 2000);
},
}
},
methods: {},
}
</script>

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB