1***@qq.com
1***@qq.com
  • 发布:2020-08-03 15:37
  • 更新:2020-08-03 15:37
  • 阅读:1146

【报Bug】uni.chooseImage()拍照有的机型会闪退

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

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

HBuilderX类型: 正式

HBuilderX版本号: 2.8.3

手机系统: Android

手机系统版本号: Android 10

手机厂商: 小米

手机机型: 红米k30Pro

页面类型: vue

打包方式: 云端

项目创建方式: HBuilderX

示例代码:

<template>
<view class="content">
<image class="logo" :src="src"></image>
<view class="text-area">
<text class="title" @click="upload">{{title}}</text>
</view>
</view>
</template>

<script>
export default {
data() {
return {
title: '上传图片',
src: ''
}
},
onLoad() {

    },  
    methods: {  
        upload () {  
            uni.chooseImage({  
                count: 6, //默认9  
                sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有  
                // sourceType: ['album'], //从相册选择  
                success: (res) => {  
                    console.log(res);  
                    this.src = res.tempFilePaths[0]  
                    console.log(this.src);  
                }  
            });  
        }  
    }  
}  

</script>

<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}

.logo {  
    height: 200rpx;  
    width: 200rpx;  
    margin-top: 200rpx;  
    margin-left: auto;  
    margin-right: auto;  
    margin-bottom: 50rpx;  
}  

.text-area {  
    display: flex;  
    justify-content: center;  
}  

.title {  
    font-size: 36rpx;  
    color: #8f8f94;  
}  

</style>

操作步骤:

点击上传按钮,选择手机拍照

预期结果:

拍完照片后展示在页面

实际结果:

拍完照片后app闪退重启

bug描述:

uni.chooseImage()API调用手机相机拍照会闪退

2020-08-03 15:37 负责人:无 分享
已邀请:

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