Commit eb7b4ef9 authored by mzx's avatar mzx

首页接口对接

parent 94e5275f
import request from '@/utils/request'
// 获取企业首页信息
export function carListInforma(query) {
return request({
url: '/car-info/list-all',
method: 'get',
params: query
})
}
// 首页地图车辆信息
export function carList(query) {
return request({
url: '/enterprise-info/index-info/car-list',
method: 'get',
params: query
})
}
<template>
<!-- 首页 -->
<div class="app-container home">
<div class="home-content">
<div class="home-content-left" ref="homeContentLeft">
<div ref="homeContentLeft" class="home-content-left">
<div class="home-content-left-item">
<el-card>
<el-button @click="get">获取</el-button>
</el-card>
</div>
</div>
<baidu-map class="bm-view" center="天津市滨海新区" :zoom="zoom" scroll-wheel-zoom @ready="handler">
<bm-boundary name="天津市滨海新区" :strokeWeight="3" strokeStyle="dashed" strokeColor="blue" fillColor="" ></bm-boundary>
<bm-marker v-for="(item,index) in markerPoint"
:position="item"
:icon="{url: require('../assets/images/profile.jpg'), size: {width: 24, height: 24}}" ></bm-marker>
<bm-boundary name="天津市滨海新区" :stroke-weight="3" stroke-style="dashed" stroke-color="blue" fillColor=""/>
<bm-marker
v-for="(item,index) in markerPoint"
:position="item"
:icon="{url: require('../assets/images/cheliang.png'), size: {width: 24, height: 24}}"
@click="handlerCar(item)"
/>
</baidu-map>
</div>
<div style="padding-left: 20px; width: 30%; height: 100%; vertical-align: top; display: inline-block">
<div style="display: contents">
<div style=" height: 33%">
<el-card style="height: 100%; padding-bottom: 10px">
1
</el-card>
</div>
<div style=" height: 33%; padding: 10px 0px">
<el-card style="height: 100%">
2
</el-card>
</div>
<div style=" height: 33%">
<el-card style="height: 100%; padding-top: 10px">
3
</el-card>
</div>
</div>
</div>
</div>
</template>
<script>
import { carList, carListInforma } from '@/api/homePage'
export default {
name: 'Index',
data() {
......@@ -31,9 +55,32 @@ export default {
}
},
mounted() {
this.markerPoint = [{ lng: '117.20809', lat: '39.09110' }]
// this.markerPoint = [{ lng: '117.777222', lat: '39.004369' }]
this.getCarList() // 获取全部车辆信息
this.getInformation()
},
methods: {
get() {
this.getCarList()
this.getInformation()
},
/** 车辆图标按钮点击操作 */
handlerCar(data) {
console.log('data', data)
},
/** 获取全部车辆信息方法 */
getCarList() {
carList().then(response => {
console.log('response.data', response.data)
this.markerPoint = response.data
})
},
/** 获取企业首页信息 */
getInformation() {
carListInforma().then(response => {
})
},
handler({ BMap, map }) {
this.BMap = BMap
this.map = map
......@@ -74,6 +121,7 @@ export default {
}
}
.home-content{
display: inline-block;
position: relative;
width: 70%;
//height: calc(1080px - 109px);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment