瀏覽代碼

Merge branch 'dev4.6.3.14' of http://192.168.3.207:8080/qmx/jy into dev4.6.3.14

zhangyuhan 3 年之前
父節點
當前提交
57aa0c2662

+ 8 - 6
src/jfw/front/shorturl.go

@@ -155,9 +155,9 @@ func (s *Short) Article(stype, id string) error {
 	s.T["isMember"] = isMember
 	s.T["isEntniche"] = isEntniche
 	s.T["isEntnicheNew"] = isEntnicheNew
-	node := CNode(userId)
+	node, hasRetainedCapital := CNode(userId)
 	var nodeStr string
-	if node {
+	if node || hasRetainedCapital {
 		nodeStr = "true"
 	} else {
 		nodeStr = "false"
@@ -377,8 +377,9 @@ func (s *Short) Article(stype, id string) error {
 	return nil
 }
 
-func CNode(userId string) bool {
+func CNode(userId string) (bool, bool) {
 	rM := map[string]interface{}{}
+	hasRetainedCapital := false
 	rdata, ok := mongodb.Find("saleLeads", map[string]interface{}{
 		"userid": userId,
 	}, `{"createtime":-1}`, nil, false, 0, 10)
@@ -398,6 +399,7 @@ func CNode(userId string) bool {
 		delete(rM, "userid")
 		delete(rM, "createtime")
 		delete(rM, "client")
+		hasRetainedCapital = true
 	}
 	if userinfo, ok := mongodb.FindById("user", userId, `{"s_phone":1,"s_m_phone":1,"s_myemail":1,"s_company":1,"o_jy":1,"o_vipjy":1}`); userinfo != nil && ok && len(*userinfo) > 0 {
 		s_phone := util.ObjToString((*userinfo)["s_phone"])
@@ -412,12 +414,12 @@ func CNode(userId string) bool {
 	if rM["name"] != nil && rM["name"] != "" && rM["phone"] != nil && rM["phone"] != "" && rM["company"] != nil && rM["company"] != "" && rM["position"] != nil && rM["position"] != "" {
 
 		if rM["position"] != "总裁" && rM["position"] != "总经理" && (rM["branch"] == nil || rM["branch"] == "") {
-			return false
+			return false, hasRetainedCapital
 		}
-		return true
+		return true, hasRetainedCapital
 
 	}
-	return false
+	return false, hasRetainedCapital
 }
 
 //查看公告详情次数限制

+ 9 - 5
src/jfw/modules/app/src/app/front/shorturl.go

@@ -96,7 +96,8 @@ func (s *Short) Article(stype, id string) error {
 			s.T["canRead"] = true
 		}
 		//检验是否留资
-		if CNode(userId) {
+		ok, hasRetainedCapital := CNode(userId)
+		if ok || hasRetainedCapital {
 			s.T["canRead"] = true
 		}
 	}
@@ -173,7 +174,9 @@ func (s *Short) Article(stype, id string) error {
 	}
 	return s.Redirect("/jyapp/free/mob/err")
 }
-func CNode(userId string) bool {
+
+func CNode(userId string) (bool, bool) {
+	hasRetainedCapital := false //是否留过资
 	rM := map[string]interface{}{}
 	rdata, ok := mongodb.Find("saleLeads", map[string]interface{}{
 		"userid": userId,
@@ -194,6 +197,7 @@ func CNode(userId string) bool {
 		delete(rM, "userid")
 		delete(rM, "createtime")
 		delete(rM, "client")
+		hasRetainedCapital = true
 	}
 	if userinfo, ok := mongodb.FindById("user", userId, `{"s_phone":1,"s_m_phone":1,"s_myemail":1,"s_company":1,"o_jy":1,"o_vipjy":1}`); userinfo != nil && ok && len(*userinfo) > 0 {
 		s_phone := util.ObjToString((*userinfo)["s_phone"])
@@ -208,12 +212,12 @@ func CNode(userId string) bool {
 	if rM["name"] != nil && rM["name"] != "" && rM["phone"] != nil && rM["phone"] != "" && rM["company"] != nil && rM["company"] != "" && rM["position"] != nil && rM["position"] != "" {
 
 		if rM["position"] != "总裁" && rM["position"] != "总经理" && (rM["branch"] == nil || rM["branch"] == "") {
-			return false
+			return false, hasRetainedCapital
 		}
-		return true
+		return true, hasRetainedCapital
 
 	}
-	return false
+	return false, hasRetainedCapital
 }
 
 func GetbelongUserId(disWord, userId string) (belongUserId string) {

+ 6 - 5
src/jfw/modules/app/src/web/templates/weixin/search/mainSearch.html

@@ -1148,6 +1148,7 @@
     }
     //回车事件
     document.onkeydown = function () {
+      debugger
         if(window.event && window.event.keyCode == 13) {
             window.event.returnValue = false;
             //超级搜索
@@ -1185,11 +1186,11 @@
             } else {
               var isNowIndex = $(".tabs-box .tabs-nav .active").index()
               if (!$(".tabs-box").hasClass('hidden') && isNowIndex !== 0) {
-                  if (isNowIndex === 1) {
-                    $("#supersearchPage input[name=super_searchinput]").blur();
-                    window.isKeyDownToEntSearch = true
-                    if (vEntSearchComponent) {
-                      vEntSearchComponent.toggleEntShow(true)
+                  if (isNowIndex === 2) {
+                    $("#supersearchPage input[name=super_searchinput]").blur()
+-                   (window.isKeyDownToEntSearch = true)
+                    if (vBuyerSearchComponent) {
+                      vBuyerSearchComponent.toggleEntShow(true)
                     }
                   }
               }