Compare commits
6 Commits
664a4a91c6
...
0c89302ef9
| Author | SHA1 | Date | |
|---|---|---|---|
| 0c89302ef9 | |||
| 8e6ca1a051 | |||
| 84dafffd17 | |||
|
|
d30b6d67ab | ||
|
|
8ec6377f77 | ||
| cce66ee074 |
@ -1,4 +1,5 @@
|
||||
import {User} from "../pages/interfaces"
|
||||
// 候选人数据
|
||||
export const CandidateData: Array<User> = [
|
||||
{
|
||||
sfzmhm: '342323199501470011',
|
||||
|
||||
35
entry/src/main/ets/mock/VideoData.ets
Normal file
35
entry/src/main/ets/mock/VideoData.ets
Normal file
@ -0,0 +1,35 @@
|
||||
import { VideoConfig } from '../pages/interfaces'
|
||||
|
||||
// 视频配置默认数据
|
||||
export const VideoConfigData: VideoConfig = {
|
||||
videoNum: '1',
|
||||
spls: '1',
|
||||
wz: '0,0',
|
||||
faceFlag: false,
|
||||
shuiying: true,
|
||||
pztd: '2',
|
||||
ljlx: '',
|
||||
ip: '192.168.36.94',
|
||||
port: '554',
|
||||
userName: 'admin',
|
||||
pwd: '12345qwe',
|
||||
td1: '1',
|
||||
td2: '2',
|
||||
td3: '3',
|
||||
td4: '4',
|
||||
videoRecord1: false,
|
||||
videoRecord2: true,
|
||||
videoRecord3: false,
|
||||
videoRecord4: false,
|
||||
text1: '',
|
||||
text2: '',
|
||||
text3: '',
|
||||
dolt: '',
|
||||
fontSize: '',
|
||||
rlls: '1',
|
||||
spzd4: false,
|
||||
spzd3: false,
|
||||
spzd2: false,
|
||||
spzd1: false,
|
||||
zdyz: '5',
|
||||
}
|
||||
3
entry/src/main/ets/mock/index.ets
Normal file
3
entry/src/main/ets/mock/index.ets
Normal file
@ -0,0 +1,3 @@
|
||||
export * from "./CandidateData"
|
||||
|
||||
export * from "./VideoData"
|
||||
@ -21,6 +21,7 @@ import {
|
||||
} from '../common/service/indexService';
|
||||
import abilityAccessCtrl, { Permissions } from '@ohos.abilityAccessCtrl';
|
||||
import promptAction from '@ohos.promptAction';
|
||||
import { VideoConfigData } from '../mock';
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
|
||||
@ -92,9 +92,4 @@ export default struct Index {
|
||||
|
||||
outClick() {
|
||||
}
|
||||
|
||||
saveLog() {
|
||||
// this.FileLog.initFileLogo('d .0ateLog')
|
||||
// this.FileLog.createFile('123')
|
||||
}
|
||||
}
|
||||
@ -19,7 +19,7 @@ import {string2Bytes} from '../common/utils/tools'
|
||||
import { getSyncData } from '../common/service/initable'
|
||||
@Entry
|
||||
@Component
|
||||
struct UserInfo {
|
||||
export default struct UserInfo {
|
||||
@State pageIndex: number = 0
|
||||
@State ratio: number = 1700 / 960
|
||||
@State index: number = 0
|
||||
@ -276,7 +276,7 @@ struct UserInfo {
|
||||
that.getExaminationStudentInfoFn()
|
||||
}
|
||||
}, 5000)
|
||||
}else{
|
||||
} else {
|
||||
this.getExaminationItemFn()
|
||||
}
|
||||
|
||||
@ -411,10 +411,10 @@ struct UserInfo {
|
||||
lsh: this.currentUser.lsh || '',
|
||||
examinationRoomId
|
||||
});
|
||||
if(examItems?.getExaminationItemRsp?.body?.kssycs!=0){
|
||||
if (examItems?.getExaminationItemRsp?.body?.kssycs != 0) {
|
||||
this.getExaminationStudentInfoFn()
|
||||
}else{
|
||||
this.dataList=[]
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.currentUser = EmptyCandidateObject
|
||||
}
|
||||
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
import TopLogo from './compontents/TopLogo'
|
||||
import FileUtil from '../common/utils/File'
|
||||
import { VideoConfig } from './interfaces'
|
||||
import TopLogo from './compontents/topLogo';
|
||||
import FileUtil from '../common/utils/File';
|
||||
import { VideoConfig } from './interfaces';
|
||||
import common from '@ohos.app.ability.common';
|
||||
import promptAction from '@ohos.promptAction'
|
||||
import { startRecordVideo, endRecordVideo,takePhoto } from '../common/service/videoService'
|
||||
import { GlobalConfig } from '../config/index'
|
||||
import promptAction from '@ohos.promptAction';
|
||||
import { endRecordVideo, startRecordVideo, takePhoto } from '../common/service/videoService';
|
||||
import { GlobalConfig } from '../config/index';
|
||||
import { VideoConfigData } from '../mock';
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
struct Index {
|
||||
@ -13,100 +15,36 @@ struct Index {
|
||||
@State previewUri: Resource = $r('app.media.2_nor')
|
||||
@State curRate: PlaybackSpeed = PlaybackSpeed.Speed_Forward_1_00_X
|
||||
@State inputFontSize: number = 10 //12
|
||||
@State rocordHandleObj:any = {
|
||||
rocord_handle1:0,
|
||||
rocord_handle2:0,
|
||||
rocord_handle3:0,
|
||||
rocord_handle4:0
|
||||
@State rocordHandleObj: any = {
|
||||
rocord_handle1: 0,
|
||||
rocord_handle2: 0,
|
||||
rocord_handle3: 0,
|
||||
rocord_handle4: 0
|
||||
}
|
||||
@State isAutoPlay: boolean = true
|
||||
@State showFlag: boolean = false
|
||||
private vocObj = null;
|
||||
@State showControls: boolean = false
|
||||
private fileUtil: FileUtil
|
||||
@State @Watch('outClick') outFlag: boolean = false;
|
||||
@State oldParam: VideoConfig = {
|
||||
videoNum:'1',
|
||||
spls: '1',
|
||||
wz: '0,0',
|
||||
faceFlag: false,
|
||||
shuiying: true,
|
||||
pztd: '2',
|
||||
ljlx: '',
|
||||
ip: '192.168.36.94',
|
||||
port: '554',
|
||||
userName: 'admin',
|
||||
pwd: '12345qwe',
|
||||
td1: '1',
|
||||
td2: '2',
|
||||
td3: '3',
|
||||
td4: '4',
|
||||
videoRecord1: false,
|
||||
videoRecord2: true,
|
||||
videoRecord3: false,
|
||||
videoRecord4: false,
|
||||
text1: '',
|
||||
text2: '',
|
||||
text3: '',
|
||||
dolt: '',
|
||||
fontSize: '',
|
||||
rlls: '1',
|
||||
spzd4:false,
|
||||
spzd3:false,
|
||||
spzd2:false,
|
||||
spzd1:false,
|
||||
zdyz:'5',
|
||||
}
|
||||
@State param: VideoConfig = {
|
||||
videoNum:'1',
|
||||
spls: '1',
|
||||
wz: '0,0',
|
||||
faceFlag: false,
|
||||
shuiying: true,
|
||||
pztd: '2',
|
||||
ljlx: '',
|
||||
ip: '192.168.36.94',
|
||||
port: '554',
|
||||
userName: 'admin',
|
||||
pwd: '12345qwe',
|
||||
td1: '1',
|
||||
td2: '2',
|
||||
td3: '3',
|
||||
td4: '4',
|
||||
videoRecord1: false,
|
||||
videoRecord2: true,
|
||||
videoRecord3: false,
|
||||
videoRecord4: false,
|
||||
text1: '',
|
||||
text2: '',
|
||||
text3: '',
|
||||
dolt: '',
|
||||
fontSize: '',
|
||||
rlls: '1',
|
||||
spzd4:false,
|
||||
spzd3:false,
|
||||
spzd2:false,
|
||||
spzd1:false,
|
||||
zdyz:'5',
|
||||
}
|
||||
@State oldParam: VideoConfig = VideoConfigData
|
||||
@State param: VideoConfig = VideoConfigData
|
||||
@State openFlag: boolean = true
|
||||
@State lsArr: Array<any> = [
|
||||
{key:'第一路'},
|
||||
{key:'第二路'},
|
||||
{key:'第三路'},
|
||||
{key:'第四路'},
|
||||
{ key: '第一路' },
|
||||
{ key: '第二路' },
|
||||
{ key: '第三路' },
|
||||
{ key: '第四路' },
|
||||
]
|
||||
|
||||
private fileUtil: FileUtil
|
||||
private context = getContext(this) as common.UIAbilityContext;
|
||||
private controller1: VideoController = new VideoController()
|
||||
private controller2: VideoController = new VideoController()
|
||||
private controller3: VideoController = new VideoController()
|
||||
private controller4: VideoController = new VideoController()
|
||||
@State videoArr: Array<any> = [
|
||||
{td:'td1',controller:this.controller1,src:''},
|
||||
{td:'td2',controller:this.controller2,src:''},
|
||||
{td:'td3',controller:this.controller3,src:''},
|
||||
{td:'td4',controller:this.controller4,src:''},
|
||||
{ td: 'td1', controller: this.controller1, src: '' },
|
||||
{ td: 'td2', controller: this.controller2, src: '' },
|
||||
{ td: 'td3', controller: this.controller3, src: '' },
|
||||
{ td: 'td4', controller: this.controller4, src: '' },
|
||||
]
|
||||
private inputController: TextInputController = new TextInputController()
|
||||
|
||||
@ -114,8 +52,8 @@ struct Index {
|
||||
Column() {
|
||||
TopLogo({ outFlag: $outFlag })
|
||||
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
|
||||
Flex({wrap:FlexWrap.Wrap,direction:FlexDirection.Row}) {
|
||||
ForEach(this.videoArr,(item,index)=>{
|
||||
Flex({ wrap: FlexWrap.Wrap, direction: FlexDirection.Row }) {
|
||||
ForEach(this.videoArr, (item, index) => {
|
||||
Video({
|
||||
src: this.openFlag ? `rtsp://${this.param.userName}:${this.param.pwd}@${this.param.ip}:${this.param.port}/h264/ch${this.param[item.td]}/main/av_stream` : '',
|
||||
currentProgressRate: this.curRate,
|
||||
@ -128,7 +66,7 @@ struct Index {
|
||||
.controls(this.showControls)
|
||||
.margin(10 * this.ratio)
|
||||
})
|
||||
}.margin({ top: 37 * this.ratio, left: 30 * this.ratio }).width(600*this.ratio).height(600*this.ratio)
|
||||
}.margin({ top: 37 * this.ratio, left: 30 * this.ratio }).width(600 * this.ratio).height(600 * this.ratio)
|
||||
|
||||
Column() {
|
||||
Image($r('app.media.shezhi'))
|
||||
@ -170,7 +108,7 @@ struct Index {
|
||||
.margin({ bottom: 10 * this.ratio })
|
||||
.onClick(() => {
|
||||
for (let i = 1; i <= 4; i++) {
|
||||
console.log('rocord_handle',i,JSON.stringify(this.rocordHandleObj))
|
||||
console.log('rocord_handle', i, JSON.stringify(this.rocordHandleObj))
|
||||
if (this.rocordHandleObj['rocord_handle'+i]) {
|
||||
endRecordVideo(this.rocordHandleObj['rocord_handle'+i])
|
||||
this.rocordHandleObj['rocord_handle'+i] = 0
|
||||
@ -185,16 +123,16 @@ struct Index {
|
||||
.width(215 * this.ratio)
|
||||
.height(64 * this.ratio)
|
||||
.onClick(async () => {
|
||||
const arr=['1','2','3','4']
|
||||
if(!arr.includes(this.param.pztd)){
|
||||
const arr = ['1', '2', '3', '4']
|
||||
if (!arr.includes(this.param.pztd)) {
|
||||
promptAction.showToast({
|
||||
message: '请填写正确的拍照通道',
|
||||
duration: 3000
|
||||
})
|
||||
return
|
||||
}
|
||||
try{
|
||||
await takePhoto(this.param,this.context,'pz/')
|
||||
try {
|
||||
await takePhoto(this.param, this.context, 'pz/')
|
||||
promptAction.showToast({
|
||||
message: '抓图完成',
|
||||
duration: 3000
|
||||
@ -203,8 +141,8 @@ struct Index {
|
||||
// console.log('daihai err: ' + err)
|
||||
// })
|
||||
|
||||
}catch (error){
|
||||
console.log('daihai',error)
|
||||
} catch (error) {
|
||||
console.log('daihai', error)
|
||||
}
|
||||
|
||||
})
|
||||
@ -319,9 +257,10 @@ struct Index {
|
||||
.width(34 * this.ratio)
|
||||
.height(26 * this.ratio)
|
||||
.fontSize(this.inputFontSize * this.ratio)
|
||||
.margin({ left: 10 * this.ratio, right: 15 * this.ratio }).onChange((value: string) => {
|
||||
this.param.zdyz = value
|
||||
})
|
||||
.margin({ left: 10 * this.ratio, right: 15 * this.ratio })
|
||||
.onChange((value: string) => {
|
||||
this.param.zdyz = value
|
||||
})
|
||||
// Text('k').fontColor('#333333').fontSize(16 * this.ratio)
|
||||
// Text('链接类型').fontColor('#333333').fontSize(16 * this.ratio)
|
||||
// TextInput({ text: this.param.ljlx, controller: this.inputController })
|
||||
@ -339,6 +278,7 @@ struct Index {
|
||||
Row() {
|
||||
Row() {
|
||||
}.width(70 * this.ratio)
|
||||
|
||||
Text('IP地址')
|
||||
.width(158 * this.ratio)
|
||||
.fontSize(16 * this.ratio)
|
||||
@ -371,7 +311,7 @@ struct Index {
|
||||
.textAlign(TextAlign.Center)
|
||||
}
|
||||
|
||||
ForEach(this.lsArr,(item,index)=>{
|
||||
ForEach(this.lsArr, (item, index) => {
|
||||
Row() {
|
||||
Text(item.key)
|
||||
.width(70 * this.ratio)
|
||||
@ -389,7 +329,7 @@ struct Index {
|
||||
.onChange((value: string) => {
|
||||
this.param.ip = value
|
||||
})
|
||||
TextInput({ text: this.param['td'+(Number(index)+1)], controller: this.inputController })
|
||||
TextInput({ text: this.param['td'+(Number(index) + 1)], controller: this.inputController })
|
||||
.type(InputType.Normal)
|
||||
.borderRadius(2)
|
||||
.width(96 * this.ratio)
|
||||
@ -398,7 +338,7 @@ struct Index {
|
||||
.margin({ right: 10 * this.ratio })
|
||||
.fontSize(this.inputFontSize * this.ratio)
|
||||
.onChange((value: string) => {
|
||||
this.param['td'+(Number(index)+1)] = value
|
||||
this.param['td'+(Number(index) + 1)] = value
|
||||
})
|
||||
TextInput({ text: this.param.userName, controller: this.inputController })
|
||||
.type(InputType.Normal)
|
||||
@ -498,7 +438,7 @@ struct Index {
|
||||
.width(22 * this.ratio)
|
||||
.height(22 * this.ratio)
|
||||
.onChange((value: boolean) => {
|
||||
this.param.spzd1=value
|
||||
this.param.spzd1 = value
|
||||
})
|
||||
Text('一路').fontSize(16 * this.ratio).fontColor('#333333')
|
||||
Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
|
||||
@ -506,7 +446,7 @@ struct Index {
|
||||
.width(22 * this.ratio)
|
||||
.height(22 * this.ratio)
|
||||
.onChange((value: boolean) => {
|
||||
this.param.spzd2=value
|
||||
this.param.spzd2 = value
|
||||
})
|
||||
Text('二路').fontSize(16 * this.ratio).fontColor('#333333')
|
||||
}
|
||||
@ -517,7 +457,7 @@ struct Index {
|
||||
.width(22 * this.ratio)
|
||||
.height(22 * this.ratio)
|
||||
.onChange((value: boolean) => {
|
||||
this.param.spzd3=value
|
||||
this.param.spzd3 = value
|
||||
})
|
||||
Text('三路').fontSize(16 * this.ratio).fontColor('#333333')
|
||||
Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
|
||||
@ -525,7 +465,7 @@ struct Index {
|
||||
.width(22 * this.ratio)
|
||||
.height(22 * this.ratio)
|
||||
.onChange((value: boolean) => {
|
||||
this.param.spzd4=value
|
||||
this.param.spzd4 = value
|
||||
})
|
||||
Text('四路').fontSize(16 * this.ratio).fontColor('#333333')
|
||||
}
|
||||
@ -620,27 +560,31 @@ struct Index {
|
||||
this.fileUtil = fileUtil
|
||||
this.getVideoConfig()
|
||||
}
|
||||
async getfilehandleCode(td){
|
||||
const record_handle = await startRecordVideo(this.param,td,this.context,'lp')
|
||||
this.rocordHandleObj['rocord_handle'+td]=record_handle
|
||||
|
||||
async getfilehandleCode(td) {
|
||||
const record_handle = await startRecordVideo(this.param, td, this.context, 'lp')
|
||||
this.rocordHandleObj['rocord_handle'+td] = record_handle
|
||||
}
|
||||
|
||||
outClick() {
|
||||
this.openFlag = false
|
||||
}
|
||||
|
||||
sleep = (delay) => new Promise((resolve) => setTimeout(resolve, delay))
|
||||
|
||||
async onPageShow() {
|
||||
}
|
||||
|
||||
async getVideoConfig() {
|
||||
const data = await this.fileUtil.readFile(GlobalConfig.comoonfileWriteAddress+'/config/config3.txt');
|
||||
const data = await this.fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/config3.txt');
|
||||
this.oldParam = JSON.parse(data)
|
||||
this.param = JSON.parse(data)
|
||||
}
|
||||
|
||||
async writeConfig() {
|
||||
this.oldParam = JSON.parse(JSON.stringify(this.param))
|
||||
this.videoArr=JSON.parse(JSON.stringify(this.videoArr))
|
||||
console.log('kkkk',JSON.stringify(this.param))
|
||||
this.videoArr = JSON.parse(JSON.stringify(this.videoArr))
|
||||
console.log('kkkk', JSON.stringify(this.param))
|
||||
const folderPath = await this.fileUtil.initFolder(`/config`);
|
||||
this.fileUtil.addFile(`${folderPath}/config3.txt`, JSON.stringify(this.param), 'overWrite')
|
||||
this.showFlag = false
|
||||
|
||||
@ -7,9 +7,6 @@
|
||||
"deviceTypes": [
|
||||
"default",
|
||||
"tablet",
|
||||
"pad",
|
||||
"wearable",
|
||||
"car",
|
||||
],
|
||||
"deliveryWithInstall": true,
|
||||
"installationFree": false,
|
||||
@ -78,12 +75,12 @@
|
||||
{
|
||||
"name": "ohos.permission.MEDIA_LOCATION"
|
||||
},
|
||||
{
|
||||
"name": "ohos.permission.WRITE_MEDIA"
|
||||
},
|
||||
{
|
||||
"name": "ohos.permission.READ_MEDIA"
|
||||
},
|
||||
{
|
||||
"name": "ohos.permission.WRITE_MEDIA"
|
||||
},
|
||||
{
|
||||
"name": "ohos.permission.READ_MEDIA"
|
||||
},
|
||||
{
|
||||
"name": "ohos.permission.WRITE_IMAGEVIDEO",
|
||||
"usedScene": {
|
||||
@ -102,26 +99,26 @@
|
||||
"when": "always"
|
||||
}
|
||||
},
|
||||
// {
|
||||
// "name": "ohos.permission.READ_MEDIA",
|
||||
// "reason": "$string:module_desc",
|
||||
// "usedScene": {
|
||||
// "abilities": [
|
||||
// "MainAbility"
|
||||
// ],
|
||||
// "when": "always"
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// "name": "ohos.permission.WRITE_MEDIA",
|
||||
// "reason": "$string:module_desc",
|
||||
// "usedScene": {
|
||||
// "abilities": [
|
||||
// "MainAbility"
|
||||
// ],
|
||||
// "when": "always"
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// "name": "ohos.permission.READ_MEDIA",
|
||||
// "reason": "$string:module_desc",
|
||||
// "usedScene": {
|
||||
// "abilities": [
|
||||
// "MainAbility"
|
||||
// ],
|
||||
// "when": "always"
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// "name": "ohos.permission.WRITE_MEDIA",
|
||||
// "reason": "$string:module_desc",
|
||||
// "usedScene": {
|
||||
// "abilities": [
|
||||
// "MainAbility"
|
||||
// ],
|
||||
// "when": "always"
|
||||
// }
|
||||
// },
|
||||
{
|
||||
"name": "ohos.permission.FILE_ACCESS_MANAGER",
|
||||
"reason": "$string:module_desc",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user