|
@@ -29,6 +29,13 @@
|
|
margin-right: 5px;
|
|
margin-right: 5px;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ .userProductList {
|
|
|
|
+ margin-top: 20px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .userProTbody tr td {
|
|
|
|
+ text-align: center;
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|
|
<div>
|
|
<div>
|
|
<h1 class="title">接口服务平台测试系统</h1>
|
|
<h1 class="title">接口服务平台测试系统</h1>
|
|
@@ -55,6 +62,31 @@
|
|
</tbody>
|
|
</tbody>
|
|
</table>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class="userProductList">
|
|
|
|
+ <div class="userProductDiv" hidden>
|
|
|
|
+ <p class="nodata"></p>
|
|
|
|
+ <h3>用户购买产品列表</h3>
|
|
|
|
+ <table border="0" id="userProduct">
|
|
|
|
+ <thead>
|
|
|
|
+ <tr class="tableTitle">
|
|
|
|
+ <th style="width: 5%">序号</th>
|
|
|
|
+ <th style="width: 10%">产品ID</th>
|
|
|
|
+ <th style="width: 25%">用户APPID</th>
|
|
|
|
+ <th style="width: 5%">剩余量</th>
|
|
|
|
+ <th style="width: 10%">扣费模式</th>
|
|
|
|
+ <th style="width: 5%">状态</th>
|
|
|
|
+ <th style="width: 10%">每日调用次数</th>
|
|
|
|
+ <th style="width: 10%">单次返回数量</th>
|
|
|
|
+ <th style="width: 20%">操作</th>
|
|
|
|
+ </tr>
|
|
|
|
+ </thead>
|
|
|
|
+ <tbody class="userProTbody">
|
|
|
|
+
|
|
|
|
+ </tbody>
|
|
|
|
+ </table>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ </div>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
userList()
|
|
userList()
|
|
@@ -72,45 +104,86 @@
|
|
$("#tableId").show();
|
|
$("#tableId").show();
|
|
for (var i = 0; i < r.data.length; i++) {
|
|
for (var i = 0; i < r.data.length; i++) {
|
|
var item = r.data[i];
|
|
var item = r.data[i];
|
|
- str += '<tr style="">';
|
|
|
|
|
|
+ str += '<tr onclick="userProductList(this)">';
|
|
str += '<td style="width: 50px">' + (i + 1) + '</td>';
|
|
str += '<td style="width: 50px">' + (i + 1) + '</td>';
|
|
str += '<td style="width: 100px">' + item.name + '</td>';
|
|
str += '<td style="width: 100px">' + item.name + '</td>';
|
|
str += '<td style="width: 200px">' + item.app_id + '</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.secret_key + '</td>';
|
|
str += '<td style="width: 100px">' + item.phone + '</td>';
|
|
str += '<td style="width: 100px">' + item.phone + '</td>';
|
|
-
|
|
|
|
str += '<td style="width: 100px">' + item.money + '</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">充值</a><a href="/page/chooseProductPage">购买产品</a></td>';
|
|
str += '</tr>';
|
|
str += '</tr>';
|
|
}
|
|
}
|
|
$('.box').html(str);
|
|
$('.box').html(str);
|
|
} else {
|
|
} else {
|
|
- $("#tableDiv").html("还没有客户,请添加客户信息");
|
|
|
|
|
|
+ $(".tableDiv").html("还没有客户,请添加客户信息");
|
|
}
|
|
}
|
|
-
|
|
|
|
} else {
|
|
} else {
|
|
- $("#tableDiv").html(r.msg);
|
|
|
|
|
|
+ $(".tableDiv").html(r.msg);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
- /*$("#projectListDetailBtn").on("click", function(){
|
|
|
|
|
|
+ function userProductList(obj, k) {
|
|
|
|
+ var appId = $(obj).find("td:eq(2)").text();
|
|
|
|
+ var key = $(obj).find("td:eq(3)").text();
|
|
|
|
+ console.log(key)
|
|
var param = {
|
|
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
|
|
|
|
|
|
+ "appId": appId
|
|
}
|
|
}
|
|
- submit(param,rType,url,hearders,"listDetail");
|
|
|
|
- })*/
|
|
|
|
|
|
+ $.ajax({
|
|
|
|
+ url: "/manage/user/userProductList",
|
|
|
|
+ type: "POST",
|
|
|
|
+ dataType: "json",
|
|
|
|
+ async: false,
|
|
|
|
+ data: param,
|
|
|
|
+ success: function (r) {
|
|
|
|
+ if (r.code === 0) {
|
|
|
|
+ var str = ""
|
|
|
|
+ console.log(r.data)
|
|
|
|
+ if (r.data.length != 0) {
|
|
|
|
+ $(".nodata").html("");
|
|
|
|
+ $(".userProductDiv").show();
|
|
|
|
+ $(".userProTbody").html("")
|
|
|
|
+ for (var i = 0; i < r.data.length; i++) {
|
|
|
|
+ var item = r.data[i];
|
|
|
|
+ str += '<tr>';
|
|
|
|
+ str += '<td>' + (i + 1) + '</td>';
|
|
|
|
+ str += '<td>' + item.product_id + '</td>';
|
|
|
|
+ str += '<td>' + item.app_id + '</td>';
|
|
|
|
+ str += '<td>' + item.left_num + '</td>';
|
|
|
|
+ if (item.cost_model == 0) {
|
|
|
|
+ str += '<td>扣量</td>';
|
|
|
|
+ } else {
|
|
|
|
+ str += '<td>扣余额</td>';
|
|
|
|
+ }
|
|
|
|
+ if (item.interface_status == 0) {
|
|
|
|
+ str += '<td>开启</td>';
|
|
|
|
+ } else {
|
|
|
|
+ str += '<td>关闭</td>';
|
|
|
|
+ }
|
|
|
|
+ str += '<td>' + item.call_times_limit_day + '</td>';
|
|
|
|
+ str += '<td>' + item.data_num_limit_one_times + '</td>';
|
|
|
|
+ if (item.product_id == 1000 || item.product_id == 1001) {
|
|
|
|
+ str += '<td class="handle" style="width: 100px"><a href="/page/projectListPage?appId=' + appId + '&key=' + key + ' " >测试接口</a></td>';
|
|
|
|
+ } else {
|
|
|
|
+ str += '<td class="handle" style="width: 100px"><a href="/page/projectListDetail?appId=' + appId + '&key=' + key + ' " >测试接口</a></td>';
|
|
|
|
+ }
|
|
|
|
+ str += '</tr>';
|
|
|
|
+ }
|
|
|
|
+ $(".userProTbody").html(str);
|
|
|
|
+ } else {
|
|
|
|
+ $(".userProductDiv").hide();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ $(".userProductList").html(r.msg);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
</script>
|
|
</script>
|
|
</body>
|
|
</body>
|
|
</html>
|
|
</html>
|