收藏
回答

Web-view中 input file 上传文件,multiple设置为true了,还是无法多选文

Web-view中 input file 上传文件,multiple设置为true了,还是无法多选文件

回答关注问题邀请回答
收藏

4 个回答

  • 社区技术运营专员--许涛
    社区技术运营专员--许涛
    2022-10-15

    你好,请问h5中是否正常呢?

    2022-10-15
    有用
    回复 8
    • yangCJ
      yangCJ
      2022-10-18
      外部浏览器都正常,开发者工具中也正常,就是真机模拟的时候只能选一个,不能多选
      2022-10-18
      回复
    • 社区技术运营专员--许涛
      社区技术运营专员--许涛
      2022-10-19回复yangCJ
      安卓复现问题还是ios呢?
      2022-10-19
      回复
    • yangCJ
      yangCJ
      2022-10-21
      android,手边没ios
      2022-10-21
      回复
    • 社区技术运营专员--许涛
      社区技术运营专员--许涛
      2022-10-24回复yangCJ
      麻烦提供下机型,微信版本号和复现链接
      2022-10-24
      回复
    • 王俊钧
      王俊钧
      2023-03-29回复社区技术运营专员--许涛
      安卓机在微信浏览器input multiple还是无法支持多选。ios则正常。
      2023-03-29
      回复
    查看更多(3)
  • K
    K
    2023-06-07

    要调用微信官方的sdk里的wx.chooseImage方法

    https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/Web_Developer_Tools.html

    <!DOCTYPE html>
    <html lang="en">
    
    
    <head>
      <meta charset="UTF-8">
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>测试安卓文件上传</title>
      <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
      <script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
      <style>
      </style>
    </head>
    
    
    <body>
      <button id="upload">上传文件</button>
      <script>
        document.addEventListener("DOMContentLoaded", () => {
          wx.config({
            // debug: this.$store.state.isDebugger ? true : false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
            debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
            appId: "***************", // 必填,公众号的唯一标识
            timestamp: timestamp, // 必填,生成签名的时间戳
            nonceStr: noncestr, // 必填,生成签名的随机串
            signature: signature, // 必填,签名
            jsApiList: ['chooseImage'] // 必填,需要使用的JS接口列表
          });
          wx.ready(function () {
            console.log(2)
            wx.checkJsApi({
              jsApiList: ['chooseImage'], // 需要检测的JS接口列表,所有JS接口列表见附录2,
              success: function (res) {
                alert(JSON.stringify(res))
              }
            });
            console.log(3)
          })
        });
    
    
    
        var btn = document.getElementById("upload")
        btn.addEventListener('click', () => {
          wx.chooseImage({
            count: 6, // 默认9
            sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
            sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
            success: function (res) {
              var localIds = res.localIds; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
              console.log(`图片上传成功${res}`)
              alert("文件上传成功")
              alert(`上传${localIds.length}张照片`)
              localIds.map(i => {
                let img = document.createElement("img")
                img.src = i
                document.body.appendChild(img)
              })
            }
          })
        })
    
    
    
      </script>
    </body>
    
    
    </html>
    
    2023-06-07
    有用 1
    回复
  • YIT
    YIT
    2022-10-29

    h5在安卓是有这个问题,要多选只有通过调用sdk了

    2022-10-29
    有用 1
    回复
  • Charlie
    Charlie
    2022-10-14

    你这个webview h5直接在微信中打开,能多选吗

    2022-10-14
    有用
    回复 1
    • 赵颖
      赵颖
      2023-04-18
      多选 不了
      2023-04-18
      回复
登录 后发表内容