Procházet zdrojové kódy

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

xuzhiheng před 4 roky
rodič
revize
5fe6997db0
2 změnil soubory, kde provedl 119 přidání a 1 odebrání
  1. 4 1
      router/pageRouter.go
  2. 115 0
      static/templates/peojectListDetail.html

+ 4 - 1
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("/projectListDetail", projectListDetailPage)
 		pageRouterGroup.GET("/interfaceListPage", interfaceListPage)
 	}
 }
@@ -40,7 +41,9 @@ func projectDetailsPage(context *gin.Context) {
 func projectListPage(context *gin.Context) {
 	context.HTML(200, "projectList.html", nil)
 }
-
+func projectListDetailPage(context *gin.Context) {
+	context.HTML(200, "projectListDetail.html", nil)
+}
 func interfaceListPage(context *gin.Context) {
 	context.HTML(200, "interfaceList.html", nil)
 }

+ 115 - 0
static/templates/peojectListDetail.html

@@ -0,0 +1,115 @@
+{{define "projectListDetail.html"}}
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <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>
+<input type="text" id="winners" placeholder="请输入中标企业名">
+<button type="button" id="projectListDetailBtn">提交</button>
+<div id="resultContent"></div>
+<div id="tableDiv" hidden>
+    <table  id="tableId" border="1px solid" cellspacing="0" cellpadding="0" >
+        <tr>
+            <th style="width: 5%;">序号</th>
+            <th style="width: 10%">项目标识</th>
+            <th style="width: 5%">项目名称</th>
+            <th style="width: 5%">项目代码</th>
+            <th style="width: 15%">中标单位</th>
+            <th style="width: 5%">采购单位</th>
+            <th style="width: 5%">采购单位电话</th>
+            <th style="width: 5%">采购单位联系人</th>
+            <th style="width: 5%">采购单位行业</th>
+            <th style="width: 5%">招标日期</th>
+            <th style="width: 5%">中标日期</th>
+            <th style="width: 5%">中标金额(元)</th>
+            <th style="width: 5%">预算金额(元)</th>
+            <th style="width: 5%">省份</th>
+            <th style="width: 5%">城市</th>
+            <th style="width: 15%">原链接</th>
+
+
+        </tr>
+        <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 style="word-break:break-all">' + item.project_id + '</td>';
+                        str += '<td >' + item.projectname + '</td>';
+                        str += '<td style="word-break:break-all">' + item.projectcode + '</td>';
+                        str += '<td >' + item.s_winner + '</td>';
+                        str += '<td style="word-break:break-all">' + item.buyer + '</td>';
+                        str += '<td style="word-break:break-all">' + item.buyertel + '</td>';
+                        str += '<td style="word-break:break-all">' + item.buyerperson + '</td>';
+                        str += '<td style="word-break:break-all">' + 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 style="word-break:break-all">' + item.bidamount + '</td>';
+                        str += '<td style="word-break:break-all">' + item.budget + '</td>';
+                        str += '<td style="word-break:break-all">' + item.area + '</td>';
+                        str += '<td style="word-break:break-all">' + item.city + '</td>';
+                        str += '<td style="word-break:break-all">' + item.sourceinfourl + '</td>';
+                        str += '</tr>';
+                    }
+                    str = str.replaceAll("undefined", "")
+                    $(".box").html(str);
+                } else {
+                    $("#resultContent").text(JSON.stringify(r));
+                }
+            }
+        })
+    }
+
+    $("#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
+        }
+        $(".box").html("");
+        $("#resultContent").text("");
+        submit(param, rType, url, hearders, "listDetail");
+    })
+</script>
+</body>
+</html>
+{{end}}