Compare commits
No commits in common. "c8bfacb9aff16efa323079980d7c03b0cd28d9ef" and "1a6a87ebaed59203867cf64b65c59ddf41664108" have entirely different histories.
c8bfacb9af
...
1a6a87ebae
@ -65,10 +65,10 @@ export interface VideoConfig {
|
||||
dolt?: string,
|
||||
fontSize?: string
|
||||
rlls?: string,
|
||||
spzd4?: boolean,
|
||||
spzd3?: boolean,
|
||||
spzd2?: boolean,
|
||||
spzd1?: boolean,
|
||||
spzd4: boolean,
|
||||
spzd3: boolean,
|
||||
spzd2: boolean,
|
||||
spzd1: boolean,
|
||||
zdyz?: string,
|
||||
}
|
||||
|
||||
|
||||
@ -1,20 +1,29 @@
|
||||
import { takePhoto } from '../../../utils/Video';
|
||||
import { takePhoto } from '../../../service/videoService';
|
||||
import promptAction from '@ohos.promptAction';
|
||||
import { judgeConfig } from './judgeConfig';
|
||||
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 {
|
||||
private params: VideoConfig
|
||||
private context:common.UIAbilityContext
|
||||
public mediaTest
|
||||
private params: Params
|
||||
private context: any
|
||||
public getPhoto = async () => {
|
||||
const { params } = this;
|
||||
if (!judgeConfig.isPhotoOpen) {
|
||||
return ''
|
||||
} else {
|
||||
try {
|
||||
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))
|
||||
return res.base64
|
||||
} catch (e) {
|
||||
@ -29,20 +38,21 @@ export default class FilePhoto {
|
||||
}
|
||||
private fileUtil: FileUtils
|
||||
|
||||
constructor(context:common.UIAbilityContext) {
|
||||
constructor(context) {
|
||||
(async () => {
|
||||
//TODO 309参数 获取拍照摄像头拍照通道
|
||||
const fileUtil = new FileUtils(context)
|
||||
const strConfig =
|
||||
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 = {
|
||||
userName:config.userName,
|
||||
pwd:config.pwd,
|
||||
ip:config.ip,
|
||||
port:config.port,
|
||||
rlls:config.rlls,
|
||||
pztd:config.pztd,
|
||||
userName,
|
||||
pwd,
|
||||
ip,
|
||||
port,
|
||||
rlls,
|
||||
pztd
|
||||
}
|
||||
this.context = context
|
||||
this.fileUtil = fileUtil
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user