萤石云播放方式修改,修复bug
This commit is contained in:
parent
57b576f28e
commit
00ecfff5cc
8
main.js
8
main.js
@ -93,11 +93,11 @@ if (process.env.NODE_ENV === 'development') {
|
||||
} else {
|
||||
// 生产环境
|
||||
console.log('生产环境')
|
||||
Vue.prototype.url_config = 'http://117.146.73.156:9809/'// 中新建项目
|
||||
Vue.prototype.work_url = 'http://117.146.73.156:19997'// 工作流地址 通用
|
||||
// Vue.prototype.url_config = 'http://117.146.73.156:9809/'// 中新建项目
|
||||
// Vue.prototype.work_url = 'http://117.146.73.156:19997'// 工作流地址 通用
|
||||
// Vue.prototype.url_config = 'http://121.37.106.37:9809/' // 测试环境
|
||||
// Vue.prototype.url_config = 'http://101.43.164.214:11111/'
|
||||
// Vue.prototype.work_url = 'http://101.43.164.214:11131'// 工作流地址 通用
|
||||
Vue.prototype.url_config = 'http://101.43.164.214:11111/'
|
||||
Vue.prototype.work_url = 'http://101.43.164.214:11131'// 工作流地址 通用
|
||||
// Vue.prototype.url_config = 'http://10.168.1.105:11111/' // 线上地址
|
||||
// Vue.prototype.url_config = 'http://10.168.1.104:11111/' // 线上地址
|
||||
// Vue.prototype.url_config = 'http://47.93.215.234:9809/' // 鞍钢线上地址(弃用)
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
"name" : "智慧安全", //中建四局
|
||||
"appid" : "__UNI__4AA4101",
|
||||
"description" : "",
|
||||
"versionName" : "1.3.6",
|
||||
"versionCode" : 136,
|
||||
"versionName" : "1.3.8",
|
||||
"versionCode" : 138,
|
||||
"transformPx" : false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus" : {
|
||||
|
||||
@ -1,71 +1,4 @@
|
||||
<template>
|
||||
<view class="fullHeight">
|
||||
<headers :showBack="true" :themeType="'white'">
|
||||
<view class="headerName">
|
||||
移动考勤
|
||||
</view>
|
||||
</headers>
|
||||
<view class="box personInfoBox">
|
||||
<!-- <image v-if="personDetail.fieldAcquisitionUrl" :src="url_config+'image/'+personDetail.fieldAcquisitionUrl" class="profile_photo"></image> -->
|
||||
<image src="/static/profile_photo.png" class="profile_photo"></image>
|
||||
<view class="info">
|
||||
<view class="personName">
|
||||
{{realName}}
|
||||
</view>
|
||||
<!-- <view class="groupName">
|
||||
木工班组
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="box" :style="{'height':(screenHeight - statusBarHeight - 44 - 105 - 15 - 30)+'px'}">
|
||||
<view class="top">
|
||||
<view class="item">
|
||||
<view class="type">
|
||||
上班
|
||||
</view>
|
||||
<view class="time" v-if="attendenceData.enterTime">
|
||||
<uni-icons class="backImg" type="checkbox-filled" size="14" color="#5181F6"></uni-icons>
|
||||
{{enterTime}} 已打卡
|
||||
</view>
|
||||
<view class="time" v-else>
|
||||
未打卡
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="type">
|
||||
下班
|
||||
</view>
|
||||
<view class="time" v-if="attendenceData.outTime">
|
||||
<uni-icons class="backImg" type="checkbox-filled" size="14" color="#5181F6"></uni-icons>
|
||||
{{outTime}}已打卡
|
||||
</view>
|
||||
<view class="time" v-else>
|
||||
未打卡
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom">
|
||||
<view class="">
|
||||
<view class="circleBox" :class="canClick?'':'grey'" @click="clockIn">
|
||||
<view class="name">
|
||||
{{!attendenceData.enterTime?'上班':!attendenceData.outTime?'下班':'更新'}}打卡
|
||||
</view>
|
||||
<view class="time">
|
||||
{{nowTime}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="address" v-if="canClick">
|
||||
<uni-icons class="backImg" type="checkbox-filled" size="14"
|
||||
color="#0bb44e"></uni-icons>已进入考勤范围:{{electricFence.addr}}
|
||||
</view>
|
||||
<view class="address" v-else>
|
||||
<uni-icons class="backImg" type="location-filled" size="14"
|
||||
color="rgba(38, 45, 71, 0.7)"></uni-icons>未进入考勤区域
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fullHeight">
|
||||
<headers :showBack="true" :themeType="'white'">
|
||||
<view class="headerName"> 考勤打卡 </view>
|
||||
@ -227,255 +160,6 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uniIcons from "@/components/uni-icons/uni-icons.vue"
|
||||
export default {
|
||||
components: {
|
||||
uniIcons
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
statusBarHeight: 0,
|
||||
screenHeight: 667,
|
||||
personDetail: {
|
||||
fieldAcquisitionUrl: ''
|
||||
},
|
||||
canClick: false,
|
||||
projectDetail: {},
|
||||
electricFence: {},
|
||||
attendenceData: {
|
||||
enterTime: null,
|
||||
outTime: null
|
||||
},
|
||||
currentTime: '',
|
||||
photoUrl: '',
|
||||
timer: null,
|
||||
realName: '',
|
||||
phoneClockImageType: 0,
|
||||
faceScore: 0,
|
||||
timer: '', //定义一个定时器
|
||||
nowTime: '',
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
enterTime: function() {
|
||||
if (this.attendenceData.enterTime) {
|
||||
var a = this.attendenceData.enterTime.split(' ')[1]
|
||||
return a
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
},
|
||||
outTime: function() {
|
||||
if (this.attendenceData.outTime) {
|
||||
var a = this.attendenceData.outTime.split(' ')[1]
|
||||
return a
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getTime()
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (this.timer) {
|
||||
clearInterval(this.timer)
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.statusBarHeight = uni.getStorageSync('systemInfo').statusBarHeight
|
||||
this.screenHeight = uni.getStorageSync('systemInfo').screenHeight
|
||||
this.projectDetail = JSON.parse(uni.getStorageSync('projectDetail'))
|
||||
var userInfo = JSON.parse(uni.getStorageSync('userInfo'))
|
||||
this.workerId = userInfo.workerId
|
||||
this.realName = userInfo.realName
|
||||
// 校验是否在考勤范围内
|
||||
this.GetLOcation()
|
||||
// 获取考勤时间
|
||||
this.getAttendenceData()
|
||||
// this.getNowTime()
|
||||
// 判断是否需要人脸-后台配置
|
||||
this.getAttendenceTypeFn()
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 线上代码1-后台配置人脸识别,this.photoUrl-代表人脸识别成功
|
||||
// if (this.phoneClockImageType == 1 && this.photoUrl) {
|
||||
// 本地测试
|
||||
if (this.photoUrl) {
|
||||
console.log("==================人脸识别成功-开始考勤===================", this.photoUrl);
|
||||
this.addPhoneAttendanceFn()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 判断是否需要人脸识别
|
||||
getAttendenceTypeFn() {
|
||||
var that = this
|
||||
this.sendRequest({
|
||||
url: 'xmgl/projectConfig/getProjectConfigList',
|
||||
data: {
|
||||
projectSn: this.projectDetail.projectSn
|
||||
},
|
||||
method: "POST",
|
||||
success(res) {
|
||||
if (res.result) {
|
||||
console.log("============是否需要人脸===========", res.result);
|
||||
that.phoneClockImageType = res.result[0].phoneClockImageType
|
||||
that.faceScore = res.result[0].faceScore
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
// 计时器
|
||||
getTime() {
|
||||
this.timer = setInterval(() => {
|
||||
let timeDate = new Date()
|
||||
let year = timeDate.getFullYear()
|
||||
let mounth = timeDate.getMonth() + 1
|
||||
let day = timeDate.getDate()
|
||||
let hours = timeDate.getHours()
|
||||
hours = hours >= 10 ? hours : '0' + hours
|
||||
let minutes = timeDate.getMinutes()
|
||||
minutes = minutes >= 10 ? minutes : '0' + minutes
|
||||
let seconds = timeDate.getSeconds()
|
||||
seconds = seconds >= 10 ? seconds : '0' + seconds
|
||||
let week = timeDate.getDay()
|
||||
let weekArr = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
|
||||
this.nowTime = ` ${hours}:${minutes}:${seconds}`
|
||||
}, 1000)
|
||||
},
|
||||
// 获取考勤信息
|
||||
getAttendenceData() {
|
||||
// 获取经纬度
|
||||
var that = this
|
||||
this.sendRequest({
|
||||
url: 'xmgl/workerAttendance/getPersonAttendanceTime',
|
||||
data: {
|
||||
workerId: this.workerId
|
||||
},
|
||||
method: "POST",
|
||||
success(res) {
|
||||
console.log('getAttendenceData', res)
|
||||
that.attendenceData = res.result
|
||||
}
|
||||
})
|
||||
},
|
||||
GetLOcation: function() {
|
||||
var that = this;
|
||||
uni.getLocation({
|
||||
type: 'gcj02',
|
||||
success: (res) => {
|
||||
console.log('success', res)
|
||||
var latitude = parseFloat(res.latitude);
|
||||
var longitude = parseFloat(res.longitude);
|
||||
that.isInArea(longitude, latitude)
|
||||
},
|
||||
fail(res) {
|
||||
console.log('fail', res)
|
||||
// uni.showModal({
|
||||
// title:'提示',
|
||||
// content:res.errMsg
|
||||
// })
|
||||
}
|
||||
});
|
||||
},
|
||||
// 校验坐标位置是否在考勤区域中
|
||||
isInArea(longitude, latitude) {
|
||||
var that = this
|
||||
this.sendRequest({
|
||||
url: 'xmgl/electricFence/checkLocation',
|
||||
data: {
|
||||
longitude: longitude,
|
||||
projectSn: this.projectDetail.projectSn,
|
||||
latitude: latitude,
|
||||
workerId: this.workerId
|
||||
},
|
||||
method: "POST",
|
||||
hideLoading: true,
|
||||
success(res) {
|
||||
console.log('isInArea', res)
|
||||
if (res.result.checkType == 0) {
|
||||
console.log('不在考勤范围内')
|
||||
that.canClick = false
|
||||
} else {
|
||||
console.log('在考勤范围内')
|
||||
that.canClick = true
|
||||
that.electricFence = res.result.electricFence
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 手机打卡
|
||||
addPhoneAttendanceFn() {
|
||||
// 打卡事件-打卡/识别-后台配置 0-打卡/1-人脸/2-拍照
|
||||
var that = this
|
||||
var type = 1
|
||||
console.log("===============第三步==================");
|
||||
if (this.attendenceData.enterTime) {
|
||||
type = 2
|
||||
}
|
||||
this.sendRequest({
|
||||
url: 'xmgl/workerAttendance/addPhoneAttendance',
|
||||
data: {
|
||||
workerId: this.workerId,
|
||||
photoUrl: this.photoUrl,
|
||||
type: type
|
||||
},
|
||||
method: "POST",
|
||||
success(res) {
|
||||
console.log('===========addPhoneAttendanceFn==并且有识别照片==', res)
|
||||
that.getAttendenceData()
|
||||
}
|
||||
})
|
||||
},
|
||||
clockIn() {
|
||||
if (!this.canClick) {
|
||||
return
|
||||
}
|
||||
console.log("===============第一步==================", this.phoneClockImageType);
|
||||
if (this.phoneClockImageType == '1') {
|
||||
uni.navigateTo({
|
||||
url: `./faceRecognition?faceScore=${this.faceScore}&config=${this.url_config}`
|
||||
})
|
||||
|
||||
} else if (this.phoneClockImageType == '2') {
|
||||
var that = this
|
||||
uni.chooseImage({
|
||||
count: 1, //默认9
|
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
// sourceType: ['camera','album'], //从相册选择
|
||||
sourceType: ['camera'], //从相册选择
|
||||
success: function(res) {
|
||||
console.log(JSON.stringify(res.tempFilePaths));
|
||||
const tempFilePaths = res.tempFilePaths;
|
||||
uni.uploadFile({
|
||||
url: that.url_config + 'upload/image', //post请求的地址
|
||||
filePath: tempFilePaths[0],
|
||||
name: 'files',
|
||||
// formData: {
|
||||
// 'username': this.userInfo.username //formData是指除了图片以外,额外加的字段
|
||||
// },
|
||||
success: (uploadFileRes) => {
|
||||
//这里要注意,uploadFileRes.data是个String类型,要转对象的话需要JSON.parse一下
|
||||
var obj = JSON.parse(uploadFileRes.data);
|
||||
console.log('obj', obj)
|
||||
that.photoUrl = obj.data[0].imageUrl
|
||||
that.addPhoneAttendanceFn()
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.addPhoneAttendanceFn()
|
||||
console.log("===============第二步==================");
|
||||
}
|
||||
|
||||
},
|
||||
}
|
||||
}
|
||||
import UTimeLine from '@/components/u-time-line/u-time-line.vue'
|
||||
import UTimeLineItem from '@/components/u-time-line-item/u-time-line-item.vue'
|
||||
import UTabbar from '@/components/u-tabbar/u-tabbar.vue'
|
||||
|
||||
@ -7,7 +7,21 @@
|
||||
</headers>
|
||||
<!-- <video class="videoBox" id="myVideo" :custom-cache="false" :src="url" controls autoplay></video> -->
|
||||
<!-- 外网IP地址访问视频监控 -->
|
||||
<video class="videoBox" id="myVideo" :custom-cache="false" :src="playUrlFilter" controls autoplay></video>
|
||||
<view v-show="isYsy && playUrlFilter && accessToken" :style="{width: '100%', height: '225px'}">
|
||||
<!-- H5环境使用ezuikit -->
|
||||
<!-- #ifdef H5 -->
|
||||
<iframe :src="ysyPlayUrl" :style="webviewStyles" frameborder="0" :scrolling="'no'"></iframe>
|
||||
<!-- #endif -->
|
||||
<!-- APP环境使用web-view -->
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<web-view
|
||||
:src="ysyPlayUrl"
|
||||
:style="webviewStyles"
|
||||
:webview-styles="webviewConfig"
|
||||
></web-view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
<video v-show="!isYsy" class="videoBox" id="myVideo" :custom-cache="false" :src="playUrlFilter" controls autoplay></video>
|
||||
<view class="videoName">
|
||||
{{videoInfo.videoName}}
|
||||
<button v-if="videoInfo.videoType==3" type="primary" class="changeBtn btn" @click="changeStreamFn">{{streamType==1?'切换到主码流':'切换到子码流'}}</button>
|
||||
@ -26,7 +40,7 @@
|
||||
<view class="zoom zoomout" :style="{backgroundImage: typeName == 'ZOOM_OUT' && videoFlag?'url(../../static/videoControlIcon/4.png)':'url(../../static/videoControlIcon/3.png)'}" @click="controlVideoFn(0,0,-0.2,'ZOOM_OUT')"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="video-playback" v-if="videoConfig.videoType != 1" @click="toBackList">
|
||||
<view class="video-playback" v-if="videoConfig && videoConfig.videoType != 1" @click="toBackList">
|
||||
视频回放
|
||||
</view>
|
||||
</view>
|
||||
@ -45,6 +59,16 @@
|
||||
videoFlag: false,
|
||||
typeName: "",
|
||||
videoConfig:{},
|
||||
accessToken: "",
|
||||
webviewStyles: {
|
||||
height: '225px',
|
||||
width: '100%'
|
||||
},
|
||||
webviewConfig: {
|
||||
progress: false, // 是否显示进度条
|
||||
scalable: false // 是否允许缩放
|
||||
},
|
||||
pageTop: 44
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
@ -58,6 +82,11 @@
|
||||
}
|
||||
this.getUseProjectVideoConfig();
|
||||
},
|
||||
onReady(){
|
||||
this.$nextTick(() => {
|
||||
this.setHeight()
|
||||
})
|
||||
},
|
||||
computed: {
|
||||
playUrlFilter(){
|
||||
//
|
||||
@ -69,9 +98,55 @@
|
||||
// }
|
||||
// console.log(url);
|
||||
return this.url
|
||||
},
|
||||
isYsy(){
|
||||
return this.videoInfo?.videoType == 1
|
||||
},
|
||||
ysyPlayUrl() {
|
||||
// 萤石云播放地址
|
||||
return `https://open.ys7.com/ezopen/h5/iframe?url=${this.playUrlFilter}&template=simple&autoplay=1&accessToken=${this.accessToken}`
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
setHeight() {
|
||||
if(!this.isYsy){
|
||||
return
|
||||
}
|
||||
let height = 0; //定义动态的高度变量,如高度为定值,可以直接写
|
||||
let statusbar = 0
|
||||
uni.getSystemInfo({
|
||||
//成功获取的回调函数,返回值为系统信息
|
||||
success: (sysinfo) => {
|
||||
statusbar = sysinfo.statusBarHeight;
|
||||
height = sysinfo.windowHeight; //自行修改,自己需要的高度 此处如底部有其他内容,可以直接---(-50)这种
|
||||
},
|
||||
complete: () => {}
|
||||
});
|
||||
this.pageTop = statusbar + 44 + 'px'
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
let currentWebview = this.$scope.$getAppWebview(); //获取当前web-view
|
||||
setTimeout(function() {
|
||||
let wv = currentWebview.children()[0];
|
||||
|
||||
wv.setStyle({ //设置web-view距离顶部的距离以及自己的高度,单位为px
|
||||
top: statusbar + 44 , //此处是距离顶部的高度,页面的头部
|
||||
height: 225 , //webview的高度
|
||||
scalable: false, //webview的页面是否可以缩放,双指放大缩小,
|
||||
position: "static"
|
||||
})
|
||||
wv.addEventListener('loaded', (e) => {
|
||||
console.log('loaded', e)
|
||||
wv.setStyle({ //设置web-view距离顶部的距离以及自己的高度,单位为px
|
||||
top: statusbar + 44 , //此处是距离顶部的高度,页面的头部
|
||||
height: 225 , //webview的高度
|
||||
scalable: false, //webview的页面是否可以缩放,双指放大缩小,
|
||||
position: "static"
|
||||
})
|
||||
})
|
||||
}, 100); //如页面初始化调用需要写延迟
|
||||
// #endif
|
||||
},
|
||||
getUseProjectVideoConfig() {
|
||||
var that = this
|
||||
let requestData = {
|
||||
@ -115,7 +190,9 @@
|
||||
success(res){
|
||||
switch (that.videoInfo.videoType){
|
||||
case 1:
|
||||
that.url=res.result.videoInfo.hdFlvAddress
|
||||
// that.url=res.result.videoInfo.hdFlvAddress
|
||||
that.url=res.result.videoInfo
|
||||
that.accessToken = res.result.accessToken
|
||||
break;
|
||||
default:
|
||||
that.url=res.result.videoInfo.url
|
||||
@ -389,4 +466,9 @@
|
||||
// margin-top: -20px;
|
||||
// margin-left: -22px;
|
||||
// }
|
||||
|
||||
// 添加web-view相关样式
|
||||
/deep/ web-view {
|
||||
background-color: #000;
|
||||
}
|
||||
</style>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user