qian0314
qian0314
  • 发布:2021-11-04 11:25
  • 更新:2021-11-04 15:06
  • 阅读:367

自定义扫码提示‘未获取相机权限’换成日语可以吗

分类:uni-app

我想问一下,扫码未开启相机权限 提示‘未获取相机权限’,这个提示可以换成日语吗
自定义代码如下:
created() {
var statusBarHeight = uni.getSystemInfoSync().statusBarHeight; //状态栏
var height = statusBarHeight + 44 + 104 + 'px';
var pages = getCurrentPages();
var page = pages[pages.length - 1];
// #ifdef APP-PLUS
var currentWebview = page.$getAppWebview();
this.barcode = plus.barcode.create('barcode', this.barcode, {
top: '0',
bottom: '0',
left: '0px',
width: '100%',
//height: height,//这里可以设置扫码框的高度
scanbarColor: '#0962EA',
position: 'static',
frameColor: '#0962EA'
});
// 创建返回原生按钮
var backVew = new plus.nativeObj.View('backVew', {
top: '0px',
left: '0px',
height: '40px',
width: '100%'
},
[{
tag: 'img',
id: 'backBar',
src: 'static/imgs/arrow-back.png',
position: {
top: '12px',
left: '20px',
width: '8px',
height: '15px'
}
}]);
// 创建展示类内容组件
var content = new plus.nativeObj.View('content', {
top: '0px',
left: '0px',
height: '100%',
width: '100%'

            },  
            [{  
                    tag: 'img',  
                    id: 'backBar',  
                    src: 'static/imgs/arrow-back.png',  
                    position: {  
                        top: '12px',  
                        left: '20px',  
                        width: '8px',  
                        height: '15px'  
                    }  
                }, {  
                    tag: 'font',  
                    id: 'scanTitle',  
                    text: 'スキャン',  
                    textStyles: {  
                        size: '18px',  
                        color: '#ffffff'  
                    },  
                    position: {  
                        top: '0px',  
                        left: '0px',  
                        width: '100%',  
                        height: '40px'  
                    }  
                },  
                {  
                    tag: 'font',  
                    id: 'scanTips',  
                    text: 'QRコードに向けてください',  
                    textStyles: {  
                        size: '12px',  
                        color: '#F0F1F3',  
                        whiteSpace: 'normal'  
                    },  
                    position: {  
                        top: '70%',  
                        left: '10%',  
                        width: '80%',  
                        height: 'wrap_content'  

                    }  
                }  

            ]);  
        this.barcode.onmarked = this.onmarked;  
        currentWebview.append(this.barcode);  
        currentWebview.append(content);  
        currentWebview.append(backVew);  
        const res = uni.getSystemInfoSync();  
        // if(res.platform == 'android'){//安卓机  
        this.barcode.start();  
        // }  
        backVew.addEventListener("click", function(e) { //返回按钮  
            uni.navigateBack({  
                delta: 1  
            })  
            barcode.close();  
            plus.navigator.setFullscreen(false);  

        }, false);  
        // #endif  
    },
2021-11-04 11:25 负责人:DCloud_uniAD_HDX 分享
已邀请:
DCloud_uniAD_HDX

DCloud_uniAD_HDX

当前版本解决方案,参考文档 https://ask.dcloud.net.cn/article/35860
如问题中的图片提示语 "未获取相机权限" 对应的key是: dcloud_feature_barcode2_no_camera_permission

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