1***@qq.com
1***@qq.com
  • 发布:2023-04-14 10:36
  • 更新:2023-04-14 10:58
  • 阅读:400

【报Bug】uniapp项目nvue真机检测运行在ios上 map组件增加markers标记点时直接闪退

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: Windows10家庭版 21H2

HBuilderX类型: 正式

HBuilderX版本号: 3.7.9

手机系统: iOS

手机系统版本号: iOS 15

手机厂商: 苹果

手机机型: iPhone13 pro

页面类型: nvue

vue版本: vue2

打包方式: 云端

项目创建方式: HBuilderX

示例代码:
<template>  
    <view class="index-container">  
        <map class="map" :latitude="latitude" :longitude="longitude" :markers="covers"  
            :scale="mapscale" enable-traffic="true" :circles="yuan" @markertap="iconClick">  
        </map>  

    </view>  
</template>  

<script>  

    export default {  
        data() {  
            return {  
                latitude: null,  
                longitude: null,  
                mapscale: 3,  
                covers: [  
                ],  
                yuan: [],  

            }  
        },  
        onReady() {  
        },  
        onLoad() {  
            this.getList()  
        },  
        methods: {  
            iconClick() {  
            },  
            getList() {  
                    // ios闪退处,1.一开始闪退 2.滑动缩放地图一会闪退  
                    this.covers = [...this.covers,{  
                            id:0,  
                            latitude: 22.626506,  
                            longitude: 114.05492,  
                            iconPath: '/static/images/power.png',  
                            width: '40',  
                            height: '42',  
                            label: {  
                                content: '52',  
                                color: '#1477FF',  
                                fontSize:'27',  
                                borderRadius: '5',  
                                anchorX: '-15',  
                                anchorY: '-37',  
                                bgColor:'#dddddd00',  
                                textAlign:'center'  
                            }  
                        },{  
                            id:1,  
                            latitude: 22.606506,  
                            longitude: 114.15492,  
                            iconPath: '/static/images/power.png',  
                            width: '40',  
                            height: '42',  
                            label: {  
                                content:10,  
                                color: '#1477FF',  
                                fontSize:'27',  
                                borderRadius: '5',  
                                anchorX: '-15',  
                                anchorY: '-37',  
                                bgColor:'#dddddd00',  
                                textAlign:'center'  
                            }  
                        }]  
            },  
        }  
    }  
</script>  

<style lang="scss">  
    .index-container {  
        width: 750rpx;  
        flex: 1;  
        .map {  
            flex: 1;  
            width: 750rpx;  
        }  
    }  
</style>

操作步骤:

1.uniapp项目nvue页面下的map组件
2.编译后打开ios真机调试
3.改变markers时闪退,未闪退的话 滑动缩小一下map组件就会触发

预期结果:

ios闪退,安卓没事。控制台无报错

实际结果:

ios闪退,安卓没事。控制台无报错

bug描述:

nvue页面下map组件写在data()里面的markers并不会闪退,但是markers添加更改时会。或者一开始不会闪退,但map组件滑动缩小时会造成闪退。控制台无任何报错

this.covers = [...this.covers,{  
                            id:0,  
                            latitude: 22.626506,  
                            longitude: 114.05492,  
                            iconPath: '/static/images/power.png',  
                            width: '40',  
                            height: '42',  
                            label: {  
                                content: '52',  
                                color: '#1477FF',  
                                fontSize:'27',  
                                borderRadius: '5',  
                                anchorX: '-15',  
                                anchorY: '-37',  
                                bgColor:'#dddddd00',  
                                textAlign:'center'  
                            }  
                        },{  
                            id:1,  
                            latitude: 22.606506,  
                            longitude: 114.15492,  
                            iconPath: '/static/images/power.png',  
                            width: '40',  
                            height: '42',  
                            label: {  
                                content:10,  
                                color: '#1477FF',  
                                fontSize:'27',  
                                borderRadius: '5',  
                                anchorX: '-15',  
                                anchorY: '-37',  
                                bgColor:'#dddddd00',  
                                textAlign:'center'  
                            }  
                        }]
2023-04-14 10:36 负责人:无 分享
已邀请:
1***@qq.com

1***@qq.com (作者)

很多hbuilderx版本都会闪退

1***@qq.com

1***@qq.com (作者)

解决了,markers label下的参数content不能为数字。

该问题目前已经被锁定, 无法添加新回复