调用支付宝扫一扫

//首先引入支付宝js
<script src="https://gw.alipayobjects.com/as/g/h5-lib/alipayjsapi/3.1.1/alipayjsapi.inc.min.js"></script>
ap.scan({
            type: 'qr'
        }, function (res) {
            if (res.error == 10) {
                // 错误码为10:用户取消操作
                // ...
            } else if (res.error == 11) {
                // 错误码为11:扫码失败
                alert('扫码失败,请重试')
                // ....
            } else {
                console.log(res.code);
                // res.code为扫码返回的结果
                //alert(res.code);
                          }
                  )}
Strjson博客交流群QQ群:892570651
Vultr注册就送$50,可开日本/新加坡等机房,【点击注册
Last modification:September 19th, 2019 at 07:34 pm
If you think my article is useful to you, please feel free to appreciate

Leave a Comment