Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mallapp
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
viitto
mallapp
Commits
e64d15bb
Commit
e64d15bb
authored
Sep 22, 2020
by
Mac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
907b1ceb
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
227 additions
and
39 deletions
+227
-39
manifest.json
manifest.json
+6
-1
guidecarList.vue
pages/guidecar/guidecarList.vue
+1
-1
index.vue
pages/guidecar/index.vue
+104
-17
place_order.vue
pages/guidecar/place_order.vue
+110
-20
index.vue
pages/index/index.vue
+6
-0
No files found.
manifest.json
View file @
e64d15bb
...
...
@@ -71,7 +71,12 @@
"urlCheck"
:
false
,
"minified"
:
false
},
"usingComponents"
:
true
"usingComponents"
:
true
,
"permission"
:
{
"scope.userLocation"
:
{
"desc"
:
"你的位置信息将用于小程序位置接口的效果展示"
}
}
},
"mp-alipay"
:
{
"usingComponents"
:
true
...
...
pages/guidecar/guidecarList.vue
View file @
e64d15bb
...
...
@@ -72,7 +72,7 @@
<view
style=
"display: flex;flex-direction: column;justify-content: space-between;height: 30px;margin-left: 8px;"
>
<view
class=
"itemb"
>
<span
style=
'font-size: 11px;color: #111111;'
>
{{
x
.
guidename
}}
</span>
<view
style=
"background-image: linear-gradient( to right,#FF8585, #EE4454);color: #FFF;font-size: 10px;border-radius: 1px;margin-left: 5px;padding: 0 2px;"
>
<view
v-if=
'x.guidescore>0'
style=
"background-image: linear-gradient( to right,#FF8585, #EE4454);color: #FFF;font-size: 10px;border-radius: 1px;margin-left: 5px;padding: 0 2px;"
>
{{
x
.
guidescore
}}
</view>
</view>
...
...
pages/guidecar/index.vue
View file @
e64d15bb
...
...
@@ -257,16 +257,17 @@
this
.
amapPlugin
=
new
amap
.
AMapWX
({
key
:
this
.
key
});
this
.
getRegeo
()
//
this.getRegeo()
},
methods
:{
getRegeo
()
{
//进入页面获取当前地址位置
uni
.
showLoading
({
title
:
'获取信息中'
});
//
uni.showLoading({
//
title: '获取信息中'
//
});
this
.
amapPlugin
.
getRegeo
({
success
:
(
data
)
=>
{
console
.
log
(
data
,
'获取当前位置'
)
this
.
address
=
data
[
0
].
name
this
.
Pickcar
=
data
[
0
].
regeocodeData
.
addressComponent
.
city
;
this
.
latitude
=
data
[
0
].
latitude
;
...
...
@@ -439,19 +440,105 @@
}
},
openmap
(){
//打开地图选择详情地址
let
that
=
this
uni
.
chooseLocation
({
latitude
:
this
.
latitude
,
longitude
:
this
.
longitude
,
success
:
function
(
res
)
{
that
.
latitude
=
res
.
latitude
;
that
.
longitude
=
res
.
longitude
;
that
.
address
=
res
.
address
let
parseResult
=
AddressParse
(
that
.
address
,
0
)
let
nameList
=
[
parseResult
.
province
,
parseResult
.
city
,
parseResult
.
area
];
that
.
getDestination
(
nameList
);
}
});
let
that
=
this
wx
.
getSetting
({
success
(
res
)
{
console
.
log
(
'res是否开启授权'
,
res
)
if
(
!
res
.
authSetting
[
'scope.userLocation'
])
{
wx
.
authorize
({
scope
:
'scope.userLocation'
,
success
()
{
// console.log('前用户发起授权请求')
uni
.
chooseLocation
({
latitude
:
that
.
latitude
,
longitude
:
that
.
longitude
,
success
:
function
(
res
)
{
that
.
latitude
=
res
.
latitude
;
that
.
longitude
=
res
.
longitude
;
that
.
address
=
res
.
address
let
parseResult
=
AddressParse
(
that
.
address
,
0
)
let
nameList
=
[
parseResult
.
province
,
parseResult
.
city
,
parseResult
.
area
];
that
.
getDestination
(
nameList
);
}
});
},
fail
()
{
// 用户点击不允许引导重新获取授权
that
.
fetchAgainLocation
()
}
})
}
else
{
// 已经授权了就会直接进入地图
uni
.
chooseLocation
({
latitude
:
that
.
latitude
,
longitude
:
that
.
longitude
,
success
:
function
(
res
)
{
that
.
latitude
=
res
.
latitude
;
that
.
longitude
=
res
.
longitude
;
that
.
address
=
res
.
address
let
parseResult
=
AddressParse
(
that
.
address
,
0
)
let
nameList
=
[
parseResult
.
province
,
parseResult
.
city
,
parseResult
.
area
];
that
.
getDestination
(
nameList
);
}
});
}
}
})
},
fetchAgainLocation
(){
let
that
=
this
wx
.
getSetting
({
success
:
(
res
)
=>
{
console
.
log
()
var
statu
=
res
.
authSetting
;
if
(
!
statu
[
'scope.userLocation'
])
{
wx
.
showModal
({
title
:
'是否授权当前位置'
,
content
:
'需要获取您的地理位置,请确认授权,否则地图功能将无法使用'
,
success
:
(
tip
)
=>
{
if
(
tip
.
confirm
)
{
wx
.
openSetting
({
success
:
(
data
)
=>
{
if
(
data
.
authSetting
[
"scope.userLocation"
]
===
true
)
{
wx
.
showToast
({
title
:
'授权成功'
,
icon
:
'success'
,
duration
:
1000
})
uni
.
chooseLocation
({
latitude
:
this
.
latitude
,
longitude
:
this
.
longitude
,
success
:
function
(
res
)
{
that
.
latitude
=
res
.
latitude
;
that
.
longitude
=
res
.
longitude
;
that
.
address
=
res
.
address
let
parseResult
=
AddressParse
(
that
.
address
,
0
)
let
nameList
=
[
parseResult
.
province
,
parseResult
.
city
,
parseResult
.
area
];
that
.
getDestination
(
nameList
);
}
});
}
else
{
wx
.
showToast
({
title
:
'授权失败'
,
icon
:
'success'
,
duration
:
1000
})
}
},
fail
:
()
=>
{},
complete
:
()
=>
{}
});
}
}
})
}
},
fail
:
()
=>
{},
complete
:
()
=>
{}
})
},
getDestination
(
nameList
)
{
this
.
request2
(
...
...
pages/guidecar/place_order.vue
View file @
e64d15bb
...
...
@@ -493,7 +493,7 @@
this
.
amapPlugin
=
new
amap
.
AMapWX
({
key
:
this
.
key
});
this
.
getRegeo
()
//
this.getRegeo()
}
},
created
()
{
...
...
@@ -506,11 +506,12 @@
},
methods
:
{
getRegeo
()
{
uni
.
showLoading
({
title
:
'获取信息中'
});
//
uni.showLoading({
//
title: '获取信息中'
//
});
this
.
amapPlugin
.
getRegeo
({
success
:
(
data
)
=>
{
console
.
log
(
data
,
'获取当前位置'
)
this
.
Pickcar
=
data
[
0
].
regeocodeData
.
addressComponent
.
city
;
this
.
latitude
=
data
[
0
].
latitude
;
this
.
longitude
=
data
[
0
].
longitude
;
...
...
@@ -519,23 +520,112 @@
});
},
openmap
()
{
//打开地图选择详情地址
let
that
=
this
wx
.
getSetting
({
success
(
res
)
{
console
.
log
(
'res是否开启授权'
,
res
)
if
(
!
res
.
authSetting
[
'scope.userLocation'
])
{
wx
.
authorize
({
scope
:
'scope.userLocation'
,
success
()
{
// console.log('前用户发起授权请求')
uni
.
chooseLocation
({
latitude
:
that
.
latitude
,
longitude
:
that
.
longitude
,
success
:
function
(
res
)
{
if
(
that
.
isShowStart
==
1
){
that
.
latitude
=
res
.
latitude
;
that
.
longitude
=
res
.
longitude
;
that
.
msg
.
ShoppingAddress
=
res
.
address
let
parseResult
=
AddressParse
(
that
.
msg
.
ShoppingAddress
,
0
)
let
nameList
=
[
parseResult
.
province
,
parseResult
.
city
,
parseResult
.
area
];
that
.
getDestination
(
nameList
);
}
else
{
that
.
orderMsg
.
DestinationAddress
=
res
.
address
;
}
}
});
},
fail
()
{
// 用户点击不允许引导重新获取授权
that
.
fetchAgainLocation
()
}
})
}
else
{
// 已经授权了就会直接进入地图
uni
.
chooseLocation
({
latitude
:
that
.
latitude
,
longitude
:
that
.
longitude
,
success
:
function
(
res
)
{
if
(
that
.
isShowStart
==
1
){
that
.
latitude
=
res
.
latitude
;
that
.
longitude
=
res
.
longitude
;
that
.
msg
.
ShoppingAddress
=
res
.
address
let
parseResult
=
AddressParse
(
that
.
msg
.
ShoppingAddress
,
0
)
let
nameList
=
[
parseResult
.
province
,
parseResult
.
city
,
parseResult
.
area
];
that
.
getDestination
(
nameList
);
}
else
{
that
.
orderMsg
.
DestinationAddress
=
res
.
address
;
}
}
});
}
}
})
},
fetchAgainLocation
(){
let
that
=
this
uni
.
chooseLocation
({
latitude
:
this
.
latitude
,
longitude
:
this
.
longitude
,
success
:
function
(
res
)
{
if
(
that
.
isShowStart
==
1
){
that
.
latitude
=
res
.
latitude
;
that
.
longitude
=
res
.
longitude
;
that
.
msg
.
ShoppingAddress
=
res
.
address
let
parseResult
=
AddressParse
(
that
.
msg
.
ShoppingAddress
,
0
)
let
nameList
=
[
parseResult
.
province
,
parseResult
.
city
,
parseResult
.
area
];
that
.
getDestination
(
nameList
);
}
else
{
that
.
orderMsg
.
DestinationAddress
=
res
.
address
;
}
}
});
wx
.
getSetting
({
success
:
(
res
)
=>
{
console
.
log
()
var
statu
=
res
.
authSetting
;
if
(
!
statu
[
'scope.userLocation'
])
{
wx
.
showModal
({
title
:
'是否授权当前位置'
,
content
:
'需要获取您的地理位置,请确认授权,否则地图功能将无法使用'
,
success
:
(
tip
)
=>
{
if
(
tip
.
confirm
)
{
wx
.
openSetting
({
success
:
(
data
)
=>
{
if
(
data
.
authSetting
[
"scope.userLocation"
]
===
true
)
{
wx
.
showToast
({
title
:
'授权成功'
,
icon
:
'success'
,
duration
:
1000
})
uni
.
chooseLocation
({
latitude
:
that
.
latitude
,
longitude
:
that
.
longitude
,
success
:
function
(
res
)
{
that
.
latitude
=
res
.
latitude
;
that
.
longitude
=
res
.
longitude
;
that
.
address
=
res
.
address
let
parseResult
=
AddressParse
(
that
.
address
,
0
)
let
nameList
=
[
parseResult
.
province
,
parseResult
.
city
,
parseResult
.
area
];
that
.
getDestination
(
nameList
);
}
});
}
else
{
wx
.
showToast
({
title
:
'授权失败'
,
icon
:
'success'
,
duration
:
1000
})
}
},
fail
:
()
=>
{},
complete
:
()
=>
{}
});
}
}
})
}
},
fail
:
()
=>
{},
complete
:
()
=>
{}
})
},
//获取数据
getData
()
{
...
...
pages/index/index.vue
View file @
e64d15bb
...
...
@@ -28,6 +28,7 @@
:bold=
"false"
@
change=
"changeHandler"
></u-tabs>
<button
@
click=
"gosid"
>
司导
</button>
<template
v-for=
"(item, i) in myPageData.home_pages.navs"
>
<view
:key=
"i"
v-if=
"active == i"
>
<template
v-for=
"(d, di) in item.template.data"
>
...
...
@@ -401,6 +402,11 @@ export default {
},
methods
:
{
gosid
(){
uni
.
navigateTo
({
url
:
'/pages/guidecar/index'
})
},
//调用获取code
getCode
(
obj
)
{
var
that
=
this
;
...
...
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