xuhy
2024-05-31 60618436b0d5e4ce7501b064285b6a4ff876201e
ManagementNTTravel/guns-admin/src/main/webapp/static/modular/system/generalization/generalization.js
@@ -22,7 +22,7 @@
            {title: '当前参与人数', field: 'count', visible: true, align: 'center', valign: 'middle',
                formatter: function (value, row) {
                    return '<a href="#"  style="color:cornflowerblue">'+row.count+'</a>' +'&nbsp;' +'&nbsp;'+'&nbsp;'+'&nbsp;'+'&nbsp;'+
                        '<a href="#" onclick="Generalization.activityRecord('+row.id+')" style="color:cornflowerblue">查看领取记录</a>' +'&nbsp;'
                        '<a href="#" onclick="Generalization.userCouponRecord('+row.id+')" style="color:cornflowerblue">查看领取记录</a>' +'&nbsp;'
                }
            },
            {title: '当前状态', field: 'state', visible: true, align: 'center', valign: 'middle',
@@ -128,26 +128,33 @@
    var imgElement = document.getElementById('qrCode');
    var imgURL = imgElement.src;
    console.log(imgURL)
    // var downloadLink = document.createElement('a');
    // downloadLink.href = imgURL;
    // downloadLink.download = '二维码.png'; // 自定义下载文件名
    // // 将链接添加到文档中(可以是隐藏的)
    // document.body.appendChild(downloadLink);
    // // 触发点击
    // downloadLink.click();
    // // 清理,可选
    // document.body.removeChild(downloadLink);
    var downloadLink = document.createElement('a');
    downloadLink.href = imgURL;
    downloadLink.download = '二维码.png'; // 自定义下载文件名
    // 将链接添加到文档中(可以是隐藏的)
    document.body.appendChild(downloadLink);
    // 触发点击
    downloadLink.click();
    // 清理,可选
    document.body.removeChild(downloadLink);
    // GeneralizationInfoDlg.close();
};
    var ajax = new $ax(Feng.ctxPath + "/generalization/downQrcode", function(data){
        Feng.success("下载成功!");
        GeneralizationInfoDlg.close();
    },function(data){
        Feng.error("下载失败!" + data.responseJSON.message + "!");
    });
    ajax.set("imgURL",imgURL);
    ajax.start();
/**
 * 领取记录
 */
Generalization.receiveRecord= function () {
    if (this.check()) {
        var index = layer.open({
            type: 2,
            title: '领取记录',
            area: ['100%', '100%'], //宽高
            fix: false, //不固定
            maxmin: true,
            content: Feng.ctxPath + '/userActivity/receiveRecord?activityId='+ UserActivity.seItem.id
        });
        this.layerIndex = index;
    }
};
/**
@@ -198,18 +205,16 @@
/**
 * 领取记录
 */
Generalization.receiveRecord= function () {
    if (this.check()) {
        var index = layer.open({
            type: 2,
            title: '领取记录',
            area: ['100%', '100%'], //宽高
            fix: false, //不固定
            maxmin: true,
            content: Feng.ctxPath + '/generalization/receiveRecord?activityId='+ Generalization.seItem.id
        });
        this.layerIndex = index;
    }
Generalization.userCouponRecord= function (id) {
    var index = layer.open({
        type: 2,
        title: '领取记录',
        area: ['100%', '100%'], //宽高
        fix: false, //不固定
        maxmin: true,
        content: Feng.ctxPath + '/userCouponRecord?activityType=5&couponActivityId='+ id
    });
    this.layerIndex = index;
};
/**