Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
9
91isoft_web_vue
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张伯涛
91isoft_web_vue
Commits
6e2cbb26
Commit
6e2cbb26
authored
Mar 05, 2024
by
张伯涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
拍照函数调用
parent
c7f46af8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
4 deletions
+28
-4
WebViewContact.js
src/utils/WebViewContact.js
+10
-1
index.vue
src/views/setup/index.vue
+18
-3
No files found.
src/utils/WebViewContact.js
View file @
6e2cbb26
...
...
@@ -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
}
src/views/setup/index.vue
View file @
6e2cbb26
...
...
@@ -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'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment