Prechádzať zdrojové kódy

Merge branch 'dev2.8.5' of http://192.168.3.207:10080/qmx/jy into dev2.8.5

wangkaiyue 5 rokov pred
rodič
commit
71cba96634

+ 51 - 36
src/jfw/front/swordfish.go

@@ -2373,44 +2373,54 @@ func (f *Front) HasPushHistory() {
 	isExpire := -1
 	tedayNum := time.Unix(time.Now().Unix(), 1).Format("20060102")
 	isOnTail := 0
-	if util.IntAll((*user)["i_vip_status"]) == 1 || util.IntAll((*user)["i_vip_status"]) == 2 {
-		//
-		var threeRemind = int64(3 * 24 * 60 * 60)
-		var twoRemind = int64(2 * 24 * 60 * 60)
-		var oneRemind = int64(1 * 24 * 60 * 60)
-		var o_vipjy map[string]interface{}
-		o_vipjy, _ = (*user)["o_vipjy"].(map[string]interface{})
-		if o_vipjy["a_items"] != nil {
-			a_itmes := util.ObjArrToMapArr(o_vipjy["a_items"].([]interface{}))
-			hasKeyFlag = len(a_itmes) > 0
-		}
-		isVipFlag = true
-		isPassCount = redis.GetInt("pushcache_2_a", "oncecount_"+tedayNum+"_"+userId) >= 2000
-		isOnTail = util.IntAll((*user)["i_vip_status"])
-		_endtime := (*user)["l_vip_endtime"]
-		//是否到期
-		if util.Int64All(_endtime)-time.Now().Unix() < threeRemind && util.Int64All(_endtime)-time.Now().Unix() >= twoRemind {
-			isExpire = 3 //即将到期
-		} else if util.Int64All(_endtime)-time.Now().Unix() < twoRemind && util.Int64All(_endtime)-time.Now().Unix() >= oneRemind {
-			isExpire = 2 //即将到期
-		} else if util.Int64All(_endtime)-time.Now().Unix() < oneRemind && util.Int64All(_endtime)-time.Now().Unix() >= 0 {
-			isExpire = 1 //即将到期
-		}
-	} else {
-		if (*user)["i_vip_status"] == nil {
-			isExpire = 0
-		} else {
-			isOnTail = util.IntAll((*user)["i_vip_status"])
-		}
-		var o_jy map[string]interface{}
-		if user != nil {
-			o_jy, _ = (*user)["o_jy"].(map[string]interface{})
-		}
+	var o_jy map[string]interface{}
+	var keys []string
+	if user != nil {
+		o_jy, _ = (*user)["o_jy"].(map[string]interface{})
 		if o_jy != nil || len(o_jy) == 0 {
 			a_key, _ := o_jy["a_key"].([]interface{})
-			hasKeyFlag = len(a_key) > 0
+			if a_key != nil {
+				for _, v := range a_key {
+					kv := util.ObjToMap(v)
+					keys = append(keys, util.ObjArrToStringArr((*kv)["key"].([]interface{}))...)
+				}
+			}
+		}
+		if util.IntAll((*user)["i_vip_status"]) == 1 || util.IntAll((*user)["i_vip_status"]) == 2 {
+			//
+			var threeRemind = int64(3 * 24 * 60 * 60)
+			var twoRemind = int64(2 * 24 * 60 * 60)
+			var oneRemind = int64(1 * 24 * 60 * 60)
+			var o_vipjy map[string]interface{}
+			o_vipjy, _ = (*user)["o_vipjy"].(map[string]interface{})
+			if o_vipjy["a_items"] != nil {
+				a_itmes := util.ObjArrToMapArr(o_vipjy["a_items"].([]interface{}))
+				hasKeyFlag = len(a_itmes) > 0
+			}
+			isVipFlag = true
+			isPassCount = redis.GetInt("pushcache_2_a", "oncecount_"+tedayNum+"_"+userId) >= 2000
+			isOnTail = util.IntAll((*user)["i_vip_status"])
+			_endtime := (*user)["l_vip_endtime"]
+			//是否到期
+			if util.Int64All(_endtime)-time.Now().Unix() < threeRemind && util.Int64All(_endtime)-time.Now().Unix() >= twoRemind {
+				isExpire = 3 //即将到期
+			} else if util.Int64All(_endtime)-time.Now().Unix() < twoRemind && util.Int64All(_endtime)-time.Now().Unix() >= oneRemind {
+				isExpire = 2 //即将到期
+			} else if util.Int64All(_endtime)-time.Now().Unix() < oneRemind && util.Int64All(_endtime)-time.Now().Unix() >= 0 {
+				isExpire = 1 //即将到期
+			}
+		} else {
+			if (*user)["i_vip_status"] == nil {
+				isExpire = 0
+			} else {
+				isOnTail = util.IntAll((*user)["i_vip_status"])
+			}
+			if o_jy != nil || len(o_jy) == 0 {
+				a_key, _ := o_jy["a_key"].([]interface{})
+				hasKeyFlag = len(a_key) > 0
+			}
+			isPassCount = redis.GetInt("pushcache_2_a", "oncecount_"+tedayNum+"_"+userId) >= 50
 		}
-		isPassCount = redis.GetInt("pushcache_2_a", "oncecount_"+tedayNum+"_"+userId) >= 50
 	}
 	pageNum, _ := f.GetInteger("pageNum")
 	if pageNum == 0 {
@@ -2421,7 +2431,11 @@ func (f *Front) HasPushHistory() {
 	if hasKeyFlag && len(list) == 0 && formatTime == "" && !isVipFlag {
 		flag, data := public.HistoryPush.MakeHistoryDatas(userId, bidSearch_field_1)
 		if flag && data != nil {
-			list = data
+			jsonBytes, err := json.Marshal(data)
+			err = json.Unmarshal(jsonBytes, &list)
+			if err != nil {
+				log.Println("err:", err)
+			}
 		}
 	}
 	//
@@ -2435,6 +2449,7 @@ func (f *Front) HasPushHistory() {
 		"isExpire":    isExpire,
 		"isOnTail":    isOnTail,
 		"userId":      util.EncodeArticleId(userId),
+		"keys":        keys,
 	})
 }
 

+ 26 - 0
src/jfw/front/vipsubscribe.go

@@ -6,6 +6,7 @@ import (
 	"jfw/jyutil"
 	"jfw/public"
 	"jfw/wx"
+	"log"
 	"net/url"
 	"qfw/util"
 	"time"
@@ -46,6 +47,9 @@ type Subscribepay struct {
 
 	//发票
 	openInvoice xweb.Mapper `xweb:"/front/vipsubscribe/openInvoice/(\\w+)"` //开发票
+
+	//预热活动链接跳转
+	preheatPoster xweb.Mapper `xweb:"/front/preheat/poster"` //预热活动链接跳转
 }
 
 func init() {
@@ -301,3 +305,25 @@ func (s *Subscribepay) OpenInvoice(order_code string) {
 	s.T["order_code"] = order_code
 	s.Render("/weixin/dataExport/dataExport_applyInvoice.html", &s.T)
 }
+
+//预热活动链接跳转
+func (s *Subscribepay) PreheatPoster() {
+	myopenid := util.ObjToString(s.GetSession("s_m_openid"))
+	mynickname, _ := s.Session().Get("s_nickname").(string)
+	myavatar, _ := s.Session().Get("s_avatar").(string)
+	s.T["nickname"] = mynickname
+	s.T["avatar"] = myavatar
+	s.T["signature"] = wx.SignJSSDK(s.Site() + s.Url())
+	s.T["openid"] = se.EncodeString(myopenid)
+	u, ok := public.MQFW.FindOne("user", `{"s_m_openid":"`+myopenid+`"}`)
+	log.Println(myopenid, "---", u, "--", ok)
+	if len(*u) > 0 && ok {
+		if util.Int64All((*u)["i_vip_status"]) == 1 || util.Int64All((*u)["i_vip_status"]) == 2 {
+			log.Println("VIP")
+			s.Redirect("/front/vipsubscribe/toSetPage")
+		} else {
+			log.Println("NO VIP")
+			s.Redirect("/front/vipsubscribe/introducePage")
+		}
+	}
+}

+ 2 - 0
src/jfw/modules/pushsubscribe/src/push/job/projectjob.go

@@ -120,6 +120,8 @@ func (p *ProjectPushJob) Execute() {
 									"area":       util.ObjToString(plm["area"]),
 									"city":       util.ObjToString(plm["city"]),
 									"_id":        infoId,
+									"toptype":    util.ObjToString(plm["toptype"]),
+									"subtype":    util.ObjToString(plm["subtype"]),
 									"buyerclass": util.ObjToString(plm["buyerclass"]),
 								},
 							})

+ 49 - 47
src/jfw/modules/pushsubscribe/src/push/util/util.go

@@ -154,56 +154,58 @@ func SaveToPushsubscribe(isVipUser, isProjectInfo bool, userId string, matchInfo
 	}
 	unix := time.Now().Unix()
 	length := len(*matchInfos)
-	fields := []string{"userid", "infoid", "date", "matchkeys", "area", "city", "buyerclass", "type", "isvip"}
+	fields := []string{"userid", "infoid", "date", "matchkeys", "area", "city", "buyerclass", "type", "isvip", "toptype", "subtype"}
 	var savecount int64
-	i := length
-	for {
-		batchSize := 0
-		values := []interface{}{}
-		for i > 0 {
-			i--
-			matchInfo := (*matchInfos)[i]
-			values = append(values, userId, util.ObjToString((*matchInfo.Info)["_id"]), unix)
-			if len(matchInfo.Keys) > 0 {
-				values = append(values, strings.Join(matchInfo.Keys, " "))
-			} else {
-				values = append(values, nil)
-			}
-			if area := util.ObjToString((*matchInfo.Info)["area"]); area != "" {
-				values = append(values, area)
-			} else {
-				values = append(values, nil)
-			}
-			if city := util.ObjToString((*matchInfo.Info)["city"]); city != "" {
-				values = append(values, city)
-			} else {
-				values = append(values, nil)
-			}
-			if buyerclass := util.ObjToString((*matchInfo.Info)["buyerclass"]); buyerclass != "" {
-				values = append(values, buyerclass)
-			} else {
-				values = append(values, nil)
-			}
-			if isProjectInfo {
-				values = append(values, 1)
-			} else {
-				values = append(values, nil)
-			}
-			if isVipUser {
-				values = append(values, 1)
-			} else {
-				values = append(values, nil)
-			}
-			batchSize++
-			if batchSize == BigBulkSize {
-				break
-			}
+	batchSize := 0
+	values := []interface{}{}
+	for i := len(*matchInfos) - 1; i >= 0; i-- {
+		matchInfo := (*matchInfos)[i]
+		values = append(values, userId, util.ObjToString((*matchInfo.Info)["_id"]), unix)
+		if len(matchInfo.Keys) > 0 {
+			values = append(values, strings.Join(matchInfo.Keys, " "))
+		} else {
+			values = append(values, nil)
 		}
-		if batchSize > 0 {
-			savecount += Mysql.InsertBatch("pushsubscribe", fields, values)
+		if area := util.ObjToString((*matchInfo.Info)["area"]); area != "" {
+			values = append(values, area)
+		} else {
+			values = append(values, nil)
 		}
-		if batchSize < BigBulkSize {
-			break
+		if city := util.ObjToString((*matchInfo.Info)["city"]); city != "" {
+			values = append(values, city)
+		} else {
+			values = append(values, nil)
+		}
+		if buyerclass := util.ObjToString((*matchInfo.Info)["buyerclass"]); buyerclass != "" {
+			values = append(values, buyerclass)
+		} else {
+			values = append(values, nil)
+		}
+		if isProjectInfo {
+			values = append(values, 1)
+		} else {
+			values = append(values, nil)
+		}
+		if isVipUser {
+			values = append(values, 1)
+		} else {
+			values = append(values, nil)
+		}
+		if toptype := util.ObjToString((*matchInfo.Info)["toptype"]); toptype != "" {
+			values = append(values, toptype)
+		} else {
+			values = append(values, nil)
+		}
+		if subtype := util.ObjToString((*matchInfo.Info)["subtype"]); subtype != "" {
+			values = append(values, subtype)
+		} else {
+			values = append(values, nil)
+		}
+		batchSize++
+		if i == 0 || batchSize == BigBulkSize {
+			savecount += Mysql.InsertBatch("pushsubscribe", fields, values)
+			batchSize = 0
+			values = []interface{}{}
 		}
 	}
 	if int(savecount) != length {

+ 83 - 1
src/jfw/modules/subscribepay/src/entity/subscribeVip.go

@@ -58,6 +58,7 @@ type VipSimpleMsg struct {
 	Industry           []string                `json:"industry"`           //行业
 	Addareacount       *map[string]interface{} `json:"addareacount"`       //新增购买区域数量
 	Addbuyerclasscount int                     `json:"addbuyerclasscount"` //新增行业数量
+	Buyset             *map[string]interface{} `json:"buyset"`             //原始信息
 	Cyclecount         int                     `json:"cyclecount"`         //日期数量
 	Cycleunit          int                     `json:"cycleunit"`          //日期单位
 	OrderType          int                     `json:"ordertype"`          //类型 1:订单 2:续费 3:立即升级 4:下月升级 5:即将到期(升降级)6:升级订单未生效再次升级
@@ -205,7 +206,17 @@ func (this *vipSubscribeStruct) UpgradeSubVip(userId string, vmsg VipSimpleMsg,
 		return false
 	}
 	if isNow {
-		buyset := JyVipSubStruct.NewBuySet(vmsg.Area, vmsg.Industry)
+		//		buyset := JyVipSubStruct.NewBuySet(vmsg.Area, vmsg.Industry)
+		buyset := SubvipBuySet{}
+		addBuyset := vmsg.Buyset
+		buyset.AreaCount = qutil.IntAll((*addBuyset)["areacount"])
+		buyset.BuyerclassCount = qutil.IntAll((*addBuyset)["buyerclasscount"])
+		cityArr := qutil.ObjToMap((*addBuyset)["citys"])
+		citys := map[string]interface{}{}
+		for cityMap, cityCount := range *cityArr {
+			citys[cityMap] = qutil.IntAll(cityCount)
+		}
+		buyset.Citys = citys
 		return util.MQFW.UpdateById("user", userId,
 			bson.M{"$set": bson.M{
 				"o_vipjy.o_area":       vmsg.Area,     //设置地区
@@ -449,6 +460,77 @@ func (this *vipSubscribeStruct) GetSubVipPrice(area *map[string]interface{}, ind
 	return payMoney
 }
 
+//计算价格
+func (this *vipSubscribeStruct) GetSubVipBuysetPrice(buyset *map[string]interface{}, count, unit int) int {
+	payMoney := func() int {
+
+		industryNum := qutil.IntAll((*buyset)["buyerclasscount"])
+		//当行业数量大于最大值SubVipPrice.BuyerClassMaxCount 按照全行业计算
+		//		industryNum := len(industry)
+		if industryNum > SubVipPrice.BuyerClassMaxCount {
+			industryNum = 0
+		}
+		//计算地区数量
+		pCount := qutil.IntAll((*buyset)["areacount"]) //省份数量
+		//		cityCountMap := map[string]int{}               //购买省份中城市数量
+
+		//当选择月份大于  按照全年计算
+		if count > SubVipPrice.MonthMaxCount && unit == 2 { //月份十个月以上价格一样
+			count = 10
+		}
+
+		if pCount == -1 { //计算全国套餐价格
+			if industryNum == 1 {
+				return getSetMealPrice(0, 1, unit) * count //全国1行业套餐
+			} else if industryNum == 0 {
+				return getSetMealPrice(0, 0, unit) * count //全国全行业套餐
+			} else {
+				return getSetMealPrice(0, industryNum, unit) * count //全国多行业套餐
+			}
+		}
+
+		//计算非全国套餐
+		finalPrice := 0 //省份价格
+		cityCountMap := qutil.ObjToMap((*buyset)["citys"])
+		for _, cityCount := range *cityCountMap {
+			thisPrice := 0
+			//			cityCount = qutil.IntAll(cityCount)
+			if qutil.IntAll(cityCount) == 1 { //单城市
+				thisPrice = getSetMealPrice(2, industryNum, unit) * count
+			} else { //多城市
+				if industryNum == 0 || industryNum == 1 { //多城市 单行业
+					if qutil.IntAll(cityCount) > SubVipPrice.CityMaxCount {
+						pCount++
+					} else {
+						thisPrice = qutil.IntAll(cityCount) * getSetMealPrice(2, industryNum, unit) * count
+					}
+				} else { //多城市 多行业
+					if qutil.IntAll(cityCount) > SubVipPrice.CityMaxCount {
+						pCount++
+					} else {
+						thisPrice = getSetMealPrice(2, industryNum, unit) * qutil.IntAll(cityCount) * count
+					}
+				}
+			}
+			finalPrice += thisPrice
+		}
+		finalPrice += pCount * getSetMealPrice(1, industryNum, unit) * count
+		return finalPrice
+	}()
+	if SubVipPrice.Discount < 1 {
+		//测试环境修改金额
+		log.Printf("进行折扣计算 折扣前金额%d\n", payMoney)
+		tmp := float64(payMoney) * SubVipPrice.Discount
+		if tmp < 1 {
+			payMoney = 1
+		} else {
+			payMoney = int(tmp)
+		}
+		log.Printf("进行折扣计算 折扣后金额%d\n", payMoney)
+	}
+	return payMoney
+}
+
 /*
 vip订阅 套餐价格
 c(city) 全国:0 省:1 市:2

+ 13 - 6
src/jfw/modules/subscribepay/src/service/vipRenewUpgrade.go

@@ -124,6 +124,8 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 	payWay := this.GetString("payWay")                               //支付方式
 	pay_source := this.GetString("pay_source")                       //类型  续费-Renew or 升级-Upgrade
 	addCount := this.GetString("addCount")
+	buyset := qutil.ObjToMap(this.GetString("buyset"))
+	log.Println("111", buyset)
 	var vipBuyCount *map[string]interface{}
 	if addCount != "" {
 		vipBuyCount = qutil.ObjToMap(addCount) //新增购买区域数量
@@ -193,6 +195,7 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 				industry,
 				nil,
 				0,
+				nil,
 				date_count,
 				date_unit,
 				orderType,
@@ -203,6 +206,7 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 				allIndustry,
 				vipBuyCount,
 				industryCount,
+				buyset,
 				date_count,
 				date_unit,
 				orderType,
@@ -270,17 +274,20 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 			oldPriceY := entity.JyVipSubStruct.GetSubVipPrice(areas, industrys, upgradeYear, 1)
 			oldPriceM := entity.JyVipSubStruct.GetSubVipPrice(areas, industrys, upgradeMonth, 2)
 			oldPrice := oldPriceY + oldPriceM
-			newPriceY := entity.JyVipSubStruct.GetSubVipPrice(allBuyArea, allIndustry, upgradeYear, 1)
-			newPriceM := entity.JyVipSubStruct.GetSubVipPrice(allBuyArea, allIndustry, upgradeMonth, 2)
+			//			newPriceY := entity.JyVipSubStruct.GetSubVipPrice(allBuyArea, allIndustry, upgradeYear, 1)
+			//			newPriceM := entity.JyVipSubStruct.GetSubVipPrice(allBuyArea, allIndustry, upgradeMonth, 2)
+			newPriceY := entity.JyVipSubStruct.GetSubVipBuysetPrice(buyset, upgradeYear, 1)
+			newPriceM := entity.JyVipSubStruct.GetSubVipBuysetPrice(buyset, upgradeMonth, 2)
 			newPrice := newPriceY + newPriceM
 			totalfee = newPrice - oldPrice
 			// --------升级价格差价计算--------
 			if date_unit == 1 { //升级中的延长时间
-				lengPrice := entity.JyVipSubStruct.GetSubVipPrice(allBuyArea, allIndustry, date_count, 1) //单位为年的已购+新增延长时间价格
-				totalfee = totalfee + lengPrice                                                           //已购+新增延长时间价格 + 升级差价 = 最终价格
+
+				lengPrice := entity.JyVipSubStruct.GetSubVipBuysetPrice(buyset, date_count, 1) //单位为年的已购+新增延长时间价格
+				totalfee = totalfee + lengPrice                                                //已购+新增延长时间价格 + 升级差价 = 最终价格
 			} else if date_unit == 2 {
-				lengPrice := entity.JyVipSubStruct.GetSubVipPrice(allBuyArea, allIndustry, date_count, 2) //单位为月的已购+新增延长时间价格
-				totalfee = totalfee + lengPrice                                                           //已购+新增延长时间价格 + 升级差价 = 最终价格
+				lengPrice := entity.JyVipSubStruct.GetSubVipBuysetPrice(buyset, date_count, 2) //单位为月的已购+新增延长时间价格
+				totalfee = totalfee + lengPrice                                                //已购+新增延长时间价格 + 升级差价 = 最终价格
 			}
 		}
 		log.Println("price", totalfee)

+ 1 - 0
src/jfw/modules/subscribepay/src/service/vipSubscribePay.go

@@ -88,6 +88,7 @@ func (this *SubVipPayOrder) CreateOrder() {
 			industry,
 			nil,
 			0,
+			nil,
 			date_count,
 			date_unit,
 			orderType,

+ 1 - 0
src/jfw/modules/subscribepay/src/service/vipSubscribeTrial.go

@@ -286,6 +286,7 @@ func (this *TrialOrder) TrialPay() {
 			industry,
 			nil,
 			0,
+			nil,
 			date_count,
 			date_unit,
 			0,

+ 1 - 7
src/jfw/modules/weixin/src/config.json

@@ -89,11 +89,5 @@
             "activeEnd": 1586185600,
             "subSecondRP": "https://www.jianyu360.com/images/t3.jpg"
         }
-    ],
-	"preheatingState":true,
-	"preheatingReply": {
-        "href_vip":"/front/vipsubscribe/toSetPage",
-        "href_notvip":"/front/vipsubscribe/introducePage",
-        "content":"<a href='%s'>剑鱼标讯VIP订阅新上线</a>"
-	}
+    ]
 }

+ 15 - 13
src/jfw/modules/weixin/src/wx/wx.go

@@ -790,21 +790,23 @@ func Subscribe(w ResponseWriter, r *Request) {
 			Description: subscribeReply["description"].(string),
 		}})
 		//vip消息
-		preheatingState := config.Sysconfig["preheatingState"].(bool)
-		if preheatingState {
-			preheatingReply := config.Sysconfig["preheatingReply"].(map[string]interface{})
-			u, ok := tools.MQFW.FindOne("user", `{"s_m_openid":"`+openid+`"}`)
-			if len(*u) > 0 && ok {
-				if util.Int64All((*u)["i_vip_status"]) == 1 || util.Int64All((*u)["i_vip_status"]) == 2 {
-					preheatingReply["href"] = preheatingReply["href_vip"]
-				} else {
-					preheatingReply["href"] = preheatingReply["href_notvip"]
+		/*
+			preheatingState := config.Sysconfig["preheatingState"].(bool)
+			if preheatingState {
+				preheatingReply := config.Sysconfig["preheatingReply"].(map[string]interface{})
+				u, ok := tools.MQFW.FindOne("user", `{"s_m_openid":"`+openid+`"}`)
+				if len(*u) > 0 && ok {
+					if util.Int64All((*u)["i_vip_status"]) == 1 || util.Int64All((*u)["i_vip_status"]) == 2 {
+						preheatingReply["href"] = preheatingReply["href_vip"]
+					} else {
+						preheatingReply["href"] = preheatingReply["href_notvip"]
+					}
 				}
+				time.AfterFunc(time.Second/2, func() {
+					w.PostText(fmt.Sprintf(fmt.Sprint(preheatingReply["content"]), config.Sysconfig["webdomain"].(string)+preheatingReply["href"].(string)))
+				})
 			}
-			time.AfterFunc(time.Second/2, func() {
-				w.PostText(fmt.Sprintf(fmt.Sprint(preheatingReply["content"]), config.Sysconfig["webdomain"].(string)+preheatingReply["href"].(string)))
-			})
-		}
+		*/
 	}
 	if source != "" && len(source) > 5 {
 		go saveUserLog(source, openid, activeName, shareflag)

+ 59 - 53
src/jfw/public/historypush.go

@@ -7,6 +7,7 @@ import (
 	"qfw/util/elastic"
 	"qfw/util/jy"
 	"qfw/util/redis"
+	"sort"
 	"strings"
 	"time"
 
@@ -428,8 +429,28 @@ func (h *historyPush) getInfoByIds(pushCas []*jy.PushCa) []map[string]interface{
 	return array
 }
 
+type resultData struct {
+	Area            string   `json:"area"`
+	Id              string   `json:"_id"`
+	Publishtime     int64    `json:"publishtime"`
+	Type            string   `json:"stype"`
+	S_subscopeclass string   `json:"s_subscopeclass"`
+	Title           string   `json:"title"`
+	Ca_isvip        int      `json:"ca_isvip"`
+	Ca_date         int64    `json:"ca_date"`
+	Ca_isvisit      int      `json:"ca_isvisit"`
+	Ca_index        int64    `json:"ca_index"`
+	Matchkeys       []string `json:"matchkeys"`
+}
+
+type resultSort []*resultData
+
+func (p resultSort) Len() int           { return len(p) }
+func (p resultSort) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }
+func (p resultSort) Less(i, j int) bool { return p[i].Ca_index > p[j].Ca_index }
+
 //保存最近7天的数据到历史记录
-func (h *historyPush) MakeHistoryDatas(userId, field string) (bool, []map[string]interface{}) {
+func (h *historyPush) MakeHistoryDatas(userId, field string) (bool, []*resultData) {
 	allquery := `{"range":{"publishtime":{"gt":%s}}}`
 	allquery = fmt.Sprintf(allquery, fmt.Sprint(time.Now().AddDate(0, 0, -7).Unix()))
 	//	allquery = ``
@@ -446,13 +467,12 @@ func (h *historyPush) MakeHistoryDatas(userId, field string) (bool, []map[string
 			}
 		}
 	}
-	result := []map[string]interface{}{}
-	fields := []string{"userid", "infoid", "date", "matchkeys", "area", "city", "type", "subscopeclass"}
-	values := []interface{}{}
 	publishTitle := map[string]bool{}
 	now := time.Now()
 	keystr := strings.Join(matchkeys, " ")
-	for k, v := range *list {
+	var resultList []*resultData
+	for _, v := range *list {
+		var myInsert = make(map[string]interface{})
 		title := strings.Replace(v["title"].(string), "\n", "", -1)
 		area_check := util.ObjToString(v["area"])
 		city_check := util.ObjToString(v["city"])
@@ -461,40 +481,23 @@ func (h *historyPush) MakeHistoryDatas(userId, field string) (bool, []map[string
 		} else {
 			publishTitle[area_check+title] = true
 		}
-		values = append(values, userId, util.ObjToString(v["_id"]), now.Unix(), keystr, area_check, city_check, 0, v["s_subscopeclass"])
-		info := map[string]interface{}{
-			"area":             area_check,
-			"_id":              util.EncodeArticleId2ByCheck(util.ObjToString(v["_id"])),
-			"publishtime":      v["publishtime"],
-			"stype":            v["type"],
-			"toptype":          v["toptype"],
-			"subtype":          v["subtype"],
-			"s_subscopeclass":  v["s_subscopeclass"],
-			"buyer":            v["buyer"],
-			"projectname":      v["projectname"],
-			"budget":           v["budget"],
-			"bidopentime":      v["bidopentime"],
-			"winner":           v["winner"],
-			"bidamount":        v["bidamount"],
-			"title":            title,
-			"ca_isvisit_index": k + 1,
-			"ca_date":          now.Unix(),
-			"ca_isvisit":       0,
-			"matchkeys":        matchkeys,
-		}
-		area := util.ObjToString(info["area"])
-		if area == "A" {
-			area = "全国"
+		myInsert["userid"] = userId
+		myInsert["infoid"] = util.ObjToString(v["_id"])
+		myInsert["date"] = now.Unix()
+		myInsert["matchkeys"] = keystr
+		myInsert["area"] = area_check
+		myInsert["city"] = city_check
+		myInsert["type"] = 0
+		myInsert["subtype"] = util.ObjToString(v["subtype"])
+		myInsert["toptype"] = util.ObjToString(v["toptype"])
+		myInsert["isvisit"] = 0
+		myInsert["isvip"] = 0
+		myInsert["buyerclass"] = v["buyerclass"]
+		id := Mysql.Insert("pushsubscribe", myInsert)
+		if area_check == "A" {
+			area_check = "全国"
 		}
-		budget, _ := info["budget"].(float64)
-		if budget == 0 || strings.TrimSpace(fmt.Sprint(info["budget"])) == "" {
-			delete(info, "budget")
-		}
-		bidamount, _ := info["bidamount"].(float64)
-		if bidamount == 0 || strings.TrimSpace(fmt.Sprint(info["bidamount"])) == "" {
-			delete(info, "bidamount")
-		}
-		industry := util.ObjToString(info["s_subscopeclass"])
+		industry := util.ObjToString(v["s_subscopeclass"])
 		scs := strings.Split(industry, ",")
 		if len(scs) > 0 {
 			industry = scs[0]
@@ -504,33 +507,36 @@ func (h *historyPush) MakeHistoryDatas(userId, field string) (bool, []map[string
 					industry = iss[0]
 				}
 			}
-			info["s_subscopeclass"] = industry
 		}
-		infotype := util.ObjToString(info["subtype"])
+		infotype := util.ObjToString(v["subtype"])
 		if infotype == "" {
-			infotype = util.ObjToString(info["toptype"])
+			infotype = util.ObjToString(v["toptype"])
 		}
 		if infotype == "" {
-			infotype = util.ObjToString(info["type"])
+			infotype = util.ObjToString(v["type"])
 			if infotype == "tender" {
 				infotype = "招标"
 			} else if infotype == "bid" {
 				infotype = "中标"
 			}
 		}
-		info["type"] = infotype
-		delete(info, "subtype")
-		delete(info, "toptype")
 
-		result = append(result, info)
+		resultList = append(resultList, &resultData{
+			area_check,
+			util.EncodeArticleId2ByCheck(util.ObjToString(v["_id"])),
+			util.Int64All(v["publishtime"]),
+			infotype,
+			industry,
+			title,
+			0,
+			now.Unix(),
+			0,
+			id,
+			matchkeys,
+		})
 	}
-	go func(fields []string, values []interface{}) {
-		count := Mysql.InsertBatch("pushsubscribe", fields, values)
-		if int(count) == len(values) {
-			log.Println("mysql insert  true")
-		}
-	}(fields, values)
-	return true, result
+	sort.Sort(resultSort(resultList))
+	return true, resultList
 }
 
 //获取用户信息

+ 1 - 0
src/web/staticres/css/wx/home.css

@@ -24,6 +24,7 @@
 .home .top .home_search .home_search_left {
   display: flex;
   align-items: center;
+width: 100%;
 }
 
 .home .top .home_search .home_search_left span {

+ 2 - 0
src/web/staticres/js/wxSupersearch.js

@@ -1915,6 +1915,8 @@ var SuperSearch = {
 		if(SuperSearch.dropload != null){
 			SuperSearch.dropload.resetload();
 		}
+		//再html内点击都会存缓存 关闭广告后再刷新 会取缓存 
+		SuperSearch.clearSessionStorage();
 	},
 	appendInterceptWord: function(word){
 		SuperSearch.interceptWord = word;

+ 29 - 15
src/web/staticres/vipsubscribe/js/updateArea.js

@@ -625,11 +625,6 @@ $(function () {
         //     province: 0,
         //     city: 0
         // }
-		//
-		sessionStorage.removeItem("vipAddCount")
-		sessionStorage.removeItem("vipSubSelectCity")
-		sessionStorage.removeItem("vipSubSelectAreaUpgrade")
-		sessionStorage.removeItem("vipSubSelectAreaAdd")
         // 数组置0,在重新从数据中计算初始状态结果并返回
         for (let i in alreadyBuy) {
             for(let ii in alreadyBuy[i]) {
@@ -679,20 +674,28 @@ $(function () {
 		let selectedCityLength = $(dom).parent().find('.city.active:not([disabled])').length;
 		let disabledCityLength = $(dom).parent().find('.city[disabled]').length;
 		let cityLength = $(dom).parent().find('.city').length;
-		let dataCount = $(dom).parent().parent().attr("data-buy-city-count");
+		let dataCount = Number($(dom).parent().parent().attr("data-buy-city-count"));
 		if(dataCount === undefined){
 			dataCount = 0;
 		}else{
-			if(Number(dataCount) === disabledCityLength){
-				dataCount = 0;
-			}else{
-				dataCount = dataCount - disabledCityLength;
+			if(Number(dataCount) !== disabledCityLength){
+				if(disabledCityLength === 0){
+					dataCount = 0;
+				}else{
+					dataCount = dataCount - disabledCityLength;
+				}
 			}
 		}
-		let showCount = selectedCityLength - dataCount;
+		let countShow = 0;
+		let showCount = selectedCityLength + dataCount;
+		// let showCount = selectedCityLength - dataCount;
 		if(showCount > 2){
-			$(".tips_d_text").text("已新增"+showCount+"个市,建议新增“全省”");
-			$(".tips_d_text").show();
+			if(selectedCityLength === 0){
+				$(".tips_d_text").hide();
+			}else{
+				$(".tips_d_text").text("已选择"+showCount+"个市,建议购买“全省”");
+				$(".tips_d_text").show();
+			}
 		}else{
 			$(".tips_d_text").hide();
 		}
@@ -702,9 +705,20 @@ $(function () {
 	}
 	
 	function showOther(){
-		let showCounts = newlyAdded.province;
+		let areaCount = areaData.data.buyset.areacount;
+		let areaSelect = $('.checkbox:checked:not([disabled])').length;
+		if(areaSelect === 0){
+			$(".tips_d_text").hide();
+			return
+		}
+		let showCounts = 0;
+		if(areaCount === -1){
+			$(".tips_d_text").hide();
+		}else{
+			showCounts = newlyAdded.province + areaCount;
+		}
 		if(showCounts > 9){
-			$(".tips_d_text").text("已新增"+showCounts+"个省,建议新增“全国”")
+			$(".tips_d_text").text("已选择"+showCounts+"个省,建议购买“全国”")
 			$(".tips_d_text").show();
 		}else{
 			$(".tips_d_text").hide();

+ 12 - 5
src/web/templates/weixin/historypush.html

@@ -36,6 +36,7 @@
 		var wxflag = "";
 		var a_visitedindex = new Array;
 		var closeAdvert=false//是否关闭广告
+		var words = ""
 		initShare({{.T.signature}},{{.T.openid}},2,"jy_extend",{{.T.nickname}},{{.T.avatar}});
 		$(function(){
 			var isinitpage = false;
@@ -105,6 +106,7 @@
 				userId = sessionStorage.userId;
 				firstTime = sessionStorage.getItem(userId+"_searchTime");
 				selectCity = sessionStorage.getItem(userId+"_selectCity");
+				words = JSON.parse(sessionStorage.keys);
 			    if(sessionStorage.closeAdvert=="true"){
 			      	closeAdvert=true
 			    }
@@ -155,6 +157,8 @@
 						isExpire = data.isExpire;
 						sessionStorage.isExpire = isExpire;
 						sessionStorage.setItem(userId+"_searchTime",firstTime);
+						words = data.keys;
+						sessionStorage.keys = JSON.stringify(words);
 						showPage();
 					},
 					error: function(xhr, type){
@@ -340,15 +344,18 @@
 				//标题(需要高亮)
 				var title=obj.title;
 				var mWords="";
-				var words = obj.matchkeys;
-				if(words.length>0){
-					for(var n=0;n<words.length;n++){
-						var keysTemp = words[n].split("+");
+				var _words = words;
+				if(obj.matchkeys!=undefined&&obj.matchkeys!=null&&obj.matchkeys!=""){
+					_words = obj.matchkeys;
+				}
+				if(_words.length>0){
+					for(var n=0;n<_words.length;n++){
+						var keysTemp = _words[n].split("+");
 						for(var m=0;m<keysTemp.length;m++){
 							 title = keyWordHighlight(title,keysTemp[m],'<font class="keyword">$1</font>');
 						}
 					}
-					mWords=words.join("_");
+					mWords=_words.join("_");
 				}
 				//地区
 				var area=obj.area;

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

@@ -23,7 +23,7 @@
 <script src="{{Msg "seo" "cdn"}}/wxswordfish/share.js?v={{Msg "seo" "version"}}111"></script>
 <script src="{{Msg "seo" "cdn"}}/js/dropload.js?v={{Msg "seo" "version"}}"></script>
 <script type="text/javascript" src="{{Msg "seo" "cdn"}}/js/wxEntsesearch.js?v={{Msg "seo" "version"}}"></script>
-<script type="text/javascript" src="{{Msg "seo" "cdn"}}/js/wxSupersearch.js?v={{Msg "seo" "version"}}521"></script>
+<script type="text/javascript" src="{{Msg "seo" "cdn"}}/js/wxSupersearch.js?v={{Msg "seo" "version"}}522"></script>
 <!--2.8-->
 <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wx_dataExport/css/base_myorder.css?v={{Msg "seo" "version"}}1">
 <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wx_dataExport/iconfont/iconfont.css?v={{Msg "seo" "version"}}">

+ 14 - 12
src/web/templates/weixin/vipsubscribe/choose_industry_upgrade.html

@@ -316,12 +316,24 @@
                 			$(".buyset").text("已购买:"+buyset);
                 		}
                 	}
+					// 显示隐藏优惠tips
+					let disabledCount = $("ul.list li.list_item .item_industry_list").find(".industry_item[disabled]").length;
+					let showCount = buyset - disabledCount;
+					let showCounts = selectedArr.length - showCount;
+					let countShow = showCounts + buyset
+					if (countShow > 3) {
+						$('.tips_btn .tips_d_text').text("已选择"+countShow+"个行业,建议购买“全部行业”");
+					    $('.tips_btn .tips_d_text').slideDown();
+					} else {
+					    $('.tips_btn .tips_d_text').slideUp()
+					}
                 }else{
                 	if(buyset !== "全部行业"){
                 		$(".buyset").text("已购买:"+buyIndustryLen+"/"+buyset+"个行业")
                 	}else{
                 		$(".buyset").text("已购买:"+buyset)
                 	}
+					$('.tips_btn .tips_d_text').slideUp()
                 }
                 for(var i in selectedArr){
                 	if(selectedArr[i] === "全部行业"){
@@ -334,16 +346,6 @@
                 		}
                 	}
                 }
-                // 显示隐藏优惠tips
-                let disabledCount = $("ul.list li.list_item .item_industry_list").find(".industry_item[disabled]").length;
-                let showCount = buyset - disabledCount;
-                let showCounts = selectedArr.length - showCount;
-                if (showCounts > 3) {
-                	$('.tips_btn .tips_d_text').text("已新增"+showCounts+"个行业,建议新增“全部行业”");
-                    $('.tips_btn .tips_d_text').slideDown();
-                } else {
-                    $('.tips_btn .tips_d_text').slideUp()
-                }
           
                 selectedIndustryArr = selectedArr
                 
@@ -423,8 +425,8 @@
 				$('.select-area-box .list button').removeClass('active');
                 showSelect(buyIndustry,false);
                 findSelectedIndustry();
-                sessionStorage.removeItem("vipSubSelectIndustryAdd");
-                sessionStorage.removeItem("vipSubSelectIndustryUpgrade");
+                //sessionStorage.removeItem("vipSubSelectIndustryAdd");
+                //sessionStorage.removeItem("vipSubSelectIndustryUpgrade");
                 $('.tips_btn .btns button').removeAttr('disabled');
             })
            

+ 118 - 67
src/web/templates/weixin/vipsubscribe/vip_upgrade.html

@@ -743,7 +743,7 @@
         var areasArr = {};
         var areas_arr = {};
 	    var industrysArr = [];
-	    // var allArea = {};
+	    var allArea = {};
 	    var allBuyArea = {};
 	    var allIndustry = [];
 	    var nowRenew = "";
@@ -786,44 +786,48 @@
 						areas_arr = {"全国":[]};
 					}
 		    	}
-				// if(area !== ""&&area !== undefined){
-				// 	for(let province in area){
-			 //    		let citys = area[province];
-			 //    		if(citys.length===0){
-				// 			allArea[province] = [];
-			 //    		}else{
-			 //    			allArea[province] = citys;
-			 //    		}
-			 //    	}
-				// 	for(let province in vipArea){
-				// 		let citys = vipArea[province];
-				// 		if(allArea[province] === undefined){
-				// 			allArea[province] = citys
-				// 		}else{
-				// 			let cityArr = [];
-				// 			for(let i in citys){
-				// 				cityArr.push(citys[i]);
-				// 			}
-				// 			for(let i in allArea[province]){
-				// 				cityArr.push(allArea[province][i]);
-				// 			}
-				// 			//
-				// 			for (var x = 0; x < cityArr.length; x++) {
-				// 	            for (var j =x+1; j <cityArr.length; ) {
-				// 	                if (cityArr[x] === cityArr[j]){
-				// 	                    cityArr.splice(j, 1);
-				// 	                }
-				// 	                else j++;
-				// 	            }
-				// 	       	}
-				// 			//
-				// 			allArea[province] = cityArr;
-				// 		}
-				// 		if(province === "全国"){
-				// 			allArea = {"全国":[]};
-				// 		}
-				// 	}
-				// }
+				if(area !== ""&&area !== undefined){
+					for(let province in area){
+			    		let citys = area[province];
+			    		if(citys.length===0){
+							allArea[province] = [];
+			    		}else{
+			    			allArea[province] = citys;
+			    		}
+			    	}
+					for(let province in vipArea){
+						let citys = vipArea[province];
+						if(allArea[province] === undefined){
+							allArea[province] = citys
+						}else{
+							if(checkObj(citys)){
+								allArea[province] = [];
+							}else{
+								let cityArr = [];
+								for(let i in citys){
+									cityArr.push(citys[i]);
+								}
+								for(let i in allArea[province]){
+									cityArr.push(allArea[province][i]);
+								}
+								//
+								for (var x = 0; x < cityArr.length; x++) {
+								    for (var j =x+1; j <cityArr.length; ) {
+								        if (cityArr[x] === cityArr[j]){
+								            cityArr.splice(j, 1);
+								        }
+								        else j++;
+								    }
+								}
+								//
+								allArea[province] = cityArr;
+							}
+						}
+						if(province === "全国"){
+							allArea = {"全国":[]};
+						}
+					}
+				}
 				if(buyArea !== ""&&buyArea !== undefined){
 					for(let province in buyArea){
 			    		let citys = buyArea[province];
@@ -838,24 +842,28 @@
 						if(allBuyArea[province] === undefined){
 							allBuyArea[province] = citys
 						}else{
-							let cityArr = [];
-							for(let i in citys){
-								cityArr.push(citys[i]);
-							}
-							for(let i in allBuyArea[province]){
-								cityArr.push(allBuyArea[province][i]);
+							if(checkObj(citys)){
+								allBuyArea[province] = [];
+							}else{
+								let cityArr = [];
+								for(let i in citys){
+									cityArr.push(citys[i]);
+								}
+								for(let i in allBuyArea[province]){
+									cityArr.push(allBuyArea[province][i]);
+								}
+								//
+								for (var x = 0; x < cityArr.length; x++) {
+									for (var j =x+1; j <cityArr.length; ) {
+										if (cityArr[x] === cityArr[j]){
+											cityArr.splice(j, 1);
+										}
+										else j++;
+									}
+								}
+								//
+								allBuyArea[province] = cityArr;
 							}
-							//
-							for (var x = 0; x < cityArr.length; x++) {
-					            for (var j =x+1; j <cityArr.length; ) {
-					                if (cityArr[x] === cityArr[j]){
-					                    cityArr.splice(j, 1);
-					                }
-					                else j++;
-					            }
-					       	}
-							//
-							allBuyArea[province] = cityArr;
 						}
 						if(province === "全国"){
 							allBuyArea = {"全国":[]};
@@ -1031,6 +1039,7 @@
 					oldYearPrice = ((monthprice / nowUpgrade) * 10).toFixed(1);
 				}
 			} else {
+				console.log(buyArea)
 				oldPrice = getsubVipOrderPrice(buyArea, buyIndustry, [nowUpgrade, 2])
 				oldMonthPrice = (oldPrice / nowUpgrade)
 				oldYearPrice = ((oldPrice / nowUpgrade) * 10).toFixed(1);
@@ -1062,10 +1071,15 @@
 				// price = addAreaPriceY + addAreaPriceM + oldAreaPriceY + oldAreaPriceM + addIndustryPriceY + addIndustryPriceM;
 				// ------- 升级价格交叉计算 ---------
 				// ------- 升级价格差价计算 ---------
-				let newPriceY = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgradeYear,1]);
-				let newPriceM = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgrade,2]);
-				let yearprice = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgradeYear,1]);
-				let monthprice = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgrade,2]);
+				let buyset = getBuySet(buyArea,buyIndustry)
+				// let newPriceY = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgradeYear,1]);
+				// let newPriceM = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgrade,2]);
+				// let yearprice = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgradeYear,1]);
+				// let monthprice = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgrade,2]);
+				let newPriceY = getsubVipOrderPriceBybuyset(areaObj(),[nowUpgradeYear,1]);
+				let newPriceM = getsubVipOrderPriceBybuyset(areaObj(),[nowUpgrade,2]);
+				let yearprice = getsubVipOrderPriceBybuyset(areaObj(),[nowUpgradeYear,1]);
+				let monthprice = getsubVipOrderPriceBybuyset(areaObj(),[nowUpgrade,2]);
 				price = newPriceY + newPriceM - oldPrice;
 				// ------- 升级延长周期价格计算 ---------
 				if(monthprice === 0){
@@ -1095,10 +1109,13 @@
 				// }
 				// price = addAreaPriceM + oldAreaPriceM + addIndustryPriceM;
 				// // ------- 升级价格交叉计算 ---------
-				let monthprice = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgrade,2]);
+				// let monthprice = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgrade,2]);
+				let monthprice = getsubVipOrderPriceBybuyset(areaObj(),[nowUpgrade,2]);
 				
 				// ------- 升级价格差价计算 ---------
-				let newPrice = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgrade,2]);
+				
+				// let newPrice = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgrade,2]);
+				let newPrice = getsubVipOrderPriceBybuyset(areaObj(),[nowUpgrade,2]);
 				price = newPrice - oldPrice;
 				// ------- 升级价格差价计算 ---------
 				// ------- 升级延长周期价格计算 ---------
@@ -1202,11 +1219,10 @@
             //
             let areaarr = buyArea;
         	let industryarr = buyIndustry;
-        	// let allAreaArr = allArea;
         	let allIndustryArr = allIndustry;
-        	// if(allAreaArr["全国"]){
-         //        allAreaArr={};
-         //    }
+        	if(allArea["全国"]){
+                allArea={};
+            }
         	if(allIndustryArr.length==1&&allIndustryArr[0]=="全部行业"){
                 allIndustryArr=[];
             }
@@ -1239,12 +1255,13 @@
 	    		"industryarr": industryarr.join(","),
 	    		// "allArea": JSON.stringify(allAreaArr),
 	    		"allIndustry": allIndustryArr.join(","),
-	    		"allBuyArea": JSON.stringify(allBuyArea),
+	    		"allBuyArea": JSON.stringify(allArea),
 	    		"payWay": "wx_js",
 	    		"pay_source" : "Upgrade",
 	    		"time": times,
 	    		"addCount":vipCount,
 	    		"addIndustryCount": vipIndustry,
+				"buyset":JSON.stringify(areaObj()),
 	    	}
 	    	console.log(param)
 	    	$DoPost("/subscribepay/renewUpgrade/renewUpgradeCreateOrder",param,function(r){
@@ -1326,6 +1343,40 @@
 	//     	}
 	//     	return areasObj
 	//     }
+	function areaObj(){
+		let buyset = getBuySet(buyArea,buyIndustry)
+		if(sessionStorage.vipSubSelectAreaAdd!==undefined&&sessionStorage.vipSubSelectAreaAdd!==""){
+			let addbuyset = JSON.parse(sessionStorage.vipSubSelectAreaAdd);
+			if(addbuyset.country !== -1){
+				if(addbuyset.province !== 0){
+					buyset.areacount = buyset.areacount + addbuyset.province;
+				}
+				if(!checkObj(addbuyset.city)){
+					let cityArr = addbuyset.city
+					for(var i in cityArr){
+						let citysArr = buyset.citys
+						if(citysArr[i] !== undefined){
+							citysArr[i] = citysArr[i] + cityArr[i]
+						}else{
+							citysArr[i] = cityArr[i];
+						}
+					}
+				}
+			}else{
+				buyset.areacount = -1;
+				buyset.citys = {};
+			}
+		}
+		if(sessionStorage.vipSubSelectIndustryAdd!==undefined){
+			var addindustrys = JSON.parse(sessionStorage.vipSubSelectIndustryAdd);
+			if(addindustrys.length === 1 && addindustrys[0] === "全部行业"){
+				buyset.buyerclasscount = -1;
+			}else{
+				buyset.buyerclasscount = buyset.buyerclasscount + addindustrys.length;
+			}
+		}
+		return buyset
+	}
 	    
     </script>
 </body>