Compare commits
No commits in common. "c8bfacb9aff16efa323079980d7c03b0cd28d9ef" and "1a6a87ebaed59203867cf64b65c59ddf41664108" have entirely different histories.
c8bfacb9af
...
1a6a87ebae
@ -65,10 +65,10 @@ export interface VideoConfig {
|
|||||||
dolt?: string,
|
dolt?: string,
|
||||||
fontSize?: string
|
fontSize?: string
|
||||||
rlls?: string,
|
rlls?: string,
|
||||||
spzd4?: boolean,
|
spzd4: boolean,
|
||||||
spzd3?: boolean,
|
spzd3: boolean,
|
||||||
spzd2?: boolean,
|
spzd2: boolean,
|
||||||
spzd1?: boolean,
|
spzd1: boolean,
|
||||||
zdyz?: string,
|
zdyz?: string,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,20 +1,29 @@
|
|||||||
import { takePhoto } from '../../../utils/Video';
|
import { takePhoto } from '../../../service/videoService';
|
||||||
import promptAction from '@ohos.promptAction';
|
import promptAction from '@ohos.promptAction';
|
||||||
import { judgeConfig } from './judgeConfig';
|
import { judgeConfig } from './judgeConfig';
|
||||||
import FileUtils from '../../../utils/FileUtils';
|
import FileUtils from '../../../utils/FileUtils';
|
||||||
import {VideoConfig} from '../../../model/Common'
|
|
||||||
import common from '@ohos.app.ability.common';
|
interface Params {
|
||||||
|
userName: string
|
||||||
|
pwd: string
|
||||||
|
ip: string
|
||||||
|
port: string
|
||||||
|
rlls: string
|
||||||
|
pztd: string
|
||||||
|
}
|
||||||
|
|
||||||
export default class FilePhoto {
|
export default class FilePhoto {
|
||||||
private params: VideoConfig
|
public mediaTest
|
||||||
private context:common.UIAbilityContext
|
private params: Params
|
||||||
|
private context: any
|
||||||
public getPhoto = async () => {
|
public getPhoto = async () => {
|
||||||
|
const { params } = this;
|
||||||
if (!judgeConfig.isPhotoOpen) {
|
if (!judgeConfig.isPhotoOpen) {
|
||||||
return ''
|
return ''
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
console.info('surenjun', '拍照开始')
|
console.info('surenjun', '拍照开始')
|
||||||
const res = await takePhoto(this.params, this.context, 'pz/', 2);
|
const res = await takePhoto(params, this.context, 'pz/', 2);
|
||||||
console.info('surenjun', '拍照结束' + JSON.stringify(res))
|
console.info('surenjun', '拍照结束' + JSON.stringify(res))
|
||||||
return res.base64
|
return res.base64
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -29,20 +38,21 @@ export default class FilePhoto {
|
|||||||
}
|
}
|
||||||
private fileUtil: FileUtils
|
private fileUtil: FileUtils
|
||||||
|
|
||||||
constructor(context:common.UIAbilityContext) {
|
constructor(context) {
|
||||||
(async () => {
|
(async () => {
|
||||||
//TODO 309参数 获取拍照摄像头拍照通道
|
//TODO 309参数 获取拍照摄像头拍照通道
|
||||||
const fileUtil = new FileUtils(context)
|
const fileUtil = new FileUtils(context)
|
||||||
const strConfig =
|
const strConfig =
|
||||||
await fileUtil.readFile('/mnt/hmdfs/100/account/device_view/local/files/duolun/config/config3.txt');
|
await fileUtil.readFile('/mnt/hmdfs/100/account/device_view/local/files/duolun/config/config3.txt');
|
||||||
const config: VideoConfig = JSON.parse(strConfig as string)
|
const config = JSON.parse(strConfig)
|
||||||
|
const { userName, ip, pwd, port, rlls, pztd } = config
|
||||||
this.params = {
|
this.params = {
|
||||||
userName:config.userName,
|
userName,
|
||||||
pwd:config.pwd,
|
pwd,
|
||||||
ip:config.ip,
|
ip,
|
||||||
port:config.port,
|
port,
|
||||||
rlls:config.rlls,
|
rlls,
|
||||||
pztd:config.pztd,
|
pztd
|
||||||
}
|
}
|
||||||
this.context = context
|
this.context = context
|
||||||
this.fileUtil = fileUtil
|
this.fileUtil = fileUtil
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user