Browse Source

Merge branch 'master' of http://192.168.3.207:10080/group3/SwordFish_Interface_Service

fuwencai 4 years ago
parent
commit
c60fe176e4

+ 7 - 0
router/pageRouter.go

@@ -16,6 +16,7 @@ func pageRouterRegister(router *gin.Engine) {
 		pageRouterGroup.GET("/projectListPage", projectListPage)
 		pageRouterGroup.GET("/projectListDetail", projectListDetailPage)
 		pageRouterGroup.GET("/interfaceListPage", interfaceListPage)
+		pageRouterGroup.GET("/moneyRechargePage", moneyRechargePage)
 	}
 }
 
@@ -47,3 +48,9 @@ func projectListDetailPage(context *gin.Context) {
 func interfaceListPage(context *gin.Context) {
 	context.HTML(200, "interfaceList.html", nil)
 }
+
+func moneyRechargePage(context *gin.Context) {
+	context.HTML(200, "moneyRecharge.html", nil)
+}
+
+

+ 46 - 0
static/templates/moneyRecharge.html

@@ -0,0 +1,46 @@
+{{define "moneyRecharge.html"}}
+    <!DOCTYPE html>
+    <html lang="en">
+    <head>
+        <meta charset="UTF-8">
+        <title>余额充值</title>
+        <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
+    </head>
+    <body>
+    <h3>余额充值</h3>
+    <div id="money">
+        <input type="number" id="moneys" placeholder="请输入充值金额">
+        <button type="button" id="moneyBtn">提交</button>
+    </div>
+
+    </body>
+    </html>
+    <script>
+        function submit(param, rType, url, hearders) {
+            $.ajax({
+                url: url,
+                type: rType,
+                headers: hearders,
+                data: param,
+                success: function (r) {
+                    $("#resultContent").text("");
+                    if (r.code === 1000) {
+                        $("#resultContent").text(r.msg);
+                    } else {
+                        $("#resultContent").text(r.msg);
+                    }
+                }
+            })
+        }
+
+        $("#moneyBtn").on("click", function () {
+            var param = {
+                "appid": appid,
+                "money": Math.round($("#moneys").val() * 100),
+            };
+            var url = "/manage/user/moneyRecharge";
+            var rType = "post";
+            submit(param, rType, url);
+        })
+    </script>
+{{end}}

+ 2 - 1
static/templates/projectDetails.html

@@ -44,7 +44,8 @@
             var hearders = {
                 "timestamp": "" + Math.round(now / 1000),
                 "token": token
-            }
+            };
+            console.log(param)
             $.ajax({
                 url: url,
                 type: rType,

+ 5 - 4
static/templates/projectList.html

@@ -69,10 +69,11 @@
                         var str = "";
                         for (var i = 0; i < r.data.length; i++) {
                             var item = r.data[i]
-                            str += '<tr onclick="projectDetails(this)">';
+                            str += '<tr >';
                             // str += '<td style="width: 20px"></td>';
                             str += '<td class="td">' + (i + 1) + '</td>';
-                            str += '<td class="td">' + item.projectId + '</td>';
+                            str += "<td class=\"td\"><a href='javascript:void(0);' style='pointer:hand;' onclick=\"projectDetails('" + item.projectId + "')\">" + item.projectId + "</a></td>";
+                            // str += '<td class="td"><a href="javascript:void(0);" onclick="projectDetails()"> ' + item.projectId + '</a></td>';
                             str += '<td>' + item.projectName + '</td>';
                             str += '<td>' + item.buyer + '</td>';
                             str += '<td class="td">' + item.buyerClass + '</td>';
@@ -116,8 +117,8 @@
         })
 
         function projectDetails(obj) {
-            var p = $(obj).find("td:eq(1)").text();
-            location.href = "/page/projectDetailsPage?projectId=" + p + "&appId=" + appid + "&key=" + key
+            // var p = $(obj).parent().find("td:eq(1)").text();
+            location.href = "/page/projectDetailsPage?projectId=" + obj + "&appId=" + appid + "&key=" + key
         }
     </script>
     </html>

+ 6 - 30
static/templates/userRecharge.html

@@ -12,18 +12,19 @@
       }
     </style>
     <body>
-        <div id="main">
+        {{/*<div id="main">
             <div class="list">
                 <h1>充值接口</h1>
                 <a href="#" onclick="$('#money').show();$('#main').hide();">1.余额充值</a><br>
                 <a href="#" onclick="$('#product').show();$('#main').hide();">2.剩余量充值</a>
             </div>
-        </div>
-        <div id="money" style="display: none;">
+        </div>*/}}
+        {{/*<div id="money" style="display: none;">
             <input type="number" id="moneys" placeholder="请输入充值金额">
             <button type="button" id="moneyBtn">提交</button>
-        </div>
-        <div id="product" style="display: none;">
+        </div>*/}}
+        <h3>剩余量充值</h3>
+        <div id="product">
             <!-- <input type="number" id="productId" placeholder="请输入产品id"> -->
             产品 <select id="productId"></select>
             <input type="number" id="rechargeNum" placeholder="请输入充值次数">
@@ -49,31 +50,6 @@
                     }
                 })
             }
-            function submit(param,rType,url,hearders){
-                $.ajax({
-                    url: url,
-                    type: rType,
-                    headers: hearders,
-                    data: param,
-                    success:function(r){
-                        $("#resultContent").text("");
-                    	if(r.code === 1000){
-                            $("#resultContent").text(r.msg);
-                    	}else{
-                    		$("#resultContent").text(r.msg);
-                    	}
-                    }
-                })
-            }
-            $("#moneyBtn").on("click", function(){
-                var param = {
-                    "appid": appid,
-                    "money": Math.round($("#moneys").val()*100),
-                };
-                var url = "/manage/user/moneyRecharge";
-                var rType = "post";
-                submit(param,rType,url);
-            })
             
             $("#productBtn").on("click", function(){
                 var param = {