Sfoglia il codice sorgente

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

熊啸云 3 anni fa
parent
commit
3ca8a7337d

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

@@ -1056,20 +1056,24 @@ func (f *Front) TSGuide() error {
 						break
 					}
 				}
+				areas := map[string]interface{}{
+					area: []string{},
+				}
 				saveData := bson.M{
-					"o_jy.o_area":       []string{area},
+					"o_jy.o_area":       areas,
 					"o_jy.a_key":        keyMaps,
 					"o_jy.l_modifydate": time.Now().Unix(),
 					"i_ts_guide":        2,
 				}
-				flag := mongodb.UpdateById("user", userid, bson.M{"$set": saveData})
-				if flag {
-					jy.ClearBigVipUserPower(userid)
-				}
-				result["flag"] = flag
+				result["flag"] = mongodb.UpdateById("user", userid, bson.M{"$set": saveData})
 			}
 		} else if reqType == "over" {
-			mongodb.UpdateById("user", userid, bson.M{"$set": bson.M{"i_ts_guide": 1}})
+			saveData := bson.M{
+				"o_jy.o_area":       map[string]interface{}{},
+				"o_jy.l_modifydate": time.Now().Unix(),
+				"i_ts_guide":        1,
+			}
+			result["flag"] = mongodb.UpdateById("user", userid, bson.M{"$set": saveData})
 		} else if reqType == "preview" {
 			rlt := elastic.GetByNgram(INDEX, TYPE, strings.Split(f.GetString("key"), " "), "", FINDF, `{"publishtime":-1}`, `"_id","title","publishtime","toptype","subtype","type","area","href","areaval"`, 0, 10)
 			if *rlt != nil && len(*rlt) > 0 {
@@ -1079,6 +1083,9 @@ func (f *Front) TSGuide() error {
 			}
 			result["data"] = rlt
 		}
+		if result["flag"] != nil && result["flag"].(bool) {
+			jy.ClearBigVipUserPower(userid)
+		}
 		f.ServeJson(result)
 	}
 	return nil

+ 5 - 1
src/jfw/front/wxkeyset.go

@@ -33,9 +33,13 @@ func (m *Front) WxKeyset(tpl string) error {
 		})
 	}
 	vipMsg := jy.GetBigVipUserBaseMsg(userid, public.Mysql, public.MQFW)
-	if tpl == "index" && vipMsg.VipStatus <= 0 && vipMsg.Status <= 0 && isInTSguide(userid) { //仅免费用户跳转向导页面
+	if (tpl == "index" || tpl == "filterset") && vipMsg.VipStatus <= 0 && vipMsg.Status <= 0 && isInTSguide(userid) { //仅免费用户跳转向导页面
 		return m.Redirect("/front/tenderSubscribe/guide")
 	}
+	//到新订阅设置
+	if vipMsg.IsUpgrade {
+		return m.Redirect("/front/vipsubscribe/toSubVipSetPage")
+	}
 	if tpl == "seniorset" {
 		data, ok := mongodb.FindById("user", userid, `{"o_jy":1}`)
 		if ok && data != nil && len(*data) > 0 {

+ 14 - 7
src/jfw/modules/app/src/app/front/front.go

@@ -314,20 +314,24 @@ func (f *Front) TSGuide() error {
 						break
 					}
 				}
+				areas := map[string]interface{}{
+					area: []string{},
+				}
 				saveData := bson.M{
-					"o_jy.o_area":       []string{area},
+					"o_jy.o_area":       areas,
 					"o_jy.a_key":        keyMaps,
 					"o_jy.l_modifydate": time.Now().Unix(),
 					"i_ts_guide":        2,
 				}
-				flag := mongodb.UpdateById("user", userid, bson.M{"$set": saveData})
-				if flag {
-					jy.ClearBigVipUserPower(userid)
-				}
-				result["flag"] = flag
+				result["flag"] = mongodb.UpdateById("user", userid, bson.M{"$set": saveData})
 			}
 		} else if reqType == "over" {
-			mongodb.UpdateById("user", userid, bson.M{"$set": bson.M{"i_ts_guide": 1}})
+			saveData := bson.M{
+				"o_jy.o_area":       map[string]interface{}{},
+				"o_jy.l_modifydate": time.Now().Unix(),
+				"i_ts_guide":        1,
+			}
+			result["flag"] = mongodb.UpdateById("user", userid, bson.M{"$set": saveData})
 		} else if reqType == "preview" {
 			rlt := elastic.GetByNgram(INDEX, TYPE, strings.Split(f.GetString("key"), " "), "", FINDF, `{"publishtime":-1}`, `"_id","title","publishtime","toptype","subtype","type","area","href","areaval"`, 0, 10)
 			if *rlt != nil && len(*rlt) > 0 {
@@ -337,6 +341,9 @@ func (f *Front) TSGuide() error {
 			}
 			result["data"] = rlt
 		}
+		if result["flag"] != nil && result["flag"].(bool) {
+			jy.ClearBigVipUserPower(userid)
+		}
 		f.ServeJson(result)
 	}
 	return nil

