소스 검색

点检任务

lilei 4 년 전
부모
커밋
c07fabc4a5
4개의 변경된 파일489개의 추가작업 그리고 443개의 파일을 삭제
  1. 415 362
      hybrid/html/ddvideo.html
  2. 54 3
      pages/spotCheck/spotCheck.vue
  3. 0 0
      unpackage/dist/dev/app-plus/app-service.js
  4. 20 78
      unpackage/dist/dev/app-plus/app-view.js

+ 415 - 362
hybrid/html/ddvideo.html

@@ -1,61 +1,61 @@
 <!DOCTYPE html>
 <html>
-<head>
-<meta charset="utf-8">
-<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"/>
-<title>点检巡店</title>
-<script src="js/vue@2.6.11"></script>
-<script src="js/uni.webview.1.5.2.js"></script>
-<!-- antd ui -->
-<script type="text/javascript" charset="utf-8" src="js/moment.min.js"></script>
-<script type="text/javascript" charset="utf-8" src="js/moment-with-locales.min.js"></script>
-<link rel="stylesheet" href="antd/antd.min.css" />
-<script type="text/javascript" charset="utf-8" src="antd/antd.min.js"></script>
-<!-- 编辑图片 -->
-<script type="text/javascript" charset="utf-8" src="imgEdit/ped.min.js"></script>
-<!-- 播放器 -->
-<link rel="stylesheet" href="aliplayer/aliplayer-min.css" />
-<script type="text/javascript" charset="utf-8" src="aliplayer/aliplayer-h5-min.js"></script>
-<!-- 页面样式 -->
-<link rel="stylesheet/less" type="text/css" href="css/styles.less" />
-<script src="js/less.min.js"></script>
-</head>
-<body>
-<div class="storeCheck" id="app">
-    <!-- 播放器 -->
-    <div class="videoPlay" v-if="xdType=='video'">
-      <!-- 云台控制 -->
-      <div class="control-yt" v-show="showYt&&!showYtbtns" @click="openYt"></div>
-      <div class="control-yt-close" v-show="showYtbtns" @click="openYt"></div>
-      <div v-show="showYtbtns" @click="kzYt(1)" class="ytBtns yt-left"></div>
-      <div v-show="showYtbtns" @click="kzYt(2)" class="ytBtns yt-right"></div>
-      <div v-show="showYtbtns" @click="kzYt(3)" class="ytBtns yt-top"></div>
-      <div v-show="showYtbtns" @click="kzYt(4)" class="ytBtns yt-bottom"></div>
-      <!-- 播放器 -->
-      <div class="prism-player" id="player-con"></div>
-    </div>
-    <!-- 工作区 -->
-    <div class="checkWork">
-      <!-- 统计及摄像头切换 -->
-      <div class="checkWork-head">
-        <div class="checkWork-head-row" v-if="xdType=='video'">
-          <!-- 机位 -->
-          <div>
-            <div>机位:</div>
-			<div></div>
-            <div>
-              <a-dropdown>
-                <a-menu selectable slot="overlay" @click="onVideoListClick">
-                  <a-menu-item v-for="item in videoList" :key="item.id"> {{item.name}} </a-menu-item>
-                </a-menu>
-				<a class="ant-dropdown-link" @click="e => e.preventDefault()">
-				  {{curVideo&&curVideo.name}} <a-icon type="down" />
-				</a>
-              </a-dropdown>
-            </div>
-          </div>
-          <!-- 预置位 -->
-          <!-- <div>
+	<head>
+		<meta charset="utf-8">
+		<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
+		<title>点检巡店</title>
+		<script src="js/vue@2.6.11"></script>
+		<script src="js/uni.webview.1.5.2.js"></script>
+		<!-- antd ui -->
+		<script type="text/javascript" charset="utf-8" src="js/moment.min.js"></script>
+		<script type="text/javascript" charset="utf-8" src="js/moment-with-locales.min.js"></script>
+		<link rel="stylesheet" href="antd/antd.min.css" />
+		<script type="text/javascript" charset="utf-8" src="antd/antd.min.js"></script>
+		<!-- 编辑图片 -->
+		<script type="text/javascript" charset="utf-8" src="imgEdit/ped.min.js"></script>
+		<!-- 播放器 -->
+		<link rel="stylesheet" href="aliplayer/aliplayer-min.css" />
+		<script type="text/javascript" charset="utf-8" src="aliplayer/aliplayer-h5-min.js"></script>
+		<!-- 页面样式 -->
+		<link rel="stylesheet" href="css/styles.css" />
+	</head>
+	<body>
+		<div class="storeCheck" id="app">
+			<!-- 播放器 -->
+			<div class="videoPlay" v-if="xdType=='video'">
+				<!-- 云台控制 -->
+				<div class="control-yt" v-show="showYt&&!showYtbtns" @click="openYt"></div>
+				<div class="control-yt-close" v-show="showYtbtns" @click="openYt"></div>
+				<div v-show="showYtbtns" @click="kzYt(1)" class="ytBtns yt-left"></div>
+				<div v-show="showYtbtns" @click="kzYt(2)" class="ytBtns yt-right"></div>
+				<div v-show="showYtbtns" @click="kzYt(3)" class="ytBtns yt-top"></div>
+				<div v-show="showYtbtns" @click="kzYt(4)" class="ytBtns yt-bottom"></div>
+				<!-- 播放器 -->
+				<div class="prism-player" id="player-con"></div>
+			</div>
+			<!-- 工作区 -->
+			<div class="checkWork">
+				<!-- 统计及摄像头切换 -->
+				<div class="checkWork-head">
+					<div class="checkWork-head-row" v-if="xdType=='video'">
+						<!-- 机位 -->
+						<div>
+							<div>机位:</div>
+							<div></div>
+							<div>
+								<a-dropdown>
+									<a-menu selectable slot="overlay" @click="onVideoListClick">
+										<a-menu-item v-for="item in videoList" :key="item.gbId"> {{item.name}} </a-menu-item>
+									</a-menu>
+									<a class="ant-dropdown-link" @click="e => e.preventDefault()">
+										{{curVideo&&curVideo.name}}
+										<a-icon type="down" />
+									</a>
+								</a-dropdown>
+							</div>
+						</div>
+						<!-- 预置位 -->
+						<!-- <div>
             <div>预置位:</div>
             <div>
               <a-dropdown>
