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
35777462
Commit
35777462
authored
Jun 07, 2024
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化抖音图片检测
parent
02ae65c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
33 deletions
+55
-33
edit.vue
scan/pagesC/edit/edit.vue
+55
-33
No files found.
scan/pagesC/edit/edit.vue
View file @
35777462
...
...
@@ -14,8 +14,8 @@
</view>
</view>
<l-clipper
v-if=
"showlip"
:image-url=
"
img
Uri"
:isShowPhotoBtn=
"false"
type=
"2d"
:minWidth=
"400"
:maxHeight=
"400"
@
success=
"
img
Uri = $event.url; showlip = false;"
@
cancel=
"showlip = false"
/>
<l-clipper
v-if=
"showlip"
:image-url=
"
temp
Uri"
:isShowPhotoBtn=
"false"
type=
"2d"
:minWidth=
"400"
:maxHeight=
"400"
@
success=
"
temp
Uri = $event.url; showlip = false;"
@
cancel=
"showlip = false"
/>
</view>
</
template
>
...
...
@@ -46,14 +46,16 @@
data
()
{
return
{
imgUri
:
''
,
tempUri
:
''
,
userBean
:
{},
type
:
''
,
ocrUrl
:
''
,
scantype
:
''
,
showlip
:
false
};
},
onLoad
(
option
)
{
this
.
img
Uri
=
decodeURIComponent
(
option
.
uri
)
this
.
temp
Uri
=
decodeURIComponent
(
option
.
uri
)
this
.
type
=
option
.
type
if
(
this
.
type
==
0
)
{
...
...
@@ -79,6 +81,8 @@
// 图片转pdf
this
.
scantype
=
ScanTypeBean
.
scan_pdf
}
},
onShow
()
{
this
.
post
({
...
...
@@ -91,7 +95,12 @@
}
});
},
methods
:
{
methods
:
{
loadData
()
{
setTimeout
(()
=>
{
this
.
compress
();
},
500
);
},
crop
()
{
this
.
showlip
=
true
},
...
...
@@ -103,27 +112,25 @@
let
that
=
this
// #ifdef MP-TOUTIAO
tt
.
compressImage
({
src
:
that
.
img
Uri
,
src
:
that
.
temp
Uri
,
quality
:
80
,
success
:
res
=>
{
that
.
uploadImg
(
res
.
tempFilePath
)
},
fail
:
err
=>
{
that
.
uploadImg
(
that
.
img
Uri
)
that
.
uploadImg
(
that
.
temp
Uri
)
}
})
// #endif
},
clickOcr
()
{
this
.
compress
()
// 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
.
ocr
(
this
.
ocrUrl
)
}
},
ocr
(
imgUrl
)
{
if
(
this
.
scantype
==
ScanTypeBean
.
fanyi
)
{
...
...
@@ -147,16 +154,11 @@
success
:
({
data
})
=>
{
if
(
that
.
userBean
.
expireTime
<=
0
)
{
// 开通VIP会员
navigateTo
(
`/pagesA/vipPay/vipPay`
)
}
else
{
that
.
goResult
(
data
,
myimgUrl
);
}
that
.
goResult
(
data
,
imgUrl
);
},
fail
:
()
=>
{
setTimeout
(()
=>
{
message
.
notify
(
'图片
存在风险
,请重新上传'
);
message
.
notify
(
'图片
异常
,请重新上传'
);
setTimeout
(()
=>
{
navigateBack
();
},
500
);
...
...
@@ -177,20 +179,15 @@
success
:
({
data
})
=>
{
if
(
that
.
userBean
.
expireTime
<=
0
)
{
// 开通VIP会员
navigateTo
(
`/pagesA/vipPay/vipPay`
)
}
else
{
that
.
goResult
(
data
,
myimgUrl
);
}
that
.
goResult
(
data
,
myimgUrl
);
},
fail
:
()
=>
{
uni
.
hideLoading
()
setTimeout
(()
=>
{
message
.
notify
(
'图片
存在风险,请重新上传'
);
setTimeout
(()
=>
{
navigateBack
();
},
500
);
setTimeout
(()
=>
{
message
.
notify
(
'图片
异常,请重新上传'
);
setTimeout
(()
=>
{
navigateBack
();
},
500
);
},
1000
);
}
});
...
...
@@ -219,13 +216,38 @@
},
success
:
(
uploadFileRes
)
=>
{
let
myData
=
JSON
.
parse
(
uploadFileRes
.
data
)
that
.
ocr
(
myData
.
data
.
url
)
that
.
ocrUrl
=
myData
.
data
.
url
that
.
dyLink
(
that
.
ocrUrl
)
},
fail
:
(
res
)
=>
{
uni
.
hideLoading
()
}
});
},
dyLink
(
url
)
{
let
that
=
this
;
this
.
post
({
url
:
'/ai/image/dyLink'
,
data
:
{
imgUrl
:
url
},
showLoading
:
true
,
success
:
({
data
})
=>
{
that
.
imgUri
=
that
.
tempUri
},
fail
:
()
=>
{
uni
.
hideLoading
()
setTimeout
(()
=>
{
message
.
notify
(
'图片存在风险,请重新上传'
);
setTimeout
(()
=>
{
navigateBack
();
},
500
);
},
1000
);
}
});
},
goResult
(
data
,
imgUrl
)
{
uni
.
hideLoading
()
if
(
this
.
type
==
0
)
{
...
...
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