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
81b50f21
Commit
81b50f21
authored
Dec 31, 2020
by
李俊赕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add-map-ak
parent
64ca950b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
22 deletions
+56
-22
try.vue
take-order/pages/photo/try.vue
+56
-22
No files found.
take-order/pages/photo/try.vue
View file @
81b50f21
...
@@ -26,7 +26,13 @@
...
@@ -26,7 +26,13 @@
</
template
>
</
template
>
<
script
>
<
script
>
let
r
=
require
(
"../../libs/bmap-wx.min.js"
);
let
h
=
new
r
.
BMapWX
({
// ak: "rpVq5d3yxaRCoKzVwmFMo0o4iC524CAG",
ak
:
"lF1HoyXdiv4uZx6TrGQEZs48F5y8kEHI"
});
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
title
:
''
,
title
:
''
,
...
@@ -50,9 +56,9 @@
...
@@ -50,9 +56,9 @@
width
:
''
,
width
:
''
,
height
:
''
,
height
:
''
,
markPath
:
''
,
markPath
:
''
,
canvasWidth
:
0
,
canvasWidth
:
0
,
canvasHeight
:
0
,
canvasHeight
:
0
,
restuleImage
:
''
,
restuleImage
:
''
,
}
}
},
},
onLoad
(
e
)
{
onLoad
(
e
)
{
...
@@ -61,6 +67,7 @@
...
@@ -61,6 +67,7 @@
this
.
getLocation
()
this
.
getLocation
()
this
.
getMarkPath
()
this
.
getMarkPath
()
this
.
getSystemInfo
()
this
.
getSystemInfo
()
this
.
baiduLocation
()
uni
.
setNavigationBarColor
({
uni
.
setNavigationBarColor
({
frontColor
:
'#FFFFFF'
,
frontColor
:
'#FFFFFF'
,
backgroundColor
:
'#333333'
,
backgroundColor
:
'#333333'
,
...
@@ -68,10 +75,37 @@
...
@@ -68,10 +75,37 @@
//this.address = ''
//this.address = ''
},
},
methods
:
{
methods
:
{
goPage
(){
baiduLocation
()
{
let
a
=
this
,
t
=
function
()
{
let
t
=
{
success
:
function
(
res
)
{
var
e
=
res
.
wxMarkerData
[
0
];
console
.
log
(
"当前定位"
,
e
);
var
i
=
e
.
address
;
this
.
address
=
i
// a.setData({
// addressValue: i
// }), o.globalData.addressValue = i, a.initWatermarkBoxHeightAndWidth();
},
fail
:
function
(
a
)
{
console
.
log
(
a
,
'a'
)
// n.error(a), console.log(a);
}
};
if
(
a
.
latitude
&&
a
.
longitude
)
{
// let e = a.longitude + "," + a.latitude;
let
e
=
'113.88308'
+
','
+
'22.55329'
t
.
location
=
e
;
}
h
.
regeocoding
(
t
);
};
t
()
},
goPage
()
{
// 进入图片预览页
// 进入图片预览页
},
},
goBack
(){
goBack
()
{
uni
.
navigateBack
({
uni
.
navigateBack
({
delta
:
2
delta
:
2
});
});
...
@@ -80,8 +114,8 @@
...
@@ -80,8 +114,8 @@
// 获取设备信息
// 获取设备信息
try
{
try
{
const
res
=
uni
.
getSystemInfoSync
();
const
res
=
uni
.
getSystemInfoSync
();
this
.
canvasWidth
=
res
.
windowWidth
*
2
this
.
canvasWidth
=
res
.
windowWidth
*
2
this
.
canvasHeight
=
res
.
windowHeight
*
2
this
.
canvasHeight
=
res
.
windowHeight
*
2
}
catch
(
e
)
{
}
catch
(
e
)
{
// error
// error
}
}
...
@@ -173,13 +207,13 @@
...
@@ -173,13 +207,13 @@
this
.
canvas
.
setFontSize
(
28
)
this
.
canvas
.
setFontSize
(
28
)
this
.
canvas
.
setFillStyle
(
'#f2f2f2'
)
this
.
canvas
.
setFillStyle
(
'#f2f2f2'
)
let
h
=
1
let
h
=
1
let
txtHeight
=
36
let
txtHeight
=
36
this
.
canvas
.
fillText
(
'经度'
+
this
.
longitude
,
20
,
canvasHeight
-
txtHeight
*
h
++
);
this
.
canvas
.
fillText
(
'经度'
+
this
.
longitude
,
20
,
canvasHeight
-
txtHeight
*
h
++
);
this
.
canvas
.
fillText
(
'维度'
+
this
.
latitude
,
20
,
canvasHeight
-
txtHeight
*
h
++
);
this
.
canvas
.
fillText
(
'维度'
+
this
.
latitude
,
20
,
canvasHeight
-
txtHeight
*
h
++
);
this
.
canvas
.
fillText
(
'地址'
+
this
.
address
,
20
,
canvasHeight
-
txtHeight
*
h
++
);
this
.
canvas
.
fillText
(
'地址'
+
this
.
address
,
20
,
canvasHeight
-
txtHeight
*
h
++
);
this
.
canvas
.
fillText
(
'时间'
+
this
.
date
,
20
,
canvasHeight
-
txtHeight
*
h
++
);
this
.
canvas
.
fillText
(
'时间'
+
this
.
date
,
20
,
canvasHeight
-
txtHeight
*
h
++
);
//加入 水印图片
//加入 水印图片
this
.
canvas
.
drawImage
(
this
.
markPath
,
canvasWidth
/
2
-
200
,
canvasHeight
/
2
-
50
,
400
,
100
)
this
.
canvas
.
drawImage
(
this
.
markPath
,
canvasWidth
/
2
-
200
,
canvasHeight
/
2
-
50
,
400
,
100
)
this
.
canvasImage
()
this
.
canvasImage
()
// this.canvas.draw()
// this.canvas.draw()
...
@@ -236,19 +270,19 @@
...
@@ -236,19 +270,19 @@
filePath
:
tempImagePath
,
filePath
:
tempImagePath
,
success
()
{
success
()
{
uni
.
showToast
({
uni
.
showToast
({
icon
:
'none'
,
icon
:
'none'
,
title
:
'已将照片保存到本地相册'
title
:
'已将照片保存到本地相册'
})
})
let
timer
=
setTimeout
(()
=>
{
let
timer
=
setTimeout
(()
=>
{
that
.
goBack
()
that
.
goBack
()
},
0
)
},
0
)
},
},
fail
()
{
fail
()
{
// console.log('保存本地相册 失败')
// console.log('保存本地相册 失败')
uni
.
showToast
({
uni
.
showToast
({
icon
:
'none'
,
icon
:
'none'
,
title
:
'保存本地相册失败'
title
:
'保存本地相册失败'
})
})
}
}
})
})
...
@@ -353,7 +387,7 @@
...
@@ -353,7 +387,7 @@
position
:
fixed
;
position
:
fixed
;
left
:
60
rpx
;
left
:
60
rpx
;
bottom
:
50
rpx
;
bottom
:
50
rpx
;
border
:
2
rpx
solid
#aaa
;
border
:
2
rpx
solid
#aaa
;
}
}
.showCanvas
{
.showCanvas
{
...
...
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