小程序
小游戏
企业微信
微信支付
扫描小程序码分享
- 当前 Bug 的表现(可附上截图)
ios 不能展示临时文件 wxfile://协议下的临时文件,Image src ios 下不能展示
- 预期表现
能显示
- 复现路径
wx.getImageInfo() 回调回来的 path
- 提供一个最简复现 Demo
2 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
请问解决了吗
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
其他部分代码有问题吧。。能做个代码片段吗
this.wxChooseImage('album', 1).then(files => {
console.log('files',files);
return Promise.all(files.map(file => this.mtGetImageInfo(file.path)));
}).then(imgs => {
this.imgSrc = imgs[0].path;
console.log('imgs',imgs);
});
wxChooseImage(type, count) {
// const _this = this;
return new Promise((resolve, reject) => {
wx.chooseImage({
count,
sourceType: [type],
sizeType: ['compressed'],
success: data => {
const paths = data.tempFiles;
resolve(paths);
},
fail: () => {
this.mtHideLoading();
就正常的getImageInfo 后 赋值的过程
mtGetImageInfo里呢?
代码片段是这个
https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html
就一个promise的封装而已
片段我是用框架生成的, 代码会比较乱
就正常的 chooseImage 后 getImageInfo 得到 path 赋值的过程
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
请问解决了吗
其他部分代码有问题吧。。能做个代码片段吗
this.wxChooseImage('album', 1).then(files => {
console.log('files',files);
return Promise.all(files.map(file => this.mtGetImageInfo(file.path)));
}).then(imgs => {
this.imgSrc = imgs[0].path;
console.log('imgs',imgs);
});
wxChooseImage(type, count) {
// const _this = this;
return new Promise((resolve, reject) => {
wx.chooseImage({
count,
sourceType: [type],
sizeType: ['compressed'],
success: data => {
const paths = data.tempFiles;
resolve(paths);
},
fail: () => {
this.mtHideLoading();
},
});
});
},
就正常的getImageInfo 后 赋值的过程
mtGetImageInfo里呢?
代码片段是这个
https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html
就一个promise的封装而已
片段我是用框架生成的, 代码会比较乱
就正常的 chooseImage 后 getImageInfo 得到 path 赋值的过程