|
var photoBrowser = api.require('photoBrowser');
photoBrowser.open({
images: imageUrls,
activeIndex: index,
// placeholderImg: path,
bgColor: '#000'
}, function(ret){
if(ret.eventType == 'click'){
photoBrowser.close();
api.setScreenOrientation({
orientation : 'auto_portrait'
});
}else if(ret.eventType == 'longPress'){
api.download({
url: imageUrls[ret.index],
cache: false,
allowResume: true
},function( ret, err ){
if(ret){
api.toast({
msg : '图片保存到'+ret.savePath
});
}else{
api.toast({
msg : '图片保存失败'
});
}
});
}
});
|
|