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": ""
+ }
}
]
},