Merge pull request 'fix:提交视频文件mock数据' (#14) from wangzhongjie into main

Reviewed-on: #14
This commit is contained in:
wangzhongjie 2024-06-04 15:01:04 +08:00
commit cce66ee074
7 changed files with 128 additions and 144 deletions

View File

@ -4,13 +4,13 @@
{ {
"name": "default", "name": "default",
"material": { "material": {
"certpath": "/Users/surenjun/.ohos/config/openharmony/auto_ohos_default_subject-two_com.oh.dts.cer", "certpath": "/Users/wangzhongjie/.ohos/config/openharmony/auto_ohos_default_subject-two_com.oh.dts.cer",
"storePassword": "0000001B0C5B52D8C8C6F415D4216EAD2848AA4A376B36FD72006E4072C15BA3D11E6E65C0D1FFA92A6D86", "storePassword": "0000001BC865153A35BD7DDD2950D70622A2081C58D17D2F5BBE67AE83F469B41A05EED0BB09AA66043089",
"keyAlias": "debugKey", "keyAlias": "debugKey",
"keyPassword": "0000001B8DCA3C8913C86858A0CDEAEB6BEE0DC29FCE9932930CA1FFE68FFF84341736AADF81F056CDD683", "keyPassword": "0000001BB839AC92D8CB8AF4765ADD271E687C74C82EC1D0ED2072093ADB1E831C3E99148406836748BCD7",
"profile": "/Users/surenjun/.ohos/config/openharmony/auto_ohos_default_subject-two_com.oh.dts.p7b", "profile": "/Users/wangzhongjie/.ohos/config/openharmony/auto_ohos_default_subject-two_com.oh.dts.p7b",
"signAlg": "SHA256withECDSA", "signAlg": "SHA256withECDSA",
"storeFile": "/Users/surenjun/.ohos/config/openharmony/auto_ohos_default_subject-two_com.oh.dts.p12" "storeFile": "/Users/wangzhongjie/.ohos/config/openharmony/auto_ohos_default_subject-two_com.oh.dts.p12"
} }
} }
], ],

View File

@ -1,4 +1,5 @@
import {User} from "../pages/interfaces" import {User} from "../pages/interfaces"
// 候选人数据
export const CandidateData: Array<User> = [ export const CandidateData: Array<User> = [
{ {
sfzmhm: '342323199501470011', sfzmhm: '342323199501470011',

View 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',
}

View File

@ -0,0 +1,3 @@
export * from "./CandidateData"
export * from "./VideoData"

View File

@ -13,7 +13,7 @@ import common from '@ohos.app.ability.common';
import { User, VideoConfig } from './interfaces'; import { User, VideoConfig } from './interfaces';
import WebRTCVoice from './webRTC/'; import WebRTCVoice from './webRTC/';
import promptAction from '@ohos.promptAction'; import promptAction from '@ohos.promptAction';
import { CandidateData, EmptyCandidateObject } from '../mock/CandidateData'; import { CandidateData, EmptyCandidateObject } from '../mock';
import { getSyncData } from '../common/service/initable'; import { getSyncData } from '../common/service/initable';
@Entry @Entry

View File

@ -1,10 +1,12 @@
import TopLogo from './compontents/topLogo' import TopLogo from './compontents/topLogo';
import FileUtil from '../common/utils/File' import FileUtil from '../common/utils/File';
import { VideoConfig } from './interfaces' import { VideoConfig } from './interfaces';
import common from '@ohos.app.ability.common'; import common from '@ohos.app.ability.common';
import promptAction from '@ohos.promptAction' import promptAction from '@ohos.promptAction';
import { startRecordVideo, endRecordVideo,takePhoto } from '../common/service/videoService' import { endRecordVideo, startRecordVideo, takePhoto } from '../common/service/videoService';
import { GlobalConfig } from '../config/index' import { GlobalConfig } from '../config/index';
import { VideoConfigData } from '../mock';
@Entry @Entry
@Component @Component
struct Index { struct Index {
@ -21,74 +23,10 @@ struct Index {
} }
@State isAutoPlay: boolean = true @State isAutoPlay: boolean = true
@State showFlag: boolean = false @State showFlag: boolean = false
private vocObj = null;
@State showControls: boolean = false @State showControls: boolean = false
private fileUtil: FileUtil
@State @Watch('outClick') outFlag: boolean = false; @State @Watch('outClick') outFlag: boolean = false;
@State oldParam: VideoConfig = { @State oldParam: VideoConfig = VideoConfigData
videoNum:'1', @State param: VideoConfig = VideoConfigData
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 openFlag: boolean = true @State openFlag: boolean = true
@State lsArr: Array<any> = [ @State lsArr: Array<any> = [
{ key: '第一路' }, { key: '第一路' },
@ -96,7 +34,8 @@ struct Index {
{ key: '第三路' }, { key: '第三路' },
{ key: '第四路' }, { key: '第四路' },
] ]
private vocObj = null;
private fileUtil: FileUtil
private context = getContext(this) as common.UIAbilityContext; private context = getContext(this) as common.UIAbilityContext;
private controller1: VideoController = new VideoController() private controller1: VideoController = new VideoController()
private controller2: VideoController = new VideoController() private controller2: VideoController = new VideoController()
@ -319,7 +258,8 @@ struct Index {
.width(34 * this.ratio) .width(34 * this.ratio)
.height(26 * this.ratio) .height(26 * this.ratio)
.fontSize(this.inputFontSize * this.ratio) .fontSize(this.inputFontSize * this.ratio)
.margin({ left: 10 * this.ratio, right: 15 * this.ratio }).onChange((value: string) => { .margin({ left: 10 * this.ratio, right: 15 * this.ratio })
.onChange((value: string) => {
this.param.zdyz = value this.param.zdyz = value
}) })
// Text('k').fontColor('#333333').fontSize(16 * this.ratio) // Text('k').fontColor('#333333').fontSize(16 * this.ratio)
@ -339,6 +279,7 @@ struct Index {
Row() { Row() {
Row() { Row() {
}.width(70 * this.ratio) }.width(70 * this.ratio)
Text('IP地址') Text('IP地址')
.width(158 * this.ratio) .width(158 * this.ratio)
.fontSize(16 * this.ratio) .fontSize(16 * this.ratio)
@ -620,14 +561,18 @@ struct Index {
this.fileUtil = fileUtil this.fileUtil = fileUtil
this.getVideoConfig() this.getVideoConfig()
} }
async getfilehandleCode(td) { async getfilehandleCode(td) {
const record_handle = await startRecordVideo(this.param, td, this.context, 'lp') const record_handle = await startRecordVideo(this.param, td, this.context, 'lp')
this.rocordHandleObj['rocord_handle'+td] = record_handle this.rocordHandleObj['rocord_handle'+td] = record_handle
} }
outClick() { outClick() {
this.openFlag = false this.openFlag = false
} }
sleep = (delay) => new Promise((resolve) => setTimeout(resolve, delay)) sleep = (delay) => new Promise((resolve) => setTimeout(resolve, delay))
async onPageShow() { async onPageShow() {
} }