请问怎么将这个图片改成使用高德地图或者百度地图显示起点和终点,并显示路线
代码是这样的,请问怎么改,帮帮忙
<div class="list" :style='{"width":"100%","margin":"0","background":"none","order":"3"}'>
<!-- 样式一 -->
<div class="list1 index-pv1" :style='{"border":"1px solid #ffc800","padding":"30px 20px 20px","boxShadow":"0px 0px 0px #ddd,inset 0px 0px 30px 0px #fbf5db","margin":"20px 0 0 0","overflow":"hidden","borderRadius":"16px","flexWrap":"wrap","background":"#fff","display":"block","width":"calc(100% - 2px)","justifyContent":"space-around","height":"auto"}'>
<div :style='{"margin":"0 0 30px 2%","borderRadius":"8px","flexWrap":"wrap","background":"none","display":"flex","width":"31%","position":"relative","float":"left","height":"auto"}' v-for="(item, index) in dataList" :key="index" @click="toDetail(item)" class="list-item animation-box">
<img :style='{"cursor":"pointer","padding":"8px","borderColor":"#ffa100","margin":"0 0 10px","objectFit":"cover","borderRadius":"20%","borderWidth":"3px","background":"#f5f6cb","display":"block","width":"100%","borderStyle":"dotted dashed solid double","height":"274px"}' v-if="item.tupian && item.tupian.substr(0,4)=='http'" :src="item.tupian" class="image" />
<img :style='{"cursor":"pointer","padding":"8px","borderColor":"#ffa100","margin":"0 0 10px","objectFit":"cover","borderRadius":"20%","borderWidth":"3px","background":"#f5f6cb","display":"block","width":"100%","borderStyle":"dotted dashed solid double","height":"274px"}' v-else :src="baseUrl + (item.tupian?item.tupian.split(',')[0]:'')" class="image" />
<div v-if="item.price" :style='{"padding":"0 10px","boxShadow":"1px 1px 1px #ddd","margin":"0 auto","color":"red","borderRadius":"20% ","textAlign":"center","background":"#f6f6f6","width":"76%","lineHeight":"30px","fontSize":"14px","order":"3"}' class="price"><span :style='{"fontSize":"12px"}'>¥</span>{{item.price}}</div>
<div :style='{"padding":"0 10px","boxShadow":"0px 2px 0px #f1e288","margin":"0 auto 10px","whiteSpace":"nowrap","color":"#333","textAlign":"center","overflow":"hidden","borderRadius":"20% ","background":"#f6f6f6","width":"76%","lineHeight":"30px","fontSize":"14px","textOverflow":"ellipsis"}' class="name ">{{item.luxianmingcheng}}</div>
<div :style='{"padding":"0 10px","boxShadow":"0px 2px 0px #f1e288","margin":"0 auto 10px","whiteSpace":"nowrap","color":"#333","textAlign":"center","overflow":"hidden","borderRadius":"20% ","background":"#f6f6f6","width":"76%","lineHeight":"30px","fontSize":"14px","textOverflow":"ellipsis"}' class="name ">{{item.jingdianmingcheng}}</div>
<div :style='{"padding":"0 10px","boxShadow":"0px 2px 0px #f1e288","margin":"0 auto 10px","whiteSpace":"nowrap","color":"#333","textAlign":"center","overflow":"hidden","borderRadius":"20% ","background":"#f6f6f6","width":"76%","lineHeight":"30px","fontSize":"14px","textOverflow":"ellipsis"}' class="name ">{{item.chuxingfangshi}}</div>
</div>
</div>
<!-- 样式二 -->
</div>
<el-pagination
background
class="pagination"
:pager-count="7"
:page-size="pageSize"
:page-sizes="pageSizes"
prev-text="<"
next-text=">"
:hide-on-single-page="true"
:layout='["total","prev","pager","next","sizes","jumper"].join()'
:total="total"
:style='{"padding":"0","margin":"10px auto","whiteSpace":"nowrap","color":"#333","width":"1200px","fontWeight":"500","order":"4"}'
@current-change="curChange"
@size-change="sizeChange"
@prev-click="prevClick"
@next-click="nextClick"
></el-pagination>
</div>
</div>
</template>
<script>
export default {
//数据集合
data() {
return {
layouts: '',
swiperIndex: -1,
baseUrl: '',
breadcrumbItem: [
{
name: '旅游路线'
}
],
formSearch: {
luxianmingcheng: '',
jingdianmingcheng: '',
chuxingfangshi: '',
qidian: '',
tujingluduan: '',
},
fenlei: [],
dataList: [],
total: 1,
pageSize: 12,
pageSizes: [10,20,30,50],
totalPage: 1,
curFenlei: '全部',
isPlain: false,
indexQueryCondition: '',
jingdianmingchengOptions: [],
chuxingfangshiOptions: [],
timeRange: []
}
},
created() {
this.indexQueryCondition = this.$route.query.indexQueryCondition ? this.$route.query.indexQueryCondition : '';
this.baseUrl = this.$config.baseUrl;
this.$http.get('option/lvyoujingdian/jingdianmingcheng').then(res => {
if (res.data.code == 0) {
this.jingdianmingchengOptions = res.data.data;
}
});
this.chuxingfangshiOptions = '自由行,跟团游,游轮,其他'.split(',');
this.getFenlei();
this.getList(1, '全部');
},
//方法集合
methods: {
// add(path) {
// this.$router.push({path: path});
// },
getFenlei() {
this.$http.get('option/lvyoujingdian/jingdianmingcheng').then(res => {
if (res.data.code == 0) {
this.fenlei = res.data.data;
}
});
},
getList(page, fenlei, ref = '') {
if(fenlei == '全部') this.swiperIndex = -1;
for(let i=0;i<this.fenlei.length;i++) {
if(fenlei == this.fenlei[i]) {
this.swiperIndex = i;
break;
}
}
this.curFenlei = fenlei;
if (this.curFenlei == '全部') {
this.isPlain = false;
} else {
this.isPlain = true;
}
let params = {page, limit: this.pageSize};
let searchWhere = {};
if (this.formSearch.luxianmingcheng != '') searchWhere.luxianmingcheng = '%' + this.formSearch.luxianmingcheng + '%';
if (this.formSearch.jingdianmingcheng != '') searchWhere.jingdianmingcheng = this.formSearch.jingdianmingcheng;
if (this.formSearch.chuxingfangshi != '') searchWhere.chuxingfangshi = this.formSearch.chuxingfangshi;
if (this.formSearch.qidian != '') searchWhere.qidian = '%' + this.formSearch.qidian + '%';
if (this.formSearch.tujingluduan != '') searchWhere.tujingluduan = '%' + this.formSearch.tujingluduan + '%';
if (this.curFenlei != '全部') searchWhere.jingdianmingcheng = this.curFenlei;
this.$http.get('lvyouluxian/list', {params: Object.assign(params, searchWhere)}).then(res => {
if (res.data.code == 0) {
this.dataList = res.data.data.list;
this.total = res.data.data.total;
this.pageSize = res.data.data.pageSize;
this.totalPage = res.data.data.totalPage;
this.pageSizes = [this.pageSize, this.pageSize*2, this.pageSize*3, this.pageSize*5];
}
});
},
curChange(page) {
this.getList(page,this.curFenlei);
},
prevClick(page) {
this.getList(page,this.curFenlei);
},
sizeChange(size){
this.pageSize = size
this.getList(1,this.curFenlei);
},
nextClick(page) {
this.getList(page,this.curFenlei);
},
toDetail(item) {
this.$router.push({path: '/index/lvyouluxianDetail', query: {detailObj: JSON.stringify(item)}});
},
}
}
</script>