2024-09-01 18:16:43 +08:00
|
|
|
|
<!-- 线上合同 -->
|
|
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
|
<view class="content">
|
|
|
|
|
|
|
|
|
|
|
|
<view class="authentication_top">
|
2025-07-11 13:16:08 +08:00
|
|
|
|
<image class="image3" style="width: 100%;margin-top: 50%;" v-if="PreviewContract" :src="contractImg"
|
|
|
|
|
|
mode="widthFix"></image>
|
2024-09-01 18:16:43 +08:00
|
|
|
|
<!-- 创建合成画布 -->
|
2025-07-11 13:16:08 +08:00
|
|
|
|
<view class="bgCoverBox" v-if="publish"><canvas :style="{width:height +'px',height:width +'px'}"
|
|
|
|
|
|
canvas-id="mycontract" class="canvsborder2"></canvas></view>
|
2024-09-01 18:16:43 +08:00
|
|
|
|
<!-- 创建合成画布 -->
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<!-- <view class="authentication_bottom" v-if="NavAutograph" style="background:#ffe9e9" @click="agreeSign">
|
|
|
|
|
|
<button style="color:#f00">我已阅读上述内容,下一步>></button>
|
|
|
|
|
|
</view> -->
|
|
|
|
|
|
<view class="authentication_bottom" v-if="NavAutograph" style="background:#ffe9e9" @click="agreeSign">
|
|
|
|
|
|
<button style="color:#f00">我已阅读上述内容,下一步>></button>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="authentication_fun" v-if="Navpreservation" style="background:#fff; ">
|
2025-07-11 13:16:08 +08:00
|
|
|
|
<button style="color:#fd972e;" @click="SigningCompleted">签署完成,去提交>></button>
|
2024-09-01 18:16:43 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
<!-- 填写信息 -->
|
|
|
|
|
|
<view class="inforMation" v-if="Mation == true">
|
|
|
|
|
|
<view class="in-input" @click="show = true">
|
|
|
|
|
|
<view class="in-left">请选择车辆:</view>
|
2025-07-11 13:16:08 +08:00
|
|
|
|
<view class="in-right">
|
2024-09-01 18:16:43 +08:00
|
|
|
|
<text>{{showtext}}</text>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
2025-07-11 13:16:08 +08:00
|
|
|
|
<view class="in-box">
|
2024-09-01 18:16:43 +08:00
|
|
|
|
<view class="in-input">
|
2025-07-11 13:16:08 +08:00
|
|
|
|
<view class="in-left">请选择人:</view>
|
|
|
|
|
|
<view class="in-right">
|
|
|
|
|
|
<input type="text" v-model="showtext1" @input="getcarlist" @blur="getcarlist"
|
|
|
|
|
|
@confirm="getcarlist" placeholder="输入姓名/手机号">
|
|
|
|
|
|
</view>
|
2024-09-01 18:16:43 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
<scroll-view class="l-bai" scroll-y="true">
|
2025-07-11 13:16:08 +08:00
|
|
|
|
<view class="renname" v-for="(item,index) in columns1" :key="index">
|
|
|
|
|
|
<view class="dix">
|
|
|
|
|
|
<view class="ming">{{item.nickname}}</view>
|
|
|
|
|
|
<view class="tel">{{item.mobile}}</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="anniux" @click="getren(item.id,item.nickname)">
|
|
|
|
|
|
<text>选择</text>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="lanzi" v-if="columns1" @click="jja">
|
2024-09-01 18:16:43 +08:00
|
|
|
|
<text>点击加载更多</text>
|
|
|
|
|
|
</view>
|
2025-07-11 13:16:08 +08:00
|
|
|
|
<view class="lanzi" v-else>
|
2024-09-01 18:16:43 +08:00
|
|
|
|
<text>暂无信息</text>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</scroll-view>
|
2025-07-11 13:16:08 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-09-01 18:16:43 +08:00
|
|
|
|
</view>
|
2025-07-11 13:16:08 +08:00
|
|
|
|
|
2024-09-01 18:16:43 +08:00
|
|
|
|
|
|
|
|
|
|
<view class="anniu" @click="getsignature()">
|
|
|
|
|
|
<text>下一步</text>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<!-- 签字弹窗 status -->
|
|
|
|
|
|
<view class="signMask" v-if="autographStatus">
|
|
|
|
|
|
<view class="sigh-btns">
|
|
|
|
|
|
<button class="btn" @tap="handleCancel">取消</button>
|
|
|
|
|
|
<button class="btn" @tap="handleReset">重写</button>
|
|
|
|
|
|
<button class="btn" @tap="handleConfirm">确认</button>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="sign-box">
|
|
|
|
|
|
<canvas class="mycanvas" :style="{width:width +'px',height:height +'px'}" canvas-id="mycanvas"
|
|
|
|
|
|
@touchstart="touchstart" @touchmove="touchmove" @touchend="touchend"></canvas>
|
|
|
|
|
|
<canvas canvas-id="camCacnvs" :style="{width:height +'px',height:width +'px'}"
|
|
|
|
|
|
class="canvsborder"></canvas>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<u-picker :show="show" :columns="columns" keyName="carBrand" @confirm="confirm1" @cancel="close1"></u-picker>
|
2025-07-11 13:16:08 +08:00
|
|
|
|
|
2024-09-01 18:16:43 +08:00
|
|
|
|
<!-- 签字弹窗 end -->
|
|
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<script>
|
2025-07-11 13:16:08 +08:00
|
|
|
|
import request from '../../utils/newRequest'
|
|
|
|
|
|
import {
|
|
|
|
|
|
getToken
|
|
|
|
|
|
} from '@/utils/auth'
|
2024-09-01 18:16:43 +08:00
|
|
|
|
import config from '@/config'
|
|
|
|
|
|
var x = 20;
|
|
|
|
|
|
var y = 20;
|
|
|
|
|
|
var tempPoint = []; //用来存放当前画纸上的轨迹点
|
|
|
|
|
|
var id = 0;
|
|
|
|
|
|
var type = '';
|
|
|
|
|
|
let that;
|
|
|
|
|
|
let canvasw;
|
|
|
|
|
|
let canvash;
|
|
|
|
|
|
export default {
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
status: 'loadmore',
|
2025-07-11 13:16:08 +08:00
|
|
|
|
searchValue: '',
|
|
|
|
|
|
wtr: '',
|
|
|
|
|
|
sfz: '',
|
|
|
|
|
|
position: '',
|
|
|
|
|
|
carNum: '',
|
|
|
|
|
|
phone: '',
|
|
|
|
|
|
cbgs: '',
|
|
|
|
|
|
kcyPhone: '',
|
|
|
|
|
|
lc: '',
|
|
|
|
|
|
rs: '',
|
|
|
|
|
|
sjqk: '',
|
|
|
|
|
|
jbr: '',
|
|
|
|
|
|
signImage: '',
|
|
|
|
|
|
Mation: false,
|
2024-09-01 18:16:43 +08:00
|
|
|
|
contractImg: '../../static/images/ppg.jpg', //合同路径
|
|
|
|
|
|
ctx: '', //绘图图像
|
|
|
|
|
|
points: [], //路径点集合,
|
|
|
|
|
|
width: 0,
|
|
|
|
|
|
height: 0,
|
|
|
|
|
|
autographStatus: false,
|
|
|
|
|
|
publish: false,
|
2025-07-11 13:16:08 +08:00
|
|
|
|
PreviewContract: true,
|
2024-09-01 18:16:43 +08:00
|
|
|
|
NavAutograph: true,
|
2025-07-11 13:16:08 +08:00
|
|
|
|
Navpreservation: false,
|
2024-09-01 18:16:43 +08:00
|
|
|
|
show: false,
|
2025-07-11 13:16:08 +08:00
|
|
|
|
showtext: '请选择',
|
2024-09-01 18:16:43 +08:00
|
|
|
|
columns: [],
|
|
|
|
|
|
show1: false,
|
2025-07-11 13:16:08 +08:00
|
|
|
|
showtext1: '',
|
2024-09-01 18:16:43 +08:00
|
|
|
|
columns1: null,
|
2025-07-11 13:16:08 +08:00
|
|
|
|
wtrId: '',
|
|
|
|
|
|
carnum: '',
|
|
|
|
|
|
pageSize: 5,
|
|
|
|
|
|
pageNum: 1,
|
2024-09-01 18:16:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
onLoad(option) {
|
|
|
|
|
|
this.contractImg = 'http://www.nuoyunr.com/lananRsc/detection' + '/inspectionWts.png'
|
|
|
|
|
|
that = this;
|
|
|
|
|
|
id = option.id;
|
|
|
|
|
|
type = option.type;
|
|
|
|
|
|
this.ctx = uni.createCanvasContext('mycanvas', this); //创建绘图对象
|
|
|
|
|
|
//设置画笔样式
|
|
|
|
|
|
this.ctx.lineWidth = 20;
|
|
|
|
|
|
this.ctx.lineCap = 'round';
|
|
|
|
|
|
this.ctx.lineJoin = 'round';
|
|
|
|
|
|
uni.getSystemInfo({
|
|
|
|
|
|
success: function(res) {
|
2025-07-11 13:16:08 +08:00
|
|
|
|
|
2024-09-01 18:16:43 +08:00
|
|
|
|
that.width = res.windowWidth * 0.8;
|
|
|
|
|
|
that.height = res.windowHeight * 0.85;
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
onShow() {
|
|
|
|
|
|
const t = this;
|
|
|
|
|
|
this.getcarlist()
|
|
|
|
|
|
uni.getStorage({
|
|
|
|
|
|
key: 'autograph_key',
|
2025-07-11 13:16:08 +08:00
|
|
|
|
success: function(res) {
|
|
|
|
|
|
if (res.data !== '') {
|
2024-09-01 18:16:43 +08:00
|
|
|
|
t.contractImg = res.data
|
|
|
|
|
|
t.PreviewContract = true;
|
|
|
|
|
|
t.publish = false;
|
|
|
|
|
|
t.NavAutograph = false
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-07-11 13:16:08 +08:00
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
|
2024-09-01 18:16:43 +08:00
|
|
|
|
methods: {
|
2025-07-11 13:16:08 +08:00
|
|
|
|
jja() {
|
2024-09-01 18:16:43 +08:00
|
|
|
|
let that = this
|
2025-07-11 13:16:08 +08:00
|
|
|
|
this.pageSize++
|
2024-09-01 18:16:43 +08:00
|
|
|
|
that.getcarlist()
|
|
|
|
|
|
console.log(this.pageSize);
|
|
|
|
|
|
},
|
2025-07-11 13:16:08 +08:00
|
|
|
|
|
|
|
|
|
|
async getcarlist() {
|
2024-09-01 18:16:43 +08:00
|
|
|
|
let resc = await request({
|
2025-07-11 13:16:08 +08:00
|
|
|
|
url: '/app-api/appInspection/userOwn/getCars',
|
2024-09-01 18:16:43 +08:00
|
|
|
|
method: 'get',
|
|
|
|
|
|
})
|
|
|
|
|
|
console.log(resc);
|
2025-07-11 13:16:08 +08:00
|
|
|
|
this.columns.push(resc.data)
|
2024-09-01 18:16:43 +08:00
|
|
|
|
let data = {
|
2025-07-11 13:16:08 +08:00
|
|
|
|
searchValue: this.showtext1,
|
|
|
|
|
|
pageNum: this.pageNum, //第几页
|
|
|
|
|
|
pageSize: this.pageSize, //一页多少张
|
2024-09-01 18:16:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
let res = await request({
|
2025-07-11 13:16:08 +08:00
|
|
|
|
url: '/app-api/appInspection/userOwn/getDbList',
|
2024-09-01 18:16:43 +08:00
|
|
|
|
method: 'get',
|
|
|
|
|
|
params: data
|
|
|
|
|
|
})
|
|
|
|
|
|
console.log(res);
|
|
|
|
|
|
this.columns1 = res.rows
|
2025-07-11 13:16:08 +08:00
|
|
|
|
|
2024-09-01 18:16:43 +08:00
|
|
|
|
},
|
2025-07-11 13:16:08 +08:00
|
|
|
|
close1() {
|
2024-09-01 18:16:43 +08:00
|
|
|
|
this.show = false
|
|
|
|
|
|
},
|
2025-07-11 13:16:08 +08:00
|
|
|
|
confirm1(e) {
|
2024-09-01 18:16:43 +08:00
|
|
|
|
this.showtext = e.value[0].carBrand
|
|
|
|
|
|
this.carnum = e.value[0].carNo
|
|
|
|
|
|
console.log(e);
|
|
|
|
|
|
this.show = false
|
2025-07-11 13:16:08 +08:00
|
|
|
|
|
2024-09-01 18:16:43 +08:00
|
|
|
|
},
|
2025-07-11 13:16:08 +08:00
|
|
|
|
close2() {
|
2024-09-01 18:16:43 +08:00
|
|
|
|
this.show1 = false
|
|
|
|
|
|
},
|
2025-07-11 13:16:08 +08:00
|
|
|
|
|
|
|
|
|
|
confirm2(e) {
|
2024-09-01 18:16:43 +08:00
|
|
|
|
this.showtext1 = e.value[0].nickname
|
|
|
|
|
|
this.wtrId = e.value[0].id
|
2025-07-11 13:16:08 +08:00
|
|
|
|
|
2024-09-01 18:16:43 +08:00
|
|
|
|
console.log(e);
|
|
|
|
|
|
this.show1 = false
|
2025-07-11 13:16:08 +08:00
|
|
|
|
|
2024-09-01 18:16:43 +08:00
|
|
|
|
},
|
2025-07-11 13:16:08 +08:00
|
|
|
|
getren(ids, names) {
|
2024-09-01 18:16:43 +08:00
|
|
|
|
this.showtext1 = names
|
|
|
|
|
|
this.wtrId = ids
|
|
|
|
|
|
},
|
2025-07-11 13:16:08 +08:00
|
|
|
|
|
2024-09-01 18:16:43 +08:00
|
|
|
|
agreeSign() {
|
2025-07-11 13:16:08 +08:00
|
|
|
|
this.Mation = true
|
2024-09-01 18:16:43 +08:00
|
|
|
|
},
|
2025-07-11 13:16:08 +08:00
|
|
|
|
getsignature() {
|
|
|
|
|
|
if (this.wtrId == '' || this.carnum == '') {
|
|
|
|
|
|
uni.showToast({
|
|
|
|
|
|
title: '以上均为必填!!!',
|
|
|
|
|
|
icon: 'none'
|
|
|
|
|
|
})
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.autographStatus = true;
|
2024-09-01 18:16:43 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
//触摸开始,获取到起点
|
|
|
|
|
|
touchstart: function(e) {
|
|
|
|
|
|
let startX = e.changedTouches[0].x;
|
|
|
|
|
|
let startY = e.changedTouches[0].y;
|
|
|
|
|
|
let startPoint = {
|
|
|
|
|
|
X: startX,
|
|
|
|
|
|
Y: startY
|
|
|
|
|
|
};
|
|
|
|
|
|
/* **************************************************
|
|
|
|
|
|
#由于uni对canvas的实现有所不同,这里需要把起点存起来
|
|
|
|
|
|
* **************************************************/
|
|
|
|
|
|
this.points.push(startPoint);
|
|
|
|
|
|
|
|
|
|
|
|
//每次触摸开始,开启新的路径
|
|
|
|
|
|
this.ctx.beginPath();
|
|
|
|
|
|
},
|
|
|
|
|
|
//触摸移动,获取到路径点
|
|
|
|
|
|
touchmove: function(e) {
|
|
|
|
|
|
let moveX = e.changedTouches[0].x;
|
|
|
|
|
|
let moveY = e.changedTouches[0].y;
|
|
|
|
|
|
let movePoint = {
|
|
|
|
|
|
X: moveX,
|
|
|
|
|
|
Y: moveY
|
|
|
|
|
|
};
|
|
|
|
|
|
this.points.push(movePoint); //存点
|
|
|
|
|
|
let len = this.points.length;
|
2025-07-11 13:16:08 +08:00
|
|
|
|
if (len >= 2) {
|
2024-09-01 18:16:43 +08:00
|
|
|
|
this.draw(); //绘制路径
|
|
|
|
|
|
}
|
|
|
|
|
|
tempPoint.push(movePoint);
|
|
|
|
|
|
},
|
|
|
|
|
|
// 触摸结束,将未绘制的点清空防止对后续路径产生干扰
|
|
|
|
|
|
touchend: function() {
|
|
|
|
|
|
this.points = [];
|
|
|
|
|
|
},
|
|
|
|
|
|
/* ***********************************************
|
|
|
|
|
|
# 绘制笔迹
|
|
|
|
|
|
# 1.为保证笔迹实时显示,必须在移动的同时绘制笔迹
|
|
|
|
|
|
# 2.为保证笔迹连续,每次从路径集合中区两个点作为起点(moveTo)和终点(lineTo)
|
|
|
|
|
|
# 3.将上一次的终点作为下一次绘制的起点(即清除第一个点)
|
|
|
|
|
|
************************************************ */
|
2025-07-11 13:16:08 +08:00
|
|
|
|
|
2024-09-01 18:16:43 +08:00
|
|
|
|
draw: function() {
|
|
|
|
|
|
let point1 = this.points[0];
|
|
|
|
|
|
let point2 = this.points[1];
|
|
|
|
|
|
this.points.shift();
|
|
|
|
|
|
this.ctx.moveTo(point1.X, point1.Y);
|
|
|
|
|
|
this.ctx.lineTo(point2.X, point2.Y);
|
|
|
|
|
|
this.ctx.stroke();
|
|
|
|
|
|
this.ctx.draw(true);
|
|
|
|
|
|
},
|
|
|
|
|
|
handleCancel() {
|
|
|
|
|
|
uni.navigateBack({
|
|
|
|
|
|
delta: 1
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
//清空画布
|
|
|
|
|
|
handleReset: function() {
|
|
|
|
|
|
console.log('handleReset');
|
|
|
|
|
|
that.ctx.clearRect(0, 0, that.width, that.height);
|
|
|
|
|
|
that.ctx.draw(true);
|
|
|
|
|
|
tempPoint = [];
|
|
|
|
|
|
},
|
2025-07-11 13:16:08 +08:00
|
|
|
|
|
2024-09-01 18:16:43 +08:00
|
|
|
|
//将签名笔迹上传到服务器,并将返回来的地址存到本地
|
|
|
|
|
|
async handleConfirm() {
|
|
|
|
|
|
const t = this;
|
|
|
|
|
|
if (tempPoint.length == 0) {
|
|
|
|
|
|
uni.showToast({
|
|
|
|
|
|
title: '请先签名',
|
|
|
|
|
|
icon: 'none',
|
|
|
|
|
|
duration: 2000
|
|
|
|
|
|
});
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
uni.showLoading({
|
|
|
|
|
|
title: '生成中'
|
|
|
|
|
|
});
|
|
|
|
|
|
uni.canvasToTempFilePath({
|
|
|
|
|
|
canvasId: 'mycanvas',
|
|
|
|
|
|
success: function(res) {
|
2025-07-11 13:16:08 +08:00
|
|
|
|
console.log('点击确认返回', res);
|
2024-09-01 18:16:43 +08:00
|
|
|
|
// t.objectURLToBlob(res)
|
|
|
|
|
|
let tempPath = res.tempFilePath;
|
|
|
|
|
|
const ctx = uni.createCanvasContext('camCacnvs', that);
|
|
|
|
|
|
ctx.translate(0, that.width);
|
|
|
|
|
|
ctx.rotate((270 * Math.PI) / 180);
|
|
|
|
|
|
ctx.drawImage(tempPath, 0, 0, that.width, that.height);
|
|
|
|
|
|
ctx.draw();
|
|
|
|
|
|
t.urlTobase64(res.tempFilePath)
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
uni.hideLoading();
|
|
|
|
|
|
// 请求上传
|
|
|
|
|
|
|
2025-07-11 13:16:08 +08:00
|
|
|
|
|
2024-09-01 18:16:43 +08:00
|
|
|
|
},
|
2025-07-11 13:16:08 +08:00
|
|
|
|
|
|
|
|
|
|
async shangchuang(imgs) {
|
2024-09-01 18:16:43 +08:00
|
|
|
|
uni.showLoading({
|
|
|
|
|
|
title: '加载中'
|
|
|
|
|
|
});
|
|
|
|
|
|
const resx = await request({
|
2025-07-11 13:16:08 +08:00
|
|
|
|
method: 'post',
|
|
|
|
|
|
url: '/system/history/jcWts',
|
|
|
|
|
|
data: {
|
|
|
|
|
|
wtrId: this.wtrId,
|
|
|
|
|
|
carnum: this.carnum,
|
|
|
|
|
|
signImage: imgs
|
2024-09-01 18:16:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
})
|
2025-07-11 13:16:08 +08:00
|
|
|
|
console.log('成功', resx);
|
|
|
|
|
|
if (resx.code == 200) {
|
2024-09-01 18:16:43 +08:00
|
|
|
|
uni.hideLoading();
|
|
|
|
|
|
uni.showToast({
|
2025-07-11 13:16:08 +08:00
|
|
|
|
title: '提交成功',
|
|
|
|
|
|
icon: 'none',
|
2024-09-01 18:16:43 +08:00
|
|
|
|
duration: 2000
|
|
|
|
|
|
})
|
2025-07-11 13:16:08 +08:00
|
|
|
|
|
2024-09-01 18:16:43 +08:00
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
uni.navigateBack()
|
|
|
|
|
|
}, 2000);
|
|
|
|
|
|
}
|
2025-07-11 13:16:08 +08:00
|
|
|
|
|
|
|
|
|
|
if (resx.code != 200) {
|
2024-09-01 18:16:43 +08:00
|
|
|
|
uni.hideLoading();
|
|
|
|
|
|
uni.showToast({
|
2025-07-11 13:16:08 +08:00
|
|
|
|
title: '网络不佳 请稍后在试' + resx.code,
|
|
|
|
|
|
icon: 'none',
|
2024-09-01 18:16:43 +08:00
|
|
|
|
duration: 2000
|
|
|
|
|
|
})
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
uni.navigateBack()
|
|
|
|
|
|
}, 2000);
|
2025-07-11 13:16:08 +08:00
|
|
|
|
|
2024-09-01 18:16:43 +08:00
|
|
|
|
}
|
2025-07-11 13:16:08 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-09-01 18:16:43 +08:00
|
|
|
|
},
|
2025-07-11 13:16:08 +08:00
|
|
|
|
urlTobase64(url) {
|
|
|
|
|
|
uni.getFileSystemManager().readFile({
|
|
|
|
|
|
filePath: url,
|
|
|
|
|
|
encoding: 'base64',
|
|
|
|
|
|
success: res => {
|
|
|
|
|
|
let base64 = 'data:image/jpeg;base64,' + res.data; //不加上这串字符,在页面无法显示
|
|
|
|
|
|
console.log(base64, "base64")
|
|
|
|
|
|
this.shangchuang(base64)
|
|
|
|
|
|
// upFile({
|
|
|
|
|
|
// 'base64': base64
|
|
|
|
|
|
// }).then(res2 => {
|
|
|
|
|
|
// console.log(res2.data.url, "res2res2res2res2")
|
|
|
|
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
2024-09-01 18:16:43 +08:00
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
2025-07-11 13:16:08 +08:00
|
|
|
|
objectURLToBlob(url) {
|
|
|
|
|
|
// console.log(url.tempFilePath,'121212')
|
|
|
|
|
|
uni.request({
|
|
|
|
|
|
url: url.tempFilePath,
|
|
|
|
|
|
method: "GET",
|
|
|
|
|
|
responseType: "arraybuffer",
|
|
|
|
|
|
success: (ress) => {
|
|
|
|
|
|
console.log(ress);
|
|
|
|
|
|
const base64 = uni.arrayBufferToBase64(ress.data)
|
|
|
|
|
|
// console.log('data:image/png;base64,'+ base64,'signFile')
|
|
|
|
|
|
let imgs = 'data:image/png;base64,' + base64
|
|
|
|
|
|
console.log('转换base格式后', imgs);
|
|
|
|
|
|
// this.shangchuang(imgs)
|
|
|
|
|
|
// upFile({
|
|
|
|
|
|
// 'base64': imgs
|
|
|
|
|
|
// }).then(res2 => {
|
|
|
|
|
|
// console.log(res2, "res2res2res2res2")
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
|
|
// //
|
|
|
|
|
|
},
|
|
|
|
|
|
fail: (res) => {
|
|
|
|
|
|
console.log(res)
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
preservationImg() {
|
2024-09-01 18:16:43 +08:00
|
|
|
|
const t = this;
|
|
|
|
|
|
uni.downloadFile({
|
|
|
|
|
|
url: t.contractImg,
|
|
|
|
|
|
success: res => {
|
|
|
|
|
|
if (res.statusCode == 200) {
|
|
|
|
|
|
uni.saveImageToPhotosAlbum({
|
|
|
|
|
|
filePath: res.tempFilePath,
|
|
|
|
|
|
success: function() {
|
|
|
|
|
|
uni.showToast({
|
|
|
|
|
|
title: '保存成功',
|
|
|
|
|
|
icon: 'none',
|
|
|
|
|
|
duration: 2000
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
fail: function() {
|
|
|
|
|
|
uni.showToast({
|
|
|
|
|
|
title: '保存失败',
|
|
|
|
|
|
icon: 'none',
|
|
|
|
|
|
duration: 2000
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
} else {
|
|
|
|
|
|
uni.showToast({
|
|
|
|
|
|
title: '第三方网络错误',
|
|
|
|
|
|
icon: 'none',
|
|
|
|
|
|
duration: 2000
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
2025-07-11 13:16:08 +08:00
|
|
|
|
SigningCompleted() {
|
2024-09-01 18:16:43 +08:00
|
|
|
|
uni.showToast({
|
2025-07-11 13:16:08 +08:00
|
|
|
|
title: '您发起了提交',
|
|
|
|
|
|
icon: 'none'
|
2024-09-01 18:16:43 +08:00
|
|
|
|
})
|
2025-07-11 13:16:08 +08:00
|
|
|
|
|
2024-09-01 18:16:43 +08:00
|
|
|
|
const t = this;
|
|
|
|
|
|
let ImgType = t.contractImg.split(".")
|
|
|
|
|
|
uni.getFileSystemManager().readFile({
|
2025-07-11 13:16:08 +08:00
|
|
|
|
filePath: t.contractImg,
|
|
|
|
|
|
encoding: 'base64',
|
|
|
|
|
|
success: async (res) => {
|
|
|
|
|
|
t.contractImg = 'data:image/png;base64,' + res.data;
|
|
|
|
|
|
uni.showLoading({
|
|
|
|
|
|
title: '提交中',
|
|
|
|
|
|
});
|
|
|
|
|
|
console.log(res.data)
|
|
|
|
|
|
return
|
|
|
|
|
|
const result = await t.$req("/user/upload/img", {
|
|
|
|
|
|
uid: t.user.uid,
|
|
|
|
|
|
type: ImgType[1],
|
|
|
|
|
|
img: res.data,
|
|
|
|
|
|
place: 'sign',
|
|
|
|
|
|
})
|
|
|
|
|
|
let rd = result.data
|
|
|
|
|
|
// console.log(rd)
|
|
|
|
|
|
if (rd.code == 0) {
|
|
|
|
|
|
let data = rd.data
|
|
|
|
|
|
t.contractImg = data.url;
|
|
|
|
|
|
uni.hideLoading();
|
|
|
|
|
|
uni.setStorage({
|
|
|
|
|
|
key: 'autograph_key',
|
|
|
|
|
|
data: t.contractImg,
|
|
|
|
|
|
success: function() {
|
|
|
|
|
|
console.log("签字", 'success');
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
uni.navigateBack({
|
|
|
|
|
|
delta: 1
|
|
|
|
|
|
}); // 返回上一页
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
2024-09-01 18:16:43 +08:00
|
|
|
|
},
|
2025-07-11 13:16:08 +08:00
|
|
|
|
ReSign: function() {
|
2024-09-01 18:16:43 +08:00
|
|
|
|
// console.log(this.ctx)
|
|
|
|
|
|
this.autographStatus = true
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
<style>
|
2025-07-11 13:16:08 +08:00
|
|
|
|
.lanzi {
|
|
|
|
|
|
margin-top: 20px;
|
2024-09-01 18:16:43 +08:00
|
|
|
|
width: 100%;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
|
color: #0D2E8D;
|
|
|
|
|
|
}
|
2025-07-11 13:16:08 +08:00
|
|
|
|
|
|
|
|
|
|
.l-bai {
|
2024-09-01 18:16:43 +08:00
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 220px;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
padding: 15px;
|
|
|
|
|
|
background: #FFFFFF;
|
2025-07-11 13:16:08 +08:00
|
|
|
|
border-radius: 5px;
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
overflow: hidden;
|
2024-09-01 18:16:43 +08:00
|
|
|
|
}
|
2025-07-11 13:16:08 +08:00
|
|
|
|
|
|
|
|
|
|
.ming {
|
2024-09-01 18:16:43 +08:00
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
|
color: #333333;
|
|
|
|
|
|
margin-right: 10px;
|
|
|
|
|
|
}
|
2025-07-11 13:16:08 +08:00
|
|
|
|
|
|
|
|
|
|
.tel {
|
2024-09-01 18:16:43 +08:00
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
|
color: #999999;
|
|
|
|
|
|
}
|
2025-07-11 13:16:08 +08:00
|
|
|
|
|
|
|
|
|
|
.renname {
|
2024-09-01 18:16:43 +08:00
|
|
|
|
width: 100%;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
padding: 10px;
|
|
|
|
|
|
}
|
2025-07-11 13:16:08 +08:00
|
|
|
|
|
|
|
|
|
|
.dix {
|
2024-09-01 18:16:43 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
2025-07-11 13:16:08 +08:00
|
|
|
|
|
2024-09-01 18:16:43 +08:00
|
|
|
|
}
|
2025-07-11 13:16:08 +08:00
|
|
|
|
|
|
|
|
|
|
.anniux {
|
2024-09-01 18:16:43 +08:00
|
|
|
|
width: 55px;
|
|
|
|
|
|
height: 25px;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
color: white;
|
|
|
|
|
|
background: #0D2E8D;
|
|
|
|
|
|
border-radius: 50px;
|
|
|
|
|
|
font-size: 15px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-07-11 13:16:08 +08:00
|
|
|
|
.image3 {}
|
2024-09-01 18:16:43 +08:00
|
|
|
|
|
2025-07-11 13:16:08 +08:00
|
|
|
|
.in-box {
|
|
|
|
|
|
background-color: white;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
border-bottom: 1px solid #E8E8E8;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.anniu {
|
|
|
|
|
|
width: 95%;
|
|
|
|
|
|
height: 40px;
|
|
|
|
|
|
margin: 0 auto;
|
|
|
|
|
|
border-radius: 50px;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
color: #333333;
|
|
|
|
|
|
background: #0D2E8D;
|
|
|
|
|
|
margin-top: 10px;
|
|
|
|
|
|
color: white;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.inforMation {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
padding-top: 88px;
|
|
|
|
|
|
background: #F6F6F6;
|
|
|
|
|
|
position: fixed;
|
|
|
|
|
|
top: 0;
|
|
|
|
|
|
left: 0;
|
|
|
|
|
|
right: 0;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.in-input {
|
|
|
|
|
|
background-color: white;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
border-bottom: 1px solid #E8E8E8;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
padding: 20px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.in-left {
|
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
|
color: #333333;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.in-right {
|
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
|
color: #C2C2C2;
|
|
|
|
|
|
text-align: right;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.authentication_top {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 90%;
|
|
|
|
|
|
position: fixed;
|
|
|
|
|
|
top: 0;
|
|
|
|
|
|
left: 0;
|
|
|
|
|
|
right: 0;
|
|
|
|
|
|
margin: auto;
|
|
|
|
|
|
overflow-y: scroll;
|
|
|
|
|
|
padding-bottom: 40rpx
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.authentication_top image {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
display: inline-block
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.authentication_bottom {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 10%;
|
|
|
|
|
|
position: fixed;
|
|
|
|
|
|
bottom: 0;
|
|
|
|
|
|
left: 0;
|
|
|
|
|
|
right: 0;
|
|
|
|
|
|
margin: auto;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
background: #ffe9e9
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.authentication_bottom button {
|
|
|
|
|
|
background: 0 0;
|
|
|
|
|
|
border: none;
|
|
|
|
|
|
font-size: 15px;
|
|
|
|
|
|
color: red;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
text-align: center
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.authentication_bottom button:after {
|
|
|
|
|
|
display: none
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.authentication_fun {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 10%;
|
|
|
|
|
|
position: fixed;
|
|
|
|
|
|
bottom: 30rpx;
|
|
|
|
|
|
left: 0;
|
|
|
|
|
|
right: 0;
|
|
|
|
|
|
margin: auto;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: row;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
background: #ffe9e9;
|
|
|
|
|
|
padding: 0 3%;
|
|
|
|
|
|
width: 90%;
|
|
|
|
|
|
border-radius: 50px;
|
|
|
|
|
|
box-shadow: 0 3px 13px rgba(0, 0, 0, .2);
|
|
|
|
|
|
border: 4px solid #fd972e;
|
|
|
|
|
|
box-sizing: border-box
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.authentication_fun button {
|
|
|
|
|
|
border: none;
|
|
|
|
|
|
font-size: 15px;
|
|
|
|
|
|
background: 0 0;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
text-align: center
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.authentication_fun button:after {
|
|
|
|
|
|
display: none
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.signMask {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
background: #fff;
|
|
|
|
|
|
position: fixed;
|
|
|
|
|
|
top: 0;
|
|
|
|
|
|
bottom: 0;
|
|
|
|
|
|
left: 0;
|
|
|
|
|
|
right: 0;
|
|
|
|
|
|
flex-direction: row
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.sign-box,
|
|
|
|
|
|
.signMask {
|
|
|
|
|
|
margin: auto;
|
|
|
|
|
|
display: flex
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.sign-box {
|
|
|
|
|
|
width: 80%;
|
|
|
|
|
|
height: 90%;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
text-align: center
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.sigh-btns,
|
|
|
|
|
|
.sign-view {
|
|
|
|
|
|
height: 100%
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.sigh-btns {
|
|
|
|
|
|
margin: auto;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
justify-content: space-around
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.btn {
|
|
|
|
|
|
margin: auto;
|
|
|
|
|
|
padding: 8rpx 40rpx;
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
transform: rotate(90deg);
|
|
|
|
|
|
border: 1rpx solid grey
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.mycanvas {
|
|
|
|
|
|
margin: auto 0rpx;
|
|
|
|
|
|
background-color: #ececec
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.canvsborder {
|
|
|
|
|
|
border: 1rpx solid #333;
|
|
|
|
|
|
position: fixed;
|
|
|
|
|
|
top: 0;
|
|
|
|
|
|
left: 10000rpx
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.bgCoverBox {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: auto
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.canvsborder2 {
|
|
|
|
|
|
height: 700px !important
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|