Commit 6e2cbb26 authored by 张伯涛's avatar 张伯涛

拍照函数调用

parent c7f46af8
......@@ -8,7 +8,7 @@ export const openCamera = (params) => {
})
})
}
// 拍照取相册
// 拍照取相册 实现调用存储功能(带相册,文件资源功能)
export const openCameraStorage = (params) => {
return new Promise(resolve => {
DS_BRIDGE.call('openCameraStorage', params, res => {
......@@ -16,6 +16,14 @@ export const openCameraStorage = (params) => {
})
})
}
// 全部实现功能(带相机,相册,文件资源功能)
export const openCameraAll = (params) => {
return new Promise(resolve => {
DS_BRIDGE.call('openCameraAll', params, res => {
resolve(res)
})
})
}
// 扫码
export const openScan = (params) => {
return new Promise(resolve => {
......@@ -28,5 +36,6 @@ export const openScan = (params) => {
export const WebView = {
openCamera,
openCameraStorage,
openCameraAll,
openScan
}
......@@ -5,10 +5,16 @@
<el-button type="primary" @click="handleOpenScan">扫码</el-button>
</div>
<div class="button_row">
<el-button type="primary" @click="handleTakePhotos">拍照</el-button>
<el-button type="primary" @click="handleTakePhotos">拍照1</el-button>
<span>实现拍照功能(直接调照相机)</span>
</div>
<div class="button_row">
<el-button type="primary" @click="handleTakePhotosAlbum">拍照取相册</el-button>
<el-button type="primary" @click="handleTakePhotosAlbum">拍照2</el-button>
<span>实现调用存储功能(带相册,文件资源功能)</span>
</div>
<div class="button_row">
<el-button type="primary" @click="handlePpenCameraAll">拍照3</el-button>
<span>全部实现功能(带相机,相册,文件资源功能)</span>
</div>
<!-- </div>-->
<!-- <div class="button_row">-->
......@@ -24,7 +30,7 @@
<script>
import { getToken } from '@/utils/auth'
import { openCameraStorage } from '@/utils/WebViewContact'
import {openCameraAll, openCameraStorage} from '@/utils/WebViewContact'
export default {
name: 'Index',
data() {
......@@ -69,6 +75,15 @@ export default {
this.imgUrlForm = JSON.parse(res)
})
},
/** 全部实现功能(带相机,相册,文件资源功能)*/
handlePpenCameraAll() {
const params = {
tokenMsg: getToken()
}
this.$WebView.openCameraAll(params).then(res => {
this.imgUrlForm = JSON.parse(res)
})
},
handleOutbound() {
this.$router.push({
path: '/setup/outbound'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment