window.onload = function() { ifLogin(function(flag) { $('body').show(); httpLoadInfo(); }); } function httpLoadInfo() { $.ajax({ type: "post", url: base_api + 'user/fx-user/order-list', dataType: 'json', success: function(res_data) { ZZLog(res_data); if(false == res_data['flag']) { if(codeNotLogin == res_data['code']) { // alert(infoNotLogin) var URL = '/web/fx/commission_list.html'; URL = encodeURI(URL); location.href = res_data['url'] + URL; } else if(codeNotRegister == res_data['code']) { location.href = 'register.html'; } else { alert(res_data['msg']); } } else { //.. var data = res_data['data']; var order_list = data['order_list']; var HTML = ''; for(var i = 0, m = order_list.length; i < m; i++) { var dict = order_list[i]; var tempHTML = getHTMLWithParam(dict); HTML += tempHTML; } $('.list_info').html(HTML); if(order_list.length == 0) { $('#no_info').show(); return; } else { $('#no_info').hide(); } } }, error: function() { alert(infoApiError); } }); } function getHTMLWithParam(dict) { var month = getMonthAndDayByDate(dict['start_date'], 'month'); var day = getMonthAndDayByDate(dict['start_date'], 'day'); var str = dict.status == '1' ? '
' + dict['status_desc'] + '
' : '
' + dict['status_desc'] + '
'; var html = '
  • ' + '
    ' + month + '月' + day + '日
    ' + '
    ' + dict['pro_cate_name'] + '
    ' + '
    ¥' + dict['commission_total_money'] + '
    ' + str + '
  • ' return html; }