浏览代码

判断是否签名

lilei 4 年之前
父节点
当前提交
834032fab1

+ 1 - 2
App.vue

@@ -1,7 +1,6 @@
 <script>
 <script>
 	// const uat_URL = 'http://md.test.zyucgj.com/at-employee/' // 预发布
 	// const uat_URL = 'http://md.test.zyucgj.com/at-employee/' // 预发布
-	// const uat_URL = 'http://192.168.16.107:7300/mock/5f5af637cb0f492ad4ee858f/app/at-employee/' // mock
-	const uat_URL = 'http://192.168.16.104:9102/at-employee/' // 本地
+	const uat_URL = 'http://192.168.16.100:9102/at-employee/' // 本地
 	const pro_URL = 'https://car.zyucgj.com/at-employee/'  // 生产
 	const pro_URL = 'https://car.zyucgj.com/at-employee/'  // 生产
 	const buildType = 0 // 打包环境对应类型,1 生产 0 预发布
 	const buildType = 0 // 打包环境对应类型,1 生产 0 预发布
 	const buildURL = buildType ? pro_URL : uat_URL // 打包后实际对应的url
 	const buildURL = buildType ? pro_URL : uat_URL // 打包后实际对应的url

+ 3 - 48
components/autograph-to-pic/autograph-to-pic.vue

@@ -38,13 +38,6 @@ export default {
 			type: String,
 			type: String,
 			default: ''
 			default: ''
 		},
 		},
-		//  是否为空校验
-		isEmpty: {
-			type: Array,
-			default: function(){
-				return []
-			}
-		}
 	},
 	},
 	data(){
 	data(){
 		return{
 		return{
@@ -55,15 +48,7 @@ export default {
 			color:'',
 			color:'',
 			showimg:'',
 			showimg:'',
 			share_popup:false,
 			share_popup:false,
-		}
-	},
-	watch: {
-		isEmpty: {
-			handler(value) {
-				console.log(value)
-				this.checkEmpty(value)
-			},
-			deep: true
+			isEmpty: true
 		}
 		}
 	},
 	},
 	mounted() {
 	mounted() {
@@ -72,40 +57,8 @@ export default {
 		  slideValue: this.slideValue, // 0, 25, 50, 75, 100
 		  slideValue: this.slideValue, // 0, 25, 50, 75, 100
 		  canvasName: this.canvasId,
 		  canvasName: this.canvasId,
 		})
 		})
