Kaynağa Gözat

Merge branch 'dev4.5.5' of http://127.0.0.1:8080/qmx/jy into dev4.5.5

zhangxinlei1996 4 yıl önce
ebeveyn
işleme
262a5c452b

+ 3 - 1
src/jfw/modules/app/src/web/templates/vipsubscribe/messageType.html

@@ -311,7 +311,6 @@
                              reqData.infotype = _infoType == "" ? [] : _infoType.split(",");
                              sessionStorage.setItem('sub_vip_state', JSON.stringify(reqData))
                          }
-                        window.history.go(-1);
                     } else {
                         weui.toast('保存失败', {
                             duration: 2000,
@@ -322,6 +321,9 @@
                         });
                     }
                  })
+                setTimeout(function(){
+                    history.back()
+                }, 300)
             })
             //
             njTipEasyPopup = new EasyPopup("nijianTip");

+ 11 - 4
src/jfw/modules/weixin/src/wx/wx.go

@@ -499,7 +499,9 @@ func saveUser(u *UserInfo, source, pre, RSource, CSource string) (bool, string,
 		}
 		if pre == "11" || pre == "12" || pre == "19" || pre == "17" { //11pc订阅,12pc搜索关键词
 			newUser, pcresult, subkey = pcSetUserKeys(newUser, source, pre)
-			newUser["i_ts_guide"] = 1 //pc订阅关键词,不再走向导页
+			if subkey != "" {
+				newUser["i_ts_guide"] = 1 //pc订阅关键词,不再走向导页
+			}
 		}
 		//看是否有对应关系
 		fromkey := fmt.Sprintf("share_jyb_%s", u.OpenId)
@@ -1148,7 +1150,7 @@ func ScanHandler(w ResponseWriter, r *Request) {
 
 	}
 	//部分未关注用户通过点击菜单创建的用户 openid和unionid为空
-	m, b := tools.MQFW.FindOneByField("user", `{"s_m_openid":"`+openid+`","s_unionid":{"$ne":"`+openid+`"}}`, `{"_id":1,"s_headimage":1,"o_jy":1,"o_vipjy":1,"i_vip_status":1}`)
+	m, b := tools.MQFW.FindOneByField("user", `{"s_m_openid":"`+openid+`","s_unionid":{"$ne":"`+openid+`"}}`, `{"_id":1,"s_headimage":1,"o_jy":1,"o_vipjy":1,"i_vip_status":1,"i_ts_guide":1}`)
 	if b {
 		//剑鱼标讯订阅提醒  (1:关注事件,2:扫码事件,3:发送客服消息处理,4:支付操作)
 		if openid != "" {
@@ -1230,15 +1232,20 @@ func ScanHandler(w ResponseWriter, r *Request) {
 							pcresult = "vipsubscribe##reply"
 						}
 					}
-
 				} else {
 					pcUser, pcresult, subkey = pcSetUserKeys(*m, r.EventKey, pccodepre)
+					i_ts_guide := util.IntAll((*m)["i_ts_guide"])
+					//有关键词 切是在订阅设置页面扫码 订阅向导未关闭(=2) 扫码订阅后 关闭订阅向导(=1)
+					if i_ts_guide == 0 || (i_ts_guide == 2 && subkey != "") {
+						i_ts_guide = 1
+					}
 					go tools.MQFW.Update("user", &map[string]interface{}{
 						"s_m_openid": openid,
 						"s_unionid":  map[string]interface{}{"$ne": openid},
 					}, &map[string]interface{}{
 						"$set": map[string]interface{}{
-							"o_jy": pcUser["o_jy"],
+							"o_jy":       pcUser["o_jy"],
+							"i_ts_guide": i_ts_guide,
 						},
 					}, false, false)
 				}

+ 1 - 5
src/web/staticres/common-module/vipsubscribe/js/vip-subscribe-set-template.js

@@ -333,11 +333,7 @@ var subComponent = {
     getActionDefault: function() {
       let _this = this
       let defaultTitle = ''
-      if(!this.initdata.matchway) {
-        $('.match-way-value').text('按标题匹配')
-        this.active = 1
-      }
-      if(this.initdata.matchway == 1) {
+      if(this.initdata.matchway == 1 || !this.initdata.matchway) {
         $('.match-way-value').text('按标题匹配')
         this.active = 1
       } else if(this.initdata.matchway == 2) {

+ 4 - 2
src/web/templates/weixin/vipsubscribe/messageType.html

@@ -267,10 +267,9 @@
                         reqData.infotype = _infoType == "" ? [] : _infoType.split(",");
                         sessionStorage.setItem('sub_vip_state', JSON.stringify(reqData))
                     }
-                    window.history.go(-1);
                 } else {
                     weui.toast('保存失败', {
-                        duration: 20000,
+                        duration: 2000,
                         className: 'custom-toast',
                         callback: function() {
                         // history.back()
@@ -278,6 +277,9 @@
                     });
                 }
             })
+            setTimeout(function(){
+                history.back()
+            }, 300)
         })
         //
         njTipEasyPopup = new EasyPopup("nijianTip");