// 选择图片
selectPicture: function(index) {
var self = this;
var isBreak = this.isBreak;
var noBreakWorkLine = this.noBreakWorkLine;
var images = this.images;
// 已经选择了的图片数量
// var currentPicNum = 0;
var maximum = 0;
if (isBreak == 'true') {
this.currentPicNum = images.length;
maximum = 10 - this.currentPicNum;
} else {
this.currentPicNum = 0;
this.currentPicNum = noBreakWorkLine[index].images.length;
maximum = 3 - this.currentPicNum;
}
plus.gallery.pick(function(e) {
for (var i in e.files) {
plus.io.resolveLocalFileSystemURL(e.files[i], function(entry) {
self.compressImage2(entry.name, entry.toLocalURL(), index);
});
}
}, function(e) {
plus.nativeUI.toast("取消选择");
}, {
filename: "_doc/camera/",
filter: "image",
multiple: true,
maximum: maximum, // 最多选择多少张图片
system: false,
onmaxed: function() {
plus.nativeUI.alert('最多只能选择' + maximum + '张图片');
}
});
}
1***@qq.com
- 发布:2020-05-27 16:29
- 更新:2020-05-27 16:29
- 阅读:919