| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370 |
- $(function () {
- // 公告关闭
- $('.article-top span').click(function() {
- $('.article-top').hide(500)
- })
- // 自动轮播
- $('#myCarousel').carousel({
- interval: 5000
- })
- // uas
- $('#myCarousel01').carousel({
- interval: 5000
- })
- // 新闻集锦
- $('#myCarousel02').carousel({
- interval: 5000
- })
- // 商城点击切换
- $('.section-bottom01 span').on('click', function () {
- var index = $(this).index();
- $(this).addClass('active').siblings().removeClass('active');
- $('.section-toggle01').eq(index).addClass('show').siblings().removeClass('show');
- })
- // u创
- $('.section-bottom02>span.tab').on('click', function () {
- var index = $(this).index();
- $(this).addClass('active').siblings().removeClass('active');
- $('.section-process').eq(index).addClass('show').siblings().removeClass('show');
- $('.c_case').eq(index).addClass('show').siblings().removeClass('show');
- })
- $('.c_tab>span.c_toggle').on('click', function () {
- var index = $(this).index();
- $(this).addClass('active').siblings().removeClass('active');
- $('.c_item_list').eq(index).addClass('show').siblings().removeClass('show');
- })
- // 成熟方案
- $('.case_indus_list').on('click', function () {
- var id = $(this).attr('id')
- $(this).addClass('active').siblings().removeClass('active');
- $.ajax({
- type: "GET",
- url: "https://login.usoftchina.com/ubtob/index/getProgramme",
- data: {id:id},
- dataType: "json",
- success: function(data){
- var html = '';
- if (data.data){
- $.each(data.data, function (k, v) {
- html += '<div class="c_case_list">'+
- '<a href="' + v.url + '">'+
- '<div class="c_img">'+
- '<img src="' + v.banner + '" alt="">'+
- '</div>'+
- '<p class="c_case_overflow">' + v.ptitle + '</p>'+
- '<div class="c_item_bottom">'+
- '<span>' + v.shop_name + '</span><span>价格: <b>¥' + v.price + '</b></span>'+
- '</div>'+
- '<div class="hover_case">'+
- '<div class="case_top">'+
- '<p class="c_case_title c_case_overflow">' + v.ptitle + '</p>'+
- '<div class="c_case_count">'+
- '<span>浏览 <span>' + v.views + '</span></span>'+
- '<span>成交量 <span>' + v.invitation + '</span></span>'+
- '</div>'+
- '</div>'+
- '<div class="case_bottom">'+
- '<div class="c_case_price">'+
- '<span>店铺名</span>'+
- '<span>价格: <span>¥' + v.price + '</span></span>'+
- '</div>'+
- '<a href="' + v.url + '" class="case_look">点击查看</a>'+
- '</div>'+
- '</div>'+
- '</a>'+
- '</div>'
- })
- }
- $('.c_case_content01').html(html)
- }
- });
- })
- $(document).ready(function(){
- $('.case_indus_list:first-child').addClass('active')
- $('.u_items:nth-child(2)').addClass('active')
- });
- // u客论坛
- // $('.k_item_list').on('click', function () {
- // $(this).addClass('active').siblings().removeClass('active');
- // })
- $(".k_item_list").hover(function(){
- $(this).addClass("active")
- .siblings().removeClass('active');
- });
- $(".u_char").hover(function(){
- $(this).addClass("active")
- .siblings().removeClass('active');
- });
- // 资讯
- $('.title_list_active').hover(function () {
- var index = $(this).index();
- $(this).addClass('active').siblings().removeClass('active');
- $('.hot_info_list_active').eq(index).addClass('show').siblings().removeClass('show');
- })
- // 滚动效果
- // function AutoScroll(obj){
- // $(obj).find(".scroll:first").animate({
- // marginTop:"-74px"
- // },500,function(){
- // $(this).css({marginTop:"0px"}).find("div.scroll .item-list:first").appendTo(this);
- // });
- // }
- // $(document).ready(function(){
- // setInterval('AutoScroll(".dynamic-scroll")',3000);
- // });
- // $(document).ready(function(){
- // $.fn.scrollTop = function(options){
- // var defaults = {
- // speed:30
- // }
- // var opts = $.extend(defaults,options);
- // this.each(function(){
- // var $timer;
- // var scroll_top=0;
- // var obj = $(this);
- // var $height = obj.find(".scroll").height();
- // obj.find(".scroll").clone().appendTo(obj);
- // obj.hover(function(){
- // clearInterval($timer);
- // },function(){
- // $timer = setInterval(function(){
- // scroll_top++;
- // if(scroll_top > $height){
- // scroll_top = 0;
- // }
- // obj.find(".scroll").first().css("margin-top",-scroll_top);
- // },opts.speed);
- // }).trigger("mouseleave");
- // })
- // }
- // })
- // $(document).ready(function(){
- // $(".scroll").scrollTop({
- // speed:30 //数值越大 速度越慢
- // });
- // })
- // 返回页面顶部
- $(window).on('scroll',function(){
- var $goTop=$('.go-top');
- if($(this).scrollTop()>0){
- $goTop.css("display","block");
- }else{
- $goTop.css("display","none");
- }
- })
- $('.go-top').click(function(e){
- e.preventDefault();
- if ($('html').scrollTop()) {
- $('html').animate({ scrollTop: 0 }, 1000);
- return false;
- }
- $('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 userspaceCount, userCount, lastYearTraderCount, thisYearTraderCount, yearDate, upYearDate;
- yearDate = new Date().getFullYear();
- upYearDate = yearDate - 1;
- // 企业用户数量
- $.ajax({
- type: "GET",
- url: "https://ssorest.usoftchina.com/api/enterprise/total/get",
- dataType: "json",
- success: function (data) {
- if(data.entTotal) {
- userspaceCount = toFinxedNum(data.entTotal, 1)
- } else {
- userspaceCount = '- 家';
- }
- $('.userspace-count').html(userspaceCount)
- },
- error: function () {
- $('.userspace-count').html('- 家')
- }
- })
- // 个人用户数量
- $.ajax({
- type: "GET",
- url: "https://ssorest.usoftchina.com/api/user/total/get",
- dataType: "json",
- success: function (data) {
- if(data.userTotal) {
- userCount = toFinxedNum(data.userTotal, 2)
- } else {
- userCount = '- 个';
- }
- $('.user-count').html(userCount)
- },
- error: function () {
- $('.user-count').html('- 个')
- }
- })
- $.ajax({
- type: "GET",
- url: "https://oldmall.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 == 3) {
- thisYearTraderCount = data[m].count;
- } else if(data[m].detno == 4) {
- lastYearTraderCount = data[m].count;
- }
- }
- $('.last-year-trader-count').html(upYearDate + '年' + toFinxedNum(lastYearTraderCount, 3))
- $('.this-year-trader-count').html(yearDate + '年' + toFinxedNum(thisYearTraderCount, 3))
- } else {
- $('.last-year-trader-count').html(upYearDate + '年' + ' ' + '- 元')
- $('.this-year-trader-count').html(yearDate + '年' + ' ' + '- 元')
- }
- },
- error: function() {
- $('.last-year-trader-count').html(upYearDate + '年' + ' ' + '- 元')
- $('.this-year-trader-count').html(yearDate + '年' + ' ' + '- 元')
- }
- })
- // 首页计数器END
- $.ajax({
- type: "GET",
- url: "sso/loginInfo",
- dataType: "json",
- success: function (data) {
- if (data.success && data.userAccount) {
- if (data.userAccount.spaceName) {
- $('#username').html(data.userAccount.vipName + ' | ' + data.userAccount.spaceName);
- } else {
- $('#username').html(data.userAccount.vipName);
- }
- $('.login').show();
- $('.unLogin').hide();
- } else {
- $('.login').hide();
- $('.unLogin').show();
- }
- }
- })
- $('.a_login').click(function () {
- window.location.href = 'https://sso2.usoftchina.com/login.html?returnUrl=' + encodeURIComponent(window.location.href);
- })
- $('.a_logout').click(function () {
- window.location.href = 'https://sso2.usoftchina.com/loginOut.html?returnUrl=' + encodeURIComponent(window.location.href) + '&baseUrl=' + encodeURIComponent('https://ssorest.usoftchina.com');
- });
- $('.a_register').click(function () {
- window.location.href = 'https://sso2.usoftchina.com/companyRegister.html?returnUrl=' + encodeURIComponent(window.location.href);
- })
- // 更新上传品牌数据计数
- $.ajax({
- type: "GET",
- url: "https://oldmall.usoftchina.com/api/product/commoncount/3/count",
- dataType: "json",
- success: function(data) {
- $("#mall_count_brands").text('品牌' + data + '个')
- }
- })
- $.ajax({
- type: "GET",
- url: "https://oldmall.usoftchina.com/inquiry/public/getCountOfLastAndThisMonth",
- dataType: "json",
- success: function(json) {
- $("#mall_count_inquiry").text('本月询价条数' + json.current)
- }
- })
- $.ajax({
- type: "GET",
- url: "https://oldmall.usoftchina.com/api/product/commoncount/12/count",
- dataType: "json",
- success: function(json) {
- json = (json - json % 100000000)/100000000
- $("#mall_count_goods").text('产品库存数' + json + '亿')
- }
- })
- $.ajax({
- type: "GET",
- url: "https://login.usoftchina.com/ubtob/index/getZbSta",
- dataType: "json",
- success: function(json) {
- var html = ''
- for (var i = 0; i < json.data.length; i++) {
- html += '<div>'+json.data[i]+'</div>'
- }
- $("#uuzcc_count_platform").html(html)
- }
- })
- $.ajax({
- type: "GET",
- url: "https://login.usoftchina.com/ubtob/index/getBbsSta",
- dataType: "json",
- success: function(json) {
- console.log(json)
- var html = ''
- for (var i = 0; i < json.data.length; i++) {
- html += '<div>'+json.data[i]+'</div>'
- }
- $("#uuzcc_count_bbs").html(html)
- }
- })
- });
|