將字符串裝換成二維碼


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();
                }
            });

 通過這個方法即可將二維碼串轉換成二維碼的形式。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM