Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
uniapp_scan
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
android
uniapp_scan
Commits
c68b63b1
Commit
c68b63b1
authored
Jun 06, 2024
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化检测图片接口
parent
3d95ad47
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
13 deletions
+43
-13
edit.vue
scan/pagesC/edit/edit.vue
+43
-13
No files found.
scan/pagesC/edit/edit.vue
View file @
c68b63b1
...
...
@@ -23,7 +23,9 @@
import
{
pdfFn
}
from
'../../utils/pdf.js'
import
{
navigateBack
}
from
'@/utils/fun'
;
import
common
from
'@/mixins/common'
;
import
{
ScanIndexBean
,
...
...
@@ -34,6 +36,7 @@
import
{
navigateTo
,
message
,
redirectTo
}
from
'@/utils/fun'
;
...
...
@@ -113,12 +116,14 @@
},
clickOcr
()
{
if
(
this
.
userBean
.
expireTime
<=
0
)
{
// 开通VIP会员
navigateTo
(
`/pagesA/vipPay/vipPay`
)
}
else
{
this
.
compress
()
}
// if (this.userBean.expireTime
<=
0
)
{
// // 开通VIP会员
// navigateTo(`/pagesA/vipPay/vipPay`)
// } else {
// this.compress()
// }
},
ocr
(
imgUrl
)
{
if
(
this
.
scantype
==
ScanTypeBean
.
fanyi
)
{
...
...
@@ -142,7 +147,21 @@
success
:
({
data
})
=>
{
that
.
goResult
(
data
,
imgUrl
);
if
(
that
.
userBean
.
expireTime
<=
0
)
{
// 开通VIP会员
navigateTo
(
`/pagesA/vipPay/vipPay`
)
}
else
{
that
.
goResult
(
data
,
myimgUrl
);
}
},
fail
:
()
=>
{
setTimeout
(()
=>
{
message
.
notify
(
'请重新上传图片'
);
setTimeout
(()
=>
{
navigateBack
();
},
500
);
},
1000
);
uni
.
hideLoading
()
}
});
},
...
...
@@ -158,10 +177,21 @@
success
:
({
data
})
=>
{
if
(
that
.
userBean
.
expireTime
<=
0
)
{
// 开通VIP会员
navigateTo
(
`/pagesA/vipPay/vipPay`
)
}
else
{
that
.
goResult
(
data
,
myimgUrl
);
}
},
fail
:
()
=>
{
uni
.
hideLoading
()
setTimeout
(()
=>
{
message
.
notify
(
'请重新上传图片'
);
setTimeout
(()
=>
{
navigateBack
();
},
500
);
},
1000
);
}
});
},
...
...
@@ -242,14 +272,14 @@
let
that
=
this
pdfFn
(
imageUrls
,
2
).
then
((
resl
)
=>
{
var
fs
=
tt
.
getFileSystemManager
();
console
.
log
(
"123=="
,
imageUrls
)
console
.
log
(
"123=="
,
imageUrls
)
fs
.
writeFile
({
filePath
:
tt
.
env
.
USER_DATA_PATH
+
'/'
+
that
.
getCurrentTime
()
+
'.pdf'
,
filePath
:
tt
.
env
.
USER_DATA_PATH
+
'/'
+
that
.
getCurrentTime
()
+
'.pdf'
,
data
:
resl
.
docBase64
,
encoding
:
"base64"
,
success
:
resx
=>
{
tt
.
openDocument
({
filePath
:
tt
.
env
.
USER_DATA_PATH
+
'/'
+
that
.
getCurrentTime
()
+
filePath
:
tt
.
env
.
USER_DATA_PATH
+
'/'
+
that
.
getCurrentTime
()
+
'.pdf'
,
showMenu
:
true
,
success
:
function
(
resxl
)
{
...
...
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