Merge pull request '邓洁 page: 地图' (#18) from dengjie into master

Reviewed-on: http://git.feashow.cn/odjbin/city-store-transfer/pulls/18
This commit is contained in:
odjbin
2023-11-04 14:10:26 +00:00
6 changed files with 207 additions and 98 deletions

View File

@@ -1,24 +1,24 @@
<template> <template>
<view class="slide"> <view class="slide">
<view class="mask" @click.self="quitSlide"> <view class="mask" @click="quitSlide">
<view class="content" @click.stop> <view class="content" @click.stop>
<view class="container"> <view class="container">
<view class="content-1" @click="enterTransfer"> <view class="content-1" @click="enterTransfer">
<image src="/static/publish/fb_icon_dpzr.png" mode="aspectFit" class="selecter"></image> <image src="/static/publish/fb_icon_dpzr.png" mode="aspectFit" class="selecter"></image>
<text class="text">店铺转让</text> <text class="text">店铺转让</text>
</view> </view>
<view class="content-1" @click="enterAddress"> <view class="content-1" @click="enterAddress">
<image src="/static/publish/fb_icon_zdxz.png" mode="aspectFit" class="selecter"></image> <image src="/static/publish/fb_icon_zdxz.png" mode="aspectFit" class="selecter"></image>
<text class="text">找店选址</text> <text class="text">找店选址</text>
</view> </view>
<view class="content-1" @click="enterRent"> <view class="content-1" @click="enterRent">
<image src="/static/publish/fb_icon_dpcz.png" mode="aspectFit" class="selecter"></image> <image src="/static/publish/fb_icon_dpcz.png" mode="aspectFit" class="selecter"></image>
<text class="text">店铺出租</text> <text class="text">店铺出租</text>
</view> </view>
<view class="content-1" @click="enterInvestment"> <view class="content-1" @click="enterInvestment">
<image src="/static/publish/fb_icon_xmzs.png" mode="aspectFit" class="selecter"></image> <image src="/static/publish/fb_icon_xmzs.png" mode="aspectFit" class="selecter"></image>
<text class="text">项目招商</text> <text class="text">项目招商</text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
@@ -26,34 +26,34 @@
</template> </template>
<script> <script>
export default{ export default {
data(){ data() {
return{ return {
} }
}, },
methods:{ methods: {
quitSlide(){ quitSlide() {
this.$emit("quitSlide") this.$emit("quitSlide")
}, },
enterTransfer(){ enterTransfer() {
uni.navigateTo({ uni.navigateTo({
url:'/pages/publish/publishTransfer/publishTransfer' url: '/pages/publish/publishTransfer/publishTransfer'
}) })
}, },
enterAddress(){ enterAddress() {
uni.navigateTo({ uni.navigateTo({
url:'/pages/publish/publishAddress/publishAddress' url: '/pages/publish/publishAddress/publishAddress'
}) })
}, },
enterRent(){ enterRent() {
uni.navigateTo({ uni.navigateTo({
url:'/pages/publish/publishRent/publishRent' url: '/pages/publish/publishRent/publishRent'
}) })
}, },
enterInvestment(){ enterInvestment() {
uni.navigateTo({ uni.navigateTo({
url:'/pages/publish/publishInvestment/publishInvestment' url: '/pages/publish/publishInvestment/publishInvestment'
}) })
} }
} }
@@ -61,60 +61,65 @@
</script> </script>
<style lang="scss"> <style lang="scss">
.mask{ .mask {
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: #000000; background-color: #000000;
// opacity: 0.2; // opacity: 0.2;
// backdrop-filter:saturate(150%) blur(8px);模糊 // backdrop-filter:saturate(150%) blur(8px);模糊
-webkit-backdrop-filter:saturate(150%) blur(8px); -webkit-backdrop-filter: saturate(150%) blur(8px);
background-color:rgba(0,0,0,.3); background-color: rgba(0, 0, 0, .3);
z-index: 20; z-index: 20;
} }
.content{
position: fixed; .content {
transform: translate(-50%, -50%); position: fixed;
left: 50%; top: 40%; transform: translate(-50%, -50%);
height: 25%; left: 50%;
width: 90%; top: 40%;
background-color: #fff; height: 25%;
z-index: 40; width: 90%;
border-radius: 29rpx; background-color: #fff;
z-index: 40;
} border-radius: 29rpx;
.container{
height: 100%; }
width: 100%;
display: flex; .container {
justify-content: space-around; height: 100%;
align-items: center; width: 100%;
z-index: 50; display: flex;
} justify-content: space-around;
.content-1{ align-items: center;
// vertical-align: middle; z-index: 50;
height: auto; }
width: auto;
display: flex; .content-1 {
flex-direction: column; // vertical-align: middle;
justify-content: center; height: auto;
align-items: center; width: auto;
} display: flex;
.selecter{ flex-direction: column;
width: 49px; justify-content: center;
height: 49px; align-items: center;
z-index: 50; }
// background-color: red;
display: flex; .selecter {
flex-direction: column; width: 49px;
// background-color: red; height: 49px;
} z-index: 50;
.text{ // background-color: red;
font-size: 28rpx; display: flex;
display: block; flex-direction: column;
} // background-color: red;
}
.text {
font-size: 28rpx;
display: block;
}
</style> </style>

View File

@@ -8,7 +8,7 @@
} }
}, },
"pages": [ "pages": [
//pages数组中第一项表示应用启动页参考https://uniapp.dcloud.io/collocation/pages //pages数组中第一项表示应用启动页
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
@@ -21,6 +21,15 @@
"enablePullDownRefresh": true "enablePullDownRefresh": true
} }
}, },
{
"path": "pages/index/map/map",
"style": {
"navigationBarTitleText": "速配地图",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#339967",
"enablePullDownRefresh": false
}
},
{ {
"path": "pages/shopTransfer/shopTransfer", "path": "pages/shopTransfer/shopTransfer",
"style": { "style": {
@@ -30,7 +39,6 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
//+
{ {
"path": "pages/shopAddress/shopAddress", "path": "pages/shopAddress/shopAddress",
"style": { "style": {

View File

@@ -4,9 +4,9 @@
<TabBar :current-page="0"></TabBar> <TabBar :current-page="0"></TabBar>
<HomeNavCard></HomeNavCard> <HomeNavCard></HomeNavCard>
<view class="news-box"> <view class="news-box">
<u-notice-bar :text="newsTextLists" :bg-color="$uni-bg-color"></u-notice-bar> <u-notice-bar :text="newsText" bg-color="#ffffff"></u-notice-bar>
</view> </view>
<ShowShopList></ShowShopList> <ShowShopList></ShowShopList>
</view> </view>
</template> </template>
@@ -18,12 +18,7 @@
}, },
data() { data() {
return { return {
newsTextLists: [ newsText: '寒雨连江夜入吴'
'寒雨连江夜入吴',
'平明送客楚山孤',
'洛阳亲友如相问',
'一片冰心在玉壶'
],
} }
}, },
onLoad() { onLoad() {
@@ -40,5 +35,4 @@
background-color: $uni-bg-color-grey; background-color: $uni-bg-color-grey;
width: 100%; width: 100%;
} }
</style> </style>

102
pages/index/map/map.vue Normal file
View File

@@ -0,0 +1,102 @@
<template>
<view>
<view class="search-box">
<view class="search-box-input">
<u-input placeholder="热门店铺" placeholder-style="color: #888888" prefixIcon="search"
prefixIconStyle="font-size: 24px;color: #888888;" border="true">
</u-input>
</view>
</view>
<view class="content">
<map id="map" @markertap="markerClick" class="map" :markers="marker" :show-location="true" :latitude="lat"
:longitude="lng"></map>
</view>
</view>
</template>
<script>
export default {
data() {
return {
lat: '30.57',
lng: '104.07',
marker: []
}
},
async onShow() {
// await this.getLifeTypeList();
// await this.getStatusCode()
// if (!this.lat && !this.lng) {
// await this.chooseSpot()
// } else {
// if (this.isGd) {
// await this.getPoiAround();
// } else {
// await this.getPoiPage();
// }
// }
// 地图
this._mapContext = uni.createMapContext("map", this);
this._mapContext.initMarkerCluster({
enableDefaultStyle: false,
zoomOnClick: true,
gridSize: 60,
complete(res) {
console.log('initMarkerCluster', res)
}
});
this._mapContext.on("markerClusterCreate", (e) => {
console.log("markerClusterCreate", e);
});
},
methods: {
// 图标点击
markerClick(e) {
console.log('图标点击', e);
// let markerId = e.markerId;
// this.marker.forEach(item => {
// if (markerId === item.id) {
// if (this.isGd) {
// uni.navigateTo({
// url: `/pages/communityLive/details?data=${item.label}&type=gd&name=${this.name}`
// })
// } else {
// uni.navigateTo({
// url: `/pages/communityLive/details?id=${item.id}&name=${this.name}&type=fgd`
// })
// }
// }
// })
},
}
}
</script>
<style lang="scss">
.search-box {
position: absolute;
z-index: 2;
top: 20rpx;
left: 50%;
transform: translateX(-50%);
.search-box-input {
width: 580rpx;
height: 62rpx;
background: #FFFFFF;
border-radius: 12rpx;
opacity: 0.85;
}
}
// 地图
.content {
width: 100%;
height: 460rpx;
}
.map {
width: 100%;
height: 100vh;
}
</style>

BIN
static/map/sp_icon_dw.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
static/map/sp_icon_hdw.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB