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

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

zhangxinlei1996 5 жил өмнө
parent
commit
6f5388d608
33 өөрчлөгдсөн 522 нэмэгдсэн , 2296 устгасан
  1. 2 1
      src/jfw/front/front.go
  2. 4 3
      src/jfw/front/pchelper.go
  3. 25 5
      src/jfw/front/swordfish.go
  4. 1 1
      src/jfw/modules/pushsubscribe/src/push/config.json
  5. 1 1
      src/jfw/modules/pushsubscribe/src/push/job/pushjob.go
  6. BIN
      src/jfw/modules/pushsubscribe/src/push/push
  7. 4 2
      src/jfw/modules/pushsubscribe/src/push/pusher/normalpush.go
  8. 2 0
      src/jfw/modules/pushsubscribe/src/push/util/db.go
  9. 1 1
      src/jfw/modules/pushsubscribe/src/push/util/entity.go
  10. 78 12
      src/jfw/modules/pushsubscribe/src/push/util/util.go
  11. 56 106
      src/jfw/modules/subscribepay/src/entity/subscribeVip.go
  12. 6 111
      src/jfw/modules/subscribepay/src/service/index_p1.go
  13. 113 161
      src/jfw/modules/subscribepay/src/service/vipRenewUpgrade.go
  14. 0 2
      src/jfw/modules/subscribepay/src/service/vipSubscribeEdit.go
  15. 14 3
      src/jfw/modules/subscribepay/src/service/vipSubscribePay.go
  16. 1 2
      src/jfw/modules/subscribepay/src/service/vipSubscribeTrial.go
  17. 2 0
      src/jfw/public/db.go
  18. 0 601
      src/jfw/public/historypush.go
  19. 5 7
      src/jfw/qrmanager/qrmanager.go
  20. 2 1
      src/seo.json
  21. 9 4
      src/web/staticres/dataExport/css/previewData.css
  22. 1 1
      src/web/staticres/js/login.js
  23. 10 0
      src/web/staticres/vipsubscribe/js/common.js
  24. 6 4
      src/web/staticres/vipsubscribe/js/updateArea.js
  25. 55 60
      src/web/templates/weixin/dataExport/dataExport_previewData.html
  26. 1 1
      src/web/templates/weixin/search/mainSearch.html
  27. 0 881
      src/web/templates/weixin/vipsubscribe/choose_area_upgrades.html
  28. 3 3
      src/web/templates/weixin/vipsubscribe/choose_industry_upgrade.html
  29. 1 1
      src/web/templates/weixin/vipsubscribe/keyWord.html
  30. 17 51
      src/web/templates/weixin/vipsubscribe/renew_notice.html
  31. 48 27
      src/web/templates/weixin/vipsubscribe/renew_pay.html
  32. 1 28
      src/web/templates/weixin/vipsubscribe/vip_purchase.html
  33. 53 215
      src/web/templates/weixin/vipsubscribe/vip_upgrade.html

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

