Browse Source

fenzhihebing

luwenna 3 years ago
parent
commit
2617dfe26a

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

@@ -1019,8 +1019,13 @@ func (f *Front) TSGuide() error {
 					if vs == nil {
 						continue
 					}
+					//多个词合并成一个
+					key := ""
+					for _, vkeys := range vs {
+						key += vkeys
+					}
 					keyMaps = append(keyMaps, map[string]interface{}{
-						"key":    vs,
+						"key":    []string{key},
 						"notkey": []string{},
 						"from":   1, //用于记录是否可以选择全国
 					})
@@ -1036,6 +1041,7 @@ func (f *Front) TSGuide() error {
 					"o_jy.a_key":        keyMaps,
 					"o_jy.l_modifydate": time.Now().Unix(),
 					"i_ts_guide":        2,
+					"o_jy.i_newfree":    1,
 				}
 				result["flag"] = mongodb.UpdateById("user", userid, bson.M{"$set": saveData})
 			}

+ 2 - 3
src/jfw/front/pchelper.go

@@ -125,9 +125,8 @@ func (l *PcHelper) Login() error {
 							"l_registedate": time.Now().Unix(),
 							"i_ts_guide":    2,
 							"o_jy": map[string]interface{}{
-								"i_apppush":  1,
-								"i_ratemode": 2,
-								// "i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
+								"i_apppush":    1,
+								"i_ratemode":   2,
 								"l_modifydate": time.Now().Unix(),
 							},
 							"s_regsource": "pchelper",

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

@@ -317,8 +317,13 @@ func (f *Front) TSGuide() error {
 					if vs == nil {
 						continue
 					}
+					//多个词合并成一个
+					key := ""
+					for _, vkeys := range vs {
+						key += vkeys
+					}
 					keyMaps = append(keyMaps, map[string]interface{}{
-						"key":      vs,
+						"key":      []string{key},
 						"infotype": []string{},
 						"notkey":   []string{},
 						"from":     1, //用于记录是否可以选择全国
@@ -335,6 +340,7 @@ func (f *Front) TSGuide() error {
 					"o_jy.a_key":        keyMaps,
 					"o_jy.l_modifydate": time.Now().Unix(),
 					"i_ts_guide":        2,
+					"o_jy.i_newfree":    1,
 				}
 				result["flag"] = mongodb.UpdateById("user", userid, bson.M{"$set": saveData})
 			}

+ 6 - 9
src/jfw/modules/app/src/app/front/login.go

@@ -193,9 +193,8 @@ func (l *Login) Login() error {
 						"s_appponetype": phoneType,
 						"i_ts_guide":    2,
 						"o_jy": map[string]interface{}{
-							"i_apppush":  1,
-							"i_ratemode": 2,
-							// "i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
+							"i_apppush":    1,
+							"i_ratemode":   2,
 							"l_modifydate": time.Now().Unix(),
 						},
 						"s_platform": "app",
@@ -447,9 +446,8 @@ func (l *Login) Register() error {
 					data["l_registedate"] = time.Now().Unix()
 					data["i_ts_guide"] = 2
 					data["o_jy"] = map[string]interface{}{
-						"i_apppush":  1,
-						"i_ratemode": 2,
-						// "i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
+						"i_apppush":    1,
+						"i_ratemode":   2,
 						"l_modifydate": time.Now().Unix(),
 					}
 					data["s_regsource"] = isAndroidOrIOS(l.Header("User-Agent"))
@@ -595,9 +593,8 @@ func (l *Login) WxLogin() {
 				"s_city":         u.City,
 				"s_headimageurl": u.HeadImageUrl,
 				"o_jy": map[string]interface{}{
-					"i_apppush":  1,
-					"i_ratemode": 2,
-					// "i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
+					"i_apppush":    1,
+					"i_ratemode":   2,
 					"l_modifydate": time.Now().Unix(),
 				},
 				"s_platform": "app", //用户注册平台 app 微信 pc

+ 66 - 39
src/jfw/modules/app/src/web/staticres/jyapp/js/searchindex.js

@@ -50,13 +50,15 @@ function hiddenTips2() {
 function updateJump2() {
     $('#tipsType').hide()
     // location.replace('/jyapp/vipsubscribe/toSubVipSetPage?vSwitch=v')
-    $.ajax({
-        url: '/publicapply/free/oneProvinceSet',
-        type: 'POST',
-        success: function (res) {
-            location.href = '/jyapp/vipsubscribe/toSubVipSetPage'
-        }
-    })
+    location.href = '/jyapp/areaPack/page/set_area'
+    // $.ajax({
+    //     url: '/publicapply/free/oneProvinceSet',
+    //     type: 'POST',
+    //     success: function (res) {
+    //         sessionStorage.setItem('needPlayClick', 'true')
+    //         location.href = '/jyapp/areaPack/page/set_area'
+    //     }
+    // })
 }
 var vOneKeySubComponent  = new Vue({
   delimiters: ['${', '}'],
@@ -370,7 +372,7 @@ var SuperSearch = {
         if (isReload) {
             this.resetPage(isFocus);
             if (sessionStorage && history && isPushHistory) {
-                history.pushState({}, "supersearch", "/jyapp/jylab/mainSearch#");
+                history.pushState({type: 'supersearch'}, "supersearch", "/jyapp/jylab/mainSearch#");
             }
         }
         if (this.initFlag) {
@@ -554,6 +556,7 @@ var SuperSearch = {
             $.ajax({
                 url: '/publicapply/free/subscribe',
                 type: 'post',
+                async: false,
                 success: function (res) {
                     if (res.error_code === 0 && res.data) {
                         try {
@@ -566,6 +569,36 @@ var SuperSearch = {
                 },
             })
 
+          function ajaxAddSubKey () {
+            $.ajax({
+              type: "post",
+              url: "/jyapp/member/swordfish/ajaxReq",
+              data: {keys: SuperSearch.s_words, reqType: "subscribe"},
+              dataType: "json",
+              async: false,
+              success: function (r) {
+                if (r.flag == "y") {
+                  rFlag = true;
+                } else if (r.flag == "o") {
+                  EasyAlert.show("您已经超过订阅<br>关键字上限");
+                }
+              },
+              error: function () {
+                rFlag = true;
+              }
+            });
+            if (rFlag) {
+              SuperSearch.setSessionStorage();
+              var goHref = "/jyapp/vipsubscribe/toSetKeyWordPage";
+              if (!isSelectArea) {
+                goHref = "/jyapp/vipsubscribe/toSubVipSetPage";
+              }
+              setTimeout(function () {
+                window.location.href = goHref
+              }, 100);
+            }
+          }
+
             // S-直接订阅
             $("#supersearchPage #zjdy").on("tap", function (even) {
                 if (userId == "" || userId == null) {
@@ -608,43 +641,37 @@ var SuperSearch = {
                     if (nowKeyLength >= 10) {
                         return EasyAlert.show("您已经超过订阅<br>关键字上限");
                     } else {
+                      // 新用户,且没有地区,不提示,去选择地区
+                      // 新用户,有地区,去添加并到关键词页面
+                      // 老用户,没有地区,提示,去选择地区
                         if (isSelectArea) {
-                            // 执行下方原有逻辑
-                        } else if (isOldUser) {
+                            // 执行下方原有逻辑到关键词页面
+                        } else  {
+                            if (!isOldUser) {
+                              return updateJump2()
+                            }
                             return $('#tipsType').show()
                         }
                     }
 
-                    $.ajax({
-                        type: "post",
-                        url: "/jyapp/member/swordfish/ajaxReq",
-                        data: {keys: SuperSearch.s_words, reqType: "subscribe"},
-                        dataType: "json",
-                        async: false,
-                        success: function (r) {
-                            if (r.flag == "y") {
-                                rFlag = true;
-                            } else if (r.flag == "o") {
-                                EasyAlert.show("您已经超过订阅<br>关键字上限");
-                            }
-                        },
-                        error: function () {
-                            rFlag = true;
-                        }
-                    });
-                    if (rFlag) {
-                        SuperSearch.setSessionStorage();
-                        var goHref = "/jyapp/vipsubscribe/toSetKeyWordPage";
-                        if (!isSelectArea) {
-                            goHref = "/jyapp/vipsubscribe/toSubVipSetPage";
-                        }
-                        setTimeout(function () {
-                            window.location.href = goHref
-                        }, 100);
-                    }
+                  ajaxAddSubKey()
                 }
             });
             // E-直接订阅
+            if (sessionStorage.getItem('needPlayClick') === 'true') {
+              sessionStorage.setItem('needPlayClick', 'fix')
+              setTimeout(function () {
+                ajaxAddSubKey()
+              }, 700)
+            }
+
+            if (sessionStorage.getItem('needPlayClick') === 'fix' && SuperSearch.isMyPage) {
+              if (!(history.state && history.state.type == 'supersearch')) {
+                console.log('fix hash')
+                sessionStorage.setItem('needPlayClick', 'hash')
+                history.pushState({type: 'supersearch'}, "supersearch", "/jyapp/jylab/mainSearch#");
+              }
+            }
         }
 
         getKeyUserInfo()
@@ -3226,7 +3253,7 @@ var EntSearch = {
         if (isReload) {
             this.resetPage(isFocus);
             if (sessionStorage && history && isPushHistory) {
-                history.pushState({}, "entsesearch", "/jyapp/jylab/mainSearch#");
+                history.pushState({type: 'entsesearch'}, "entsesearch", "/jyapp/jylab/mainSearch#");
             }
         }
         if (this.initFlag) {
@@ -4357,4 +4384,4 @@ window.onload = function(){
 	if(ActiveTipFlag){
 		ActiveTip = new Active_Tip();
 	}
-}
+}

+ 9 - 8
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/keyset-list.js

@@ -410,15 +410,16 @@ var keySet = new Vue({
     },
     updateJump: function () {
       this.tipsType = false
+      location.replace('/jyapp/areaPack/page/set_area')
       // location.replace('/jyapp/vipsubscribe/toSubVipSetPage?vSwitch=v')
-      sessionStorage.setItem('userIsNew', true)
-      $.ajax({
-        url: '/publicapply/free/oneProvinceSet',
-        type: 'POST',
-        success: function (res) {
-          location.replace('/jyapp/vipsubscribe/toSubVipSetPage')
-        }})
-      // 
+      // sessionStorage.setItem('userIsNew', true)
+      // $.ajax({
+      //   url: '/publicapply/free/oneProvinceSet',
+      //   type: 'POST',
+      //   success: function (res) {
+      //     location.replace('/jyapp/areaPack/page/set_area')
+      //   }})
+      //
     },
   }
 })

+ 22 - 12
src/jfw/modules/app/src/web/staticres/jyapp/wxtsguide/main.js

@@ -1,5 +1,5 @@
 //关键词不合规范提示
-var hintcon=["您订阅的关键词较多,<br>可能会收不到推送信息。<br>点击 “?” 图标查看订阅技巧帮助页面。","您订阅的关键词字数过多,<br>可能会收不到推送信息。<br>点击 “?”图标查看订阅技巧帮助页面。","您订阅的关键词包含特殊符号,<br>可能会收不到推送信息。<br>点击 “?”图标查看订阅技巧帮助页面。"] 
+var hintcon=["您订阅的关键词较多,<br>可能会收不到推送信息。<br>点击 “?” 图标查看订阅技巧帮助页面。","您订阅的关键词字数过多,<br>可能会收不到推送信息。<br>点击 “?”图标查看订阅技巧帮助页面。","您订阅的关键词包含特殊符号,<br>可能会收不到推送信息。<br>点击 “?”图标查看订阅技巧帮助页面。"]
 var isiOS = !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
 var Guide = {
 	industryRecomFlag: false,
@@ -21,6 +21,7 @@ var Guide = {
 	},
 	//所选的行业
 	selectIndustrys: [],
+	isSaveArea:false,
 	initStep_1: function(){
 		var industryUlWidth = $(window).width() - 30;
 		var liWidth = 80;
@@ -59,7 +60,7 @@ var Guide = {
 	skip: function(index){
 		$.post("/jyapp/tenderSubscribe/guide",{reqType: "over",index:index},function(r){
 		    var guideKey = localStorage.tsGuide_keywords
-		      if(localStorage){
+		    if(localStorage){
 		        localStorage.tsGuide_status = "1";
 		        localStorage.removeItem("tsGuide_selectIndustrys");
 		        localStorage.removeItem("tsGuide_keywords");
@@ -70,12 +71,18 @@ var Guide = {
 //			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 (Guide.isSaveArea){
+				window.location.replace('/jyapp/vipsubscribe/toSubVipSetPage')
+		    }else{
+		      	// 跳过向导-跳转选择地区
+		      	window.location.replace('/jyapp/areaPack/page/set_area')
+			}
+			// 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 {
@@ -246,6 +253,9 @@ var Guide = {
 			dataType: "json",
 			traditional: true,
 			success: function(r){
+				if (r.flag){
+					Guide.isSaveArea= true;
+				}
 				if(text && text.match(/[^0-9a-zA-Z\u4E00-\u9FFF\s]/g)){
 					//EasyAlert.show(hintcon[2],"",2000);
 					//text=text.replace(/[^0-9a-zA-Z\u4E00-\u9FFF\s]/g,"")
@@ -253,7 +263,7 @@ var Guide = {
 				}
 			},
 			error: function(){
-				
+
 			}
 		});
 	},
@@ -519,7 +529,7 @@ var RecomKWs = function() {
 			//		});
 			//	}
 			//}
-			
+
 			var datalength = 0;
 			for(var i in industry_keyword){
 				if(datalength< industry_keyword[i].length){
@@ -835,7 +845,7 @@ $(function(){
 	}
 	$("body").removeClass("hide");
 	//帮助按钮
-	$(".jy_help").click(function(){	
+	$(".jy_help").click(function(){
 		JyObj.openExternalLink("https://mp.weixin.qq.com/mp/homepage?__biz=Mzk0MjIyMzY2Nw==&hid=1&sn=6b5d4f4aced2f4c9263e6e66639a40e6","使用帮助");
 	});
 	if(!isiOS){
@@ -903,4 +913,4 @@ $(function(){
 	}).on('compositionend', function(){
 	    $(this).prop('comStart', false);
 	});
-});
+});

+ 51 - 3
src/jfw/modules/app/src/web/templates/areaPack/page_set_area.html

@@ -152,7 +152,10 @@
                     basenum: 1,
                     provincenum: 0, // 购买的省份数量
                 },
-                popupTip: false
+                popupTip: false,
+                noAreaFreeType: false, // 免费用户未设置地区时显示弹窗
+                backTipShowCount: 0, // 离开页面展示弹窗次数
+                successBack: false
             },
             computed: {
                 moreThanSubCount: function () {
@@ -218,10 +221,50 @@
                         this.setAreaAllNotSelected()
                     } else {
                         this.getUserSubscribe()
-                    } 
+                    }
                 }
             },
             methods: {
+              showBackTip: function () {
+                if (this.successBack) {
+                  history.back()
+                  return
+                }
+                var _this = this
+                this.$dialog.confirm({
+                  title: '提示信息',
+                  width: 303,
+                  className: 'unbind-dialog',
+                  message: '您的区域尚未选择,确定退出吗?',
+                  confirmButtonText: '确认',
+                  confirmButtonColor: '#2ABED1'
+                }).then(function () {
+                  sessionStorage.removeItem('needPlayClick')
+                  history.back()
+                }).catch(function () {
+                  _this.addPopState(true)
+                })
+              },
+              addPopState: function (type) {
+                var pushContent = {
+                  info: '订阅省份返回',
+                  url: '#tipover'
+                }
+                if (type) {
+                  history.pushState(pushContent, null, pushContent.url);
+                }
+              },
+              // 页面跳转返回提示
+              addBackTip: function () {
+                var _this = this
+                this.addPopState(!history.state && this.backTipShowCount < 1)
+                $(window).on('popstate', function () {
+                  setTimeout(function () {
+                    _this.showBackTip()
+                  }, 100)
+                  _this.backTipShowCount++
+                })
+              },
                 initPageInfo: function () {
                     var area = this.selectedArea
                     this.setComponentState(area)
@@ -249,6 +292,7 @@
                                 if (res.data) {
                                     if (res.data.area === null || res.data.area === undefined) {
                                         _this.setAreaAllNotSelected()
+                                        _this.addBackTip()
                                     } else {
                                         if (res.data.area) {
                                             // 赋值默认已选
@@ -279,7 +323,11 @@
                         },
                         success: function (res) {
                             if (res && res.success) {
-                                history.back()           
+                                sessionStorage.setItem('needPlayClick', 'true')
+                                if (history.state) {
+                                  _this.successBack = true
+                                }
+                                history.back()
                             } else {
                                 if (res.errMsg) {
                                     _this.$toast(res.errMsg)

+ 13 - 12
src/jfw/modules/app/src/web/templates/weixin/historypush.html

@@ -642,7 +642,7 @@
                 url: '/publicapply/free/areapack/update',
                 type: 'POST',
                 success: function (res) {
-                    
+
                 }
             })
         }
@@ -833,7 +833,7 @@
                     tokeyset()
                 }
             }
-            
+
         });
         $(".tab_left .area").hide();
         if (r.isPassCount) {
@@ -869,7 +869,7 @@
                     tosetpage()
                 }
             }
-            
+
         });
         if(productType == 0) {
             $(".vip_report").show();
@@ -1142,7 +1142,7 @@
                     if (listString) {
                         $('.header_header').show()
                     }
-                } 
+                }
                 $(".app-content").css("justify-content","flex-start");
                 $(".switch").addClass("only-personal");
                 $(".switch .user_pro").text("立即使用 超级订阅");
@@ -1666,14 +1666,15 @@ function hasNoData() {
     }
     function updateJump2() {
         $('#tipsType').hide()
+        location.href = '/jyapp/areaPack/page/set_area'
         // location.replace('/jyapp/vipsubscribe/toSubVipSetPage?vSwitch=v')
-        $.ajax({
-            url: '/publicapply/free/oneProvinceSet',
-            type: 'POST',
-            success: function (res) {
-                location.href = '/jyapp/vipsubscribe/toSubVipSetPage'
-            }
-        })
+        // $.ajax({
+        //     url: '/publicapply/free/oneProvinceSet',
+        //     type: 'POST',
+        //     success: function (res) {
+        //         location.href = '/jyapp/areaPack/page/set_area'
+        //     }
+        // })
     }
   //
   function appendList(content) {
@@ -1756,7 +1757,7 @@ function hasNoData() {
   function ajaxFun(time, area, city, subscopeclass, buyerclass, key, subtype) {
     if(historyVt == 's') {
       $(".set_keyword").hide();
-    } 
+    }
       if (!ajaxFlag) {
           return
       }

+ 4 - 0
src/jfw/modules/app/src/web/templates/weixin/search/mainSearch.html

@@ -1400,6 +1400,10 @@
           return;
         }
         //登录返回之后,更新历史记录,获取userId
+      if (sessionStorage.getItem('needPlayClick') === 'hash') {
+        sessionStorage.removeItem('needPlayClick')
+        return;
+      }
         if(sessionStorage.searchpageName == "superSearch"){
             SuperSearch.init(false,false,true);
         }else if(sessionStorage.searchpageName == "superSearch_back"){

+ 2 - 1
src/jfw/modules/bigmember/src/service/use/use.go

@@ -608,6 +608,7 @@ func (u *Use) IsAdd() {
 			a_key, _ := o_jy["a_key"].([]interface{})
 			hasKey = len(a_key) > 0
 		}
+		d["freeHasKey"] = hasKey
 		//获取用户权限详情
 		power := []int{} //GetNewPower(userid)
 		bigPower := jy.GetBigVipUserBaseMsg(userid, db.Mysql, db.Mgo)
@@ -637,7 +638,7 @@ func (u *Use) IsAdd() {
 		filePackNum := redis.GetInt(jy.PowerCacheDb, filePackKey)
 		d["fileNum"] = config.Config.FileUploadNum[uk] - redis.GetInt(jy.PowerCacheDb, fmt.Sprintf(jy.VipFileUploadNumKey, userid, fmt.Sprint(time.Now().Month()))) + filePackNum
 		//新用户->新订阅设置页面
-		if config.Config.NewFreeUser < bigPower.Registedate || !hasKey {
+		if config.Config.NewFreeUser < bigPower.Registedate {
 			d["isUpgrade"] = true
 		}
 		uid := userid

+ 2 - 2
src/jfw/modules/publicapply/src/subscribe/entity/entity.go

@@ -37,7 +37,7 @@ func NewParamInfo(userId string) *ParamInfo {
 	return &ParamInfo{userId}
 }
 
-//
+//dev4.6.3.21 暂不调用
 func (this *ParamInfo) SetAreaByOneProvince() (b bool) {
 	b = true
 	mData, ok := db.Mgo.FindById("user", this.UserId, `{"o_jy":1}`)
@@ -57,7 +57,7 @@ func (this *ParamInfo) SetAreaByOneProvince() (b bool) {
 			areas = append(areas, qutil.ObjArrToStringArr(area)...)
 		}
 		setMap := map[string]interface{}{
-			"o_jy.i_newfree": 1, //老免费用户=>新订阅设置页面 20211122
+			// "o_jy.i_newfree": 1, //老免费用户=>新订阅设置页面 20211122
 		}
 		if len(areas) == 1 {
 			//设置地区

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

@@ -101,7 +101,7 @@ func directSubKWSFree(updateItems string, keys string, userId string) map[string
 					},
 				},
 				updateItems + ".l_modifydate": time.Now().Unix(),
-				updateItems + ".i_newfree":    1, //老免费用户=>新订阅设置页面 20211122
+				// updateItems + ".i_newfree":    1, //老免费用户=>新订阅设置页面 20211122
 			},
 			}); ok {
 				flag = "y"
@@ -131,7 +131,7 @@ func directSubKWSFree(updateItems string, keys string, userId string) map[string
 					"$set": bson.M{
 						updateItems + ".l_modifydate": time.Now().Unix(),
 						updateItems + ".s_item":       classify_name,
-						updateItems + ".i_newfree":    1, //老免费用户=>新订阅设置页面 20211122
+						// updateItems + ".i_newfree":    1, //老免费用户=>新订阅设置页面 20211122
 					},
 				})
 				if ok {
@@ -192,8 +192,8 @@ func AddKeyWordsFree(types, userId, classIndex, className, keywordsIndex, keywor
 		if !errs {
 			db.Mgo.UpdateById("user", userId, map[string]interface{}{
 				"$set": map[string]interface{}{
-					types + ".a_key":     []map[string]interface{}{},
-					types + ".i_newfree": 1, //老免费用户=>新订阅设置页面 20211122
+					types + ".a_key": []map[string]interface{}{},
+					// types + ".i_newfree": 1, //老免费用户=>新订阅设置页面 20211122
 				},
 			})
 		}
@@ -231,7 +231,7 @@ func AddKeyWordsFree(types, userId, classIndex, className, keywordsIndex, keywor
 		} else {
 			//修改关键词
 			saveData[types+".s_item"] = className
-			saveData[types+".i_newfree"] = 1 //老免费用户=>新订阅设置页面 20211122
+			// saveData[types+".i_newfree"] = 1 //老免费用户=>新订阅设置页面 20211122
 			saveData[types+".a_key."+keywordsIndex+".key"] = newKws
 			saveData[types+".a_key."+keywordsIndex+".appendkey"] = append(appendKeyword, _kws[1:]...)
 			saveData[types+".a_key."+keywordsIndex+".notkey"] = notKeyword
@@ -518,7 +518,7 @@ func (this *UpdateOther) UpdateOther() map[string]interface{} {
 	}()
 	flag := true
 	if types == "o_jy" {
-		setMap["o_jy.i_newfree"] = 1 //老免费用户=>新订阅设置页面 20211122
+		// setMap["o_jy.i_newfree"] = 1 //老免费用户=>新订阅设置页面 20211122
 	}
 	if setMap != nil {
 		if db.Mgo.UpdateById("user", this.UserId, map[string]interface{}{

+ 2 - 2
src/jfw/modules/publicapply/src/subscribePush/entity/setting.go

@@ -66,11 +66,11 @@ func freeSet(area map[string]interface{}, industry []string, userId string) *Fun
 			return &FuncResult{false, errors.New(fmt.Sprintf("订阅地区调整次数(%d)已用完", areacount+jy.BaseAreaNum)), nil}
 		}
 	}
+	//清楚缓存
+	jy.ClearBigVipUserPower(userId)
 	if !FreeSubChange(userId, &area, industry, ppb, isfirst) {
 		return &FuncResult{false, errors.New("保存修改出错"), nil}
 	} else if issetredis { //更新调整次数 非全国(第一次 不消耗次数)
-		//清楚缓存
-		jy.ClearBigVipUserPower(userId)
 		//优先使用省份订阅包次数
 		// log.Println(areacount, "---", ppnum)
 		// log.Println(jy.BaseAreaNum, "---", fpnum)

+ 10 - 1
src/jfw/modules/weixin/src/wx/subscribe.go

@@ -168,8 +168,17 @@ func (rs *ReplyStruct) freeFastSubscribe() {
 		}
 	}
 	if rs.Pcresult == "ok" {
+		key := ""
+		//多个关键词合并成一个
+		if keyarr := strings.Split(rs.Subkey, "++"); len(keyarr) > 0 {
+			for _, v := range keyarr {
+				key += v
+			}
+		} else {
+			key = rs.Subkey
+		}
 		o_jys = append(o_jys, KeysWords{
-			Key:    strings.Split(rs.Subkey, "++"),
+			Key:    []string{key},
 			Notkey: []string{},
 		})
 		if tools.MQFW.Update("user", &map[string]interface{}{

+ 62 - 36
src/web/staticres/js/wxSupersearch.js

@@ -50,14 +50,17 @@ function hiddenTips2() {
 }
 function updateJump2() {
   $('#tipsType').hide()
+  SuperSearch.setSessionStorage();
   // location.replace('/jyapp/vipsubscribe/toSubVipSetPage?vSwitch=v')
-  $.ajax({
-    url: '/publicapply/free/oneProvinceSet',
-    type: 'POST',
-    success: function (res) {
-      location.href = '/front/vipsubscribe/toSubVipSetPage'
-    }
-  })
+  location.href = '/areaPack/wx/page/set_area'
+  // $.ajax({
+  //   url: '/publicapply/free/oneProvinceSet',
+  //   type: 'POST',
+  //   success: function (res) {
+  //     sessionStorage.setItem('needPlayClick', 'true')
+  //     location.href = '/areaPack/wx/page/set_area'
+  //   }
+  // })
 
 }
 var nowClientHeight = document.documentElement.clientHeight || document.body.clientHeight
@@ -341,7 +344,7 @@ var SuperSearch = {
     if(isReload){
       this.resetPage(isFocus);
       if(sessionStorage && history && isPushHistory){
-        history.pushState({},"","");
+        history.pushState({type: 'supersearch'}, "supersearch", "");
       }
       this.searchKeyword();
     }
@@ -514,6 +517,7 @@ var SuperSearch = {
       $.ajax({
         url: '/publicapply/free/subscribe',
         type: 'post',
+        async: false,
         success: function (res) {
           if (res.error_code === 0 && res.data) {
             try {
@@ -525,10 +529,35 @@ var SuperSearch = {
           }
         },
       })
-
+      var rFlag = false;
+      function ajaxAddSubKey () {
+        $.ajax({
+          type: "post",
+          url: "/member/swordfish/ajaxReq",
+          data: {keys:SuperSearch.s_words,reqType: "subscribe"},
+          dataType: "json",
+          async: false,
+          success: function(r){
+            if(r.flag=="y"){
+              rFlag = true;
+            }else if(r.flag=="o"){
+              EasyAlert.show("您已经超过订阅<br>关键字上限");
+            }
+          },error: function(){
+            rFlag = true;
+          }
+        });
+        if(rFlag){
+          SuperSearch.setSessionStorage();
+          var goHref = "/front/vipsubscribe/toSetKeyWordPage";
+          if (!isSelectArea) {
+            goHref = "/front/vipsubscribe/toSubVipSetPage";
+          }
+          window.location.href = goHref
+        }
+      }
       // S-直接订阅
     $("#supersearchPage #zjdy").on("tap",function(){
-      var rFlag = false;
       if (SuperSearch.s_words==""){
         SuperSearch.s_words=$.trim($("#supersearchPage [name='super_searchinput']").val());
         SuperSearch.s_words=SuperSearch.s_words.replace(/\s+/g," ");
@@ -567,39 +596,36 @@ var SuperSearch = {
           if (nowKeyLength >= 10) {
             return EasyAlert.show("您已经超过订阅<br>关键字上限");
           } else {
+            // 新用户,且没有地区,不提示,去选择地区
+            // 新用户,有地区,去添加并到关键词页面
+            // 老用户,没有地区,提示,去选择地区
             if (isSelectArea) {
-              // 执行下方原有逻辑
-            } else if (isOldUser) {
+              // 执行下方原有逻辑到关键词页面
+            } else  {
+              if (!isOldUser) {
+                return updateJump2()
+              }
               return $('#tipsType').show()
             }
           }
-        $.ajax({
-          type: "post",
-          url: "/member/swordfish/ajaxReq",
-          data: {keys:SuperSearch.s_words,reqType: "subscribe"},
-          dataType: "json",
-          async: false,
-          success: function(r){
-            if(r.flag=="y"){
-              rFlag = true;
-            }else if(r.flag=="o"){
-              EasyAlert.show("您已经超过订阅<br>关键字上限");
-            }
-          },error: function(){
-            rFlag = true;
-          }
-        });
-        if(rFlag){
-            SuperSearch.setSessionStorage();
-            var goHref = "/front/vipsubscribe/toSetKeyWordPage";
-            if (!isSelectArea) {
-              goHref = "/front/vipsubscribe/toSubVipSetPage";
-            }
-            window.location.href = goHref
-        }
+          ajaxAddSubKey()
       }
     });
       // E-直接订阅
+      if (sessionStorage.getItem('needPlayClick') === 'true') {
+        sessionStorage.setItem('needPlayClick', 'fix')
+        SuperSearch.setSessionStorage();
+        setTimeout(function () {
+          ajaxAddSubKey()
+        }, 700)
+      }
+      if (sessionStorage.getItem('needPlayClick') === 'fix' && SuperSearch.isMyPage) {
+        if (!(history.state && history.state.type == 'supersearch')) {
+          console.log('fix hash')
+          sessionStorage.setItem('needPlayClick', 'hash')
+          history.pushState({type: 'supersearch'}, "supersearch", "");
+        }
+      }
     }
 
     getKeyUserInfo()

+ 10 - 9
src/web/staticres/vipsubscribe/js/keyset-list.js

@@ -400,15 +400,16 @@ var keySet = new Vue({
     },
     updateJump: function () {
       this.tipsType = false
-      sessionStorage.setItem('userIsNew', true)
-      $.ajax({
-        url: '/publicapply/free/oneProvinceSet',
-        type: 'POST',
-        success: function (res) {
-        // location.replace('/jyapp/vipsubscribe/toSubVipSetPage?vSwitch=v')
-          location.replace('/front/vipsubscribe/toSubVipSetPage')
-        }
-      })
+      // sessionStorage.setItem('userIsNew', true)
+      location.replace('/areaPack/wx/page/set_area')
+      // $.ajax({
+      //   url: '/publicapply/free/oneProvinceSet',
+      //   type: 'POST',
+      //   success: function (res) {
+      //   // location.replace('/jyapp/vipsubscribe/toSubVipSetPage?vSwitch=v')
+      //     location.replace('/areaPack/wx/page/set_area')
+      //   }
+      // })
     },
     // 清除订阅页面缓存
     clearHistoryPushDataCache: function () {

+ 21 - 11
src/web/staticres/wxtsguide/main.js

@@ -1,5 +1,5 @@
 //关键词不合规范提示
-var hintcon=["您订阅的关键词较多,<br>可能会收不到推送信息。<br>点击 “?” 图标查看订阅技巧帮助页面。","您订阅的关键词字数过多,<br>可能会收不到推送信息。<br>点击 “?”图标查看订阅技巧帮助页面。","您订阅的关键词包含特殊符号,<br>可能会收不到推送信息。<br>点击 “?”图标查看订阅技巧帮助页面。"] 
+var hintcon=["您订阅的关键词较多,<br>可能会收不到推送信息。<br>点击 “?” 图标查看订阅技巧帮助页面。","您订阅的关键词字数过多,<br>可能会收不到推送信息。<br>点击 “?”图标查看订阅技巧帮助页面。","您订阅的关键词包含特殊符号,<br>可能会收不到推送信息。<br>点击 “?”图标查看订阅技巧帮助页面。"]
 var isiOS = !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
 var Guide = {
 	industryRecomFlag: false,
@@ -21,6 +21,7 @@ var Guide = {
 	},
 	//所选的行业
 	selectIndustrys: [],
+	isSaveArea:false,
 	initStep_1: function(){
 		var industryUlWidth = $(window).width() - 30;
 		var liWidth = 80;
@@ -66,12 +67,18 @@ var Guide = {
 	        	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 (Guide.isSaveArea){
+				window.location.replace('/front/vipsubscribe/toSubVipSetPage')
+		    }else{
+		      	// 跳过向导-跳转选择地区
+	          	window.location.replace('/areaPack/wx/page/set_area')
+			}
+	      	// 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 {
@@ -242,6 +249,9 @@ var Guide = {
 			dataType: "json",
 			traditional: true,
 			success: function(r){
+				if (r.flag){
+					Guide.isSaveArea= true;
+				}
 				if(text && text.match(/[^0-9a-zA-Z\u4E00-\u9FFF\s]/g)){
 					//EasyAlert.show(hintcon[2],"",2000);
 					//text=text.replace(/[^0-9a-zA-Z\u4E00-\u9FFF\s]/g,"")
@@ -249,7 +259,7 @@ var Guide = {
 				}
 			},
 			error: function(){
-				
+
 			}
 		});
 	},
@@ -512,7 +522,7 @@ var RecomKWs = function() {
 			//		});
 			//	}
 			//}
-			
+
 			var datalength = 0;
 			for(var i in industry_keyword){
 				if(datalength< industry_keyword[i].length){
@@ -818,7 +828,7 @@ $(function(){
 	}
 	if(localStorage && localStorage.tsGuide_status == "1"){
 		isBodyShow = false;
-		window.history.go(-1);
+//		window.history.go(-1);
 		$("body").addClass("hide");
 		localStorage.tsGuide_status = "0";
 		window.history.go(-1);
@@ -904,4 +914,4 @@ $(function(){
 	}).on('compositionend', function(){
 	    $(this).prop('comStart', false);
 	});
-});
+});

+ 51 - 3
src/web/templates/areaPack/wx/page_set_area.html

@@ -152,7 +152,10 @@
                     basenum: 1,
                     provincenum: 0, // 购买的省份数量
                 },
-                popupTip: false
+                popupTip: false,
+                noAreaFreeType: false, // 免费用户未设置地区时显示弹窗
+                backTipShowCount: 0, // 离开页面展示弹窗次数
+                successBack: false
             },
             computed: {
                 moreThanSubCount: function () {
@@ -218,10 +221,50 @@
                         this.setAreaAllNotSelected()
                     } else {
                         this.getUserSubscribe()
-                    } 
+                    }
                 }
             },
             methods: {
+              showBackTip: function () {
+                if (this.successBack) {
+                  history.back()
+                  return
+                }
+                var _this = this
+                this.$dialog.confirm({
+                  title: '提示信息',
+                  width: 303,
+                  className: 'unbind-dialog',
+                  message: '您的区域尚未选择,确定退出吗?',
+                  confirmButtonText: '确认',
+                  confirmButtonColor: '#2ABED1'
+                }).then(function () {
+                  sessionStorage.removeItem('needPlayClick')
+                  history.back()
+                }).catch(function () {
+                  _this.addPopState(true)
+                })
+              },
+              addPopState: function (type) {
+                var pushContent = {
+                  info: '订阅省份返回',
+                  url: '#tipover'
+                }
+                if (type) {
+                  history.pushState(pushContent, null, pushContent.url);
+                }
+              },
+              // 页面跳转返回提示
+              addBackTip: function () {
+                var _this = this
+                this.addPopState(!history.state && this.backTipShowCount < 1)
+                $(window).on('popstate', function () {
+                  setTimeout(function () {
+                    _this.showBackTip()
+                  }, 100)
+                  _this.backTipShowCount++
+                })
+              },
                 initPageInfo: function () {
                     var area = this.selectedArea
                     this.setComponentState(area)
@@ -249,6 +292,7 @@
                                 if (res.data) {
                                     if (res.data.area === null || res.data.area === undefined) {
                                         _this.setAreaAllNotSelected()
+                                        _this.addBackTip()
                                     } else {
                                         if (res.data.area) {
                                             // 赋值默认已选
@@ -279,7 +323,11 @@
                         },
                         success: function (res) {
                             if (res && res.success) {
-                                history.back()           
+                              sessionStorage.setItem('needPlayClick', 'true')
+                              if (history.state) {
+                                  _this.successBack = true
+                                }
+                                history.back()
                             } else {
                                 if (res.errMsg) {
                                     _this.$toast(res.errMsg)

+ 8 - 7
src/web/templates/weixin/historypush.html

@@ -1762,13 +1762,14 @@
         function updateJump2() {
             $('#tipsType').hide()
             // location.replace('/jyapp/vipsubscribe/toSubVipSetPage?vSwitch=v')
-            $.ajax({
-                url: '/publicapply/free/oneProvinceSet',
-                type: 'POST',
-                success: function (res) {
-                    location.href = '/front/vipsubscribe/toSubVipSetPage'
-                }
-            })
+            location.href = '/areaPack/wx/page/set_area'
+            // $.ajax({
+            //     url: '/publicapply/free/oneProvinceSet',
+            //     type: 'POST',
+            //     success: function (res) {
+            //         location.href = '/areaPack/wx/page/set_area'
+            //     }
+            // })
         }
       //
       function appendList(content) {

+ 12 - 1
src/web/templates/weixin/search/mainSearch.html

@@ -1246,7 +1246,18 @@
     	});
 	}
 	function backThisPage(){
-		initFlag = 0;
+    // if (sessionStorage.getItem('needPlayClick') === 'hash') {
+    //   sessionStorage.removeItem('needPlayClick')
+    //   return;
+    // }
+    //
+    // if (sessionStorage.getItem('needPlayClick') === 'true') {
+    //   sessionStorage.removeItem('needPlayClick')
+    //   sessionStorage.searchpageName = "superSearch"
+    // }
+
+
+    initFlag = 0;
 		if(sessionStorage){
 			if(sessionStorage.searchpageName == "superSearch"){
 				initFlag = 1;