1***@163.com
1***@163.com
  • 发布:2021-03-31 18:46
  • 更新:2021-03-31 18:46
  • 阅读:351

【报Bug】uni 微信小程序组件触发父页面事件参数丢失

分类:uni-app

产品分类: uniapp/小程序/微信

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win10

HBuilderX类型: 正式

HBuilderX版本号: 3.1.4

第三方开发者工具版本号: 1.05.2103190

基础库版本号: 2.16.0

项目创建方式: HBuilderX

示例代码:

<template>
<view>
<painter @imgOK="imgOk" @imgErr="imgErr" widthPixels="375" customStyle='width:750rpx;' :palette="template"/>
</view>
</template>

<script>
import painter from '@/wxcomponents/Kujiale-Mobile-painter/painter';
export default {
components: {
painter
},
data() {
return {
template:{}
}
},
mounted() {
this._doctorBase()
},
methods:{
imgOk(e){
console.log(e);
},
imgErr(){

        },  
    _doctorBase(){  
                    let arr = {  
                        background: '#ffffff',  
                            width: '598rpx',  
                            height: '841rpx',  
                            borderRadius: '12rpx',  
                            views: [  
                                {  
                                    type: "rect",  
                                    css: {  
                                        left:'211rpx',  
                                        top:'171rpx',  
                                        width: '176rpx',  
                                        height: '36rpx',  
                                        borderRadius: '12rpx',  
                                        color: '#f75a53',  
                                    }  
                                },  
                                {  
                                    type: "text",  
                                    text:'wdctefvsdcx',  
                                    css: {  
                                        color:'#ffffff',  
                                        top:'174rpx', //设计图为177  
                                        fontSize:'26rpx',  
                                        lineHeight:'26rpx',  
                                        width:'598rpx',  
                                        textAlign:'center',  
                                    }  
                                },  
                                {  
                                    type: "text",  
                                    text:'4wdctefvsdcx56',  
                                    css: {  
                                        maxLines:1,  
                                        top:'210rpx', // 设计图为220  
                                        color:'#363636',  
                                        width:'598rpx',  
                                        lineHeight:'35rpx',  
                                        fontSize:'35rpx',  
                                        textAlign:'center',  
                                    }  
                                },  
                                {  
                                    type: "text",  
                                    text:'5wdctefvsdcx',  
                                    css: {  
                                        maxLines:1,  
                                        top:'295rpx',  
                                        color:'#363636',  
                                        width:'598rpx',  
                                        lineHeight:'35rpx',  
                                        fontSize:'35rpx',  
                                        textAlign:'center',  
                                    }  
                                },  
                                {  
                                    type: "text",  
                                    text:'wdctefvsdcx',  

                                    css: {  
                                        maxLines:1,  
                                        top:'335rpx',  
                                        color:'#363636',  
                                        width:'598rpx',  
                                        lineHeight:'35rpx',  
                                        fontSize:'35rpx',  
                                        textAlign:'center',  
                                    }  
                                },  
                                {  
                                    type: "text",  
                                    text:'用微信扫描二维码可以预约',  
                                    css: {  
                                        textAlign:'center',  
                                        top:'680rpx',  
                                        width:'598rpx',  
                                        color:'#898989',  
                                        lineHeight:'35rpx',  
                                        fontSize:'30rpx',  
                                    }  
                                },  
                                {  
                                    type: "text",  
                                    text:'(或长按图片识别图中二维码)',  
                                    css: {  
                                    textAlign:'center',  
                                        top:'715rpx',  
                                        color:'#898989',  
                                        width:'598rpx',  
                                        lineHeight:'35rpx',  
                                        fontSize:'30rpx',  
                                    }  
                                },  
                                {  
                                    type: "rect",  
                                    css: {  
                                            left:'0rpx',  
                                            top:'779rpx',  
                                            width: '598rpx',  
                                            height: '1rpx',  
                                            color: '#d7d7d7',  
                                    }  
                                },  
                                {  
                                    type: "text",  
                                    text:'123',  
                                    css: {  
                                        left:'241rpx',  
                                        top:'792rpx',  
                                        color:'#26bfbf',  
                                        fontSize:'30rpx',  
                                    }  
                                }  
                            ]  
                    }  
                    this.template = arr;  
    }  
}  

}
</script>

操作步骤:

引入组件,生成图片结束后会触发

预期结果:

图片生成后返回图片参数

实际结果:

图片生成后,组件内可以获取到图片参数,父页面也触发了对应方法,但是父页面接收不到参数

bug描述:

uni引入微信小程序组件,https://ext.dcloud.net.cn/plugin?id=1480,组件内触发了triggerEvent,页面也有触发对应方法,但是参数丢失,因为是在wxcomponents目录下,所以无法使用uni.$emit

2021-03-31 18:46 负责人:无 分享
已邀请:

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