From 62be66876a9a40fc6189b5481b6ad67bb453b541 Mon Sep 17 00:00:00 2001 From: wb Date: Thu, 23 Nov 2017 15:14:13 +0800 Subject: [PATCH] 接口平台对接 --- css/libCss/common.css | 8 ++++---- index.html | 343 ++----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- js/index.js | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------- js/pdalatform.js | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------ js/unit.js | 14 ++++++++++---- js/wechatlatform.js | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- pdalatform.html | 338 ++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ wechatlatform.html | 343 ++----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 8 files changed, 200 insertions(+), 1044 deletions(-) diff --git a/css/libCss/common.css b/css/libCss/common.css index b01758c..4035465 100644 --- a/css/libCss/common.css +++ b/css/libCss/common.css @@ -63,7 +63,7 @@ header{ /*左侧栏--------------------------------------------------*/ .main-wrap{ min-width: 1400px; - overflow-x: scroll; + overflow-x: auto; height: calc(100% - 80px); } nav{ @@ -238,7 +238,7 @@ section{ .ranking-list{ height: 534px; background-color: #f9f9f9; - overflow-y: scroll; + overflow-y: auto; overflow-x: hidden; } .ranking-list li{ @@ -307,7 +307,7 @@ section{ .list-con-wrap{ width: 1092px; height: 537px; - overflow-y: scroll; + overflow-y: auto; } .list-con-wrap li{ @@ -335,7 +335,7 @@ section{ /*API详情----------------------------------------*/ .list-detail-wrap{ height: 581px; - overflow-y: scroll; + overflow-y: auto; } .list-detail-title{ font-size: 20px; diff --git a/index.html b/index.html index 5e81d4b..ded20a2 100644 --- a/index.html +++ b/index.html @@ -56,7 +56,7 @@ 总接口数 @@ -66,7 +66,7 @@ 今日活跃接口数 @@ -83,81 +83,6 @@ 调用排行榜 @@ -171,270 +96,6 @@
  • 描述
  • diff --git a/js/index.js b/js/index.js index e785f49..1facdbe 100644 --- a/js/index.js +++ b/js/index.js @@ -21,7 +21,7 @@ var fun = { grid: { left: '0', right: '3%', - bottom: '0', + bottom: '1%', top:'3%', containLabel: true }, @@ -30,7 +30,7 @@ var fun = { boundaryGap: false, type : 'category', boundaryGap : false, - data : ['周一','周二','周三','周四','周五','周六','周日'], + data : ['首页','支付','我的管理','余额','会员卡','车牌'], axisTick:{ show:false, }, @@ -92,18 +92,72 @@ var fun = { width:3, } }, - data:[120, 132, 101, 134, 90, 230, 210] + data:[4, 12, 14, 9, 8, 3, 8] }, ] }; - - + homePage(); + queryApiList(); // 使用刚指定的配置项和数据显示图表。 myChart.setOption(option); }, }; fun.init(); + +function homePage(){ + var req = { + sysCode: sysComm.sysCode, + apiType: 1 + }; + sysAjax({ + method: "post", + url: dataUrl.util.queryHomePage(), + data: JSON.stringify(req), + contentType: 'application/json; charset=utf-8', + dataType: 'json', + async: false, + success: function(res) { + $('#total_api_no').text(res.apiCount); + $('#total_api_hy__no').text(res.apiHYCount) + $.each(res.apiListDTO, function (index, domEle) { + var str = '
  • '; + str += '
    '; + str += '
    '+domEle.uddi+'
    '; + str += '
    '+domEle.apiCount+'
    '; + str += '
  • '; + $('.ranking-list').append(str) + }); + } + }); +}; + +function queryApiList(){ + var req = { + sysCode: sysComm.sysCode, + apiType: 1 + }; + sysAjax({ + method: "post", + url: dataUrl.util.queryApiList(), + data: JSON.stringify(req), + contentType: 'application/json; charset=utf-8', + dataType: 'json', + async: false, + success: function(res) { + $.each(res, function (index, domEle) { + var str = '
  • '; + str += '
    '; + str += ''+domEle.code+''; + str += '
    '; + str += '
    '+domEle.uddi+'
    '; + str += '
  • '; + $('#list-con-wrap').append(str) + }); + } + }); +}; + $('#link-div span').on('click',function () { var index = $(this).index(); $(this).addClass('linkActive').siblings('span').removeClass('linkActive'); @@ -114,8 +168,8 @@ $('#link-div span').on('click',function () { }); $(document).delegate('#list-con-wrap li span','click',function () { var id = $(this).attr('data-id'); - alert(id); - $('#list-main-wrap').addClass('display-none'); - $('#list-detail-wrap').removeClass('display-none'); + window.open(id);    + /* $('#list-main-wrap').addClass('display-none'); + $('#list-detail-wrap').removeClass('display-none');*/ }); diff --git a/js/pdalatform.js b/js/pdalatform.js index 7193f55..82be17e 100644 --- a/js/pdalatform.js +++ b/js/pdalatform.js @@ -30,7 +30,7 @@ var fun = { boundaryGap: false, type : 'category', boundaryGap : false, - data : ['周一','周二','周三','周四','周五','周六','周日'], + data : ['首页','入场','出场','欠费补缴','停车记录','退款'], axisTick:{ show:false, }, @@ -92,18 +92,74 @@ var fun = { width:3, } }, - data:[120, 132, 101, 134, 90, 230, 210] + data:[5, 8, 2, 12, 3, 9, 8] }, ] }; - +homePage(); + queryApiList(); // 使用刚指定的配置项和数据显示图表。 myChart.setOption(option); }, }; fun.init(); + +function homePage(){ + var req = { + sysCode: sysComm.sysCode, + apiType: 2 + }; + sysAjax({ + method: "post", + url: dataUrl.util.queryHomePage(), + data: JSON.stringify(req), + contentType: 'application/json; charset=utf-8', + dataType: 'json', + async: false, + success: function(res) { + $('#total_api_no_pda').text(res.apiCount); + $('#total_api_hy__no_pda').text(res.apiHYCount) + $.each(res.apiListDTO, function (index, domEle) { + var str = '
  • '; + str += '
    '; + str += '
    '+domEle.uddi+'
    '; + str += '
    '+domEle.apiCount+'
    '; + str += '
  • '; + $('.ranking-list').append(str) + }); + } + }); +}; + +function queryApiList(){ + var req = { + sysCode: sysComm.sysCode, + apiType: 2 + }; + sysAjax({ + method: "post", + url: dataUrl.util.queryApiList(), + data: JSON.stringify(req), + contentType: 'application/json; charset=utf-8', + dataType: 'json', + async: false, + success: function(res) { + $.each(res, function (index, domEle) { + var str = '
  • '; + str += '
    '; + str += ''+domEle.code+''; + str += '
    '; + str += '
    '+domEle.uddi+'
    '; + str += '
  • '; + $('#list-con-wrap').append(str) + }); + } + }); +}; + + $('#link-div span').on('click',function () { var index = $(this).index(); $(this).addClass('linkActive').siblings('span').removeClass('linkActive'); @@ -114,8 +170,6 @@ $('#link-div span').on('click',function () { }); $(document).delegate('#list-con-wrap li span','click',function () { var id = $(this).attr('data-id'); - alert(id); - $('#list-main-wrap').addClass('display-none'); - $('#list-detail-wrap').removeClass('display-none'); + window.open(id);  }); diff --git a/js/unit.js b/js/unit.js index c57f2ac..76fcae5 100644 --- a/js/unit.js +++ b/js/unit.js @@ -19,9 +19,9 @@ sysComm = { // var authUrl = 'http://sys.service.rnting.com/';// 鉴权URL公用地址 //61环境,别删 -var baseUrl = 'http://61.177.139.228:18088/';// url公用地址 -var parkcloudbaseUrl = 'http://61.177.139.228:18093/';// url公用地址 -var authUrl = 'http://61.177.139.228:18088/';// 鉴权URL公用地址 +var baseUrl = 'http://localhost:8099/';// url公用地址 +var parkcloudbaseUrl = 'http://localhost:8099/';// url公用地址 +var authUrl = 'http://localhost:8099/';// 鉴权URL公用地址 var dataUrl = dataUrl || {}; @@ -56,7 +56,13 @@ dataUrl.util = { return baseUrl + 'oauth/loginout' }, - + queryHomePage: function () { + return baseUrl + 'api/apiHome' + }, + queryApiList: function () { + return baseUrl + 'api/apiList' + }, + } //公共方法 fn = { diff --git a/js/wechatlatform.js b/js/wechatlatform.js index 7193f55..3b34d50 100644 --- a/js/wechatlatform.js +++ b/js/wechatlatform.js @@ -98,12 +98,68 @@ var fun = { ] }; - + homePage(); + queryApiList(); // 使用刚指定的配置项和数据显示图表。 myChart.setOption(option); }, }; fun.init(); + +function homePage(){ + var req = { + sysCode: sysComm.sysCode, + apiType: 3 + }; + sysAjax({ + method: "post", + url: dataUrl.util.queryHomePage(), + data: JSON.stringify(req), + contentType: 'application/json; charset=utf-8', + dataType: 'json', + async: false, + success: function(res) { + $('#total_api_no_wx').text(res.apiCount); + $('#total_api_hy__no_wx').text(res.apiHYCount) + $.each(res.apiListDTO, function (index, domEle) { + var str = '
  • '; + str += '
    '; + str += '
    '+domEle.uddi+'
    '; + str += '
    '+domEle.apiCount+'
    '; + str += '
  • '; + $('.ranking-list').append(str) + }); + } + }); +}; + +function queryApiList(){ + var req = { + sysCode: sysComm.sysCode, + apiType: 3 + }; + sysAjax({ + method: "post", + url: dataUrl.util.queryApiList(), + data: JSON.stringify(req), + contentType: 'application/json; charset=utf-8', + dataType: 'json', + async: false, + success: function(res) { + $.each(res, function (index, domEle) { + var str = '
  • '; + str += '
    '; + str += ''+domEle.code+''; + str += '
    '; + str += '
    '+domEle.uddi+'
    '; + str += '
  • '; + $('#list-con-wrap').append(str) + }); + } + }); +}; + + $('#link-div span').on('click',function () { var index = $(this).index(); $(this).addClass('linkActive').siblings('span').removeClass('linkActive'); @@ -114,8 +170,6 @@ $('#link-div span').on('click',function () { }); $(document).delegate('#list-con-wrap li span','click',function () { var id = $(this).attr('data-id'); - alert(id); - $('#list-main-wrap').addClass('display-none'); - $('#list-detail-wrap').removeClass('display-none'); + window.open(id);  }); diff --git a/pdalatform.html b/pdalatform.html index 52a4fee..b70da25 100644 --- a/pdalatform.html +++ b/pdalatform.html @@ -56,7 +56,7 @@ 总接口数 @@ -66,7 +66,7 @@ 今日活跃接口数 @@ -84,76 +84,6 @@ diff --git a/wechatlatform.html b/wechatlatform.html index 28ab008..6e1b706 100644 --- a/wechatlatform.html +++ b/wechatlatform.html @@ -55,7 +55,7 @@ 总接口数 @@ -65,7 +65,7 @@ 今日活跃接口数 @@ -82,81 +82,6 @@ 调用排行榜 @@ -170,270 +95,6 @@
  • 描述
  • -- libgit2 0.21.4