|
|
@@ -145,6 +145,7 @@ $(function () {
|
|
|
// speed:30 //数值越大 速度越慢
|
|
|
// });
|
|
|
// })
|
|
|
+
|
|
|
// 返回页面顶部
|
|
|
$(window).on('scroll',function(){
|
|
|
var $goTop=$('.go-top');
|
|
|
@@ -164,6 +165,101 @@ $(function () {
|
|
|
$('body').animate({ scrollTop: 0 }, 1000);
|
|
|
return false;
|
|
|
})
|
|
|
+
|
|
|
+ // 首页计数器使用
|
|
|
+ $('#statistic .count-close').click(function () {
|
|
|
+ $(this).parent().hide()
|
|
|
+ })
|
|
|
+
|
|
|
+ function strNumSize(tempNum) {
|
|
|
+ var stringNum = tempNum.toString();
|
|
|
+ var index = stringNum.indexOf(".");
|
|
|
+ var newNum = stringNum;
|
|
|
+ if(index != -1) {
|
|
|
+ newNum = stringNum.substring(0, index)
|
|
|
+ }
|
|
|
+ return newNum.length;
|
|
|
+ }
|
|
|
+ function unitConvert(num) {
|
|
|
+ var moneyUnits = ["", "万", "亿", "万亿"];
|
|
|
+ var dividend = 10000;
|
|
|
+ var curentNum = num;
|
|
|
+ //转换数字
|
|
|
+ var curentUnit = moneyUnits[0];
|
|
|
+ //转换单位
|
|
|
+ for(var i = 0; i < 4; i++) {
|
|
|
+ curentUnit = moneyUnits[i];
|
|
|
+ if(strNumSize(curentNum) < 5) {
|
|
|
+ break;
|
|
|
+ };
|
|
|
+ curentNum = curentNum / dividend;
|
|
|
+ }
|
|
|
+ return curentNum.toFixed(2) + curentUnit;
|
|
|
+ }
|
|
|
+
|
|
|
+ function toFinxedNum (num, flag) {
|
|
|
+ var type = Number(num);
|
|
|
+ var countd = 0;
|
|
|
+ var unit = '';
|
|
|
+ if(flag == 1) {
|
|
|
+ unit = '家'
|
|
|
+ } else if(flag == 2) {
|
|
|
+ unit = '人'
|
|
|
+ } else if(flag == 3) {
|
|
|
+ unit = '元'
|
|
|
+ } else {
|
|
|
+ unit = '个'
|
|
|
+ }
|
|
|
+ count = type > 100000 ? unitConvert(type) : type;
|
|
|
+ return (count + unit)
|
|
|
+ }
|
|
|
+
|
|
|
+ var countHtml = ''
|
|
|
+ $.ajax({
|
|
|
+ type: "GET",
|
|
|
+ url: "https://mall.usoftchina.com/api/product/commoncount?usedFor=usoftchina_home_counter&_status=actived",
|
|
|
+ dataType: "json",
|
|
|
+ success: function(data) {
|
|
|
+ if(data) {
|
|
|
+ for(var m = 0; m < data.length; m++) {
|
|
|
+ if(data[m].detno == 1) {
|
|
|
+ countHtml += '<div class="items"><p class="title">企业用户</p><span class="count-item">' + toFinxedNum(data[m].count, 1) + '</span></div>';
|
|
|
+ } else if(data[m].detno == 2) {
|
|
|
+ countHtml += '<div class="items"><p class="title">个人用户</p><span class="count-item">' + toFinxedNum(data[m].count, 2) + '</span></div>';
|
|
|
+ } else if(data[m].detno == 3) {
|
|
|
+ countHtml += '<div class="items"><p class="title two_item">交易金额</p><span class="count-item">本年' + toFinxedNum(data[m].count, 3) + '</span><br/>';
|
|
|
+ } else if(data[m].detno == 4) {
|
|
|
+ countHtml += '<span class="count-item">上年' + toFinxedNum(data[m].count, 3) + '</span></div>';
|
|
|
+ } else if(data[m].detno == 5) {
|
|
|
+ countHtml += '<div class="items"><p class="title two_item">研发需求</p><span class="count-item">本年' + toFinxedNum(data[m].count, 4) + '</span><br/>';
|
|
|
+ } else if(data[m].detno == 6) {
|
|
|
+ countHtml += '<span class="count-item">上年' + toFinxedNum(data[m].count, 4) + '</span></div>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ countHtml += '<div class="items"><p class="title">企业用户</p><span class="count-item">' + toFinxedNum(10428, 1) + '</span></div>';
|
|
|
+ countHtml += '<div class="items"><p class="title">个人用户</p><span class="count-item">' + toFinxedNum(41282, 2) + '</span></div>';
|
|
|
+ countHtml += '<div class="items"><p class="title two_item">交易金额</p><span class="count-item">本年' + toFinxedNum(15283268864.27, 3) + '</span><br/>';
|
|
|
+ countHtml += '<span class="count-item">上年' + toFinxedNum(11728286832.86, 3) + '</span></div>';
|
|
|
+ countHtml += '<div class="items"><p class="title two_item">研发需求</p><span class="count-item">本年' + toFinxedNum(383, 4) + '</span><br/>';
|
|
|
+ countHtml += '<span class="count-item">上年' + toFinxedNum(1, 4) + '</span></div>';
|
|
|
+ }
|
|
|
+ $('#statistic .count-list').html(countHtml)
|
|
|
+ },
|
|
|
+ error: function() {
|
|
|
+ countHtml += '<div class="items"><p class="title">企业用户</p><span class="count-item">' + toFinxedNum(10428, 1) + '</span></div>';
|
|
|
+ countHtml += '<div class="items"><p class="title">个人用户</p><span class="count-item">' + toFinxedNum(41282, 2) + '</span></div>';
|
|
|
+ countHtml += '<div class="items"><p class="title two_item">交易金额</p><span class="count-item">本年' + toFinxedNum(15283268864.27, 3) + '</span><br/>';
|
|
|
+ countHtml += '<span class="count-item">上年' + toFinxedNum(11728286832.86, 3) + '</span></div>';
|
|
|
+ countHtml += '<div class="items"><p class="title two_item">研发需求</p><span class="count-item">本年' + toFinxedNum(383, 4) + '</span><br/>';
|
|
|
+ countHtml += '<span class="count-item">上年' + toFinxedNum(1, 4) + '</span></div>';
|
|
|
+ $('#statistic .count-list').html(countHtml)
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ // 首页计数器END
|
|
|
+
|
|
|
+
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
url: "sso/loginInfo",
|