From c16f8df489b47adbcda2e3f1af9a6d546c213d12 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=AE=B8=E5=85=81=E6=9E=9E?= <3422692813@qq.com>
Date: Thu, 31 Oct 2024 15:20:22 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=AD=BE=E5=AD=97=E7=89=88?=
=?UTF-8?q?=E6=A0=B7=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages-order/addOrder/addOrder.vue | 3 +-
pages-repair/sign/pickerColor.vue | 145 +++++++
pages-repair/sign/sign.vue | 619 +++++++++++++++++++++++++++
pages-repair/signature/signature.vue | 34 +-
pages.json | 6 +
5 files changed, 789 insertions(+), 18 deletions(-)
create mode 100644 pages-repair/sign/pickerColor.vue
create mode 100644 pages-repair/sign/sign.vue
diff --git a/pages-order/addOrder/addOrder.vue b/pages-order/addOrder/addOrder.vue
index 36bfeaa..13d1345 100644
--- a/pages-order/addOrder/addOrder.vue
+++ b/pages-order/addOrder/addOrder.vue
@@ -257,7 +257,8 @@ export default {
itemList: this.formatItem(this.selectedProj)
}
uni.navigateTo({
- url: '/pages-repair/signature/signature?data=' + JSON.stringify(data)
+ // url: '/pages-repair/signature/signature?data=' + JSON.stringify(data)
+ url: '/pages-repair/sign/sign?data=' + JSON.stringify(data)
})
// request({
// url: '/admin-api/repair/tickets/create',
diff --git a/pages-repair/sign/pickerColor.vue b/pages-repair/sign/pickerColor.vue
new file mode 100644
index 0000000..b074da1
--- /dev/null
+++ b/pages-repair/sign/pickerColor.vue
@@ -0,0 +1,145 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages-repair/sign/sign.vue b/pages-repair/sign/sign.vue
new file mode 100644
index 0000000..510beca
--- /dev/null
+++ b/pages-repair/sign/sign.vue
@@ -0,0 +1,619 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 请签名
+
+
+
+
+
+
+
+
+
+
diff --git a/pages-repair/signature/signature.vue b/pages-repair/signature/signature.vue
index 091c68d..be5feaa 100644
--- a/pages-repair/signature/signature.vue
+++ b/pages-repair/signature/signature.vue
@@ -6,12 +6,12 @@
确定维修项目无误后请客户签字确认
@@ -27,21 +27,21 @@ import VNavigationBar from "@/components/VNavigationBar.vue";
import request from "@/utils/request";
export default {
- components: {VNavigationBar},
+ components: { VNavigationBar },
data() {
return {
context: null, // Canvas上下文
isSigning: false, // 是否正在签名中
- data:{}
+ data: {}
};
},
onLoad(data) {
// 获取 canvas 上下文
this.context = uni.createCanvasContext("signatureCanvas", this);
this.context.fillStyle = "white";
- if (data.data){
- console.log('传递过来的内容', JSON.parse(data.data))
- this.data = JSON.parse(data.data)
+ if (data.data) {
+ console.log('传递过来的内容', JSON.parse(data.data));
+ this.data = JSON.parse(data.data);
}
},
methods: {
@@ -60,7 +60,7 @@ export default {
this.context.setStrokeStyle("#000000"); // 设定笔触颜色
this.context.setLineWidth(2); // 设定线条宽度
this.context.setLineCap("round"); // 圆形笔触
- this.context.stroke();
+ this.context.stroke(); // 实线
this.context.draw(true); // 连续绘制
},
// 结束签名
@@ -87,8 +87,8 @@ export default {
filePath: tempFilePath,
}).then((res) => {
console.log('服务器返回图片地址', res);
- this.data.image = res.data.url
- console.log('提交的内容', this.data)
+ this.data.image = res.data.url;
+ console.log('提交的内容', this.data);
request({
url: '/admin-api/repair/tickets/create',
method: 'POST',
@@ -97,11 +97,11 @@ export default {
uni.showToast({
title: '创建工单成功',
icon: 'success'
- })
+ });
uni.navigateTo({
url: `/pages-order/orderDetail/orderDetail?id=${res.data.id}&isDetail=0`
});
- })
+ });
});
},
fail: (err) => {
@@ -149,7 +149,7 @@ export default {
.canvas {
width: 100%;
- height: 500rpx;
+ height: 600rpx; /* 加宽画布高度以适配横屏 */
border: 1px solid #ccc;
border-radius: 10rpx;
box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.1);
diff --git a/pages.json b/pages.json
index 0047a91..fae8af6 100644
--- a/pages.json
+++ b/pages.json
@@ -201,6 +201,12 @@
"style": {
"navigationBarTitleText": ""
}
+ },
+ {
+ "path": "sign/sign",
+ "style": {
+ "navigationBarTitleText": ""
+ }
}
]
},