Tang 3 years ago
parent
commit
e3adb88b1a
3 changed files with 26 additions and 14 deletions
  1. 1 1
      common/request.js
  2. 5 2
      common/signature.js
  3. 20 11
      pages2/verify/input2.vue

+ 1 - 1
common/request.js

@@ -5,7 +5,7 @@ import store from '@/store/index.js'
 import api from './api.js'
 var num = 1
 
-export const BASE_URL = 'http://42.192.164.187:19005'//接口api  http://42.192.164.187:19005
+export const BASE_URL = 'http://192.168.1.222:5055'//接口api  http://42.192.164.187:19005
 
 
 export const BASE_IMG_URL = 'https://file-dev.xyyxt.net/'//图片上传api  'https://file.xyyxt.net/

+ 5 - 2
common/signature.js

@@ -36,9 +36,12 @@ class Handwriting {
 		this.ctx = uni.createCanvasContext(this.canvasName)
 		var query = uni.createSelectorQuery();
 		query.select('.handCenter').boundingClientRect(rect => {
-			console.log(rect)
+			if(rect.width){
 			this.canvasWidth = rect.width;
+			}
+			if(rect.height){
 			this.canvasHeight = rect.height;
+			}
 		}).exec();
 		this.selectSlideValue(this.slideValue);
 	}
@@ -337,7 +340,7 @@ class Handwriting {
 		}
 		for (let i = 1; i < point.length; i++) {
 			this.ctx.bezierCurveTo(point[i].c1x, point[i].c1y, point[i].c2x, point[i].c2y, point[i].ex, point[i]
-			.ey);
+				.ey);
 		}
 		this.ctx.stroke();
 		if (undefined != is_fill) {

+ 20 - 11
pages2/verify/input2.vue

@@ -73,22 +73,22 @@ export default {
 		this.$refs.uForm.setRules(this.rules);
 	},
 	methods: {
-		downDocx(url){
+		downDocx(url) {
 			uni.downloadFile({
-			    url: this.$method.splitImgHost(url), 
-			    success: (res) => {
-			        if (res.statusCode === 200) {
-						console.log(this.$method.splitImgHost(url))
-						this.$method.showToast("下载成功")
-			        }
-			    }
+				url: this.$method.splitImgHost(url),
+				success: res => {
+					if (res.statusCode === 200) {
+						console.log(this.$method.splitImgHost(url));
+						this.$method.showToast('下载成功');
+					}
+				}
 			});
 		},
 		clearWord() {
 			this.$set(this.form, 'commitment_seal', '');
 		},
 		uploadFieds() {
-			var self = this
+			var self = this;
 			wx.chooseMessageFile({
 				count: 1,
 				size: 2097152,
@@ -110,15 +110,24 @@ export default {
 		async submitApi() {
 			var data = JSON.parse(JSON.stringify(this.form));
 			if (data['commitment_seal']) {
+				console.log(123);
 				data.commitment_seal = await this.$method.uploadFile(data.commitment_seal, 0);
+			} else {
+				console.log(456);
 			}
-			var concatData = {}
-			Object.assign(concatData,this.copyData,data)
+			var concatData = {};
+			Object.assign(concatData, this.copyData, data);
 			console.log(concatData);
 		},
 		//验证表单
 		resultForm(int) {
 			if (this.openVerify) {
+				for (let i = 0; i < this.listData.length; i++) {
+					if (this.listData[i].fieldKey === 'commitment_seal' && !this.listData[i].required) {
+						this.submitApi();
+						return
+					}
+				}
 				this.$refs.uForm.validate(valid => {
 					if (valid) {
 						if (int === 1) {