template使用1------转换日期格式
















(function(){
	loadBankDetailReport();
})

function loadBankDetailReport() {
        loadBigDataReport(
            "#bankDetail",
            "${root}/static/tpl/_report.tpl",
            bigDataRequestUrl,
            "BANK_DETAIL",
            function (resp, data) {
                console.log("bank:", data);
                var bankDetailReport = data["DETAIL"];


                if (bankDetailReport) {
                    bankDetailReport = bankDetailReport["wd_api_ibank_getdata_response"]["data_list"][0];
                    var render = template.compile(resp);
                    var html = render(bankDetailReport);
                    $("#bankDetail").html(html);
                    return true;
                }
                return false;
            });
    }




    /**
     获取
     */
    function loadBigDataReport(templateId, templateUrl, bigDataRequestUrl, dataTypes, renderCallback, extData) {
        $.get(
            templateUrl,
            function (resp) {
                if (resp != null) {
                    $.ajax({
                        url: bigDataRequestUrl,
                        type: 'POST',
                        dataType: 'json',
                        data: $.extend({
                            customerId: creditDataCustomerId,
                            dataType: dataTypes
                        }, extData),
                        success: function (data) {
                            var renderResult = renderCallback(resp, data);
                            if (renderResult != null && !renderResult) {
                                var str = "

" + "暂无数据" + "

"; $(templateId).html(str); } }, error: function () { var str = "

" + "数据异常" + "

"; $(templateId).html(str); } }); } }); }

 
  

你可能感兴趣的:(artTemplate)