Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
take_order
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
和慭琛
take_order
Commits
eec44dbe
Commit
eec44dbe
authored
Mar 19, 2021
by
李俊赕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edit-take-photo
parent
1092ea9e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
148 additions
and
88 deletions
+148
-88
pages.json
take-order/pages.json
+1
-0
take.vue
take-order/pages/photo/take.vue
+147
-88
icon-light.png
take-order/static/photo/icon-light.png
+0
-0
icon-setting.png
take-order/static/photo/icon-setting.png
+0
-0
icon-switch.png
take-order/static/photo/icon-switch.png
+0
-0
icon-take.png
take-order/static/photo/icon-take.png
+0
-0
No files found.
take-order/pages.json
View file @
eec44dbe
...
@@ -132,6 +132,7 @@
...
@@ -132,6 +132,7 @@
{
{
"path"
:
"pages/photo/take"
,
"path"
:
"pages/photo/take"
,
"style"
:
{
"style"
:
{
"navigationStyle"
:
"custom"
,
"navigationBarTitleText"
:
"拍照"
,
"navigationBarTitleText"
:
"拍照"
,
"navigationBarBackgroundColor"
:
"#333333"
,
"navigationBarBackgroundColor"
:
"#333333"
,
"navigationBarTextStyle"
:
"#FFFFFF"
,
"navigationBarTextStyle"
:
"#FFFFFF"
,
...
...
take-order/pages/photo/take.vue
View file @
eec44dbe
<
template
>
<
template
>
<view
class=
"blackBackColor"
>
<view
class=
"camera-container"
>
<cover-view
class=
"header-box"
>
<cover-image
bindtap=
"changeScale"
class=
"icon"
mode=
"aspectFit"
src=
"/static/photo/icon-switch.png"
></cover-image>
<cover-image
bindtap=
"changeScale"
class=
"icon"
mode=
"aspectFit"
src=
"/static/photo/icon-light.png"
></cover-image>
<cover-image
bindtap=
"changeScale"
class=
"icon"
mode=
"aspectFit"
src=
"/static/photo/icon-setting.png"
></cover-image>
</cover-view>
<camera
device-position=
"front"
flash=
"on"
style=
'width:100%; height:100vh; overflow: hidden;'
@
error=
"cameraRefuse"
>
<camera
device-position=
"front"
flash=
"on"
style=
'width:100%; height:100vh; overflow: hidden;'
@
error=
"cameraRefuse"
>
<cover-view
class=
"
locationView
"
>
<cover-view
class=
"
mark-box
"
>
<cover-view
class=
"locationText u-m-l-20 u-m-t-30"
>
经度:
{{
longitude
}}
</cover-view>
<cover-view
class=
"locationText u-m-l-20 u-m-t-30"
>
经度:
{{
longitude
}}
</cover-view>
<cover-view
class=
"locationText u-m-l-20 u-m-t-10"
>
维度:
{{
latitude
}}
</cover-view>
<cover-view
class=
"locationText u-m-l-20 u-m-t-10"
>
维度:
{{
latitude
}}
</cover-view>
<cover-view
class=
"locationText u-m-l-20 u-m-t-10"
>
地址:
{{
address
}}
</cover-view>
<cover-view
class=
"locationText u-m-l-20 u-m-t-10"
>
地址:
{{
address
}}
</cover-view>
<cover-view
class=
"locationText u-m-l-20 u-m-t-10"
>
时间:
{{
date
}}
</cover-view>
<cover-view
class=
"locationText u-m-l-20 u-m-t-10"
>
时间:
{{
date
}}
</cover-view>
</cover-view>
</cover-view>
<cover-image
class=
"liveWatermarkNormal"
mode=
"aspectFit"
:src=
"liveWaterMarkImage"
></cover-image>
<cover-image
class=
"
mark-water
liveWatermarkNormal"
mode=
"aspectFit"
:src=
"liveWaterMarkImage"
></cover-image>
</camera>
</camera>
<cover-view
class=
"bottom
View
"
>
<cover-view
class=
"bottom
-box
"
>
<cover-image
class=
"
backI
con"
:src=
"icon_arrow_down"
mode=
""
@
click=
"simpleBack"
></cover-image>
<cover-image
class=
"
i
con"
:src=
"icon_arrow_down"
mode=
""
@
click=
"simpleBack"
></cover-image>
<!--cover-image class='switchIcon' :src='icon_switch_white' @click="switchClick()">
</cover-image-->
<!--cover-image class='switchIcon' :src='icon_switch_white' @click="switchClick()">
</cover-image-->
<cover-image
class=
'
takeIcon'
:src=
'icon_take
'
@
click=
"takePhoto()"
>
</cover-image>
<cover-image
class=
'
icon-take icon'
src=
'/static/photo/icon-take.png
'
@
click=
"takePhoto()"
>
</cover-image>
<cover-view
class=
"txt"
>
拍照要求
</cover-view>
<!--cover-image class='flashIcon' :src='icon_light_on_white' @click="flashClick()">
</cover-image-->
<!--cover-image class='flashIcon' :src='icon_light_on_white' @click="flashClick()">
</cover-image-->
</cover-view>
</cover-view>
<!--button @click="openSetting">打开设置页
</button-->
<!--button @click="openSetting">打开设置页
</button-->
...
@@ -344,9 +349,7 @@
...
@@ -344,9 +349,7 @@
//第一步: 拍照
//第一步: 拍照
takePhoto
()
{
takePhoto
()
{
this
.
getLocation
()
console
.
log
((
new
Date
).
getTime
(),
'开始渲染'
)
return
let
that
=
this
this
.
ctx
.
takePhoto
({
this
.
ctx
.
takePhoto
({
quality
:
'high'
,
quality
:
'high'
,
success
:
(
res
)
=>
{
success
:
(
res
)
=>
{
...
@@ -419,8 +422,10 @@
...
@@ -419,8 +422,10 @@
},
},
canvasImage
()
{
canvasImage
()
{
let
self
=
this
let
self
=
this
this
.
canvas
.
draw
(
false
,
setTimeout
(()
=>
{
this
.
canvas
.
draw
(
false
,
setTimeout
(()
=>
{
setTimeout
(()
=>
{
console
.
log
((
new
Date
).
getTime
(),
'结束渲染'
)
uni
.
canvasToTempFilePath
({
uni
.
canvasToTempFilePath
({
// x: 0,
// x: 0,
// y: 0,
// y: 0,
...
@@ -428,6 +433,7 @@
...
@@ -428,6 +433,7 @@
height
:
Number
(
this
.
canvasHeight
),
height
:
Number
(
this
.
canvasHeight
),
canvasId
:
'canvas'
,
canvasId
:
'canvas'
,
success
:
(
res
)
=>
{
success
:
(
res
)
=>
{
self
.
saveToLocal
(
res
.
tempFilePath
)
self
.
saveToLocal
(
res
.
tempFilePath
)
const
FileSystemManager
=
wx
.
getFileSystemManager
()
const
FileSystemManager
=
wx
.
getFileSystemManager
()
FileSystemManager
.
saveFile
({
FileSystemManager
.
saveFile
({
...
@@ -449,8 +455,7 @@
...
@@ -449,8 +455,7 @@
uni
.
hideLoading
();
uni
.
hideLoading
();
}
}
},
this
);
},
this
);
},
500
);
},
500
));
}));
},
},
showPreviewFn
(
img
)
{
showPreviewFn
(
img
)
{
uni
.
previewImage
({
uni
.
previewImage
({
...
@@ -622,74 +627,21 @@
...
@@ -622,74 +627,21 @@
}
}
</
script
>
</
script
>
<
style
>
<
style
scoped
lang=
"scss"
>
.
blackBackColor
{
.
camera-container
{
background-color
:
#000000
;
padding-top
:var
(
--status-bar-height
)
;
overflow
:
hidden
;
background-color
:
black
;
}
}
.header-box
{
.bottomView
{
padding
:
10rpx
20rpx
;
background-color
:
#333333
;
z-index
:
5
;
width
:
100%
;
height
:
200
rpx
;
position
:
absolute
;
bottom
:
0
;
display
:
flex
;
display
:
flex
;
flex-direction
:
row
;
.icon
{
align-items
:
center
;
display
:
block
;
justify-content
:
center
;
width
:
50rpx
;
height
:
50rpx
;
}
}
.switchIcon
{
background-color
:
#000000
;
width
:
50
rpx
;
height
:
50
rpx
;
}
.takeIcon
{
background-color
:
#333333
;
width
:
150
rpx
;
height
:
150
rpx
;
}
.flashIcon
{
background-color
:
#000000
;
width
:
50
rpx
;
height
:
50
rpx
;
margin-left
:
100
rpx
;
}
.locationView
{
/* z-index: 5;
width: 300rpx;
position: absolute;
left: 0;
bottom: 200rpx;
display: flex;
flex-direction: column;
padding-bottom: 20rpx;
padding-right: 20rpx; */
bottom
:
200
rpx
;
padding-bottom
:
20
rpx
;
padding-right
:
20
rpx
;
z-index
:
4
;
position
:
absolute
;
font-size
:
14px
;
line-height
:
18px
;
color
:
#fff
;
}
.locationText
{
/* font-size: 24rpx;
color: #999999;
width: 260rpx; */
margin
:
2px
0
;
}
}
.mark-water
{
.liveWatermarkNormal
{
z-index
:
3
;
position
:
absolute
;
position
:
absolute
;
left
:
50%
;
left
:
50%
;
top
:
50%
;
top
:
50%
;
...
@@ -698,17 +650,124 @@
...
@@ -698,17 +650,124 @@
height
:
90rpx
;
height
:
90rpx
;
z-index
:
6
;
z-index
:
6
;
}
}
.mark-box
{
.backIcon
{
position
:
absolute
;
background-color
:
#FFFFFF
;
left
:
0
;
width
:
54
rpx
;
bottom
:
240rpx
;
height
:
54
rpx
;
padding
:
20rpx
;
border-radius
:
27
rpx
;
}
position
:
fixed
;
.bottom-box
{
left
:
60
rpx
;
position
:
absolute
;
bottom
:
50
rpx
;
left
:
0
;
right
:
0
;
border
:
2
rpx
solid
#aaa
;
bottom
:
0
;
z-index
:
5
;
height
:
160rpx
;
display
:
flex
;
justify-content
:
space-between
;
padding
:
20rpx
;
align-items
:
center
;
background-color
:
black
;
.txt
{
line-height
:
60rpx
;
color
:
#fff
;
}
.icon
{
display
:
block
;
width
:
60rpx
;
height
:
60rpx
;
&
.icon-take
{
width
:
150rpx
;
height
:
150rpx
;
}
}
}
}
// .blackBackColor {
// background-color: #000000;
// overflow: hidden;
// }
// .bottomView {
// background-color: #333333;
// z-index: 5;
// width: 100%;
// height: 200rpx;
// position: absolute;
// bottom: 0;
// display: flex;
// flex-direction: row;
// align-items: center;
// justify-content: center;
// }
// .switchIcon {
// background-color: #000000;
// width: 50rpx;
// height: 50rpx;
// }
// .takeIcon {
// background-color: #333333;
// width: 150rpx;
// height: 150rpx;
// }
// .flashIcon {
// background-color: #000000;
// width: 50rpx;
// height: 50rpx;
// margin-left: 100rpx;
// }
// .locationView {
// /* z-index: 5;
// width: 300rpx;
// position: absolute;
// left: 0;
// bottom: 200rpx;
// display: flex;
// flex-direction: column;
// padding-bottom: 20rpx;
// padding-right: 20rpx; */
// bottom: 200rpx;
// padding-bottom: 20rpx;
// padding-right: 20rpx;
// z-index: 4;
// position: absolute;
// font-size: 14px;
// line-height: 18px;
// color: #fff;
// }
// .locationText {
// /* font-size: 24rpx;
// color: #999999;
// width: 260rpx; */
// margin: 2px 0;
// }
// .liveWatermarkNormal {
// z-index: 3;
// position: absolute;
// left: 50%;
// top: 50%;
// transform: translate(-50%, -50%);
// width: 360rpx;
// height: 90rpx;
// z-index: 6;
// }
// // .backIcon {
// // background-color: #FFFFFF;
// // width: 54rpx;
// // height: 54rpx;
// // border-radius: 27rpx;
// // position: fixed;
// // left: 60rpx;
// // bottom: 50rpx;
// // border: 2rpx solid #aaa;
// // }
.showCanvas
{
.showCanvas
{
background-color
:
#007AFF
;
background-color
:
#007AFF
;
...
...
take-order/static/photo/icon-light.png
0 → 100644
View file @
eec44dbe
1.67 KB
take-order/static/photo/icon-setting.png
0 → 100644
View file @
eec44dbe
6 KB
take-order/static/photo/icon-switch.png
0 → 100644
View file @
eec44dbe
1.77 KB
take-order/static/photo/icon-take.png
0 → 100644
View file @
eec44dbe
8.88 KB
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