puzhibing
2023-08-01 25f2228000100801a128ba2d6f693f4a92d2bf87
cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCouponInfo.js
@@ -2,7 +2,9 @@
 * 初始化详情对话框
 */
var couponInfoDlg = {
    couponInfoData: {}
    couponInfoData: {},
    goodsPicArray: [], //商品图片数组
    goodsCover: '' //商品封面图
};
/**
@@ -56,47 +58,35 @@
    ajax.start();
}
/**
 * 发放方式1
 */
function distributionMethod1() {
    $("#demo2").hide()
}
/**
 * 发放方式2
 */
function distributionMethod2() {
    $("#demo2").hide()
}
/**
 * 发放方式3
 */
function distributionMethod3() {
    $("#demo2").hide()
}
/**
 * 兑换方式1
 */
function exchangeMethod1() {
    $("#demo2").show()
    $("#needAmount").hide();
    $("#needIntegral").show();
    $('#requiredPoints').val('');
    $('#requiredCash').val('');
}
/**
 * 兑换方式2
 */
function exchangeMethod2() {
    $("#demo2").show()
    $("#needAmount").show();
    $("#needIntegral").show();
    $('#requiredPoints').val('');
    $('#requiredCash').val('');
}
/**
 * 兑换方式3
 */
function exchangeMethod3() {
    $("#demo2").show()
    $("#needAmount").show();
    $("#needIntegral").hide();
    $('#requiredPoints').val('');
    $('#requiredCash').val('');
}
/**
@@ -123,20 +113,22 @@
 * 全国通用
 */
function scopeOfApplication1() {
    $("#storeSelect").hide()
    $("#citySelect").hide()
    $("#storeSelect").hide();
    $("#citySelect").hide();
}
/**
 * 指定城市
 */
function scopeOfApplication2() {
    $("#demo2").show()
    $("#storeSelect").hide();
    $("#citySelect").show();
}
/**
 * 指定门店
 */
function scopeOfApplication3() {
    $("#demo2").show()
    $("#storeSelect").show();
    $("#citySelect").hide();
}
/**
@@ -537,54 +529,4 @@
$(function () {
    var val3 = $("#couponType_").val();
    document.getElementById("couponType").selectedIndex = val3 - 1;
    if ($("#couponType").val() == 6) {
        $("#couponName1").show()
    }
    var val1 = $('#remark_').val();
    if (val1 != '' && val1 != null) {
        const detailTextarea = document.querySelector('#detail');
        detailTextarea.value = val1;
    }
    if ($('#times_').val() == 0) {
        $('#couponTimes').val('')
        $("#couponTimes").prop("disabled", true)
        $("#inlineCheckbox").prop('checked', true)
    } else {
        $('#couponTimes').val($('#times_').val())
    }
    // $(':radio[name="prescription"]:checked').val($("#timeType_").val())
    var val2 = $("#timeType_").val();
    $(":radio[name='prescription'][value=" + val2 + "]").prop("checked", "checked");
    if (val2 == 1) {
        $("#time").val('');
        // document.getElementById("time").readOnly = true;
        $("#time").attr('disabled', 'disabled');
        $("#createTime").removeAttr("disabled");
    } else if (val2 == 2) {
        $("#createTime").val('')
        // document.getElementById("time").readOnly = false;
        $("#time").removeAttr("disabled");
        $("#createTime").attr('disabled', 'disabled');
    } else {
        $("#time").val('')
        $("#createTime").val('')
        //document.getElementById("time").readOnly = true;
        $("#time").attr('disabled', 'disabled');
        $("#createTime").attr('disabled', 'disabled');
    }
    if ($("#belongs_").val() == '0') {
        $("#demo2").hide()
        $("input:radio[value='0']").attr('checked', 'true');
    } else {
        $("input:radio[value='4']").attr('checked', 'true');
    }
    // document.getElementById("time").readOnly = true;
    // $("#createTime").attr('disabled', 'disabled');couponTimes
    $("#couponTimes").val(1)
});