...
|
...
|
@@ -145,9 +145,10 @@ |
|
|
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
|
|
|
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
|
|
|
success: function (res) {
|
|
|
$(res.localIds).each(function (key, localId) {
|
|
|
uploadImages(localId,1);
|
|
|
});
|
|
|
let i = 0; //第几个
|
|
|
let localIds = res.localIds; //总文件
|
|
|
let length = localIds.length; //总共个数
|
|
|
uploadImages(localIds,length,i,1);
|
|
|
}
|
|
|
});
|
|
|
});
|
...
|
...
|
@@ -157,27 +158,15 @@ |
|
|
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
|
|
|
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
|
|
|
success: function (res) {
|
|
|
// alert(JSON.stringify(res));
|
|
|
// let successUp = 0; //成功个数
|
|
|
// let failUp = 0; //失败个数
|
|
|
let i = 0; //第几个
|
|
|
let tempFilePaths = res.localIds; //总文件
|
|
|
let length = res.localIds.length; //总共个数
|
|
|
|
|
|
|
|
|
uploadImages(tempFilePaths,length,i,2);
|
|
|
|
|
|
|
|
|
// $(res.localIds).each(function (key, localId) {
|
|
|
// uploadImages(localId,2);
|
|
|
// console.log('44444444444444444444444444');
|
|
|
// });
|
|
|
let localIds = res.localIds; //总文件
|
|
|
let length = localIds.length; //总共个数
|
|
|
uploadImages(localIds,length,i,2);
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
|
|
|
function uploadImages(localId,length,i,type) {
|
|
|
// console.log('555555555555555555')
|
|
|
wx.uploadImage({
|
|
|
localId: localId[i],
|
|
|
isShowProgressTips: 1,
|
...
|
...
|
@@ -190,7 +179,6 @@ |
|
|
success:function(res){
|
|
|
console.log(res);
|
|
|
if(res.code == 1){
|
|
|
// alert('99999999999')
|
|
|
if(type == 1){
|
|
|
var html = "<div class=\"images\">\n" +
|
|
|
" <img src=\""+res.data+"\" class=\"images_one\"/>\n" +
|
...
|
...
|
@@ -202,8 +190,6 @@ |
|
|
$('#dom1').prepend(html);
|
|
|
i++;
|
|
|
if(i < length) {
|
|
|
// alert('6666666666666666666')
|
|
|
// 还有图片
|
|
|
uploadImages(localId,length,i,1);
|
|
|
}
|
|
|
}else if(type == 2){
|
...
|
...
|
@@ -217,8 +203,6 @@ |
|
|
$('#dom2').prepend(html);
|
|
|
i++;
|
|
|
if(i < length) {
|
|
|
// alert('777777777777')
|
|
|
// 还有图片
|
|
|
uploadImages(localId,length,i,2);
|
|
|
}
|
|
|
}
|
...
|
...
|
|