Merge branch 'api10' of http://88.22.24.105:3000/harmony_car/subject-two into api10
This commit is contained in:
commit
5910f134a2
@ -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,29 +1,20 @@
|
|||||||
import { takePhoto } from '../../../service/videoService';
|
import { takePhoto } from '../../../utils/Video';
|
||||||
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'
|
||||||
interface Params {
|
import common from '@ohos.app.ability.common';
|
||||||
userName: string
|
|
||||||
pwd: string
|
|
||||||
ip: string
|
|
||||||
port: string
|
|
||||||
rlls: string
|
|
||||||
pztd: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export default class FilePhoto {
|
export default class FilePhoto {
|
||||||
public mediaTest
|
private params: VideoConfig
|
||||||
private params: Params
|
private context:common.UIAbilityContext
|
||||||
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(params, this.context, 'pz/', 2);
|
const res = await takePhoto(this.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) {
|
||||||
@ -38,21 +29,20 @@ export default class FilePhoto {
|
|||||||
}
|
}
|
||||||
private fileUtil: FileUtils
|
private fileUtil: FileUtils
|
||||||
|
|
||||||
constructor(context) {
|
constructor(context:common.UIAbilityContext) {
|
||||||
(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 = JSON.parse(strConfig)
|
const config: VideoConfig = JSON.parse(strConfig as string)
|
||||||
const { userName, ip, pwd, port, rlls, pztd } = config
|
|
||||||
this.params = {
|
this.params = {
|
||||||
userName,
|
userName:config.userName,
|
||||||
pwd,
|
pwd:config.pwd,
|
||||||
ip,
|
ip:config.ip,
|
||||||
port,
|
port:config.port,
|
||||||
rlls,
|
rlls:config.rlls,
|
||||||
pztd
|
pztd:config.pztd,
|
||||||
}
|
}
|
||||||
this.context = context
|
this.context = context
|
||||||
this.fileUtil = fileUtil
|
this.fileUtil = fileUtil
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user