Commit ea96d2ee authored by 高宇's avatar 高宇

拍照 和扫码

parent 9554d707
......@@ -14,6 +14,7 @@
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml"
},
"dependencies": {
"dsbridge": "^3.1.4",
"@riophae/vue-treeselect": "^0.4.0",
"axios": "0.18.1",
"bpmn-js": "^6.1.1",
......
......@@ -36,6 +36,8 @@ import Pagination from '@/components/Pagination'
import { uploadPublic } from '@/api/fileUploadPublic'
import Viewer from 'v-viewer'
import 'viewerjs/dist/viewer.css'
// 安卓h5交互
import { WebView } from '@/utils/WebViewContact'
Vue.use(Viewer)
Viewer.setDefaults({
Options: {
......@@ -47,6 +49,7 @@ Viewer.setDefaults({
})
// 全局方法挂载
Vue.prototype.$WebView = WebView
Vue.prototype.getDicts = getDicts
Vue.prototype.getConfigKey = getConfigKey
Vue.prototype.parseTime = parseTime
......
const DS_BRIDGE = require('dsbridge')
// 拍照
export const openCamera = (params) => {
return new Promise(resolve => {
DS_BRIDGE.call('openCamera', params, res => {
resolve(res)
})
})
}
// 扫码
export const openScan = (params) => {
return new Promise(resolve => {
DS_BRIDGE.call('openScan', params, res => {
resolve(res)
})
})
}
export const WebView = {
openCamera,
openScan
}
This diff is collapsed.
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