소스 검색

Merge branch 'dev2.0.1' of http://192.168.3.207:10080/qmx/jy into dev2.0.1

wangshan 7 년 전
부모
커밋
283d9e9431
5개의 변경된 파일93개의 추가작업 그리고 74개의 파일을 삭제
  1. 16 14
      src/jfw/front/follow.go
  2. 1 1
      src/jfw/front/shorturl.go
  3. 7 7
      src/jfw/front/swordfish.go
  4. 59 48
      src/web/templates/pc/biddingsearch_enterprise.html
  5. 10 4
      src/web/templates/weixin/wxinfocontent.html

+ 16 - 14
src/jfw/front/follow.go

@@ -66,10 +66,11 @@ func (m *Follow) CheckCStatus() error {
 	pname := m.GetString("pcname")
 	pcode := m.GetString("pccode")
 	userId, _ := m.GetSession("userId").(string)
+	openId, _ := m.GetSession("s_m_openid").(string)
 	flag := false
 	followid := ""
 	if userId != "" {
-		flag, followid = MFollow(userId, pname, pcode, "")
+		flag, followid = MFollow(userId, pname, pcode, "", openId)
 		//		follows, _ := mongodb.FindOneByField("follow_project", `{"s_id":"`+s_id+`","s_openid":"`+s_openid.(string)+`"}`, `{"_id":1}`)
 		//		if follows != nil && *follows != nil && len(*follows) > 0 {
 		//			flag = "t"
@@ -106,9 +107,9 @@ func (m *Follow) Fwsave() {
 	var status = "n"
 	var followId string
 	s_id := util.DecodeArticleId2ByCheck(m.GetString("id"))[0]
-	if mongodb.Count("follow_project", `{"s_userid":"`+userId+`"}`) >= followLimit {
+	if mongodb.Count("follow_project", `{"s_openid":"`+openid+`"}`) >= followLimit {
 		status = "m"
-	} else if mongodb.Count("follow_project", `{"s_userid":"`+m.GetSession("userId").(string)+`","s_id":"`+s_id+`"}`) > 0 {
+	} else if mongodb.Count("follow_project", `{"s_openid":"`+openid+`","s_id":"`+s_id+`"}`) > 0 {
 		status = "e"
 	} else {
 		data := make(map[string]interface{})
@@ -318,8 +319,9 @@ func (m *Follow) Photo(tp string) error {
 	m.T["projectname"] = projectname
 	m.T["projectcode"] = projectcode
 	userId, _ := m.GetSession("userId").(string)
+	openid := m.GetSession("s_m_openid").(string)
 	if userId != "" {
-		flag, followid := MFollow(userId, projectname, projectcode, "")
+		flag, followid := MFollow(userId, projectname, projectcode, "", openid)
 		if flag && len(followid) > 0 {
 			m.Redirect("/follow/set/list/" + followid)
 			return nil
@@ -398,14 +400,15 @@ func (m *Follow) Photo(tp string) error {
 func (m *Follow) AjaxReq() {
 	defer util.Catch()
 	userId := m.GetSession("userId").(string)
+	openid := m.GetSession("s_m_openid").(string)
 	var status = "n"
 	reqType := m.GetString("reqType")
 	var followId string
 	if reqType == "follow" { //快照页面关注
 		s_id := util.DecodeArticleId2ByCheck(m.GetString("id"))[0]
-		if mongodb.Count("follow_project", `{"s_userid":"`+userId+`"}`) >= followLimit {
+		if mongodb.Count("follow_project", `{"s_openid":"`+openid+`"}`) >= followLimit {
 			status = "m"
-		} else if mongodb.Count("follow_project", `{"s_userid":"`+m.GetSession("userId").(string)+`","s_id":"`+s_id+`"}`) > 0 {
+		} else if mongodb.Count("follow_project", `{"s_openid":"`+openid+`","s_id":"`+s_id+`"}`) > 0 {
 			status = "e"
 		} else {
 			publishtime, _ := m.GetInt("publishtime")
@@ -418,7 +421,6 @@ func (m *Follow) AjaxReq() {
 			toptype := m.GetString("toptype")
 			s_type := m.GetString("type")
 			if projectname != "" || projectcode != "" {
-				openid := m.GetSession("s_m_openid").(string)
 				data := map[string]interface{}{
 					"s_userid":      userId,
 					"s_openid":      openid,
@@ -479,7 +481,7 @@ func (m *Follow) AjaxReq() {
 			}
 		}
 	} else if reqType == "cancel" { //取消关注
-		if data, ok := mongodb.FindOne("follow_project", `{"s_userid":"`+userId+`","_id":"`+util.DecodeArticleId2ByCheck(m.GetString("id"))[0]+`"}`); ok && data != nil {
+		if data, ok := mongodb.FindOne("follow_project", `{"s_openid":"`+openid+`","_id":"`+util.DecodeArticleId2ByCheck(m.GetString("id"))[0]+`"}`); ok && data != nil {
 			(*data)["s_followid"] = util.BsonIdToSId((*data)["_id"])
 			delete(*data, "_id")
 			(*data)["i_status"] = 1
@@ -491,7 +493,7 @@ func (m *Follow) AjaxReq() {
 		}
 	} else if reqType == "followset" {
 		id := util.DecodeArticleId2ByCheck(m.GetString("id"))[0]
-		if mongodb.Count("follow_project", map[string]interface{}{"_id": bson.ObjectIdHex(id), "s_userid": m.GetSession("userId").(string)}) == 1 {
+		if mongodb.Count("follow_project", map[string]interface{}{"_id": bson.ObjectIdHex(id), "s_openid": openid}) == 1 {
 			data := make(map[string]interface{})
 			data["l_updatetime"] = time.Now().Unix()
 			if remind, _ := m.GetInteger("remind"); remind == 1 {
@@ -519,7 +521,8 @@ func (m *Follow) AjaxReq() {
 //我关注的项目
 func (m *Follow) List() error {
 	defer util.Catch()
-	datas, ok := mongodb.Find("follow_project", `{"s_userid":"`+m.GetSession("userId").(string)+`"}`, `{"l_lastpushtime":-1,"l_createtime":-1}`, `{"s_projectname":1,"s_projectcode":1,"i_remind":1,"l_lastpushtime":1,"l_createtime":1}`, false, -1, -1)
+	myopenid, _ := m.Session().Get("s_m_openid").(string)
+	datas, ok := mongodb.Find("follow_project", `{"s_openid":"`+myopenid+`"}`, `{"l_lastpushtime":-1,"l_createtime":-1}`, `{"s_projectname":1,"s_projectcode":1,"i_remind":1,"l_lastpushtime":1,"l_createtime":1}`, false, -1, -1)
 	m.T["flag"] = false
 	if ok && datas != nil && len(*datas) > 0 {
 		for k, v := range *datas {
@@ -534,7 +537,6 @@ func (m *Follow) List() error {
 			m.T["flag"] = true
 		}
 	}
-	myopenid, _ := m.Session().Get("s_m_openid").(string)
 	m.T["openid"] = se.EncodeString(myopenid)
 	mynickname, _ := m.Session().Get("s_nickname").(string)
 	myavatar, _ := m.Session().Get("s_avatar").(string)
@@ -559,10 +561,10 @@ func (m *Follow) Addsave() error {
 	var status = "n"
 	var id string
 	userId := m.GetSession("userId").(string)
-	if mongodb.Count("follow_project", `{"s_userid":"`+userId+`"}`) >= followLimit {
+	openid := m.GetSession("s_m_openid").(string)
+	if mongodb.Count("follow_project", `{"s_openid":"`+openid+`"}`) >= followLimit {
 		status = "m"
 	} else {
-		openid := m.GetSession("s_m_openid").(string)
 		if projectname := m.GetString("projectname"); projectname != "" {
 			data := map[string]interface{}{
 				"s_userid":      userId,
@@ -647,7 +649,7 @@ func (m *Follow) Set(tp, id string) error {
 	fields := `{"s_id":1,"i_source":1,"s_projectname":1,"s_projectcode":1,"s_url":1,"i_remind":1,"s_type":1,"l_bidopentime":1,"l_remindtime":1,"a_relationinfo":1,"a_visited":1,"l_lastpushtime":1,"a_lastpushids":1}`
 	data, ok := mongodb.FindOneByField("follow_project", map[string]interface{}{
 		"_id":      bson.ObjectIdHex(id),
-		"s_userid": m.GetSession("userId").(string),
+		"s_openid": m.GetSession("s_m_openid").(string),
 	}, fields)
 	m.T["isDel"] = false
 	if ok && (data == nil || len(*data) == 0) {

+ 1 - 1
src/jfw/front/shorturl.go

@@ -109,7 +109,7 @@ func (s *Short) Article(stype, id string) error {
 		s.T["signature"] = wx.SignJSSDK(s.Site() + s.Url())
 		userId, _ := s.GetSession("userId").(string)
 		var obj map[string]interface{}
-		obj = wxvisitD(sid, userId)
+		obj = wxvisitD(sid, userId, myopenid)
 		if len(obj) > 0 {
 			//获取打赏文案
 			//util.ReadConfig(&config.Sysconfig)

+ 7 - 7
src/jfw/front/swordfish.go

@@ -1051,7 +1051,7 @@ func (m *Front) VisitRedirect() {
 	m.T["signature"] = wx.SignJSSDK(m.Site() + m.Url())
 	userId, _ := m.GetSession("userId").(string)
 	var obj map[string]interface{}
-	obj = wxvisitD(sid, userId)
+	obj = wxvisitD(sid, userId, myopenid)
 	if len(obj) > 0 {
 		//获取打赏文案
 		m.T["rewardText"], m.T["advertText"] = getRewardText()
@@ -1063,7 +1063,7 @@ func (m *Front) VisitRedirect() {
 		m.Redirect(surl)
 	}
 }
-func wxvisitD(sid, userId string) (objdata map[string]interface{}) {
+func wxvisitD(sid, userId, openId string) (objdata map[string]interface{}) {
 	defer util.Catch()
 	var obj map[string]interface{}
 	if len(sid) > 5 {
@@ -1089,7 +1089,7 @@ func wxvisitD(sid, userId string) (objdata map[string]interface{}) {
 				pcode, _ := obj["projectcode"].(string)
 				pname, _ := obj["projectname"].(string)
 				titleTmp, _ := obj["title"].(string)
-				obj["followFlag"], obj["followId"] = MFollow(userId, pname, pcode, titleTmp)
+				obj["followFlag"], obj["followId"] = MFollow(userId, pname, pcode, titleTmp, openId)
 				obj["hasSession"] = true
 			}
 			if strings.Trim(util.ObjToString(obj["detail"]), " ") == "" {
@@ -1100,11 +1100,11 @@ func wxvisitD(sid, userId string) (objdata map[string]interface{}) {
 	return obj
 }
 
-func MFollow(userId string, pname string, pcode string, title string) (bool, string) {
+func MFollow(userId, pname, pcode, title, openid string) (bool, string) {
 	defer util.Catch()
 	var followId string
 	followFlag := false
-	follows, ok := mongodb.Find("follow_project", `{"s_userid":"`+userId+`"}`, `{"_id":1,"s_projectname":1,"s_projectcode":1}`, nil, false, -1, -1)
+	follows, ok := mongodb.Find("follow_project", `{"s_openid":"`+openid+`"}`, `{"_id":1,"s_projectname":1,"s_projectcode":1}`, nil, false, -1, -1)
 	if ok && follows != nil && len(*follows) > 0 {
 		for _, v := range *follows {
 			pc, _ := v["s_projectcode"].(string)
@@ -1691,7 +1691,7 @@ func (m *Front) DelOL() error {
 		})
 		return nil
 	}
-	if datas, ok := mongodb.Find("follow_project", bson.M{"_id": bson.M{"$in": ids}, "s_userid": userId}, nil, nil, false, -1, -1); ok && datas != nil {
+	if datas, ok := mongodb.Find("follow_project", bson.M{"_id": bson.M{"$in": ids}, "s_openid": m.GetSession("s_m_openid").(string)}, nil, nil, false, -1, -1); ok && datas != nil {
 		for _, v := range *datas {
 			delete(v, "_id")
 			v["i_status"] = 2
@@ -1699,7 +1699,7 @@ func (m *Front) DelOL() error {
 			go delRelRedis(v["s_openid"], v["a_relationinfo"])
 		}
 	}
-	if mongodb.Del("follow_project", bson.M{"_id": bson.M{"$in": ids}, "s_userid": userId}) {
+	if mongodb.Del("follow_project", bson.M{"_id": bson.M{"$in": ids}, "s_openid": m.GetSession("s_m_openid").(string)}) {
 		flag = "T"
 	}
 	m.ServeJson(map[string]interface{}{

+ 59 - 48
src/web/templates/pc/biddingsearch_enterprise.html

@@ -231,6 +231,15 @@
 			    left: 198px;
 			    top: 148px;
 			}
+			#searchInner .searchControl .seaTender-inner .tabContainer .lucene-table table{
+				width: 1200px;
+			}
+			#searchInner .searchControl .seaTender-inner .tabContainer .lucene-table>div{
+				width: 1220;
+			}
+			#searchInner .searchControl .seaTender-inner .tabContainer{
+				overflow: inherit;
+			}
 		</style>
 	</head>
 
@@ -373,52 +382,54 @@
 					项目地区:
 				</div>
 				<div class="region-content">
-					<span id="regionBtn" class="active">全国</span>
-					<i class="diver"></i>
-					<font class="parent-node">华北地区</font>
-					<font>北京</font>
-					<font>天津</font>
-					<font>河北</font>
-					<font>山西</font>
-					<font>内蒙古</font>
-					<i class="diver"></i>
-					<font class="parent-node">东北地区</font>
-					<font>辽宁</font>
-					<font>吉林</font>
-					<font>黑龙江</font>
-					<i class="diver"></i>
-					<font class="parent-node">华东地区</font>
-					<font>上海</font>
-					<font>江苏</font>
-					<font>浙江</font>
+					<span id="regionBtn" class=" active">全国</span>
+					<i class="diver">A</i>
 					<font>安徽</font>
+					<i class="diver">B</i>
+					<font>北京</font>
+					<i class="diver">C</i>
+					<font>重庆</font>
+					<i class="diver">F</i>
 					<font>福建</font>
-					<font>江西</font>
-					<font>山东</font>
-					<i class="diver"></i>
-					<font class="parent-node">华南地区</font>
+					<i class="diver">G</i>
 					<font>广东</font>
 					<font>广西</font>
+					<font>贵州</font>
+					<font>甘肃</font>
+					<i class="diver">H</i>
+					<font>河北</font>
+					<font>湖北</font>
+					<font>黑龙江</font>
 					<font>海南</font>
-					<i class="diver"></i>
-					<font class="parent-node">华中地区</font>
 					<font>河南</font>
-					<font>湖北</font>
 					<font>湖南</font>
-					<i class="diver"></i>
-					<font class="parent-node">西南地区</font>
-					<font>重庆</font>
+					<i class="diver">J</i>
+					<font>吉林</font>
+					<br>
+					<font>江苏</font>
+					<font>江西</font>
+					<i class="diver">L</i>
+					<font>辽宁</font>
+					<i class="diver">N</i>
+					<font>内蒙古</font>
+					<font>宁夏</font>
+					<i class="diver">Q</i>
+					<font>青海</font>
+					<i class="diver">S</i>
+					<font>山西</font>
+					<font>陕西</font>
+					<font>上海</font>
+					<font>山东</font>
 					<font>四川</font>
-					<font>贵州</font>
-					<font>云南</font>
+					<i class="diver">T</i>
+					<font>天津</font>
+					<i class="diver">X</i>
 					<font>西藏</font>
-					<i class="diver"></i>
-					<font class="parent-node">西北地区</font>
-					<font>陕西</font>
-					<font>甘肃</font>
-					<font>青海</font>
-					<font>宁夏</font>
 					<font>新疆</font>
+					<i class="diver">Y</i>
+					<font>云南</font>
+					<i class="diver">Z</i>
+					<font>浙江</font>
 				</div>
 			</div>
 		</div>
@@ -450,10 +461,10 @@
 						<thead>
 						<tr>
 						{{if .T.searchvalue}}
-							<td>序号</td>
+							<td width="35">序号</td>
 							<td width="150">中标日期</td>
-							<td width="830">项目名称</td>
-							<td>中标金额(万元)</td>
+							<td width="865">项目名称</td>
+							<td width="150">中标金额(万元)</td>
 						{{else}}
 							<td width="48">序号</td>
 							<td width="315">项目名称</td>
@@ -1366,7 +1377,7 @@
 							+'<div class="luce-left">'
 							+'<div class="left-title">'
 							+'<em>'+index+'.</em>'
-							+'<a onclick="noIn(this)" dataid="'+datas[i].linkid+'" target="_blank">'+datas[i].title+'</a>'
+							+'<a onclick="noIn(this)" dataid="'+datas[i]._id+'" target="_blank">'+datas[i].title+'</a>'
 							+'</div>'
 							+'</div>'
 							+'<div class="luce-right">'
@@ -1410,7 +1421,7 @@
 					}
 				}
 				listItem+='</div></div></li>'
-				tableHtml +='<tr onclick="noIn(this)" dataid="'+datas[i].linkid+'" dataindustry="'+datas[i].industry+'" target="_blank">'
+				tableHtml +='<tr onclick="noIn(this)" dataid="'+datas[i]._id+'" dataindustry="'+datas[i].industry+'" target="_blank">'
 						+'<td width="48"><div>'+index+'</div></td>'
 						
 				if(typeof(datas[i].projectname) != "undefined" && datas[i].projectname != null && datas[i].projectname != ""){
@@ -1479,25 +1490,25 @@
 					tableHtml+='</tr>'
 			}else{
 				 formItem += '<tr onclick="noIn(this)" dataid="'+datas[i].linkid+'">'+
-							'<td>'+index+'</td>'
+							'<td width="35">'+index+'</td>'
 				//
 				if(typeof(datas[i].jgtime) != "undefined" && datas[i].jgtime != null && datas[i].jgtime != ""){
 					var diff = formatDate(Number(datas[i].jgtime),"s");
 					if(diff != null){
-						formItem += '<td>'+diff+'</td>';
+						formItem += '<td width="150">'+diff+'</td>';
 					}else{
-						formItem += '<td></td>';
+						formItem += '<td width="150"></td>';
 					}
 				}else{
-					formItem += '<td></td>';
+					formItem += '<td width="150"></td>';
 				}
-				formItem +='<td class="tt-l">'+datas[i].projectname+'</td>'
+				formItem +='<td class="tt-l" width="865">'+datas[i].projectname+'</td>'
 				//
 				if(typeof(datas[i].bidamount) != "undefined" && datas[i].bidamount != null && datas[i].bidamount != ""){
 					var bidamount = parseInt(datas[i].bidamount)/10000;
-					formItem += '<td class="tt-r">'+bidamount+'</td>';
+					formItem += '<td class="tt-r" width="150">'+bidamount+'</td>';
 				}else{
-					formItem += '<td></td>';
+					formItem += '<td width="150"></td>';
 				}
 				formItem +='</tr>'
 			}

+ 10 - 4
src/web/templates/weixin/wxinfocontent.html

@@ -78,7 +78,7 @@ pre {
 	/*margin-left: -15;*/
 }
 .toolbar span{
-	margin-left: 5px;
+	font-size: 13px;
 }
 .toolbar i{
 	margin-right: 3px;
@@ -86,6 +86,8 @@ pre {
 .toolbar .follow{
 	float: right;
 	color: #ffba00;
+	position: relative;
+	top: 2px;
 }
 .toolbar .follow i{
 	top: 2px;
@@ -104,6 +106,8 @@ pre {
 	border-radius: 3px;
 	padding: 1px 3px;    
 	border: 1px solid #24C0D7;
+	margin-right: 3px;
+	float: left;
 }
 .type{
 	padding: 1px 3px;
@@ -112,6 +116,7 @@ pre {
 	color: #fff;
 	border-radius: 3px;
 	margin-right: 3px;
+	float: left;
 }
 .industry{
 	padding: 1px 3px;
@@ -120,6 +125,7 @@ pre {
 	color: #fff;
 	border-radius: 3px;
 	margin-right: 3px;
+	float: left;
 }
 .guide{
 	text-align: center;
@@ -424,7 +430,7 @@ pre {
 				}
 			}
 		</script>
-		{{if .T.obj.hasSession}}{{if or .T.obj.projectname .T.obj.projectcode}}<span class="follow">{{if .T.obj.followFlag}}<i class="glyphicon yiguanzhu"></i>已关注{{else}}<i class="glyphicon weiguanzhu"></i>关注项目{{end}}</span>{{end}}{{else}}<!--<a href="/swordfish/share/-1" style="text-decoration: none;color:#24C0D7;"><span class="follow"><i class="glyphicon weiguanzhu"></i></span>关注项目</a>-->{{end}}
+		{{if .T.obj.hasSession}}{{if or .T.obj.projectname .T.obj.projectcode}}<span class="follow">{{if .T.obj.followFlag}}<i class="glyphicon yiguanzhu"></i>已关注{{else}}<i class="glyphicon weiguanzhu"></i>关注项目{{end}}</span>{{end}}{{else}}<!--<a href="/swordfish/share/-1" style="text-decoration: none;color:#24C0D7;"><span class="follow"><i class="glyphicon weiguanzhu"></i></span>关注项目</a>-->{{end}}
 	</div>
 	<!--{{if .T.obj.hasSession}}
 		{{if or .T.obj.projectname .T.obj.projectcode}}
@@ -1049,7 +1055,7 @@ $(function(){
 			}else{
 				followFlag = false;
 				jumpFlag = false;
-				$(".follow").html('<i class="glyphicon weiguanzhu"></i>关注项目');
+				$(".follow").html('<i class="glyphicon weiguanzhu"></i>关注项目');
 			}
 		})
 	}
@@ -1060,7 +1066,7 @@ $(function(){
 					EasyAlert.show("已取消<br>关注");
 					followFlag = false;
 					jumpFlag = false;
-					$(".follow").html('<i class="glyphicon weiguanzhu"></i>关注项目');
+					$(".follow").html('<i class="glyphicon weiguanzhu"></i>关注项目');
 				}else{
 					EasyAlert.show("取消关注失败!");
 				}