框架类型 | 问题类型 | 终端类型 | 微信版本 | 基础库版本 |
---|---|---|---|---|
小程序 | Bug | 微信安卓客户端 | 最新 | 最新 |
<view class="weui-uploader__input-box">
<view class="weui-uploader__input" bindtap="chooseVideo"></view>
</view>
async chooseVideo(e) {
console.log("chooseVideo 调用了1次")
this.setData({
chooseVideoStatus: "loading"
})
await wx.chooseMedia({
count: 1,
mediaType: ['video'],
sourceType: ['album', 'camera'],
maxDuration: 30,
success: res => {
// console.log(res.tempFiles[0].tempFilePath)
this.chooseVideo = res.tempFiles[0].tempFilePath;
this.setData({
chooseCover: res.tempFiles[0].thumbTempFilePath,
}, () => {
const id = setTimeout(() => {
this.setData({
chooseVideoStatus: "choose"
});
clearTimeout(id);
}, 2000)
})
},
fail: err => {
console.log('choose Media fail.')
this.setData({
chooseVideoStatus: null
})
}
})
},
经过测试,将 chooseVideo 改成其他名称后,运行正常。
怀疑是 因为自定义函数 和 wx.chooseVideo 冲突。
网友回复
stop eating:
this.chooseVideo = res.tempFiles[0].tempFilePath 这行代码搞的鬼