将字符串装换成二维码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
function handleResult(url, res, data, isDeposit) {
    if (res.code === 0) {
        if ('SCAN_WEIXIN' === data.field.payMethodType || 'SCAN_ALIPAY' === data.field.payMethodType) {
            $("#qrCode").append('<div id="code" style="margin-top: 25px;"></div>');
            jQuery('#code').qrcode({
                render: "table",
                text: res.data.respMap.payInfo
            });
            layer.open({
                title: '请扫描二维码支付',
                type: 1,
                content: $('#code'),
                yes: function () {
                    $('#code').empty();
                    layer.closeAll();
                },
                cancel: function () {
                    $('#code').empty();
                    layer.closeAll();
                }
            });
        }else if ('CODEPAY_W' === data.field.payMethodType) {
            layer.open({
                title: '提示信息',
                content: res.data.respMap.payStatus,
                yes: function () {          
                    layer.closeAll();
                },
                cancel: function () {
                    layer.closeAll();
                }
            });

 通过这个方法即可将二维码串转换成二维码的形式。

posted @   jourage  阅读(2293)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示