Browse Source

Merge branch 'deploy' of http://git.chelingzhu.com/chelingzhu-web/storeCheck-app into deploy

1004749546@qq.com 4 years ago
parent
commit
9717c92ab7

+ 1 - 2
App.vue

@@ -1,7 +1,6 @@
 <script>
 	// 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 buildType = 0 // 打包环境对应类型,1 生产 0 预发布
 	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,
 			default: ''
 		},
-		//  是否为空校验
-		isEmpty: {
-			type: Array,
-			default: function(){
-				return []
-			}
-		}
 	},
 	data(){
 		return{
@@ -55,15 +48,7 @@ export default {
 			color:'',
 			showimg:'',
 			share_popup:false,
-		}
-	},
-	watch: {
-		isEmpty: {
-			handler(value) {
-				console.log(value)
-				this.checkEmpty(value)
-			},
-			deep: true
+			isEmpty: true
 		}
 	},
 	mounted() {
@@ -72,40 +57,8 @@ export default {
 		  slideValue: this.slideValue, // 0, 25, 50, 75, 100
 		  canvasName: this.canvasId,
 		})
-		console.log(this.handwriting)
 	},
 	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) {
 			this.selectColor = event
@@ -119,6 +72,7 @@ export default {
 		//  重写
 		retDraw() {
 			this.handwriting.retDraw()
+			this.isEmpty = true
 		},
 		// 笔迹粗细滑块
 		updateValue(e) {
@@ -136,6 +90,7 @@ export default {
 		// 绑定到canvas的uploadScaleEnd事件
 		uploadScaleEnd(event){
 			this.handwriting.uploadScaleEnd(event)
+			this.isEmpty = false
 		},
 		// 保存  生成图片
 		subCanvas(){

+ 20 - 17
hybrid/html/ddvideo.html

@@ -158,7 +158,7 @@
 				data: {
 					xdType: 'video', // 巡店类型
 					player: null, // 播放器对象
-					videoPlayerStatus:'',// 视频播放状态
+					videoPlayerStatus: '', // 视频播放状态
 					videoList: [], // 播放通道
 					curVideo: null, // 当前播放的视频
 					showYt: false, // 显示云台控制
@@ -208,7 +208,9 @@
 						this.zbItem = JSON.parse(data)
 					},
 					// 选择机位
-					onVideoListClick({key}) {
+					onVideoListClick({
+						key
+					}) {
 						this.videoPlayerStatus = ''
 						let v = this.videoList.find(item => item.gbId == key)
 						if (v) {
@@ -217,15 +219,15 @@
 						}
 					},
 					// 获取当前设备流地址
-					getVideoUrl(){
+					getVideoUrl() {
 						this.sendMsg('getVideoUrl', JSON.stringify(this.curVideo))
 					},
 					// 获取视频地址成功
-					getVideoUrlSuccess(url){
+					getVideoUrlSuccess(url) {
 						// 重置播放器
 						this.showYt = false
 						this.showYtbtns = false
-						if(this.player){
+						if (this.player) {
 							this.player.dispose()
 						}
 						this.videoInit(url)
@@ -332,30 +334,31 @@
 						this.curZbItem = Object.assign({
 							comments: '',
 							taskTargetPhotoList: []
-						},JSON.parse(JSON.stringify(obj)))
+						}, JSON.parse(JSON.stringify(obj)))
 						// 抓拍
 						this.takePhotos(1)
 					},
 					// 抓拍
-					takePhotos(type){
-						if(!this.curZbItem.taskTargetPhotoList||this.curZbItem.taskTargetPhotoList.length<6){
-							this.sendMsg('takePhotos',JSON.stringify({
-								streamId: this.curVideo.streamId,
+					takePhotos(type) {
+						if (!this.curZbItem.taskTargetPhotoList || this.curZbItem.taskTargetPhotoList.length < 6) {
+							let pd = JSON.stringify({
+								streamId: this.curVideo && this.curVideo.streamId,
 								videoPlayerStatus: this.videoPlayerStatus,
 								type: type
-							}))
-						}else{
-							this.sendMsg('toast','最多抓拍6张图片')
+							});
+							this.sendMsg('takePhotos', this.xdType == 'video' ? pd : '')
+						} else {
+							this.sendMsg('toast', '最多抓拍6张图片')
 						}
 					},
 					// 拍照成功后,返回图片地址
-					takePhotoSuccess(url){
+					takePhotoSuccess(url) {
 						let obj = {
 							photoPath: url
 						}
-						if(!this.curZbItem.hasOwnProperty('taskTargetPhotoList')){
+						if (!this.curZbItem.hasOwnProperty('taskTargetPhotoList')) {
 							this.curZbItem.taskTargetPhotoList = [obj]
-						}else{
+						} else {
 							this.curZbItem.taskTargetPhotoList.push(obj)
 							this.curZbItem.taskTargetPhotoList.splice()
 						}
@@ -373,7 +376,7 @@
 						this.sendMsg('delImgs', index)
 					},
 					delImgsSuccess(index) {
-						console.log(index,'delImgsSuccess')
+						console.log(index, 'delImgsSuccess')
 						this.curZbItem.taskTargetPhotoList.splice(index, 1)
 					},
 					// 预览编辑图片

+ 1 - 1
hybrid/html/video.html

@@ -397,7 +397,7 @@
 					takePhotos(type){
 						if(!this.curZbItem.taskTargetPhotoList||this.curZbItem.taskTargetPhotoList.length<6){
 							this.sendMsg('takePhotos',JSON.stringify({
-								streamId: this.curVideo.streamId,
+								streamId: this.curVideo&&this.curVideo.streamId,
 								videoPlayerStatus: this.videoPlayerStatus,
 								type: type
 							}))

+ 0 - 5
libs/validate.js

@@ -1,5 +0,0 @@
-//  正则有效手机号码
-export const isvalidPhone = function (str) {
-  const reg = /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/
-  return reg.test(str)
-}

+ 1 - 1
pages/login/apply-trial.vue

@@ -47,7 +47,7 @@
 </template>
 
 <script>
-	import { isvalidPhone } from '@/libs/validate.js'
+	import { isvalidPhone } from '@/libs/tools.js'
 	import Address from '@/components/address.vue'
 	import uniPopup from '@/components/uni-popup/uni-popup.vue'
 	import popupCon from '@/components/uni-popup/popup-con.vue'

+ 1 - 1
pages/login/forget-pass.vue

@@ -33,7 +33,7 @@
 </template>
 
 <script>
-	import { isvalidPhone } from '@/libs/validate.js'
+	import { isvalidPhone } from '@/libs/tools.js'
 	import uniPopup from '@/components/uni-popup/uni-popup.vue'
 	import popupCon from '@/components/uni-popup/popup-con.vue'
 	import { memberVerifyCode, memberChangePwd, memberValidateVerifyCode, memberGetByMobile } from '@/api/user.js'

+ 1 - 1
pages/login/login.vue

@@ -41,7 +41,7 @@
 <script>
 import market from "@/js_sdk/dc-market/market.js"
 import { checkVersionToLoadUpdate, setStorageForAppVersion } from '@/libs/tools'
-import { isvalidPhone } from '@/libs/validate.js';
+import { isvalidPhone } from '@/libs/tools.js';
 import { login } from '@/api/user.js';
 import { getSysVersion } from '@/api/data.js'
 export default {

+ 414 - 383
pages/shopTour/shopTour.vue

@@ -1,414 +1,445 @@
 <template>
-	<view>
-		<web-view @message="onmessage" src="/hybrid/html/video.html"></web-view>
-	</view>
+	<view><web-view @message="onmessage" src="/hybrid/html/video.html"></web-view></view>
 </template>
 
 <script>
-	import { clzConfirm,saveBase64ToAliOss } from '@/libs/tools'
-	import {taskStart,submitTask,updateTaskItem,getTaskDetail} from '@/api/task'
-	import {getTaskItem,delTaskItem} from '@/api/taskItem'
-	import {taskTargetSave,taskCommentsSave} from '@/api/taskTarget'
-	import {findVsDeviceChannels,findStoreVsDevice,photoPaiZhao,getVideoUrl} from '@/api/store'
-	export default {
-		data() {
-			return {
-				wv: null,
-				isClose: false, // 是否关闭当前窗口
-				isEditImg: false, // 是否正在编辑图片
-				showPz: false, // 是否正在拍照
-				types: 'video', // 巡店类型,video,scene
-				restart: '', // 是否重新巡店
-				taskId: '', // 任务id
-				storeId: '', // 门店id
-				assessSchemeId: '', // 方案id
-			};
-		},
-		methods: {
-			// 监听html页面事件
-			onmessage(event) {
-				let data = event.detail.data[0]
-				// console.log(data)
-				if(data.action == 'toast'){
-					uni.showToast({
-						icon:'none',
-						title: data.msg
-					})
-				}
-				// webview 窗口传过来的页面状态
-				if(data.action == 'getWinStatus'){
-					let d = JSON.parse(data.msg)
-					this[d.key] = d.val
-				}
-				// 获取视频地址
-				if(data.action == 'getVideoUrl'){
-					this.getStoreVideoUrl(JSON.parse(data.msg))
-				}
-				// 抓拍图片
-				if(data.action == 'takePhotos'){
-					this.takePhotos(JSON.parse(data.msg))
-				}
-				// 保存编辑后的图片
-				if(data.action == 'saveEditImg'){
-					this.uploadImg(data.msg)
-				}
-				// 删除图片
-				if(data.action == 'delImgs'){
-					this.delImgs(data.msg)
-				}
-				// 删除考评项
-				if(data.action == 'delKpItem'){
-					this.delKpItem(data.msg)
-				}
-				// 评分,保存指标结果
-				if(data.action == 'selZbResult'){
-					this.saveZbResult(JSON.parse(data.msg))
-				}
-				// 指标评论,图片更新保存
-				if(data.action == 'saveZbPlImgs'){
-					this.saveZbPlImgs(JSON.parse(data.msg))
-				}
-				// 更新考评总计
-				if(data.action == 'updateKpTj'){
-					this.getTaskDetail()
-				}
-				// 提交巡店
-				if(data.action == 'submitTask'){
-					this.submitTask()
-				}
-				// 现场巡店下一步签字页面
-				if(data.action == 'nextStep'){
-					this.nextStep()
-				}
-			},
-			//指标评论,图片更新保存
-			saveZbPlImgs(data){
-				let params = {
-					id: data.id,
-					comments: data.comments,
-					taskTargetPhotoList: []
+import { clzConfirm, saveBase64ToAliOss, saveImgToAliOss } from '@/libs/tools';
+import { taskStart, submitTask, updateTaskItem, getTaskDetail } from '@/api/task';
+import { getTaskItem, delTaskItem } from '@/api/taskItem';
+import { taskTargetSave, taskCommentsSave } from '@/api/taskTarget';
+import { findVsDeviceChannels, findStoreVsDevice, photoPaiZhao, getVideoUrl } from '@/api/store';
+export default {
+	data() {
+		return {
+			wv: null,
+			isClose: false, // 是否关闭当前窗口
+			isEditImg: false, // 是否正在编辑图片
+			showPz: false, // 是否正在拍照
+			types: 'video', // 巡店类型,video,scene
+			restart: '', // 是否重新巡店
+			taskId: '', // 任务id
+			storeId: '', // 门店id
+			assessSchemeId: '' // 方案id
+		};
+	},
+	methods: {
+		// 监听html页面事件
+		onmessage(event) {
+			let data = event.detail.data[0];
+			// console.log(data)
+			if (data.action == 'toast') {
+				uni.showToast({
+					icon: 'none',
+					title: data.msg
+				});
+			}
+			// webview 窗口传过来的页面状态
+			if (data.action == 'getWinStatus') {
+				let d = JSON.parse(data.msg);
+				this[d.key] = d.val;
+			}
+			// 获取视频地址
+			if (data.action == 'getVideoUrl') {
+				this.getStoreVideoUrl(JSON.parse(data.msg));
+			}
+			// 抓拍图片
+			if (data.action == 'takePhotos') {
+				console.log('takePhotos');
+				// 截图
+				if (this.types == 'video') {
+					this.takePhotos(JSON.parse(data.msg));
 				}
-				data.taskTargetPhotoList.map(item=>{
-					params.taskTargetPhotoList.push({
-						photoPath: item.photoPath
-					})
-				})
-				console.log(params,'saveZbPlImgs')
-				taskCommentsSave(params).then(res=>{
-					console.log(res)
-					if(res.status == 200){
-						this.wv.evalJS("vm.saveZbPlImgsSuccess()") 
-					}
-					uni.showToast({
-						icon:'none',
-						title: res.message
-					})
-				})
-			},
-			// 保存指标结果
-			saveZbResult(data){
-				console.log(data,'saveZbResult')
-				taskTargetSave(data).then(res=>{
-					if(res.status == 200){
-						this.wv.evalJS("vm.saveZbResultSuccess('"+JSON.stringify(data)+"')") 
-					}
-					uni.showToast({
-						icon:'none',
-						title: res.message
-					})
-				})
-			},
-			// 拍照截图,data.type 1 是列表按钮触发的,2 是弹框里触发的
-			takePhotos(data){
-				if(data.videoPlayerStatus == 'playing'){
-					uni.showLoading({
-						mask: true,
-						title: '正在抓拍图片...'
-					})
-					photoPaiZhao({streamId:data.streamId}).then(res=>{
-						console.log(res)
-						if(res.data){
-							this.wv.evalJS("vm.takePhotoSuccess('"+res.data.url+"')")
-						}else{
-							uni.showToast({
-								icon:'none',
-								title: res.message || '拍照截图失败,稍后重试'
-							})
-						}
-						uni.hideLoading()
-					})
-				}else{
-					uni.showToast({
-						icon:'none',
-						title: '开始播放视频后才可以拍照截图'
-					})
+				// 拍照
+				if (this.types == 'scene') {
+					console.log('camerPhotos');
+					this.camerPhotos();
 				}
-			},
+			}
+			// 保存编辑后的图片
+			if (data.action == 'saveEditImg') {
+				this.uploadImg(data.msg);
+			}
 			// 删除图片
-			delImgs(index){
-				const _this = this;
-				clzConfirm({
-					title: '提示',
-					content: '确定删除此图片,删除后无法恢复?',
-					success: function(res) {
-						if (res.confirm || res.index == 0) {
-							_this.wv.evalJS("vm.delImgsSuccess("+index+")") 
-						}
-					}
-				});
-			},
+			if (data.action == 'delImgs') {
+				this.delImgs(data.msg);
+			}
 			// 删除考评项
-			delKpItem(id){
-				const _this = this;
-				clzConfirm({
-					title: '提示',
-					content: '确定删除此考评项,删除后无法恢复?',
-					success: function(res) {
-						if (res.confirm || res.index == 0) {
-							delTaskItem({id:id}).then(ret=>{
-								if(ret.status == 200){
-									_this.wv.evalJS("vm.delKpItemSuccess("+id+")") 
-								}
-								uni.showToast({
-									icon:'none',
-									title: ret.message
-								})
-							})
-						}
-					}
+			if (data.action == 'delKpItem') {
+				this.delKpItem(data.msg);
+			}
+			// 评分,保存指标结果
+			if (data.action == 'selZbResult') {
+				this.saveZbResult(JSON.parse(data.msg));
+			}
+			// 指标评论,图片更新保存
+			if (data.action == 'saveZbPlImgs') {
+				this.saveZbPlImgs(JSON.parse(data.msg));
+			}
+			// 更新考评总计
+			if (data.action == 'updateKpTj') {
+				this.getTaskDetail();
+			}
+			// 提交巡店
+			if (data.action == 'submitTask') {
+				this.submitTask();
+			}
+			// 现场巡店下一步签字页面
+			if (data.action == 'nextStep') {
+				this.nextStep();
+			}
+		},
+		//指标评论,图片更新保存
+		saveZbPlImgs(data) {
+			let params = {
+				id: data.id,
+				comments: data.comments,
+				taskTargetPhotoList: []
+			};
+			data.taskTargetPhotoList.map(item => {
+				params.taskTargetPhotoList.push({
+					photoPath: item.photoPath
 				});
-			},
-			// 上传编辑后的图片到阿里云
-			uploadImg(formData) {
-				const _this = this;
-				saveBase64ToAliOss(formData,function(res){
-					// console.log(res);
-					// 关闭编辑图片
-					_this.wv.evalJS("vm.closeImgsEdit()")
-					// 更新编辑后的图片
-					_this.wv.evalJS("vm.updateItemImg('"+res.data+"')")
-				})
-			},
-			// 开始巡店(重新开始),isNew 0 新建,1 重新开始
-			creatTask(isNew){
-				// 新建任务,只传门店id
-				let parms = {
-					storeId:this.storeId,
-					type: this.types == 'video' ? 'VIDEO_INSPECTION' : 'SPOT_INSPECTION'
+			});
+			console.log(params, 'saveZbPlImgs');
+			taskCommentsSave(params).then(res => {
+				console.log(res);
+				if (res.status == 200) {
+					this.wv.evalJS('vm.saveZbPlImgsSuccess()');
 				}
-				// 重新开始,要传任务id
-				if(isNew){
-					parms.id = this.taskId
+				uni.showToast({
+					icon: 'none',
+					title: res.message
+				});
+			});
+		},
+		// 保存指标结果
+		saveZbResult(data) {
+			console.log(data, 'saveZbResult');
+			taskTargetSave(data).then(res => {
+				if (res.status == 200) {
+					this.wv.evalJS("vm.saveZbResultSuccess('" + JSON.stringify(data) + "')");
 				}
-				taskStart(parms).then(res => {
-					console.log(res,parms,'taskStart')
-					if(res.status == 200){
-						this.taskId = res.data.id
-						// 创建成功,查询任务明细
-						this.getTaskDetail()
-						this.getTaskItem()
-					}else{
-						uni.showToast({
-							icon:'none',
-							title: res.message
-						})
-					}
-				})
-			},
-			// 查询任务明细
-			getTaskDetail(){
-				getTaskDetail({id:this.taskId}).then(res => {
-					this.assessSchemeId = res.data.assessSchemeId // 方案id
-					this.wv.evalJS("vm.getTaskDetail('"+JSON.stringify(res.data)+"')")
-				})
-			},
-			// 任务考评项目明细
-			getTaskItem(){
-				getTaskItem({id:this.taskId}).then(res => {
-					console.log(res,'getTaskItem')
-					this.wv.evalJS("vm.getTaskItem('"+JSON.stringify(res.data)+"')")
-				})
-			},
-			// 更新方案项目
-			updateTaskItem(row){
-				console.log(row)
-				updateTaskItem({
-					id:this.taskId,
-					assessSchemeId: row.id,
-					assessSchemeName: row.name
-				}).then(res=>{
-					console.log(res,'updateTaskItem')
-					if(res.status==200){
-						// 重置页面
-						this.wv.evalJS("vm.resetPage()")
-						this.getTaskDetail()
-						this.getTaskItem()
-					}else{
-						uni.showToast({
-							icon:'none',
-							title: res.message
-						})
-					}
-				})
-			},
-			// 获取视频列表
-			getVideoList(){
-				let list = this.$store.state.vuex_storeVideoList
-				this.wv.evalJS("vm.setVideoList('"+JSON.stringify(list)+"')")
-			},
-			// 获取视频地址
-			getStoreVideoUrl(item){
-				getVideoUrl({streamId:item.streamId,outProtocol:"hls"}).then(res=>{
-					console.log(res)
-					if(res.status == 200&&res.data){
-						this.wv.evalJS("vm.getVideoUrlSuccess('"+res.data.url+"')")
-					}else{
+				uni.showToast({
+					icon: 'none',
+					title: res.message
+				});
+			});
+		},
+		// 拍照截图,data.type 1 是列表按钮触发的,2 是弹框里触发的
+		takePhotos(data) {
+			if (data.videoPlayerStatus == 'playing') {
+				uni.showLoading({
+					mask: true,
+					title: '正在抓拍图片...'
+				});
+				photoPaiZhao({ streamId: data.streamId }).then(res => {
+					console.log(res);
+					if (res.data) {
+						this.wv.evalJS("vm.takePhotoSuccess('" + res.data.url + "')");
+					} else {
 						uni.showToast({
-							icon:'none',
-							title: "获取视频地址失败,请返回重试"
-						})
-					}
-				})
-			},
-			// 提交本次任务
-			submitTask(){
-				const _this = this;
-				clzConfirm({
-					title: '提示',
-					content: '确定提交本次巡店?',
-					success: function(res) {
-						console.log(res,'--------')
-						if (res.confirm || res.index == 0) {
-							submitTask({
-								id: _this.taskId
-							}).then(ret=>{
-								console.log(ret)
-								if(ret.status == 200){
-									_this.isClose = true
-									// 打开完成页面
-									uni.redirectTo({
-										url:"/pages/shopTourCompleted/shopTourCompleted?taskId="+_this.taskId
-									})
-								}else{
-									_this.isClose = false
-								}
-								uni.showToast({
-									icon:'none',
-									title: ret.message
-								})
-							})
-						}
+							icon: 'none',
+							title: res.message || '拍照截图失败,稍后重试'
+						});
 					}
+					uni.hideLoading();
+				});
+			} else {
+				uni.showToast({
+					icon: 'none',
+					title: '开始播放视频后才可以拍照截图'
 				});
-			},
-			// 现场巡店下一步签字
-			nextStep(){
-				uni.navigateTo({
-					url:"/pages/shopTourOver/shopTourOver?taskId="+this.taskId
-				})
 			}
 		},
-		onLoad(options) {
-			console.log(options,'options')
-			// 巡店类型,视频还时现场
-			this.types = options.types
-			this.taskId = options.taskId
-			this.storeId = options.storeId
-			this.restart = options.restart
+		// 摄像机拍照
+		camerPhotos() {
+			const _this = this;
+			uni.chooseImage({
+				count: 1, //最多可以选择的图片张数,默认9
+				sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
+				sourceType: ['camera'], //album 从相册选图,camera 使用相机,默认二者都有
+				success: function(res) {
+					// tempFilePaths 图片的本地文件路径列表,tempFiles 图片的本地文件列表,每一项是一个 File 对象
+					console.log(JSON.stringify(res.tempFilePaths));
+					saveImgToAliOss(res.tempFilePaths[0], function(ret) {
+						console.log(ret);
+						_this.wv.evalJS("vm.takePhotoSuccess('" + ret.data + "')");
+					});
+				}
+			});
 		},
-		onUnload() {
-			uni.$off("resetTaskKpItem")
-			uni.$off("closeTour")
+		// 删除图片
+		delImgs(index) {
+			const _this = this;
+			clzConfirm({
+				title: '提示',
+				content: '确定删除此图片,删除后无法恢复?',
+				success: function(res) {
+					if (res.confirm || res.index == 0) {
+						_this.wv.evalJS('vm.delImgsSuccess(' + index + ')');
+					}
+				}
+			});
 		},
-		onReady() {
-			let _this = this
-			_this.isClose = false
-			// #ifdef APP-PLUS
-			 //获取当前页面的webview对象
-			 var currentWebview = this.$mp.page.$getAppWebview()
-			 //如果是页面初始化调用时,需要延时一下
-			 setTimeout(function() {
-				_this.wv = currentWebview.children()[0]
-				_this.wv.evalJS("vm.setTyps('"+_this.types+"')")
-				// 获取视频列表
-				if(_this.types == 'video'){
-					_this.getVideoList() 
+		// 删除考评项
+		delKpItem(id) {
+			const _this = this;
+			clzConfirm({
+				title: '提示',
+				content: '确定删除此考评项,删除后无法恢复?',
+				success: function(res) {
+					if (res.confirm || res.index == 0) {
+						delTaskItem({ id: id }).then(ret => {
+							if (ret.status == 200) {
+								_this.wv.evalJS('vm.delKpItemSuccess(' + id + ')');
+							}
+							uni.showToast({
+								icon: 'none',
+								title: ret.message
+							});
+						});
+					}
 				}
-				if(_this.restart == 1){ // 重新开始
-					_this.creatTask(1)
-				}else if(_this.restart == 0){ // 继续上次巡店
-					//查询任务明细
-					_this.getTaskDetail()
-					_this.getTaskItem()
-				}else{
-					// 首次新建
-					_this.creatTask(0)
+			});
+		},
+		// 上传编辑后的图片到阿里云
+		uploadImg(formData) {
+			const _this = this;
+			saveBase64ToAliOss(formData, function(res) {
+				// console.log(res);
+				// 关闭编辑图片
+				_this.wv.evalJS('vm.closeImgsEdit()');
+				// 更新编辑后的图片
+				_this.wv.evalJS("vm.updateItemImg('" + res.data + "')");
+			});
+		},
+		// 开始巡店(重新开始),isNew 0 新建,1 重新开始
+		creatTask(isNew) {
+			// 新建任务,只传门店id
+			let parms = {
+				storeId: this.storeId,
+				type: this.types == 'video' ? 'VIDEO_INSPECTION' : 'SPOT_INSPECTION'
+			};
+			// 重新开始,要传任务id
+			if (isNew) {
+				parms.id = this.taskId;
+			}
+			// 现场巡店,需要保存签到信息
+			if (this.types == 'scene') {
+				let signin = this.$store.state.vuex_sceneTaskSignIn;
+				parms.inspectorPositionAddr = signin.inspectorPositionAddr;
+				parms.inspectorPositionPhotoBasePath = signin.inspectorPositionPhotoBasePath;
+				parms.inspectorPositionPhotoPath = signin.inspectorPositionPhotoPath;
+			}
+			taskStart(parms).then(res => {
+				console.log(res, parms, 'taskStart');
+				if (res.status == 200) {
+					this.taskId = res.data.id;
+					// 创建成功,查询任务明细
+					this.getTaskDetail();
+					this.getTaskItem();
+				} else {
+					uni.showToast({
+						icon: 'none',
+						title: res.message
+					});
 				}
-			 }, 500);
-			// #endif
-			
-			// 监听选择方案后事件,schemeId 方案id
-			uni.$on("resetTaskKpItem",(row)=>{
-				_this.updateTaskItem(row)
-			})
-			
-			// 关闭当前页面
-			uni.$on("closeTour",(flag)=>{
-				if(flag==1){
-					this.isClose = true
-					uni.navigateBack()
+			});
+		},
+		// 查询任务明细
+		getTaskDetail() {
+			getTaskDetail({ id: this.taskId }).then(res => {
+				this.assessSchemeId = res.data.assessSchemeId; // 方案id
+				this.wv.evalJS("vm.getTaskDetail('" + JSON.stringify(res.data) + "')");
+			});
+		},
+		// 任务考评项目明细
+		getTaskItem() {
+			getTaskItem({ id: this.taskId }).then(res => {
+				console.log(res, 'getTaskItem');
+				this.wv.evalJS("vm.getTaskItem('" + JSON.stringify(res.data) + "')");
+			});
+		},
+		// 更新方案项目
+		updateTaskItem(row) {
+			console.log(row);
+			updateTaskItem({
+				id: this.taskId,
+				assessSchemeId: row.id,
+				assessSchemeName: row.name
+			}).then(res => {
+				console.log(res, 'updateTaskItem');
+				if (res.status == 200) {
+					// 重置页面
+					this.wv.evalJS('vm.resetPage()');
+					this.getTaskDetail();
+					this.getTaskItem();
+				} else {
+					uni.showToast({
+						icon: 'none',
+						title: res.message
+					});
 				}
-			})
+			});
+		},
+		// 获取视频列表
+		getVideoList() {
+			let list = this.$store.state.vuex_storeVideoList;
+			this.wv.evalJS("vm.setVideoList('" + JSON.stringify(list) + "')");
 		},
-		// 监听返回键
-		onBackPress() {
-			console.log(this.isEditImg,'onBackPress')
-			let _this = this
-			if(!_this.isClose){
-				// 正在编辑图片
-				if(this.isEditImg){
-					// 关闭编辑图片
-					_this.wv.evalJS("vm.closeImgsEdit()")
+		// 获取视频地址
+		getStoreVideoUrl(item) {
+			getVideoUrl({ streamId: item.streamId, outProtocol: 'hls' }).then(res => {
+				console.log(res);
+				if (res.status == 200 && res.data) {
+					this.wv.evalJS("vm.getVideoUrlSuccess('" + res.data.url + "')");
+				} else {
+					uni.showToast({
+						icon: 'none',
+						title: '获取视频地址失败,请返回重试'
+					});
 				}
-				// 正在拍照
-				else if(this.showPz){
-					// 关闭拍照弹框
-					_this.wv.evalJS("vm.onClosePz()")
-				}else{
-					clzConfirm({
-						title: '提示',
-						content: '巡店还未完成,确定退出吗?',
-						success: function(res) {
-							if (res.confirm || res.index == 0) {
-								_this.isClose = true
-								uni.navigateBack({
-									delta: 1
+			});
+		},
+		// 提交本次任务
+		submitTask() {
+			const _this = this;
+			clzConfirm({
+				title: '提示',
+				content: '确定提交本次巡店?',
+				success: function(res) {
+					console.log(res, '--------');
+					if (res.confirm || res.index == 0) {
+						submitTask({
+							id: _this.taskId
+						}).then(ret => {
+							console.log(ret);
+							if (ret.status == 200) {
+								_this.isClose = true;
+								// 打开完成页面
+								uni.redirectTo({
+									url: '/pages/shopTourCompleted/shopTourCompleted?taskId=' + _this.taskId
 								});
+							} else {
+								_this.isClose = false;
 							}
-						}
-					});
+							uni.showToast({
+								icon: 'none',
+								title: ret.message
+							});
+						});
+					}
 				}
-				
-				return true
-			}
+			});
 		},
-		// 添加考评模板
-		onNavigationBarButtonTap(e) {
-			// 且当前没编辑图片或抓拍图片
-			if(e.index==0 && !this.isEditImg){
-				uni.navigateTo({
-					url: '/pages/evaluatePlan/evaluatePlan?id='+this.assessSchemeId
-				})
-			}else{
-				uni.showToast({
-					icon:"none",
-					title:"正在编辑图片,不能选择考评方案"
-				})
+		// 现场巡店下一步签字
+		nextStep() {
+			uni.navigateTo({
+				url: '/pages/shopTourOver/shopTourOver?taskId=' + this.taskId
+			});
+		}
+	},
+	onLoad(options) {
+		console.log(options, 'options');
+		// 巡店类型,视频还时现场
+		this.types = options.types;
+		this.taskId = options.taskId;
+		this.storeId = options.storeId;
+		this.restart = options.restart;
+	},
+	onUnload() {
+		uni.$off('resetTaskKpItem');
+		uni.$off('closeTour');
+	},
+	onReady() {
+		let _this = this;
+		_this.isClose = false;
+		// #ifdef APP-PLUS
+		//获取当前页面的webview对象
+		var currentWebview = this.$mp.page.$getAppWebview();
+		//如果是页面初始化调用时,需要延时一下
+		setTimeout(function() {
+			_this.wv = currentWebview.children()[0];
+			_this.wv.evalJS("vm.setTyps('" + _this.types + "')");
+			// 获取视频列表
+			if (_this.types == 'video') {
+				_this.getVideoList();
 			}
-		},
+			if (_this.restart == 1) {
+				// 重新开始
+				_this.creatTask(1);
+			} else if (_this.restart == 0) {
+				// 继续上次巡店
+				//查询任务明细
+				_this.getTaskDetail();
+				_this.getTaskItem();
+			} else {
+				// 首次新建
+				_this.creatTask(0);
+			}
+		}, 500);
+		// #endif
+
+		// 监听选择方案后事件,schemeId 方案id
+		uni.$on('resetTaskKpItem', row => {
+			_this.updateTaskItem(row);
+		});
+
+		// 关闭当前页面
+		uni.$on('closeTour', flag => {
+			if (flag == 1) {
+				this.isClose = true;
+				uni.navigateBack();
+			}
+		});
+	},
+	// 监听返回键
+	onBackPress() {
+		console.log(this.isEditImg, 'onBackPress');
+		let _this = this;
+		if (!_this.isClose) {
+			// 正在编辑图片
+			if (this.isEditImg) {
+				// 关闭编辑图片
+				_this.wv.evalJS('vm.closeImgsEdit()');
+			}
+			// 正在拍照
+			else if (this.showPz) {
+				// 关闭拍照弹框
+				_this.wv.evalJS('vm.onClosePz()');
+			} else {
+				clzConfirm({
+					title: '提示',
+					content: '巡店还未完成,确定退出吗?',
+					success: function(res) {
+						if (res.confirm || res.index == 0) {
+							_this.isClose = true;
+							uni.navigateBack({
+								delta: 1
+							});
+						}
+					}
+				});
+			}
+
+			return true;
+		}
+	},
+	// 添加考评模板
+	onNavigationBarButtonTap(e) {
+		// 且当前没编辑图片或抓拍图片
+		if (e.index == 0 && !this.isEditImg) {
+			uni.navigateTo({
+				url: '/pages/evaluatePlan/evaluatePlan?id=' + this.assessSchemeId
+			});
+		} else {
+			uni.showToast({
+				icon: 'none',
+				title: '正在编辑图片,不能选择考评方案'
+			});
+		}
 	}
+};
 </script>
 
-<style>
-
-</style>
+<style></style>

+ 50 - 34
pages/shopTourOver/shopTourOver.vue

@@ -4,14 +4,14 @@
 		<view class="autograph-con">
 			<text class="autograph-tit">店长签名:</text>
 			<view class="autograph-main">
-				<autograph-to-pic canvasId="handWriting-dz" :isEmpty="isEmpty" />
+				<autograph-to-pic ref="dz" canvasId="handWriting-dz"/>
 			</view>
 		</view>
 		<!-- 巡店人签名 -->
 		<view class="autograph-con">
 			<text class="autograph-tit">巡店人签名:</text>
 			<view class="autograph-main">
-				<autograph-to-pic canvasId="handWriting-xd" :isEmpty="isEmpty" />
+				<autograph-to-pic ref="xdr" canvasId="handWriting-xd" />
 			</view>
 		</view>
 		<u-button type="primary" shape="circle" class="submit-btn" @click="submitFun">提交</u-button>
@@ -28,10 +28,6 @@
 		},
 		data(){
 			return{
-				isEmpty: [  //  是否为空判断
-					{name: 'handWriting-dz', state: true},
-					{name: 'handWriting-xd', state: true}
-				],
 				taskId: '',
 				inspectorSign:'', // 巡店人签名
 				storeManagerSign:'', // 店长签名
@@ -44,35 +40,55 @@
 			// 提交本次任务
 			submitFun(){
 				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>

+ 18 - 3
pages/signIn/signIn.vue

@@ -115,6 +115,12 @@ export default {
 				uni.showToast({ icon: 'none', title: '请拍照后再进行签到' })
 				return
 			}
+			// 存储当前签到信息
+			this.$u.vuex('vuex_sceneTaskSignIn',{
+				inspectorPositionAddr: '',
+				inspectorPositionPhotoBasePath:'',
+				inspectorPositionPhotoPath: this.photograph
+			})
 			//  判断是否超出签到范围
 			validTaskPosition({
 				storeId: this.stores.id,
@@ -125,9 +131,18 @@ export default {
 			}).then(res => {
 				if (res.status == 200) {
 					//  跳转开始巡店
-					uni.redirectTo({
-						url: '/pages/shopTour/shopTour?storeId=' + this.stores.id + '&types=scene'
-					})
+					let item = this.stores
+					// 重新开始巡店
+					if(item.taskId&&item.restart){
+						uni.navigateTo({
+							url: '/pages/shopTour/shopTour?storeId=' + item.id + '&taskId='+ item.taskId + '&restart=1&types=scene'
+						})
+					}else{
+						// 首次巡店
+						uni.navigateTo({
+							url: '/pages/shopTour/shopTour?storeId=' + item.id + '&types=scene'
+						})
+					}
 				} else {
 					uni.showToast({ icon: 'none', title: res.message })
 				}

+ 2 - 2
pages/siteInspection/siteInspection.vue

@@ -127,14 +127,14 @@
 										})
 							        }else if(result.cancel || result.index==1){  //  重新开始
 										uni.navigateTo({
-											url:"/pages/signIn/signIn?item=" + encodeURIComponent(JSON.stringify(item))
+											url:"/pages/signIn/signIn?item=" + encodeURIComponent(JSON.stringify({id:item.id,name:item.name,taskId:res.data,restart:1}))
 										})
 							        }
 							    }
 							})
 						}else{
 							uni.navigateTo({
-								url:"/pages/signIn/signIn?item=" + encodeURIComponent(JSON.stringify(item))
+								url:"/pages/signIn/signIn?item=" + encodeURIComponent(JSON.stringify({id:item.id,name:item.name}))
 							})
 						}
 					}else{

+ 1 - 0
pages/spotCheck/spotCheck.vue

@@ -173,6 +173,7 @@
 			this.taskId = options.taskId
 			this.storeId = options.storeId
 			this.storeName = options.storeName
+			console.log(options,this.taskId)
 		},
 		onUnload() {
 			uni.$off("closeTour")

+ 5 - 3
pages/spotCheckCenter/spotChecking.vue

@@ -59,8 +59,8 @@ export default {
 		};
 	},
 	onLoad() {
-		// 获取任务状态
-		this.tabList = this.$store.state.vuex_spotCheckStatus
+		// 获取任务状态   对象深度克隆
+		this.tabList = this.$u.deepClone(this.$store.state.vuex_spotCheckStatus)
 		this.tabList.unshift({dispName: '全部', code: ''})
 		// 加载列表
 		this.resetPage();
@@ -159,8 +159,10 @@ export default {
 		},
 		//  开始点检
 		toSpotCheck(item){
+			console.log(item)
+			console.log('/pages/spotCheck/spotCheck?taskId=' + item.id + '&types=video&storeId='+item.storeId+'&storeName='+item.storeName)
 			// 判断当前门店是否已绑定设备
-			findStoreVsDevice({storeCode:item.code}).then(res=>{
+			findStoreVsDevice({storeCode:item.storeCode}).then(res=>{
 				if(res.data.length){
 					// 门店下的设备
 					this.$u.vuex('vuex_storeVideoList',res.data)

+ 1 - 0
store/index.js

@@ -101,6 +101,7 @@ const store = new Vuex.Store({
 		vuex_storeVideoList: [], // 视频巡店时的当前门店设备信息
 		vuex_spotCheckStatus: [], // 点检任务的状态
 		vuex_taskStatus: [], // 任务状态
+		vuex_sceneTaskSignIn: null, // 现场巡店签到信息
 	},
 	mutations: {
 		$uStore(state, payload) {

File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/app-plus/app-service.js


+ 5 - 13
unpackage/dist/dev/app-plus/app-view.js

@@ -7154,7 +7154,7 @@ __webpack_require__.r(__webpack_exports__);
 Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default =
 
 {
-  name: "UniCheckList", props: ["listData", "types", "titleKeys", "noDataText", "showArrow", "defValue", "backValue", "checkIconPositon"],
+  name: "UniCheckList", props: ["listData", "types", "titleKeys", "noDataText", "status", "showArrow", "defValue", "backValue", "checkIconPositon"],
   data: function data() {
     return {
       wxsProps: {} };
@@ -8725,7 +8725,7 @@ var render = function() {
           _c(
             "v-uni-view",
             { staticClass: _vm._$g(3, "sc"), attrs: { _i: 3 } },
-            [_c("autograph-to-pic", { attrs: { _i: 4 } })],
+            [_c("autograph-to-pic", { ref: "dz", attrs: { _i: 4 } })],
             1
           )
         ],
@@ -8743,7 +8743,7 @@ var render = function() {
           _c(
             "v-uni-view",
             { staticClass: _vm._$g(7, "sc"), attrs: { _i: 7 } },
-            [_c("autograph-to-pic", { attrs: { _i: 8 } })],
+            [_c("autograph-to-pic", { ref: "xdr", attrs: { _i: 8 } })],
             1
           )
         ],
@@ -8942,7 +8942,7 @@ __webpack_require__.r(__webpack_exports__);
 Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default =
 
 {
-  props: ["canvasId", "isEmpty"],
+  props: ["canvasId"],
   data: function data() {
     return {
       wxsProps: {} };
@@ -16437,15 +16437,7 @@ var render = function() {
           }),
           _c(
             "u-dropdown-item",
-            {
-              staticClass: _vm._$g(3, "sc"),
-              attrs: { _i: 3 },
-              on: {
-                change: function($event) {
-                  return _vm.$handleViewEvent($event)
-                }
-              }
-            },
+            { staticClass: _vm._$g(3, "sc"), attrs: { _i: 3 } },
             [
               _c(
                 "v-uni-view",

+ 1 - 1
unpackage/dist/dev/app-plus/hybrid/html/video.html

@@ -397,7 +397,7 @@
 					takePhotos(type){
 						if(!this.curZbItem.taskTargetPhotoList||this.curZbItem.taskTargetPhotoList.length<6){
 							this.sendMsg('takePhotos',JSON.stringify({
-								streamId: this.curVideo.streamId,
+								streamId: this.curVideo&&this.curVideo.streamId,
 								videoPlayerStatus: this.videoPlayerStatus,
 								type: type
 							}))

File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/app-plus/manifest.json


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/app-plus/view.umd.min.js


Some files were not shown because too many files changed in this diff