-		console.log(this.handwriting)
 	},
 	},
 	methods:{
 	methods:{
-		//  为空校验
-		checkEmpty(arr){
-			console.log(arr)
-			let isCheck = []
-			arr.map(item => {
-				if(item.state){
-					isCheck.push(item.name)
-				}
-			})
-			console.log(isCheck)
-			isCheck.map(item => {
-				const c = document.getElementById(item); // 获取html的canvas对象,我这个id="canvas"
-				if(this.isCanvasBlank(c)){
-					// alert("请绘制草图后再上传!")
-					// return
-					item.empty = true
-				}else{
-					item.empty = false
-				}
-			})
-			console.log(isCheck,'===空空kong')
-		},
-		//	验证canvas画布是否为空函数
-		isCanvasBlank(canvas) {
-			console.log(canvas.width,canvas.height)
-		 //    var blank = document.createElement('canvas');//系统获取一个空canvas对象
-		 //    blank.width = canvas.width;
-		 //    blank.height = canvas.height;
-			// console.log(blank.toDataURL(),blank)
-		 //    return canvas.toDataURL() == blank.toDataURL()//比较值相等则为空
-		},
 		// 选择画笔颜色
 		// 选择画笔颜色
 		selectColorEvent(event) {
 		selectColorEvent(event) {
 			this.selectColor = event
 			this.selectColor = event
@@ -119,6 +72,7 @@ export default {
 		//  重写
 		//  重写
 		retDraw() {
 		retDraw() {
 			this.handwriting.retDraw()
 			this.handwriting.retDraw()
+			this.isEmpty = true
 		},
 		},
 		// 笔迹粗细滑块
 		// 笔迹粗细滑块
 		updateValue(e) {
 		updateValue(e) {
@@ -136,6 +90,7 @@ export default {
 		// 绑定到canvas的uploadScaleEnd事件
 		// 绑定到canvas的uploadScaleEnd事件
 		uploadScaleEnd(event){
 		uploadScaleEnd(event){
 			this.handwriting.uploadScaleEnd(event)
 			this.handwriting.uploadScaleEnd(event)
+			this.isEmpty = false
 		},
 		},
 		// 保存  生成图片
 		// 保存  生成图片
 		subCanvas(){
 		subCanvas(){

+ 50 - 34
pages/shopTourOver/shopTourOver.vue

@@ -4,14 +4,14 @@
 		<view class="autograph-con">
 		<view class="autograph-con">
 			<text class="autograph-tit">店长签名:</text>
 			<text class="autograph-tit">店长签名:</text>
 			<view class="autograph-main">
 			<view class="autograph-main">
-				<autograph-to-pic canvasId="handWriting-dz" :isEmpty="isEmpty" />
+				<autograph-to-pic ref="dz" canvasId="handWriting-dz"/>
 			</view>
 			</view>
 		</view>
 		</view>
 		<!-- 巡店人签名 -->
 		<!-- 巡店人签名 -->
 		<view class="autograph-con">
 		<view class="autograph-con">
 			<text class="autograph-tit">巡店人签名:</text>
 			<text class="autograph-tit">巡店人签名:</text>
 			<view class="autograph-main">
 			<view class="autograph-main">
-				<autograph-to-pic canvasId="handWriting-xd" :isEmpty="isEmpty" />
+				<autograph-to-pic ref="xdr" canvasId="handWriting-xd" />
 			</view>
 			</view>
 		</view>
 		</view>
 		<u-button type="primary" shape="circle" class="submit-btn" @click="submitFun">提交</u-button>
 		<u-button type="primary" shape="circle" class="submit-btn" @click="submitFun">提交</u-button>
@@ -28,10 +28,6 @@
 		},
 		},
 		data(){
 		data(){
 			return{
 			return{
-				isEmpty: [  //  是否为空判断
-					{name: 'handWriting-dz', state: true},
-					{name: 'handWriting-xd', state: true}
-				],
 				taskId: '',
 				taskId: '',
 				inspectorSign:'', // 巡店人签名
 				inspectorSign:'', // 巡店人签名
 				storeManagerSign:'', // 店长签名
 				storeManagerSign:'', // 店长签名
@@ -44,35 +40,55 @@
 			// 提交本次任务
 			// 提交本次任务
 			submitFun(){
 			submitFun(){
 				const _this = this
 				const _this = this
-				console.log({inspectorSign: _this.inspectorSign, storeManagerSign: _this.storeManagerSign})
-				// clzConfirm({
-				// 	title: '提示',
-				// 	content: '确定提交本次巡店?',
-				// 	success: function(res) {
-				// 		if (res.confirm || res.index == 0) {
-				// 			submitTask({
-				// 				id: _this.taskId,
-				// 				inspectorSign: _this.inspectorSign,
-				// 				storeManagerSign: _this.storeManagerSign
-				// 			}).then(ret=>{
-				// 				console.log(ret)
-				// 				if(ret.status == 200){
-				// 					// 关闭上页
-				// 					uni.$emit("closeTour",1)
-				// 					// 打开完成页面
-				// 					uni.redirectTo({
-				// 						url:"/pages/shopTourCompleted/shopTourCompleted?taskId="+_this.taskId
-				// 					})
-				// 				}
-				// 				uni.showToast({
-				// 					icon:'none',
-				// 					title: ret.message
-				// 				})
-				// 			})
-				// 		}
-				// 	}
-				// });
+				console.log(_this.$refs.dz.isEmpty)
+				const dzIsEmpty = _this.$refs.dz.isEmpty
+				const xdrIsEmpty = _this.$refs.xdr.isEmpty
+				if(dzIsEmpty){
+					uni.showToast({
+						icon:'none',
+						title:'店长未签名'
+					})
+					return
+				}
+				if(xdrIsEmpty){
+					uni.showToast({
+						icon:'none',
+						title:'巡店人未签名'
+					})
+					return
+				}
+				clzConfirm({
+					title: '提示',
+					content: '确定提交本次巡店?',
+					success: function(res) {
+						if (res.confirm || res.index == 0) {
+							// 上传图片后提交代码
+							//_this.submitTask()
+						}
+					}
+				});
 			},
 			},
+			submitTask(){
+				submitTask({
+					id: _this.taskId,
+					inspectorSign: _this.inspectorSign,
+					storeManagerSign: _this.storeManagerSign
+				}).then(ret=>{
+					console.log(ret)
+					if(ret.status == 200){
+						// 关闭上页
+						uni.$emit("closeTour",1)
+						// 打开完成页面
+						uni.redirectTo({
+							url:"/pages/shopTourCompleted/shopTourCompleted?taskId="+_this.taskId
+						})
+					}
+					uni.showToast({
+						icon:'none',
+						title: ret.message
+					})
+				})
+			}
 		}
 		}
 	}
 	}
 </script>
 </script>

文件差异内容过多而无法显示
+ 0 - 0
unpackage/dist/dev/app-plus/app-service.js


文件差异内容过多而无法显示
+ 14 - 16
unpackage/dist/dev/app-plus/app-view.js


部分文件因为文件数量过多而无法显示