Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
上
上药订单生命周期升级
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
sph
上药订单生命周期升级
Commits
8cdd79ef
Commit
8cdd79ef
authored
Mar 10, 2021
by
琉璃丶c
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.添加物流step组件
2.修改了高德地图版本号 3.新增了3个公共颜色
parent
84620257
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
292 additions
and
83 deletions
+292
-83
src/assets/styles/variable.scss
src/assets/styles/variable.scss
+6
-0
src/components/MapView.vue
src/components/MapView.vue
+32
-72
src/main.js
src/main.js
+1
-1
src/views/myOrder/components/logisticsStep.vue
src/views/myOrder/components/logisticsStep.vue
+32
-0
src/views/myOrder/components/stepItem.vue
src/views/myOrder/components/stepItem.vue
+137
-0
src/views/myOrder/detail/logisticsDetail.vue
src/views/myOrder/detail/logisticsDetail.vue
+84
-10
No files found.
src/assets/styles/variable.scss
View file @
8cdd79ef
...
@@ -29,8 +29,14 @@ $arrowC:#747782;
...
@@ -29,8 +29,14 @@ $arrowC:#747782;
$txtBlack
:
#23262A
;
$txtBlack
:
#23262A
;
$txtGray
:
#8792A4
;
$txtGray
:
#8792A4
;
// 线颜色
$line
:
#eeeeee
;
// 文字色
$txtGray9
:
#999999
;
$txtGrayL
:
#D3D3D3
;
//订单状态颜色
//订单状态颜色
$orderReturn
:
#D9001B
;
$orderReturn
:
#D9001B
;
$orderJm
:
#02a7f0
;
$orderJm
:
#02a7f0
;
$orderCold
:
#4b7902
;
$orderCold
:
#4b7902
;
src/components/MapView.vue
View file @
8cdd79ef
<
template
>
<
template
>
<div
id=
"mapView"
>
<div
class=
"amap-container"
>
<!--
<div
id=
"container"
style=
"width:100%;height:400px"
></div>
-->
<el-amap
<el-amap
:plugin=
"plugin"
vid=
"amap-order"
:amap-manager=
"amapManager"
class =
"amap-box"
:zoom=
"zoom"
:resizeEnable=
"mapInfo.resizeEnable"
:center=
"center"
:amap-manager=
"mapInfo.amapManager"
vid=
"amapDemo"
:zoom=
"mapInfo.zoom"
ref=
"reds"
:center=
"mapInfo.center"
style=
"width:100vw;height:80vh"
:events=
"mapInfo.events"
:events=
"events"
></el-amap>
></el-amap>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
AMapManager
}
from
'
vue-amap
'
import
VueAMap
from
'
vue-amap
'
// var map = amapManager.getMap();
import
AMap
from
'
AMap
'
// 引入高德地图ui组件
// 引入高德地图ui组件
import
{
lazyAMapApiLoaderInstance
}
from
'
vue-amap
'
// eslint-disable-next-line import/no-duplicates
// import {lazyAMapApiLoaderInstance} from 'vue-amap'
// eslint-disable-next-line import/no-duplicates
import
VueAMap
from
'
vue-amap
'
//
let
amapManager
=
new
VueAMap
.
AMapManager
()
let
amapManager
=
new
VueAMap
.
AMapManager
()
export
default
{
export
default
{
...
@@ -33,52 +30,25 @@ export default {
...
@@ -33,52 +30,25 @@ export default {
}
}
},
},
data
()
{
data
()
{
let
_obj
=
this
return
{
return
{
status
:
this
.
value
,
mapInfo
:
{
amapManager
,
resizeEnable
:
true
,
// 是否监控地图容器尺寸变化
center
:
[
116.379028
,
39.865042
],
zoom
:
13
,
// 地图缩放
plugin
:
[
amapManager
,
{
center
:
[
116.379028
,
39.865042
],
pName
:
'
Scale
'
,
events
:
{
events
:
{
init
(
o
)
{
init
(
instance
)
{
// lazyAMapApiLoaderInstance.load().then(() => {
console
.
log
(
instance
)
//
}
// })
}
// eslint-disable-next-line no-undef
}
let
marker
=
new
AMap
.
Marker
({
// 点图标
],
position
:
[
116.379028
,
39.865042
]
zoom
:
13
,
events
:
{
init
(
o
)
{
// _obj.createMap();
o
.
setMapStyle
(
'
amap://styles/macaron
'
)
// 自定义的高德地图的样式,我选的是马卡龙
let
marker
=
new
AMap
.
Marker
({
// 点图标
position
:
[
116.379028
,
39.865042
]
})
// o.setZoomAndCenter(16, [116.379028, 39.865042])
marker
.
setMap
(
o
)
o
.
plugin
([
'
AMap.Driving
'
],
function
()
{
var
driving
=
new
AMap
.
Driving
({
map
:
o
,
showTraffic
:
false
// 是否显示拥堵状态
})
})
// 地点关键字+ 驾车路线规划
marker
.
setMap
(
o
)
driving
.
search
(
new
AMap
.
LngLat
(
116.379028
,
39.865042
),
new
AMap
.
LngLat
(
116.427281
,
39.903719
),
function
(
status
,
result
)
{
}
// result 即是对应的驾车导航信息,相关数据结构文档请参考 https://lbs.amap.com/api/javascript-api/reference/route-search#m_DrivingResult
if
(
status
===
'
complete
'
)
{
console
.
log
(
'
绘制驾车路线完成
'
)
}
else
{
console
.
log
(
'
获取驾车数据失败:
'
+
result
)
}
}
)
o
.
addControl
(
driving
)
})
}
}
},
}
marker
:
{},
map
:
{}
// 保存地图对象
}
}
},
},
watch
:
{
watch
:
{
...
@@ -87,19 +57,8 @@ export default {
...
@@ -87,19 +57,8 @@ export default {
}
}
},
},
mounted
()
{
mounted
()
{
this
.
createMapOne
()
},
},
methods
:
{
methods
:
{
// 创建地图
createMapOne
()
{
},
createMap
()
{
o
.
setMapStyle
(
'
amap://styles/macaron
'
)
// 自定义的高德地图的样式,我选的是马卡龙
let
marker
=
new
AMap
.
Marker
({
// 点图标
position
:
[
116.379028
,
39.865042
]
})
},
action
()
{
action
()
{
this
.
$emit
(
'
action
'
,
''
)
this
.
$emit
(
'
action
'
,
''
)
}
}
...
@@ -107,7 +66,8 @@ export default {
...
@@ -107,7 +66,8 @@ export default {
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
#MapView
{
.amap-container
{
// height: 44px;
height
:
300px
;
width
:
100%
;
}
}
</
style
>
</
style
>
src/main.js
View file @
8cdd79ef
...
@@ -14,7 +14,7 @@ Vue.use(VueAMap)
...
@@ -14,7 +14,7 @@ Vue.use(VueAMap)
VueAMap
.
initAMapApiLoader
({
VueAMap
.
initAMapApiLoader
({
key
:
'
061c2a328572b71e2b26d9dc1a0cc703
'
,
key
:
'
061c2a328572b71e2b26d9dc1a0cc703
'
,
plugin
:
[
'
AMap.Scale
'
,
'
AMap.OverView
'
,
'
AMap.ToolBar
'
,
'
AMap.MapType
'
,
'
AMap.PlaceSearch
'
,
'
AMap.Geolocation
'
,
'
AMap.Geocoder
'
],
plugin
:
[
'
AMap.Scale
'
,
'
AMap.OverView
'
,
'
AMap.ToolBar
'
,
'
AMap.MapType
'
,
'
AMap.PlaceSearch
'
,
'
AMap.Geolocation
'
,
'
AMap.Geocoder
'
],
v
:
'
1.4.4
'
,
v
:
'
2.0
'
,
uiVersion
:
'
1.0
'
uiVersion
:
'
1.0
'
})
})
// import './assets/styles/variable.scss'
// import './assets/styles/variable.scss'
...
...
src/views/myOrder/components/logisticsStep.vue
0 → 100644
View file @
8cdd79ef
<
template
>
<div
id=
"stepLayout"
>
<slot
:state=
"'history'"
></slot>
</div>
</
template
>
<
script
>
export
default
{
name
:
'
logisticsStep
'
,
props
:
{
active
:
{
type
:
Number
,
default
:
0
}
},
mounted
()
{
this
.
calcStepLine
()
},
methods
:
{
calcStepLine
()
{
let
lineEle
=
document
.
getElementsByClassName
(
'
state-line
'
)
if
(
lineEle
.
length
>
0
)
{
lineEle
[
lineEle
.
length
-
1
].
style
.
width
=
'
0px
'
}
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
</
style
>
src/views/myOrder/components/stepItem.vue
0 → 100644
View file @
8cdd79ef
<
template
>
<div
class=
"step-container"
:class=
"'type__'+stepState"
>
<div
class=
"step-time "
>
<div
class=
"step-date"
>
{{
stepInfo
.
date
}}
</div>
<div
class=
"step-hours"
>
{{
stepInfo
.
hours
}}
</div>
</div>
<div
class=
"step-tips"
>
<van-icon
class=
"state-icon"
name=
"smile"
/>
<div
class=
"state-line"
></div>
</div>
<div
class=
"step-content "
>
<div
class=
"step-type"
>
{{
stepInfo
.
type
}}
</div>
<div
class=
"step-text"
>
{{
stepInfo
.
text
}}
</div>
</div>
</div>
</
template
>
<
script
>
export
default
{
name
:
'
stepItem
'
,
data
()
{
return
{
state
:
'
normal
'
}
},
props
:
{
stepInfo
:
{
type
:
Object
,
default
:
()
=>
{
return
{
date
:
'
2020-03-10
'
,
hours
:
'
10:08:08
'
,
type
:
'
状态名称
'
,
text
:
'
内容信息
'
}
}
}
},
computed
:
{
stepState
:
function
()
{
return
this
.
$parent
.
$children
[
0
].
_uid
===
this
.
_uid
?
'
normal
'
:
'
history
'
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.step-container
{
display
:
flex
;
align-items
:
center
;
height
:
60px
;
//border-bottom: 1px solid $line;
/*时间 选中*/
.step-time
{
flex
:
1
.5
;
text-align
:
center
;
.step-date
{
color
:
$txtGray9
;
}
.step-hours
{
font-size
:
14px
;
font-weight
:
bold
;
color
:
$txtBlack
;
}
}
/*图标 连接线*/
.step-tips
{
flex
:
0
.5
;
font-size
:
18px
;
position
:relative
;
text-align
:
center
;
margin-top
:
-12px
;
.state-icon
{
z-index
:
100
;
color
:
$main1
}
.state-line
{
position
:
absolute
;
z-index
:
1
;
left
:
0
;
right
:
0
;
top
:
16px
;
width
:
2px
;
height
:
50px
;
margin
:
0
auto
;
background-size
:
2px
11px
;
background-repeat
:
repeat-y
;
background-image
:
linear-gradient
(
0deg
,
$txtGrayL
0%
,
$txtGrayL
50%
,
transparent
50%
);
}
}
/*内容 选中*/
.step-content
{
flex
:
5
;
margin-left
:
2px
;
.step-type
{
font-weight
:
bold
;
font-size
:
15px
;
}
.step-text
{
font-size
:
12px
;
color
:
$txtGray9
;
}
}
}
/*非选中 文字颜色*/
.type__history
{
.step-time
{
.step-date
{
color
:
$txtGrayL
;
}
.step-hours
{
color
:
$txtGrayL
;
}
}
.step-tips
{
.state-icon
{
color
:
$txtGrayL
}
}
.step-content
{
.step-type
{
color
:
$txtGrayL
;
}
.step-text
{
color
:
$txtGrayL
;
}
}
}
</
style
>
src/views/myOrder/detail/logisticsDetail.vue
View file @
8cdd79ef
<
template
>
<
template
>
<div
class=
"logistics-content"
>
<div
class=
"logistics-content"
>
<map-view/>
<map-view/>
<div
class=
"logistics-head"
>
<div
class=
"logistics-header"
>
<van-icon
:name=
"icons.logo"
/>
<div
class=
"header-title"
>
<span>
承运商: 绥德库
</span>
<van-icon
class=
"logistic-logo"
:name=
"icons.logo"
/>
<span>
市内
</span>
<span
class=
"logistic-name"
>
承运商:
<span
class=
"logistic-values"
>
绥德库
</span></span>
<span
class=
"logistic-type"
>
市内
</span>
</div>
<div
class=
"header-order-info"
style=
"margin-top: 8px"
>
运单号:
<span
class=
"logistic-values"
>
3902202102250062
</span></div>
<div
class=
"header-order-info"
style=
"margin-top:2px;margin-bottom:8px"
>
配送人:
<span
class=
"logistic-values"
>
罗平行 13300992222
</span></div>
</div>
<div
class=
"logistics-step-line"
>
<logistics-step>
<step-item
v-for=
"(item, index) in stepList"
:stepInfo =
item
:key=
"index"
/>
</logistics-step>
</div>
</div>
<div
>
运单号: 3902202102250062
</div>
<div
>
配送人: 罗平行 13300992222
</div>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
MapView
from
'
../../../components/MapView
'
import
MapView
from
'
../../../components/MapView
'
import
LogisticsStep
from
'
../components/logisticsStep
'
import
StepItem
from
'
../components/stepItem
'
export
default
{
export
default
{
name
:
'
logisticsDetail
'
,
name
:
'
logisticsDetail
'
,
components
:
{
MapView
},
components
:
{
StepItem
,
LogisticsStep
,
MapView
},
data
()
{
data
()
{
return
{
return
{
icons
:
{
icons
:
{
logo
:
require
(
'
@/assets/img/u48.png
'
)
logo
:
require
(
'
@/assets/img/u48.png
'
)
}
},
stepList
:
[
{
date
:
'
2020-03-10
'
,
hours
:
'
10:08:12
'
,
type
:
'
已签收
'
,
text
:
'
您的订单已完成签收,期待再次为您服务。
'
},
{
date
:
'
2020-03-10
'
,
hours
:
'
10:08:11
'
,
type
:
'
运输中
'
,
text
:
'
乘运商已提货,待运输。
'
},
{
date
:
'
2020-03-10
'
,
hours
:
'
10:08:10
'
,
type
:
'
运输中
'
,
text
:
'
您的订单正在配送途中,请耐心等待。
'
},
{
date
:
'
2020-03-10
'
,
hours
:
'
10:08:09
'
,
type
:
'
已发货
'
,
text
:
'
正在出库中...
'
},
{
date
:
'
2020-03-10
'
,
hours
:
'
10:08:08
'
,
type
:
'
已下单
'
,
text
:
'
正在为您积极打包
'
}
]
}
}
},
},
mounted
()
{
mounted
()
{
...
@@ -40,5 +80,39 @@ export default {
...
@@ -40,5 +80,39 @@ export default {
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.logistics-content
{
background-color
:
#fff
;
height
:
calc
(
100vh
-
46px
);
overflow
:
scroll
;
.logistics-header
{
border-bottom
:
1px
solid
$line
;
padding
:
10px
;
.header-title
{
display
:
flex
;
align-items
:
center
;
.logistic-logo
{
font-size
:
22px
;
margin-right
:
6px
;
}
.logistic-name
{
font-size
:
13px
;
font-weight
:
bold
;
flex
:
1
;
}
.logistic-type
{
border
:
1px
solid
$orderJm
;
color
:
$orderJm
;
padding
:
0
8px
;
transform
:
scale
(
0
.8
);
}
}
.header-order-info
{
font-size
:
13px
;
margin-left
:
28px
;
}
.logistic-values
{
margin-left
:
10px
;
}
}
}
</
style
>
</
style
>
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