onLoad(option) {
this.activityId = option.activityId;
this.sourceType = option.isCamera == 'false' ? ['album'] : ['camera'];
wx.chooseMedia({
count: 1,
sourceType: this.sourceType,
mediaType: ['image'],
success: (data) => {
let file = data.tempFiles[0];
let filePath = file.tempFilePath;
file.path = file.tempFilePath;
file.type = "image";
file.thumb = file.path;
file.url = file.path;
this.imgSrc = filePath;
this.file = file;
},
fail(err) {
uni.navigateBack();
},
complete() {
},
})
},
你不就是在onload调起的吗
加100毫秒延时后可大概率(毕竟延时不靠谱)规避此问题