|
var UIAlbumBrowser = api.require('UIAlbumBrowser');
UIAlbumBrowser.open({
max: 6,
isOpenPreview: false,
type: 'all',
styles: {
bg: '#fff',
mark: {
icon: '',
position: 'bottom_left',
size: 20
},
nav: {
bg: 'rgba(0,0,0,0.6)',
titleColor: '#fff',
titleSize: 18,
cancelColor: '#fff',
cancelSize: 16,
finishColor: '#fff',
finishSize: 16
}
},
rotation: true,
selectedAll: false
}, function (ret) {
if (ret) {
if (ret.list && ret.list.length > 0) {
var list = ret.list;
api.showProgress({
title: '请稍后...',
text: ""
});
if (api.systemType == 'ios') {
var aliObjectPath = [];
(function loopUp(i) {
if (i === list.length) {
uploadAliOss(aliObjectPath);
return;
} else if (i < list.length) {
UIAlbumBrowser.transPath({
path: list.path
}, function (ret, err) {
if (ret) {
aliObjectPath.push({
path: ret.path
})
loopUp(++i);
}
});
}
}(0))
} else {
uploadAliOss(list);
}
}
}
});
|
|