当前位置: 首页 > news >正文

做美食网站赚钱吗电商培训心得体会

做美食网站赚钱吗,电商培训心得体会,做电影网站被抓,网站title重复的后果注&#xff1a; 1.默认的聚合点可以点击自动展示子级点位&#xff0c;但是自定义的聚合点在ios上无法触发markerClusterClick的监听&#xff0c;至今未解决&#xff0c;不知啥原因 2.ios和安卓展示的点位样式还有有差别 源码附上 <template><view class"marke…

注:

1.默认的聚合点可以点击自动展示子级点位,但是自定义的聚合点在ios上无法触发markerClusterClick的监听,至今未解决,不知啥原因

2.ios和安卓展示的点位样式还有有差别

源码附上

<template><view class="marker-map"><map id="mapId" style="width: 100%; height:1342rpx ;" :latitude="latitude" :longitude="longitude"show-location show-scale :scale="zoom" @regionchange="regionchange" @updated="update" @callouttap='callouttap'></map><view class="layer flex-column align-end"><view class="cur-location justify-center align-center" @click="backCenter"><image :src="imgConf.position" mode="" style="width:60%;height: 60%;"></image></view><view class="list"><u-transition :show="showMarkerListPop" mode="fade-up"><mapMarkerList @onclose="showMarkerListPop=false" /></u-transition></view></view></view>
</template><script>import mapMarkerList from './components/mapMarkerList.vue'import imgConf from '@/utils/imgConf.js'export default {components: {mapMarkerList},data() {return {imgConf,longitude: 104.04311,latitude: 30.64242,markers: [], // 使用 marker点击事件 需要填写idfixedHeight: 60,zoom: 16,showMarkerListPop: false}},created() {this.mapContext = uni.createMapContext("mapId", this);console.log("this.mapContext", this.mapContext);// 使用默认聚合效果时可注释下一句this.bindEvent()this.getDotList();},methods: {bindEvent() {this.mapContext.initMarkerCluster({enableDefaultStyle: false,zoomOnClick: true,gridSize: 100,complete(res) {console.log('initMarkerCluster', res)}});// enableDefaultStyle 为 true 时不会触发该事件this.mapContext.on('markerClusterCreate', res => {const clusters = res.clustersconst markers = clusters.map(cluster => {const {center,clusterId,markerIds} = clusterreturn {...center,width: 1,height: 1,clusterId, // 必须iconPath: '',label: {content: '盛世年华' + "(" + "2" + "套)" + '\n' + '12' + '元起',color: "#ffffff",fontSize: 11,borderRadius: 8,bgColor: "#0090FF",padding: 10,textAlign: 'center',anchorX: 0,anchorY: -56,}// callout: {// 	content: '盛世年华' + "(" + "2" + "套)" + '\n' + '12' + '元起',// 	color: "#ffffff",// 	fontSize: 11,// 	borderRadius: 8,// 	bgColor: "#0090FF",// 	padding: 10,// 	textAlign: 'center',// 	display: 'ALWAYS',// },}})this.mapContext.addMarkers({markers,clear: false,complete(res) {console.log('clusterCreate addMarkers', res)}})})this.mapContext.on("markerClusterClick", (ClusterInfo) => {console.log("点击聚合点", ClusterInfo); //[id1,id2]});},// 获取所有点位/async getDotList(params) {// const res = await getDot(params)const resPosition = [{longitude: 113.324520,latitude: 23.099994,title: '盛世年华1',num: 1,price: 35500},{longitude: 102.04320,latitude: 31.64242,title: '盛世年华2',num: 1,price: 35500},{longitude: 102.04313,latitude: 30.64242,title: '盛世年华3',num: 1,price: 15500},{longitude: 113.326520,latitude: 31.64242,title: '盛世年华4',num: 3,price: 25500},]const markers = []resPosition.forEach((p, i) => {markers.push(Object.assign({}, {id: i + 1,iconPath: '',joinCluster: true,width: 2,height: 2,callout: {content: p.title + "(" + p.num + "套)" + '\n' + p.price + '元起',color: "#ffffff",fontSize: 11,borderRadius: 8,bgColor: "#0090FF",padding: 10,textAlign: 'center',display: 'ALWAYS',},}, p))})this.markers = JSON.parse(JSON.stringify(markers))this.mapContext.addMarkers({markers: this.markers,clear: false,complete(res) {console.log('addMarkers', res)}})// .map((item, index) => {// 	if (item.lnglat === '') {// 		return undefined// 	}// 	var location = item.x.split(",");// 	let iconPath = ''// 	let label = item.name.length > 20 ? item.name.substr(0, 18) + '...' : item.name;// 	label = label.length > 10 ? label.substr(0, 10) + '\n' + label.substr(10) : label;// 	return {// 		id: index,// 		longitude: Number(location[0]),// 		latitude: Number(location[1]),// 		iconPath,// 		joinCluster: this.zoom > 18 ? false : true,// 		width: 50,// 		height: 60,// 		name: item.name,// 		label: {// 			content: label,// 			anchorX: 20,// 			anchorY: -45,// 			color: '#333',// 			fontSize: 14// 		}// 	}// }).filter(i => i !== undefined)console.log('markers', this.markers)if (this.markers.length === 0) {uni.showToast({title: '暂无相关点位信息',icon: "none"})this.longitude = 92.066757this.latitude = 31.473608this.zoom = 16return}// })},// 点击标记点callouttap(e) {this.showMarkerListPop = true// 根据markerid查找console.log('点击标记点E', e) //e.markerId},regionchange() {// this.mapContext.getScale({// 	success: (res) => {// 		this.zoom = res.scale// 	}// })},update() {console.log('渲染更新完成') //e.markerId},// 定位到当前位置backCenter() {uni.getLocation({type: 'gcj02',success: (res) => {if (res.longitude && res.latitude) {this.latitude = Number(res.latitude)this.longitude = Number(res.longitude)this.zoom = 16.01 // 必须要有层级的变化,下面的方法才能生效this.mapContext.moveToLocation({longitude: this.longitude,latitude: this.latitude,success: (res) => {this.zoom = 16.03},fail: (info) => {console.log(info)}})} else {uni.showToast({title: '无法获取当前定位'})}},fail(err) {uni.showToast({title: '无法获取当前定位'})}});},}}
</script><style lang="scss" scoped>.marker-map {.layer {position: fixed;z-index: 999;width: 100%;right: 0;bottom: 0;}.cur-location {width: 86rpx;height: 86rpx;background: #FFFFFF;box-shadow: 0rpx 0rpx 8rpx 1rpx rgba(0, 144, 255, 0.15);border-radius: 20rpx 20rpx 20rpx 20rpx;margin-right: 30rpx;margin-bottom: 50rpx;}.list {width: 100%;height: 100%;}}
</style>

http://www.15wanjia.com/news/50882.html

相关文章:

  • 要做一个网站需要准备什么网络营销的基本特征有哪七个
  • 篮球运动装备网站模板长沙网络推广公司
  • 国内手机网站建设百度一下就知道
  • 南京高端模板建站自媒体培训学校
  • 濮阳网站建设公司网页设计是干嘛的
  • 手机做照片下载网站培训课程表
  • 高端定制网站建设制作培训seo去哪家机构最好
  • 福田做商城网站建设找哪家公司比较安全广州seo效果
  • 大庆做网站公司美区下载的app怎么更新
  • 哪个网站做美食视频软件广州seo黑帽培训
  • 数字广东网络建设有限公司是国企吗seo网络排名优化哪家好
  • 怎么邀约客户做网站品牌宣传推广方案
  • 做网站的流程分析如何做线上销售和推广
  • 体育网站建设的必要性长沙网站seo外包
  • 深圳营销网站建设模板手机系统流畅神器
  • 濮阳做网站关键词优化怎么弄
  • 建设信用卡银行商城网站搜索引擎优化的基本手段
  • 阳江做网站多少钱网站建设网站推广
  • 做微信广告网站有哪些内容seo入门视频
  • 怎么根据街景图片找地址seo是指搜索引擎营销
  • 河南网站建站系统平台爱站网seo
  • python基础教程雪峰seo整站优化报价
  • 重庆南川网站制作公司推荐晨阳seo服务
  • 摄影做网站百度联盟是什么
  • 东坑东莞微信网站建设app开发公司排行榜
  • 帮妈妈做家务作文网站影响seo排名的因素
  • 怎样免费创建网站推广下载app拿佣金
  • 政府网站建设滞后微信营销平台有哪些
  • wordpress会员认证谷歌seo课程
  • 做魔杖网站seo建站教学