Эх сурвалжийг харах

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

zhangxinlei1996 3 жил өмнө
parent
commit
276b8d2180

+ 2 - 9
src/jfw/front/front.go

@@ -1033,7 +1033,7 @@ func (f *Front) TSGuide() error {
 		return f.Render("/weixin/wxtsguide.html")
 		return f.Render("/weixin/wxtsguide.html")
 	} else {
 	} else {
 		reqType := f.GetString("reqType")
 		reqType := f.GetString("reqType")
-		index, _ := f.GetInteger("index")
+		// index, _ := f.GetInteger("index")
 		result := make(bson.M)
 		result := make(bson.M)
 		if reqType == "save" {
 		if reqType == "save" {
 			var keyMaps []map[string]interface{}
 			var keyMaps []map[string]interface{}
@@ -1070,14 +1070,7 @@ func (f *Front) TSGuide() error {
 			}
 			}
 		} else if reqType == "over" {
 		} else if reqType == "over" {
 			saveData := bson.M{
 			saveData := bson.M{
-				"o_jy.o_area":       map[string]interface{}{},
-				"o_jy.l_modifydate": time.Now().Unix(),
-				"i_ts_guide":        1,
-			}
-			if index > 2 {
-				saveData = bson.M{
-					"i_ts_guide": 1,
-				}
+				"i_ts_guide": 1,
 			}
 			}
 			result["flag"] = mongodb.UpdateById("user", userid, bson.M{"$set": saveData})
 			result["flag"] = mongodb.UpdateById("user", userid, bson.M{"$set": saveData})
 		} else if reqType == "preview" {
 		} else if reqType == "preview" {

+ 1 - 0
src/jfw/front/login.go

@@ -115,6 +115,7 @@ func (l *Login) Login() error {
 						"s_company":     s_company,
 						"s_company":     s_company,
 						"o_jy": map[string]interface{}{
 						"o_jy": map[string]interface{}{
 							"i_apppush":    1,
 							"i_apppush":    1,
+							"i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
 							"i_ratemode":   2,
 							"i_ratemode":   2,
 							"l_modifydate": time.Now().Unix(),
 							"l_modifydate": time.Now().Unix(),
 						},
 						},

+ 1 - 0
src/jfw/front/otherAct.go

@@ -135,6 +135,7 @@ func (f *Front) Lpsubmit() error {
 				"i_ts_guide":    2,
 				"i_ts_guide":    2,
 				"o_jy": map[string]interface{}{
 				"o_jy": map[string]interface{}{
 					"i_apppush":    1,
 					"i_apppush":    1,
+					"i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
 					"i_ratemode":   2,
 					"i_ratemode":   2,
 					"l_modifydate": time.Now().Unix(),
 					"l_modifydate": time.Now().Unix(),
 				},
 				},

+ 1 - 0
src/jfw/front/pchelper.go

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

+ 2 - 9
src/jfw/modules/app/src/app/front/front.go

@@ -291,7 +291,7 @@ func (f *Front) TSGuide() error {
 		return f.Render("/weixin/wxtsguide.html")
 		return f.Render("/weixin/wxtsguide.html")
 	} else {
 	} else {
 		reqType := f.GetString("reqType")
 		reqType := f.GetString("reqType")
-		index, _ := f.GetInteger("index")
+		// index, _ := f.GetInteger("index")
 		result := make(bson.M)
 		result := make(bson.M)
 		if reqType == "save" {
 		if reqType == "save" {
 			var keyMaps []map[string]interface{}
 			var keyMaps []map[string]interface{}
@@ -328,14 +328,7 @@ func (f *Front) TSGuide() error {
 			}
 			}
 		} else if reqType == "over" {
 		} else if reqType == "over" {
 			saveData := bson.M{
 			saveData := bson.M{
-				"o_jy.o_area":       map[string]interface{}{},
-				"o_jy.l_modifydate": time.Now().Unix(),
-				"i_ts_guide":        1,
-			}
-			if index > 2 {
-				saveData = bson.M{
-					"i_ts_guide": 1,
-				}
+				"i_ts_guide": 1,
 			}
 			}
 			result["flag"] = mongodb.UpdateById("user", userid, bson.M{"$set": saveData})
 			result["flag"] = mongodb.UpdateById("user", userid, bson.M{"$set": saveData})
 		} else if reqType == "preview" {
 		} else if reqType == "preview" {

+ 3 - 0
src/jfw/modules/app/src/app/front/login.go

@@ -206,6 +206,7 @@ func (l *Login) Login() error {
 						"o_jy": map[string]interface{}{
 						"o_jy": map[string]interface{}{
 							"i_apppush":    1,
 							"i_apppush":    1,
 							"i_ratemode":   2,
 							"i_ratemode":   2,
+							"i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
 							"l_modifydate": time.Now().Unix(),
 							"l_modifydate": time.Now().Unix(),
 						},
 						},
 					}
 					}
@@ -462,6 +463,7 @@ func (l *Login) Register() error {
 					data["o_jy"] = map[string]interface{}{
 					data["o_jy"] = map[string]interface{}{
 						"i_apppush":    1,
 						"i_apppush":    1,
 						"i_ratemode":   2,
 						"i_ratemode":   2,
+						"i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
 						"l_modifydate": time.Now().Unix(),
 						"l_modifydate": time.Now().Unix(),
 					}
 					}
 					data["s_regsource"] = isAndroidOrIOS(l.Header("User-Agent"))
 					data["s_regsource"] = isAndroidOrIOS(l.Header("User-Agent"))
@@ -605,6 +607,7 @@ func (l *Login) WxLogin() {
 				"o_jy": map[string]interface{}{
 				"o_jy": map[string]interface{}{
 					"i_apppush":    1,
 					"i_apppush":    1,
 					"i_ratemode":   2,
 					"i_ratemode":   2,
+					"i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
 					"l_modifydate": time.Now().Unix(),
 					"l_modifydate": time.Now().Unix(),
 				},
 				},
 			}
 			}

+ 10 - 8
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/vip_index_new.js

@@ -33,19 +33,18 @@ var subNode = new Vue({
       }
       }
       this.switchShow()
       this.switchShow()
       this.switehAjax()
       this.switehAjax()
-      this.getUserSubscribe()
     },
     },
-    mounted () { 
+    mounted () {
         // this.userAreaNum = 0
         // this.userAreaNum = 0
         // this.userType = true
         // this.userType = true
         // this.userAreaAllNum = 1
         // this.userAreaAllNum = 1
     },
     },
     methods: {
     methods: {
-        // 省份订阅包续费 
+        // 省份订阅包续费
         renewBtn: function () {
         renewBtn: function () {
             location.href = '/jyapp/areaPack/page/buy?type=renew'
             location.href = '/jyapp/areaPack/page/buy?type=renew'
         },
         },
-        // 省份订阅包升级 
+        // 省份订阅包升级
         updateBtn: function () {
         updateBtn: function () {
             location.href = '/jyapp/areaPack/page/buy?type=upgrade&area=' +  encodeURIComponent(JSON.stringify(this.freeUserArea))
             location.href = '/jyapp/areaPack/page/buy?type=upgrade&area=' +  encodeURIComponent(JSON.stringify(this.freeUserArea))
         },
         },
@@ -144,7 +143,10 @@ var subNode = new Vue({
                     console.log(res)
                     console.log(res)
                     if(res.data) {
                     if(res.data) {
                         _this.vSwitch = res.data.vt || 'f'
                         _this.vSwitch = res.data.vt || 'f'
+                        // f 免费 m 大会员 v 超级订阅
                         if (_this.vSwitch === 'f') {
                         if (_this.vSwitch === 'f') {
+                            // 判断是否购买省份订阅包
+                            _this.getUserSubscribe()
                             $('.update_renew').hide()
                             $('.update_renew').hide()
                         }
                         }
                         if(res.data.vt == 'm') {
                         if(res.data.vt == 'm') {
@@ -334,7 +336,7 @@ $(function () {
               } else if (switchProduct == 'free') {
               } else if (switchProduct == 'free') {
                 subNode.initData = r.data
                 subNode.initData = r.data
               } else {
               } else {
-                res = resObj
+                res = r
               }
               }
           }
           }
           if(!res.data.industry) {
           if(!res.data.industry) {
@@ -640,12 +642,12 @@ $(function () {
       checkmerge(state.industry, state.isread)
       checkmerge(state.industry, state.isread)
       // init 已选择的区域和行业
       // init 已选择的区域和行业
       // var selectedAreaAndInd = getBuySet(state.area, state.industry);
       // var selectedAreaAndInd = getBuySet(state.area, state.industry);
-      // 2021-5-21修改 初始化已选择的区域和行业 
+      // 2021-5-21修改 初始化已选择的区域和行业
       var selectedAreaAndInd = getSelectBuyset(state.area, state.industry)
       var selectedAreaAndInd = getSelectBuyset(state.area, state.industry)
       setSelectedAreaAndInd(selectedAreaAndInd);
       setSelectedAreaAndInd(selectedAreaAndInd);
       // 初始化,已购买的城市和行业
       // 初始化,已购买的城市和行业
-        // setBuyAreaAndInd(state.buyset);
-      
+      setBuyAreaAndInd(state.buyset);
+
       //是否提示即将到期
       //是否提示即将到期
       showTimeOut(state.endTime, state.isTrial);
       showTimeOut(state.endTime, state.isTrial);
       selectTime = sessionStorage.getItem("vip_change_time");
       selectTime = sessionStorage.getItem("vip_change_time");

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

@@ -332,7 +332,7 @@
           </li>
           </li>
         </ul>
         </ul>
         <!-- 升级 -->
         <!-- 升级 -->
-        <div class="update_renew">
+        <div class="update_renew" v-if="thisvSwitch === 'v'">
           <div class="update-tips" data-update-tips>因系统升级,已购买用户可选择原套餐续费,或升级到新版本享受更多权益。</div>
           <div class="update-tips" data-update-tips>因系统升级,已购买用户可选择原套餐续费,或升级到新版本享受更多权益。</div>
           <div class="footer-button-group j-button-group">
           <div class="footer-button-group j-button-group">
             <button class="j-button-confirm" data-bind-renew>续费</button>
             <button class="j-button-confirm" data-bind-renew>续费</button>

+ 4 - 3
src/jfw/modules/common/src/qfw/util/jy/bigVipPower.go

@@ -98,7 +98,7 @@ func GetBigVipUserBaseMsg(userId string, mysql *mysql.Mysql, mg MongodbSim) *Big
 	if userId == "" {
 	if userId == "" {
 		return &userPower
 		return &userPower
 	}
 	}
-	userPower.IsUpgrade = true
+	userPower.IsUpgrade = false
 	userPower.Uid = userId
 	userPower.Uid = userId
 	cacheKey := fmt.Sprintf(PowerCacheKey, userId)
 	cacheKey := fmt.Sprintf(PowerCacheKey, userId)
 
 
@@ -141,8 +141,9 @@ func GetBigVipUserBaseMsg(userId string, mysql *mysql.Mysql, mg MongodbSim) *Big
 			userPower.FreeBuyerPort = redis.GetInt(PowerCacheDb, fmt.Sprintf(PowerCacheBuyerPortKey, userId))
 			userPower.FreeBuyerPort = redis.GetInt(PowerCacheDb, fmt.Sprintf(PowerCacheBuyerPortKey, userId))
 			userPower.FreeFile = redis.GetInt(PowerCacheDb, fmt.Sprintf(PowerCacheFileKey, userId))
 			userPower.FreeFile = redis.GetInt(PowerCacheDb, fmt.Sprintf(PowerCacheFileKey, userId))
 			o_jy := qutil.ObjToMap((*data)["o_jy"])
 			o_jy := qutil.ObjToMap((*data)["o_jy"])
-			if _, ok := (*o_jy)["o_area"]; !ok {
-				userPower.IsUpgrade = false
+			//"i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
+			if qutil.IntAll((*o_jy)["i_newfree"]) > 0 {
+				userPower.IsUpgrade = true
 			}
 			}
 		}
 		}
 	}
 	}

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

@@ -68,11 +68,13 @@ func freeSet(area map[string]interface{}, industry []string, userId string) *Fun
 //免费用户地区调整
 //免费用户地区调整
 func FreeSubChange(userId string, area *map[string]interface{}, industry []string, ppb, isfirst bool) bool {
 func FreeSubChange(userId string, area *map[string]interface{}, industry []string, ppb, isfirst bool) bool {
 	setMap := map[string]interface{}{"$set": map[string]interface{}{
 	setMap := map[string]interface{}{"$set": map[string]interface{}{
-		"o_jy.o_area": area, //设置地区
+		"o_jy.o_area":    area, //设置地区
+		"o_jy.i_newfree": 1,    //老免费用户=>新订阅设置页面 20211122
 	}}
 	}}
 	if ppb {
 	if ppb {
 		setMap = map[string]interface{}{"$set": map[string]interface{}{
 		setMap = map[string]interface{}{"$set": map[string]interface{}{
-			"o_jy.o_area_p": area, //设置地区
+			"o_jy.o_area_p":  area, //设置地区
+			"o_jy.i_newfree": 1,    //老免费用户=>新订阅设置页面 20211122
 		}}
 		}}
 	}
 	}
 	updateOk := db.Mgo.UpdateById("user", userId, setMap)
 	updateOk := db.Mgo.UpdateById("user", userId, setMap)

+ 5 - 3
src/jfw/modules/subscribepay/src/service/userAccountInfo.go

@@ -7,9 +7,6 @@ import (
 	"database/sql"
 	"database/sql"
 	"encoding/base64"
 	"encoding/base64"
 	"fmt"
 	"fmt"
-	"github.com/dchest/captcha"
-	"github.com/go-xweb/httpsession"
-	"github.com/go-xweb/xweb"
 	"log"
 	"log"
 	"mongodb"
 	"mongodb"
 	qutil "qfw/util"
 	qutil "qfw/util"
@@ -19,6 +16,10 @@ import (
 	"strings"
 	"strings"
 	"time"
 	"time"
 	"util"
 	"util"
+
+	"github.com/dchest/captcha"
+	"github.com/go-xweb/httpsession"
+	"github.com/go-xweb/xweb"
 )
 )
 
 
 type UserAccount struct {
 type UserAccount struct {
@@ -648,6 +649,7 @@ func (this *UserAccount) WxUnBind() {
 			(*unsetMap)["o_jy"] = map[string]interface{}{
 			(*unsetMap)["o_jy"] = map[string]interface{}{
 				"i_wxpush":   1,
 				"i_wxpush":   1,
 				"i_ratemode": 2,
 				"i_ratemode": 2,
+				"i_newfree":  1, //新免费用户=>新订阅设置页面 20211122
 			}
 			}
 			//公众号微信关注移至另一用户中  此时微信公众号用户session问题错乱
 			//公众号微信关注移至另一用户中  此时微信公众号用户session问题错乱
 			if saveId := util.MQFW.Save("user", unsetMap); saveId == "" {
 			if saveId := util.MQFW.Save("user", unsetMap); saveId == "" {

+ 2 - 0
src/jfw/modules/weixin/src/wx/wx.go

@@ -502,6 +502,7 @@ func saveUser(u *UserInfo, source, pre, RSource, CSource string) (bool, string,
 			newUser["i_ts_guide"] = 2
 			newUser["i_ts_guide"] = 2
 			newUser["o_jy"] = map[string]interface{}{
 			newUser["o_jy"] = map[string]interface{}{
 				"i_wxpush":   1,
 				"i_wxpush":   1,
+				"i_newfree":  1, //新免费用户=>新订阅设置页面 20211122
 				"i_ratemode": 2,
 				"i_ratemode": 2,
 			}
 			}
 		} else {
 		} else {
@@ -581,6 +582,7 @@ func saveUser(u *UserInfo, source, pre, RSource, CSource string) (bool, string,
 				"s_sourceid":      source,
 				"s_sourceid":      source,
 				"i_sourceid":      isourceid,
 				"i_sourceid":      isourceid,
 				"o_jy.i_wxpush":   1,
 				"o_jy.i_wxpush":   1,
+				"o_jy.i_newfree":  1, //新免费用户=>新订阅设置页面 20211122
 				"i_ispush":        1,
 				"i_ispush":        1,
 				"s_headimageurl":  u.HeadImageUrl,
 				"s_headimageurl":  u.HeadImageUrl,
 				"s_nickname":      u.Nickname,
 				"s_nickname":      u.Nickname,

+ 19 - 8
src/web/staticres/common-module/vipsubscribe/js/vip-subscribe-set-template.js

@@ -305,7 +305,7 @@ var subComponent = {
       this.iosBackRefresh()
       this.iosBackRefresh()
     },
     },
     // 判断用户权限
     // 判断用户权限
-    
+
     // 设置区域
     // 设置区域
     setArea: function() {
     setArea: function() {
       let _this = this
       let _this = this
@@ -513,6 +513,11 @@ var subComponent = {
       $iosActionsheet.removeClass('weui-actionsheet_toggle');
       $iosActionsheet.removeClass('weui-actionsheet_toggle');
       $('.match-keywords-actionsheet').hide()
       $('.match-keywords-actionsheet').hide()
       $iosMask.fadeOut(200);
       $iosMask.fadeOut(200);
+      // 免费用户
+      if (this.thisvSwitch === 'f') {
+        return
+      }
+      // 超级订阅升级提示
       if(update_renew) {
       if(update_renew) {
         if(this.accStatus == 2) {
         if(this.accStatus == 2) {
           update_renew.hide()
           update_renew.hide()
@@ -552,6 +557,11 @@ var subComponent = {
         }
         }
         location.href = href
         location.href = href
       } else {
       } else {
+
+        if (this.vSwitch === 'f') {
+          return this.hideActionSheet()
+        }
+
         if(_this.accStatus == 2) {
         if(_this.accStatus == 2) {
           vswitch = 'm'
           vswitch = 'm'
         } else if(_this.accStatus == 1)  {
         } else if(_this.accStatus == 1)  {
@@ -641,6 +651,7 @@ var subComponent = {
     },
     },
     // 修改地区无次数点击事件
     // 修改地区无次数点击事件
     userNumOver: function () {
     userNumOver: function () {
+      var _this = this
       if (this.vSwitch === 'f' && this.userAreaNum === 0) {
       if (this.vSwitch === 'f' && this.userAreaNum === 0) {
         this.linkobj.area = 'javascript:;'
         this.linkobj.area = 'javascript:;'
         if (this.userAreaAllNum > 0) {
         if (this.userAreaAllNum > 0) {
@@ -655,9 +666,9 @@ var subComponent = {
                 label: '取消',
                 label: '取消',
                 type: 'default'
                 type: 'default'
             },{
             },{
-              label: this.userType ? '去升级' : '去购买',
+              label: _this.userType ? '去升级' : '去购买',
               onClick: function(){
               onClick: function(){
-                if (this.userType) {
+                if (_this.userType) {
                   if (location.href.indexOf('front') !== -1) {
                   if (location.href.indexOf('front') !== -1) {
                     var href = '/areaPack/wx/page/buy?type=upgrade'
                     var href = '/areaPack/wx/page/buy?type=upgrade'
                   } else {
                   } else {
@@ -674,7 +685,7 @@ var subComponent = {
               }
               }
             }]
             }]
         });
         });
-      } 
+      }
       else {
       else {
         // this.linkobj.area = '/jyapp/big/page/set_area?callback=setting_save'
         // this.linkobj.area = '/jyapp/big/page/set_area?callback=setting_save'
         if (this.vSwitch === 'f') {
         if (this.vSwitch === 'f') {
@@ -711,7 +722,7 @@ var subComponent = {
         } else {
         } else {
           location.href = '/jyapp/vipsubscribe/toSetInfoTypePage'
           location.href = '/jyapp/vipsubscribe/toSetInfoTypePage'
         }
         }
-        
+
       }
       }
     },
     },
     // 重置信息类型
     // 重置信息类型
@@ -783,7 +794,7 @@ var subComponent = {
               _this.userAreaNum = res.data.areanum
               _this.userAreaNum = res.data.areanum
               _this.userType = res.data.provincenum === 0 ? false : true
               _this.userType = res.data.provincenum === 0 ? false : true
               _this.userAreaAllNum = res.data.provincenum
               _this.userAreaAllNum = res.data.provincenum
-              _this.initdata.infotype = res.data.infotype || [] 
+              _this.initdata.infotype = res.data.infotype || []
               _this.info.infoType = _this.initdata.infotype.join('、')
               _this.info.infoType = _this.initdata.infotype.join('、')
               // _this.$emit('UserSubscribe',res)
               // _this.$emit('UserSubscribe',res)
 
 
@@ -839,7 +850,7 @@ var subComponent = {
         _this.backTipShowCount++
         _this.backTipShowCount++
       })
       })
     },
     },
-    // 
+    //
     // 最近三个月推送结果预览总数
     // 最近三个月推送结果预览总数
     getResultView: function () {
     getResultView: function () {
       let keyArr = []
       let keyArr = []
@@ -959,4 +970,4 @@ var custom = {
       })
       })
   }
   }
 }
 }
-setInfoTypeFn.init()
+setInfoTypeFn.init()