选择多张图片
This commit is contained in:
parent
110512d9cb
commit
ccd4cdf328
@ -874,7 +874,7 @@ export struct ChatP2PPage {
|
|||||||
MediaUtils.showImageVideoPicker().then((results) => {
|
MediaUtils.showImageVideoPicker().then((results) => {
|
||||||
if(results!=null&&results.length>0)
|
if(results!=null&&results.length>0)
|
||||||
{
|
{
|
||||||
results.forEach(result=>{
|
for (const result of results) {
|
||||||
if (result.errorMsg == null && result.uri) {
|
if (result.errorMsg == null && result.uri) {
|
||||||
if (result.type === photoAccessHelper.PhotoType.IMAGE) {
|
if (result.type === photoAccessHelper.PhotoType.IMAGE) {
|
||||||
this.chatViewModel.sendImageMessage(result.uri);
|
this.chatViewModel.sendImageMessage(result.uri);
|
||||||
@ -882,7 +882,8 @@ export struct ChatP2PPage {
|
|||||||
this.chatViewModel.sendVideoMessage(result.uri, result.duration, result.width, result.height);
|
this.chatViewModel.sendVideoMessage(result.uri, result.duration, result.width, result.height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
@ -1027,7 +1028,7 @@ export struct ChatP2PPage {
|
|||||||
MediaUtils.showImageVideoPicker().then((results) => {
|
MediaUtils.showImageVideoPicker().then((results) => {
|
||||||
if(results!=null&&results.length>0)
|
if(results!=null&&results.length>0)
|
||||||
{
|
{
|
||||||
results.forEach(result=>{
|
for (const result of results) {
|
||||||
if (result.errorMsg == null && result.uri) {
|
if (result.errorMsg == null && result.uri) {
|
||||||
if (result.type === photoAccessHelper.PhotoType.IMAGE) {
|
if (result.type === photoAccessHelper.PhotoType.IMAGE) {
|
||||||
this.chatViewModel.sendImageMessage(result.uri);
|
this.chatViewModel.sendImageMessage(result.uri);
|
||||||
@ -1035,7 +1036,8 @@ export struct ChatP2PPage {
|
|||||||
this.chatViewModel.sendVideoMessage(result.uri, result.duration, result.width, result.height);
|
this.chatViewModel.sendVideoMessage(result.uri, result.duration, result.width, result.height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// if (result.errorMsg == null && result.uri) {
|
// if (result.errorMsg == null && result.uri) {
|
||||||
// if (result.type === photoAccessHelper.PhotoType.IMAGE) {
|
// if (result.type === photoAccessHelper.PhotoType.IMAGE) {
|
||||||
|
|||||||
@ -72,9 +72,9 @@ export class MediaUtils {
|
|||||||
const uri = photoSelectResult.photoUris;
|
const uri = photoSelectResult.photoUris;
|
||||||
let selectResult:SelectResult[]=[]
|
let selectResult:SelectResult[]=[]
|
||||||
// const uri = photoSelectResult.photoUris[0];
|
// const uri = photoSelectResult.photoUris[0];
|
||||||
await uri.forEach(async values=>{
|
for (const indexUri of uri) {
|
||||||
selectResult.push(await MediaUtils.getMediaInfo(context, values))
|
selectResult.push(await MediaUtils.getMediaInfo(context, indexUri))
|
||||||
})
|
}
|
||||||
// const selectResult = MediaUtils.getMediaInfo(context, uri)
|
// const selectResult = MediaUtils.getMediaInfo(context, uri)
|
||||||
resolve(selectResult);
|
resolve(selectResult);
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user