浏览代码

Merge branch 'dev2.0' of 192.168.3.17:qmx/jy into dev2.0

张金坤 8 年之前
父节点
当前提交
17810b7cbe
共有 25 个文件被更改,包括 99 次插入51 次删除
  1. 2 1
      src/jfw/modules/entsesearch/src/config.json
  2. 16 10
      src/jfw/modules/entsesearch/src/search/entsesearch.go
  3. 0 0
      src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/css/bootstrap.min.css
  4. 0 0
      src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/css/bootswatch.min.css
  5. 0 0
      src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/css/common.css
  6. 0 0
      src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/css/jy.css
  7. 0 0
      src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/css/reset.css
  8. 0 0
      src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/favicon.ico
  9. 0 0
      src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/images/wx/jyqingchu.png
  10. 0 0
      src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/images/wx/jywxjs.png
  11. 0 0
      src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/images/wx/sys-jt-bottom.png
  12. 0 0
      src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/images/wx/sys-jt-bottom2.png
  13. 0 0
      src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/js/bootstrap.min.js
  14. 0 0
      src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/js/common.js
  15. 0 0
      src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/js/jquery.cookie.js
  16. 0 0
      src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/js/jquery.js
  17. 0 0
      src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/js/jy.js
  18. 0 0
      src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/js/login.js
  19. 0 0
      src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/js/rem.js
  20. 0 0
      src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/mobiscroll/mobiscroll.min.css
  21. 0 0
      src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/mobiscroll/mobiscroll.min.js
  22. 38 20
      src/jfw/modules/entsesearch/src/web/templates/weixin/entseSearch.html
  23. 27 17
      src/jfw/modules/followent/src/followent/followent.go
  24. 1 1
      src/jfw/modules/followent/src/web/staticres/jylab/followent/css/follow.css
  25. 15 2
      src/jfw/modules/followent/src/web/templates/weixin/set.html

+ 2 - 1
src/jfw/modules/entsesearch/src/config.json

@@ -11,6 +11,7 @@
     "webrpcport": "84",
     "weixinrpc": "127.0.0.1:83",
     "cacheflag": false,
-    "agreement": "http"
+    "agreement": "http",
+    "recommendEntLimit":"50"
 
 }

+ 16 - 10
src/jfw/modules/entsesearch/src/search/entsesearch.go

@@ -2,15 +2,17 @@ package search
 
 import (
 	"fmt"
-	"strconv"
 	"github.com/go-xweb/xweb"
+	"qfw/util/elastic"
+	"config"
+	"strconv"
 )
 
 type EntSeSearch struct {
 	*xweb.Action
-	toSearch  xweb.Mapper `xweb:"/entSeSearch/search"`  //跳转到中标企业查询页面
-	recList   xweb.Mapper `xweb:"/entSeSearch/recList"` //获取推荐企业列表
-	proList   xweb.Mapper `xweb:"/entSeSearch/proList"` //获取企业中标项目
+	toSearch  xweb.Mapper `xweb:"/jylab/entsesearch/search"`  //跳转到中标企业查询页面
+	recList   xweb.Mapper `xweb:"/jylab/entsesearch/recList"` //获取推荐企业列表
+	proList   xweb.Mapper `xweb:"/jylab/entsesearch/proList"` //获取企业中标项目列表
 
 }
 
