Browse Source

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

wangkaiyue 5 years ago
parent
commit
4f8bc20fda

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

@@ -2448,7 +2448,7 @@ func (f *Front) HasPushHistory() {
 	}
 	area := f.GetString("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 == "" && area == "" && !isVipFlag {
 		flag, data := jy.SubscribePush.MakeHistoryDatas(public.MQFW, public.PushMysql, userId, public.PushView)
 		if flag && data != nil {
 			jsonBytes, err := json.Marshal(data)

+ 1 - 1
src/jfw/modules/pushsubscribe/src/match/job/timetask.go

@@ -20,7 +20,7 @@ type MatchTimeTask struct {
 }
 
 func (m *MatchTimeTask) Execute() {
-	hour := time.Hour
+	hour := time.Now().Hour()
 	//23点到1点之间,不执行定时任务
 	//订阅付费有每天0点的定时任务删除pushspace_temp表的数据,会有冲突
 	if hour < 23 && hour > 1 {

BIN
src/jfw/modules/pushsubscribe/src/match/match


+ 18 - 10
src/jfw/modules/pushsubscribe/src/push/job/projectjob.go

@@ -186,16 +186,7 @@ func (p *ProjectPushJob) Execute() {
 	}
 	ProjectTask.Pici = unix
 	util.WriteSysConfig("./projecttask.json", &ProjectTask)
-	sess := mongodb.GetMgoConn()
-	defer mongodb.DestoryMongoConn(sess)
-	_, err := sess.DB(DbName).C(Pushspace_project).RemoveAll(map[string]interface{}{
-		"comeintime": map[string]interface{}{
-			"$lt": time.Now().AddDate(0, -3, 0).Unix(),
-		},
-	})
-	if err != nil {
-		logger.Error("删除出错", err)
-	}
+	p.Clear()
 	logger.Info("关联项目推送任务结束。。。", unix)
 }
 
@@ -289,3 +280,20 @@ func (p *ProjectPushJob) loadProject() *sync.Map {
 	logger.Info("加载项目结束。。。", index)
 	return projectMap
 }
+
+//清理三个月前的数据
+func (p *ProjectPushJob) Clear() {
+	logger.Error("开始清理过期的关联项目数据。。。")
+	sess := mongodb.GetMgoConn()
+	defer mongodb.DestoryMongoConn(sess)
+	_, err := sess.DB(DbName).C(Pushspace_project).RemoveAll(map[string]interface{}{
+		"createtime": map[string]interface{}{
+			"$lt": time.Now().AddDate(0, -3, 0).Unix(),
+		},
+	})
+	if err != nil {
+		logger.Error("清理过期的关联项目数据错误", err)
+	} else {
+		logger.Error("清理过期的关联项目数据结束。。。")
+	}
+}

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

@@ -2,14 +2,10 @@ package job
 
 import (
 	"log"
-	. "public"
 	. "push/config"
 	"qfw/util"
-	"qfw/util/mongodb"
 	"strings"
 	"time"
-
-	"github.com/donnie4w/go-logger/logger"
 )
 
 type TimeTask struct{}
@@ -18,19 +14,7 @@ func (t *TimeTask) Run() {
 	go t.push() //推送
 	go t.move() //迁移数据
 	go t.crontab("01:00", func() {
-		logger.Error("开始每天1点删除过期关联项目数据错误。。。")
-		sess := mongodb.GetMgoConn()
-		defer mongodb.DestoryMongoConn(sess)
-		_, err := sess.DB(DbName).C(Pushspace_project).RemoveAll(map[string]interface{}{
-			"createtime": map[string]interface{}{
-				"$lt": time.Now().AddDate(0, -3, 0).Unix(),
-			},
-		})
-		if err != nil {
-			logger.Error("每天1点删除过期关联项目数据错误", err)
-		} else {
-			logger.Error("每天1点删除过期关联项目数据错误结束。。。")
-		}
+		Jobs.ProjectPush.Clear()
 	})
 }
 func (t *TimeTask) push() {

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


+ 3 - 3
src/jfw/modules/pushsubscribe/src/push/util/util.go

@@ -265,7 +265,7 @@ func SaveToPushsubscribe(isVipUser, isProjectInfo bool, userId string, matchInfo
 	}
 	//更新redis
 	subPush, err := jy.SubscribePush.GetTodayCache(userId)
-	if err == nil && subPush != nil {
+	if err == nil && subPush != nil && len(subPush.Datas) > 0 {
 		if nowymd := util.NowFormat(util.Date_Short_Layout); subPush.Date != nowymd {
 			subPush = &jy.SubPush{
 				Date:  nowymd,
@@ -279,7 +279,7 @@ func SaveToPushsubscribe(isVipUser, isProjectInfo bool, userId string, matchInfo
 	}
 	//全部列表缓存
 	allCache, err := jy.SubscribePush.GetAllCache(userId)
-	if err == nil && allCache != nil {
+	if err == nil && allCache != nil && len(allCache) > 0 {
 		subPush_datas = append(subPush_datas, allCache...)
 		if len(subPush_datas) > jy.AllSubPushCacheSize {
 			subPush_datas = subPush_datas[:jy.AllSubPushCacheSize]
@@ -288,7 +288,7 @@ func SaveToPushsubscribe(isVipUser, isProjectInfo bool, userId string, matchInfo
 	}
 	//最近7天50条redis缓存处理
 	sevenDayCache, err := jy.SubscribePush.GetSevenDayCache(userId)
-	if err == nil && sevenDayCache != nil {
+	if err == nil && sevenDayCache != nil && len(sevenDayCache) > 0 {
 		for _, v := range sevenDayCache {
 			if v.Ca_date > unix-SevenDay {
 				subPush_datas = append(subPush_datas, v)

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

@@ -223,7 +223,6 @@ func (this *vipSubscribeStruct) UpgradeSubVip(userId string, vmsg VipSimpleMsg,
 				"o_vipjy.a_buyerclass": vmsg.Industry, //设置行业
 				"o_vipjy.o_buyset":     buyset,
 				"l_vip_endtime":        endTime.Unix(),
-				"i_vip_status":         2,
 				"i_vip_expire_tip":     0,
 			}})
 
@@ -399,7 +398,7 @@ func (this *vipSubscribeStruct) GetSubVipPrice(area *map[string]interface{}, ind
 func (this *vipSubscribeStruct) GetSubVipPriceByBuySet(cityCountMap map[string]int, pCount, industryNum, count, unit int, isDiscount bool) int {
 	payMoney := func() int {
 		//城市选择过多时,转为省份
-		newCityMap := map[string]int{}//防止操作cityCountMap 影响原数据
+		newCityMap := map[string]int{} //防止操作cityCountMap 影响原数据
 		for cityName, cityCount := range cityCountMap {
 			if cityCount > SubVipPrice.CityMaxCount {
 				pCount++

+ 4 - 1
src/jfw/modules/subscribepay/src/service/index_p1.go

@@ -297,7 +297,10 @@ func getPushHistory(userId string) (result []*jy.SubPushList) {
 		return
 	}
 	subPush, err := jy.SubscribePush.GetSevenDayCache(userId)
-	if err == nil && subPush != nil {
+	if err != nil {
+		log.Println(userId, "GetSevenDayCache Error", err)
+	}
+	if err == nil && subPush != nil && len(subPush) > 0 {
 		result = subPush
 	} else {
 		findSQL := "select * from pushsubscribe where userid = '" + userId + "'  and date >= %d order by id desc limit 50"

+ 20 - 15
src/jfw/modules/subscribepay/src/service/vipRenewUpgrade.go

@@ -123,11 +123,15 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 			}
 		}
 
-		res, ok := util.MQFW.FindById("user", userId, `{"l_vip_endtime":1,"l_vip_starttime":1,"o_vipjy":1}`)
+		res, ok := util.MQFW.FindById("user", userId, `{"l_vip_endtime":1,"l_vip_starttime":1,"o_vipjy":1,i_vip_status:1}`)
 		if res == nil || len(*res) == 0 || !ok {
 			return &entity.FuncResult{false, errors.New("数据库操作异常"), nil}
 		}
 
+		vipStatus := qutil.IntAll((*res)["i_vip_status"])
+		if vipStatus == 1 {
+			return &entity.FuncResult{false, errors.New("试用用户不可升级或续费"), nil}
+		}
 		start := qutil.Int64All((*res)["l_vip_starttime"])
 		end := qutil.Int64All((*res)["l_vip_endtime"])
 		vipjy := (*res)["o_vipjy"].(map[string]interface{})
@@ -216,6 +220,7 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 			}
 			//------校验buyset、区域、行业是否异常
 			upgradeBuyset := entity.JyVipSubStruct.NewBuySet(allBuyArea, allIndustry)
+			log.Println("upgradeBuyset", upgradeBuyset)
 			if newICount != -1 {
 				if newICount < iCount {
 					return &entity.FuncResult{false, errors.New("非法请求"), nil}
@@ -230,22 +235,22 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 					return &entity.FuncResult{false, errors.New("非法请求"), nil}
 				}
 				//区域是否异常
-				if upgradeBuyset.AreaCount > newPCount || upgradeBuyset.AreaCount == -1 {
+				if upgradeBuyset.AreaCount == -1 {
 					return &entity.FuncResult{false, errors.New("非法请求"), nil}
 				}
-				for province, cityCount := range *cityArr {
-					if qutil.IntAll((*newCityArr)[province]) < qutil.IntAll(cityCount) {
-						return &entity.FuncResult{false, errors.New("非法请求"), nil}
-					}
-				}
-				citysMap := upgradeBuyset.Citys
-				for provinces, cityCounts := range *newCityArr {
-					if citysMap[provinces] != nil {
-						if qutil.IntAll(citysMap[provinces]) > qutil.IntAll(cityCounts) {
-							return &entity.FuncResult{false, errors.New("非法请求"), nil}
-						}
-					}
-				}
+				//				for province, cityCount := range *cityArr {
+				//					if qutil.IntAll((*newCityArr)[province]) < qutil.IntAll(cityCount) {
+				//						return &entity.FuncResult{false, errors.New("非法请求"), nil}
+				//					}
+				//				}
+				//				citysMap := upgradeBuyset.Citys
+				//				for provinces, cityCounts := range *newCityArr {
+				//					if citysMap[provinces] != nil {
+				//						if qutil.IntAll(citysMap[provinces]) > qutil.IntAll(cityCounts) {
+				//							return &entity.FuncResult{false, errors.New("非法请求"), nil}
+				//						}
+				//					}
+				//				}
 			}
 			//------校验buyset、区域、行业是否异常
 

+ 8 - 1
src/web/staticres/js/wxSupersearch.js

@@ -1999,7 +1999,14 @@ var SuperSearch = {
 				var _list = list[i];
 				var title = _list["title"];
 				if(SuperSearch.hasSubscribe){
-					title = keyWordHighlight(title,_list["matchkeys"],'<font class="keyword">$1</font>');
+					if(_list["matchkeys"]!=null&&typeof(_list["matchkeys"])!="undefined"){
+						for(var n=0;n<_list["matchkeys"].length;n++){
+							var matchkeys = _list["matchkeys"][n].split("+");
+							for(var nn=0;nn<matchkeys.length;nn++){
+								title = keyWordHighlight(title,matchkeys[nn],'<font class="keyword">$1</font>');
+							}
+						}
+					}
 				}else if(SuperSearch.myHistory!=null&&SuperSearch.myHistory.length>0){
 					title = keyWordHighlight(title,SuperSearch.myHistory,'<font class="keyword">$1</font>');
 				}

+ 1 - 1
src/web/staticres/vipsubscribe/css/addition_exclusive_word.css

@@ -3,7 +3,7 @@
   display: flex;
   flex-direction: column;
   justify-content: space-between;
-  width: 100;
+/*  width: 100;*/
   height: 100%;
   overflow: hidden;
 }

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

@@ -148,7 +148,6 @@ function getsubVipOrderPriceBybuyset(buyset, t, price) {
 			}
 		}
 	}
-	console.log(vipbuyset)
     //当省份数量大于price.ProvinceMaxCount 按照全国计算
     if (vipbuyset.areacount > price.provinceMaxCount) {
         vipbuyset.areacount = -1

+ 147 - 10
src/web/staticres/vipsubscribe/js/updateArea.js

@@ -73,7 +73,7 @@ $(function () {
     }
 
     // 新增求值 ---- 统计数量,不做视图操作
-    function getResult(callback) {
+    function getResult0(callback) {
         if (areaData.data.buyset.areacount === -1) {
             $('.result_text.add_new .added-info').hide()
             return
@@ -86,7 +86,7 @@ $(function () {
         
         // 已购买省份改变的数量
         let dBuySetProvinceCount = 0
-        // 已购买省份改变的数量
+        // 新增省份改变的数量
         let dAddedProvinceCount = 0
         
         // 已购买城市改变的数量
@@ -192,21 +192,157 @@ $(function () {
             isLockedTipButtons(false)
         }
     }
+	
+	
+	
+	// 新增求值 ---- 统计数量,不做视图操作
+	function getResult(callback) {
+	    if (areaData.data.buyset.areacount === -1) {
+	        $('.result_text.add_new .added-info').hide()
+	        return
+	    }
+	    // 升级新增清空
+	    $('.result_text.add_new .added-info').text('')
+	
+	    let isWholeSelected = $('.tab.whole input').is(':checked')
+	    let isWholeDisabled = $('.tab.whole input').prop('disabled')
+	    
+	    // 已购买省份改变的数量
+	    let dBuySetProvinceCount = 0
+	    // 新增省份改变的数量
+	    let dAddedProvinceCount = 0
+	    
+	    // 已购买城市改变的数量
+	    let dBuySetCityCount = 0
+	    // 新增城市的数量
+	    let dAddedCityCount = 0
+	    $('.area-list li:not(.index)').each(function(i, dom){
+	        if ($(dom).children('.tab').hasClass('whole')) return true
+	        // 统计非全国的数量
+	        // 没有'data-buy-city-count'属性的 $(dom).attr('data-buy-city-count') 为undefined
+	        if ($(dom).attr('data-buy-city-count')) {
+	            /********  此处判断的是已购买的城市下的  ********************/
+	            // 获取购买城市的数量
+	            let buyCount = $(dom).attr('data-buy-city-count') - 0   // 隐式转换成Number
+	            // 获取城市不可点击的数量
+	            let alreadySelectedCount = $(dom).find('button[disabled]').length
+	            // 选择城市的数量(包括不可点击的)
+	            let hasActiveCount = $(dom).find('button.active').length
+				let allCitylength = $(dom).find('button').length
+	
+	            if (hasActiveCount > buyCount) {
+					if (alreadySelectedCount - hasActiveCount === 0) {
+						dBuySetCityCount += buyCount
+						dBuySetProvinceCount ++
+					} else if (allCitylength === hasActiveCount) {
+						// 如果选中全省,则多修改
+						dBuySetCityCount += buyCount
+						dAddedProvinceCount ++
+					} else {
+						dBuySetCityCount += buyCount
+						dAddedCityCount += (hasActiveCount - buyCount)
+					}
+	            } else {
+	                // 操作已购买的数量
+	                dBuySetCityCount += hasActiveCount
+	            }
+	        } else {
+	            // 是不是直辖市或自治区,在有data-buy-count没必要判断
+	            let hasCities = $(dom).find('.tab').hasClass('municipality')
+	            // 是否购买过该省份(还需要判断该省份下面的城市是否全部disabled --- 同时满足才算购买过全省)
+	            let provinceInput = $(dom).find('input')
+	            // 循环着的当前的省份是否可选 和 是否被选中
+	            let isBoughtProvince = provinceInput.prop('disabled')
+	            let isChecked = provinceInput.is(':checked')
+	
+	            // 可得到已经购买的省份的数量(循环完成后可得到,循环过程中的值可能不全)
+	
+	            // 判断是否为购买过的城市
+	            if (isBoughtProvince) {
+	                // 将已购买(选中但不能单击的)城市选中
+	                if (isChecked) {
+	                    dBuySetProvinceCount ++
+	                }
+	            } else {
+	                // 判断是否是直辖市或自治区(省份下面没有城市的和有城市的分开计算)
+	                if (hasCities) {
+	                    // 直辖市、自治区 -----直接进行省份的操作
+	                    // 并且没有购买过该省的,并且选中的
+	                    if (isChecked) {
+	                        dAddedProvinceCount ++
+	                    }
+	                } else {
+	                    // 带有市的省份城市(该省份下以前没有购买过任何城市)
+	                    // 两种情况:1. 全选    2. 不全选
+	                    let allCityLength = $(dom).find('button').length
+	                    let otherTotalAddCount = $(dom).find('button.active').length
+	
+	                    if (allCityLength === otherTotalAddCount && isChecked) {
+	                        // 选中了省份下的所有城市
+	                        dAddedProvinceCount ++
+	                    } else {
+	                        // 对城市做新增操作
+	                        dAddedCityCount += otherTotalAddCount
+	                    }
+	                }
+	            }
+	        }
+	    })
+	
+	    // 循环完成判断已经选择的省份数量 是否 大于购买过的数量
+	    if (dBuySetProvinceCount + dAddedProvinceCount > alreadyBuy.province.totalCount) {
+	        // 如果已选择的数量和新增的数量大于已购买过的数量,说明我有购买新的城市
+	        dAddedProvinceCount -= (alreadyBuy.province.totalCount - dBuySetProvinceCount)
+	        dBuySetProvinceCount = alreadyBuy.province.totalCount
+	    } else {
+	        dBuySetProvinceCount += dAddedProvinceCount
+	        dAddedProvinceCount = 0
+	    }
+	
+	    // 已购买城市下选项改变,状态更新
+	    alreadyBuy.city.selectedCount = dBuySetCityCount
+	    newlyAdded.city = dAddedCityCount
+	
+	    alreadyBuy.province.selectedCount = dBuySetProvinceCount
+	    newlyAdded.province = dAddedProvinceCount
+	
+	    callback && callback()
+	
+	    setDataInResult()
+	
+	    // 全国被选中了
+	    if (isWholeSelected && !isWholeDisabled) {
+	        $('.result_text.add_new .added-info').text('全国')
+	        $('.result_text.add_new').show()
+	        isLockedTipButtons(false)
+	    }
+	}
+	
+	
 
     function setDataInResult() {
         let buySetInfo = {
-            p: `省级区域${alreadyBuy.province.selectedCount}/${alreadyBuy.province.totalCount}、`,
+            p: `省级区域${alreadyBuy.province.selectedCount}/${alreadyBuy.province.totalCount}`,
             c: `地市${alreadyBuy.city.selectedCount}/${alreadyBuy.city.totalCount}`
         }
         let addedInfo = {
-            p: `省级区域 ${newlyAdded.province}、`,
+            p: `省级区域 ${newlyAdded.province}`,
             c: `地市 ${newlyAdded.city}`
         }
 
         // 修改数量并进行重新赋值
-        $('.result_text.already .buy-set-info').text(buySetInfo.p + buySetInfo.c)
+		if (alreadyBuy.city.totalCount === 0) {
+			// 只买了省级区域
+			$('.result_text.already .buy-set-info').text(buySetInfo.p)
+		} else if (alreadyBuy.province.totalCount === 0){
+			// 只买了市
+			$('.result_text.already .buy-set-info').text(buySetInfo.c)
+		} else {
+			$('.result_text.already .buy-set-info').text(`${buySetInfo.p}、${buySetInfo.c}`)
+		}
+        
         // 升级新增赋值
-        $('.result_text.add_new .added-info').text(addedInfo.p + addedInfo.c)
+        $('.result_text.add_new .added-info').text(`${addedInfo.p}、${addedInfo.c}`)
 
         if (newlyAdded.province !== 0 || newlyAdded.city !== 0) {
             $('.result_text.add_new').show()
@@ -245,6 +381,7 @@ $(function () {
                 let pName = $(dom).find('.province').text().replace(/\s+ | [\r\n]/g, '')
                 // 获取当前dom下有几个按钮有active样式(点亮和灰色按钮的总数)
                 let activeButtonLength = $(dom).find('button.active').length
+				let allCitylength = $(dom).find('button').length
 
                 // 判断该省是否有购买过的城市
                 if ($(dom).attr('data-buy-city-count')) {
@@ -256,7 +393,7 @@ $(function () {
 					
                     if (aCityCount > 0) {
 						// 说明有购买的城市
-						if (activeButtonLength - alreadySelectedCount === 0) {
+						if (activeButtonLength - alreadySelectedCount === 0 || activeButtonLength === allCitylength) {
 							added.province ++
 						} else {
 							added.city[pName] = aCityCount
@@ -348,10 +485,10 @@ $(function () {
                         }
                     } else {
                         // 判断是否全省被选中
-                        if ($(dom).find('button.active:not([disabled])').length === allCitylength) {
+                        if ($(dom).find('button.active').length === allCitylength) {
                             arr.push(selectedObj)
                         } else {
-                            $(dom).find('button.active:not([disabled])').each(function(c, dom) {
+                            $(dom).find('button.active').each(function(c, dom) {
                                 let cName = $(dom).text().replace(/\s+ | [\r\n]/g, '')
                                 selectedObj.children.push(cName)
                             })
@@ -443,7 +580,7 @@ $(function () {
         }
         getResult()
     }
-
+	
     function isLockedTipButtons(f) {
         $('.tips_btn button').prop('disabled', f)
     }

+ 4 - 0
src/web/templates/weixin/vipsubscribe/additionWord.html

@@ -78,6 +78,10 @@
         var _addindex = -1;
 		var addkws_arr = {}
         $(function() {
+			(/iphone|ipod|ipad/i.test(navigator.appVersion)) && document.addEventListener('blur', function(e) {
+				// 这里加了个类型判断,因为a等元素也会触发blur事件
+				['input', 'textarea'].includes(e.target.localName) && document.body.scrollIntoView(true)
+			}, true)
             if(sessionStorage&&sessionStorage.addition_kws!=undefined){
                 addition_kws = JSON.parse(sessionStorage.addition_kws);
                 appendHtml(addition_kws);

+ 4 - 0
src/web/templates/weixin/vipsubscribe/exclusiveWord.html

@@ -77,6 +77,10 @@
         var _notindex = -1;
 		var notkws_arr = {}
         $(function() {
+			(/iphone|ipod|ipad/i.test(navigator.appVersion)) && document.addEventListener('blur', function(e) {
+				// 这里加了个类型判断,因为a等元素也会触发blur事件
+				['input', 'textarea'].includes(e.target.localName) && document.body.scrollIntoView(true)
+			}, true)
             if(sessionStorage&&sessionStorage.not_kws!=undefined){
                 not_kws = JSON.parse(sessionStorage.not_kws);
                 appendHtml(not_kws);

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

@@ -183,7 +183,7 @@
         </main>
         <!-- 当状态为待付款时显示去支付按钮 -->
         <!--当状态为已取消时显示再次购买按钮-->
-        <a href="#" class="button align" style="display:none">去支付<span class="cancel_time"></span></a>
+        <a class="button align" style="display:none">去支付<span class="cancel_time"></span></a>
     </div>
 </body>
 <script src="{{Msg "seo" "cdn"}}/vipsubscribe/js/jquery-2.1.4.js?v={{Msg "seo" "version"}}"></script>

+ 45 - 22
src/web/templates/weixin/vipsubscribe/vip_upgrade.html

@@ -501,7 +501,7 @@
 
         /* -------- 控制年份number_box的事件  点击1年 2年 3年触发的事件------- */
         $('#number_box_year').on('click', 'span', function (e) {
-            console.log(e.target.dataset.id)
+            // console.log(e.target.dataset.id)
             let id = e.target.dataset.id;
             // 当续费时间 + 当前已经买的时间超过36个月,给出提醒
             if((id*12+nowRenew)>36){
@@ -741,7 +741,7 @@
 				oldBuyset = data.data.buyset;
 			}
         },false);
-		console.log("666666666333",oldBuyset)
+		// console.log("666666666333",oldBuyset)
         //
         var completeMonth = 0;
         var completeYear = 0;
@@ -894,7 +894,7 @@
 	            }
 	       	}
 			
-			console.log("industrysArr",industrysArr);
+			// console.log("industrysArr",industrysArr);
 			//
 			if(endYear === nowYear){
 				if(endMonth === nowMonth){
@@ -928,7 +928,7 @@
 				}
 			}
 			nowRenew = nowUpgrade;
-			console.log("monthold",nowUpgrade)
+			// console.log("monthold",nowUpgrade)
 			//
 			var nowUpgradeYear = 0;
 			if(nowUpgrade >= 12 && nowUpgrade < 24){
@@ -942,8 +942,8 @@
 				nowUpgradeYear = nowUpgradeYear + 1;
 				nowUpgrade = 0;
 			}
-			console.log("year",nowUpgradeYear)
-			console.log("month",nowUpgrade)
+			// console.log("year",nowUpgradeYear)
+			// console.log("month",nowUpgrade)
 			//
 			if (nowUpgradeYear >= 1) {
 				// let monthprice = getsubVipOrderPrice(buyArea, buyIndustry, [nowUpgrade, 2])
@@ -963,8 +963,8 @@
 				oldMonthPrice = (oldPrice / nowUpgrade)
 				oldYearPrice = ((oldPrice / nowUpgrade) * 10).toFixed(1);
 			}
-			console.log("oldYearPrice",oldYearPrice)
-			console.log("oldMonthPrice",oldMonthPrice)
+			// console.log("oldYearPrice",oldYearPrice)
+			// console.log("oldMonthPrice",oldMonthPrice)
 			
 			//
 			if(nowUpgradeYear >= 1){
@@ -982,32 +982,32 @@
 					completeYear = ((monthprice / nowUpgrade)*10).toFixed(1);
 				}
 				// ------- 升级延长周期价格计算 ---------
-				console.log("yearprice",yearprice);
-				console.log("monthprice",monthprice);
-				console.log(">=1",price);
+				// console.log("yearprice",yearprice);
+				// console.log("monthprice",monthprice);
+				// console.log(">=1",price);
 			}else{
-				let monthprice = getsubVipOrderPriceBybuyset(newBuysetObj(areaObj()),[nowUpgrade,2]);
+				let monthprice = getsubVipOrderPriceBybuyset(buySetObj(newBuysetObj(areaObj())),[nowUpgrade,2]);
 				
 				// ------- 升级价格差价计算 ---------
 				
 				// let newPrice = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgrade,2]);
-				let newPrice = getsubVipOrderPriceBybuyset(newBuysetObj(areaObj()),[nowUpgrade,2]);
+				let newPrice = getsubVipOrderPriceBybuyset(buySetObj(newBuysetObj(areaObj())),[nowUpgrade,2]);
 				price = newPrice - oldPrice;
 				// ------- 升级价格差价计算 ---------
 				// ------- 升级延长周期价格计算 ---------
 				completeMonth = (monthprice / nowUpgrade).toFixed(1);
 				completeYear = ((monthprice / nowUpgrade)*10).toFixed(1);
 				// ------- 升级延长周期价格计算 ---------
-				console.log("<1",price)
+				// console.log("<1",price)
 			}
 			
-			console.log("oldPrice", oldPrice);
+			// console.log("oldPrice", oldPrice);
 			if(sessionStorage.vipSubSelectAreaUpgrade===undefined&&sessionStorage.vipSubSelectIndustryUpgrade===undefined){
 				completeMonth = oldMonthPrice;
 				completeYear = oldYearPrice;
 			}
-			console.log("completeMonth",completeMonth)
-			console.log("completeYear",completeYear)
+			// console.log("completeMonth",completeMonth)
+			// console.log("completeYear",completeYear)
 			// ------- 延长周期价格赋值 ---------
 			if(sessionStorage.upgrade_cyclecount !== undefined && sessionStorage.upgrade_cycleunit !== undefined){
 				if(sessionStorage.upgrade_cycleunit === "1"){
@@ -1027,14 +1027,14 @@
 			if(price>0){
 				var cPrice = (price).toFixed(1);
 			}
-			console.log(cPrice);
+			// console.log(cPrice);
 			if(sessionStorage.proPrice!==""&&sessionStorage.proPrice!==undefined){
 				let proPrice = sessionStorage.proPrice;
 				console.log("proprice",proPrice);
 				cPrice = (Number(cPrice) + Number(proPrice)).toFixed(1);
 			}
 			if(cPrice <= 0){
-				cPrice = 0;
+				cPrice = (0).toFixed(2);
 			}
 			$(".finally_price").html("¥"+cPrice);
 			//
@@ -1103,7 +1103,7 @@
 	    		"time": times,
 	    		"addCount":vipCount,
 	    		"addIndustryCount": vipIndustry,
-				"buyset":JSON.stringify(areaObj()),
+				"buyset":JSON.stringify(buySetObj(areaObj())),
 	    	}
 	    	console.log(param)
 	    	$DoPost("/subscribepay/renewUpgrade/renewUpgradeCreateOrder",param,function(r){
@@ -1175,7 +1175,7 @@
 			newbuyset.buyerclasscount = oldset.buyerclasscount;
 			newbuyset.citys = oldset.citys;
 			// let buyset = oldBuyset
-			console.log("11111",newbuyset)
+			// console.log("11111",newbuyset)
 			if(sessionStorage.vipSubSelectAreaAdd!==undefined&&sessionStorage.vipSubSelectAreaAdd!==""){
 				let addbuyset = JSON.parse(sessionStorage.vipSubSelectAreaAdd);
 				if(addbuyset.country !== -1){
@@ -1206,7 +1206,7 @@
 					newbuyset.buyerclasscount = newbuyset.buyerclasscount + addindustrys.length;
 				}
 			}
-			console.log(JSON.stringify(newbuyset))
+			// console.log(JSON.stringify(newbuyset))
 			return newbuyset
 		}
 		
@@ -1221,6 +1221,29 @@
 			}
 			return newset
 		}
+		
+		function buySetObj(buyset){
+			let nowset = JSON.parse(JSON.stringify(buyset));
+			if(sessionStorage.vipSubSelectAreaUpgrade!==undefined&&sessionStorage.vipSubSelectAreaUpgrade!==""){
+				let vip_area = JSON.parse(sessionStorage.vipSubSelectAreaUpgrade);
+				for(let province in nowset.citys){
+					if(nowset.citys[province] > 0){
+						if(checkObj(vip_area[province])){
+							let cityarr = nowset.citys
+							delete cityarr[province]
+						}
+					}
+				}
+				// for(let n in nowset.citys){
+				// 	if(nowset.citys[n] > 2){
+				// 		let cityarr = nowset.citys
+				// 		delete cityarr[n]
+				// 		nowset.areacount += 1
+				// 	}
+				// }
+			}
+			return nowset
+		}
 	    
     </script>
 </body>