+ 7 - 0
src/jfw/modules/app/src/app/front/wxkeyset.go

@@ -5,7 +5,9 @@ import (
 	. "app/jyutil"
 	"fmt"
 	"jfw/config"
+	"jfw/public"
 	"qfw/util"
+	"qfw/util/jy"
 	"regexp"
 	"strconv"
 	"strings"
@@ -22,6 +24,11 @@ func (m *Front) WxKeyset(tpl string) error {
 	if tpl == "index" && isInTSguide(userid) { //仅免费用户跳转向导页面
 		return m.Redirect("/jyapp/tenderSubscribe/guide")
 	}
+	//到新订阅设置
+	vipMsg := jy.GetBigVipUserBaseMsg(userid, public.Mysql, public.MQFW)
+	if vipMsg.IsUpgrade {
+		return m.Redirect("/front/vipsubscribe/toSubVipSetPage")
+	}
 	if tpl == "seniorset" {
 		data, ok := mongodb.FindById("user", userid, `{"o_jy":1}`)
 		if ok && data != nil && len(*data) > 0 {

+ 3 - 7
src/jfw/modules/app/src/web/staticres/jyapp/big-member/js/set_area.js

@@ -427,13 +427,9 @@ var vNode = {
         },
         onChange: function () {
             var pState = this.checkAllProvinceState()
-            if (this.config.onlyProvince) {
-
-            } else {
-                // 如果所有省份被全选,则取消所有选中,让全国选中
-                if (pState.allSelected || pState.noSelected) {
-                    this.setCitySelected()
-                }
+            // 如果所有省份被全选,则取消所有选中,让全国选中
+            if (pState.allSelected || pState.noSelected) {
+                this.setCitySelected()
             }
             
             // 获取当前状态

+ 24 - 17
src/jfw/modules/app/src/web/staticres/jyapp/wxtsguide/main.js

@@ -57,23 +57,30 @@ var Guide = {
 	},
 	//跳过向导
 	skip: function(){
-		$.post("/jyapp/tenderSubscribe/guide",{reqType: "over"},function(){
-      var guideKey = localStorage.tsGuide_keywords
-      if(localStorage){
-        localStorage.tsGuide_status = "1";
-        localStorage.removeItem("tsGuide_selectIndustrys");
-        localStorage.removeItem("tsGuide_keywords");
-        localStorage.removeItem("tsGuide_preview");
-        localStorage.removeItem("tsGuide_step");
-      }
-			if (!mySysIsIos()){
-				JyObj.finishGuide();
-      }
-      if (guideKey) {
-        window.location.replace('/jyapp/wxkeyset/keyset/index')
-      } else {
-        window.location.replace('/jyapp/wxkeyset/keyset/filterset?type=add&index=0&from=guide')
-      }
+		$.post("/jyapp/tenderSubscribe/guide",{reqType: "over"},function(r){
+		    var guideKey = localStorage.tsGuide_keywords
+		      if(localStorage){
+		        localStorage.tsGuide_status = "1";
+		        localStorage.removeItem("tsGuide_selectIndustrys");
+		        localStorage.removeItem("tsGuide_keywords");
+		        localStorage.removeItem("tsGuide_preview");
+		        localStorage.removeItem("tsGuide_step");
+		    }
+			//Android客户端没有使用
+//			if (!mySysIsIos()){
+//				JyObj.finishGuide();
+//		    }
+			
+			if (guideKey) {
+		        window.location.replace('/jyapp/vipsubscribe/toSubVipSetPage')
+		    } else {
+		        window.location.replace('/jyapp/vipsubscribe/toSetKeyWordPage?type=add&index=0&from=guide')
+		    }
+//		    if (guideKey) {
+//		        window.location.replace('/jyapp/wxkeyset/keyset/index')
+//		    } else {
+//		        window.location.replace('/jyapp/wxkeyset/keyset/filterset?type=add&index=0&from=guide')
+//		    }
 		});
 	},
 	//下一步

+ 29 - 0
src/jfw/modules/publicapply/src/subscribe/entity/entity.go

@@ -91,6 +91,35 @@ func DataCount(uid, item string, index int) int64 {
 	return elastic.Count(INDEX, TYPE, qstr)
 }
 
+func KeysetDataCount(userId, key, notkey string, matchway int) int64 {
+	key = strings.TrimSpace(key)
+	notkey = strings.TrimSpace(notkey)
+	if key == "" {
+		return 0
+	}
+	// sql := GetSqlObjFromId(userId, "", -1)
+	sql := GetSqlObjFromFreeId(userId, "", -1)
+	viewKeyWords := []ViewKeyWord{}
+	if matchway == 0 {
+		viewKeyWords = append(viewKeyWords, ViewKeyWord{
+			Keyword:  strings.Split(key, " "),
+			Exclude:  strings.Split(notkey, " "),
+			MatchWay: matchway,
+		})
+	} else {
+		for _, v := range strings.Split(key, " ") {
+			viewKeyWords = append(viewKeyWords, ViewKeyWord{
+				Keyword:  []string{v},
+				Exclude:  strings.Split(notkey, " "),
+				MatchWay: matchway,
+			})
+		}
+	}
+	sql.Keyword = viewKeyWords
+	qstr := GetVIPViewSql(userId, sql)
+	return elastic.Count(INDEX, TYPE, qstr)
+}
+
 func SubViewDatas(userId, allquery string, pageNum int) (keys []interface{}, list *[]map[string]interface{}, hasNextPage bool) {
 	if userId == "" {
 		return

+ 6 - 5
src/jfw/modules/publicapply/src/subscribe/service/action.go

@@ -6,9 +6,10 @@ import (
 
 type ServiceStruct struct {
 	*xweb.Action
-	subscribeMsg   xweb.Mapper `xweb:"/free/subscribe"`      //获取用户订阅信息
-	getPushCount   xweb.Mapper `xweb:"/free/pushcount"`      //推送结果预览 计数
-	getPushView    xweb.Mapper `xweb:"/free/pushview"`       //推送结果预览
-	areaPackEndTip xweb.Mapper `xweb:"/free/areapack/(.*)"`  //省份订阅包到期提醒
-	oneProvinceSet xweb.Mapper `xweb:"/free/oneProvinceSet"` //免费老用户点击去升级订阅设置
+	subscribeMsg     xweb.Mapper `xweb:"/free/subscribe"`      //获取用户订阅信息
+	getPushCount     xweb.Mapper `xweb:"/free/pushcount"`      //推送结果预览 计数
+	getPushView      xweb.Mapper `xweb:"/free/pushview"`       //推送结果预览
+	getPushCountitem xweb.Mapper `xweb:"/free/pushcountitem"`  //单组推送结果预览 计数
+	areaPackEndTip   xweb.Mapper `xweb:"/free/areapack/(.*)"`  //省份订阅包到期提醒
+	oneProvinceSet   xweb.Mapper `xweb:"/free/oneProvinceSet"` //免费老用户点击去升级订阅设置
 }

+ 11 - 0
src/jfw/modules/publicapply/src/subscribe/service/service.go

@@ -67,6 +67,17 @@ func (this *ServiceStruct) GetPushCount() {
 	}
 }
 
+func (this *ServiceStruct) GetPushCountitem() {
+	defer qu.Catch()
+	userId, _ := this.GetSession("userId").(string)
+	if userId != "" {
+		matchway, _ := this.GetInteger("matchway")
+		this.ServeJson(map[string]interface{}{
+			"count": entity.KeysetDataCount(userId, this.GetString("key"), this.GetString("notkey"), matchway),
+		})
+	}
+}
+
 //
 func (this *ServiceStruct) AreaPackEndTip(types string) {
 	userId, _ := this.GetSession("userId").(string)

+ 3 - 0
src/jfw/modules/publicapply/src/subscribePush/entity/keyWords.go

@@ -184,6 +184,7 @@ func AddKeyWordsFree(types, userId, classIndex, className, keywordsIndex, keywor
 		a_items := make([]interface{}, 0)
 		ojy, _ := (*data)[types].(map[string]interface{})
 		a_key, errs := ojy["a_key"].([]interface{})
+		log.Println(a_key, errs)
 		if !errs {
 			db.Mgo.UpdateById("user", userId, map[string]interface{}{
 				"$set": map[string]interface{}{
@@ -193,6 +194,8 @@ func AddKeyWordsFree(types, userId, classIndex, className, keywordsIndex, keywor
 		}
 		if ki, _ := strconv.Atoi(keywordsIndex); ki > len(a_key) {
 			keywordsIndex = strconv.Itoa(len(a_key))
+		} else if ki == 0 {
+			keywordsIndex = strconv.Itoa(ki)
 		}
 		a_items = append(a_items, ojy)
 		//排除词处理 词过长或者为空的情况

+ 3 - 7
src/web/staticres/big-member/js/set_area.js

@@ -427,13 +427,9 @@ var vNode = {
         },
         onChange: function () {
             var pState = this.checkAllProvinceState()
-            if (this.config.onlyProvince) {
-
-            } else {
-                // 如果所有省份被全选,则取消所有选中,让全国选中
-                if (pState.allSelected || pState.noSelected) {
-                    this.setCitySelected()
-                }
+            // 如果所有省份被全选,则取消所有选中,让全国选中
+            if (pState.allSelected || pState.noSelected) {
+                this.setCitySelected()
             }
             
             // 获取当前状态

+ 20 - 17
src/web/staticres/wxtsguide/main.js

@@ -57,23 +57,26 @@ var Guide = {
 	},
 	//跳过向导
 	skip: function(){
-		
-		$.post("/front/tenderSubscribe/guide",{reqType: "over"},function(){
-      var guideKey = localStorage.tsGuide_keywords
-
-      if(localStorage){
-        localStorage.tsGuide_status = "1";
-        localStorage.removeItem("tsGuide_selectIndustrys");
-        localStorage.removeItem("tsGuide_keywords");
-        localStorage.removeItem("tsGuide_preview");
-        localStorage.removeItem("tsGuide_step");
-      }
-
-      if (guideKey) {
-        window.location.replace('/wxkeyset/keyset/index')
-      } else {
-        window.location.replace('/wxkeyset/keyset/filterset?type=add&index=0&from=guide')
-      }
+		$.post("/front/tenderSubscribe/guide",{reqType: "over"},function(r){
+	      	var guideKey = localStorage.tsGuide_keywords
+	      	if(localStorage){
+	       		localStorage.tsGuide_status = "1";
+	        	localStorage.removeItem("tsGuide_selectIndustrys");
+	        	localStorage.removeItem("tsGuide_keywords");
+	        	localStorage.removeItem("tsGuide_preview");
+	        	localStorage.removeItem("tsGuide_step");
+	      	}
+	
+	      	if (guideKey) {
+	        	window.location.replace('/front/vipsubscribe/toSubVipSetPage')
+	      	} else {
+	        	window.location.replace('/front/vipsubscribe/toSetKeyWordPage?type=add&index=0&from=guide')
+	      	}
+//	      	if (guideKey) {
+//	        	window.location.replace('/wxkeyset/keyset/index')
+//	      	} else {
+//	        	window.location.replace('/wxkeyset/keyset/filterset?type=add&index=0&from=guide')
+//	      	}
 		});
 	},
 	//下一步

+ 1 - 1
src/web/templates/weixin/wxtsguide.html

@@ -14,7 +14,7 @@ var isBodyShow = true;
 <script src="/js/jquery.js"></script>
 <script src="{{Msg "seo" "cdn"}}/js/rem.js?v={{Msg "seo" "version"}}"></script>
 <!--<script src='{{Msg "seo" "cdn"}}/js/check-bind-phone.js?v={{Msg "seo" "version"}}'></script>-->
-<script src="/wxtsguide/main.js?v={{Msg "seo" "version"}}1"></script>
+<script src="/wxtsguide/main.js?v={{Msg "seo" "version"}}"></script>
 <script src="/js/common.js?v={{Msg "seo" "version"}}"></script>
 <script src="{{Msg "seo" "cdn"}}/js/bootstrap.min.js"></script>
 <link href='{{Msg "seo" "cdn"}}/common-module/collection/css/index.css?v={{Msg "seo" "version"}}' rel="stylesheet"/>