@@ -68,312 +68,365 @@
               </a-dropdown>
             </div>
           </div> -->
-        </div>
-      </div>
-      <!-- 打分 -->
-      <div class="checkWork-body">
-        <div style="width: 100%;" class="checkWork-body-tabCons">
-          <div class="tabCons-items" v-for="(zb,zbIndex) in zbItem" :key="zb.id">
-            <div>
-              <div><b>{{zb.assessTargetName}}</b></div>
-			  <!-- 点击打开拍照 -->
-              <div @click="openCamera(zbIndex)"><a-icon type="camera" style="font-size: 30px;" /></div>
-            </div>
-			<!-- 拍照图片 -->
-			<div class="photos">
-				<div 
-				v-for="(photo,pindex) in zb.taskTargetPhotoVOList" 
-				:key="photo.id"
-				>
-				<a-avatar :size="40" shape="square" :src="photo.photoPath" />
+					</div>
+				</div>
+				<!-- 打分 -->
+				<div class="checkWork-body">
+					<div style="width: 100%;" class="checkWork-body-tabCons">
+						<div class="tabCons-items" v-for="(zb,zbIndex) in zbItem" :key="zb.id">
+							<div>
+								<div><b>{{zb.assessTargetName}}</b></div>
+								<!-- 点击打开拍照 -->
+								<div @click="openCamera(zbIndex)">
+									<a-icon type="camera" style="font-size: 30px;" />
+								</div>
+							</div>
+							<!-- 拍照图片 -->
+							<div class="photos">
+								<div v-for="(photo,pindex) in zb.taskTargetPhotoList" :key="photo.id">
+									<a-avatar :size="40" shape="square" :src="photo.photoPath" />
+								</div>
+							</div>
+							<!-- 评论 -->
+							<div class="remarks">
+								评论:{{zb.comments}}
+							</div>
+							<!-- 评分 -->
+							<div>
+								<div>
+									<!-- 分值:{{zb.getScore}} <a-icon @click="openEditFs" type="edit" style="font-size: 20px;margin-left: 10px;"/> -->
+								</div>
+								<div>
+									<!-- 不适用 -->
+									<a-icon @click="selZbResult(0,zb)" type="minus-circle" :class="zb.result=='NOT_WORK'?'choose-bsy':''" />
+								</div>
+								<div>
+									<!-- 不合格 -->
+									<a-icon @click="selZbResult(1,zb)" type="close-circle" :class="zb.result=='NOT_PASS'?'choose-bhg':''" />
+								</div>
+								<div>
+									<!-- 合格 -->
+									<a-icon @click="selZbResult(2,zb)" type="check-circle" :class="zb.result=='PASS'?'choose-hg':''" />
+								</div>
+							</div>
+						</div>
+						<div v-if="!zbItem" style="text-align: center;padding-top: 50px;">
+							暂无数据
+						</div>
+					</div>
+				</div>
+				<!-- 提交按钮 -->
+				<div class="checkWork-button">
+					<div v-if="xdType=='video'" @click="submitTask">提交</div>
 				</div>
 			</div>