@@ -24,13 +26,17 @@ func (e *EntSeSearch) ToSearch() error{
 
 func (e *EntSeSearch) RecList() {
 	fmt.Println("entName", e.GetString("entName"))
-	var recArr [10]string
-	for i := 0; i < len(recArr); i++ {
-		recArr[i] = "河南省凯陆电子科技有限公司" + strconv.Itoa(i+1)
+	var entName = e.GetString("entName")
+	if entName!=""{
+		limit,_ := strconv.Atoi(config.Sysconfig["recommendEntLimit"].(string))
+		r := elastic.GetPage("winner", "winner", `{"winner":"`+entName+`"}`, ``, `"_id","winner"`, 0, limit)
+		if r!=nil && len(*r) != 0{
+			fmt.Println("RecList",r)
+			e.ServeJson(map[string]interface{}{
+				"recList": r,
+			})
+		}
 	}
-	e.ServeJson(map[string]interface{}{
-		"recList": recArr,
-	})
 }
 
 func (e *EntSeSearch) ProList() {

+ 0 - 0
src/jfw/modules/entsesearch/src/web/staticres/css/bootstrap.min.css → src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/css/bootstrap.min.css


+ 0 - 0
src/jfw/modules/entsesearch/src/web/staticres/css/bootswatch.min.css → src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/css/bootswatch.min.css


+ 0 - 0
src/jfw/modules/entsesearch/src/web/staticres/css/common.css → src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/css/common.css


+ 0 - 0
src/jfw/modules/entsesearch/src/web/staticres/css/jy.css → src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/css/jy.css


+ 0 - 0
src/jfw/modules/entsesearch/src/web/staticres/css/reset.css → src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/css/reset.css


+ 0 - 0
src/jfw/modules/entsesearch/src/web/staticres/favicon.ico → src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/favicon.ico


+ 0 - 0
src/jfw/modules/entsesearch/src/web/staticres/images/wx/jyqingchu.png → src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/images/wx/jyqingchu.png


+ 0 - 0
src/jfw/modules/entsesearch/src/web/staticres/images/wx/jywxjs.png → src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/images/wx/jywxjs.png


+ 0 - 0
src/jfw/modules/entsesearch/src/web/staticres/images/wx/sys-jt-bottom.png → src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/images/wx/sys-jt-bottom.png


+ 0 - 0
src/jfw/modules/entsesearch/src/web/staticres/images/wx/sys-jt-bottom2.png → src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/images/wx/sys-jt-bottom2.png


+ 0 - 0
src/jfw/modules/entsesearch/src/web/staticres/js/bootstrap.min.js → src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/js/bootstrap.min.js


+ 0 - 0
src/jfw/modules/entsesearch/src/web/staticres/js/common.js → src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/js/common.js


+ 0 - 0
src/jfw/modules/entsesearch/src/web/staticres/js/jquery.cookie.js → src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/js/jquery.cookie.js


+ 0 - 0
src/jfw/modules/entsesearch/src/web/staticres/js/jquery.js → src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/js/jquery.js


+ 0 - 0
src/jfw/modules/entsesearch/src/web/staticres/js/jy.js → src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/js/jy.js


+ 0 - 0
src/jfw/modules/entsesearch/src/web/staticres/js/login.js → src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/js/login.js


+ 0 - 0
src/jfw/modules/entsesearch/src/web/staticres/js/rem.js → src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/js/rem.js


+ 0 - 0
src/jfw/modules/entsesearch/src/web/staticres/mobiscroll/mobiscroll.min.css → src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/mobiscroll/mobiscroll.min.css


+ 0 - 0
src/jfw/modules/entsesearch/src/web/staticres/mobiscroll/mobiscroll.min.js → src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/mobiscroll/mobiscroll.min.js


+ 38 - 20
src/jfw/modules/entsesearch/src/web/templates/weixin/entseSearch.html

@@ -7,9 +7,9 @@
 <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0" user-scalable="no" />
 <meta name="renderer" content="webkit">
 {{include "/common/pnc.html"}}
-<script src="/js/jquery.js"></script>
-<script src="/js/rem.js"></script>
-<link rel="stylesheet" href="/css/reset.css" />
+<script src="/jylab/entsesearch/js/jquery.js"></script>
+<script src="/jylab/entsesearch/js/rem.js"></script>
+<link rel="stylesheet" href="/jylab/entsesearch/css/reset.css" />
 <style>
 #searchDiv .searchform{
 	width:79%;
@@ -216,6 +216,19 @@
 	color: #2cb7ca;
 }
 
+.tip{
+	font-size: 14px;
+	padding: 0 .3rem;
+	margin-bottom:70px;
+	line-height: 20px;
+}
+#recList{
+	z-index: 1;
+	position: absolute;
+	background: rgb(255, 255, 255);
+	width: 79%;
+}
+
 </style>
 </head>
 <body>
@@ -225,8 +238,8 @@
 	<div class="wxhead">
 	<input class="form-control searchname" id="searchname" name="searchname" maxlength ="50" value="{{if .T.shname}}{{.T.shname}}{{end}}" placeholder="中标企业名称"/>
 	<div id="recList" style="display: none"></div>
-	<span class="tubiao"><img src="/images/wx/jywxjs.png"/></span>
-	<span class="qc"><img src="/images/wx/jyqingchu.png"/></span>
+	<span class="tubiao"><img src="/jylab/entsesearch/images/wx/jywxjs.png"/></span>
+	<span class="qc"><img src="/jylab/entsesearch/images/wx/jyqingchu.png"/></span>
 	<span class="shaixuan">筛选</span>
 	</div>
 	</form>
@@ -235,9 +248,9 @@
 <div id="set_search" class="hidden">
 	<div class="select">
 		<ul>
-			<li>金额<img src="/images/wx/sys-jt-bottom.png"></li>
+			<li>金额<img src="/jylab/entsesearch/images/wx/sys-jt-bottom.png"></li>
 			<li class="shuxian"></li>
-			<li>项目地区<img src="/images/wx/sys-jt-bottom.png"></li>
+			<li>项目地区<img src="/jylab/entsesearch/images/wx/sys-jt-bottom.png"></li>
 		</ul>
 	</div>
 	<div>
@@ -335,29 +348,28 @@
 				<td>序号</td>
 				<td>中标日期</td>
 				<td>项目名称</td>
-				<td>中标金额
-					(万元)</td>
+				<td>中标金额(万元)</td>
 			</tr>
 			</thead>
 			<tbody>
 			<tr>
 				<td>1</td>
 				<td>2017 0721</td>
-				<td><span class="higHlight">五峰土家族自治县</span>LED单色
-					户外电子屏采购项目</td>
+				<td><span>五峰土家族自治县</span>LED单色户外电子屏采购项目</td>
 				<td>1.30</td>
 			</tr>
 			<tr>
 				<td>2</td>
 				<td>2017 0721</td>
-				<td>G320下司至麻江良田公路
-					改扩建项目</td>
+				<td>G320下司至麻江良田公路改扩建项目</td>
 				<td>31</td>
 			</tr>
 			</tbody>
 		</table>
 	</section>
 </div>
+<!--tip-->
+<div class="tip">提示:为了获得更佳的体验,推荐使用电脑浏览器访问剑鱼网站jianyu360.com查看数据表格。</div>
 </body>
 </html>
 <script>
@@ -386,12 +398,12 @@
 
         function getRecList(entName) {
             $("#recList").html("");
-            $.post("/entSeSearch/recList",{entName:entName},function(r){
+            $.post("/jylab/entsesearch/recList",{entName:entName},function(r){
                 if(r){
                     if(typeof (r.recList)!="undefined"){
                         var recList = r.recList;
-                        for(var i=0;i<10;i++){
-                            var entName = recList[i];
+                        for(var i=0;i<recList.length;i++){
+                            var entName = recList[i].winner;
                             if(entName!="" && entName.length>20){
                                 entName = entName.substr(0,20)+"...";
                             }
@@ -412,12 +424,18 @@
                 });
             });
         }
+
+        $("body").click(function () {
+            $("#recList").hide();
+        });
     });
 
 	//显示筛选过滤选择
 	$(".shaixuan").click(function(){
 		if($("#set_search").attr("class")=="hidden"){
 			$("#set_search").removeClass("hidden");
+			$("#searchList").addClass("hidden");
+			$(".tip").addClass("hidden");
 		}else{
 			$("#set_search").addClass("hidden");
 		}
@@ -427,16 +445,16 @@
 	$("#set_search .select ul li:eq(0)").click(function(){
 		$(this).css("color","#2cb7ca");
 		$("#set_search .select ul li:eq(2)").css("color","#888");
-		$("#set_search .select ul li:eq(0) img").attr("src","/images/wx/sys-jt-bottom2.png");
-		$("#set_search .select ul li:eq(2) img").attr("src","/images/wx/sys-jt-bottom.png");
+		$("#set_search .select ul li:eq(0) img").attr("src","/jylab/entsesearch/images/wx/sys-jt-bottom2.png");
+		$("#set_search .select ul li:eq(2) img").attr("src","/jylab/entsesearch/images/wx/sys-jt-bottom.png");
 		$(".money").removeClass("hidden");
 		$(".area").addClass("hidden");
 	})
 	$("#set_search .select ul li:eq(2)").click(function(){
 		$(this).css("color","#2cb7ca");
 		$("#set_search .select ul li:eq(0)").css("color","#888");
-		$("#set_search .select ul li:eq(0) img").attr("src","/images/wx/sys-jt-bottom.png");
-		$("#set_search .select ul li:eq(2) img").attr("src","/images/wx/sys-jt-bottom2.png");
+		$("#set_search .select ul li:eq(0) img").attr("src","/jylab/entsesearch/images/wx/sys-jt-bottom.png");
+		$("#set_search .select ul li:eq(2) img").attr("src","/jylab/entsesearch/images/wx/sys-jt-bottom2.png");
 		$(".money").addClass("hidden");
 		$(".area").removeClass("hidden");
 	})

+ 27 - 17
src/jfw/modules/followent/src/followent/followent.go

@@ -1,26 +1,30 @@
 package followent
 
 import (
+	"config"
 	"fmt"
 	"log"
 	"qfw/util"
+	"qfw/util/elastic"
 	"qfw/util/redis"
+	"strconv"
 	"tools"
+
 	"github.com/go-xweb/xweb"
-	"qfw/util/elastic"
-	"config"
-	"strconv"
 )
 
 var mongodb = tools.MQFW
 
 type FollowEnt struct {
 	*xweb.Action
-	entList xweb.Mapper `xweb:"/jylab/followent/entList"` //获取关注企业列表
-	addEnt  xweb.Mapper `xweb:"/jylab/followent/addEnt"`  //添加关注企业页面
-	newInfo xweb.Mapper `xweb:"/jylab/followent/newInfo/(.*)/(.*)"` //企业最新信息
-	recList xweb.Mapper `xweb:"/jylab/followent/recList"` //获取推荐企业列表
-	saveEnt xweb.Mapper `xweb:"/jylab/followent/saveEnt"` //保存关注企业
+
+	entList    xweb.Mapper `xweb:"/jylab/followent/entList"`           //获取关注企业列表
+	addEnt     xweb.Mapper `xweb:"/jylab/followent/addEnt"`            //添加关注企业页面
+	newInfo    xweb.Mapper `xweb:"/jylab/followent/newInfo/(.*)/(.*)"` //企业最新信息
+	recList    xweb.Mapper `xweb:"/jylab/followent/recList"`           //获取推荐企业列表
+	saveEnt    xweb.Mapper `xweb:"/jylab/followent/saveEnt"`           //保存关注企业
+	followYorN xweb.Mapper `xweb:"/jylab/followent/followYorN"`        //查询用户是否关注企业
+
 }
 
 func init() {
@@ -57,12 +61,12 @@ func (f *FollowEnt) AddEnt() error {
 func (f *FollowEnt) RecList() {
 	fmt.Println("entName", f.GetString("entName"))
 	var entName = f.GetString("entName")
-	if entName!=""{
-		limit,_ := strconv.Atoi(config.Sysconfig["recommendEntLimit"].(string))
+	if entName != "" {
+		limit, _ := strconv.Atoi(config.Sysconfig["recommendEntLimit"].(string))
 		r := elastic.GetPage("winner", "winner", `{"winner":"`+entName+`"}`, ``, `"_id","winner"`, 0, limit)
-		if r!=nil && len(*r) != 0{
-			fmt.Println("RecList",r)
-			for _,v := range *r{
+		if r != nil && len(*r) != 0 {
+			fmt.Println("RecList", r)
+			for _, v := range *r {
 				v["_id"] = util.EncodeArticleId2ByCheck(v["_id"].(string))
 			}
 			f.ServeJson(map[string]interface{}{
@@ -81,14 +85,14 @@ func (f *FollowEnt) SaveEnt() {
 }
 
 //企业最新信息
-func (f *FollowEnt) NewInfo(winner,id string) error {
+func (f *FollowEnt) NewInfo(winner, id string) error {
 	defer util.Catch()
 	////var winner = "天津超林时代科技发展有限公司"
 	fields := `{"projectname":1,"projectcode":1,"bidamount":1,"title":1,"publishtime":1,"subtype":1}`
 	data, ok := mongodb.Find("bidding", `{"winner":"`+winner+`"}`, nil, fields, false, -1, -1)
-	if !ok || data == nil || len(*data) == 0 {
-		return f.Render("_error.html")
-	}
+	//if !ok || data == nil || len(*data) == 0 {
+	//	return f.Render("_error.html")
+	//}
 	if ok && data != nil && *data != nil && len(*data) != 0 {
 		f.T["data"] = data
 		fmt.Println(f.T["data"])
@@ -96,6 +100,12 @@ func (f *FollowEnt) NewInfo(winner,id string) error {
 	f.T["winner"] = winner
 	return f.Render("/weixin/set.html", &f.T)
 }
+func (f *FollowEnt) FollowYorN() error {
+	defer util.Catch()
+	userId := f.GetSession("userId").(string)
+	fmt.Println(userId)
+	return nil
+}
 
 //
 func (f *FollowEnt) Followent() error {

+ 1 - 1
src/jfw/modules/followent/src/web/staticres/jylab/followent/css/follow.css

@@ -417,7 +417,7 @@
 }
 .jynoticelist .priceStyle{
 	position: absolute;
-    top: 47px;
+    bottom: 10px;
     font-size: 13px;
     right: 7px;
     color: #a0a0a0;

+ 15 - 2
src/jfw/modules/followent/src/web/templates/weixin/set.html

@@ -18,15 +18,24 @@
 	var winner = {{.T.winner}};
 	
 	$(function(){
+		$.ajax({
+			type:'post',
+			url:'/jylab/followent/followYorN',
+			data:{},
+			success:function(r){
+				
+			}
+		})
 		var easyPopup = new EasyPopup("easypopup");
 		$(".noticehead").html(winner)
 		
 		for(var i = 0; i < data.length; i++){
 			var noticetime = '';
 			var type = '';
+			var amountHtml = '';
 			var listhtml = '';
 			var title = data[i]["title"];
-			var amount = parseInt(data[i]["bidamount"])/10000
+			var amount = data[i]["bidamount"];
 
 			if(data[i]["publishtime"]){
 				noticetime = new Date(Number(data[i]["publishtime"]+"000")).Format("MM-dd");	
@@ -34,6 +43,10 @@
 			if(typeof(data[i]["subtype"]) != "undefined" && data[i]["subtype"] != "" && data[i]["subtype"] !=null){
 				type = data[i]["subtype"];
 			}
+			if(typeof(amount) != "undefined" && amount != null && amount != ""){
+				amount = parseInt(amount)/1000;
+				amountHtml = '<span class="priceStyle">'+amount+'万元中标</span>';
+			}
 			listhtml = '<div class="jynoticelist">'
 			   	 			+'<div>'
 			        			+'<span class="noticetime">'+noticetime+'</span>'
@@ -44,7 +57,7 @@
 			    	 		+'</div>'
 			       			+'<div>'
 								+title
-								+'<span class="priceStyle">'+amount+'万元中标</span>'
+								+amountHtml
 			       			+'</div>'
 			    		+'</div>'
 			$(".jynotice").append(listhtml)