将字符串装换成二维码


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