浏览代码

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

tsz 3 年之前
父节点
当前提交
c9b265c5d6

+ 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) {

+ 19 - 7
src/web/staticres/common-module/keep-tags/keep-ent-tags-template.js

@@ -532,14 +532,26 @@ function checkBackSuccess () {
   var isBackSuccess = sessionStorage.getItem('salesBackStatus') || false
   if (isBackSuccess == 'true') {
     var sessionData = JSON.parse(sessionStorage.getItem('salesBackData') || '{}')
-    if (sessionData.type === 'article_collection') {
-      if (vKeepComponent) {
-        vKeepComponent.changeBid(sessionData.id, sessionData.shoucang)
+    switch (sessionData.type) {
+      case 'article_collection': {
+        if (vKeepComponent) {
+          vKeepComponent.changeBid(sessionData.id, sessionData.shoucang)
+        }
+        break
       }
-    }
-    if (sessionData.type === 'article_original') {
-      if (!utils.isWeiXinBrowser) {
-        JyObj.openExternalLink(sessionData.url,"查看原文");
+      case 'article_original': {
+        if (!utils.isWeiXinBrowser) {
+          JyObj.openExternalLink(sessionData.url,"查看原文");
+        }
+        break
+      }
+      case 'jyarticle_see3_plus_wx': {
+        location.reload()
+        break
+      }
+      case 'jyarticle_see3_plus_app': {
+        location.reload()
+        break
       }
     }
   }

+ 19 - 7
src/web/staticres/common-module/keep-tags/keep-tags-template.js

@@ -606,14 +606,26 @@ function checkBackSuccess () {
   var isBackSuccess = sessionStorage.getItem('salesBackStatus') || false
   if (isBackSuccess == 'true') {
     var sessionData = JSON.parse(sessionStorage.getItem('salesBackData') || '{}')
-    if (sessionData.type === 'article_collection') {
-      if (vKeepComponent) {
-        vKeepComponent.changeBid(sessionData.id, sessionData.shoucang)
+    switch (sessionData.type) {
+      case 'article_collection': {
+        if (vKeepComponent) {
+          vKeepComponent.changeBid(sessionData.id, sessionData.shoucang)
+        }
+        break
       }
-    }
-    if (sessionData.type === 'article_original') {
-      if (!utils.isWeiXinBrowser) {
-        JyObj.openExternalLink(sessionData.url,"查看原文");
+      case 'article_original': {
+        if (!utils.isWeiXinBrowser) {
+          JyObj.openExternalLink(sessionData.url,"查看原文");
+        }
+        break
+      }
+      case 'jyarticle_see3_plus_wx': {
+        location.reload()
+        break
+      }
+      case 'jyarticle_see3_plus_app': {
+        location.reload()
+        break
       }
     }
   }