fuwencai 4 年之前
父節點
當前提交
8b789566cc
共有 4 個文件被更改,包括 225 次插入56 次删除
  1. 4 0
      router/pageRouter.go
  2. 22 0
      static/templates/interfaceList.html
  3. 95 52
      static/templates/login.html
  4. 104 4
      static/templates/peojectListDetail.html

+ 4 - 0
router/pageRouter.go

@@ -15,6 +15,7 @@ func pageRouterRegister(router *gin.Engine) {
 		pageRouterGroup.GET("/projectDetailsPage", projectDetailsPage)
 		pageRouterGroup.GET("/projectListPage", projectListPage)
 		pageRouterGroup.GET("/projectListDetail", projectListDetailPage)
+		pageRouterGroup.GET("/interfaceListPage", interfaceListPage)
 	}
 }
 
@@ -43,3 +44,6 @@ func projectListPage(context *gin.Context) {
 func projectListDetailPage(context *gin.Context) {
 	context.HTML(200, "projectListDetail.html", nil)
 }
+func interfaceListPage(context *gin.Context) {
+	context.HTML(200, "interfaceList.html", nil)
+}

+ 22 - 0
static/templates/interfaceList.html

@@ -0,0 +1,22 @@
+{{define "interfaceList.html"}}
+
+    <!DOCTYPE html>
+    <html lang="en">
+    <head>
+        <meta charset="UTF-8">
+        <title>接口列表</title>
+    </head>
+    <style>
+        .list a {
+            text-decoration: none;
+        }
+    </style>
+    <body>
+    <div class="list">
+        <a href="/page/projectListPage">项目列表接口</a><br>
+        <a href="">项目列表详情接口</a>
+    </div>
+
+    </body>
+    </html>
+{{end}}

+ 95 - 52
static/templates/login.html

@@ -11,63 +11,106 @@
 
     </style>
     <body>
-        <dev id="main">
-            <h1>对外接口</h1>
-            <div>
-                <a href="/page/projectListPage">1.项目列表</a>
-                <a onclick="$('#projectListDetail').show();$('#main').hide();">2.项目列表及详情</a>
-            </div>
-             <h1><a href="/page/userRecharge">充值接口</a></h1>
-            <h1>内部接口</h1>
-            <div>
-                <a href="/page/createUser">1.创建用户</a>
-            </div>
-            <h1>产品接口</h1>
-            <dev>
-                <a href="/page/chooseProductPage">1.选择产品</a>
-                <a>2.余额充值</a>
-                <a>3.产品充值</a>
-            </dev>
-        </dev>
-        <dev id="projectList" style="display: none;">
-            <input type="text" id="projectName" placeholder="请输入项目名">
-            <input type="text" id="winner" placeholder="请输入中标企业名">
-            <input type="text" id="bidTime" placeholder="请输入中标日期">
-            <button type="button" id="projectListBtn">提交</button>
-        </dev>
-        <dev id="projectListDetail" style="display: none;">
-            <input type="text" id="winners" placeholder="请输入中标企业名">
-            <button type="button" id="projectListDetailBtn">提交</button>
-        </dev>
-        <dev id="resultContent"></dev>
-        {{/*<style>
-            .title {
-                text-align: center;
-            }
+    <style>
+        .title {
+            text-align: center;
+        }
+
+        .tableDiv {
+            margin-top: 20px;
+        }
+
+        .box tr td {
+            text-align: center;
+        }
+
+        .handle a {
+            text-decoration: none;
+            margin-right: 5px;
+        }
+
+    </style>
+    <div>
+        <h1 class="title">接口服务平台测试系统</h1>
+    </div>
+    <div>
+        <button style="width: 80px;height: 35px"><a style="text-decoration:none;" href="/page/createUser">创建用户</a>
+        </button>
+    </div>
+    <div class="tableDiv">
+        <table border="0" id="tableId" hidden>
+            <thead>
+            <tr class="tableTitle">
+                <th style="width: 5%">序号</th>
+                <th style="width: 25%">客户名称</th>
+                <th style="width: 20%">APPID</th>
+                <th style="width: 10%">密钥</th>
+                <th style="width: 10%">客户电话</th>
+                <th style="width: 10%">余额</th>
+                <th style="width: 20%">操作</th>
+            </tr>
+            </thead>
+            <tbody class="box">
+
+            </tbody>
+        </table>
+    </div>
+
+    <script>
+        userList()
 
-        </style>
-        <div>
-            <h1 class="title">接口服务平台测试系统</h1>
-        </div>*/}}
+        function userList() {
+            $.ajax({
+                url: "/manage/user/list",
+                type: "POST",
+                dataType: "json",
+                async: false,
+                success: function (r) {
+                    if (r.code === 0) {
+                        var str = ""
+                        if (r.data.length != 0) {
+                            $("#tableId").show();
+                            for (var i = 0; i < r.data.length; i++) {
+                                var item = r.data[i];
+                                str += '<tr style="">';
+                                str += '<td style="width: 50px">' + (i + 1) + '</td>';
+                                str += '<td style="width: 100px">' + item.name + '</td>';
+                                str += '<td style="width: 200px">' + item.app_id + '</td>';
+                                str += '<td style="width: 100px">' + item.secret_key + '</td>';
+                                str += '<td style="width: 100px">' + item.phone + '</td>';
 
-        <script>
+                                str += '<td style="width: 100px">' + item.money + '</td>';
+                                str += '<td class="handle" style="width: 100px"><a href="/page/userRecharge">充值</a><a href="/page/chooseProductPage">购买产品</a><a href="/page/interfaceListPage">测试接口</a></td>';
+                                str += '</tr>';
+                            }
+                            $('.box').html(str);
+                        } else {
+                            $("#tableDiv").html("还没有客户,请添加客户信息");
+                        }
 
-            
-            $("#projectListDetailBtn").on("click", function(){
-                var param = {
-                    "app_id": appid,
-                    "winner": $("#winners").val()
-                };
-                var url = "/sfis/api/v1/projectListDetail";
-                var rType = "post";
-                var now = new Date().getTime();
-                var token = md5(appid+Math.round(now/1000)+key);
-                var hearders = {
-                    "timestamp": ""+Math.round(now/1000),
-                    "token": token
+                    } else {
+                        $("#tableDiv").html(r.msg);
+                    }
                 }
-                submit(param,rType,url,hearders,"listDetail");
             })
+        }
+
+
+        /*$("#projectListDetailBtn").on("click", function(){
+            var param = {
+                "app_id": appid,
+                "winner": $("#winners").val()
+            };
+            var url = "/sfis/api/v1/projectListDetail";
+            var rType = "post";
+            var now = new Date().getTime();
+            var token = md5(appid+Math.round(now/1000)+key);
+            var hearders = {
+                "timestamp": ""+Math.round(now/1000),
+                "token": token
+            }
+            submit(param,rType,url,hearders,"listDetail");
+        })*/
     </script>
     </body>
     </html>

+ 104 - 4
static/templates/peojectListDetail.html

@@ -1,10 +1,110 @@
+{{define "projectListDetail.html"}}
 <!DOCTYPE html>
 <html lang="en">
 <head>
-  <meta charset="UTF-8">
-  <title>$Title$</title>
+    <meta charset="UTF-8">
+    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
+    <script src="https://cdn.bootcss.com/blueimp-md5/2.10.0/js/md5.js"></script>
+    <title>项目列表详情</title>
 </head>
 <body>
-$END$
+<input type="text" id="winners" placeholder="请输入中标企业名">
+<button type="button" id="projectListDetailBtn">提交</button>
+<div id="tableDiv" hidden>
+    <table border="0" id="tableId">
+        <thead>
+        <tr class="tableTitle">
+            <th style="width: 5%;">序号</th>
+            <th style="width: 5%">项目标识</th>
+            <th style="width: 5%">项目名称</th>
+            <th style="width: 5%">项目代码</th>
+            <th style="width: 20%">中标单位</th>
+            <th style="width: 10%">采购单位</th>
+            <th style="width: 5%">采购单位电话</th>
+            <th style="width: 5%">采购单位联系人</th>
+            <th style="width: 8%">采购单位行业</th>
+            <th style="width: 8%">招标日期</th>
+            <th style="width: 8%">中标日期</th>
+            <th style="width: 8%">中标金额(元)</th>
+            <th style="width: 8%">预算金额(元)</th>
+            <th style="width: 8%">省份</th>
+            <th style="width: 8%">城市</th>
+            <th style="width: 8%">原链接</th>
+        </tr>
+        </thead>
+        <tbody class="box">
+
+        </tbody>
+    </table>
+</div>
+<script>
+    var appid = "sfGSVYRQMAAgkGBAUBJg4f";
+    var key = "364xw909";
+
+    function submit(param, rType, url, hearders, str) {
+        $.ajax({
+            url: url,
+            type: rType,
+            headers: hearders,
+            data: param,
+            success: function (r) {
+                if (r.data) {
+                    $("#tableDiv").show();
+                    $("#resultContent").text("");
+                    var str = "";
+                    for (var i = 0; i < r.data.length; i++) {
+                        var item = r.data[i]
+                        str += '<tr>';
+                        str += '<td >' + (i + 1) + '</td>';
+                        str += '<td >' + item.project_id + '</td>';
+                        str += '<td>' + item.projectname + '</td>';
+                        str += '<td>' + item.projectcode + '</td>';
+                        str += '<td>' + item.s_winner + '</td>';
+                        str += '<td>' + item.buyer + '</td>';
+                        str += '<td>' + item.buyertel + '</td>';
+                        str += '<td>' + item.buyerperson + '</td>';
+                        str += '<td >' + item.buyerclass + '</td>';
+                        if (item.zbtime == undefined || item.zbtime == "") {
+                            str += '<td ></td>';
+                        } else {
+                            str += '<td >' + item.zbtime + '</td>';
+                        }
+                        if (item.jgtime == undefined || item.jgtime == "") {
+                            str += '<td></td>';
+                        } else {
+                            str += '<td class="td">' + item.jgtime + '</td>';
+                        }
+                        str += '<td>' + item.bidamount + '</td>';
+                        str += '<td>' + item.budget + '</td>';
+                        str += '<td>' + item.area + '</td>';
+                        str += '<td>' + item.city + '</td>';
+                        str += '<td>' + item.sourceinfourl + '</td>';
+                        str += '</tr>';
+                    }
+                    $(".box").html(str);
+                } else {
+                    $("#resultContent").text(r.msg);
+                }
+            }
+        })
+    }
+    $("#projectListDetailBtn").on("click", function(){
+
+        var param = {
+            "app_id": appid,
+            "winner": $("#winners").val()
+        };
+        var url = "/sfis/api/v1/projectListDetail";
+        var rType = "post";
+        var now = new Date().getTime();
+        var token = md5(appid+Math.round(now/1000)+key);
+        var hearders = {
+            "timestamp": ""+Math.round(now/1000),
+            "token": token
+        }
+        submit(param,rType,url,hearders,"listDetail");
+    })
+</script>
 </body>
-</html>
+</html>
+{{end}}