xuzhiheng 4 ani în urmă
părinte
comite
4623bfc243
2 a modificat fișierele cu 29 adăugiri și 15 ștergeri
  1. 1 1
      static/templates/login.html
  2. 28 14
      static/templates/userRecharge.html

+ 1 - 1
static/templates/login.html

@@ -80,7 +80,7 @@
                                 str += '<td style="width: 100px">' + item.phone + '</td>';
 
                                 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 += '<td class="handle" style="width: 100px"><a href="/page/userRecharge?id='+ item.app_id +'">充值</a><a href="/page/chooseProductPage">购买产品</a><a href="/page/interfaceListPage">测试接口</a></td>';
                                 str += '</tr>';
                             }
                             $('.box').html(str);

+ 28 - 14
static/templates/userRecharge.html

@@ -7,29 +7,31 @@
         <title>接口服务平台后台管理系统</title>
     </head>
     <style>
-      
+      .list a {
+          text-decoration: none;
+      }
     </style>
     <body>
-        <dev id="main">
-            <h1>充值接口</h1>
-            <dev>
-                <a onclick="$('#money').show();$('#main').hide();">1.余额充值</a>
-                <a onclick="$('#product').show();$('#main').hide();">2.剩余量充值</a>
-            </dev>
-        </dev>
-        <dev id="money" style="display: none;">
+        <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;">
             <input type="number" id="moneys" placeholder="请输入充值金额">
             <button type="button" id="moneyBtn">提交</button>
-        </dev>
-        <dev id="product" style="display: none;">
+        </div>
+        <div id="product" style="display: none;">
             <input type="number" id="productId" placeholder="请输入产品id">
             <input type="number" id="rechargeNum" placeholder="请输入充值次数">
             <input type="text" id="endTime" placeholder="请输入结束时间">
             <button type="button" id="productBtn">提交</button>
-        </dev>
-        <dev id="resultContent"></dev>
+        </div>
+        <div id="resultContent"></div>
         <script>
-            var appid = "sfGSVYRQMAAgkGBAUBJg4f";
+            var appid = getParam("id");
             function submit(param,rType,url,hearders){
                 $.ajax({
                     url: url,
@@ -66,6 +68,18 @@
                 var rType = "post";
                 submit(param,rType,url);
             })
+            
+            // 获取上个页面传来的参数
+            function getParam(name) {
+                var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
+                var r = window.location.search.substr(1).match(reg); //获取url中"?"符后的字符串并正则匹配
+                var context = "";
+                if (r != null)
+                    context = r[2];
+                reg = null;
+                r = null;
+                return context == null || context == "" || context == "undefined" ? "" : context;
+            }
         </script>
     </body>
     </html>