- map 中bindtap中点击地图中的任何一个点都可以吗?为啥这边不是?
<map id="map" longitude="{{longitude}}" circles="{{circles}}" show-location latitude="{{latitude}}" scale="14" bindmarkertap="handleMarkerTap" bindtap="tapMap" style="width:100%;height:90%;"></map> circles:[ { longitude: 113.324520, latitude: 23.099994, radius:500, strokeWidth:1, color:'#E41F18' } ], getDistance(lat1, lon1, lat2, lon2) { const R = 6371000; const toRad = (d) => d * Math.PI / 180; const dLat = toRad(lat2 - lat1); const dLon = toRad(lon2 - lon1); const a = Math.sin(dLat / 2) ** 2 + Math.cos(toRad(lat1)) * Math.cos(toRad(lat2)) * Math.sin(dLon / 2) ** 2; return R * (2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a))); }, isInCircle(currentLat, currentLon, circleLat, circleLon, radius) { const distance = this.getDistance(currentLat, currentLon, circleLat, circleLon); return distance <= radius; }, tapMap(e){ console.log(e,'点击地图'); const tappedLocation = e.detail; // 获取被点击的标记点的位置信息(如果有的话) if (this.isInCircle( // 22.677173,114.330154,// 内 tappedLocation.latitude,tappedLocation.longitude, this.data.circles[0].latitude, this.data.circles[0].longitude, this.data.circles[0].radius )) { // console.log('Point is within the circle'); wx.showToast({ title:'在范围内', icon:'none' }) // 处理在圆内的点击事件,例如更新markers数组等。 } else { wx.showToast({ title:'很遗憾', icon:'none' }) // console.log('Point is outside the circle'); // 可以选择移除该标记或给出提示。 } },
02-24 - 使用Skyline再使用vant组件,vant组件不能用吗?
使用Skyline再使用vant组件,vant组件不生效,原因是啥?
02-21 - 小程序发券插件如何关闭提示已放入卡券?
<!-- 发券按钮 --> <send-coupon wx:else bind:sendcoupon="getcoupon" bind:userconfirm="redirectuser" send_coupon_params="{{couponMsg.send_coupon_params}}" sign="{{couponMsg.sign}}" send_coupon_merchant="{{couponMsg.send_coupon_merchant}}" suggest_immediate_use="{{couponMsg.suggest_immediate_use}}"> <!-- 内部为自定义代码,按钮点击部分的代码写在这里 --> <!-- [[以下为示例代码 --> <view class="takeCoupon"> </view> <!-- 以上为示例代码 ]] --> </send-coupon>
2024-10-12 - video bindfullscreenchange这个事件为什么会触发两次?
<video style="width:100%;height:100%" wx:if="{{item.accept=='video'}}" id="myVideo" src="{{ele}}" show-center-play-btn="{{false}}" show-play-btn="{{true}}" catchfullscreenchange="fullscreenchange" controls class="video" ></video>
2024-09-23 - 小程序版本已发布,但发布不了扫普通链接二维码打开小程序这个规则?
[图片]
2024-09-23 - wx.scanCode扫码进入fail里面?
[图片]
2024-09-11 - wx.getLocation返回provider:'gps'是什么意思?
[图片]
2024-05-28 - 请问微信是不是有问题,一开始是发布不了,切换了好几个电脑,然后是发布成功啦,不是我最新版本?
请问微信是不是有问题,一开始是发布不了,切换了好几个电脑,然后是发布成功啦,不是我最新版本?
2024-04-08 - wx-open-launch-weapp按钮不显示?
wx-open-launch-weapp按钮不显示?请大佬赐教
2024-01-31 - 微信扫码获取不到码值什么原因?偶先
直接使用微信的扫一扫,进入页面,有个别用户获取不到码值,是偶现 现在不知道是什么原因 [图片] [图片]
2023-11-29