日韩天天综合网_野战两个奶头被亲到高潮_亚洲日韩欧美精品综合_av女人天堂污污污_视频一区**字幕无弹窗_国产亚洲欧美小视频_国内性爱精品在线免费视频_国产一级电影在线播放_日韩欧美内地福利_亚洲一二三不卡片区

如何修改資金余額小數(shù)位數(shù)_動(dòng)易Cms教程

編輯Tag賺U幣
教程Tag:暫無(wú)Tag,歡迎添加,賺取U幣!

問(wèn)題:如何修改資金余額小數(shù)位數(shù)
解決:后臺(tái)管理 >> 系統(tǒng)設(shè)置 >> 模板標(biāo)簽管理 >> 標(biāo)簽管理,找到并修改標(biāo)簽“Ajax用戶登錄”,找到下面段代碼

function GetUserInfo(xml)
   {
        var userInfo="<div class=\"u_login\">"+xml.getElementsByTagName("username")[0].firstChild.data+",您好!您有:<br/>";
        userInfo =userInfo +"資金余額:"+xml.getElementsByTagName("balance")[0].firstChild.data+" 元<br/>";
        userInfo =userInfo +"經(jīng)驗(yàn)積分:"+xml.getElementsByTagName("exp")[0].firstChild.data+" 分<br/>";
        userInfo =userInfo +"待閱短信:"+xml.getElementsByTagName("msg")[0].firstChild.data+" 條<br/>";
        userInfo =userInfo +"登錄次數(shù):"+xml.getElementsByTagName("logintimes")[0].firstChild.data+" 次<br/>";
        userInfo =userInfo +"可用點(diǎn)券:"+xml.getElementsByTagName("point")[0].firstChild.data+" "+xml.getElementsByTagName("pointunit")[0].firstChild.data+"<br/>";
        userInfo =userInfo +"待簽文章:"+xml.getElementsByTagName("signincontent")[0].firstChild.data+" 篇<br/>";
        userInfo =userInfo +"<div style=\"text-align: center\"><a href=\"{PE.SiteConfig.ApplicationPath /}User/Default.aspx\" target=\"_top\">會(huì)員中心</a>&nbsp;&nbsp;|&nbsp;&nbsp;";
        userInfo =userInfo +"<a href=\"{PE.SiteConfig.ApplicationPath /}User/Logout.aspx\" target=\"_top\">退出登錄</a></div>";
        userInfo=userInfo+"</div>";
        return userInfo;
   }


 

改為:

function GetUserInfo(xml)
   {
        var userInfo="<div class=\"u_login\">"+xml.getElementsByTagName("username")[0].firstChild.data+",您好!您有:<br/>";
        userInfo =userInfo +"資金余額:"+xml.getElementsByTagName("balance")[0].firstChild.data+" 元<br/>";
        userInfo =userInfo +"資金余額:"+round(xml.getElementsByTagName("balance")[0].firstChild.data,2)+" 元<br/>";
        userInfo =userInfo +"經(jīng)驗(yàn)積分:"+xml.getElementsByTagName("exp")[0].firstChild.data+" 分<br/>";
        userInfo =userInfo +"待閱短信:"+xml.getElementsByTagName("msg")[0].firstChild.data+" 條<br/>";
        userInfo =userInfo +"登錄次數(shù):"+xml.getElementsByTagName("logintimes")[0].firstChild.data+" 次<br/>";
        userInfo =userInfo +"可用點(diǎn)券:"+xml.getElementsByTagName("point")[0].firstChild.data+" "+xml.getElementsByTagName("pointunit")[0].firstChild.data+"<br/>";
        userInfo =userInfo +"待簽文章:"+xml.getElementsByTagName("signincontent")[0].firstChild.data+" 篇<br/>";
        userInfo =userInfo +"<div style=\"text-align: center\"><a href=\"{PE.SiteConfig.ApplicationPath /}User/Default.aspx\" target=\"_top\">會(huì)員中心</a>&nbsp;&nbsp;|&nbsp;&nbsp;";
        userInfo =userInfo +"<a href=\"{PE.SiteConfig.ApplicationPath /}User/Logout.aspx\" target=\"_top\">退出登錄</a></div>";
        userInfo=userInfo+"</div>";
        return userInfo;
   }
 function round(v,e)
    {
        var t=1;
        for(;e>0;t*=10,e--);
        for(;e<0;t/=10,e );
        return Math.round(v*t)/t;
    }

 

修改下面的“2”,可以實(shí)現(xiàn)位數(shù)控制,0為無(wú)小數(shù)位,1為一位小數(shù),2為二位小數(shù),3為三位小數(shù)。

        userInfo =userInfo +"資金余額:"+round(xml.getElementsByTagName("balance")[0].firstChild.data,2)+" 元<br/>"; 
    

查看更多 動(dòng)易Cms教程  動(dòng)易Cms模板

來(lái)源:模板無(wú)憂//所屬分類:動(dòng)易Cms教程/更新時(shí)間:2009-07-27
相關(guān)動(dòng)易Cms教程