设置 camera 属性没用,全是后置
chooseImgBack: function () { wx.chooseImage({ count: 1, sizeType: [ 'original' ], sourceType: [ 'camera' ], camera: 'back' , success(res) { // tempFilePath可以作为img标签的src属性显示图片 const tempFilePaths = res.tempFilePaths } }) }, chooseImgFront: function () { wx.chooseImage({ count: 1, sizeType: [ 'original' ], sourceType: [ 'camera' ], camera: 'front' , success(res) { // tempFilePath可以作为img标签的src属性显示图片 const tempFilePaths = res.tempFilePaths } }) }, chooseVideoBack: function () { wx.chooseVideo({ sourceType: [ 'camera' ], maxDuration: 10, camera: 'back' , success(res) { console.log(res.tempFilePath) } }) }, chooseVideoFront: function () { wx.chooseVideo({ sourceType: [ 'camera' ], maxDuration: 30, camera: 'front' , success(res) { console.log(res.tempFilePath) } }) }, |
请提供一下出现问题的机型和微信版本,以及能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
就是上面的4个函数加上 4个button
三星note8 另外一个同事的手机也不行 都是安卓的
<
view
>chooseImg back</
view
>
<
button
bindtap
=
"chooseImgBack"
>chooseImgBack</
button
>
<
view
>chooseImg front</
view
>
<
button
bindtap
=
"chooseImgFront"
>chooseImgFront</
button
>
<
view
>chooseVideo back</
view
>
<
button
bindtap
=
'chooseVideoBack'
>chooseVideoBack</
button
>
<
view
>chooseVideo front</
view
>
<
button
bindtap
=
'chooseVideoFront'
>chooseVideoFront</
button
>
麻烦按照教程来提供下代码片段