jiaojiao7 4 éve
szülő
commit
d02bd18289
3 módosított fájl, 122 hozzáadás és 52 törlés
  1. 5 0
      router/pageRouter.go
  2. 22 0
      static/templates/interfaceList.html
  3. 95 52
      static/templates/login.html

+ 5 - 0
router/pageRouter.go

@@ -14,6 +14,7 @@ func pageRouterRegister(router *gin.Engine) {
 		pageRouterGroup.GET("/userRecharge", userRechargePage)
 		pageRouterGroup.GET("/projectDetailsPage", projectDetailsPage)
 		pageRouterGroup.GET("/projectListPage", projectListPage)
+		pageRouterGroup.GET("/interfaceListPage", interfaceListPage)
 	}
 }
 
@@ -39,3 +40,7 @@ func projectDetailsPage(context *gin.Context) {
 func projectListPage(context *gin.Context) {
 	context.HTML(200, "projectList.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>