zhongtianhaoyuan 2 years ago
parent
commit
76fe06cae5
2 changed files with 30 additions and 2 deletions
  1. 2 2
      config/index.js
  2. 28 0
      pages/order/signContract.vue

+ 2 - 2
config/index.js

@@ -1,7 +1,7 @@
 const dev = {
-	baseUrlNew: 'https://api.changyuntong56.com',
+	// baseUrlNew: 'https://api.changyuntong56.com',
 	// baseUrlNew: 'https://apitest.changyuntong56.com',
-	// baseUrlNew: 'http://192.168.110.9:8099',
+	baseUrlNew: 'http://192.168.110.9:8099',
 	// baseUrlNew: 'https://apitest.eliangeyun.com',
 	// baseUrlNew: 'http://192.168.110.67:8999/',
 	h5Appid: 'wxb66b599f7f61b46f',

+ 28 - 0
pages/order/signContract.vue

@@ -147,6 +147,34 @@
 						this.canvasHeight = rect.height;
 						/* 将canvas背景设置为 白底,不设置  导出的canvas的背景为透明 */
 						this.setCanvasBg('#fff');
+						this.$request.baseRequest('get', '/commonUser/getSignatureAddress', {
+							phone: this.userInfo.phone,
+							identification: 2
+						}).then(res => {
+							if (res.data) {
+								if (res.data.signImg) {
+									// 获取远程图片,canvas无法直接绘制远程图片
+									this.userInfo.signImg = res.data.signImg
+									uni.getImageInfo({
+										src: res.data.signImg,
+										success(res) {
+											var ctx = uni.createCanvasContext('handWriting')
+											ctx.drawImage(res.path, 0, 0, 330, 244)
+											ctx.save()
+											ctx.draw()
+										},
+										fail(res) {
+											console.log("fail -> res", res)
+											uni.showToast({
+												title: "图片下载异常",
+												duration: 2000,
+												icon: "none"
+											})
+										}
+									})
+								}
+							}
+						})
 					})
 					.exec();
 			});