-			<!-- 评论 -->
-			<div class="remarks">
-				评论:{{zb.comments}}
+			<!-- 拍照弹框 -->
+			<a-drawer title="快拍" placement="bottom" :closable="true" :visible="showPz" @close="onClosePz" :height="360">
+				<div class="pzPopus">
+					<!-- 评论 -->
+					<div class="pz-pinglun">
+						<div class="remarks">
+							<a-textarea placeholder="请填写备注内容(选填)" v-model="curZbItem.comments" :rows="4" />
+						</div>
+						<div class="icons" @click="takePhotos(2)">
+							<a-icon class="aicon" type="camera" />
+						</div>
+					</div>
+					<!-- 图片列表 -->
+					<div class="imglist">
+						<div v-for="(photo,pindex) in curZbItem.taskTargetPhotoList" :key="pindex">
+							<img @click="editImgs(photo.photoPath,activeZbIndex,pindex)" :src="photo.photoPath">
+							<a-icon @click.stop="delImgs(pindex)" class="aicon" type="close" />
+						</div>
+					</div>
+					<!-- 提交 -->
+					<div class="f-btns">
+						<a-button size="large" @click="saveZbPlImgs" type="primary" block> 提交 </a-button>
+					</div>
+				</div>
+			</a-drawer>
+
+			<!-- 加载条 -->
+			<div v-if="showLoading" class="loading">
+				<a-spin />
 			</div>
