Commit d419b5a6 authored by shilei's avatar shilei

添加地图模式

parent ac5ba8cb
...@@ -10,12 +10,15 @@ ...@@ -10,12 +10,15 @@
:style="item.chooseState ? 'background: #F2F2F2' : ''" :style="item.chooseState ? 'background: #F2F2F2' : ''"
> >
<view class="item-right-list-name">{{ item.dictLabel }} </view> <view class="item-right-list-name">{{ item.dictLabel }} </view>
<image <div v-if="item.chooseState" class="item-right-list-img">
<u-icon name="checkmark" color="#4374EF"></u-icon>
</div>
<!-- <image
v-if="item.chooseState" v-if="item.chooseState"
class="item-right-list-img" class="item-right-list-img"
src="/static/dropDown/select.png" src="/static/dropDown/select.png"
> >
</image> </image> -->
</view> </view>
</scroll-view> </scroll-view>
<view class="btn-list"> <view class="btn-list">
...@@ -176,6 +179,8 @@ export default { ...@@ -176,6 +179,8 @@ export default {
right: 22rpx; right: 22rpx;
width: 80rpx; width: 80rpx;
height: 80rpx; height: 80rpx;
display: flex;
align-items: center;
} }
} }
} }
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
flex-shrink: 0; flex-shrink: 0;
" "
class="flex align-center" class="flex align-center"
@click="changeMode"
> >
<image <image
src="/static/img/icon-exchange.png" src="/static/img/icon-exchange.png"
...@@ -56,29 +57,51 @@ ...@@ -56,29 +57,51 @@
:top="166" :top="166"
></dropdown-vue> ></dropdown-vue>
<div style="height: 246rpx"></div> <div style="height: 246rpx"></div>
<view class="tab-contant"> <div v-if="mode === 'list'">
<view <view class="tab-contant">
class="media-card" <view
v-for="cardInfo in dataList" class="media-card"
:key="cardInfo.id" v-for="cardInfo in dataList"
@click="toDetail(cardInfo)" :key="cardInfo.id"
> @click="toDetail(cardInfo)"
<park-card-vue :key-words="keyWords" :detail="cardInfo" v-if="activeBar == 0"></park-card-vue> >
<land-card-vue :key-words="keyword" :detail="cardInfo" v-if="activeBar == 1"></land-card-vue> <park-card-vue :key-words="keyWords" :detail="cardInfo" v-if="activeBar == 0"></park-card-vue>
<carrier-card-vue :key-words="keyword" :detail="cardInfo" v-if="activeBar == 2"></carrier-card-vue> <land-card-vue :key-words="keyword" :detail="cardInfo" v-if="activeBar == 1"></land-card-vue>
<carrier-card-vue :key-words="keyword" :detail="cardInfo" v-if="activeBar == 2"></carrier-card-vue>
</view>
</view> </view>
</view> <u-loadmore
<u-empty v-if="dataList.length && (!haveMore || isLoading)"
icon="/static/img/empty_list.png" :status="isLoading ? 'loading' : 'nomore'"
v-if="dataList.length === 0" nomore-text="没有更多了"
width="300" loading-text="加载数据中"
height="300" marginTop="30"
textSize="26" marginBottom="30"
text="暂无查询内容" fontSize="20rpx"
textColor="#BDBDBD" color="#999999"
marginTop="120" line
> />
</u-empty> <u-empty
icon="/static/img/empty_list.png"
v-if="dataList.length === 0 && !isLoading"
width="300"
height="300"
textSize="26"
text="暂无查询内容"
textColor="#BDBDBD"
marginTop="120"
>
</u-empty>
</div>
<div v-else>
<map id="mapId" @markertap="handleMarkerClick" @callouttap="handleMarkerClick" :scale='10' style="width: 100%;height: calc(100vh - 246rpx)" latitude="31.464086" longitude="116.944909" class="map" :markers="markers">
</map>
<div v-if="activeInfo.id" :key="activeInfo.id" @click="toDetail(activeInfo)" style="position: fixed;padding: 0 30rpx;bottom: 30rpx;width: 100vw;z-index: 999;box-sizing: border-box;">
<park-card-vue :key="activeInfo.id" :key-words="keyWords" :detail="activeInfo" v-if="activeBar == 0"></park-card-vue>
<land-card-vue :key="activeInfo.id" :key-words="keyword" :detail="activeInfo" v-if="activeBar == 1"></land-card-vue>
<carrier-card-vue :key="activeInfo.id" :key-words="keyword" :detail="activeInfo" v-if="activeBar == 2"></carrier-card-vue>
</div>
</div>
</view> </view>
</template> </template>
...@@ -175,7 +198,9 @@ export default { ...@@ -175,7 +198,9 @@ export default {
itemList4: [], itemList4: [],
}, },
searchKey: '', searchKey: '',
keyWords: '' keyWords: '',
mode: 'list',
activeInfo: {}
}; };
}, },
mounted() { mounted() {
...@@ -203,6 +228,7 @@ export default { ...@@ -203,6 +228,7 @@ export default {
if (!this.haveMore) return; if (!this.haveMore) return;
this.isLoading = true; this.isLoading = true;
let searchCondition = {}; let searchCondition = {};
this.activeInfo = {};
this.keyWords = this.searchKey; this.keyWords = this.searchKey;
// this.filterChoice.map(item => { // this.filterChoice.map(item => {
// searchCondition[item.dictType] = item.dictValue; // searchCondition[item.dictType] = item.dictValue;
...@@ -230,6 +256,7 @@ export default { ...@@ -230,6 +256,7 @@ export default {
this.dataList.push(...res.records); this.dataList.push(...res.records);
this.haveMore = this.haveMore =
this.dataList.length < res.total; this.dataList.length < res.total;
}, },
}); });
}, },
...@@ -294,12 +321,47 @@ export default { ...@@ -294,12 +321,47 @@ export default {
this.pageNum = 1; this.pageNum = 1;
this.haveMore = true; this.haveMore = true;
this.getList(); this.getList();
},
// 模式切换
changeMode() {
this.mode = this.mode === 'list' ? 'map' : 'list';
this.activeInfo = {};
},
handleMarkerClick(e) {
console.log('handleMarkerClick', e)
this.activeInfo = {}
const temp = this.dataList.filter(item => item.id === e.detail.markerId)[0];
console.log(temp)
setTimeout(() => {
this.$set(this, 'activeInfo', temp)
})
console.log(this.activeInfo)
} }
}, },
computed: { computed: {
filterEnum() { filterEnum() {
return store.state.filterEnum; return store.state.filterEnum;
}, },
markers() {
let temp = [];
this.dataList.forEach(item => {
temp.push({
id: item.id,
latitude: item.latitude,
longitude: item.longitude,
width: 25,
height: 36,
callout: {
content: item.name,
padding: 5,
display: 'ALWAYS',
textAlign: 'center'
}
})
})
return temp || []
}
}, },
watch: { watch: {
refreshCollectionPage(newVal) { refreshCollectionPage(newVal) {
...@@ -320,6 +382,9 @@ export default { ...@@ -320,6 +382,9 @@ export default {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.container {
padding-bottom: 30rpx;
}
.tab_bar { .tab_bar {
border-bottom: 1rpx solid #fff; border-bottom: 1rpx solid #fff;
display: flex; display: flex;
......
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