Backup/Discuz.Web/javascript/template_eccredit.js

(开头部分) 9KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

//加载当前用户的评价数据
function loadratedata(startpos,endpos, div_list, span_goodrate)
{
    var goodrate = 0; //好评数
    var sosorate = 0; //中评数
    var badrate = 0; //差评数
    var oneweekcount = 0;//最近一周评价数
    var onemonthcount = 0;//最近一个月评价数
    var sixmonthweekcount = 0;//最近六个月评价数
    var sixmonthagocount = 0;//6个月前评价数
    var ratecount = 0; //评价总数
    var rate_html = '<table cellspacing="0" cellpadding="5"><thead><tr><td>&nbsp;</td><td>最近1周</td><td>最近1个月</td><td>最近6个月</td><td>6个月前</td><td>总计</td></tr></thead><tbody>';
   
    for(i = startpos; i<endpos ;i++) {		
        oneweekcount += usercredit_data[i].oneweek;
        onemonthcount += usercredit_data[i].onemonth;
        sixmonthweekcount += usercredit_data[i].sixmonth;
        sixmonthagocount += usercredit_data[i].sixmonthago;
    
        rate_html += '<tr>';			
        curentratecount = usercredit_data[i].sixmonth +usercredit_data[i].sixmonthago;
        if(usercredit_data[i].ratetype == 1) {
		    rate_html +='<td><img src="templates/' + templatepath + '/images/good.gif" border="0" width="14" height="16" /><font color="red">好评</font></td>';
		    goodrate = curentratecount;
	    }else if(usercredit_data[i].ratetype == 2) {
	        rate_html +='<td><img src="templates/' + templatepath + '/images/soso.gif" border="0" width="14" height="16" /><font color="green">中评</font></td>';
	        sosorate = curentratecount;
	    }else if(usercredit_data[i].ratetype == 3) {
	        rate_html +='<td><img src="templates/' + templatepath + '/images/bad.gif" border="0" width="14" height="16" /><font color="black">差评</black></td>';
	        badrate = curentratecount;
	    }	
	    rate_html +='<td><a href="#" onclick="ajaxgetrate(' + uid + ',' +usercredit_data[i].ratefrom + ', ' + usercredit_data[i].ratetype + ',\'oneweek\');">' + usercredit_data[i].oneweek + '</a></td>';
	    rate_html +='<td><a href="#" onclick="ajaxgetrate(' + uid + ',' +usercredit_data[i].ratefrom + ', ' + usercredit_data[i].ratetype + ',\'onemonth\');">' + usercredit_data[i].onemonth + '</a></td>';
	    rate_html +='<td><a href="#" onclick="ajaxgetrate(' + uid + ',' +usercredit_data[i].ratefrom + ', ' + usercredit_data[i].ratetype + ',\'sixmonth\');">' + usercredit_data[i].sixmonth + '</a></td>';
	    rate_html +='<td><a href="#" onclick="ajaxgetrate(' + uid + ',' +usercredit_data[i].ratefrom + ', ' + usercredit_data[i].ratetype + ',\'sixmonthago\');">' + usercredit_data[i].sixmonthago + '</a></td>';
	    rate_html +='<td>' + curentratecount + '</td>';
	    rate_html +='</tr>';
    }				
    rate_html +='<tr><td>总计</td>';
    
    var ratefrom = 1; //来自卖家
    if(startpos == 0) {
        ratefrom = 2; //来自买家
    }
    rate_html +='<td><a href="#" onclick="ajaxgetrate(' + uid + ', ' + ratefrom + ', 0, \'oneweek\');">' + oneweekcount + '</a></td>';
    rate_html +='<td><a href="#" onclick="ajaxgetrate(' + uid + ', ' + ratefrom + ', 0, \'onemonth\');">' + onemonthcount + '</a></td>';
    rate_html +='<td><a href="#" onclick="ajaxgetrate(' + uid + ', ' + ratefrom + ', 0, \'sixmonth\');">' + sixmonthweekcount + '</a></td>';
    rate_html +='<td><a href="#" onclick="ajaxgetrate(' + uid + ', ' + ratefrom + ', 0, \'sixmonthago\');">' + sixmonthagocount + '</a></td>';

    ratecount = sixmonthweekcount + sixmonthagocount;
    rate_html +='<td>'+ ratecount +'</td>';
    rate_html +='</tr></tbody></table>';
    
    $(div_list).innerHTML = rate_html;

    if(ratecount > 0) { 
        $(span_goodrate).innerHTML = parseFloat((goodrate / ratecount) * 100).toFixed(2) + '%';
    }
    else {
        $(span_goodrate).innerHTML = '0.00%';
后面还有 143 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。