TangMonk
V2EX  ›  问与答

微信 JS SDK 扫码二维码 api scanQRCode, 不会回调 success 函数,而是直接出二维码里的内容(偶尔)

  •  
  •   TangMonk · Jul 5, 2016 · 17917 views
    This topic created in 3600 days ago, the information mentioned may be changed or developed.

    代码如下:

      $(document).on 'wx_loaded', ->
        $('#reserve_confirm').on 'click', (e) ->
          e.preventDefault()
          wx.scanQRCode
            needResult: 1
            scanType: [ 'qrCode' ]
            success: (res) ->
              result = res.resultStr
              $.ajax({
                url: "#{wx_admin_reserve_confirm_path}"
                type: "POST"
                data: {user_id: result}
                success: () ->
                  window.location.href = "#{wx_admin_reserve_buildings_path}?user_id=\#{result}"
              })
    
    
    
    5 replies    2016-07-05 11:15:30 +08:00
    cloverstd
        1
    cloverstd  
       Jul 5, 2016
    开了 debug ,就会 alert 把结果打出来
    TangMonk
        2
    TangMonk  
    OP
       Jul 5, 2016
    @cloverstd 没开 debug
    pubby
        3
    pubby  
       Jul 5, 2016 via Android
    偶尔还返回键失效,顶部 status bar 还经常变榨

    安卓

    感觉微信的 Webview 小问题还挺多的
    TangMonk
        4
    TangMonk  
    OP
       Jul 5, 2016
    @pubby js sdk 的问题确实挺多的,之前还遇到过 调用拍照的接口,在低端机上出现内存不足闪退的问题。。
    pubby
        5
    pubby  
       Jul 5, 2016
    早期版本的 js sdk , 安卓上得到照片是缩略图画质
    录音回放什么的也时不时出问题,有时要重启微信 app 才能恢复。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5531 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 72ms · UTC 08:21 · PVG 16:21 · LAX 01:21 · JFK 04:21
    ♥ Do have faith in what you're doing.