|
[开发工具]
换了apicloud3之后彻底不会用了
[复制链接]
换了apicloud3之后彻底不会用了 。底部按钮点击弹出选择器选择是拍照还是相册图片,然后选择不用的函数执行。
chooseImages() {
api.actionSheet({
title : '上传照片',
cancelTitle : '取消',
buttons : ['拍照', '相册']
}, function(ret, err) {
if (ret) {
this.getPicture(ret.buttonIndex);
});
},
getPicture(sourceType){
if (sourceType == 1) {
}else if (sourceType == 2){
}
}
这样写不对吗?为什么控制器提示错误:ERROR] dispatch script failed. TypeError: this.getPicture is not a function
这种应该怎么写才对呢?
|
|