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
dc424f15
Commit
dc424f15
authored
Dec 20, 2023
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口调试
parent
fb3ed1d6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
107 additions
and
73 deletions
+107
-73
doc.vue
scan/pages/doc/doc.vue
+71
-56
edit.vue
scan/pagesC/edit/edit.vue
+28
-11
result.vue
scan/pagesC/result/result.vue
+6
-4
scan.vue
scan/pagesC/scan/scan.vue
+2
-2
No files found.
scan/pages/doc/doc.vue
View file @
dc424f15
<
template
>
<view
class=
"body"
>
<tabs-center
class=
"center"
:tabs=
"tabs"
v-model=
"tabIndex"
@
change=
"handleChange"
/>
<view
class=
"content"
>
<!--
<z-paging
class=
"flex-1"
ref=
"paging"
v-model=
"dataList"
@
query=
"queryList"
>
<view
style=
"width: 100%;height: 150rpx;border-radius:10rpx;"
v-for=
"(item, i) in dataList"
:key=
"i"
@
click=
"handleInfo(item)"
>
-->
<view
style=
"display: flex;margin-left: 10rpx;margin-bottom: 10rpx;"
>
<view
style=
"flex-grow: 2;display: flex;align-items: center;"
>
<image
style=
"border-radius:10rpx; width: 120rpx;height: 150rpx;margin-top: 10rpx;"
src=
"https://content.volccdn.com/obj/feedcoop/skit/0641.jpg"
mode=
"aspectFill"
></image>
<view
style=
"margin: 20rpx;"
>
<view
style=
"font-size: 30rpx; color: black;"
>
123
</view>
<view
style=
"font-size: 24rpx;margin-top: 10rpx;color: gray;"
>
12344
</view>
<z-paging
class=
"flex-1"
ref=
"paging"
v-model=
"dataList"
@
query=
"queryList"
>
<view
style=
"width: 100%;height: 150rpx;border-radius:10rpx;"
v-for=
"(item, i) in dataList"
:key=
"i"
@
click=
"handleInfo(item)"
>
<view
style=
"display: flex;margin: 10rpx;"
>
<view
style=
"flex-grow: 2;display: flex;align-items: center;"
>
<image
style=
"border-radius:10rpx; width: 120rpx;height: 150rpx;margin-top: 10rpx;"
:src=
"item.imgUrl"
mode=
"aspectFill"
></image>
<view
style=
"margin: 20rpx;"
>
<!--
<view
style=
"font-size: 30rpx; color: black;"
>
123
</view>
-->
<view
style=
"font-size: 24rpx;margin-top: 10rpx;color: gray;"
>
{{
item
.
time
*
1000
|
formatDate
(
'yyyy-MM-dd'
)
}}
</view>
</view>
</view>
</view>
<view
style=
"display: flex;flex-direction: column;justify-content: center;"
>
<image
@
click=
"handleDel()"
style=
"width: 30rpx;height: 30rpx;margin: 10rpx;"
src=
"../../static/index/ic_quit_white.png"
mode=
"aspectFill"
></image>
<view
style=
"display: flex;flex-direction: column;justify-content: center;"
>
<image
@
click=
"handleDel()"
style=
"width: 30rpx;height: 30rpx;margin: 10rpx;"
src=
"../../static/index/ic_quit_white.png"
mode=
"aspectFill"
></image>
</view>
</view>
</view>
<view
style=
"display: flex;margin-left: 10rpx;"
>
<view
style=
"flex-grow: 2;display: flex;align-items: center;"
>
<image
style=
"border-radius:10rpx; width: 120rpx;height: 150rpx;margin-top: 10rpx;"
src=
"https://content.volccdn.com/obj/feedcoop/skit/0641.jpg"
mode=
"aspectFill"
></image>
<view
style=
"margin: 20rpx;"
>
<view
style=
"font-size: 30rpx; color: black;"
>
123
</view>
<view
style=
"font-size: 24rpx;margin-top: 10rpx;color: gray;"
>
12344
</view>
</view>
</view>
<view
style=
"display: flex;flex-direction: column;justify-content: center;"
>
<image
@
click=
"handleDel()"
style=
"width: 30rpx;height: 30rpx;margin: 10rpx;"
src=
"../../static/index/ic_quit_white.png"
mode=
"aspectFill"
></image>
</view>
</view>
<!--
</view>
</z-paging>
-->
</view>
</z-paging>
<view
>
<view>
<uni-popup
ref=
"alertDialog"
type=
"center"
>
<uni-popup-dialog
cancelText=
"取消"
confirmText=
"删除"
title=
"提示"
content=
"是否要删除当前记录?"
@
confirm=
"dialogToggle"
@
close=
"dialogClose"
>
...
...
@@ -55,7 +39,8 @@
import
{
navigateTo
,
navigateTo
,
message
}
from
'@/utils/fun.js'
;
const
app
=
getApp
();
...
...
@@ -66,6 +51,7 @@
data
()
{
return
{
tabIndex
:
0
,
type
:
'all'
,
dataList
:
[],
tabs
:
[{
title
:
'全部'
,
...
...
@@ -77,53 +63,82 @@
title
:
'表格'
,
value
:
2
},
{
title
:
'
中文
'
,
title
:
'
翻译
'
,
value
:
3
},
{
title
:
'英文'
,
value
:
4
},
{
title
:
'测试'
,
value
:
5
},
{
title
:
'test'
,
value
:
6
}]
}
},
onLoad
(
e
)
{},
onLoad
()
{
},
methods
:
{
onShow
()
{
if
(
this
.
$refs
.
paging
!=
null
)
{
this
.
$refs
.
paging
.
reload
();
}
},
queryList
(
page
,
size
)
{
if
(
this
.
tabIndex
==
0
)
{
this
.
type
=
'all'
}
else
if
(
this
.
tabIndex
==
1
)
{
this
.
type
=
'accurate_basic'
}
else
if
(
this
.
tabIndex
==
2
)
{
this
.
type
=
'img_to_excel'
}
else
if
(
this
.
tabIndex
==
3
)
{
this
.
type
=
'fanyi'
}
this
.
post
({
url
:
'/
vedio/list
'
,
url
:
'/
ai/image/history
'
,
data
:
{
page
,
size
,
t
abIndex
size
,
t
ype
:
this
.
type
},
showLoading
:
false
,
success
:
({
data
})
=>
{
this
.
dataList
=
data
.
list
;
this
.
$refs
.
paging
.
complete
(
data
.
list
);
}
});
},
handleChange
(
e
)
{
this
.
tabIndex
=
e
.
value
;
// this.$refs.paging.clear();
// this.$refs.paging.reload();
this
.
$refs
.
paging
.
reload
();
},
handleDel
()
{
this
.
$refs
.
alertDialog
.
open
();
},
dialogToggle
()
{
this
.
$refs
.
alertDialog
.
close
();
// this.$refs.paging.clear();
// this.$refs.paging.reload();
let
that
=
this
;
if
(
this
.
tabIndex
==
0
)
{
this
.
type
=
'all'
}
else
if
(
this
.
tabIndex
==
1
)
{
this
.
type
=
'accurate_basic'
}
else
if
(
this
.
tabIndex
==
2
)
{
this
.
type
=
'img_to_excel'
}
else
if
(
this
.
tabIndex
==
3
)
{
this
.
type
=
'fanyi'
}
var
tempHid
=
this
.
dataList
[
this
.
tabIndex
].
historyId
;
this
.
post
({
url
:
'/ai/image/removeHistory'
,
data
:
{
type
:
this
.
type
,
historyId
:
tempHid
},
showLoading
:
false
,
success
:
({
data
})
=>
{
message
.
notify
(
'删除成功'
);
setTimeout
(()
=>
{
that
.
$refs
.
paging
.
reload
();
},
500
);
}
});
},
dialogClose
()
{
this
.
$refs
.
alertDialog
.
close
();
...
...
scan/pagesC/edit/edit.vue
View file @
dc424f15
<
template
>
<view
class=
"wrapper"
>
<view
class=
"show-img"
>
<image
:src=
"imgUri"
mode=
"aspectFit
"
></image>
<image
style=
"width: 80%;height: 90%;"
:src=
"imgUri"
mode=
"widthFix
"
></image>
</view>
<view
class=
"item-bottom"
>
<view
class=
"item-bottom-content"
@
click=
"crop"
>
<view
v-if=
"false"
class=
"item-bottom-content"
@
click=
"crop"
>
<image
class=
"img"
src=
"../../static/ic_copy.png"
></image>
<text
class=
"text1"
>
裁剪
</text>
</view>
...
...
@@ -49,7 +49,16 @@
this
.
windowHeight
=
windowHeight
this
.
imgUri
=
option
.
uri
this
.
type
=
option
.
type
if
(
option
.
type
==
0
)
{
this
.
type
=
'accurate_basic'
}
else
if
(
option
.
type
==
1
)
{
this
.
type
=
'img_to_excel'
}
else
if
(
option
.
type
==
2
)
{
this
.
type
=
'fanyi'
}
else
if
(
option
.
type
==
3
)
{
this
.
type
=
'fanyi'
}
},
methods
:
{
compress
()
{
...
...
@@ -75,7 +84,8 @@
this
.
dealImage
(
this
.
type
,
imgUrl
)
}
},
fanyi
(
from
,
to
,
imgUrl
)
{
fanyi
(
from
,
to
,
imgUrl
)
{
let
that
=
this
;
this
.
post
({
url
:
'/ai/fanyi'
,
data
:
{
...
...
@@ -87,11 +97,17 @@
success
:
({
data
})
=>
{
console
.
log
(
data
)
let
newData
=
JSON
.
parse
(
data
);
let
newResult
=
''
;
for
(
var
i
in
newData
.
all
)
{
newResult
=
newResult
+
newData
.
all
[
i
].
src
+
'
\
n'
;
}
that
.
goResult
(
newResult
,
imgUrl
);
}
});
},
dealImage
(
type
,
imgUrl
)
{
let
that
=
this
;
this
.
post
({
url
:
'/ai/dealImage'
,
data
:
{
...
...
@@ -102,20 +118,21 @@
success
:
({
data
})
=>
{
console
.
log
(
data
)
that
.
goResult
(
data
.
fontText
,
imgUrl
);
}
});
},
crop
()
{},
uploadImg
(
tempFilePath
)
{
let
that
=
this
let
that
=
this
;
let
tempUrl
=
'/ai/image/upload'
;
uni
.
uploadFile
({
url
:
'https://api.mints-tech.cn/camera-api/api/ai/image/upload'
,
url
:
`
${
app
.
globalData
.
baseUrl
}${
tempUrl
}
`
,
filePath
:
tempFilePath
,
header
:
{
pkgname
:
'com.mints.helivideo'
,
token
:
app
.
globalData
.
token
pkgname
:
app
.
globalData
.
pkgName
,
// token: app.globalData.token
token
:
'393068DF9283B935CC4C37D9ABEF88F39D63941D16243ACA30B04FE7A3F7F2EB5F433703067DF5142735505C42F58997'
},
name
:
'file'
,
formData
:
{
...
...
scan/pagesC/result/result.vue
View file @
dc424f15
...
...
@@ -2,8 +2,8 @@
<view
class=
"body"
:style=
'
{width:windowWidth+"px",height:windowHeight+"px"}'>
<!--
<status-title
:showBack=
"true"
iconColor=
"black"
>
识别结果
</status-title>
-->
<view
style=
"display: flex;flex-direction: column;height: 100%;"
>
<view
style=
"height: 40%;"
>
<image
mode=
"
heightFix"
style=
"height: 100%;"
src=
"../../static/bg_vip_0.png
"
/>
<view
style=
"height: 40%;
display: flex;flex-direction: row;align-items: center;
"
>
<image
mode=
"
widthFix"
style=
"width: 100%;"
:src=
"imgUrl
"
/>
</view>
<view
style=
"background: white;height: 50%;display: flex;flex-direction: column;padding-top: 30rpx;"
>
...
...
@@ -49,7 +49,8 @@
return
{
windowWidth
:
''
,
windowHeight
:
''
,
result
:
''
,
result
:
''
,
imgUrl
:
''
,
dataList
:
[
"AAAAAAAA"
,
"AAAAAAAA"
,
...
...
@@ -74,7 +75,8 @@
this
.
windowWidth
=
windowWidth
this
.
windowHeight
=
windowHeight
this
.
result
=
option
.
result
this
.
result
=
option
.
result
this
.
imgUrl
=
option
.
imgUrl
this
.
dataList
=
this
.
result
.
split
(
'
\
n'
)
},
onShareAppMessage
()
{
...
...
scan/pagesC/scan/scan.vue
View file @
dc424f15
...
...
@@ -7,10 +7,10 @@
<view
:style=
"'display: flex;height:'+Number(windowHeight*0.1)+'px;'"
>
<block
v-for=
"(item, index) in tabs"
:key=
"index"
>
<view
class=
"flex"
style=
"margin:0 20rpx
;"
@
click=
"clickItem(index)"
>
<view
style=
"margin:0 20rpx;display: flex;flex-direction: column;justify-content: center
;"
@
click=
"clickItem(index)"
>
<view
class=
"font"
>
{{
item
.
name
}}
</view>
<view
v-if=
"current==index"
style=
"width: 1
0rpx;height: 10
rpx;background: red;border-radius: 10rpx;margin: 0 auto;"
>
style=
"width: 1
5rpx;height: 15
rpx;background: red;border-radius: 10rpx;margin: 0 auto;"
>
</view>
</view>
</block>
...
...
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