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
f1b8a809
Commit
f1b8a809
authored
Sep 15, 2020
by
Mac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改参数
parent
9d07596d
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
205 additions
and
40 deletions
+205
-40
amap-wx.js
pages/guidecar/components/amap-wx.js
+1
-0
guidecarGoodsdetails.vue
pages/guidecar/guidecarGoodsdetails.vue
+78
-11
guidecarList.vue
pages/guidecar/guidecarList.vue
+68
-12
index.vue
pages/guidecar/index.vue
+37
-13
pickcarcity.vue
pages/guidecar/pickcarcity.vue
+21
-4
No files found.
pages/guidecar/components/amap-wx.js
0 → 100644
View file @
f1b8a809
function
AMapWX
(
a
){
this
.
key
=
a
.
key
,
this
.
requestConfig
=
{
key
:
a
.
key
,
s
:
"rsx"
,
platform
:
"WXJS"
,
appname
:
a
.
key
,
sdkversion
:
"1.2.0"
,
logversion
:
"2.0"
}}
AMapWX
.
prototype
.
getWxLocation
=
function
(
a
,
b
){
wx
.
getLocation
({
type
:
"gcj02"
,
success
:
function
(
a
){
var
c
=
a
.
longitude
+
","
+
a
.
latitude
;
wx
.
setStorage
({
key
:
"userLocation"
,
data
:
c
}),
b
(
c
)},
fail
:
function
(
c
){
wx
.
getStorage
({
key
:
"userLocation"
,
success
:
function
(
a
){
a
.
data
&&
b
(
a
.
data
)}}),
a
.
fail
({
errCode
:
"0"
,
errMsg
:
c
.
errMsg
||
""
})}})},
AMapWX
.
prototype
.
getRegeo
=
function
(
a
){
function
c
(
c
){
var
d
=
b
.
requestConfig
;
wx
.
request
({
url
:
"https://restapi.amap.com/v3/geocode/regeo"
,
data
:{
key
:
b
.
key
,
location
:
c
,
extensions
:
"all"
,
s
:
d
.
s
,
platform
:
d
.
platform
,
appname
:
b
.
key
,
sdkversion
:
d
.
sdkversion
,
logversion
:
d
.
logversion
},
method
:
"GET"
,
header
:{
"content-type"
:
"application/json"
},
success
:
function
(
b
){
var
d
,
e
,
f
,
g
,
h
,
i
,
j
,
k
,
l
;
b
.
data
.
status
&&
"1"
==
b
.
data
.
status
?(
d
=
b
.
data
.
regeocode
,
e
=
d
.
addressComponent
,
f
=
[],
g
=
""
,
d
&&
d
.
roads
[
0
]
&&
d
.
roads
[
0
].
name
&&
(
g
=
d
.
roads
[
0
].
name
+
"附近"
),
h
=
c
.
split
(
","
)[
0
],
i
=
c
.
split
(
","
)[
1
],
d
.
pois
&&
d
.
pois
[
0
]
&&
(
g
=
d
.
pois
[
0
].
name
+
"附近"
,
j
=
d
.
pois
[
0
].
location
,
j
&&
(
h
=
parseFloat
(
j
.
split
(
","
)[
0
]),
i
=
parseFloat
(
j
.
split
(
","
)[
1
]))),
e
.
provice
&&
f
.
push
(
e
.
provice
),
e
.
city
&&
f
.
push
(
e
.
city
),
e
.
district
&&
f
.
push
(
e
.
district
),
e
.
streetNumber
&&
e
.
streetNumber
.
street
&&
e
.
streetNumber
.
number
?(
f
.
push
(
e
.
streetNumber
.
street
),
f
.
push
(
e
.
streetNumber
.
number
)):(
k
=
""
,
d
&&
d
.
roads
[
0
]
&&
d
.
roads
[
0
].
name
&&
(
k
=
d
.
roads
[
0
].
name
),
f
.
push
(
k
)),
f
=
f
.
join
(
""
),
l
=
[{
iconPath
:
a
.
iconPath
,
width
:
a
.
iconWidth
,
height
:
a
.
iconHeight
,
name
:
f
,
desc
:
g
,
longitude
:
h
,
latitude
:
i
,
id
:
0
,
regeocodeData
:
d
}],
a
.
success
(
l
)):
a
.
fail
({
errCode
:
b
.
data
.
infocode
,
errMsg
:
b
.
data
.
info
})},
fail
:
function
(
b
){
a
.
fail
({
errCode
:
"0"
,
errMsg
:
b
.
errMsg
||
""
})}})}
var
b
=
this
;
a
.
location
?
c
(
a
.
location
):
b
.
getWxLocation
(
a
,
function
(
a
){
c
(
a
)})},
AMapWX
.
prototype
.
getWeather
=
function
(
a
){
function
d
(
d
){
var
e
=
"base"
;
a
.
type
&&
"forecast"
==
a
.
type
&&
(
e
=
"all"
),
wx
.
request
({
url
:
"https://restapi.amap.com/v3/weather/weatherInfo"
,
data
:{
key
:
b
.
key
,
city
:
d
,
extensions
:
e
,
s
:
c
.
s
,
platform
:
c
.
platform
,
appname
:
b
.
key
,
sdkversion
:
c
.
sdkversion
,
logversion
:
c
.
logversion
},
method
:
"GET"
,
header
:{
"content-type"
:
"application/json"
},
success
:
function
(
b
){
function
c
(
a
){
var
b
=
{
city
:{
text
:
"城市"
,
data
:
a
.
city
},
weather
:{
text
:
"天气"
,
data
:
a
.
weather
},
temperature
:{
text
:
"温度"
,
data
:
a
.
temperature
},
winddirection
:{
text
:
"风向"
,
data
:
a
.
winddirection
+
"风"
},
windpower
:{
text
:
"风力"
,
data
:
a
.
windpower
+
"级"
},
humidity
:{
text
:
"湿度"
,
data
:
a
.
humidity
+
"%"
}};
return
b
}
var
d
,
e
;
b
.
data
.
status
&&
"1"
==
b
.
data
.
status
?
b
.
data
.
lives
?(
d
=
b
.
data
.
lives
,
d
&&
d
.
length
>
0
&&
(
d
=
d
[
0
],
e
=
c
(
d
),
e
[
"liveData"
]
=
d
,
a
.
success
(
e
))):
b
.
data
.
forecasts
&&
b
.
data
.
forecasts
[
0
]
&&
a
.
success
({
forecast
:
b
.
data
.
forecasts
[
0
]}):
a
.
fail
({
errCode
:
b
.
data
.
infocode
,
errMsg
:
b
.
data
.
info
})},
fail
:
function
(
b
){
a
.
fail
({
errCode
:
"0"
,
errMsg
:
b
.
errMsg
||
""
})}})}
function
e
(
e
){
wx
.
request
({
url
:
"https://restapi.amap.com/v3/geocode/regeo"
,
data
:{
key
:
b
.
key
,
location
:
e
,
extensions
:
"all"
,
s
:
c
.
s
,
platform
:
c
.
platform
,
appname
:
b
.
key
,
sdkversion
:
c
.
sdkversion
,
logversion
:
c
.
logversion
},
method
:
"GET"
,
header
:{
"content-type"
:
"application/json"
},
success
:
function
(
b
){
var
c
,
e
;
b
.
data
.
status
&&
"1"
==
b
.
data
.
status
?(
e
=
b
.
data
.
regeocode
,
e
.
addressComponent
?
c
=
e
.
addressComponent
.
adcode
:
e
.
aois
&&
e
.
aois
.
length
>
0
&&
(
c
=
e
.
aois
[
0
].
adcode
),
d
(
c
)):
a
.
fail
({
errCode
:
b
.
data
.
infocode
,
errMsg
:
b
.
data
.
info
})},
fail
:
function
(
b
){
a
.
fail
({
errCode
:
"0"
,
errMsg
:
b
.
errMsg
||
""
})}})}
var
b
=
this
,
c
=
b
.
requestConfig
;
a
.
city
?
d
(
a
.
city
):
b
.
getWxLocation
(
a
,
function
(
a
){
e
(
a
)})},
AMapWX
.
prototype
.
getPoiAround
=
function
(
a
){
function
d
(
d
){
var
e
=
{
key
:
b
.
key
,
location
:
d
,
s
:
c
.
s
,
platform
:
c
.
platform
,
appname
:
b
.
key
,
sdkversion
:
c
.
sdkversion
,
logversion
:
c
.
logversion
};
a
.
querytypes
&&
(
e
[
"types"
]
=
a
.
querytypes
),
a
.
querykeywords
&&
(
e
[
"keywords"
]
=
a
.
querykeywords
),
wx
.
request
({
url
:
"https://restapi.amap.com/v3/place/around"
,
data
:
e
,
method
:
"GET"
,
header
:{
"content-type"
:
"application/json"
},
success
:
function
(
b
){
var
c
,
d
,
e
,
f
;
if
(
b
.
data
.
status
&&
"1"
==
b
.
data
.
status
){
if
(
b
=
b
.
data
,
b
&&
b
.
pois
){
for
(
c
=
[],
d
=
0
;
d
<
b
.
pois
.
length
;
d
++
)
e
=
0
==
d
?
a
.
iconPathSelected
:
a
.
iconPath
,
c
.
push
({
latitude
:
parseFloat
(
b
.
pois
[
d
].
location
.
split
(
","
)[
1
]),
longitude
:
parseFloat
(
b
.
pois
[
d
].
location
.
split
(
","
)[
0
]),
iconPath
:
e
,
width
:
22
,
height
:
32
,
id
:
d
,
name
:
b
.
pois
[
d
].
name
,
address
:
b
.
pois
[
d
].
address
});
f
=
{
markers
:
c
,
poisData
:
b
.
pois
},
a
.
success
(
f
)}}
else
a
.
fail
({
errCode
:
b
.
data
.
infocode
,
errMsg
:
b
.
data
.
info
})},
fail
:
function
(
b
){
a
.
fail
({
errCode
:
"0"
,
errMsg
:
b
.
errMsg
||
""
})}})}
var
b
=
this
,
c
=
b
.
requestConfig
;
a
.
location
?
d
(
a
.
location
):
b
.
getWxLocation
(
a
,
function
(
a
){
d
(
a
)})},
AMapWX
.
prototype
.
getStaticmap
=
function
(
a
){
function
f
(
b
){
c
.
push
(
"location="
+
b
),
a
.
zoom
&&
c
.
push
(
"zoom="
+
a
.
zoom
),
a
.
size
&&
c
.
push
(
"size="
+
a
.
size
),
a
.
scale
&&
c
.
push
(
"scale="
+
a
.
scale
),
a
.
markers
&&
c
.
push
(
"markers="
+
a
.
markers
),
a
.
labels
&&
c
.
push
(
"labels="
+
a
.
labels
),
a
.
paths
&&
c
.
push
(
"paths="
+
a
.
paths
),
a
.
traffic
&&
c
.
push
(
"traffic="
+
a
.
traffic
);
var
e
=
d
+
c
.
join
(
"&"
);
a
.
success
({
url
:
e
})}
var
e
,
b
=
this
,
c
=
[],
d
=
"https://restapi.amap.com/v3/staticmap?"
;
c
.
push
(
"key="
+
b
.
key
),
e
=
b
.
requestConfig
,
c
.
push
(
"s="
+
e
.
s
),
c
.
push
(
"platform="
+
e
.
platform
),
c
.
push
(
"appname="
+
e
.
appname
),
c
.
push
(
"sdkversion="
+
e
.
sdkversion
),
c
.
push
(
"logversion="
+
e
.
logversion
),
a
.
location
?
f
(
a
.
location
):
b
.
getWxLocation
(
a
,
function
(
a
){
f
(
a
)})},
AMapWX
.
prototype
.
getInputtips
=
function
(
a
){
var
b
=
this
,
c
=
b
.
requestConfig
,
d
=
{
key
:
b
.
key
,
s
:
c
.
s
,
platform
:
c
.
platform
,
appname
:
b
.
key
,
sdkversion
:
c
.
sdkversion
,
logversion
:
c
.
logversion
};
a
.
location
&&
(
d
[
"location"
]
=
a
.
location
),
a
.
keywords
&&
(
d
[
"keywords"
]
=
a
.
keywords
),
a
.
type
&&
(
d
[
"type"
]
=
a
.
type
),
a
.
city
&&
(
d
[
"city"
]
=
a
.
city
),
a
.
citylimit
&&
(
d
[
"citylimit"
]
=
a
.
citylimit
),
wx
.
request
({
url
:
"https://restapi.amap.com/v3/assistant/inputtips"
,
data
:
d
,
method
:
"GET"
,
header
:{
"content-type"
:
"application/json"
},
success
:
function
(
b
){
b
&&
b
.
data
&&
b
.
data
.
tips
&&
a
.
success
({
tips
:
b
.
data
.
tips
})},
fail
:
function
(
b
){
a
.
fail
({
errCode
:
"0"
,
errMsg
:
b
.
errMsg
||
""
})}})},
AMapWX
.
prototype
.
getDrivingRoute
=
function
(
a
){
var
b
=
this
,
c
=
b
.
requestConfig
,
d
=
{
key
:
b
.
key
,
s
:
c
.
s
,
platform
:
c
.
platform
,
appname
:
b
.
key
,
sdkversion
:
c
.
sdkversion
,
logversion
:
c
.
logversion
};
a
.
origin
&&
(
d
[
"origin"
]
=
a
.
origin
),
a
.
destination
&&
(
d
[
"destination"
]
=
a
.
destination
),
a
.
strategy
&&
(
d
[
"strategy"
]
=
a
.
strategy
),
a
.
waypoints
&&
(
d
[
"waypoints"
]
=
a
.
waypoints
),
a
.
avoidpolygons
&&
(
d
[
"avoidpolygons"
]
=
a
.
avoidpolygons
),
a
.
avoidroad
&&
(
d
[
"avoidroad"
]
=
a
.
avoidroad
),
wx
.
request
({
url
:
"https://restapi.amap.com/v3/direction/driving"
,
data
:
d
,
method
:
"GET"
,
header
:{
"content-type"
:
"application/json"
},
success
:
function
(
b
){
b
&&
b
.
data
&&
b
.
data
.
route
&&
a
.
success
({
paths
:
b
.
data
.
route
.
paths
,
taxi_cost
:
b
.
data
.
route
.
taxi_cost
||
""
})},
fail
:
function
(
b
){
a
.
fail
({
errCode
:
"0"
,
errMsg
:
b
.
errMsg
||
""
})}})},
AMapWX
.
prototype
.
getWalkingRoute
=
function
(
a
){
var
b
=
this
,
c
=
b
.
requestConfig
,
d
=
{
key
:
b
.
key
,
s
:
c
.
s
,
platform
:
c
.
platform
,
appname
:
b
.
key
,
sdkversion
:
c
.
sdkversion
,
logversion
:
c
.
logversion
};
a
.
origin
&&
(
d
[
"origin"
]
=
a
.
origin
),
a
.
destination
&&
(
d
[
"destination"
]
=
a
.
destination
),
wx
.
request
({
url
:
"https://restapi.amap.com/v3/direction/walking"
,
data
:
d
,
method
:
"GET"
,
header
:{
"content-type"
:
"application/json"
},
success
:
function
(
b
){
b
&&
b
.
data
&&
b
.
data
.
route
&&
a
.
success
({
paths
:
b
.
data
.
route
.
paths
})},
fail
:
function
(
b
){
a
.
fail
({
errCode
:
"0"
,
errMsg
:
b
.
errMsg
||
""
})}})},
AMapWX
.
prototype
.
getTransitRoute
=
function
(
a
){
var
b
=
this
,
c
=
b
.
requestConfig
,
d
=
{
key
:
b
.
key
,
s
:
c
.
s
,
platform
:
c
.
platform
,
appname
:
b
.
key
,
sdkversion
:
c
.
sdkversion
,
logversion
:
c
.
logversion
};
a
.
origin
&&
(
d
[
"origin"
]
=
a
.
origin
),
a
.
destination
&&
(
d
[
"destination"
]
=
a
.
destination
),
a
.
strategy
&&
(
d
[
"strategy"
]
=
a
.
strategy
),
a
.
city
&&
(
d
[
"city"
]
=
a
.
city
),
a
.
cityd
&&
(
d
[
"cityd"
]
=
a
.
cityd
),
wx
.
request
({
url
:
"https://restapi.amap.com/v3/direction/transit/integrated"
,
data
:
d
,
method
:
"GET"
,
header
:{
"content-type"
:
"application/json"
},
success
:
function
(
b
){
if
(
b
&&
b
.
data
&&
b
.
data
.
route
){
var
c
=
b
.
data
.
route
;
a
.
success
({
distance
:
c
.
distance
||
""
,
taxi_cost
:
c
.
taxi_cost
||
""
,
transits
:
c
.
transits
})}},
fail
:
function
(
b
){
a
.
fail
({
errCode
:
"0"
,
errMsg
:
b
.
errMsg
||
""
})}})},
AMapWX
.
prototype
.
getRidingRoute
=
function
(
a
){
var
b
=
this
,
c
=
b
.
requestConfig
,
d
=
{
key
:
b
.
key
,
s
:
c
.
s
,
platform
:
c
.
platform
,
appname
:
b
.
key
,
sdkversion
:
c
.
sdkversion
,
logversion
:
c
.
logversion
};
a
.
origin
&&
(
d
[
"origin"
]
=
a
.
origin
),
a
.
destination
&&
(
d
[
"destination"
]
=
a
.
destination
),
wx
.
request
({
url
:
"https://restapi.amap.com/v4/direction/bicycling"
,
data
:
d
,
method
:
"GET"
,
header
:{
"content-type"
:
"application/json"
},
success
:
function
(
b
){
b
&&
b
.
data
&&
b
.
data
.
data
&&
a
.
success
({
paths
:
b
.
data
.
data
.
paths
})},
fail
:
function
(
b
){
a
.
fail
({
errCode
:
"0"
,
errMsg
:
b
.
errMsg
||
""
})}})},
module
.
exports
.
AMapWX
=
AMapWX
;
\ No newline at end of file
pages/guidecar/guidecarGoodsdetails.vue
View file @
f1b8a809
...
...
@@ -4,21 +4,21 @@
<view
class=
"g_top"
>
<view
class=
"row"
>
<u-icon
name=
"location"
:size=
"32"
color=
"#EE4454"
></u-icon>
<span>
成都站
</span>
<span>
{{
Pickcar
}}
</span>
<view
style=
"width: 2px;color: #E7E7E7;height: 20px;margin:0 10px;"
></view>
</view>
<view
class=
'row'
style=
"justify-content: space-between;width: 220px;"
>
<view
class=
"topB"
@
click=
""
>
<span
class=
'ztext'
>
9月5
日
</span>
<span
class=
'titext'
>
周三 18:20:00
</span>
<span
class=
'ztext'
>
{{
STime
.
month
}}
月
{{
STime
.
day
}}
日
</span>
<span
class=
'titext'
>
{{
STime
.
week
+
' '
+
STime
.
hour
+
':'
+
STime
.
minute
}}
</span>
</view>
<view
class=
"topB"
style=
"height: 20px;align-items: center;"
>
<span
style=
'font-size: 11px;color: #1C1E1F;'
>
6天
</span>
<span
style=
'font-size: 11px;color: #1C1E1F;'
>
{{
intervalDay
}}
</span>
<image
src=
"../../static/images/sanjiao.png"
mode=
"aspectFill"
style=
"width: 55px;height: 4px;"
></image>
</view>
<view
class=
"topB"
@
click=
""
>
<span
class=
'ztext'
>
9月11
日
</span>
<span
class=
'titext'
>
周三 18:20:00
</span>
<span
class=
'ztext'
>
{{
ETime
.
month
}}
月
{{
ETime
.
day
}}
日
</span>
<span
class=
'titext'
>
{{
ETime
.
week
+
' '
+
ETime
.
hour
+
':'
+
ETime
.
minute
}}
</span>
</view>
</view>
</view>
...
...
@@ -115,7 +115,7 @@
style=
"margin-left: 5px; font-size: 12px;"
>
{{
g
.
goods_marketing_award
.
integral
.
title
}}
</text>
</view>
<view
<!--
<view
style=
"display: flex;flex-direction: row;align-items: center"
v-if=
"g.goods_marketing_award.PresentFXGradeMsg != ''"
@
click=
"goVIP"
...
...
@@ -124,7 +124,7 @@
<text
style=
"margin-left: 5px; font-size: 12px;"
>
{{
g
.
goods_marketing_award
.
PresentFXGradeMsg
}}
</text>
</view>
</view>
-->
</view>
...
...
@@ -251,14 +251,52 @@
comments
:
[],
bian
:
false
,
path
:
''
,
STime
:{},
ETime
:{},
intervalDay
:
''
,
address
:
''
,
Pickcar
:
''
,
}
},
onLoad
(
option
){
if
(
option
&&
option
.
GoodsId
){
this
.
GoodsId
=
option
.
GoodsId
}
if
(
option
&&
option
.
address
){
this
.
address
=
option
.
address
}
if
(
option
&&
option
.
Pickcar
){
this
.
Pickcar
=
option
.
Pickcar
}
if
(
option
&&
option
.
StartTime
){
this
.
STime
=
this
.
getTime
(
option
.
StartTime
)
}
if
(
option
&&
option
.
EndTime
){
this
.
ETime
=
this
.
getTime
(
option
.
EndTime
)
}
if
(
option
&&
option
.
StartTime
&&
option
.
EndTime
){
let
startTime
=
new
Date
(
option
.
StartTime
);
// 开始时间
let
endTime
=
new
Date
(
option
.
EndTime
);
// 结束时间
let
usedTime
=
endTime
-
startTime
;
// 相差的毫秒数
let
days
=
Math
.
floor
(
usedTime
/
(
24
*
3600
*
1000
));
// 计算出天数
let
leavel
=
usedTime
%
(
24
*
3600
*
1000
);
// 计算天数后剩余的时间
let
hours
=
Math
.
floor
(
leavel
/
(
3600
*
1000
));
// 计算剩余的小时数
if
(
days
>
0
){
if
(
leavel
>
0
){
this
.
intervalDay
=
days
+
1
+
'天'
}
else
{
this
.
intervalDay
=
days
+
'天'
}
}
else
{
if
(
hours
>=
6
){
this
.
intervalDay
=
'1天'
}
else
{
this
.
intervalDay
=
'半天'
}
}
}
this
.
init
()
//商品详情
this
.
getAppletGoodsCommentPageList
()
//获取商品评论数
let
u
=
uni
.
getStorageSync
(
"mall_UserInfo"
);
...
...
@@ -320,6 +358,35 @@
}
);
},
getTime(time){
let myDate = new Date(time);
let obj = {}
obj.year = myDate.getFullYear(); //年
obj.month = myDate.getMonth() + 1; //月
obj.day = myDate.getDate(); //日
obj.hour = myDate.getHours(); //时
obj.minute = myDate.getMinutes(); //分
let days = myDate.getDay();
obj.week = this.getweek(days)//星期几
return obj
},
getweek(day){//根据值返回当前时间的星期几
if(day==1){
return '
星期一
'
}else if(day==2){
return '
星期二
'
}else if(day==3){
return '
星期三
'
}else if(day==4){
return '
星期四
'
}else if(day==5){
return '
星期五
'
}else if(day==6){
return '
星期六
'
}else if(day==0){
return '
星期日
'
}
},
getAppletGoodsCommentPageList(){
this.request2(
{
...
...
@@ -378,7 +445,7 @@
//跳转
goUrl(){
uni.navigateTo({
url:'
/
pages
/
guidecar
/
place_order
'
url:'
/
pages
/
guidecar
/
place_order
?
GoodsId
=
'+this.GoodsId+'
&
Number
=
'+this.g.ride_num+'
&
ShoppingAddress
=
'+this.address
})
}
...
...
pages/guidecar/guidecarList.vue
View file @
f1b8a809
...
...
@@ -13,7 +13,6 @@
<span
class=
'ztext'
>
{{
ETime
.
month
}}
月
{{
ETime
.
day
}}
日
</span>
<span
class=
'titext'
>
{{
ETime
.
week
+
' '
+
ETime
.
hour
+
':'
+
ETime
.
minute
}}
</span>
</view>
</div>
<view
style=
"padding: 10px 0 0;position: relative;background: #fff;width: 100%;height: 55px;"
>
<view
style=
" border-bottom: 1px solid #E2E2E2;"
>
...
...
@@ -34,7 +33,7 @@
</view>
</view>
<div
style=
'display: flex;width: 100%;'
>
<div
style=
'display: flex;width: 100%;
overflow: hidden;overflow-y: auto;
'
>
<view
v-if=
"screenshow==true"
class=
"Mask"
@
click=
"screenshow=false"
></view>
<div
class=
"left-slider"
>
<sidebar
...
...
@@ -120,6 +119,7 @@ export default {
classList
:[],
current
:
0
,
screenshow
:
false
,
Pickcar
:
''
,
tic
:
0
,
msg
:{
pageIndex
:
1
,
...
...
@@ -152,6 +152,7 @@ export default {
STime
:
''
,
ETime
:
''
,
intervalDay
:
''
,
address
:
''
,
//出发地址
BrandList
:[],
//品牌列表
g
:
[],
page_count
:
1
,
...
...
@@ -176,16 +177,38 @@ export default {
this
.
msg
.
RegionIds
=
item
.
RegionIds
this
.
msg
.
RideNum
=
item
.
RideNum
this
.
msg
.
StartTime
=
item
.
StartTime
}
if
(
options
&&
options
.
STime
){
this
.
STime
=
JSON
.
parse
(
decodeURIComponent
(
options
.
STime
))
this
.
STime
=
this
.
getTime
(
item
.
StartTime
)
this
.
ETime
=
this
.
getTime
(
item
.
EndTime
)
let
startTime
=
new
Date
(
this
.
msg
.
StartTime
);
// 开始时间
let
endTime
=
new
Date
(
this
.
msg
.
EndTime
);
// 结束时间
let
usedTime
=
endTime
-
startTime
;
// 相差的毫秒数
let
days
=
Math
.
floor
(
usedTime
/
(
24
*
3600
*
1000
));
// 计算出天数
let
leavel
=
usedTime
%
(
24
*
3600
*
1000
);
// 计算天数后剩余的时间
let
hours
=
Math
.
floor
(
leavel
/
(
3600
*
1000
));
// 计算剩余的小时数
if
(
days
>
0
){
if
(
leavel
>
0
){
this
.
intervalDay
=
days
+
1
+
'天'
}
else
{
this
.
intervalDay
=
days
+
'天'
}
}
else
{
if
(
hours
>=
6
){
this
.
intervalDay
=
'1天'
}
else
{
this
.
intervalDay
=
'半天'
}
if
(
options
&&
options
.
ETime
){
this
.
ETime
=
JSON
.
parse
(
decodeURIComponent
(
options
.
ETime
))
}
if
(
options
&&
options
.
intervalDay
){
this
.
intervalDay
=
options
.
intervalDay
}
if
(
options
&&
options
.
address
){
this
.
address
=
options
.
address
}
if
(
options
&&
options
.
Pickcar
){
this
.
Pickcar
=
options
.
Pickcar
}
if
(
options
&&
options
.
tic
){
this
.
tic
=
options
.
tic
...
...
@@ -224,6 +247,36 @@ export default {
}
);
},
getTime
(
time
){
let
myDate
=
new
Date
(
time
);
let
obj
=
{}
obj
.
year
=
myDate
.
getFullYear
();
//年
obj
.
month
=
myDate
.
getMonth
()
+
1
;
//月
obj
.
day
=
myDate
.
getDate
();
//日
obj
.
hour
=
myDate
.
getHours
();
//时
obj
.
minute
=
myDate
.
getMinutes
();
//分
let
days
=
myDate
.
getDay
();
obj
.
week
=
this
.
getweek
(
days
)
//星期几
return
obj
},
getweek
(
day
){
//根据值返回当前时间的星期几
if
(
day
==
1
){
return
'星期一'
}
else
if
(
day
==
2
){
return
'星期二'
}
else
if
(
day
==
3
){
return
'星期三'
}
else
if
(
day
==
4
){
return
'星期四'
}
else
if
(
day
==
5
){
return
'星期五'
}
else
if
(
day
==
6
){
return
'星期六'
}
else
if
(
day
==
0
){
return
'星期日'
}
},
getGuideCarBrandList
(){
this
.
request2
(
{
...
...
@@ -297,7 +350,10 @@ getGuideCarBrandList(){
},
goDetails
(
x
){
//跳转商品详情
uni
.
navigateTo
({
url
:
'/pages/guidecar/guidecarOrderdetails?GoodsId='
+
x
.
id
url
:
'/pages/guidecar/guidecarGoodsdetails?GoodsId='
+
x
.
id
+
'&address='
+
this
.
address
+
'&Pickcar='
+
this
.
Pickcar
+
'&StartTime='
+
this
.
msg
.
StartTime
+
'&EndTime='
+
this
.
msg
.
EndTime
})
},
lower
(
e
)
{
...
...
pages/guidecar/index.vue
View file @
f1b8a809
...
...
@@ -34,7 +34,7 @@
</view>
<view
class=
"topB"
v-if=
"info.IsShowCarpooling==1&& msg.CarType==5"
style=
"align-items: center;"
>
<span
class=
'titext'
>
是否拼车
</span>
<u-switch
v-model=
"
msg.IsSpell"
size=
'30'
active-value=
"1"
inactive-value=
"2"
></u-switch>
<u-switch
v-model=
"
Ischecked"
size=
'30'
@
change=
'goIsSpell'
></u-switch>
</view>
</view>
<view
class=
"c_row"
>
...
...
@@ -160,6 +160,7 @@
<
script
>
import
AddressParse
from
'../address/zh-address-parse.min.js'
import
amap
from
'./components/amap-wx.js'
export
default
{
data
(){
return
{
...
...
@@ -184,6 +185,7 @@
ETime
:{},
//显示的结束时间
intervalDay
:
''
,
//间隔天数
address
:
''
,
//详情地址
Ischecked
:
false
,
msg
:{
StartTime
:
''
,
//取车时间
EndTime
:
''
,
//还车时间
...
...
@@ -203,6 +205,8 @@
minute
:
true
,
},
amapPlugin
:
null
,
key
:
'c785085c46d1eb41b1ebe8d1ec7fd945'
}
},
created
()
{
...
...
@@ -231,8 +235,23 @@
this
.
init
()
//获取司导首页配置
this
.
getCarClassList
()
//车辆分类下拉
this
.
getOrderListExportEnumList
()
//获取出行类型
this
.
amapPlugin
=
new
amap
.
AMapWX
({
key
:
this
.
key
});
this
.
getRegeo
()
},
methods
:{
getRegeo
()
{
uni
.
showLoading
({
title
:
'获取信息中'
});
this
.
amapPlugin
.
getRegeo
({
success
:
(
data
)
=>
{
this
.
Pickcar
=
data
[
0
].
regeocodeData
.
addressComponent
.
city
uni
.
hideLoading
();
}
});
}
,
init
(){
uni
.
showLoading
({
title
:
"加载中"
,
...
...
@@ -282,6 +301,9 @@
}
);
},
getPickcar
(
Name
){
//选择取消地址
this
.
Pickcar
=
Name
},
radioChange
(
item
){
//车辆类型
this
.
carName
=
item
.
Name
;
this
.
msg
.
CarClass
=
item
.
Id
;
...
...
@@ -304,6 +326,13 @@
delta
:
1
,
});
},
goIsSpell
(
val
){
if
(
val
==
true
){
this
.
msg
.
IsSpell
=
1
}
else
{
this
.
msg
.
IsSpell
=
2
}
},
btnStart
(
val
){
if
(
this
.
timeType
==
1
){
//出行时间的选择
this
.
msg
.
StartTime
=
val
.
year
+
'-'
+
val
.
month
+
'-'
+
val
.
day
+
' '
+
val
.
hour
+
':'
+
val
.
minute
+
':00'
;
...
...
@@ -403,25 +432,20 @@
url
:
'/pages/guidecar/pickcarcity'
})
},
goList
(){
let
that
=
this
let
msg
=
that
.
msg
let
tic
=
0
;
that
.
classList
.
forEach
((
x
,
i
)
=>
{
if
(
x
.
Id
==
that
.
msg
.
CarClass
){
if
(
x
.
Id
==
msg
.
CarClass
){
tic
=
i
+
1
console
.
log
(
tic
)
}
})
uni
.
navigateTo
({
url
:
"/pages/guidecar/guidecarList?item="
+
encodeURIComponent
(
JSON
.
stringify
(
that
.
msg
))
+
'&STime='
+
encodeURIComponent
(
JSON
.
stringify
(
that
.
STime
))
+
'&ETime='
+
encodeURIComponent
(
JSON
.
stringify
(
that
.
ETime
))
+
'&intervalDay='
+
that
.
intervalDay
+
'&tic='
+
tic
+
'&address='
+
that
.
address
url
:
"/pages/guidecar/guidecarList?item="
+
encodeURIComponent
(
JSON
.
stringify
(
msg
))
+
'&tic='
+
tic
+
'&address='
+
that
.
address
+
'&Pickcar='
+
that
.
Pickcar
});
}
}
}
</
script
>
...
...
pages/guidecar/pickcarcity.vue
View file @
f1b8a809
...
...
@@ -16,7 +16,7 @@
</view>
<view
class=
"kaitong"
>
<div
style=
'width: 100%;'
><span
style=
'color: #9A9A9A;font-size: 12px;'
>
已开通城市
</span></div>
<view
v-for=
"(item, index) in RegionList"
:key=
"index"
class=
"region"
@
click=
"goback(item)"
>
<view
v-for=
"(item, index) in RegionList"
:key=
"index"
class=
"region"
@
click=
"goback(item
,1
)"
>
{{
item
.
RegionName
}}
</view>
</view>
...
...
@@ -25,7 +25,7 @@
<u-index-list
:scrollTop=
"scrollTop"
>
<view
v-for=
"(item, index) in indexList"
:key=
"index"
>
<u-index-anchor
:index=
"item.ti"
/>
<view
class=
"list-cell"
v-for=
"(x,y) in item.children"
:key=
'y'
@
click=
"goback(x)"
>
<view
class=
"list-cell"
v-for=
"(x,y) in item.children"
:key=
'y'
@
click=
"goback(x
,2
)"
>
{{
x
.
Name
}}
</view>
...
...
@@ -115,8 +115,25 @@
onPageScroll
(
e
)
{
this
.
scrollTop
=
e
.
scrollTop
;
},
goback
(
item
){
console
.
log
(
item
)
goback
(
item
,
type
){
let
Name
if
(
type
==
1
){
Name
=
item
.
RegionName
}
else
{
Name
=
item
.
Name
}
let
pages
=
getCurrentPages
();
// 当前页面
let
beforePage
beforePage
=
pages
[
pages
.
length
-
2
];
// 前一个页面
setTimeout
(()
=>
{
uni
.
navigateBack
({
delta
:
1
,
success
:
function
()
{
beforePage
.
$vm
.
getPickcar
(
Name
);
// 执行前一个页面的方法
}
});
},
100
)
},
searchHandler
(
val
){
console
.
log
(
val
)
...
...
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