-			<!-- 评分 -->
-            <div>
-              <div><!-- 分值:{{zb.getScore}} <a-icon @click="openEditFs" type="edit" style="font-size: 20px;margin-left: 10px;"/> --></div>
-              <div>
-				  <!-- 不适用 -->
-                <a-icon @click="selZbResult(0,zb)" type="minus-circle" :class="zb.result=='bsy'?'choose-bsy':''"/>
-              </div>
-			  <div>
-				  <!-- 不合格 -->
-				  <a-icon @click="selZbResult(1,zb)" type="close-circle" :class="zb.result=='bhg'?'choose-bhg':''"/>
-			  </div>
-			  <div>
-				  <!-- 合格 -->
-				  <a-icon @click="selZbResult(2,zb)" type="check-circle" :class="zb.result=='hg'?'choose-hg':''"/>
-			  </div>
-            </div>
-          </div>
-		  </div>
-      </div>
-      <!-- 提交按钮 -->
-	  <div class="checkWork-button">
-		  <div v-if="xdType=='video'" @click="submitTask">提交</div>
-	  </div>
-	</div>
-	<!-- 拍照弹框 -->
-	<a-drawer
-	  title="快拍"
-	  placement="bottom"
-	  :closable="true"
-	  :visible="showPz"
-	  @close="onClosePz"
-	  :height="360"
-	>
-	  <div class="pzPopus">
-		  <!-- 评论 -->
-		  <div class="pz-pinglun">
-			  <div class="remarks">
-				  <a-textarea placeholder="请填写备注内容(选填)" v-model="curZbItem.comments" :rows="4" />
-			  </div>
-			  <div class="icons">
-				  <a-icon class="aicon" type="camera" />
-			  </div>
-		  </div>
-		  <!-- 图片列表 -->
-		  <div class="imglist">
-			  <div v-for="(photo,pindex) in curZbItem.taskTargetPhotoVOList" 
-				:key="photo.id"
-				>
-				  <img @click="editImgs(photo.photoPath,activeZbIndex,pindex)" :src="photo.photoPath">
-				  <a-icon @click.stop="delImgs(pindex)" class="aicon" type="close" />
-			  </div>
-		  </div>
-		  <!-- 提交 -->
-		  <div class="f-btns">
-			  <a-button size="large" @click="saveZbPlImgs" type="primary" block> 提交 </a-button>
-		  </div>
-	  </div>
-	</a-drawer>
-	
-	<!-- 加载条 -->
-	<div v-if="showLoading" class="loading">
-	    <a-spin />
-	</div>
-  </div>
-<script>
-	window.onload = function(){
-		vm.showLoading = false
-	}
-	// 初始化vm 实例
-	var vm = new Vue({
-	  el: '#app',
-	  data: {
-		  xdType:'video', // 巡店类型
-		  player: null, // 播放器对象
-		  videoList: [], // 播放通道
-		  curVideo: null, // 当前播放的视频
-		  showYt: false, // 显示云台控制
-		  showYtbtns: false,
-		  showPz: false,// 显示拍照弹框
-		  showLoading: true, // 页面加载条
-		  isEditImg: false, // 是否编辑图片
-		  PED: null, // 图片编辑对象
-		  activeZbIndex:0,//当前编辑的指标index
-		  activeZbPhoto:0, //当前编辑的指标图片index
-		  curZbItem: {comments:'',taskTargetPhotoVOList:[]},// 当前编辑的指标评论图片对象
-		  zbItem: [],// 考评项
-		},
-		mounted () {
-		  let _this = this
-		  moment.locale('zh-cn');
-		},
-		methods: {
-	      // 重置页面
-		  resetPage(){
-			  this.activeZbIndex = 0
-			  this.activeZbPhoto = 0
-			  this.curZbItem = {comments:'',taskTargetPhotoVOList:[]}
-			  this.showPz = false
-		  },
-		  // 设置巡店类型及标题
-		  setTyps(type,storeName){
-			  this.xdType = type
-			  // 设置标题
-			  document.title = storeName
-		  },
-		  // 设置视频列表
-		  setVideoList(data){
-			  this.videoList = JSON.parse(data)
-			  this.curVideo = this.videoList[0]
-			  this.videoInit()
-		  },
-		  // 设置任务项列表
-		  getTaskDetail(data){
-			  this.zbItem = JSON.parse(data)
-		  },
-		  // 选择机位
-		  onVideoListClick({ key }){
-			  let v = this.videoList.find(item=>item.id == key)
-			  if(v){
-				  this.curVideo = v
-				  // 重置播放器
-				  this.showYt = false
-				  this.showYtbtns = false
-				  this.player.dispose()
-				  this.videoInit()
-			  }
-		  },
-		  // 初始化播放器
-		  videoInit(){
-			  const _this = this
-			  const videoSrc = this.curVideo.videoSrc
-			  // 初始化播放器
-			  _this.player = new Aliplayer({
-			    'id': 'player-con',
-			    'source': videoSrc,
-			    'width': '100%',
-			    'height': '240px',
-			    'autoplay': false,
-			    'isLive': true,
-			    'rePlay': true,
-			    'playsinline': true,
-			    'preload': true,
-			    'language': 'zh-cn',
-			    'useH5Prism': true,
-			    'extraInfo': {
-			      'crossOrigin': 'anonymous'
-			    },
-			    'skinLayout': [
-			      {
-			        'name': 'bigPlayButton',
-			        'align': 'cc'
-			      },
-			      {
-			        'name': 'errorDisplay',
-			        'align': 'tlabs',
-			        'x': 0,
-			        'y': 0
-			      },
-			      {
-			        'name': 'infoDisplay'
-			      },
-			      {
-			        'name': 'controlBar',
-			        'align': 'blabs',
-			        'x': 0,
-			        'y': 0,
-			        'children': [
-			          {
-			            'name': 'fullScreenButton',
-			            'align': 'tr',
-			            'x': 15,
-			            'y': 10
-			          },
-			          {
-			            'name': 'volume',
-			            'align': 'tr',
-			            'x': 15,
-			            'y': 8
-			          },
-			          {
-			            'name': 'liveDisplay',
-			            'align': 'tl',
-			            'x': 15,
-			            'y': 2
-			          }
-			        ]
-			      }
-			    ]
-			  }, function (player) {
-			    _this.sendMsg('message','The player is created')
-			  }
-			  )
-			  // 控制栏
-			  _this.player.on('playing', function () {
-			    _this.showYt = true
-			  })
-			  _this.player.on('error',function(e){
-				  console.log(JSON.stringify(e),'error')
-			  })
-		  },
-		  // 发送消息给app 页面
-		  sendMsg (action,msg) {
-		    uni.postMessage({
-		      data: {
-		        action: action,
-		        msg: msg
-		      }
-		    })
-		  },
-		  // 显示云台控制按钮
-		  openYt () {
-		    this.showYtbtns = !this.showYtbtns
-		  },
-		  // 控制云台
-		  kzYt (index) {
-		    const cmd = ['left', 'right', 'up', 'down']
-		    this.sendMsg('kzyt','控制云台' + cmd[index - 1])
-		  },
-		  // 打开抓拍照片弹框
-		  openCamera(index){
-			 this.showPz = true
-			 this.activeZbIndex = index
-			 this.sendMsg('getWinStatus',JSON.stringify({key:'showPz',val: true}))
-			 // 当前查看的指标对象
-			 let obj = this.zbItem[this.activeZbIndex]
-			 this.curZbItem = JSON.parse(JSON.stringify(obj))
-		  },
-		  // 关闭抓拍弹框
-		  onClosePz(){
-			  this.showPz = false
-			  this.sendMsg('getWinStatus',JSON.stringify({key:'showPz',val: false}))
-		  },
-		  // 删除图片
-		  delImgs(index){
-			  this.sendMsg('delImgs',index)
-		  },
-		  delImgsSuccess(index){
-			  this.curZbItem.taskTargetPhotoVOList.splice(index,1)
-		  },
-		  // 预览编辑图片
-		  editImgs(url,index,pindex){
-			   let _this = this
-			   _this.activeZbIndex = index
-			   _this.activeZbPhoto = pindex
-			   _this.sendMsg('getWinStatus',JSON.stringify({key:'isEditImg',val: true}))
-			   this.PED = new window.PED.imageInfo(
-			   url,
-			   function(data){
-				   // 保存图片编辑
-				   _this.sendMsg('saveEditImg',data)
-			   },
-			   function(){
-				   _this.sendMsg('getWinStatus',JSON.stringify({key:'isEditImg',val: false}))
-			   })
-		  },
-		  // 关闭图片编辑
-		  closeImgsEdit(){
-			  this.PED.hidePED()
-			  this.sendMsg('getWinStatus',JSON.stringify({key:'isEditImg',val: false}))
-		  },
-		  // 更新编辑后的图片
-		  updateItemImg(path){
-			  let photoList = this.curZbItem.taskTargetPhotoVOList
-			  photoList[this.activeZbPhoto].photoPath = path
-		  },
-		  // 评分,0 不适用,1 不合格,2 合格
-		  selZbResult(type,zb){
-			  let ret = ['bsy','bhg','hg']
-			  zb.result = ret[type]
-		  },
-		  // 保存指标评论及图片
-		  saveZbPlImgs(){
-			  this.zbItem.splice(this.activeZbIndex,1,this.curZbItem)
-			  this.onClosePz()
-		  },
-		  // 提交此次任务
-		  submitTask(){
-			  this.sendMsg('submitTask',JSON.stringify(this.zbItem))
-		  },
-		}
-	})
- 
-</script>
-</body>
-</html>
+		</div>
+		<script>
+			// 初始化vm 实例
+			var vm = new Vue({
+				el: '#app',
+				data: {
+					xdType: 'video', // 巡店类型
+					player: null, // 播放器对象
+					videoPlayerStatus:'',// 视频播放状态
+					videoList: [], // 播放通道
+					curVideo: null, // 当前播放的视频
+					showYt: false, // 显示云台控制
+					showYtbtns: false,
+					showPz: false, // 显示拍照弹框
+					showLoading: true, // 页面加载条
+					isEditImg: false, // 是否编辑图片
+					PED: null, // 图片编辑对象
+					activeZbIndex: 0, //当前编辑的指标index
+					activeZbPhoto: 0, //当前编辑的指标图片index
+					curZbItem: {
+						comments: '',
+						taskTargetPhotoList: []
+					}, // 当前编辑的指标评论图片对象
+					zbItem: [], // 考评项
+				},
+				mounted() {
+					let _this = this
+					moment.locale('zh-cn');
+				},
+				methods: {
+					// 重置页面
+					resetPage() {
+						this.activeZbIndex = 0
+						this.activeZbPhoto = 0
+						this.curZbItem = {
+							comments: '',
+							taskTargetPhotoList: []
+						}
+						this.showPz = false
+					},
+					// 设置巡店类型及标题
+					setTyps(type, storeName) {
+						console.log(type)
+						this.xdType = type
+						// 设置标题
+						document.title = storeName
+					},
+					// 设置视频列表
+					setVideoList(data) {
+						this.videoList = JSON.parse(data)
+						this.curVideo = this.videoList[0]
+						this.getVideoUrl()
+					},
+					// 设置任务项列表
+					getTaskDetail(data) {
+						this.zbItem = JSON.parse(data)
+					},
+					// 选择机位
+					onVideoListClick({key}) {
+						this.videoPlayerStatus = ''
+						let v = this.videoList.find(item => item.gbId == key)
+						if (v) {
+							this.curVideo = v
+							this.getVideoUrl()
+						}
+					},
+					// 获取当前设备流地址
+					getVideoUrl(){
+						this.sendMsg('getVideoUrl', JSON.stringify(this.curVideo))
+					},
+					// 获取视频地址成功
+					getVideoUrlSuccess(url){
+						// 重置播放器
+						this.showYt = false
+						this.showYtbtns = false
+						if(this.player){
+							this.player.dispose()
+						}
+						this.videoInit(url)
+					},
+					// 初始化播放器
+					videoInit(videoSrc) {
+						const _this = this
+						// 初始化播放器
+						_this.player = new Aliplayer({
+							'id': 'player-con',
+							'source': videoSrc,
+							'width': '100%',
+							'height': '240px',
+							'autoplay': false,
+							'isLive': true,
+							'rePlay': true,
+							'playsinline': true,
+							'preload': true,
+							'language': 'zh-cn',
+							'useH5Prism': true,
+							'extraInfo': {
+								'crossOrigin': 'anonymous'
+							},
+							'skinLayout': [{
+									'name': 'bigPlayButton',
+									'align': 'cc'
+								},
+								{
+									'name': 'errorDisplay',
+									'align': 'tlabs',
+									'x': 0,
+									'y': 0
+								},
+								{
+									'name': 'infoDisplay'
+								},
+								{
+									'name': 'controlBar',
+									'align': 'blabs',
+									'x': 0,
+									'y': 0,
+									'children': [{
+											'name': 'fullScreenButton',
+											'align': 'tr',
+											'x': 15,
+											'y': 10
+										},
+										{
+											'name': 'volume',
+											'align': 'tr',
+											'x': 15,
+											'y': 8
+										},
+										{
+											'name': 'liveDisplay',
+											'align': 'tl',
+											'x': 15,
+											'y': 2
+										}
+									]
+								}
+							]
+						}, function(player) {
+							_this.sendMsg('message', 'The player is created')
+						})
+						// 控制栏
+						_this.player.on('playing', function() {
+							// _this.showYt = true
+							_this.videoPlayerStatus = 'playing'
+						})
+						_this.player.on('error', function(e) {
+							console.log(JSON.stringify(e), 'error')
+						})
+					},
+					// 发送消息给app 页面
+					sendMsg(action, msg) {
+						uni.postMessage({
+							data: {
+								action: action,
+								msg: msg
+							}
+						})
+					},
+					// 显示云台控制按钮
+					openYt() {
+						this.showYtbtns = !this.showYtbtns
+					},
+					// 控制云台
+					kzYt(index) {
+						const cmd = ['left', 'right', 'up', 'down']
+						this.sendMsg('kzyt', '控制云台' + cmd[index - 1])
+					},
+					// 打开抓拍照片弹框
+					openCamera(index) {
+						// 显示弹框
+						this.showPz = true
+						this.activeZbIndex = index
+						this.sendMsg('getWinStatus', JSON.stringify({
+							key: 'showPz',
+							val: true
+						}))
+						// 当前查看的指标对象
+						let obj = this.zbItem[this.activeZbIndex]
+						this.curZbItem = Object.assign({
+							comments: '',
+							taskTargetPhotoList: []
+						},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,
+								videoPlayerStatus: this.videoPlayerStatus,
+								type: type
+							}))
+						}else{
+							this.sendMsg('toast','最多抓拍6张图片')
+						}
+					},
+					// 拍照成功后,返回图片地址
+					takePhotoSuccess(url){
+						let obj = {
+							photoPath: url
+						}
+						if(!this.curZbItem.hasOwnProperty('taskTargetPhotoList')){
+							this.curZbItem.taskTargetPhotoList = [obj]
+						}else{
+							this.curZbItem.taskTargetPhotoList.push(obj)
+							this.curZbItem.taskTargetPhotoList.splice()
+						}
+					},
+					// 关闭抓拍弹框
+					onClosePz() {
+						this.showPz = false
+						this.sendMsg('getWinStatus', JSON.stringify({
+							key: 'showPz',
+							val: false
+						}))
+					},
+					// 删除图片
+					delImgs(index) {
+						this.sendMsg('delImgs', index)
+					},
+					delImgsSuccess(index) {
+						console.log(index,'delImgsSuccess')
+						this.curZbItem.taskTargetPhotoList.splice(index, 1)
+					},
+					// 预览编辑图片
+					editImgs(url, index, pindex) {
+						let _this = this
+						_this.activeZbIndex = index
+						_this.activeZbPhoto = pindex
+						_this.sendMsg('getWinStatus', JSON.stringify({
+							key: 'isEditImg',
+							val: true
+						}))
+						this.PED = new window.PED.imageInfo(
+							url,
+							function(data) {
+								// 保存图片编辑
+								_this.sendMsg('saveEditImg', data)
+							},
+							function() {
+								_this.sendMsg('getWinStatus', JSON.stringify({
+									key: 'isEditImg',
+									val: false
+								}))
+							})
+					},
+					// 关闭图片编辑
+					closeImgsEdit() {
+						this.PED.hidePED()
+						this.sendMsg('getWinStatus', JSON.stringify({
+							key: 'isEditImg',
+							val: false
+						}))
+					},
+					// 更新编辑后的图片
+					updateItemImg(path) {
+						let photoList = this.curZbItem.taskTargetPhotoList
+						photoList[this.activeZbPhoto].photoPath = path
+					},
+					// 评分,0 不适用,1 不合格,2 合格
+					selZbResult(type, zb) {
+						let result = ['NOT_WORK', 'NOT_PASS', 'PASS']
+						zb.result = result[type]
+					},
+					// 保存指标评论及图片
+					saveZbPlImgs() {
+						this.zbItem.splice(this.activeZbIndex, 1, this.curZbItem)
+						this.onClosePz()
+					},
+					// 提交此次任务
+					submitTask() {
+						this.sendMsg('submitTask', JSON.stringify(this.zbItem))
+					},
+				}
+			})
+		</script>
+	</body>
+</html>

+ 54 - 3
pages/spotCheck/spotCheck.vue

@@ -27,11 +27,25 @@
 			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)
@@ -58,6 +72,32 @@
 					}
 				});
 			},
+			// 拍照截图,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: '开始播放视频后才可以拍照截图'
+					})
+				}
+			},
 			// 上传编辑后的图片到阿里云
 			uploadImg(formData) {
 				const _this = this;
@@ -78,9 +118,20 @@
 			},
 			// 获取视频列表
 			getVideoList(){
-				findVsDeviceChannels({storeId:this.storeId}).then(res=>{
-					if(res.status==200){
-						this.wv.evalJS("vm.setVideoList('"+JSON.stringify(res.data)+"')")
+				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: "获取视频地址失败,请返回重试"
+						})
 					}
 				})
 			},

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
unpackage/dist/dev/app-plus/app-service.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 20 - 78
unpackage/dist/dev/app-plus/app-view.js


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.