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 @@
...
@@ -14,8 +14,8 @@
</view>
</view>
</view>
</view>
<l-clipper
v-if=
"showlip"
:image-url=
"
img
Uri"
:isShowPhotoBtn=
"false"
type=
"2d"
:minWidth=
"400"
:maxHeight=
"400"
<l-clipper
v-if=
"showlip"
:image-url=
"
temp
Uri"
:isShowPhotoBtn=
"false"
type=
"2d"
:minWidth=
"400"
:maxHeight=
"400"
@
success=
"
img
Uri = $event.url; showlip = false;"
@
cancel=
"showlip = false"
/>
@
success=
"
temp
Uri = $event.url; showlip = false;"
@
cancel=
"showlip = false"
/>
</view>
</view>
</
template
>
</
template
>
...
@@ -46,14 +46,16 @@
...
@@ -46,14 +46,16 @@
data
()
{
data
()
{
return
{
return
{
imgUri
:
''
,
imgUri
:
''
,
tempUri
:
''
,
userBean
:
{},
userBean
:
{},
type
:
''
,
type
:
''
,
ocrUrl
:
''
,
scantype
:
''
,
scantype
:
''
,
showlip
:
false
showlip
:
false
};
};
},
},
onLoad
(
option
)
{
onLoad
(
option
)
{
this
.
img
Uri
=
decodeURIComponent
(
option
.
uri
)
this
.
temp
Uri
=
decodeURIComponent
(
option
.
uri
)
this
.
type
=
option
.
type
this
.
type
=
option
.
type
if
(
this
.
type
==
0
)
{
if
(
this
.
type
==
0
)
{
...
@@ -79,6 +81,8 @@
...
@@ -79,6 +81,8 @@
// 图片转pdf
// 图片转pdf
this
.
scantype
=
ScanTypeBean
.
scan_pdf
this
.
scantype
=
ScanTypeBean
.
scan_pdf
}
}
},
},
onShow
()
{
onShow
()
{
this
.
post
({
this
.
post
({
...
@@ -91,7 +95,12 @@
...
@@ -91,7 +95,12 @@
}
}
});
});
},
},
methods
:
{
methods
:
{
loadData
()
{
setTimeout
(()
=>
{
this
.
compress
();
},
500
);
},
crop
()
{
crop
()
{
this
.
showlip
=
true
this
.
showlip
=
true
},
},
...
@@ -103,27 +112,25 @@
...
@@ -103,27 +112,25 @@
let
that
=
this
let
that
=
this
// #ifdef MP-TOUTIAO
// #ifdef MP-TOUTIAO
tt
.
compressImage
({
tt
.
compressImage
({
src
:
that
.
img
Uri
,
src
:
that
.
temp
Uri
,
quality
:
80
,
quality
:
80
,
success
:
res
=>
{
success
:
res
=>
{
that
.
uploadImg
(
res
.
tempFilePath
)
that
.
uploadImg
(
res
.
tempFilePath
)
},
},
fail
:
err
=>
{
fail
:
err
=>
{
that
.
uploadImg
(
that
.
img
Uri
)
that
.
uploadImg
(
that
.
temp
Uri
)
}
}
})
})
// #endif
// #endif
},
},
clickOcr
()
{
clickOcr
()
{
this
.
compress
()
if
(
this
.
userBean
.
expireTime
<=
0
)
{
// 开通VIP会员
// if (this.userBean.expireTime
<=
0
)
{
navigateTo
(
`/pagesA/vipPay/vipPay`
)
// // 开通VIP会员
}
else
{
// navigateTo(`/pagesA/vipPay/vipPay`)
this
.
ocr
(
this
.
ocrUrl
)
// } else {
}
// this.compress()
// }
},
},
ocr
(
imgUrl
)
{
ocr
(
imgUrl
)
{
if
(
this
.
scantype
==
ScanTypeBean
.
fanyi
)
{
if
(
this
.
scantype
==
ScanTypeBean
.
fanyi
)
{
...
@@ -147,16 +154,11 @@
...
@@ -147,16 +154,11 @@
success
:
({
success
:
({
data
data
})
=>
{
})
=>
{
if
(
that
.
userBean
.
expireTime
<=
0
)
{
that
.
goResult
(
data
,
imgUrl
);
// 开通VIP会员
navigateTo
(
`/pagesA/vipPay/vipPay`
)
}
else
{
that
.
goResult
(
data
,
myimgUrl
);
}
},
},
fail
:
()
=>
{
fail
:
()
=>
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
message
.
notify
(
'图片
存在风险
,请重新上传'
);
message
.
notify
(
'图片
异常
,请重新上传'
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
navigateBack
();
navigateBack
();
},
500
);
},
500
);
...
@@ -177,20 +179,15 @@
...
@@ -177,20 +179,15 @@
success
:
({
success
:
({
data
data
})
=>
{
})
=>
{
if
(
that
.
userBean
.
expireTime
<=
0
)
{
that
.
goResult
(
data
,
myimgUrl
);
// 开通VIP会员
navigateTo
(
`/pagesA/vipPay/vipPay`
)
}
else
{
that
.
goResult
(
data
,
myimgUrl
);
}
},
},
fail
:
()
=>
{
fail
:
()
=>
{
uni
.
hideLoading
()
uni
.
hideLoading
()
setTimeout
(()
=>
{
setTimeout
(()
=>
{
message
.
notify
(
'图片
存在风险,请重新上传'
);
message
.
notify
(
'图片
异常,请重新上传'
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
navigateBack
();
navigateBack
();
},
500
);
},
500
);
},
1000
);
},
1000
);
}
}
});
});
...
@@ -219,13 +216,38 @@
...
@@ -219,13 +216,38 @@
},
},
success
:
(
uploadFileRes
)
=>
{
success
:
(
uploadFileRes
)
=>
{
let
myData
=
JSON
.
parse
(
uploadFileRes
.
data
)
let
myData
=
JSON
.
parse
(
uploadFileRes
.
data
)
that
.
ocr
(
myData
.
data
.
url
)
that
.
ocrUrl
=
myData
.
data
.
url
that
.
dyLink
(
that
.
ocrUrl
)
},
},
fail
:
(
res
)
=>
{
fail
:
(
res
)
=>
{
uni
.
hideLoading
()
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
)
{
goResult
(
data
,
imgUrl
)
{
uni
.
hideLoading
()
uni
.
hideLoading
()
if
(
this
.
type
==
0
)
{
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