@@ -61,6 +61,7 @@ type Front struct {
 	feedback           xweb.Mapper `xweb:"/swordfish/feedback"`   //意见反馈
 	feedback           xweb.Mapper `xweb:"/swordfish/feedback"`   //意见反馈
 	wxpushAjaxReq      xweb.Mapper `xweb:"/wxpush/bid/ajaxReq"`
 	wxpushAjaxReq      xweb.Mapper `xweb:"/wxpush/bid/ajaxReq"`
 	newSordfish        xweb.Mapper `xweb:"/"`                                  //剑鱼标讯pc首页
 	newSordfish        xweb.Mapper `xweb:"/"`                                  //剑鱼标讯pc首页
+	newSordfishC       xweb.Mapper `xweb:"/pcindex.html"`                      //剑鱼标讯pc首页-统计
 	searchinfolist     xweb.Mapper `xweb:"/swordfish/searchinfolist(.*).html"` //剑鱼标讯pc查询
 	searchinfolist     xweb.Mapper `xweb:"/swordfish/searchinfolist(.*).html"` //剑鱼标讯pc查询
 	about              xweb.Mapper `xweb:"/swordfish/about"`
 	about              xweb.Mapper `xweb:"/swordfish/about"`
 	shareabout         xweb.Mapper `xweb:"/swordfish/shareabout/([^.]*)"`
 	shareabout         xweb.Mapper `xweb:"/swordfish/shareabout/([^.]*)"`
@@ -1461,7 +1462,7 @@ func (f *Front) Msgremind() error {
 			if i_vip_status == 2 {
 			if i_vip_status == 2 {
 				return f.Redirect("/front/vipsubscribe/toSetPage")
 				return f.Redirect("/front/vipsubscribe/toSetPage")
 			} else {
 			} else {
-				return f.Redirect("/weixin/pay/vipsubscribe_willExpire")
+				return f.Redirect("/weixin/pay/vipsubscribe_new")
 			}
 			}
 		} else if t == "soonexprie" || t == "expried" {
 		} else if t == "soonexprie" || t == "expried" {
 			now_unix := time.Now().Unix()
 			now_unix := time.Now().Unix()

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

@@ -9,6 +9,7 @@ import (
 	"log"
 	"log"
 	"net/url"
 	"net/url"
 	"qfw/util"
 	"qfw/util"
+	"qfw/util/jy"
 	"qfw/util/redis"
 	"qfw/util/redis"
 	"strings"
 	"strings"
 	"time"
 	"time"
@@ -310,7 +311,7 @@ func (l *PcHelper) ToPushView() error {
 	defer util.Catch()
 	defer util.Catch()
 	userid := util.ObjToString(l.GetSession("userId"))
 	userid := util.ObjToString(l.GetSession("userId"))
 	if userid != "" {
 	if userid != "" {
-		user, _ := public.HistoryPush.UserInfo(userid)
+		user, _ := jy.SubscribePush.UserInfo(public.MQFW, userid)
 		var o_jy map[string]interface{}
 		var o_jy map[string]interface{}
 		if user != nil {
 		if user != nil {
 			o_jy, _ = (*user)["o_jy"].(map[string]interface{})
 			o_jy, _ = (*user)["o_jy"].(map[string]interface{})
@@ -343,9 +344,9 @@ func (l *PcHelper) PushView() error {
 	res := map[string]interface{}{}
 	res := map[string]interface{}{}
 	res["hasNextPage"] = false
 	res["hasNextPage"] = false
 	if userid != "" {
 	if userid != "" {
-		user, _ := public.HistoryPush.UserInfo(userid)
+		user, _ := jy.SubscribePush.UserInfo(public.MQFW, userid)
 		if user != nil {
 		if user != nil {
-			hasNextPage, list := public.HistoryPush.Datas_Mysql(userid, pageNum, "", "")
+			hasNextPage, list := jy.SubscribePush.Datas(public.MQFW, public.PushMysql, userid, pageNum, "", "")
 			//hasNextPage, list, _ := public.HistoryPush.Datas(userid, pageNum, firstPushTime, "")
 			//hasNextPage, list, _ := public.HistoryPush.Datas(userid, pageNum, firstPushTime, "")
 			res["hasNextPage"] = hasNextPage
 			res["hasNextPage"] = hasNextPage
 			res["data"] = &list
 			res["data"] = &list

+ 25 - 5
src/jfw/front/swordfish.go

@@ -76,6 +76,26 @@ func (m *Front) Praise() error {
 	return nil
 	return nil
 }
 }
 
 
+//剑鱼标讯pc首页-统计
+func (m *Front) NewSordfishC() error {
+	var shareid = m.GetString("id")
+	if len(shareid) == 0 {
+		shareid = "10" //fmt.Sprintf("%s%d", config.Seoconfig["jysy"].(string)+fmt.Sprintf("%d", time.Now().UnixNano())[8:14], rand.Intn(9))
+	} else {
+		redis.Del("other", "jypcindex")
+	}
+	m.T["logid"] = config.Seoconfig["jysy"].(string)
+	m.T["shareid"] = se.EncodeString(shareid)
+	if ret := redis.Get("other", "jypcindex"); ret != nil {
+		return m.SetBody([]byte(ret.(string)))
+	} else {
+		m.DisableHttpCache()
+		content, _ := m.Render4Cache("/pc/index.html", &m.T)
+		redis.Put("other", "jypcindex", string(content), 60*60*2)
+		return m.SetBody(content)
+	}
+}
+
 //剑鱼标讯pc首页
 //剑鱼标讯pc首页
 func (m *Front) NewSordfish() error {
 func (m *Front) NewSordfish() error {
 	ispc, _ := m.GetInteger("ispc")
 	ispc, _ := m.GetInteger("ispc")
@@ -1550,7 +1570,7 @@ func (m *Front) WxpushAjaxReq() error {
 	userId := util.ObjToString(m.GetSession("userId"))
 	userId := util.ObjToString(m.GetSession("userId"))
 	if userId != "" {
 	if userId != "" {
 		vsid := m.GetString("vsid")
 		vsid := m.GetString("vsid")
-		public.HistoryPush.Visit_Mysql(userId, vsid)
+		jy.SubscribePush.Visit(public.PushMysql, userId, vsid)
 	}
 	}
 	return nil
 	return nil
 }
 }
@@ -2366,7 +2386,7 @@ func (f *Front) HasPushHistory() {
 	if userId == "" {
 	if userId == "" {
 		return
 		return
 	}
 	}
-	user, _ := public.HistoryPush.UserInfo(userId)
+	user, _ := jy.SubscribePush.UserInfo(public.MQFW, userId)
 	hasKeyFlag := false
 	hasKeyFlag := false
 	isVipFlag := false
 	isVipFlag := false
 	isPassCount := false
 	isPassCount := false
@@ -2427,9 +2447,9 @@ func (f *Front) HasPushHistory() {
 		pageNum = 1
 		pageNum = 1
 	}
 	}
 	area := f.GetString("area")
 	area := f.GetString("area")
-	hasNextPage, list := public.HistoryPush.Datas_Mysql(userId, pageNum, formatTime, area)
+	hasNextPage, list := jy.SubscribePush.Datas(public.MQFW, public.PushMysql, userId, pageNum, formatTime, area)
 	if hasKeyFlag && len(list) == 0 && formatTime == "" && !isVipFlag {
 	if hasKeyFlag && len(list) == 0 && formatTime == "" && !isVipFlag {
-		flag, data := public.HistoryPush.MakeHistoryDatas(userId, bidSearch_field_1)
+		flag, data := jy.SubscribePush.MakeHistoryDatas(public.MQFW, public.PushMysql, userId, public.PushView)
 		if flag && data != nil {
 		if flag && data != nil {
 			jsonBytes, err := json.Marshal(data)
 			jsonBytes, err := json.Marshal(data)
 			err = json.Unmarshal(jsonBytes, &list)
 			err = json.Unmarshal(jsonBytes, &list)
@@ -2517,7 +2537,7 @@ func (f *Front) HistorypushPaging() error {
 		//		if user == nil {
 		//		if user == nil {
 		//			return nil
 		//			return nil
 		//		}
 		//		}
-		hasNextPage, list := public.HistoryPush.Datas_Mysql(userId, pageNum, formatTime, area)
+		hasNextPage, list := jy.SubscribePush.Datas(public.MQFW, public.PushMysql, userId, pageNum, formatTime, area)
 		//		hasNextPage, list, _ := public.HistoryPush.Datas(userId, pageNum, firstPushTime, formatTime)
 		//		hasNextPage, list, _ := public.HistoryPush.Datas(userId, pageNum, firstPushTime, formatTime)
 		f.ServeJson(map[string]interface{}{
 		f.ServeJson(map[string]interface{}{
 			"hasNextPage": hasNextPage,
 			"hasNextPage": hasNextPage,

+ 1 - 1
src/jfw/modules/pushsubscribe/src/push/config.json

@@ -48,7 +48,7 @@
 	"maxPushSize":50,
 	"maxPushSize":50,
 	"vipMaxPushSize":2000,
 	"vipMaxPushSize":2000,
 	"maxRelationProject":10000,
 	"maxRelationProject":10000,
-	"testids":["5ddf31ae61fd001ed85c8f9d"],
+	"testids":["5d81c5a525ef8723ac0036f9"],
 	"weixinRpcServer":"127.0.0.1:8083",
 	"weixinRpcServer":"127.0.0.1:8083",
 	"wxColor":"#2cb7ca",
 	"wxColor":"#2cb7ca",
 	"wxGroup":"招标信息",
 	"wxGroup":"招标信息",

+ 1 - 1
src/jfw/modules/pushsubscribe/src/push/job/pushjob.go

@@ -135,7 +135,7 @@ func (p *PushJob) doPush(pusher Pusher, taskType int, pushWay *putil.PushWay, u
 		<-p.minutePushPool //正常期
 		<-p.minutePushPool //正常期
 	}
 	}
 	pushParam := pusher.GetPushParam(pushWay.MailPush, u, sl)
 	pushParam := pusher.GetPushParam(pushWay.MailPush, u, sl)
-	if pushParam.InfosLength == 0 {
+	if pushParam == nil || pushParam.InfosLength == 0 {
 		logger.Info("推送任务", taskType, "没有要推送的数据!", u.Id)
 		logger.Info("推送任务", taskType, "没有要推送的数据!", u.Id)
 		return
 		return
 	}
 	}

BIN
src/jfw/modules/pushsubscribe/src/push/push


+ 4 - 2
src/jfw/modules/pushsubscribe/src/push/pusher/normalpush.go

@@ -101,9 +101,11 @@ func (n *NormalPush) AfterPush(pushResult *putil.PushResult, u *UserInfo, user m
 }
 }
 func (n *NormalPush) GetPushParam(mailPush bool, u *UserInfo, sl *SortList) *putil.PushParam {
 func (n *NormalPush) GetPushParam(mailPush bool, u *UserInfo, sl *SortList) *putil.PushParam {
 	dayCountKey := DayCountKey(u.Id)
 	dayCountKey := DayCountKey(u.Id)
-	onceCountKey := OnceCountKey(u.Id)
 	dayCount := redis.GetInt(Pushcache_2_a, dayCountKey)
 	dayCount := redis.GetInt(Pushcache_2_a, dayCountKey)
 	isVipUser := IsVipUser(u.VipStatus)
 	isVipUser := IsVipUser(u.VipStatus)
+	if isVipUser && dayCount >= Config.VipMaxPushSize {
+		return nil
+	}
 	pushParam := putil.NewPushParam(true, dayCount, mailPush, u, sl)
 	pushParam := putil.NewPushParam(true, dayCount, mailPush, u, sl)
 	if pushParam.InfosLength == 0 {
 	if pushParam.InfosLength == 0 {
 		return pushParam
 		return pushParam
@@ -112,7 +114,7 @@ func (n *NormalPush) GetPushParam(mailPush bool, u *UserInfo, sl *SortList) *put
 	pushParam.PushDate = putil.SaveToPushsubscribe(isVipUser, false, u.Id, &pushParam.Infos)
 	pushParam.PushDate = putil.SaveToPushsubscribe(isVipUser, false, u.Id, &pushParam.Infos)
 	if pushParam.PushDate > 0 {
 	if pushParam.PushDate > 0 {
 		redis.Put(Pushcache_2_a, dayCountKey, dayCount+pushParam.InfosLength, OneDaySecond)
 		redis.Put(Pushcache_2_a, dayCountKey, dayCount+pushParam.InfosLength, OneDaySecond)
-		redis.Put(Pushcache_2_a, onceCountKey, pushParam.InfosLength, OneDaySecond)
+		redis.Put(Pushcache_2_a, OnceCountKey(u.Id), pushParam.InfosLength, OneDaySecond)
 		for _, v := range pushParam.Infos {
 		for _, v := range pushParam.Infos {
 			redis.Put(Pushcache_2_a, PushInfoKey(u.Id, util.ObjToString((*v.Info)["_id"])), 1, OneDaySecond)
 			redis.Put(Pushcache_2_a, PushInfoKey(u.Id, util.ObjToString((*v.Info)["_id"])), 1, OneDaySecond)
 		}
 		}

+ 2 - 0
src/jfw/modules/pushsubscribe/src/push/util/db.go

@@ -4,6 +4,7 @@ import (
 	"log"
 	"log"
 	. "public"
 	. "public"
 	. "push/config"
 	. "push/config"
+	"qfw/util/jy"
 	"qfw/util/mongodb"
 	"qfw/util/mongodb"
 	"qfw/util/mongodbutil"
 	"qfw/util/mongodbutil"
 	"qfw/util/mysql"
 	"qfw/util/mysql"
@@ -36,4 +37,5 @@ func init() {
 	}
 	}
 	Mysql.Init()
 	Mysql.Init()
 	log.Println("mysql初始化完成!")
 	log.Println("mysql初始化完成!")
+	jy.PushMapping.Init(Mysql)
 }
 }

+ 1 - 1
src/jfw/modules/pushsubscribe/src/push/util/entity.go

@@ -76,13 +76,13 @@ type PushParam struct {
 }
 }
 
 
 func NewPushParam(isLimit bool, dayCount int, mailPush bool, u *UserInfo, sl *SortList) *PushParam {
 func NewPushParam(isLimit bool, dayCount int, mailPush bool, u *UserInfo, sl *SortList) *PushParam {
+	isVipUser := IsVipUser(u.VipStatus)
 	mailContent := ""
 	mailContent := ""
 	jpushTitle := ""
 	jpushTitle := ""
 	lastInfoDate := int64(0)
 	lastInfoDate := int64(0)
 	titleArray := []string{}
 	titleArray := []string{}
 	infos := []*MatchInfo{}
 	infos := []*MatchInfo{}
 	infosLength := 0
 	infosLength := 0
-	isVipUser := IsVipUser(u.VipStatus)
 	for _, ks := range *sl {
 	for _, ks := range *sl {
 		infosLength++
 		infosLength++
 		dayCount++
 		dayCount++

+ 78 - 12
src/jfw/modules/pushsubscribe/src/push/util/util.go

@@ -5,6 +5,7 @@ import (
 	. "public"
 	. "public"
 	. "push/config"
 	. "push/config"
 	"qfw/util"
 	"qfw/util"
+	"qfw/util/jy"
 	"qfw/util/mongodb"
 	"qfw/util/mongodb"
 	"sort"
 	"sort"
 	"strings"
 	"strings"
@@ -155,29 +156,62 @@ func SaveToPushsubscribe(isVipUser, isProjectInfo bool, userId string, matchInfo
 	unix := time.Now().Unix()
 	unix := time.Now().Unix()
 	length := len(*matchInfos)
 	length := len(*matchInfos)
 	fields := []string{"userid", "infoid", "date", "matchkeys", "area", "city", "buyerclass", "type", "isvip", "toptype", "subtype"}
 	fields := []string{"userid", "infoid", "date", "matchkeys", "area", "city", "buyerclass", "type", "isvip", "toptype", "subtype"}
-	var savecount int64
+	var saveCount int64
 	batchSize := 0
 	batchSize := 0
 	values := []interface{}{}
 	values := []interface{}{}
-	for i := len(*matchInfos) - 1; i >= 0; i-- {
+	var subPush_datas = make([]*jy.SubPushList, length)
+	k := length - 1
+	for i := length - 1; i >= 0; i-- {
 		matchInfo := (*matchInfos)[i]
 		matchInfo := (*matchInfos)[i]
-		values = append(values, userId, util.ObjToString((*matchInfo.Info)["_id"]), unix)
+		_id := util.ObjToString((*matchInfo.Info)["_id"])
+		//
+		pushCa := &jy.PushCa{
+			Date:   unix,
+			InfoId: _id,
+			Keys:   matchInfo.Keys,
+		}
+		if isVipUser {
+			pushCa.Isvip = 1
+		}
+		if isProjectInfo {
+			pushCa.Type = 1
+		}
+		subPush_datas[i] = jy.SubscribePush.InfoFormat(pushCa, &(*matchInfo.Info))
+		//
+		values = append(values, userId, _id, unix)
 		if len(matchInfo.Keys) > 0 {
 		if len(matchInfo.Keys) > 0 {
 			values = append(values, strings.Join(matchInfo.Keys, " "))
 			values = append(values, strings.Join(matchInfo.Keys, " "))
 		} else {
 		} else {
 			values = append(values, nil)
 			values = append(values, nil)
 		}
 		}
 		if area := util.ObjToString((*matchInfo.Info)["area"]); area != "" {
 		if area := util.ObjToString((*matchInfo.Info)["area"]); area != "" {
-			values = append(values, area)
+			if area == "全国" {
+				values = append(values, 0)
+			} else {
+				if area_mapping, ok := jy.PushMapping.Area[area]; ok {
+					values = append(values, area_mapping)
+				} else {
+					values = append(values, nil)
+				}
+			}
 		} else {
 		} else {
 			values = append(values, nil)
 			values = append(values, nil)
 		}
 		}
 		if city := util.ObjToString((*matchInfo.Info)["city"]); city != "" {
 		if city := util.ObjToString((*matchInfo.Info)["city"]); city != "" {
-			values = append(values, city)
+			if city_mapping, ok := jy.PushMapping.City[city]; ok {
+				values = append(values, city_mapping)
+			} else {
+				values = append(values, nil)
+			}
 		} else {
 		} else {
 			values = append(values, nil)
 			values = append(values, nil)
 		}
 		}
 		if buyerclass := util.ObjToString((*matchInfo.Info)["buyerclass"]); buyerclass != "" {
 		if buyerclass := util.ObjToString((*matchInfo.Info)["buyerclass"]); buyerclass != "" {
-			values = append(values, buyerclass)
+			if buyerclass_mapping, ok := jy.PushMapping.Buyerclass[buyerclass]; ok {
+				values = append(values, buyerclass_mapping)
+			} else {
+				values = append(values, nil)
+			}
 		} else {
 		} else {
 			values = append(values, nil)
 			values = append(values, nil)
 		}
 		}
@@ -192,26 +226,58 @@ func SaveToPushsubscribe(isVipUser, isProjectInfo bool, userId string, matchInfo
 			values = append(values, nil)
 			values = append(values, nil)
 		}
 		}
 		if toptype := util.ObjToString((*matchInfo.Info)["toptype"]); toptype != "" {
 		if toptype := util.ObjToString((*matchInfo.Info)["toptype"]); toptype != "" {
-			values = append(values, toptype)
+			if toptype_mapping, ok := jy.PushMapping.Toptype[toptype]; ok {
+				values = append(values, toptype_mapping)
+			} else {
+				values = append(values, nil)
+			}
 		} else {
 		} else {
 			values = append(values, nil)
 			values = append(values, nil)
 		}
 		}
 		if subtype := util.ObjToString((*matchInfo.Info)["subtype"]); subtype != "" {
 		if subtype := util.ObjToString((*matchInfo.Info)["subtype"]); subtype != "" {
-			values = append(values, subtype)
+			if subtype_mapping, ok := jy.PushMapping.Subtype[subtype]; ok {
+				values = append(values, subtype_mapping)
+			} else {
+				values = append(values, nil)
+			}
 		} else {
 		} else {
 			values = append(values, nil)
 			values = append(values, nil)
 		}
 		}
 		batchSize++
 		batchSize++
 		if i == 0 || batchSize == BigBulkSize {
 		if i == 0 || batchSize == BigBulkSize {
-			savecount += Mysql.InsertBatch("pushsubscribe", fields, values)
+			count, lastId := Mysql.InsertBatch("pushsubscribe", fields, values)
+			saveCount += count
+			var this_k int64
+			for k >= 0 {
+				subPush_datas[k].Ca_index = lastId + this_k
+				k--
+				this_k++
+				if this_k == count {
+					break
+				}
+			}
 			batchSize = 0
 			batchSize = 0
 			values = []interface{}{}
 			values = []interface{}{}
 		}
 		}
 	}
 	}
-	if int(savecount) != length {
-		logger.Error(userId, "批量保存有问题", length, savecount)
+	if int(saveCount) != length {
+		logger.Error(userId, "批量保存有问题", length, saveCount)
+	}
+	//更新redis
+	subPush, err := jy.SubscribePush.Get(userId)
+	if err == nil && subPush != nil {
+		if nowymd := util.NowFormat(util.Date_Short_Layout); subPush.Date != nowymd {
+			subPush = &jy.SubPush{
+				Date:  nowymd,
+				Datas: subPush_datas,
+			}
+		} else {
+			subPush_datas = append(subPush_datas, subPush.Datas...)
+			subPush.Datas = subPush_datas
+		}
+		jy.SubscribePush.Put(userId, subPush)
 	}
 	}
-	if savecount == 0 {
+	if saveCount == 0 {
 		return 0
 		return 0
 	}
 	}
 	return unix
 	return unix

+ 56 - 106
src/jfw/modules/subscribepay/src/entity/subscribeVip.go

@@ -370,44 +370,59 @@ func (this *vipSubscribeStruct) SaveSelectLog(userId, openId string, msg *VipSim
 }
 }
 
 
 //计算价格
 //计算价格
+// area具体省市名称
+//industry 具体行业
+//count 时间长度  unit 时间单位
 func (this *vipSubscribeStruct) GetSubVipPrice(area *map[string]interface{}, industry []string, count, unit int) int {
 func (this *vipSubscribeStruct) GetSubVipPrice(area *map[string]interface{}, industry []string, count, unit int) int {
+	industryNum := len(industry)     //行业数量
+	pCount := -1                     //省份数量
+	cityCountMap := map[string]int{} //购买省份中城市数量
+	if len(*area) > 0 {
+		pCount = 0
+		for k, v := range *area {
+			tmp := v.([]interface{})
+			if len(tmp) == 0 { //省份
+				pCount++
+			} else { //城市
+				cityCountMap[k] = len(tmp)
+			}
+		}
+	}
+	return this.GetSubVipPriceByBuySet(cityCountMap, pCount, industryNum, count, unit, true)
+}
+
+//cityCountMap 选择城市数量
+//pCount 选择省份数量  pCount:-1 (全国)
+//industryNum 选择行业数量
+//count 时间长度  unit 时间单位
+//isDiscount 测试环境是否打折
+func (this *vipSubscribeStruct) GetSubVipPriceByBuySet(cityCountMap map[string]int, pCount, industryNum, count, unit int, isDiscount bool) int {
 	payMoney := func() int {
 	payMoney := func() int {
+		//城市选择过多时,转为省份
+		newCityMap := map[string]int{}//防止操作cityCountMap 影响原数据
+		for cityName, cityCount := range cityCountMap {
+			if cityCount > SubVipPrice.CityMaxCount {
+				pCount++
+			} else {
+				newCityMap[cityName] = cityCount
+			}
+		}
+		//
+		if industryNum == -1 {
+			industryNum = 0
+		}
 		//当行业数量大于最大值SubVipPrice.BuyerClassMaxCount 按照全行业计算
 		//当行业数量大于最大值SubVipPrice.BuyerClassMaxCount 按照全行业计算
-		industryNum := len(industry)
 		if industryNum > SubVipPrice.BuyerClassMaxCount {
 		if industryNum > SubVipPrice.BuyerClassMaxCount {
 			industryNum = 0
 			industryNum = 0
 		}
 		}
-		//计算地区数量
-		pCount := -1                     //省份数量
-		cityCountMap := map[string]int{} //购买省份中城市数量
-
-		if len(*area) != 0 {
-			pCount = 0
-			for k, v := range *area {
-				tmp := v.([]interface{})
-				if len(tmp) == 0 { //省份
-					pCount++
-				} else { //城市
-					//当城市数量大于最大值时,按照全省计算
-					if len(tmp) > SubVipPrice.CityMaxCount {
-						pCount++
-					} else {
-						cityCountMap[k] = len(tmp)
-					}
-				}
-			}
+		//当选择月份大于  按照全年计算
+		if count > SubVipPrice.MonthMaxCount && unit == 2 { //月份十个月以上价格一样
+			count = 10
 		}
 		}
-
 		//当省份数量大于SubVipPrice.ProvinceMaxCount 按照全国计算
 		//当省份数量大于SubVipPrice.ProvinceMaxCount 按照全国计算
 		if pCount > SubVipPrice.ProvinceMaxCount {
 		if pCount > SubVipPrice.ProvinceMaxCount {
 			pCount = -1
 			pCount = -1
 		}
 		}
-
-		//当选择月份大于  按照全年计算
-		if count > SubVipPrice.MonthMaxCount && unit == 2 { //月份十个月以上价格一样
-			count = 10
-		}
-
 		if pCount == -1 { //计算全国套餐价格
 		if pCount == -1 { //计算全国套餐价格
 			if industryNum == 1 {
 			if industryNum == 1 {
 				return getSetMealPrice(0, 1, unit) * count //全国1行业套餐
 				return getSetMealPrice(0, 1, unit) * count //全国1行业套餐
@@ -417,10 +432,9 @@ func (this *vipSubscribeStruct) GetSubVipPrice(area *map[string]interface{}, ind
 				return getSetMealPrice(0, industryNum, unit) * count //全国多行业套餐
 				return getSetMealPrice(0, industryNum, unit) * count //全国多行业套餐
 			}
 			}
 		}
 		}
-
 		//计算非全国套餐
 		//计算非全国套餐
-		finalPrice := 0 //省份价格
-		for _, cityCount := range cityCountMap {
+		finalPrice := 0
+		for _, cityCount := range newCityMap {
 			thisPrice := 0
 			thisPrice := 0
 			if cityCount == 1 { //单城市
 			if cityCount == 1 { //单城市
 				thisPrice = getSetMealPrice(2, industryNum, unit) * count
 				thisPrice = getSetMealPrice(2, industryNum, unit) * count
@@ -428,16 +442,10 @@ func (this *vipSubscribeStruct) GetSubVipPrice(area *map[string]interface{}, ind
 				if industryNum == 0 || industryNum == 1 { //多城市 单行业
 				if industryNum == 0 || industryNum == 1 { //多城市 单行业
 					thisPrice = cityCount * getSetMealPrice(2, industryNum, unit) * count
 					thisPrice = cityCount * getSetMealPrice(2, industryNum, unit) * count
 				} else { //多城市 多行业
 				} else { //多城市 多行业
-					//industryPrice := SubVipPrice.BuyerClassPrice * industryNum
-					//cityPrice := SubVipPrice.CityPrice * cityCount
-					//thisPrice = (industryPrice + cityPrice) * count
 					if cityCount > SubVipPrice.CityMaxCount {
 					if cityCount > SubVipPrice.CityMaxCount {
 						pCount++
 						pCount++
 					} else {
 					} else {
 						thisPrice = getSetMealPrice(2, industryNum, unit) * cityCount * count
 						thisPrice = getSetMealPrice(2, industryNum, unit) * cityCount * count
-						//						if unit == 1 { //年
-						//							thisPrice *= 10
-						//						}
 					}
 					}
 				}
 				}
 			}
 			}
@@ -446,80 +454,22 @@ func (this *vipSubscribeStruct) GetSubVipPrice(area *map[string]interface{}, ind
 		finalPrice += pCount * getSetMealPrice(1, industryNum, unit) * count
 		finalPrice += pCount * getSetMealPrice(1, industryNum, unit) * count
 		return finalPrice
 		return finalPrice
 	}()
 	}()
-	if SubVipPrice.Discount < 1 {
-		//测试环境修改金额
-		log.Printf("进行折扣计算 折扣前金额%d\n", payMoney)
-		tmp := float64(payMoney) * SubVipPrice.Discount
-		if tmp < 1 {
-			if tmp != 0 {
-				payMoney = 1
-			}
-		} else {
-			payMoney = int(tmp)
-		}
-		log.Printf("进行折扣计算 折扣后金额%d\n", payMoney)
-	}
-	return payMoney
-}
-
-//计算价格
-func (this *vipSubscribeStruct) GetSubVipBuysetPrice(buyset *map[string]interface{}, count, unit int) int {
-	industryNum := qutil.IntAll((*buyset)["buyerclasscount"])
-	if industryNum == -1 {
-		industryNum = 0
-	}
-	//当行业数量大于最大值SubVipPrice.BuyerClassMaxCount 按照全行业计算
-	//		industryNum := len(industry)
-	if industryNum > SubVipPrice.BuyerClassMaxCount {
-		industryNum = 0
-	}
-	//计算地区数量
-	pCount := qutil.IntAll((*buyset)["areacount"]) //省份数量
-	//		cityCountMap := map[string]int{}               //购买省份中城市数量
-	//当省份数量大于SubVipPrice.ProvinceMaxCount 按照全国计算
-	if pCount > SubVipPrice.ProvinceMaxCount {
-		pCount = -1
-	}
-	//当选择月份大于  按照全年计算
-	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
+	if isDiscount {
+		if SubVipPrice.Discount < 1 {
+			//测试环境修改金额
+			log.Printf("进行折扣计算 折扣前金额%d\n", payMoney)
+			tmp := float64(payMoney) * SubVipPrice.Discount
+			if tmp < 1 {
+				if tmp != 0 {
+					payMoney = 1
 				}
 				}
+			} else {
+				payMoney = int(tmp)
 			}
 			}
+			log.Printf("进行折扣计算 折扣后金额%d\n", payMoney)
 		}
 		}
-		finalPrice += thisPrice
 	}
 	}
-	finalPrice += pCount * getSetMealPrice(1, industryNum, unit) * count
-	return finalPrice
+	return payMoney
 }
 }
 
 
 /*
 /*

+ 6 - 111
src/jfw/modules/subscribepay/src/service/index_p1.go

@@ -13,8 +13,6 @@ import (
 	"time"
 	"time"
 	"util"
 	"util"
 
 
-	"gopkg.in/mgo.v2/bson"
-
 	"github.com/go-xweb/xweb"
 	"github.com/go-xweb/xweb"
 )
 )
 
 
@@ -69,7 +67,7 @@ func (this *IndexSearch) GetIndexMessage() {
 			o_msgset := qutil.ObjToMap((*userMap)["o_vipjy"])
 			o_msgset := qutil.ObjToMap((*userMap)["o_vipjy"])
 			vip_items, ok := (*o_msgset)["a_items"].([]interface{})
 			vip_items, ok := (*o_msgset)["a_items"].([]interface{})
 			//vip查询推送历史
 			//vip查询推送历史
-			result := getPushHistory(userId)
+			_, result := jy.SubscribePush.Datas(util.MQFW, util.PushMysql, userId, 1, "", "")
 			return &entity.FuncResult{true, nil, map[string]interface{}{
 			return &entity.FuncResult{true, nil, map[string]interface{}{
 				"isVip":        true,                     //是否是vip用户
 				"isVip":        true,                     //是否是vip用户
 				"hasSubscribe": ok && len(vip_items) > 0, //是否有订阅词
 				"hasSubscribe": ok && len(vip_items) > 0, //是否有订阅词
@@ -82,7 +80,7 @@ func (this *IndexSearch) GetIndexMessage() {
 		items, ok := (*o_msgset)["a_key"].([]interface{})
 		items, ok := (*o_msgset)["a_key"].([]interface{})
 		if ok && len(items) > 0 {
 		if ok && len(items) > 0 {
 			//普通用户查询推送历史
 			//普通用户查询推送历史
-			result := getPushHistory(userId)
+			_, result := jy.SubscribePush.Datas(util.MQFW, util.PushMysql, userId, 1, "", "")
 			return &entity.FuncResult{true, nil, map[string]interface{}{
 			return &entity.FuncResult{true, nil, map[string]interface{}{
 				"isVip":        false,                //是否是vip用户
 				"isVip":        false,                //是否是vip用户
 				"hasSubscribe": ok && len(items) > 0, //是否有订阅词
 				"hasSubscribe": ok && len(items) > 0, //是否有订阅词
@@ -294,120 +292,17 @@ func getSimpleSql(city string, history []string) string {
 }
 }
 
 
 //查询查询推送记录
 //查询查询推送记录
-func getPushHistory(userId string) (result []map[string]interface{}) {
+func getPushHistory(userId string) (result []*jy.SubPushList) {
 	if userId == "" {
 	if userId == "" {
 		return
 		return
 	}
 	}
 	findSQL := "select * from pushsubscribe where userid = '" + userId + "'  and date >= %d order by id desc limit 50"
 	findSQL := "select * from pushsubscribe where userid = '" + userId + "'  and date >= %d order by id desc limit 50"
 	list := util.PushMysql.SelectBySql(fmt.Sprintf(findSQL, time.Now().AddDate(0, 0, -7).Unix()))
 	list := util.PushMysql.SelectBySql(fmt.Sprintf(findSQL, time.Now().AddDate(0, 0, -7).Unix()))
 	if len(*list) > 0 {
 	if len(*list) > 0 {
-		pushCas := getJyPushs(*list)
-		result = getInfoByIds(pushCas)
+		pushCas := jy.SubscribePush.GetJyPushs(*list)
+		result = jy.SubscribePush.GetInfoByIds(util.MQFW, pushCas)
 	} else {
 	} else {
-		result = []map[string]interface{}{}
-	}
-	return
-}
-
-func getJyPushs(datas []map[string]interface{}) (pushCas []*jy.PushCa) {
-	pushCas = []*jy.PushCa{}
-	for _, v := range datas {
-		pushCas = append(pushCas, &jy.PushCa{
-			Date:       qutil.Int64All(v["date"]),
-			InfoId:     qutil.ObjToString(v["infoid"]),
-			Visit:      qutil.IntAll(v["isvisit"]),
-			Index:      1,
-			Area:       qutil.ObjToString(v["area"]),
-			City:       qutil.ObjToString(v["city"]),
-			Buyerclass: qutil.ObjToString(v["buyerclass"]),
-			Keys:       strings.Split(qutil.ObjToString(v["matchkeys"]), " "),
-			Type:       qutil.IntAll(v["type"]),
-		})
+		result = []*jy.SubPushList{}
 	}
 	}
 	return
 	return
 }
 }
-
-//根据id取内容
-func getInfoByIds(pushCas []*jy.PushCa) []map[string]interface{} {
-	array := make([]map[string]interface{}, len(pushCas))
-	if len(pushCas) == 0 {
-		return array
-	}
-	m := map[string]bool{}
-	ids := []string{}
-	for _, v := range pushCas {
-		if m[v.InfoId] {
-			continue
-		}
-		m[v.InfoId] = true
-		ids = append(ids, v.InfoId)
-	}
-	infos := map[string]map[string]interface{}{}
-	//redis
-	es_ids := []string{}
-	//	log.Println("---:", ids)
-	for _, v := range ids {
-		info_i := redis.Get("pushcache_1", fmt.Sprintf("info_%s", v))
-		if info_i != nil {
-			info_m, _ := info_i.(map[string]interface{})
-			info_m["_id"] = v
-			infos[v] = info_m
-		} else {
-			es_ids = append(es_ids, v)
-		}
-	}
-	//	log.Println(es_ids)
-	//elasticsearch
-	if len(es_ids) > 0 {
-		list := elastic.Get("bidding", "bidding", fmt.Sprintf(query_ids, strings.Join(es_ids, `","`), len(es_ids)))
-		if list != nil {
-			for _, v := range *list {
-				_id := qutil.ObjToString(v["_id"])
-				infos[_id] = v
-			}
-		}
-	}
-	//mongodb bidding
-	mgo_ids := []bson.ObjectId{}
-	for _, v := range es_ids {
-		if infos[v] == nil {
-			mgo_ids = append(mgo_ids, bson.ObjectIdHex(v))
-		}
-	}
-	if len(mgo_ids) > 0 {
-		list, ok := util.MQFW.Find("bidding", map[string]interface{}{"_id": map[string]interface{}{"$in": mgo_ids}}, nil, mongodb_fields, false, -1, -1)
-		if ok && *list != nil {
-			for _, v := range *list {
-				_id := qutil.BsonIdToSId(v["_id"])
-				v["_id"] = _id
-				infos[_id] = v
-			}
-		}
-	}
-	//mongodb bidding_back
-	mgo_back_ids := []bson.ObjectId{}
-	for _, v := range mgo_ids {
-		if infos[qutil.BsonIdToSId(v)] == nil {
-			mgo_back_ids = append(mgo_back_ids, v)
-		}
-	}
-	if len(mgo_back_ids) > 0 {
-		list, ok := util.MQFW.Find("bidding_back", map[string]interface{}{"_id": map[string]interface{}{"$in": mgo_back_ids}}, nil, mongodb_fields, false, -1, -1)
-		if ok && *list != nil {
-			for _, v := range *list {
-				_id := qutil.BsonIdToSId(v["_id"])
-				v["_id"] = _id
-				infos[_id] = v
-			}
-		}
-	}
-	//
-	for k, v := range pushCas {
-		info := infos[v.InfoId]
-		if info == nil {
-			continue
-		}
-		array[k] = jy.HistoryPush.InfoFormat(v, &info)
-	}
-	return array
-}

+ 113 - 161
src/jfw/modules/subscribepay/src/service/vipRenewUpgrade.go

@@ -31,102 +31,64 @@ type RenewUpgrade struct {
 //获取购买订阅相关信息
 //获取购买订阅相关信息
 func (this *RenewUpgrade) GetBuyMsg() {
 func (this *RenewUpgrade) GetBuyMsg() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
 	userId := qutil.ObjToString(this.GetSession("userId"))
-	data, ok := util.MQFW.FindById("user", userId, nil)
-	if ok && len(*data) > 0 && *data != nil {
-		vipjy := (*data)["o_vipjy"].(map[string]interface{})
-		area := vipjy["o_area"]
-		buyerclass := vipjy["a_buyerclass"]
-		cycleunit := vipjy["i_cycleunit"]   // 1-年,2-月
-		cyclecount := vipjy["i_cyclecount"] //数量
-		starttime := qutil.Int64All((*data)["l_vip_starttime"])
-		start := time.Unix(starttime, 0).Format("2006-01-02")
-		endtime := qutil.Int64All((*data)["l_vip_endtime"])
-		end := time.Unix(endtime, 0).Format("2006-01-02")
-		now := time.Unix(time.Now().Unix(), 0).Format("2006-01-02")
-		vipStatus := (*data)["i_vip_status"]
-		buyset := vipjy["o_buyset"]
-
-		orderdata := util.Mysql.FindOne("dataexport_order", map[string]interface{}{
-			"user_id":      userId,
-			"order_status": 1,
-			"product_type": "VIP订阅",
-		}, "filter,order_code", "create_time desc")
-		vmsg := entity.VipSimpleMsg{}
-		if len(*orderdata) > 0 && *orderdata != nil {
-			filterStr := qutil.ObjToString((*orderdata)["filter"])
-			if err := json.Unmarshal([]byte(filterStr), &vmsg); err != nil {
-				log.Printf("%s vipSubscribeStruct PayCallBack Unmarshal 出错 [%s]\n", filterStr)
-				return
+	r := func() *entity.FuncResult {
+		if userId == "" {
+			return &entity.FuncResult{false, errors.New("未登录"), nil}
+		}
+		data, ok := util.MQFW.FindById("user", userId, nil)
+		if ok && len(*data) > 0 && *data != nil {
+			vipjy := (*data)["o_vipjy"].(map[string]interface{})
+			area := vipjy["o_area"]
+			buyerclass := vipjy["a_buyerclass"]
+			starttime := qutil.Int64All((*data)["l_vip_starttime"])
+			start := time.Unix(starttime, 0).Format("2006-01-02")
+			endtime := qutil.Int64All((*data)["l_vip_endtime"])
+			end := time.Unix(endtime, 0).Format("2006-01-02")
+			now := time.Unix(time.Now().Unix(), 0).Format("2006-01-02")
+			vipStatus := (*data)["i_vip_status"]
+			buyset := vipjy["o_buyset"]
+			//
+			var orderCode interface{}
+			orderdata := util.Mysql.FindOne("dataexport_order", map[string]interface{}{
+				"user_id":      userId,
+				"order_status": 1,
+				"product_type": "VIP订阅",
+			}, "order_code", "create_time desc")
+			if len(*orderdata) > 0 && *orderdata != nil {
+				orderCode = (*orderdata)["order_code"]
 			}
 			}
-			allArea := vmsg.Area
-			allIndustry := vmsg.Industry
 			dataArr := map[string]interface{}{
 			dataArr := map[string]interface{}{
-				"area":        area,
-				"buyerclass":  buyerclass,
-				"cycleunit":   cycleunit,
-				"cyclecount":  cyclecount,
-				"starttime":   starttime,
-				"endtime":     endtime,
-				"start":       start,
-				"end":         end,
-				"now":         now,
-				"vipStatus":   vipStatus,
-				"buyset":      buyset,
-				"allarea":     allArea,
-				"allindustry": allIndustry,
-				"orderCode":   (*orderdata)["order_code"],
+				"area":       area,
+				"buyerclass": buyerclass,
+				"starttime":  starttime,
+				"endtime":    endtime,
+				"start":      start,
+				"end":        end,
+				"now":        now,
+				"vipStatus":  vipStatus,
+				"buyset":     buyset,
+				"orderCode":  orderCode,
 			}
 			}
-			this.ServeJson(dataArr)
+			return &entity.FuncResult{true, nil, dataArr}
+		} else {
+			return &entity.FuncResult{false, errors.New("非法请求"), nil}
 		}
 		}
+	}()
+	if r.Err != nil {
+		log.Printf("%s CreateOrder err:%v\n", userId, r.Err.Error())
 	}
 	}
+	this.ServeJson(r.Format())
 }
 }
 
 
 //升级续费
 //升级续费
 //创建订单返回支付串
 //创建订单返回支付串
 func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
-	// -------差价计算部分可注释-----
-	//	areaArr := this.GetString("area")
-	//	var area *map[string]interface{}
-	//	if areaArr != "no" {
-	//保留
-	area := qutil.ObjToMap(this.GetString("area")) //新增订阅区域
-	//	} else {
-	//		area = &map[string]interface{}{
-	//			"no": "no",
-	//		}
-	//	}
-	// -------差价计算部分可注释-----
-	// -------差价计算可注释-----
-	//	areas_arr := this.GetString("areas_arr")
-	//	var addBuyArea *map[string]interface{}
-	//	if areas_arr != "no" {
-	//		addBuyArea = qutil.ObjToMap(this.GetString("areas_arr")) //新增购买区域
-	//	} else {
-	//		addBuyArea = &map[string]interface{}{
-	//			"no": "no",
-	//		}
-	//	}
-	// -------差价计算可注释-----
-	// -------差价计算部分可注释-----
-	//	industryArr := this.GetString("industry")
-	//	var industry []string
-	//	if industryArr != "no" {
-	//保留
-	industry := strings.Split(this.GetString("industry"), ",") //新增行业
-	//	} else {
-	//		industry = append(industry, "no")
-	//	}
-	// -------差价计算部分可注释-----
-	//	areas := qutil.ObjToMap(this.GetString("areas"))                 //已购买区域
-	//	industrys := strings.Split(this.GetString("industryarr"), ",")   //已购买行业
 	allBuyArea := qutil.ObjToMap(this.GetString("allBuyArea"))       //已购+新增区域
 	allBuyArea := qutil.ObjToMap(this.GetString("allBuyArea"))       //已购+新增区域
 	allIndustry := strings.Split(this.GetString("allIndustry"), ",") //已购+新增行业
 	allIndustry := strings.Split(this.GetString("allIndustry"), ",") //已购+新增行业
 	date := this.GetString("time")                                   //不延长时为空,正常为 年或月
 	date := this.GetString("time")                                   //不延长时为空,正常为 年或月
 	payWay := this.GetString("payWay")                               //支付方式
 	payWay := this.GetString("payWay")                               //支付方式
 	pay_source := this.GetString("pay_source")                       //类型  续费-Renew or 升级-Upgrade
 	pay_source := this.GetString("pay_source")                       //类型  续费-Renew or 升级-Upgrade
 	addCount := this.GetString("addCount")
 	addCount := this.GetString("addCount")
-	oldBuyset := qutil.ObjToMap(this.GetString("oldbuyset"))
-	log.Println("111", oldBuyset)
 	buyset := qutil.ObjToMap(this.GetString("buyset"))
 	buyset := qutil.ObjToMap(this.GetString("buyset"))
 	log.Println("111", buyset)
 	log.Println("111", buyset)
 	var vipBuyCount *map[string]interface{}
 	var vipBuyCount *map[string]interface{}
@@ -139,16 +101,11 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
 	userId := qutil.ObjToString(this.GetSession("userId"))
 	openId := qutil.ObjToString(this.GetSession("s_m_openid"))
 	openId := qutil.ObjToString(this.GetSession("s_m_openid"))
 	r := func() *entity.FuncResult {
 	r := func() *entity.FuncResult {
+		if userId == "" {
+			return &entity.FuncResult{false, errors.New("未登录"), nil}
+		}
 		now := time.Now()
 		now := time.Now()
 		//数据校验
 		//数据校验
-		//		if (industry[0]) != "no" {
-		if len(industry) == 1 && industry[0] == "" { //去掉[""]
-			industry = []string{}
-		}
-		//		}
-		//		if len(industrys) == 1 && industrys[0] == "" { //去掉[""]
-		//			industrys = []string{}
-		//		}
 		if len(allIndustry) == 1 && allIndustry[0] == "" { //去掉[""]
 		if len(allIndustry) == 1 && allIndustry[0] == "" { //去掉[""]
 			allIndustry = []string{}
 			allIndustry = []string{}
 		}
 		}
@@ -173,6 +130,10 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 
 
 		start := qutil.Int64All((*res)["l_vip_starttime"])
 		start := qutil.Int64All((*res)["l_vip_starttime"])
 		end := qutil.Int64All((*res)["l_vip_endtime"])
 		end := qutil.Int64All((*res)["l_vip_endtime"])
+		vipjy := (*res)["o_vipjy"].(map[string]interface{})
+		oldBuy := vipjy["o_buyset"]
+		oldBuyset := oldBuy.(map[string]interface{})
+		log.Println("old", oldBuyset)
 		if start == 0 || end == 0 {
 		if start == 0 || end == 0 {
 			return &entity.FuncResult{false, errors.New("数据异常"), nil}
 			return &entity.FuncResult{false, errors.New("数据异常"), nil}
 		}
 		}
@@ -193,12 +154,14 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 		}
 		}
 		filter := entity.VipSimpleMsg{}
 		filter := entity.VipSimpleMsg{}
 		if pay_source == "Renew" {
 		if pay_source == "Renew" {
+			areaMap := qutil.ObjToMap(vipjy["o_area"])
+			industryMap := qutil.ObjArrToStringArr(vipjy["a_buyerclass"].([]interface{}))
 			filter = entity.VipSimpleMsg{
 			filter = entity.VipSimpleMsg{
-				area,
-				industry,
+				areaMap,
+				industryMap,
 				nil,
 				nil,
 				0,
 				0,
-				buyset,
+				&oldBuyset,
 				date_count,
 				date_count,
 				date_unit,
 				date_unit,
 				orderType,
 				orderType,
@@ -220,90 +183,79 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 		if mog_id == "" {
 		if mog_id == "" {
 			return &entity.FuncResult{false, errors.New("创建订单出错"), nil}
 			return &entity.FuncResult{false, errors.New("创建订单出错"), nil}
 		}
 		}
+
 		//计算价格
 		//计算价格
 		var totalfee int
 		var totalfee int
 		if pay_source == "Renew" {
 		if pay_source == "Renew" {
-			//			totalfee = entity.JyVipSubStruct.GetSubVipPrice(area, industry, date_count, date_unit)
-			totalfee = entity.JyVipSubStruct.GetSubVipBuysetPrice(buyset, date_count, date_unit)
+			cityArr := qutil.ObjToMap(oldBuyset["citys"])
+			citysArr := map[string]int{}
+			for k, v := range *cityArr {
+				citysArr[k] = qutil.IntAll(v)
+			}
+			pCount := qutil.IntAll(oldBuyset["areacount"])
+			iCount := qutil.IntAll(oldBuyset["buyerclasscount"])
+			//
+			totalfee = entity.JyVipSubStruct.GetSubVipPriceByBuySet(citysArr, pCount, iCount, date_count, date_unit, true)
 		} else if pay_source == "Upgrade" {
 		} else if pay_source == "Upgrade" {
 			upgradeYear, upgradeMonth := MaxUpgradeMonth(end) //获取最大升级月数
 			upgradeYear, upgradeMonth := MaxUpgradeMonth(end) //获取最大升级月数
-			// -------差价计算可注释-----
-			//			vipjy := (*res)["o_vipjy"].(map[string]interface{})
-			//			addIndustry := qutil.ObjArrToStringArr(vipjy["a_buyerclass"].([]interface{}))
-			//			buyerclasscount := vipjy["o_buyset"].(map[string]interface{})["buyerclasscount"]
-			//			if len(addIndustry) != 0 {
-			//				reduce := qutil.IntAll(buyerclasscount) - len(addIndustry)
-			//				if reduce > 0 {
-			//					Leng := len(industry) - reduce
-			//					if len(industry) > 0 {
-			//						if industry[0] != "no" {
-			//							industry = industry[0:Leng]
-			//						}
-			//					}
-			//				}
-			//			}
-			// -------差价计算可注释-----
-			// --------升级价格交叉计算--------
-			//			addAreaY := 0
-			//			addAreaM := 0
-			//			oldAreaY := 0
-			//			oldAreaM := 0
-			//			addIndustryY := 0
-			//			addIndustryM := 0
-			//			if (*addBuyArea)["no"] != "no" && len(industry) > 0 {
-			//				if industry[0] != "no" {
-			//					addAreaY = entity.JyVipSubStruct.GetSubVipPrice(addBuyArea, industry, upgradeYear, 1)
-			//					addAreaM = entity.JyVipSubStruct.GetSubVipPrice(addBuyArea, industry, upgradeMonth, 2)
-			//				}
-			//			} else if (*addBuyArea)["no"] != "no" && len(industry) == 0 {
-			//				addAreaY = entity.JyVipSubStruct.GetSubVipPrice(addBuyArea, industry, upgradeYear, 1)
-			//				addAreaM = entity.JyVipSubStruct.GetSubVipPrice(addBuyArea, industry, upgradeMonth, 2)
-			//			}
-			//			if (*addBuyArea)["no"] != "no" {
-			//				oldAreaY = entity.JyVipSubStruct.GetSubVipPrice(addBuyArea, industrys, upgradeYear, 1)
-			//				oldAreaM = entity.JyVipSubStruct.GetSubVipPrice(addBuyArea, industrys, upgradeMonth, 2)
-			//			}
-			//			if len(industry) > 0 {
-			//				if industry[0] != "no" {
-			//					addIndustryY = entity.JyVipSubStruct.GetSubVipPrice(areas, industry, upgradeYear, 1)
-			//					addIndustryM = entity.JyVipSubStruct.GetSubVipPrice(areas, industry, upgradeMonth, 2)
-			//				}
-			//			} else {
-			//				addIndustryY = entity.JyVipSubStruct.GetSubVipPrice(areas, industry, upgradeYear, 1)
-			//				addIndustryM = entity.JyVipSubStruct.GetSubVipPrice(areas, industry, upgradeMonth, 2)
-			//			}
-			//			totalfee = addAreaY + addAreaM + oldAreaY + oldAreaM + addIndustryY + addIndustryM
-			// --------升级价格交叉计算--------
-			// --------升级价格差价计算--------
-			//			oldPriceY := entity.JyVipSubStruct.GetSubVipPrice(areas, industrys, upgradeYear, 1)
-			//			oldPriceM := entity.JyVipSubStruct.GetSubVipPrice(areas, industrys, upgradeMonth, 2)
-			oldPriceY := entity.JyVipSubStruct.GetSubVipBuysetPrice(oldBuyset, upgradeYear, 1)
-			oldPriceM := entity.JyVipSubStruct.GetSubVipBuysetPrice(oldBuyset, upgradeMonth, 2)
+			//
+			cityArr := qutil.ObjToMap(oldBuyset["citys"])
+			citysArr := map[string]int{}
+			for k, v := range *cityArr {
+				citysArr[k] = qutil.IntAll(v)
+			}
+			pCount := qutil.IntAll(oldBuyset["areacount"])
+			iCount := qutil.IntAll(oldBuyset["buyerclasscount"])
+			//
+			newCityArr := qutil.ObjToMap((*buyset)["citys"])
+			newCitysArr := map[string]int{}
+			newPCount := qutil.IntAll((*buyset)["areacount"])
+			newICount := qutil.IntAll((*buyset)["buyerclasscount"])
+			for c, y := range *newCityArr {
+				newCitysArr[c] = qutil.IntAll(y)
+			}
+			//校验buyset
+			if newICount != -1 {
+				if newICount < iCount {
+					return &entity.FuncResult{false, errors.New("非法请求"), nil}
+				}
+			}
+			if newPCount != -1 {
+				if newPCount < pCount {
+					return &entity.FuncResult{false, errors.New("非法请求"), nil}
+				}
+				for a, b := range *newCityArr {
+					if (*cityArr)[a] != nil {
+						if qutil.IntAll((*cityArr)[a]) < qutil.IntAll(b) {
+							return &entity.FuncResult{false, errors.New("非法请求"), nil}
+						}
+					}
+				}
+			}
+
+			//
+			oldPriceY := entity.JyVipSubStruct.GetSubVipPriceByBuySet(citysArr, pCount, iCount, upgradeYear, 1, false)
+			oldPriceM := entity.JyVipSubStruct.GetSubVipPriceByBuySet(citysArr, pCount, iCount, upgradeMonth, 2, false)
 			oldPrice := oldPriceY + oldPriceM
 			oldPrice := oldPriceY + oldPriceM
-			//			log.Println("oldPrice", oldPrice)
-			//			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)
+			//
+			newPriceY := entity.JyVipSubStruct.GetSubVipPriceByBuySet(newCitysArr, newPCount, newICount, upgradeYear, 1, false)
+			newPriceM := entity.JyVipSubStruct.GetSubVipPriceByBuySet(newCitysArr, newPCount, newICount, upgradeMonth, 2, false)
 			newPrice := newPriceY + newPriceM
 			newPrice := newPriceY + newPriceM
-			//			log.Println("newPriceY", newPriceY)
-			//			log.Println("newPriceM", newPriceM)
-			//			log.Println("newPrice", newPrice)
+			//
 			totalfee = newPrice - oldPrice
 			totalfee = newPrice - oldPrice
 			// --------升级价格差价计算--------
 			// --------升级价格差价计算--------
 			if date_unit == 1 { //升级中的延长时间
 			if date_unit == 1 { //升级中的延长时间
-
-				lengPrice := entity.JyVipSubStruct.GetSubVipBuysetPrice(buyset, date_count, 1) //单位为年的已购+新增延长时间价格
-				totalfee = totalfee + lengPrice                                                //已购+新增延长时间价格 + 升级差价 = 最终价格
+				lengPrice := entity.JyVipSubStruct.GetSubVipPriceByBuySet(newCitysArr, newPCount, newICount, date_count, 1, true) //单位为年的已购+新增延长时间价格
+				totalfee = totalfee + lengPrice                                                                                   //已购+新增延长时间价格 + 升级差价 = 最终价格
 			} else if date_unit == 2 {
 			} else if date_unit == 2 {
-				lengPrice := entity.JyVipSubStruct.GetSubVipBuysetPrice(buyset, date_count, 2) //单位为月的已购+新增延长时间价格
-				totalfee = totalfee + lengPrice                                                //已购+新增延长时间价格 + 升级差价 = 最终价格
+				lengPrice := entity.JyVipSubStruct.GetSubVipPriceByBuySet(newCitysArr, newPCount, newICount, date_count, 2, true) //单位为月的已购+新增延长时间价格
+				totalfee = totalfee + lengPrice                                                                                   //已购+新增延长时间价格 + 升级差价 = 最终价格
 			}
 			}
 		}
 		}
 		log.Println("price", totalfee)
 		log.Println("price", totalfee)
-		paymoneny := float64(totalfee) * 0.0000001
-		if paymoneny < 1 {
-			if totalfee != 0 {
+		tmp := float64(totalfee) * 0.000001
+		if tmp < 1 {
+			if tmp != 0 {
 				totalfee = 1
 				totalfee = 1
 			}
 			}
 		}
 		}

+ 0 - 2
src/jfw/modules/subscribepay/src/service/vipSubscribeEdit.go

@@ -78,9 +78,7 @@ func (this *EditSub) SaveSubEdit() {
 		switch doType {
 		switch doType {
 		case "area":
 		case "area":
 			areaNew := map[string]interface{}{}
 			areaNew := map[string]interface{}{}
-			log.Println(doValue)
 			err := json.Unmarshal([]byte(doValue), &areaNew)
 			err := json.Unmarshal([]byte(doValue), &areaNew)
-			log.Println(err)
 			if err != nil {
 			if err != nil {
 				return &editSubResult{false, errors.New("数据格式错误"), nil}
 				return &editSubResult{false, errors.New("数据格式错误"), nil}
 			}
 			}

+ 14 - 3
src/jfw/modules/subscribepay/src/service/vipSubscribePay.go

@@ -68,7 +68,6 @@ func (this *SubVipPayOrder) CreateOrder() {
 			if json.Unmarshal([]byte(selectedStr), &selected) != nil {
 			if json.Unmarshal([]byte(selectedStr), &selected) != nil {
 				return &entity.FuncResult{false, errors.New("数据异常"), nil}
 				return &entity.FuncResult{false, errors.New("数据异常"), nil}
 			}
 			}
-			log.Println("xxx", selected)
 			if !selected[0] || !selected[0] {
 			if !selected[0] || !selected[0] {
 				//查询最后一笔订单
 				//查询最后一笔订单
 				vipMsg, err := entity.JyVipSubStruct.GetUserLastOrderDetaul(userId)
 				vipMsg, err := entity.JyVipSubStruct.GetUserLastOrderDetaul(userId)
@@ -83,12 +82,24 @@ func (this *SubVipPayOrder) CreateOrder() {
 				}
 				}
 			}
 			}
 		}
 		}
+		//即将到期续费区域展示buyset
+		exprieBuyset := entity.JyVipSubStruct.NewBuySet(area, industry)
+		buyset := &map[string]interface{}{}
+		(*buyset)["areacount"] = exprieBuyset.AreaCount
+		(*buyset)["buyerclasscount"] = exprieBuyset.BuyerclassCount
+		cityArr := exprieBuyset.Citys
+		citys := map[string]interface{}{}
+		for cityMap, cityCount := range cityArr {
+			citys[cityMap] = qutil.IntAll(cityCount)
+		}
+		(*buyset)["citys"] = citys
+		//
 		filter := entity.VipSimpleMsg{
 		filter := entity.VipSimpleMsg{
 			area,
 			area,
 			industry,
 			industry,
 			nil,
 			nil,
 			0,
 			0,
-			nil,
+			buyset,
 			date_count,
 			date_count,
 			date_unit,
 			date_unit,
 			orderType,
 			orderType,
@@ -173,7 +184,7 @@ func (this *SubVipPayOrder) CreateOrder() {
 			return &entity.FuncResult{false, errors.New("数据库操作异常"), nil}
 			return &entity.FuncResult{false, errors.New("数据库操作异常"), nil}
 		}
 		}
 		//支付提醒
 		//支付提醒
-		util.MsgRemind.Add(qutil.IntAll(orderid), totalfee, -1, 0, ordercode, userId, now.Unix())
+		util.MsgRemind.Add(qutil.IntAll(orderid), totalfee, qutil.If(orderType == 5, 1, -1).(int), 0, ordercode, userId, now.Unix())
 		return &entity.FuncResult{true, nil, map[string]interface{}{"code": ordercode, "res": payStr}}
 		return &entity.FuncResult{true, nil, map[string]interface{}{"code": ordercode, "res": payStr}}
 	}()
 	}()
 	if r.Err != nil {
 	if r.Err != nil {

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

@@ -116,7 +116,7 @@ func (t *TrialOrder) SendPhoneCaptcha() {
 		}
 		}
 		imgcode_sess := qutil.ObjToString(t.GetSession("subvip_trial_imgCode"))
 		imgcode_sess := qutil.ObjToString(t.GetSession("subvip_trial_imgCode"))
 		if !captcha.VerifyString(imgcode_sess, imgcode_req) || imgcode_req == "" {
 		if !captcha.VerifyString(imgcode_sess, imgcode_req) || imgcode_req == "" {
-			return false, "图形验证码不正确"
+			return false, "图形验证码错误"
 		}
 		}
 		//获取上次发送验证码时间
 		//获取上次发送验证码时间
 		lastSend := qutil.Int64All(t.GetSession("subvip_trial_lastSend"))
 		lastSend := qutil.Int64All(t.GetSession("subvip_trial_lastSend"))
@@ -163,7 +163,6 @@ func (t *TrialOrder) SubmitApply() {
 		code_sess := qutil.ObjToString(t.GetSession("subvip_trial_MsgCode"))
 		code_sess := qutil.ObjToString(t.GetSession("subvip_trial_MsgCode"))
 		tel_sess := qutil.ObjToString(t.GetSession("subvip_trial_phoneNum"))
 		tel_sess := qutil.ObjToString(t.GetSession("subvip_trial_phoneNum"))
 		if code != code_sess || tel != tel_sess {
 		if code != code_sess || tel != tel_sess {
-			log.Println(code, code_sess, tel, tel_sess)
 			return false, "短信验证码错误"
 			return false, "短信验证码错误"
 		}
 		}
 		if isExist(tel_sess) {
 		if isExist(tel_sess) {

+ 2 - 0
src/jfw/public/db.go

@@ -3,6 +3,7 @@ package public
 import (
 import (
 	. "jfw/config"
 	. "jfw/config"
 	"qfw/util"
 	"qfw/util"
+	"qfw/util/jy"
 	mg "qfw/util/mongodb"
 	mg "qfw/util/mongodb"
 	"qfw/util/mysql"
 	"qfw/util/mysql"
 	"qfw/util/redis"
 	"qfw/util/redis"
@@ -75,5 +76,6 @@ func init() {
 			MaxIdleConns: util.IntAll(pushMysqlConfig["maxIdleConns"]),
 			MaxIdleConns: util.IntAll(pushMysqlConfig["maxIdleConns"]),
 		}
 		}
 		PushMysql.Init()
 		PushMysql.Init()
+		jy.PushMapping.Init(PushMysql)
 	}
 	}
 }
 }

+ 0 - 601
src/jfw/public/historypush.go

@@ -1,601 +0,0 @@
-package public
-
-import (
-	"fmt"
-	"log"
-	"qfw/util"
-	"qfw/util/elastic"
-	"qfw/util/jy"
-	"qfw/util/redis"
-	"sort"
-	"strings"
-	"time"
-
-	"gopkg.in/mgo.v2/bson"
-)
-
-const (
-	pageSize       = 50
-	query          = `{"query":{"terms":{"_id":["%s"]}},"_source":["_id","area", "bidamount", "bidopentime", "budget", "buyer", "projectname", "publishtime", "s_subscopeclass", "subtype", "title", "toptype", "type", "winner"],"from":0,"size":%d}`
-	mongodb_fields = `{"_id":1,"area":1,"bidamount":1,"bidopentime":1,"budget":1,"buyer":1,"projectname":1,"publishtime":1,"s_subscopeclass":1,"subtype":1,"title":1,"toptype":1,"type":1,"winner":1}`
-)
-
-var HistoryPush = &historyPush{}
-
-type historyPush struct{}
-
-var Mysql_table = "pushsubscribe"
-
-//
-func (h *historyPush) Datas_Mysql(userId string, pageNum int, selectTime, area string) (hasNextPage bool, result []map[string]interface{}) {
-	if userId == "" {
-		return
-	}
-	findSQL := "select * from pushsubscribe where userid = '" + userId + "'"
-	countSQL := "select count(1) as count from pushsubscribe where userid = '" + userId + "'"
-	findStr := ""
-	if selectTime != "" {
-		startTime := selectTime + " 00:00:00"
-		endTime := selectTime + " 23:59:59"
-		st, _ := time.ParseInLocation("2006-01-02 15:04:05", startTime, time.Local)
-		et, _ := time.ParseInLocation("2006-01-02 15:04:05", endTime, time.Local)
-		fmt.Println(st.Unix())
-		_startTime := st.Unix()
-		_endTime := et.Unix()
-		log.Println(_startTime, "--", _endTime)
-		findStr += " and date < " + fmt.Sprint(_endTime) + " and date >= " + fmt.Sprint(_startTime)
-	}
-	if area != "" {
-		findStr += " and city in ("
-		var _area = ""
-		for _, v := range strings.Split(area, ",") {
-			if v == "全部" {
-				continue
-			}
-			if _area != "" {
-				_area += ","
-			}
-			_area += "'" + v + "'"
-		}
-		findStr += _area + ")"
-	}
-	countSQL = countSQL + findStr
-	count := PushMysql.CountBySql(countSQL)
-	start := (pageNum - 1) * pageSize
-	findStr += " order by id desc limit " + fmt.Sprint(start) + "," + fmt.Sprint(pageSize)
-	findSQL = findSQL + findStr
-	//	log.Println("findsql:", findSQL)
-	list := PushMysql.SelectBySql(findSQL)
-	if len(*list) > 0 {
-		pushCas := h.getJyPushs(*list)
-		result = h.getInfoByIds(pushCas)
-	} else {
-		result = []map[string]interface{}{}
-	}
-	hasNextPage = int(count) > pageNum*pageSize
-	return
-}
-
-//获取历史推送记录入口
-//selectTime 查询推送的日期 传入的值为‘20060102’ 如果不查询具体天数 传入""
-func (h *historyPush) Datas(userId string, pageNum int, firstPushTime int64, selectTime string) (hasNextPage bool, result []map[string]interface{}, err error) {
-	defer util.Catch()
-	result = []map[string]interface{}{}
-	var infos []map[string]interface{}
-	var pc_a *jy.PushSub
-	var pushCas []*jy.PushCa
-	var ps_a_err error
-	//历史推送,接收到时间则直接从库中查找数据。
-	if selectTime != "" {
-		pushCas = h.getSelectDateDatas(userId, selectTime)
-		pc_c := h.getInfoByIds(pushCas)
-		infos = pc_c
-	} else {
-		pc_a, ps_a_err = jy.HistoryPush.GetPushCache_A(userId)
-		if ps_a_err != nil {
-			err = ps_a_err
-			log.Println("HistoryPush Datas Error", ps_a_err)
-		}
-		if pageNum <= 10 {
-			if pc_a == nil {
-				pc_a = &jy.PushSub{}
-				ids := h.halfYearDatas(userId)
-				length := len(ids)
-				if length == 0 {
-					hyad := h.halfYearAgoDatas(userId, firstPushTime)
-					if hyad_length := len(hyad); hyad_length > 0 {
-						pc_a.Type = 2
-						if hyad_length > 500 {
-							hyad = hyad[:500]
-							pc_a.Count = 500
-						} else {
-							pc_a.Count = hyad_length
-						}
-						pc_a.Infos = h.getInfoByIds(hyad)
-					}
-				} else if length == 500 {
-					pc_a.Type = 1
-					pc_a.Count = 0
-					pc_a.Infos = h.getInfoByIds(ids)
-				} else if length > 500 {
-					pc_a.Type = 1
-					pc_a.Count = 500
-					pc_a.Infos = h.getInfoByIds(ids[:500])
-				} else if length < 500 {
-					pc_a.Type = 1
-					pc_a.Count = length
-					hyads := h.halfYearAgoDatas(userId, firstPushTime)
-					if hyads_length := len(hyads); hyads_length > 0 {
-						if length == 0 {
-							pc_a.Type = 2
-						} else {
-							pc_a.Type = 3
-						}
-						needLength := 500 - length
-						if hyads_length > needLength {
-							hyads = hyads[:needLength]
-							pc_a.Count = needLength
-						} else {
-							pc_a.Count = hyads_length
-						}
-						ids = append(ids, hyads...)
-					}
-					pc_a.Infos = h.getInfoByIds(ids)
-				}
-				jy.HistoryPush.PutPushCache_A(userId, pc_a)
-			} else {
-				log.Println("hit pushcache_2_a", userId)
-			}
-			infos = pc_a.Infos
-		} else {
-			pageNum -= 10
-			pc_b, pc_b_err := jy.HistoryPush.GetPushCache_B(userId)
-			if pc_b_err != nil {
-				err = pc_b_err
-				log.Println("HistoryPush Datas Error", pc_b_err)
-			}
-			if pc_b == nil {
-				if pc_a == nil {
-					pc_a = &jy.PushSub{}
-					pc_a_ids := []*jy.PushCa{}
-					pc_b = []map[string]interface{}{}
-					ids := h.halfYearDatas(userId)
-					length := len(ids)
-					if length >= 500 {
-						pc_a_ids = ids[:500]
-						pc_a.Type = 1
-						if length == 500 {
-							pc_a.Count = 0
-						} else {
-							pc_a.Count = 500
-						}
-						if length == 4000 {
-							pc_b = h.getInfoByIds(ids[500:])
-						} else {
-							pc_b_ids := ids[500:]
-							hyads := h.halfYearAgoDatas(userId, firstPushTime)
-							if len(hyads) > 0 {
-								pc_b_ids = append(pc_b_ids, hyads...)
-								if len(pc_b_ids) > 3500 {
-									pc_b_ids = pc_b_ids[:3500]
-								}
-							}
-							pc_b = h.getInfoByIds(pc_b_ids)
-						}
-					} else if length < 500 {
-						pc_a_ids = ids
-						pc_a.Type = 1
-						pc_a.Count = length
-						hyads := h.halfYearAgoDatas(userId, firstPushTime)
-						if len(hyads) > 0 {
-							if length == 0 {
-								pc_a.Type = 2
-							} else {
-								pc_a.Type = 3
-							}
-							needLength := 500 - length
-							if len(hyads) > needLength {
-								pc_a.Count = needLength
-								pc_a_ids = append(pc_a_ids, hyads[:needLength]...)
-								hyads = hyads[needLength:]
-								if len(hyads) > 3500 {
-									hyads = hyads[:3500]
-								}
-								pc_b = h.getInfoByIds(hyads)
-							} else {
-								pc_a.Count = len(hyads)
-								pc_a_ids = append(pc_a_ids, hyads...)
-							}
-						}
-					}
-					go func() {
-						pc_a.Infos = h.getInfoByIds(pc_a_ids)
-						jy.HistoryPush.PutPushCache_A(userId, pc_a)
-					}()
-				} else {
-					switch pc_a.Type {
-					case 1:
-						if pc_a.Count == 0 {
-							hyads := h.halfYearAgoDatas(userId, firstPushTime)
-							if len(hyads) > 3500 {
-								hyads = hyads[:3500]
-							}
-							pc_b = h.getInfoByIds(hyads)
-						} else {
-							ids := h.halfYearDatas(userId)
-							if len(ids) > pc_a.Count {
-								ids = ids[pc_a.Count:]
-								if len(ids) < 3500 {
-									hyads := h.halfYearAgoDatas(userId, firstPushTime)
-									needLength := 3500 - len(ids)
-									if len(hyads) > needLength {
-										hyads = hyads[:needLength]
-									}
-									ids = append(ids, hyads...)
-								}
-								pc_b = h.getInfoByIds(ids)
-							}
-						}
-						break
-					case 2, 3:
-						if pc_a.Count > 0 {
-							ids := h.halfYearAgoDatas(userId, firstPushTime)
-							if len(ids) > pc_a.Count {
-								pc_b = h.getInfoByIds(ids[pc_a.Count:])
-							}
-						}
-						break
-					}
-				}
-				if pc_b == nil {
-					pc_b = []map[string]interface{}{}
-				}
-				jy.HistoryPush.PutPushCache_B(userId, pc_b)
-			} else {
-				log.Println("hit pushcache_2_b", userId)
-			}
-			infos = pc_b
-		}
-	}
-	log.Println(len(infos))
-	if len(infos) > 0 {
-		start := (pageNum - 1) * pageSize
-		end := pageNum * pageSize
-		if end > len(infos) {
-			end = len(infos)
-		}
-		if start < len(infos) {
-			result = infos[start:end]
-		}
-	}
-	hasNextPage = len(result) >= pageSize
-	return
-}
-
-/* 半年内的数据
- * userId 用户id
- * date 半年前的日期
- */
-func (h *historyPush) halfYearDatas(userId string) (pushCas []*jy.PushCa) {
-	datas := Ca_Push.Search("select * from jy_pushhistory where uid=? and date>=?", userId, h.halfYear())
-	pushCas = h.getJyPushs(datas)
-	return
-}
-
-/*
- * 用户根据时间 在cassandra查询数据
- * userId 用户id
- * selectdate 选中的日期
- */
-func (h *historyPush) getSelectDateDatas(userId string, selectTime string) (pushCas []*jy.PushCa) {
-	datas := Ca_Push.Search("select * from jy_pushhistory where uid=? and dateymd=?", userId, selectTime)
-	pushCas = h.getJyPushs(datas)
-	return
-}
-
-/* 半年以前的数据
- * userId 用户id
- * date 半年前的日期
- */
-func (h *historyPush) halfYearAgoDatas(userId string, firstPushTime int64) (pushCas []*jy.PushCa) {
-	if firstPushTime == 0 || firstPushTime > h.halfYear() {
-		return
-	}
-	datas := Ca_Push.Search("select * from jy_pushhistory where uid=? and date<? limit 1000", userId, h.halfYear())
-	pushCas = h.getJyPushs(datas)
-	return
-}
-
-func (h *historyPush) getJyPushs(datas []map[string]interface{}) (pushCas []*jy.PushCa) {
-	pushCas = []*jy.PushCa{}
-	for _, v := range datas {
-		pushCas = append(pushCas, &jy.PushCa{
-			Date:       util.Int64All(v["date"]),
-			InfoId:     util.ObjToString(v["infoid"]),
-			Visit:      util.IntAll(v["isvisit"]),
-			Index:      util.IntAll(v["id"]),
-			Area:       util.ObjToString(v["area"]),
-			City:       util.ObjToString(v["city"]),
-			Buyerclass: util.ObjToString(v["buyerclass"]),
-			Keys:       strings.Split(util.ObjToString(v["matchkeys"]), " "),
-			Type:       util.IntAll(v["type"]),
-			Isvip:      util.IntAll(v["isvip"]),
-		})
-	}
-	return
-}
-
-//是否访问过
-func (h *historyPush) isVisited(isvisit int64, index int) int {
-	if uint64(isvisit)&(1<<uint64(index)) > 0 {
-		return 1
-	} else {
-		return 0
-	}
-}
-
-//获取半年前的unix时间
-func (h *historyPush) halfYear() int64 {
-	return time.Now().AddDate(0, -6, 0).Unix()
-}
-
-//根据id取内容
-func (h *historyPush) getInfoByIds(pushCas []*jy.PushCa) []map[string]interface{} {
-	array := make([]map[string]interface{}, len(pushCas))
-	if len(pushCas) == 0 {
-		return array
-	}
-	m := map[string]bool{}
-	ids := []string{}
-	for _, v := range pushCas {
-		if m[v.InfoId] {
-			continue
-		}
-		m[v.InfoId] = true
-		ids = append(ids, v.InfoId)
-	}
-	infos := map[string]map[string]interface{}{}
-	//redis
-	es_ids := []string{}
-	for _, v := range ids {
-		info_i := redis.Get("pushcache_1", fmt.Sprintf("info_%s", v))
-		if info_i != nil {
-			info_m, _ := info_i.(map[string]interface{})
-			info_m["_id"] = v
-			infos[v] = info_m
-		} else {
-			es_ids = append(es_ids, v)
-		}
-	}
-	//	log.Println(es_ids)
-	//elasticsearch
-	if len(es_ids) > 0 {
-		list := elastic.Get("bidding", "bidding", fmt.Sprintf(query, strings.Join(es_ids, `","`), len(es_ids)))
-		if list != nil {
-			for _, v := range *list {
-				_id := util.ObjToString(v["_id"])
-				infos[_id] = v
-			}
-		}
-	}
-	//mongodb bidding
-	mgo_ids := []bson.ObjectId{}
-	for _, v := range es_ids {
-		if infos[v] == nil {
-			mgo_ids = append(mgo_ids, bson.ObjectIdHex(v))
-		}
-	}
-	if len(mgo_ids) > 0 {
-		list, ok := MQFW.Find("bidding", map[string]interface{}{"_id": map[string]interface{}{"$in": mgo_ids}}, nil, mongodb_fields, false, -1, -1)
-		if ok && *list != nil {
-			for _, v := range *list {
-				_id := util.BsonIdToSId(v["_id"])
-				v["_id"] = _id
-				infos[_id] = v
-			}
-		}
-	}
-	//mongodb bidding_back
-	mgo_back_ids := []bson.ObjectId{}
-	for _, v := range mgo_ids {
-		if infos[util.BsonIdToSId(v)] == nil {
-			mgo_back_ids = append(mgo_back_ids, v)
-		}
-	}
-	if len(mgo_back_ids) > 0 {
-		list, ok := MQFW.Find("bidding_back", map[string]interface{}{"_id": map[string]interface{}{"$in": mgo_back_ids}}, nil, mongodb_fields, false, -1, -1)
-		if ok && *list != nil {
-			for _, v := range *list {
-				_id := util.BsonIdToSId(v["_id"])
-				v["_id"] = _id
-				infos[_id] = v
-			}
-		}
-	}
-	//
-	for k, v := range pushCas {
-		info := infos[v.InfoId]
-		if info == nil {
-			continue
-		}
-		array[k] = jy.HistoryPush.InfoFormat(v, &info)
-	}
-	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, []*resultData) {
-	allquery := `{"range":{"publishtime":{"gt":%s}}}`
-	allquery = fmt.Sprintf(allquery, fmt.Sprint(time.Now().AddDate(0, 0, -7).Unix()))
-	//	allquery = ``
-	keys, list := PushView(userId, allquery, field, 1, 50)
-	log.Println(list)
-	if list == nil || len(*list) == 0 {
-		return true, nil
-	}
-	matchkeys := []string{}
-	if len(keys) > 0 {
-		for _, v := range keys {
-			for _, k := range util.ObjArrToStringArr(v.([]interface{})) {
-				matchkeys = append(matchkeys, k)
-			}
-		}
-	}
-	publishTitle := map[string]bool{}
-	now := time.Now()
-	keystr := strings.Join(matchkeys, " ")
-	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"])
-		if publishTitle[area_check+title] {
-			continue
-		} else {
-			publishTitle[area_check+title] = true
-		}
-		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 := PushMysql.Insert("pushsubscribe", myInsert)
-		if area_check == "A" {
-			area_check = "全国"
-		}
-		industry := util.ObjToString(v["s_subscopeclass"])
-		scs := strings.Split(industry, ",")
-		if len(scs) > 0 {
-			industry = scs[0]
-			if industry != "" {
-				iss := strings.Split(industry, "_")
-				if len(iss) > 0 {
-					industry = iss[0]
-				}
-			}
-		}
-		infotype := util.ObjToString(v["subtype"])
-		if infotype == "" {
-			infotype = util.ObjToString(v["toptype"])
-		}
-		if infotype == "" {
-			infotype = util.ObjToString(v["type"])
-			if infotype == "tender" {
-				infotype = "招标"
-			} else if infotype == "bid" {
-				infotype = "中标"
-			}
-		}
-
-		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,
-		})
-	}
-	sort.Sort(resultSort(resultList))
-	return true, resultList
-}
-
-//获取用户信息
-func (h *historyPush) UserInfo(userId string) (*map[string]interface{}, int64) {
-	user, ok := MQFW.FindById("user", userId, `{"s_m_openid":1,"a_m_openid":1,"s_phone":1,"a_mergeorder":1,"o_jy":1,"l_firstpushtime":1,"i_vip_status":1,"l_vip_endtime":1,"o_vipjy":1}`)
-	if !ok || user == nil {
-		return nil, 0
-	}
-	return user, util.Int64All((*user)["l_firstpushtime"])
-}
-func (h *historyPush) Visit_Mysql(userId, Id string) {
-	if Id == "" || userId == "" {
-		return
-	}
-	ok := PushMysql.UpdateOrDeleteBySql("update pushsubscribe set isvisit=1 where userid='" + userId + "' and id='" + Id + "'")
-	log.Println("--update:", ok)
-}
-
-//已访问过的,改变状态值
-func (h *historyPush) Visit(userId, infoId string, date int64, index int) {
-	log.Println(date, userId, index)
-	if date == 0 || userId == "" || index > 50 {
-		return
-	}
-	if res := Ca_Push.SearchOne("select isvisit from jy_pushhistory where date=? and uid=? ", date, userId); len(res) > 0 {
-		saveValue := int64(uint64(util.Int64All(res["isvisit"])) + 1<<uint64(index))
-		log.Println("saveValue:", saveValue)
-		Ca_Push.CDB.Query("update jy_pushhistory set isvisit = ? where uid=? and date=? ", saveValue, userId, date).Exec()
-		pc_a, err := jy.HistoryPush.GetPushCache_A(userId)
-		if err != nil {
-			log.Println(err)
-			return
-		}
-		if pc_a != nil && pc_a.Infos != nil {
-			if h.setVisit(date, infoId, index, &pc_a.Infos) {
-				jy.HistoryPush.PutPushCache_A(userId, pc_a)
-				return
-			}
-		}
-		pc_b, err := jy.HistoryPush.GetPushCache_B(userId)
-		if err != nil {
-			log.Println(err)
-			return
-		}
-		if pc_b != nil {
-			if h.setVisit(date, infoId, index, &pc_b) {
-				jy.HistoryPush.PutPushCache_B(userId, pc_b)
-				return
-			}
-		}
-	}
-}
-func (h *historyPush) setVisit(date int64, infoId string, index int, list *[]map[string]interface{}) bool {
-	for _, info := range *list {
-		if date != util.Int64All(info["ca_date"]) {
-			continue
-		}
-		if infoId != util.ObjToString(info["_id"]) {
-			continue
-		}
-		if index != util.IntAll(info["ca_isvisit_index"]) {
-			continue
-		}
-		info["ca_visit"] = 1
-		return true
-	}
-	return false
-}

+ 5 - 7
src/jfw/qrmanager/qrmanager.go

@@ -50,13 +50,6 @@ func RedisInfo(oid, action, sione, sitwo string, i int, hsn *httpsession.Session
 	//活动页模块
 	//活动页模块
 	if len(Rurl) > 1 && strings.Contains(Rurl, "id=") {
 	if len(Rurl) > 1 && strings.Contains(Rurl, "id=") {
 		activeCode := strings.Split(Rurl, "id=")[1]
 		activeCode := strings.Split(Rurl, "id=")[1]
-		if strings.Contains(activeCode, "pcbaiduSEM") {
-			activeCode = "pcbaiduSEM"
-		} else if strings.Contains(activeCode, "360SEM") {
-			activeCode = "360SEM"
-		} else if strings.Contains(activeCode, "sogouSEM") {
-			activeCode = "sogouSEM"
-		}
 		//首先查看是否从百度等搜索引擎过来的referer
 		//首先查看是否从百度等搜索引擎过来的referer
 		sourcelist := Seoconfig["source"].(map[string]interface{})
 		sourcelist := Seoconfig["source"].(map[string]interface{})
 		for k, v := range sourcelist {
 		for k, v := range sourcelist {
@@ -68,6 +61,11 @@ func RedisInfo(oid, action, sione, sitwo string, i int, hsn *httpsession.Session
 				}
 				}
 			}
 			}
 		}
 		}
+		if hsn.Get("RSource") == nil {
+			hsn.Set("RSource", activeCode)
+			hsn.Set("RModule", activeCode+"活动页")
+			hsn.Set("RActiveCode", activeCode)
+		}
 	}
 	}
 	userData["RModule"] = hsn.Get("RModule")
 	userData["RModule"] = hsn.Get("RModule")
 	userData["RActiveCode"] = hsn.Get("RActiveCode")
 	userData["RActiveCode"] = hsn.Get("RActiveCode")

+ 2 - 1
src/seo.json

@@ -396,7 +396,8 @@
 		"xinan":"信安CA证书精灵",
 		"xinan":"信安CA证书精灵",
 		"xinlang":"新浪网广告",
 		"xinlang":"新浪网广告",
 		"zhishiyingxiao":"百度知识营销",
 		"zhishiyingxiao":"百度知识营销",
-		"landpage":"新落地页"
+		"landpage":"新落地页",
+		"peixunwang":"招投标培训网"
 	},
 	},
 	"advList":{
 	"advList":{
 		"专属味道":"oIMvJvjdp91QL-T7kVweryz58L9I"
 		"专属味道":"oIMvJvjdp91QL-T7kVweryz58L9I"

+ 9 - 4
src/web/staticres/dataExport/css/previewData.css

@@ -1,3 +1,8 @@
+* {
+    -webkit-overflow-scrolling: touch;
+    -webkit-tap-highlight-color:rgba(0,0,0,0);
+    -webkit-tap-highlight-color:transparent;
+}
 body{
 body{
 	padding: 0;
 	padding: 0;
 	margin:0;
 	margin:0;
@@ -24,10 +29,10 @@ body{
     white-space: nowrap;
     white-space: nowrap;
 }
 }
 .d_bz tr:nth-child(odd),.d_gj tr:nth-child(odd){
 .d_bz tr:nth-child(odd),.d_gj tr:nth-child(odd){
-	background-color: #f9f9f9;
+	background-color: rgba(0,0,0,.02);
 }
 }
 .d_bz tr:nth-child(even),.d_gj tr:nth-child(even){
 .d_bz tr:nth-child(even),.d_gj tr:nth-child(even){
-	background-color: #ffffff;
+/*	background-color: #ffffff;*/
 }
 }
 
 
 .d_bz{
 .d_bz{
@@ -175,14 +180,14 @@ body{
 	height:50px;
 	height:50px;
 	margin-bottom:5px;
 	margin-bottom:5px;
 }
 }
-.sy{
+/*.sy{
     background: url("/dataExport/image/sy.png");
     background: url("/dataExport/image/sy.png");
     position: absolute;
     position: absolute;
     top: 0px;
     top: 0px;
     left: 0px;
     left: 0px;
     opacity: 0.5;    
     opacity: 0.5;    
 	margin-top: 55px;
 	margin-top: 55px;
-}
+}*/
 .fimg{
 .fimg{
 	opacity: 0;
 	opacity: 0;
 	position: absolute;	
 	position: absolute;	

+ 1 - 1
src/web/staticres/js/login.js

@@ -597,7 +597,7 @@ function changeER(){
 }
 }
 function loginBtnType(){
 function loginBtnType(){
 	var href = window.location.pathname;
 	var href = window.location.pathname;
-	if (href=="/"||href.indexOf("subscribe")>-1||href.indexOf("advservices")>-1||href.indexOf("aboutus")>-1||href.indexOf("busicooperation")>-1){
+	if (href=="/"||href.indexOf("subscribe")>-1||href.indexOf("advservices")>-1||href.indexOf("aboutus")>-1||href.indexOf("busicooperation")>-1||href.indexOf("pcindex.html")>-1){
 		$(".loginBtn").attr("onmouseover","this.style.borderColor='#2cb7ca'; this.style.color='#2cb7ca';");
 		$(".loginBtn").attr("onmouseover","this.style.borderColor='#2cb7ca'; this.style.color='#2cb7ca';");
 		$(".loginBtn").attr("onmouseout","this.style.borderColor='#fff'; this.style.color='#fff';");
 		$(".loginBtn").attr("onmouseout","this.style.borderColor='#fff'; this.style.color='#fff';");
 	}else if(href.indexOf("topics")>-1){
 	}else if(href.indexOf("topics")>-1){

+ 10 - 0
src/web/staticres/vipsubscribe/js/common.js

@@ -139,6 +139,16 @@ function getsubVipOrderPriceBybuyset(buyset, t, price) {
         }
         }
     }
     }
 	var vipbuyset = JSON.parse(JSON.stringify(buyset));
 	var vipbuyset = JSON.parse(JSON.stringify(buyset));
+	
+	if (!$.isEmptyObject(vipbuyset.citys)) {
+		for (var i in vipbuyset.citys) {
+			if(vipbuyset.citys[i]>price.cityMaxCount){
+				vipbuyset.areacount++
+				delete vipbuyset.citys[i]
+			}
+		}
+	}
+	
     //当省份数量大于price.ProvinceMaxCount 按照全国计算
     //当省份数量大于price.ProvinceMaxCount 按照全国计算
     if (vipbuyset.areacount > price.provinceMaxCount) {
     if (vipbuyset.areacount > price.provinceMaxCount) {
         vipbuyset.areacount = -1
         vipbuyset.areacount = -1

+ 6 - 4
src/web/staticres/vipsubscribe/js/updateArea.js

@@ -643,7 +643,9 @@ $(function () {
         //     province: 0,
         //     province: 0,
         //     city: 0
         //     city: 0
         // }
         // }
-		sessionStorage.removeItem("vipAddCount");
+		// sessionStorage.removeItem("vipAddCount");
+		// sessionStorage.removeItem("vipSubSelectAreaAdd");
+		// sessionStorage.removeItem("vipSubSelectCity");
         // 数组置0,在重新从数据中计算初始状态结果并返回
         // 数组置0,在重新从数据中计算初始状态结果并返回
         for (let i in alreadyBuy) {
         for (let i in alreadyBuy) {
             for(let ii in alreadyBuy[i]) {
             for(let ii in alreadyBuy[i]) {
@@ -746,10 +748,10 @@ $(function () {
 
 
     // ----------------------- 以下数据交互 ------------------
     // ----------------------- 以下数据交互 ------------------
     $DoPost("/subscribepay/renewUpgrade/getBuyMsg", {}, function (data) {
     $DoPost("/subscribepay/renewUpgrade/getBuyMsg", {}, function (data) {
-    	if(data){
+    	if(data.success){
         	areaData["data"] = {
         	areaData["data"] = {
-        		"area" : data.area,
-        		"buyset" : data.buyset, 
+        		"area" : data.data.area,
+        		"buyset" : data.data.buyset, 
         	}
         	}
         	init();
         	init();
     	}
     	}

+ 55 - 60
src/web/templates/weixin/dataExport/dataExport_previewData.html

@@ -1,21 +1,16 @@
 <html>
 <html>
 	<head>
 	<head>
-		<meta charset="utf-8">
-		<title>预览数据</title>
-		<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
-		<script src="{{Msg "seo" "cdn"}}/js/rem.js"></script>
-		<link rel="stylesheet" type="text/css" href="{{Msg "seo" "cdn"}}/wx_dataExport/iconfont/iconfont.css" />					<link rel="stylesheet" href="{{Msg "seo" "cdn"}}/dataExport/css/previewData.css?v={{Msg "seo" "version"}}">
-		<link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wx_dataExport/css/preview_data.css">
+		{{include "/common/meta.html"}}
+		<title>预览数据</title>		
+		<link href="/jyapp/css/layout.css?v={{Msg "seo" "version"}}" rel="stylesheet">
+		<link href="/jyapp/css/font.css?v={{Msg "seo" "version"}}" rel="stylesheet">
+		<link rel="stylesheet" type="text/css" href="/jyapp/dataExport/iconfont/iconfont.css" />
+		<link rel="stylesheet" href="/jyapp/dataExport/css/preview_data.css">
+		<link rel="stylesheet" href="/jyapp/dataExport/css/previewData.css?v={{Msg "seo" "version"}}11">
 		<script src="https://cdn.bootcss.com/js-polyfills/0.1.42/polyfill.min.js"></script>
 		<script src="https://cdn.bootcss.com/js-polyfills/0.1.42/polyfill.min.js"></script>
+		<script src="/jyapp/js/jquery-3.2.1.min.js"></script>
+		{{include "/common/js.html"}}
 		<style>
 		<style>
-			@font-face {
-				font-style: normal;
-			    font-weight: normal;
-				font-family: 'MyNewFont';
-				src: url('/fonts/ttf/{{.T.ttf}}.eot');  /* IE 9 - 11 */
-    			src: url('/fonts/ttf/{{.T.ttf}}.eot?#iefix') format('embedded-opentype'), /* IE Fix for IE 6-8*/
-				url("/fonts/ttf/{{.T.ttf}}.ttf") format("truetype");  /* chrome、firefox、opera、Safari, Android, iOS 4.2+ */
-			}
 			body{
 			body{
 				-webkit-text-size-adjust: none;
 				-webkit-text-size-adjust: none;
 			}
 			}
@@ -26,7 +21,6 @@
 			    background: #382f3d;
 			    background: #382f3d;
 			    z-index: 999999999990;
 			    z-index: 999999999990;
 				opacity: .7;
 				opacity: .7;
-				    margin-top: -55px;
 			}
 			}
 			body .loading_ > p {
 			body .loading_ > p {
 			    position: absolute;
 			    position: absolute;
@@ -60,20 +54,35 @@
 			  100% {
 			  100% {
 			    transform: rotate(360deg); } 
 			    transform: rotate(360deg); } 
 			}
 			}
+			.app-layout-content-b {
+				display: flex;
+				flex-direction: column;
+				width: 100%;
+			}
 			.buttons-tab{
 			.buttons-tab{
-				position: fixed;
+				/*position: absolute;
 			    top: 0px;
 			    top: 0px;
 			    left: 0px;
 			    left: 0px;
 			    right: 0px;
 			    right: 0px;
-				z-index: 9999;    
+				z-index: 9999; */
+				width: 100%;
+				   
 				height: 51px;
 				height: 51px;
     			background: #fff;
     			background: #fff;
     			font-size: 16px;
     			font-size: 16px;
+				top: 20px;
+			}
+			.tab-container {
+				margin-top: 3px;
+				flex: 1;
+				width: 100%;
+				overflow: scroll;
+				border-top: 1px solid transparent
 			}
 			}
 			#d_bz{
 			#d_bz{
-				margin-top:55px;
 				position:relative;
 				position:relative;
 				margin-bottom:10px;
 				margin-bottom:10px;
+				background: url("/jyapp/dataExport/images/sy.png") repeat;
 			}
 			}
 			.fimg{
 			.fimg{
 				margin-top:55px;
 				margin-top:55px;
@@ -135,38 +144,32 @@
 			    font-size: 16px;
 			    font-size: 16px;
 				text-align: center;
 				text-align: center;
 			}
 			}
-			.noData_{
-				width: 200px;
-			    height: 50px;
-			    position: absolute;
-			    top: 40%;
-			    left: 50%;
-			    margin-left: -100px;
-			    font-size: 16px;
-				text-align: center;
-			}
 		</style>
 		</style>
 	</head>
 	</head>
 	<body>
 	<body>
 		<div class="loading_" style="display:none;">
 		<div class="loading_" style="display:none;">
 			<p><span></span></p>
 			<p><span></span></p>
 		</div>
 		</div>
-		<div class="buttons-tab">
-			<ul>
-				<li class="tab-link active">标准字段包</li>
-				<li class="tab-link ">高级字段包</li>
-			</ul>
+		<div class="app-layout-header">
+			<span class="app-back jyapp-icon jyapp-icon-zuojiantou"></span>
+			预览数据
 		</div>
 		</div>
-		<div class="tabs"  style="min-width:2020px;">
-			<table id="d_bz" class="d_bz" cellspacing="0" cellpadding="0" >
-				
-			</table>
-			<div class="sy">
+		<div class="app-layout-content-b">
+			<div class="buttons-tab">
+				<ul>
+					<li class="tab-link active">标准字段包</li>
+					<li class="tab-link ">高级字段包</li>
+				</ul>
 			</div>
 			</div>
+			<div class="tab-container">
+				<div class="tabs">
+					<table id="d_bz" class="d_bz" cellspacing="0" cellpadding="0" >
+						
+					</table>
+				</div>
+			</div>
+			<div class="noData" style="display:none;">今日已超出预览次数</div>
 		</div>
 		</div>
-		<div class="noData_" style="display:none;">暂无数据</div>
-		<div class="noData" style="display:none;">今日已超出预览次数</div>
-		<script src="{{Msg "seo" "cdn"}}/wx_dataExport/js/zepto.js"></script>
 		<script>
 		<script>
 			var bz = '<tr><td>序号</td><td>公告标题</td><td>公告内容</td><td>剑鱼标讯地址</td><td>省份</td><td>城市</td><td>发布时间</td><td>项目名称</td><td>采购单位</td><td>中标单位</td><td>中标价<br>(万元)</td><td>币种</td><td>公告类别</td></tr>';
 			var bz = '<tr><td>序号</td><td>公告标题</td><td>公告内容</td><td>剑鱼标讯地址</td><td>省份</td><td>城市</td><td>发布时间</td><td>项目名称</td><td>采购单位</td><td>中标单位</td><td>中标价<br>(万元)</td><td>币种</td><td>公告类别</td></tr>';
 			var gj = '<tr><td>序号</td><td>公告标题</td><td>公告内容</td><td>公告地址</td><td>剑鱼标讯地址</td><td>省份</td><td>城市</td><td>发布时间</td><td>项目名称</td><td>项目编号</td><td>采购单位</td><td>采购单位<br>联系人</td><td>采购单位<br>联系电话</td><td>预算<br>(万元)</td><td>开标日期</td><td>中标单位</td><td>中标价<br>(万元)</td><td>招标机构</td><td>项目范围</td><td>币种</td><td>公告类别</td></tr>';
 			var gj = '<tr><td>序号</td><td>公告标题</td><td>公告内容</td><td>公告地址</td><td>剑鱼标讯地址</td><td>省份</td><td>城市</td><td>发布时间</td><td>项目名称</td><td>项目编号</td><td>采购单位</td><td>采购单位<br>联系人</td><td>采购单位<br>联系电话</td><td>预算<br>(万元)</td><td>开标日期</td><td>中标单位</td><td>中标价<br>(万元)</td><td>招标机构</td><td>项目范围</td><td>币种</td><td>公告类别</td></tr>';
@@ -177,22 +180,23 @@
 				$(".buttons-tab .tab-link").each(function() {
 				$(".buttons-tab .tab-link").each(function() {
 					var index = $(this).index();
 					var index = $(this).index();
 					$(".buttons-tab .tab-link").eq(0).addClass("active");
 					$(".buttons-tab .tab-link").eq(0).addClass("active");
+
 					$(this).click(function() {
 					$(this).click(function() {
 						loading(true);
 						loading(true);
 						tab(parseInt(index)+1);
 						tab(parseInt(index)+1);
 						$(this).addClass("active").siblings().removeClass("active");
 						$(this).addClass("active").siblings().removeClass("active");
 					})
 					})
-				});
+				})
 				$(".buttons-tab .tab-link").eq((parseInt({{.T.dataType}})-parseInt(1))).addClass("active").siblings().removeClass("active");
 				$(".buttons-tab .tab-link").eq((parseInt({{.T.dataType}})-parseInt(1))).addClass("active").siblings().removeClass("active");
 			})
 			})
 			//
 			//
 			function tab(t){
 			function tab(t){
-				$.post("/front/wx_dataExport/getPreview",{dataType:t,_id:{{.T.id}}},function(r){
+				$.post("/jyapp/front/dataExport/getPreview",{dataType:t,_id:{{.T.id}}},function(r){
 					if(r.res.data){
 					if(r.res.data){
 						var res = r.res.data;
 						var res = r.res.data;
 						var aHtml = bz;
 						var aHtml = bz;
 						if(t==2){
 						if(t==2){
-							$(".tabs").css("min-width","4020px");
+							$(".tabs").css("min-width","2820px");
 							$("#d_bz").attr("class","d_gj");
 							$("#d_bz").attr("class","d_gj");
 							aHtml = gj;
 							aHtml = gj;
 							var a = 0;
 							var a = 0;
@@ -240,7 +244,6 @@
 										+'<td>'+res[i]["subtype"]+'</td>'
 										+'<td>'+res[i]["subtype"]+'</td>'
 										+'</tr>';
 										+'</tr>';
 							}
 							}
-
 						}
 						}
 						$("#d_bz").html(aHtml);
 						$("#d_bz").html(aHtml);
 						$('td').each(function(){
 						$('td').each(function(){
@@ -251,16 +254,12 @@
 						});
 						});
 						makeP();
 						makeP();
 					}else if(r.res.msg){
 					}else if(r.res.msg){
-						var msg = r.res.msg
-						if(msg=="超出预览次数"){
-							$(".tabs").css({"min-width":"0px","display": "none"});
-							$(".noData").show();
-							loading(false);
-							return
-						}
+						$(".tabs").css({"min-width":"0px","display": "none"});
+						$(".noData").text("今日已超出预览次数").show();
+						loading(false);
 					}else{
 					}else{
 						$(".tabs").css({"min-width":"0px","display": "none"});
 						$(".tabs").css({"min-width":"0px","display": "none"});
-						$(".noData_").show();
+						$(".noData").text("暂无数据").show();
 						loading(false);
 						loading(false);
 					}
 					}
 				})
 				})
@@ -277,15 +276,11 @@
 			function makeP(){
 			function makeP(){
 				var w=$("table").width();
 				var w=$("table").width();
 				var h=$("table").height();
 				var h=$("table").height();
-				$(".sy").width($("table").width()).height($("table").height());
-				//html2canvas(document.querySelector(".tabs")).then(function(canvas){
-				//		var url=canvas.toDataURL('image/png');
-				//		$("body").append("<img class=\"fimg\" src=\""+url+"\">");
-				//		$("body img").width(w);
-				//});
+				//$(".sy").width($("table").width()).height($("table").height());
 				loading(false);
 				loading(false);
 			}
 			}
 		</script>
 		</script>
-	{{include "/common/baiducc.html"}}
+<!--百度统计end-->
+{{include "/common/baiducc.html"}}
 	</body>
 	</body>
 </html>
 </html>

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

@@ -274,7 +274,7 @@
 	}
 	}
 	</style>
 	</style>
 </head>
 </head>
-<body>
+<body  style="min-height:100vh;">
 
 
 <!--主题内容-->
 <!--主题内容-->
 <section id="searchIndex" class="hidden" style="transform: none;">
 <section id="searchIndex" class="hidden" style="transform: none;">

+ 0 - 881
src/web/templates/weixin/vipsubscribe/choose_area_upgrades.html

@@ -1,881 +0,0 @@
-<!DOCTYPE html>
-<html>
-
-<head>
-    <meta charset="utf-8">
-    <title>区域选择</title>
-    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
-    <meta name="apple-mobile-web-app-capable" content="yes">
-    <meta name="apple-mobile-web-app-status-bar-style" content="black">
-    <script src="/vipsubscribe/js/rem.js?v={{Msg "seo" "version"}}"></script>
-    <link rel="stylesheet" href="/vipsubscribe/css/weui.min.css?v={{Msg "seo" "version"}}">
-    <link rel="stylesheet" type="text/css" href="/vipsubscribe/css/base.css?v={{Msg "seo" "version"}}" />
-    <link rel="stylesheet" type="text/css" href="/vipsubscribe/iconfont/iconfont.css?v={{Msg "seo" "version"}}" />
-    <link rel="stylesheet" href="/vipsubscribe/css/public.css?v={{Msg "seo" "version"}}">
-    <link rel="stylesheet" href="/vipsubscribe/css/choose_area.css?v={{Msg "seo" "version"}}4">
-	{{include "/common/weixin.html"}}
-	<!--<script src="{{Msg "seo" "cdn"}}/wxswordfish/share.js?v={{Msg "seo" "version"}}"></script>-->
-	<script src="/vipsubscribe/js/share.js?v={{Msg "seo" "version"}}"></script>
-</head>
-<style type="text/css">
-	body,html {
-		height: 100%;
-	}
-</style>
-<body>
-	<script type="text/javascript">
-		initShare({{.T.signature}},{{.T.openid}},2,"jy_extend",{{.T.nickname}},{{.T.avatar}});
-	</script>
-    <div id="choose_area" >
-        <div class="result">
-            <!-- 首次购买 显示"已选择" -----  升级订阅显示"已新增" -->
-            <p class="result_text line_two"> 已新增:<span class="result_name"></span>
-                <a href="javascript:;" class="detail">详情</a>
-            </p>
-            <a href="javascript:;" class="packup" style="display: none;">收起</a>
-        </div>
-        <div class="form">
-            <div class="select-area-box">
-                <ul class="area-list">
-                    <li>
-                        <div class="tab whole">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox other">全国
-                            </div>
-                        </div>
-                    </li>
-                    <li class="index" id="A">A</li>
-                    <li>
-                        <div class="tab">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">安徽
-                            </div>
-                            <span><i class="icon iconfont">&#xe600;</i></span>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <li>
-                        <div class="tab municipality">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">澳门
-                            </div>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <li class="index" id="B">B</li>
-                    <li>
-                        <div class="tab municipality">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">北京
-                            </div>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <li class="index" id="C">C</li>
-                    <li>
-                        <div class="tab municipality">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">重庆
-                            </div>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <li class="index" id="F">F</li>
-                    <li>
-                        <div class="tab">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">福建
-                            </div>
-                            <span><i class="icon iconfont">&#xe600;</i></span>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <li class="index" id="G">G</li>
-                    <li>
-                        <div class="tab">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">广东
-                            </div>
-                            <span><i class="icon iconfont">&#xe600;</i></span>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <li>
-                        <div class="tab">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">广西
-                            </div>
-                            <span><i class="icon iconfont">&#xe600;</i></span>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <li>
-                        <div class="tab">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">贵州
-                            </div>
-                            <span><i class="icon iconfont">&#xe600;</i></span>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <li>
-                        <div class="tab">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">甘肃
-                            </div>
-                            <span><i class="icon iconfont">&#xe600;</i></span>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <li class="index" id="H">H</li>
-                    <li>
-                        <div class="tab">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">河北
-                            </div>
-                            <span><i class="icon iconfont">&#xe600;</i></span>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <li>
-                        <div class="tab">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">湖北
-                            </div>
-                            <span><i class="icon iconfont">&#xe600;</i></span>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <li>
-                        <div class="tab">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">黑龙江
-                            </div>
-                            <span><i class="icon iconfont">&#xe600;</i></span>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <li>
-                        <div class="tab">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">海南
-                            </div>
-                            <span><i class="icon iconfont">&#xe600;</i></span>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <li>
-                        <div class="tab">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">河南
-                            </div>
-                            <span><i class="icon iconfont">&#xe600;</i></span>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <li>
-                        <div class="tab">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">湖南
-                            </div>
-                            <span><i class="icon iconfont">&#xe600;</i></span>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <p class="index" id="J">J</p>
-                    <li>
-                        <div class="tab">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">吉林
-                            </div>
-                            <span><i class="icon iconfont">&#xe600;</i></span>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <li>
-                        <div class="tab">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">江苏
-                            </div>
-                            <span><i class="icon iconfont">&#xe600;</i></span>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <li>
-                        <div class="tab">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">江西
-                            </div>
-                            <span><i class="icon iconfont">&#xe600;</i></span>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <li class="index" id="L">L</li>
-                    <li>
-                        <div class="tab">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">辽宁
-                            </div>
-                            <span><i class="icon iconfont">&#xe600;</i></span>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <li class="index" id="N">N</li>
-                    <li>
-                        <div class="tab">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">内蒙古
-                            </div>
-                            <span><i class="icon iconfont">&#xe600;</i></span>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <li>
-                        <div class="tab">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">宁夏
-                            </div>
-                            <span><i class="icon iconfont">&#xe600;</i></span>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <li class="index" id="Q">Q</li>
-                    <li>
-                        <div class="tab">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">青海
-                            </div>
-                            <span><i class="icon iconfont">&#xe600;</i></span>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <li class="index" id="S">S</li>
-                    <li>
-                        <div class="tab">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">山西
-                            </div>
-                            <span><i class="icon iconfont">&#xe600;</i></span>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <li>
-                        <div class="tab">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">陕西
-                            </div>
-                            <span><i class="icon iconfont">&#xe600;</i></span>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <li>
-                        <div class="tab municipality">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">上海
-                            </div>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <li>
-                        <div class="tab">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">山东
-                            </div>
-                            <span><i class="icon iconfont">&#xe600;</i></span>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <li>
-                        <div class="tab">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">四川
-                            </div>
-                            <span><i class="icon iconfont">&#xe600;</i></span>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <li class="index" id="T">T</li>
-                    <li>
-                        <div class="tab municipality">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">天津
-                            </div>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <li>
-                        <div class="tab municipality">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">台湾
-                            </div>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <li class="index" id="X">X</li>
-                    <li>
-                        <div class="tab">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">西藏
-                            </div>
-                            <span><i class="icon iconfont">&#xe600;</i></span>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <li>
-                        <div class="tab">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">新疆
-                            </div>
-                            <span><i class="icon iconfont">&#xe600;</i></span>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <li>
-                        <div class="tab municipality">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">香港
-                            </div>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <li class="index" id="Y">Y</li>
-                    <li>
-                        <div class="tab">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">云南
-                            </div>
-                            <span><i class="icon iconfont">&#xe600;</i></span>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                    <li class="index" id="Z">Z</li>
-                    <li>
-                        <div class="tab">
-                            <div class="province">
-                                <input type="checkbox" class="checkbox">浙江
-                            </div>
-                            <span class="down-icon"><i class="icon iconfont">&#xe600;</i></span>
-                        </div>
-                        <div class="tab_content clearfix"></div>
-                    </li>
-                </ul>
-                
-            </div>
-        </div>
-        <div class="tips_btn">
-            <div class="tips_discount">
-                <!--<div class="tips_d_money" style="display: block">&yen;38</div>-->
-                <div class="tips_d_text citys">已选择4个市,建议购买“全省”。</div>
-                <div class="tips_d_text all">已选择10个省,建议购买“全国”。</div>
-            </div>
-            <div class="btns">
-                <button class="reset-btn">重置</button>
-                <button class="save-btn">确认</button>
-            </div>
-        </div>
-        <div class="slide">
-            <a href="javascript:;">#</a>
-            <a href="javascript:;">A</a>
-            <a href="javascript:;">B</a>
-            <a href="javascript:;">C</a>
-            <a href="javascript:;">F</a>
-            <a href="javascript:;">G</a>
-            <a href="javascript:;">H</a>
-            <a href="javascript:;">J</a>
-            <a href="javascript:;">L</a>
-            <a href="javascript:;">N</a>
-            <a href="javascript:;">Q</a>
-            <a href="javascript:;">S</a>
-            <a href="javascript:;">T</a>
-            <a href="javascript:;">X</a>
-            <a href="javascript:;">Y</a>
-            <a href="javascript:;">Z</a>
-        </div>
-    </div>
-    <script src="/vipsubscribe/js/jquery-2.1.4.js?v={{Msg "seo" "version"}}"></script>
-    <!--<script src="/vipsubscribe/js/fastclick.js?v={{Msg "seo" "version"}}"></script>-->
-    <script src="/vipsubscribe/js/mapJSON.js?v={{Msg "seo" "version"}}"></script>
-    <script src="/vipsubscribe/js/common.js?v={{Msg "seo" "version"}}"></script>
-    <script>
-    	//已购买
-    	var buystr = "";
-    	var areaData = {};
-        $DoPost("/subscribepay/renewUpgrade/getBuyMsg", {}, function (data) {
-        	if(data){
-            	buystr = data.area;
-            	areaData["data"] = {
-            		"area" : data.area,
-            		"buyset" : data.buyset, 
-            	}
-            	console.log(areaData)
-        	}
-        }, false);
-//      console.log(buystr)
-      var AreaChoose={
-        selectObj:{},//已选择,未购买城市;
-        buyObj:{},//已购买
-        selectedIndustryArr:["一个行业"],//计算价格临时变量
-        timeSelect:[1,2],//计算价格临时变量 timeSelect[0]时长  timeSelect[1] 1:年 2:月
-        vipSubisTrial:false,
-        inintData:function(){
-          //已选择
-          try{
-            let select =sessionStorage.getItem("vipSubSelectAreaUpgrade");
-            if(select){
-              this.selectObj=JSON.parse(select);
-            }
-            if(sessionStorage.getItem("vipSubSelectIndustryUpgrade")){
-              this.selectedIndustryArr=JSON.parse(sessionStorage.getItem("vipSubSelectIndustryUpgrade"));
-            }
-            if(sessionStorage.getItem("vipSubSelectTime")){
-              this.timeSelect=JSON.parse(sessionStorage.getItem("vipSubSelectTime"));
-            }
-            //
-            this.buyObj = buystr;
-            if(checkObj(buystr)){
-            	this.buyObj = {"全国":[]}
-            }
-//          console.log(this.buyObj)
-            //是否试用界面
-            if(sessionStorage.getItem("vipSubisTrial")) this.vipSubisTrial=true;
-          }catch(e){
-            console.log(e);
-            this.selectObj={};
-          }
-        },
-        inintPage:function(){//初始化省份城市选项   
-          $(".select-area-box ul li:not('.index')").each(function () {
-              var text = $(this).find(".province").text().trim()
-              var data = null
-              chinaMapJSON.some(function (v) {
-                  data = v
-                  return v.name.indexOf(text) !== -1
-              })
-              var box = $(this).find('div.tab_content')
-              var html = AreaChoose.createMoreCity(data.city)
-              box.html(html)
-          })
-        },
-        createMoreCity:function(arr){
-          var tempHtml = arr.map(function (v) {
-                return '<button class="city">' + v.name + '</button>'
-            }).join('')
-            return tempHtml
-        },
-        showSelected:function(canClick){ //回显已选择
-        	var ran = "";
-            if(canClick){
-            	ran = this.selectObj;
-            }else{
-            	ran = this.buyObj;
-            }    
-            for(var province in ran) {
-      			let citys=ran[province]
-	            if(citys.length>0){//地市
-	                this.selectCity(citys,canClick)
-	            }else{//省份
-	                this.selectProvince(province,canClick)
-	            }
-	        }
-        },
-        selectProvince:function(province,canClick){ //设置选中省份 province 省份
-          $($('.tab .province')).each(function (index, dom) {
-            if (province == $.trim($(dom).text())) {
-              $(".checkbox.other").attr("checked", false); //取消全国选中
-              $(dom).children('.checkbox').attr({"checked": true,"disabled":!canClick});//选中此省份
-              if(canClick){
-              	$(dom).parents().siblings('.tab_content').find(".city").addClass("active").attr({"disabled":!canClick});
-              }else{
-              	$(dom).parents().siblings('.tab_content').find(".city").attr({"disabled":!canClick});
-              }
-            }
-            if(!canClick){
-            	if(province === "全国"){
-	            	$('.tab .province').each(function(){
-	            		$(this).children('.checkbox').attr({"checked": true,"disabled":!canClick});//选中此省份
-	            	});
-	            	$('.tab_content .city').each(function(){
-	            		$(this).attr("disabled",!canClick);
-	            	});
-	            }
-            }
-          })
-        },
-        selectCity:function(citys,canClick){ //设置选中城市
-          citys.forEach(v => {
-            $($('.tab_content .city')).each(function (index, dom) {
-                if (v == $(dom).text()) {
-                    $(".checkbox.other").attr("checked", false); //取消全国选中
-                    if(canClick){
-                    	$(dom).addClass('active').attr('disabled', !canClick).parents().siblings('.tab')
-                        .addClass('selected').children('.province').children('.checkbox').attr({
-                            "checked": true
-                        })
-                    }else{
-                    	$(dom).attr('disabled', !canClick).parents().siblings('.tab')
-                        .addClass('selected').children('.province').children('.checkbox').attr({
-                            "checked": true,
-                            "disabled": "disabled"
-                        })
-                        $(dom).parents().slideDown(500);
-                    }
-                }
-            })
-          })
-        },
-        getResult:function(){   /* 选中结果 */
-          //如果选中所有,则转为全国
-          if($(".city").length==$(".city.active").length){
-            $(".checkbox.other").trigger("click");
-            return
-          }
-          this.selectObj = {};
-          $('.result_name').empty()
-          var data = []; //定义一个总数组
-          var cityArr =[]; //定义一个选中城市数组
-          var provincesArr = [];
-          var val = $('.other').parents('.province').text().trim();
-          if ($('.other').is(':checked')) {
-            // data.push(val)
-            data =[{name:val,children:[]}] //全国
-          }
-          $(".tab_content").find(".city.active:not('[disabled]')").each(function () {
-              var length = $(this).parent('.tab_content').find('.city').length; //省份下城市的length
-              var activeLeng = $(this).parent('.tab_content').find('.city.active').length; //省份下选中城市的length
-              let arr =[];
-              // 判断省份下的城市是否等于选中的城市长度,相等就是全部选中
-              if (length == activeLeng) {
-                  $('.tips_btn .tips_d_text.citys').hide();
-                  // data.push($(this).parent('.tab_content').siblings('.tab:not(.whole)').children('.province').text().trim())
-                  let province = $(this).parent('.tab_content').siblings('.tab:not(.whole)').children('.province').text().trim();
-                  data.push({
-                      name:province,
-                      children:[]
-                  });
-                  provincesArr.push(province);
-              } else { 
-                  let province = $(this).parent('.tab_content').siblings('.tab:not(.whole)').children('.province').text().trim();
-                  let city = $(this).html()
-                  arr.push({name:city,parent:province})
-                  for(let i =0;i<arr.length;i++){
-                      let obj ={};
-                      obj.name = arr[i].name;
-                      obj.parent = arr[i].parent;
-                      cityArr.push(obj)
-                  }
-                  data.push({
-                      name:province,
-                      children:cityArr
-                  })
-              }
-              if(activeLeng > 0){
-              	$(".tips_btn .btns .reset-btn").removeAttr("disabled");
-              	$(".tips_btn .btns .save-btn").removeAttr("disabled");
-              }
-          })
-          //数组对象去重
-          let obj = {};
-          data = data.reduce((cur,next) =>{
-              obj[next.name] ? "" : obj[next.name] = true && cur.push(next);
-              return cur
-          },[]);
-          
-          // 数组筛选
-          let result = data.map(v =>{
-              let filterArr = v.children.filter(s =>{
-                 return s.parent === v.name
-              })
-              return {
-                  name:v.name,
-                  children:filterArr
-              }
-          })
-          var html = '';
-          for (var i = 0; i < result.length; i++) {
-              let children = result[i].children;
-              if( children.length >0){
-                  // 判断每个省份下选中的城市长度,当大于等于4的时候 弹出"选择全省更划算的弹窗"
-                  let childrenArr=[];
-                  if (children.length >= 3 && !this.vipSubisTrial) {
-                      $('.tips_btn .tips_d_text.citys').text("已选择"+children.length+"个市,建议购买“全省”");
-                      $('.tips_btn .tips_d_text.citys').show();
-                  }else{
-                  		$('.tips_btn .tips_d_text.citys').hide();
-                  }
-                  html += `${result[i].name}(`
-                  for(var j = 0;j < children.length;j++){
-                      childrenArr.push(children[j].name)
-                      if (j != children.length - 1) {
-                          html += `${children[j].name}、`
-                      } else {
-                          html += `${children[j].name}`
-                      }
-                  }
-                  if(i !=result.length -1){
-                      html += `)、`
-                  }else{
-                      html += `)`
-                  }
-                  this.selectObj[result[i].name]=childrenArr;//
-              }else{
-                  if(i !=result.length -1){
-                      html += `${result[i].name}、`
-                  }else{
-                      html += `${result[i].name}`
-                  }
-                  this.selectObj[result[i].name]=[];//
-              }
-          }
-          	for (var x = 0; x < provincesArr.length; x++) {
-	            for (var j =x+1; j <provincesArr.length; ) {
-	                if (provincesArr[x] === provincesArr[j]){
-	                    provincesArr.splice(j, 1);
-	                }
-	                else j++;
-	            }
-	        }
-          	if(provincesArr.length > 9){
-          		$('.tips_d_text.all').text("已选择"+provincesArr.length+"个省,建议购买“全国”");
-          		$('.tips_d_text.all').show();
-          		$('.tips_d_text.citys').hide();
-          	}else{
-          		$('.tips_d_text.all').hide();
-          	}
-//        console.log("this.selectObj:",this.selectObj)
-          $('.result_name').append(html)
-          AreaChoose.isOpen()
-        },
-        submitArea:function(){
-          let addCity = $('.result_name').text(); //新增的城市
-          sessionStorage.setItem("vipSubSelectAreaUpgrade",JSON.stringify(AreaChoose.selectObj));
-          history.go(-1);
-        },
-        isAllSelected:function(){
-          var _f = true
-          $($('.tab_content .city')).each(function (index, dom) {
-              if ($(dom).hasClass('active')) {
-                  _f = false
-                  $('.other').prop('checked', false);
-              }
-          })
-          // 如果循环结束仍为true说明 没有全部都被选中
-          if (_f) {
-//            $('.other').prop('checked', true);
-				$(".tips_btn .btns .reset-btn").attr("disabled","disabled");
-        		$(".tips_btn .btns .save-btn").attr("disabled","disabled");
-          }
-        },
-        isOpen:function(){
-          let pHeight = $('.result_text').height()
-          let minHeight = $('.result_text').css('min-height')
-          let rows = Math.round(Math.round(pHeight)/ parseFloat(minHeight));
-          $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
-//        console.log("高度:"+ pHeight,"最小高度"+ minHeight,"行数:" + rows)
-          if(rows == 1){
-              if(length >= 50){
-                  $('.detail').show()
-                  $('.packup').hide()
-              }else{
-                  $('.detail').hide()
-                  $('.packup').hide()
-              }
-          }else if(rows == 2){
-//            console.log($('.result_name').html().trim().length)
-              let length = $('.result_name').html().trim().length;
-              if(length >= 50){
-                  $('.detail').show()
-                  $('.packup').hide()
-              }else{
-                  $('.detail').hide()
-                  $('.packup').hide()
-              }
-              
-          } else{
-              $('.packup').show()
-              $('.detail').hide()
-          }
-        },
-        inintClick:function(){
-//      	$('.tab_content').each(function(){
-//        		AreaChoose.showSelected(false);
-//      	})
-          $('.detail').click(function () {  
-                $('.result_text').removeClass('line_two')
-                $(".result").css("padding-bottom","0.3rem")
-                $(this).hide();
-                $('.packup').show()
-                $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
-            })
-            $('.packup').click(function () { 
-                $(".result").css("padding-bottom","0.2rem")
-                $('.result_text').addClass('line_two')
-                $(this).hide();
-                $('.detail').show()
-                $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
-            })
-            $("body").on('click','.slide a',function(){
-                var s = $(this).html()
-                if(s == '#'){
-                    return;
-                }
-                document.querySelector('#' + s).scrollIntoView({block:'center'});
-            })
-          $(".select-area-box .tab:not(.municipality)").on('click', function (event) {
-                if($(this).next('.tab_content:not(:animated)').css("display") == "block"){
-                    $(this).children().children('i').css({
-                        "display":"inline-block",
-                        "transform":"rotate(0)"
-                    })
-                }else{
-                    $(this).children().children('i').css({
-                        "display":"inline-block",
-                        "transform":"rotate(-180deg)"
-                    })
-                }
-                $(this).toggleClass('selected').next('.tab_content:not(:animated)').stop(true, true).slideToggle()
-                $(this).parent().siblings().children('.tab').removeClass('selected');
-                
-            })
-            $('.checkbox').click(function (e) {  
-                e.stopPropagation();
-            })
-            $('.province .checkbox:not(.other)').on('change', function () {
-                var isCheckded = $(this).is(':checked')
-                if (isCheckded) {
-                    $(this).parents('.tab').siblings('.tab_content').find('.city').addClass('active')
-                    $(this).parents('.tab').siblings('.tab_content').find('.city[disabled]').removeClass('active')
-                    AreaChoose.isAllSelected()
-                    AreaChoose.getResult() 
-                    AreaChoose.showSelected(false);
-                } else {
-                    $(this).parents('.tab').siblings('.tab_content').find('.city').removeClass(
-                        'active')
-                    $(this).parents('.tab').siblings('.tab_content').find('.city').attr('disabled',false);    
-                    AreaChoose.isAllSelected()
-                    AreaChoose.getResult() 
-                    AreaChoose.showSelected(false);
-                }
-            })
-
-            //执行已购买城市函操作dom函数
-            $('.tab_content').on('click', '.city', function () {
-            	AreaChoose.showSelected(false);
-                $(this).toggleClass('active')
-                var isActive = $(this).parent().find('.city.active').length
-                if (isActive) {
-                    var input = $(this).parents('li').find('input.checkbox')
-                    window.input = input
-                    input.prop('checked', true)
-                    AreaChoose.isAllSelected()
-                    AreaChoose.getResult() 
-                } else {
-                    $(this).parent('div').siblings('.tab').children().children('.checkbox').prop(
-                        'checked', false)
-                    AreaChoose.isAllSelected()
-                    AreaChoose.getResult() 
-                }
-            })
-
-            $('.other').on('change', function () { //选择全国
-              	AreaChoose.reset();
-            })
-
-            $('.save-btn').click(function () {  // 提交
-                AreaChoose.submitArea();              
-            })
-            $('.reset-btn').click(function () {  //重置
-//            if(!$(".other").is(':checked')){
-//              $(".other").trigger("click");
-//            }
-				$('.tab:not(.whole):not(.tab[disabled])').removeClass('selected').children('.province').find(
-                    'input').prop({
-                    'checked': false,
-                    "disabled": false
-                });
-                $('.tab_content').find('.city:not(.city[disabled])').removeClass('active').attr({
-                    "disabled": false,
-                    "checked": false
-                })
-				AreaChoose.showSelected(false);
-				AreaChoose.getResult();
-				sessionStorage.removeItem("vipSubSelectAreaUpgrade");
-            })
-            //
-            if(sessionStorage.vipSubSelectAreaUpgrade!==undefined&&sessionStorage.vipSubSelectAreaUpgrade!==""){
-            	let areas = JSON.parse(sessionStorage.vipSubSelectAreaUpgrade);
-            	for(var province in areas){
-            		if(province === "全国"){
-              			$(".other").prop("checked",true);
-              			AreaChoose.reset();
-            		}
-            	}
-            }
-        },
-        reset:function(){
-           var checked = $(".other").is(':checked');
-            if (checked) {
-                $('.tab_content').slideUp(500)
-                $('.tab span i').css({
-                    "display":"inline-block",
-                    "transform":"rotate(0)"
-                })
-                $('.tab:not(.whole):not(.tab[disabled])').removeClass('selected').children('.province').find(
-                    'input').prop({
-                    'checked': false,
-                    "disabled": false
-                });
-                $('.tab_content').find('.city:not(.city[disabled])').removeClass('active').attr({
-                    "disabled": false,
-                    "checked": false
-                })
-                AreaChoose.getResult();
-                $(".tips_btn .btns .reset-btn").removeAttr("disabled");
-            	$(".tips_btn .btns .save-btn").removeAttr("disabled");
-            }else{
-            	AreaChoose.showSelected(false);
-                AreaChoose.getResult();
-                $(".tips_btn .btns .reset-btn").attr("disabled","disabled");
-            	$(".tips_btn .btns .save-btn").attr("disabled","disabled");
-            }
-        }
-      }
-      
-      $(function () {
-            AreaChoose.isOpen()
-            AreaChoose.inintData(); //初始化 已选择和已购买数据
-            AreaChoose.inintPage(); //初始化城市数据
-            AreaChoose.showSelected(false);
-            AreaChoose.showSelected(true);//回显已选择
-            /* 判断已购买的城市 在不在 全部城市里面,在,将按钮置灰,不可点击 */
-
-            AreaChoose.getResult();
-            AreaChoose.inintClick();
-        })
-      //
-        //
-	    function checkObj(obj) {
-		    //检验数组
-		    if (Array.prototype.isPrototypeOf(obj) && obj.length === 0) {
-		        return true;
-		    }
-		    //检验对象
-		    if (Object.prototype.isPrototypeOf(obj) && Object.keys(obj).length === 0) {
-		        return true;
-		    }
-		    return false;
-		}
-	    //
-	    if($(".result_name").text()===""){
-	    	$(".tips_btn .btns .reset-btn").attr("disabled","disabled");
-        	$(".tips_btn .btns .save-btn").attr("disabled","disabled");
-	    }
-	    
-	    if(sessionStorage.vipSubSelectAreaUpgrade!==undefined && sessionStorage.vipSubSelectAreaUpgrade!==""){
-	    	$(".tips_btn .btns .reset-btn").removeAttr("disabled");
-            $(".tips_btn .btns .save-btn").removeAttr("disabled");
-	    }
-
-    </script>
-</body>
-
-</html>

+ 3 - 3
src/web/templates/weixin/vipsubscribe/choose_industry_upgrade.html

@@ -474,11 +474,11 @@
                 }
                 }
                 //已购买行业
                 //已购买行业
                 $DoPost("/subscribepay/renewUpgrade/getBuyMsg", {}, function (data) {
                 $DoPost("/subscribepay/renewUpgrade/getBuyMsg", {}, function (data) {
-                	if(data){
-		            	buyIndustry = data.buyerclass;
+                	if(data.success){
+		            	buyIndustry = data.data.buyerclass;
 		            	buyLen = buyIndustry.length
 		            	buyLen = buyIndustry.length
 		            	buyIndustryLen = buyIndustry.length;
 		            	buyIndustryLen = buyIndustry.length;
-		            	buyset = Number(data.buyset.buyerclasscount);
+		            	buyset = Number(data.data.buyset.buyerclasscount);
 		            	if(sessionStorage.buyIndustry !== undefined){
 		            	if(sessionStorage.buyIndustry !== undefined){
 							$(".buyset").text(sessionStorage.buyIndustry);
 							$(".buyset").text(sessionStorage.buyIndustry);
 						}else{
 						}else{

+ 1 - 1
src/web/templates/weixin/vipsubscribe/keyWord.html

@@ -138,7 +138,7 @@
                     <strong class="weui-dialog__title">快速导入</strong>
                     <strong class="weui-dialog__title">快速导入</strong>
                 </div>
                 </div>
                 <div class="weui-dialog__bd">
                 <div class="weui-dialog__bd">
-                    快速导入可将免费版招标订阅内所设置的关键词及其排除词一并导入至“<span class="fastICName">未分类</span>"关键词分类内,无需再次手动输入,简化您的订阅过程。
+                    快速导入可将免费版招标订阅内所设置的关键词及其排除词一并导入至“<span class="fastICName">未分类</span>关键词分类内,无需再次手动输入,简化您的订阅过程。
 					<p style="color:#888;">注:地区与行业分类以VIP订阅设置内为准,不做导入。</p>
 					<p style="color:#888;">注:地区与行业分类以VIP订阅设置内为准,不做导入。</p>
                 </div>
                 </div>
                 <div class="weui-dialog__ft">
                 <div class="weui-dialog__ft">

+ 17 - 51
src/web/templates/weixin/vipsubscribe/renew_notice.html

@@ -153,14 +153,12 @@
 				},false);
 				},false);
 			}else{
 			}else{
 				$DoPost("/subscribepay/renewUpgrade/getBuyMsg", {}, function (data) {
 				$DoPost("/subscribepay/renewUpgrade/getBuyMsg", {}, function (data) {
-					if(data){
-						var area = data.allarea;
-					    var buyerclass = data.allindustry;
-					    var startTime = data.start;
-					    var endTime = data.end;
+					if(data.success){
+					    var startTime = data.data.start;
+					    var endTime = data.data.end;
 					    var exprie = {{.T.exprie}};
 					    var exprie = {{.T.exprie}};
-					    var vipStatus = Number(data.vipStatus);
-					    orderCode = data.orderCode;
+					    var vipStatus = Number(data.data.vipStatus);
+					    orderCode = data.data.orderCode;
 					    //
 					    //
 					    var areaHtml = "";
 					    var areaHtml = "";
 					    var provinceArr = [];
 					    var provinceArr = [];
@@ -169,35 +167,14 @@
 					    var buyerclassHtml = "";
 					    var buyerclassHtml = "";
 				//	    var dateName = "";
 				//	    var dateName = "";
 					    var dateHtml = "";
 					    var dateHtml = "";
-						var oldBuyset = data.buyset;
-				// 	    if (area !== "" && area !== undefined){
-				// 	    	for(var province in area){
-				// 	    		var citys = area[province]
-				// //	    		console.log(citys);
-				// 	    		if(citys.length===0){
-				// 	    			provinceArr.push(province);
-				// 	    		}else{
-				// 	    			for(var i in citys){
-				// 	    				var city = citys[i];
-				// 	    				cityArr.push(city);
-				// 	    			}
-				// 	    		}
-				// 	    	}
-				// 	    	var provinceLen = provinceArr.length;
-				// 	 		var cityLen = cityArr.length;
-				// 	    	areaHtml = provinceLen+"个省级区域、"+cityLen+"个市";
-					    	
-				// 			if(checkObj(area)){
-				// 				areaHtml = "全国";
-				// 			}
-				// 	    	$(".area-list").text(areaHtml);
-				// 	    }
+						var oldBuyset = data.data.buyset;
+				
 						if(oldBuyset!==""&&oldBuyset!==undefined){
 						if(oldBuyset!==""&&oldBuyset!==undefined){
 							let provinceLen = 0;
 							let provinceLen = 0;
 							provinceLen = oldBuyset.areacount
 							provinceLen = oldBuyset.areacount
 							let citys = oldBuyset.citys
 							let citys = oldBuyset.citys
 							let cityLen = 0;
 							let cityLen = 0;
-							let areaHtml = ";"
+							let areaHtml = "";
 							for(let i in citys){
 							for(let i in citys){
 								cityLen += citys[i];
 								cityLen += citys[i];
 							}
 							}
@@ -206,27 +183,16 @@
 							}else{
 							}else{
 								areaHtml = provinceLen+"个省级区域、"+cityLen+"个市";
 								areaHtml = provinceLen+"个省级区域、"+cityLen+"个市";
 							}
 							}
-							$(".item_area .label_for").text(areaHtml);
+							$(".area-list").text(areaHtml);
+							let industryLen = 0;
+							industryLen = oldBuyset.buyerclasscount;
+							if(industryLen === -1){
+								buyerclassHtml = "全行业";
+							}else{
+								buyerclassHtml = industryLen+"个行业";
+							}
+							$(".industry-list").text(buyerclassHtml);
 						}
 						}
-					    if(buyerclass !== "" && buyerclass !== undefined){
-					    	for(var i in buyerclass){
-					    		var industry = buyerclass[i];
-					    		buyerclassArr.push(industry);
-					    		buyerclassHtml = buyerclassArr.length+"个行业";
-					    	}
-					    	if(checkObj(buyerclass)){
-					    		buyerclassHtml = "全行业";
-					    	}
-					    	$('.industry-list').text(buyerclassHtml);
-					    }
-				//	    if(cycleunit !== "" && cycleunit !== undefined){
-				//	    	if(cycleunit === 1){
-				//	    		dateName = cyclecount + " 年";
-				//	    	}else if(cycleunit === 2){
-				//	    		dateName = cyclecount + " 个月";
-				//	    	}
-				//	    	$(".item_cycle .label_for").text(dateName);
-				//	    }
 					    if(startTime !== "" && endTime !== ""){
 					    if(startTime !== "" && endTime !== ""){
 					    	var start = startTime.toString().replace(/-/g, ".");
 					    	var start = startTime.toString().replace(/-/g, ".");
 					    	var end = endTime.toString().replace(/-/g, ".");
 					    	var end = endTime.toString().replace(/-/g, ".");

+ 48 - 27
src/web/templates/weixin/vipsubscribe/renew_pay.html

@@ -71,7 +71,7 @@
                             <p>
                             <p>
                                 <!-- 正常点击vip首页续费进入显示去升级,即将到期点击vip首页续费显示订阅修改 -->
                                 <!-- 正常点击vip首页续费进入显示去升级,即将到期点击vip首页续费显示订阅修改 -->
                                 <a href="/weixin/pay/toUpgradePage" class="go_update renew_upgrade">去升级</a>
                                 <a href="/weixin/pay/toUpgradePage" class="go_update renew_upgrade">去升级</a>
-                                <a href="/weixin/pay/vipsubscribe_willExpire" class="go_update renew_update">订阅修改</a>
+                                <a onclick="toWillExpire()" class="go_update renew_update">订阅修改</a>
                             </p>
                             </p>
                         </div>
                         </div>
                 </li>
                 </li>
@@ -591,17 +591,15 @@
 		var oldBuyset = "";
 		var oldBuyset = "";
 	    //
 	    //
 	    $DoPost("/subscribepay/renewUpgrade/getBuyMsg", {}, function (data) {
 	    $DoPost("/subscribepay/renewUpgrade/getBuyMsg", {}, function (data) {
-            if (data) {
-                area = data.area;
-			    buyerclass = data.buyerclass;
-			    areas = data.allarea;
-			    industrys = data.allindustry;
-			    cyclecount = data.cyclecount;
-			    startTime = data.start;
-			    starts = data.starttime;
-			    endTime = data.end;
-			    ends = data.endtime;
-				oldBuyset = data.buyset;
+            if (data.success) {
+                area = data.data.area;
+			    buyerclass = data.data.buyerclass;
+			    cyclecount = data.data.cyclecount;
+			    startTime = data.data.start;
+			    starts = data.data.starttime;
+			    endTime = data.data.end;
+			    ends = data.data.endtime;
+				oldBuyset = data.data.buyset;
 			    monthPrice = getsubVipOrderPriceBybuyset(oldBuyset, [1, 2]);
 			    monthPrice = getsubVipOrderPriceBybuyset(oldBuyset, [1, 2]);
 			    yearPrice = getsubVipOrderPriceBybuyset(oldBuyset, [1, 1]);
 			    yearPrice = getsubVipOrderPriceBybuyset(oldBuyset, [1, 1]);
 			    //
 			    //
@@ -650,18 +648,15 @@
 						areaHtml = provinceLen+"个省级区域、"+cityLen+"个市";
 						areaHtml = provinceLen+"个省级区域、"+cityLen+"个市";
 					}
 					}
 					$(".item_area .label_for").text(areaHtml);
 					$(".item_area .label_for").text(areaHtml);
+					let industryLen = 0;
+					industryLen = oldBuyset.buyerclasscount;
+					if(industryLen === -1){
+						buyerclassHtml = "全行业";
+					}else{
+						buyerclassHtml = industryLen+"个行业";
+					}
+					$(".item_industry .label_for").text(buyerclassHtml);
 				}
 				}
-			    if(industrys !== "" && industrys !== undefined){
-			    	for(var i in industrys){
-			    		var industry = industrys[i];
-			    		buyerclassArr.push(industry);
-			    		buyerclassHtml = buyerclassArr.length+"个行业";
-			    	}
-			    	if(checkObj(industrys)){
-			    		buyerclassHtml = "全行业";
-			    	}
-			    	$(".item_industry .label_for").text(buyerclassHtml);
-			    }
 			    if(startTime !== "" && endTime !== "" && startTime !== undefined && endTime !== undefined){
 			    if(startTime !== "" && endTime !== "" && startTime !== undefined && endTime !== undefined){
 			    	console.log(startTime)
 			    	console.log(startTime)
 			    	var start = startTime.replace(/-/g, ".");
 			    	var start = startTime.replace(/-/g, ".");
@@ -806,11 +801,20 @@
 	    }
 	    }
 	    //
 	    //
 	    $(".save_renew").on("click", function(){
 	    $(".save_renew").on("click", function(){
+			if(nowUpgrade>=36){
+				var overtimeWarning = `最长订阅周期不可超过3年<br />当前订阅周期:${nowUpgrade}个月`
+			    weui.toast(overtimeWarning, {
+			        duration: 3000,
+			        className: 'custom-toast',
+			        callback: function() {
+			        }
+			    })
+			}
 	        $(".save_renew").attr("disabled","disabled");
 	        $(".save_renew").attr("disabled","disabled");
 	    	var param = {
 	    	var param = {
-	    		"area": JSON.stringify(areas),
-	    		"industry": industrys.toString(),
-				"buyset": JSON.stringify(oldBuyset),
+	    		// "area": JSON.stringify(areas),
+	    		// "industry": industrys.toString(),
+				// "buyset": JSON.stringify(oldBuyset),
 	    		"time": $('.choose_item.select_cycle .info').val(),
 	    		"time": $('.choose_item.select_cycle .info').val(),
 	    		"payWay":"wx_js",
 	    		"payWay":"wx_js",
 	    		"pay_source": "Renew",
 	    		"pay_source": "Renew",
@@ -832,6 +836,20 @@
 	    	sessionStorage.removeItem("renew_price");
 	    	sessionStorage.removeItem("renew_price");
 	    	sessionStorage.removeItem("renew_finally_price");
 	    	sessionStorage.removeItem("renew_finally_price");
 	    	sessionStorage.removeItem("buyChecks");
 	    	sessionStorage.removeItem("buyChecks");
+			//
+			sessionStorage.removeItem("upgrade_cyclecount");
+			sessionStorage.removeItem("upgrade_cycleunit");
+			sessionStorage.removeItem("upgrade_price");
+			sessionStorage.removeItem("proPrice");
+			sessionStorage.removeItem("vipSubSelectAreaUpgrade");
+			sessionStorage.removeItem("vipSubSelectIndustryUpgrade");
+			sessionStorage.removeItem("vipSubSelectIndustryAdd");
+			sessionStorage.removeItem("vipSubSelectAreaAdd");
+			sessionStorage.removeItem("vipAddCount");
+			sessionStorage.removeItem("vipSubSelectCity");
+			sessionStorage.removeItem("buyCheck");
+			sessionStorage.removeItem("buyIndustry");
+			sessionStorage.removeItem("addIndustry");
 	    }
 	    }
 	    
 	    
 	    //
 	    //
@@ -846,7 +864,10 @@
 		    }
 		    }
 		    return false;
 		    return false;
 		}
 		}
-	    
+	  function toWillExpire(){
+      sessionStorage.removeItem("vipSubBuySet");
+      window.location.href="/weixin/pay/vipsubscribe_willExpire"
+    }  
     </script>
     </script>
 </body>
 </body>
 
 

+ 1 - 28
src/web/templates/weixin/vipsubscribe/vip_purchase.html

@@ -347,28 +347,7 @@
                     if (sessionStorage.getItem("vipSubSelectIndustry")) {
                     if (sessionStorage.getItem("vipSubSelectIndustry")) {
                         this.industrySelect = JSON.parse(sessionStorage.getItem("vipSubSelectIndustry"));
                         this.industrySelect = JSON.parse(sessionStorage.getItem("vipSubSelectIndustry"));
                     }
                     }
-                    {{if eq .T.orderType 5 }}
-                    $('#payHandle').text("立即续费");
-                    //即将到期 回显已购买
-                    if (!sessionStorage.getItem("vipSubSelectArea") || !sessionStorage.getItem("vipSubSelectIndustry")) {
-                        $DoPost("/subscribepay/editSub/getSubBuyMsg", {}, function (r) {
-                            if (r.success) {
-                                if (!$.isEmptyObject(r.data.area)) {
-                                    purchase.areaSelect = r.data.area
-                                } else {
-                                    purchase.areaSelect = {"全国": []}
-                                }
-                                if (r.data.industry.length != 0) {
-                                    purchase.industrySelect = r.data.industry
-                                } else {
-                                    purchase.industrySelect = ["全部行业"]
-                                }
-                                sessionStorage.setItem("vipSubSelectArea", JSON.stringify(purchase.areaSelect));
-                                sessionStorage.setItem("vipSubSelectIndustry", JSON.stringify(purchase.industrySelect));
-                            }
-                        }, false)
-                    }
-                    {{end}}
+                  
                     {{if .T.again}}    //再次购买回显
                     {{if .T.again}}    //再次购买回显
                     {{if eq .T.again 1 }}
                     {{if eq .T.again 1 }}
                     var orderCode = getParam("orderCode")
                     var orderCode = getParam("orderCode")
@@ -434,9 +413,6 @@
 
 
                 if (!$.isEmptyObject(this.areaSelect) && !this.areaSelect["全国"] && !this.areaSelect["一个省"]) { //选择有行业信息 且不是全国
                 if (!$.isEmptyObject(this.areaSelect) && !this.areaSelect["全国"] && !this.areaSelect["一个省"]) { //选择有行业信息 且不是全国
                     var tipTxt = "已选择 ";
                     var tipTxt = "已选择 ";
-                    {{if eq .T.orderType 5 }}
-                    tipTxt = "已购买 ";
-                    {{end}}
                     if (provinceArr.length > 0) tipTxt += provinceArr.length + " 个省级区域";
                     if (provinceArr.length > 0) tipTxt += provinceArr.length + " 个省级区域";
                     if (cityArr.length > 0) {
                     if (cityArr.length > 0) {
                         if (provinceArr.length > 0) tipTxt += "、";
                         if (provinceArr.length > 0) tipTxt += "、";
@@ -472,9 +448,6 @@
                 }*/
                 }*/
                 if (this.industrySelect.length > 0 && this.industrySelect[0] != "全部行业" && this.industrySelect[0] != "一个行业") { //选择有行业信息
                 if (this.industrySelect.length > 0 && this.industrySelect[0] != "全部行业" && this.industrySelect[0] != "一个行业") { //选择有行业信息
                     var tipTxt = "已选择 ";
                     var tipTxt = "已选择 ";
-                    {{if eq .T.orderType 5 }}
-                    tipTxt = "已购买 ";
-                    {{end}}
                     $(".choose_industry").val(tipTxt + this.industrySelect.length + " 个行业");
                     $(".choose_industry").val(tipTxt + this.industrySelect.length + " 个行业");
                 } else if (this.industrySelect.length > 0 && this.industrySelect[0] == "全部行业") {
                 } else if (this.industrySelect.length > 0 && this.industrySelect[0] == "全部行业") {
                     $(".choose_industry").val("全部行业");
                     $(".choose_industry").val("全部行业");

+ 53 - 215
src/web/templates/weixin/vipsubscribe/vip_upgrade.html

@@ -653,16 +653,17 @@
 			// 	$("#area").attr("placeholder", areaHtml);
 			// 	$("#area").attr("placeholder", areaHtml);
 			// }
 			// }
 	  //   }
 	  //   }
-		if(sessionStorage.vipAddCount!==""&&sessionStorage.vipAddCount!==undefined&&sessionStorage.vipSubSelectCity!==undefined&&sessionStorage.vipSubSelectCity!==""){
+		if(sessionStorage.vipAddCount!==""&&sessionStorage.vipAddCount!==undefined&&sessionStorage.vipSubSelectCity!==undefined&&sessionStorage.vipSubSelectCity!==""&&sessionStorage.vipSubSelectAreaAdd!==undefined){
 			var vipSubSelectArea = JSON.parse(sessionStorage.vipAddCount);
 			var vipSubSelectArea = JSON.parse(sessionStorage.vipAddCount);
+			var vipadd = JSON.parse(sessionStorage.vipSubSelectAreaAdd);
 			let cityLen = sessionStorage.vipSubSelectCity;
 			let cityLen = sessionStorage.vipSubSelectCity;
-			if(vipSubSelectArea.province === 0&&vipSubSelectArea.city === 0){
+			if(vipadd.country === -1){
 				areaHtml = "已新增全国";
 				areaHtml = "已新增全国";
 				$("#area").attr("placeholder", areaHtml);
 				$("#area").attr("placeholder", areaHtml);
 			}else{
 			}else{
 				areaHtml = "已新增 "+ vipSubSelectArea.province +" 个省级区域、"+ cityLen +" 个地市";
 				areaHtml = "已新增 "+ vipSubSelectArea.province +" 个省级区域、"+ cityLen +" 个地市";
 				if(Number(vipSubSelectArea.province) === 0 && Number(cityLen) === 0){
 				if(Number(vipSubSelectArea.province) === 0 && Number(cityLen) === 0){
-					areaHtml = "选择升级区域";
+					areaHtml = "选择升级区域";
 				}
 				}
 				$("#area").attr("placeholder", areaHtml);
 				$("#area").attr("placeholder", areaHtml);
 			}
 			}
@@ -737,18 +738,16 @@
 	    var ends = "";
 	    var ends = "";
 		var oldBuyset = "";
 		var oldBuyset = "";
 	 	$DoPost("/subscribepay/renewUpgrade/getBuyMsg", {}, function (data) {
 	 	$DoPost("/subscribepay/renewUpgrade/getBuyMsg", {}, function (data) {
-            if (data) {
-                area = data.area;
-			    buyerclass = data.buyerclass;
-			    buyArea = data.allarea;
-			    buyIndustry = data.allindustry;
-			    cycleunit = data.cycleunit;
-			    cyclecount = data.cyclecount;
-			    startTime = data.start;
-			    starts = data.starttime;
-			    endTime = data.end;
-			    ends = data.endtime;
-				oldBuyset = data.buyset;
+            if (data.success) {
+                area = data.data.area;
+			    buyerclass = data.data.buyerclass;
+			    cycleunit = data.data.cycleunit;
+			    cyclecount = data.data.cyclecount;
+			    startTime = data.data.start;
+			    starts = data.data.starttime;
+			    endTime = data.data.end;
+			    ends = data.data.endtime;
+				oldBuyset = data.data.buyset;
 			}
 			}
         },false);
         },false);
 		console.log("666666666333",oldBuyset)
 		console.log("666666666333",oldBuyset)
@@ -845,77 +844,13 @@
 						}
 						}
 					}
 					}
 				}
 				}
-				if(buyArea !== ""&&buyArea !== undefined){
-					for(let province in buyArea){
-			    		let citys = buyArea[province];
-			    		if(citys.length===0){
-							allBuyArea[province] = [];
-			    		}else{
-			    			allBuyArea[province] = citys;
-			    		}
-			    	}
-					for(let province in vipArea){
-						let citys = vipArea[province];
-						if(allBuyArea[province] === undefined){
-							allBuyArea[province] = citys
-						}else{
-							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;
-							}
-						}
-						if(province === "全国"){
-							allBuyArea = {"全国":[]};
-						}
-					}
-				}
-				// if(sessionStorage.vipSubSelectAreaAdd!==""&&sessionStorage.vipSubSelectAreaAdd!==undefined){
-				// 	areasArr = addAreaObj();
-				// }else{
-				// 	areasArr = null;
-				// }
+				
 				if(buyCheck){
 				if(buyCheck){
 					$(".save_upgrade").removeAttr("disabled");
 					$(".save_upgrade").removeAttr("disabled");
 				}
 				}
 			}else{
 			}else{
 				areas_arr = null
 				areas_arr = null
 				// areasArr = null
 				// areasArr = null
-				if(buyArea !== ""&&buyArea !== undefined){
-					// for(let province in buyArea){
-			  //   		let citys = buyArea[province];
-			  //   		if(citys.length===0){
-					// 		allArea[province] = [];
-			  //   		}else{
-			  //   			allArea[province] = citys;
-			  //   		}
-			  //   	}
-					for(let province in buyArea){
-			    		let citys = buyArea[province];
-			    		if(citys.length===0){
-							allBuyArea[province] = [];
-			    		}else{
-			    			allBuyArea[province] = citys;
-			    		}
-			    	}
-				}
 				if(area !== ""&&area !== undefined){
 				if(area !== ""&&area !== undefined){
 					for(let province in area){
 					for(let province in area){
 						let citys = area[province];
 						let citys = area[province];
@@ -928,33 +863,6 @@
 				}
 				}
 			}
 			}
 			//
 			//
-			// if(sessionStorage.vipSubSelectIndustryAdd!==""&&sessionStorage.vipSubSelectIndustryAdd!==undefined){
-			// 	var vipIndustry = JSON.parse(sessionStorage.vipSubSelectIndustryAdd);
-			// 	for(let i in vipIndustry){
-		 //    		let industry = vipIndustry[i];
-		 //    		industrysArr.push(industry);
-		 //        }
-			// 	for(let i in vipIndustry){
-			// 		if(industry === "全部行业"){
-			// 			industrysArr = ["全部行业"];
-			// 		}
-			// 	}
-			// }
-			//
-			// if(sessionStorage.vipSubSelectIndustryAdd!==""&&sessionStorage.vipSubSelectIndustryAdd!==undefined){
-			// 	var vipIndustry = JSON.parse(sessionStorage.vipSubSelectIndustryAdd);
-			// 	for(let i in vipIndustry){
-		 //    		let industry = vipIndustry[i];
-		 //    		industrysArr.push(industry);
-		 //        }
-			// 	for(let i in vipIndustry){
-			// 		if(industry === "全部行业"){
-			// 			industrysArr = ["全部行业"];
-			// 		}
-			// 	}
-			// }else{
-			// 	industrysArr = null;
-			// }
 			
 			
 			if(sessionStorage.vipSubSelectIndustryUpgrade!==""&&sessionStorage.vipSubSelectIndustryUpgrade!==undefined){
 			if(sessionStorage.vipSubSelectIndustryUpgrade!==""&&sessionStorage.vipSubSelectIndustryUpgrade!==undefined){
 				var vipIndustry = JSON.parse(sessionStorage.vipSubSelectIndustryUpgrade);
 				var vipIndustry = JSON.parse(sessionStorage.vipSubSelectIndustryUpgrade);
@@ -975,24 +883,14 @@
 					$(".save_upgrade").removeAttr("disabled");
 					$(".save_upgrade").removeAttr("disabled");
 				}
 				}
 			}else{
 			}else{
-				if(buyIndustry!==""&&buyIndustry!==undefined){
-					for(let i in buyIndustry){
-			    		let industry = buyIndustry[i];
+				if(buyerclass!==""&&buyerclass!==undefined){
+					for(let i in buyerclass){
+			    		let industry = buyerclass[i];
 			    		allIndustry.push(industry);
 			    		allIndustry.push(industry);
 			    	}
 			    	}
 			    }
 			    }
 			}
 			}
 			//
 			//
-			// if(industrysArr !== null){
-			// 	for (var x = 0; x < industrysArr.length; x++) {
-		 //            for (var j =x+1; j <industrysArr.length; ) {
-		 //                if (industrysArr[x] === industrysArr[j]){
-		 //                    industrysArr.splice(j, 1);
-		 //                }
-		 //                else j++;
-		 //            }
-		 //       	}
-			// }
 			for (var x = 0; x < allIndustry.length; x++) {
 			for (var x = 0; x < allIndustry.length; x++) {
 	            for (var j =x+1; j <allIndustry.length; ) {
 	            for (var j =x+1; j <allIndustry.length; ) {
 	                if (allIndustry[x] === allIndustry[j]){
 	                if (allIndustry[x] === allIndustry[j]){
@@ -1076,37 +974,10 @@
 			
 			
 			//
 			//
 			if(nowUpgradeYear >= 1){
 			if(nowUpgradeYear >= 1){
-				// ------- 升级价格交叉计算 ---------
-				// let addAreaPriceY = 0;
-				// let addAreaPriceM = 0;
-				// let oldAreaPriceY = 0;
-				// let oldAreaPriceM = 0;
-				// let addIndustryPriceY = 0;
-				// let addIndustryPriceM = 0;
-				// if(areasArr !== null&&industrysArr !== null){
-				// 	addAreaPriceY = getsubVipOrderPrice(areasArr,industrysArr,[nowUpgradeYear,1]);
-				// 	addAreaPriceM = getsubVipOrderPrice(areasArr,industrysArr,[nowUpgrade,2]);
-				// }
-				// if(areasArr !== null){
-				// 	oldAreaPriceY = getsubVipOrderPrice(areasArr,buyIndustry,[nowUpgradeYear,1]);
-				// 	oldAreaPriceM = getsubVipOrderPrice(areasArr,buyIndustry,[nowUpgrade,2]);
-				// }
-				// if(industrysArr !== null){
-				// 	addIndustryPriceY = getsubVipOrderPrice(buyArea,industrysArr,[nowUpgradeYear,1]);
-				// 	addIndustryPriceM = getsubVipOrderPrice(buyArea,industrysArr,[nowUpgrade,2]);
-				// }
-				// price = addAreaPriceY + addAreaPriceM + oldAreaPriceY + oldAreaPriceM + addIndustryPriceY + addIndustryPriceM;
-				// ------- 升级价格交叉计算 ---------
-				// ------- 升级价格差价计算 ---------
-				// 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]);
+				let newPriceY = getsubVipOrderPriceBybuyset(newBuysetObj(areaObj()),[nowUpgradeYear,1]);
+				let newPriceM = getsubVipOrderPriceBybuyset(newBuysetObj(areaObj()),[nowUpgrade,2]);
+				let yearprice = getsubVipOrderPriceBybuyset(newBuysetObj(areaObj()),[nowUpgradeYear,1]);
+				let monthprice = getsubVipOrderPriceBybuyset(newBuysetObj(areaObj()),[nowUpgrade,2]);
 				price = newPriceY + newPriceM - oldPrice;
 				price = newPriceY + newPriceM - oldPrice;
 				// ------- 升级延长周期价格计算 ---------
 				// ------- 升级延长周期价格计算 ---------
 				if(monthprice === 0){
 				if(monthprice === 0){
@@ -1121,28 +992,12 @@
 				console.log("monthprice",monthprice);
 				console.log("monthprice",monthprice);
 				console.log(">=1",price);
 				console.log(">=1",price);
 			}else{
 			}else{
-				// ------- 升级价格交叉计算 ---------
-				// let addAreaPriceM = 0;
-				// let oldAreaPriceM = 0;
-				// let addIndustryPriceM = 0;
-				// if(areasArr !== null&&industrysArr !== null){
-				// 	addAreaPriceM = getsubVipOrderPrice(areasArr,industrysArr,[nowUpgrade,2]);
-				// }
-				// if(areasArr !== null){
-				// 	oldAreaPriceM = getsubVipOrderPrice(areasArr,buyIndustry,[nowUpgrade,2]);
-				// }
-				// if(industrysArr !== null){
-				// 	addIndustryPriceM = getsubVipOrderPrice(buyArea,industrysArr,[nowUpgrade,2]);
-				// }
-				// price = addAreaPriceM + oldAreaPriceM + addIndustryPriceM;
-				// // ------- 升级价格交叉计算 ---------
-				// let monthprice = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgrade,2]);
-				let monthprice = getsubVipOrderPriceBybuyset(areaObj(),[nowUpgrade,2]);
+				let monthprice = getsubVipOrderPriceBybuyset(newBuysetObj(areaObj()),[nowUpgrade,2]);
 				
 				
 				// ------- 升级价格差价计算 ---------
 				// ------- 升级价格差价计算 ---------
 				
 				
 				// let newPrice = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgrade,2]);
 				// let newPrice = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgrade,2]);
-				let newPrice = getsubVipOrderPriceBybuyset(areaObj(),[nowUpgrade,2]);
+				let newPrice = getsubVipOrderPriceBybuyset(newBuysetObj(areaObj()),[nowUpgrade,2]);
 				price = newPrice - oldPrice;
 				price = newPrice - oldPrice;
 				// ------- 升级价格差价计算 ---------
 				// ------- 升级价格差价计算 ---------
 				// ------- 升级延长周期价格计算 ---------
 				// ------- 升级延长周期价格计算 ---------
@@ -1206,46 +1061,18 @@
         
         
         //
         //
         $(".save_upgrade").on("click", function(){
         $(".save_upgrade").on("click", function(){
+			if(nowRenew>36){
+				var overtimeWarning = `最长订阅周期不可超过3年<br />当前订阅周期:${nowRenew}个月`
+			    weui.toast(overtimeWarning, {
+			        duration: 3000,
+			        className: 'custom-toast',
+			        callback: function() {
+			        }
+			    })
+			    return
+			}
         	$(".save_upgrade").attr("disabled","disabled");
         	$(".save_upgrade").attr("disabled","disabled");
-        	//
-        	// let areas = areasArr;
-        	// let industrys = null;
-        	// if(sessionStorage.vipSubSelectIndustryUpgrade !== undefined){
-        	// 	industrys = JSON.parse(sessionStorage.vipSubSelectIndustryUpgrade);
-        	// }
-        	// let industryArr = "";
-        	// let areaArr = "";
-        	// if(areas !== null){
-        	// 	if(areas["全国"]){
-	        //         areas={};
-	        //     }
-        	// 	areaArr = JSON.stringify(areas);
-        	// }else{
-        	// 	areaArr = "no";
-        	// }
-        	// if(industrys !== null){
-        	// 	if(industrys.length==1&&industrys[0]=="全部行业"){
-	        //         industrys=[];
-	        //     }
-        	// 	industryArr = industrys.join(",");
-        	// }else{
-        	// 	industryArr = "no";
-        	// }
-        	//
-        	// if(areas_arr !== null){
-        	// 	if(areas_arr["全国"]){
-	        //         areas_arr={};
-	        //     }
-        	// 	areas_arr = JSON.stringify(areas_arr);
-        	// }else{
-        	// 	areas_arr = "no";
-        	// }
-        	if(allBuyArea["全国"]){
-                allBuyArea={};
-            }
             //
             //
-            let areaarr = buyArea;
-        	let industryarr = buyIndustry;
         	let allIndustryArr = allIndustry;
         	let allIndustryArr = allIndustry;
         	if(allArea["全国"]){
         	if(allArea["全国"]){
                 allArea={};
                 allArea={};
@@ -1275,12 +1102,6 @@
             }
             }
             //
             //
 	    	var param = {
 	    	var param = {
-	    		// "area": areas_arr,
-	    		// "industry": industryArr,
-	    		// "areas": JSON.stringify(areaarr),
-	    		// "areas_arr": areaArr,
-	    		// "industryarr": industryarr.join(","),
-	    		// "allArea": JSON.stringify(allAreaArr),
 	    		"allIndustry": allIndustryArr.join(","),
 	    		"allIndustry": allIndustryArr.join(","),
 	    		"allBuyArea": JSON.stringify(allArea),
 	    		"allBuyArea": JSON.stringify(allArea),
 	    		"payWay": "wx_js",
 	    		"payWay": "wx_js",
@@ -1289,7 +1110,6 @@
 	    		"addCount":vipCount,
 	    		"addCount":vipCount,
 	    		"addIndustryCount": vipIndustry,
 	    		"addIndustryCount": vipIndustry,
 				"buyset":JSON.stringify(areaObj()),
 				"buyset":JSON.stringify(areaObj()),
-				"oldbuyset":JSON.stringify(oldBuyset),
 	    	}
 	    	}
 	    	console.log(param)
 	    	console.log(param)
 	    	$DoPost("/subscribepay/renewUpgrade/renewUpgradeCreateOrder",param,function(r){
 	    	$DoPost("/subscribepay/renewUpgrade/renewUpgradeCreateOrder",param,function(r){
@@ -1331,6 +1151,12 @@
 	    	sessionStorage.removeItem("buyCheck");
 	    	sessionStorage.removeItem("buyCheck");
 			sessionStorage.removeItem("buyIndustry");
 			sessionStorage.removeItem("buyIndustry");
 			sessionStorage.removeItem("addIndustry");
 			sessionStorage.removeItem("addIndustry");
+			//
+			sessionStorage.removeItem("renew_cyclecount");
+			sessionStorage.removeItem("renew_cycleunit");
+			sessionStorage.removeItem("renew_price");
+			sessionStorage.removeItem("renew_finally_price");
+			sessionStorage.removeItem("buyChecks");
 	    }
 	    }
 	    
 	    
 	    //
 	    //
@@ -1427,9 +1253,21 @@
 				newbuyset.buyerclasscount = newbuyset.buyerclasscount + addindustrys.length;
 				newbuyset.buyerclasscount = newbuyset.buyerclasscount + addindustrys.length;
 			}
 			}
 		}
 		}
-		console.log("233333",newbuyset)
+		console.log(JSON.stringify(newbuyset))
 		return newbuyset
 		return newbuyset
 	}
 	}
+	
+	function newBuysetObj(buyset){
+		let newset = JSON.parse(JSON.stringify(buyset));
+		for(let n in newset.citys){
+			if(newset.citys[n] > 2){
+				let cityarr = newset.citys
+				delete cityarr[n]
+				newset.areacount += 1
+			}
+		}
+		return newset
+	}
 	    
 	    
     </script>
     </script>
 </body>
 </body>