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

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

wangkaiyue 5 жил өмнө
parent
commit
4aa31ceb18

+ 2 - 2
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/css/vip_update.css

@@ -775,8 +775,8 @@
   height: .64rem;
   line-height: .64rem;
   font-size: .26rem;
-  color: #FFB901;
-  background-color: rgba(255, 185, 1, 0.12);
+  color: #fff;
+  background-color: #FFB901;
   text-align: center;
 }
 

+ 5 - 1
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/updateArea.js

@@ -625,7 +625,11 @@ $(function () {
         //     province: 0,
         //     city: 0
         // }
-
+		//
+		sessionStorage.removeItem("vipAddCount")
+		sessionStorage.removeItem("vipSubSelectCity")
+		sessionStorage.removeItem("vipSubSelectAreaUpgrade")
+		sessionStorage.removeItem("vipSubSelectAreaAdd")
         // 数组置0,在重新从数据中计算初始状态结果并返回
         for (let i in alreadyBuy) {
             for(let ii in alreadyBuy[i]) {

+ 10 - 0
src/jfw/modules/app/src/web/templates/vipsubscribe/renew_pay.html

@@ -30,6 +30,13 @@
 	::-webkit-input-placeholder{
 		color: #000;
 	}
+	.vip_renew .detail_item {
+	    border-bottom: 1px solid #e0e0e0;
+	    border-top: 1px solid #e0e0e0;
+	}
+	.weui-check__label:active {
+		background-color: #fff!important;
+	}
 </style>
 <body class="no-touch">
 	<div class="app-layout-header">
@@ -407,6 +414,9 @@
             } else {
                 $('#number_box_month button').removeAttr('disabled')
             }
+			if(val==="1"){
+				$('#number_box_month button:first').attr('disabled', true);
+			}
             let result = (Number(val) * monthPrice).toFixed(1);
             $('.computed_price').html('¥' + result)
 

+ 6 - 0
src/jfw/modules/app/src/web/templates/vipsubscribe/vip_upgrade.html

@@ -31,6 +31,9 @@
 	::-webkit-input-placeholder{
 		color: #000;
 	}
+	.weui-check__label:active {
+		background-color: #fff!important;
+	}
 </style>
 <body class="no-touch">
 	<div class="app-layout-header">
@@ -352,6 +355,9 @@
 		        })
 		        return
             }
+			if($(".month_number").text() === "1"){
+				$('#number_box_month button:first').attr('disabled', true);
+			}
             $('#time_cycle').show(200);
         })
         // 对订阅时间选择的 input绑定点击事件

+ 29 - 15
src/jfw/modules/pushsubscribe/src/push/util/util.go

@@ -154,15 +154,7 @@ func SaveToPushsubscribe(isVipUser, isProjectInfo bool, userId string, matchInfo
 	}
 	unix := time.Now().Unix()
 	length := len(*matchInfos)
-	fields := []string{"userid", "infoid", "date", "matchkeys", "area", "city"}
-	if isVipUser {
-		fields = append(fields, "buyerclass")
-		if isProjectInfo {
-			fields = append(fields, "type")
-		}
-	} else {
-		fields = append(fields, "subscopeclass")
-	}
+	fields := []string{"userid", "infoid", "date", "matchkeys", "area", "city", "buyerclass", "type", "isvip"}
 	var savecount int64
 	i := length
 	for {
@@ -171,14 +163,36 @@ func SaveToPushsubscribe(isVipUser, isProjectInfo bool, userId string, matchInfo
 		for i > 0 {
 			i--
 			matchInfo := (*matchInfos)[i]
-			values = append(values, userId, util.ObjToString((*matchInfo.Info)["_id"]), unix, strings.Join(matchInfo.Keys, " "), util.ObjToString((*matchInfo.Info)["area"]), util.ObjToString((*matchInfo.Info)["city"]))
+			values = append(values, userId, util.ObjToString((*matchInfo.Info)["_id"]), unix)
+			if len(matchInfo.Keys) > 0 {
+				values = append(values, strings.Join(matchInfo.Keys, " "))
+			} else {
+				values = append(values, nil)
+			}
+			if area := util.ObjToString((*matchInfo.Info)["area"]); area != "" {
+				values = append(values, area)
+			} else {
+				values = append(values, nil)
+			}
+			if city := util.ObjToString((*matchInfo.Info)["city"]); city != "" {
+				values = append(values, city)
+			} else {
+				values = append(values, nil)
+			}
+			if buyerclass := util.ObjToString((*matchInfo.Info)["buyerclass"]); buyerclass != "" {
+				values = append(values, buyerclass)
+			} else {
+				values = append(values, nil)
+			}
+			if isProjectInfo {
+				values = append(values, 1)
+			} else {
+				values = append(values, nil)
+			}
 			if isVipUser {
-				values = append(values, util.ObjToString((*matchInfo.Info)["buyerclass"]))
-				if isProjectInfo {
-					values = append(values, 1)
-				}
+				values = append(values, 1)
 			} else {
-				values = append(values, GetSubScopeClass((*matchInfo.Info)["s_subscopeclass"]))
+				values = append(values, nil)
 			}
 			batchSize++
 			if batchSize == BigBulkSize {

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

@@ -151,6 +151,7 @@ func (this *vipSubscribeStruct) GetUserLastOrderDetaul(userid string) (VipSimple
 	orderData := util.Mysql.FindOne("dataexport_order", map[string]interface{}{
 		"user_id":      userid,
 		"order_status": 1,
+		"product_type": "VIP订阅",
 	}, "filter,order_code", "create_time desc")
 	if orderData == nil || len(*orderData) == 0 {
 		return vmsg, errors.New("not find last order")
@@ -226,12 +227,7 @@ func (this *vipSubscribeStruct) UpgradeSubVip(userId string, vmsg VipSimpleMsg,
 			log.Printf("%s更新结束%d日期出错\n", userId, endTime.Unix())
 			return false
 		}
-		//		var effectTime time.Time
-		//		if isExprie != "no" {
 		effectTime := startTime
-		//		} else {
-		//			effectTime = time.Date(time.Now().Year(), time.Now().Month()+1, 1, 0, 0, 0, 0, time.Local)
-		//		}
 		buyset := JyVipSubStruct.NewBuySet(vmsg.Area, vmsg.Industry)
 		return util.MQFW.Save("vip_upgrade",
 			bson.M{
@@ -247,45 +243,6 @@ func (this *vipSubscribeStruct) UpgradeSubVip(userId string, vmsg VipSimpleMsg,
 	return false
 }
 
-//升级未生效再次升级
-//func (this *vipSubscribeStruct) UpgradeSubVipTwo(userId string, vmsg VipSimpleMsg, end string, isNow bool) bool {
-//	endTime, err := time.ParseInLocation(qutil.Date_Full_Layout, end, time.Local)
-//	if err != nil {
-//		log.Println("%s格式化日期出错%s\n", userId, endTime)
-//		return false
-//	}
-//	buyset := JyVipSubStruct.NewBuySet(vmsg.Area, vmsg.Industry)
-
-//	if !util.MQFW.UpdateById("user", userId,
-//		bson.M{"$set": bson.M{
-//			"l_vip_endtime":    endTime.Unix(),
-//			"i_vip_expire_tip": 0,
-//		}}) {
-//		log.Printf("%s更新结束%d日期出错\n", userId, endTime.Unix())
-//		return false
-//	}
-
-//	if util.MQFW.Update("vip_upgrade", bson.M{"s_userid": userId, "i_isvalid": 0},
-//		bson.M{"$set": bson.M{
-//			"i_isvalid": 1,
-//		}}, false, false,
-//	) {
-//		effectTime := time.Date(time.Now().Year(), time.Now().Month()+1, 1, 0, 0, 0, 0, time.Local)
-//		return util.MQFW.Save("vip_upgrade",
-//			bson.M{
-//				"s_userid":     userId,            //试用设置地区
-//				"a_buyerclass": vmsg.Industry,     //试用设置行业
-//				"o_area":       vmsg.Area,         //购买内容 城市、省份、行业数量
-//				"l_validtime":  effectTime.Unix(), //生效时间
-//				"l_createtime": time.Now().Unix(), //入库时间
-//				"o_buyset":     buyset,            //购买内容数量
-//				"i_isvalid":    0,                 //是否已经生效 0-未生效
-//			}) != ""
-//	} else {
-//		return false
-//	}
-//}
-
 //根据行业和地区 返回*SubvipBuySet
 func (this *vipSubscribeStruct) NewBuySet(area *map[string]interface{}, industry []string) *SubvipBuySet {
 	buyset := SubvipBuySet{}

+ 7 - 6
src/jfw/modules/subscribepay/src/service/afterPay.go

@@ -2,7 +2,6 @@ package service
 
 import (
 	"fmt"
-	"log"
 	qutil "qfw/util"
 	"strconv"
 	"strings"
@@ -33,7 +32,7 @@ func (a *AfterPay) FastImport() error {
 	var _keys []map[string]interface{}
 	kwsCount := 0
 	classify_index, _ := a.GetInteger("c_index")
-	kws_index, _ := a.GetInteger("k_index")
+	//	kws_index, _ := a.GetInteger("k_index")
 	classify_name := a.GetString("c_name")
 	if userId != "" {
 		data, ok := util.MQFW.FindById("user", userId, `{"o_jy":1,"o_vipjy":1,"i_vip_fastimport":1}`)
@@ -99,8 +98,6 @@ func (a *AfterPay) FastImport() error {
 						flagInt = 1 //导入成功-普通用户的关键词都已存在
 					}
 				}
-				log.Println(classify_index, kws_index, _keys)
-
 			} else {
 				flagInt = -1 //普通用户暂未设置关键词
 			}
@@ -139,7 +136,7 @@ func (a *AfterPay) DirectSubKWS() error {
 		data, ok := util.MQFW.FindById("user", userId, `{"o_vipjy":1}`)
 		keys := a.GetString("keys")
 		var repleat = false
-		var classify_index = 0
+		var classify_index = -1
 		var kwsCount = 0
 		if len([]rune(keys)) > 20 {
 			keys = qutil.SubString(keys, 0, 20)
@@ -167,6 +164,11 @@ func (a *AfterPay) DirectSubKWS() error {
 						break
 					}
 				}
+				if classify_index == -1 {
+					classify_index = len(a_items)
+				}
+			} else {
+				classify_index = 0
 			}
 			if repleat {
 				flag = "o"
@@ -466,7 +468,6 @@ func (a *AfterPay) GetUserInfo() error {
 			}
 			(*userData)["i_vip_fastimport"] = qutil.IntAll((*userData)["i_vip_fastimport"])
 		}
-		log.Println("userId:", userId)
 		a.ServeJson(map[string]interface{}{
 			"userData": userData,
 		})

+ 97 - 78
src/jfw/modules/subscribepay/src/service/vipRenewUpgrade.go

@@ -83,34 +83,42 @@ func (this *RenewUpgrade) GetBuyMsg() {
 //升级续费
 //创建订单返回支付串
 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"), ",") //已购买行业
-	//	allArea := qutil.ObjToMap(this.GetString("allArea"))             //已购+新增区域
+	// -------差价计算部分可注释-----
+	//	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"))       //已购+新增区域
 	allIndustry := strings.Split(this.GetString("allIndustry"), ",") //已购+新增行业
 	date := this.GetString("time")                                   //不延长时为空,正常为 年或月
 	payWay := this.GetString("payWay")                               //支付方式
@@ -122,18 +130,17 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 	} else {
 		vipBuyCount = &map[string]interface{}{}
 	}
-	industryCount, _ := this.GetInteger("addIndustryCount")
-	allBuyArea := qutil.ObjToMap(this.GetString("allBuyArea"))
+	industryCount, _ := this.GetInteger("addIndustryCount") //新增购买行业数量
 	userId := qutil.ObjToString(this.GetSession("userId"))
 	openId := qutil.ObjToString(this.GetSession("s_m_openid"))
 	r := func() *entity.FuncResult {
 		now := time.Now()
 		//数据校验
-		if (industry[0]) != "no" {
-			if len(industry) == 1 && industry[0] == "" { //去掉[""]
-				industry = []string{}
-			}
+		//		if (industry[0]) != "no" {
+		if len(industry) == 1 && industry[0] == "" { //去掉[""]
+			industry = []string{}
 		}
+		//		}
 		if len(industrys) == 1 && industrys[0] == "" { //去掉[""]
 			industrys = []string{}
 		}
@@ -216,50 +223,62 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 			totalfee = entity.JyVipSubStruct.GetSubVipPrice(area, industry, date_count, date_unit)
 		} else if pay_source == "Upgrade" {
 			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
+			// -------差价计算可注释-----
+			//			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)
+			oldPrice := oldPriceY + oldPriceM
+			newPriceY := entity.JyVipSubStruct.GetSubVipPrice(allBuyArea, allIndustry, upgradeYear, 1)
+			newPriceM := entity.JyVipSubStruct.GetSubVipPrice(allBuyArea, allIndustry, upgradeMonth, 2)
+			newPrice := newPriceY + newPriceM
+			totalfee = newPrice - oldPrice
+			// --------升级价格差价计算--------
 			if date_unit == 1 { //升级中的延长时间
 				lengPrice := entity.JyVipSubStruct.GetSubVipPrice(allBuyArea, allIndustry, date_count, 1) //单位为年的已购+新增延长时间价格
 				totalfee = totalfee + lengPrice                                                           //已购+新增延长时间价格 + 升级差价 = 最终价格

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

@@ -8,11 +8,11 @@
     "weixinrpcport": "8083",
     "webrpcport": "127.0.0.1:8084",
     "jyop_webrpcport": "127.0.0.1:8012",
-    "webdomain": "http://web-jydev-xzh.jianyu360.cn",
-    "appid": "wx41a95e706276804d",
-    "apptoken": "topnet2018topnet2018",
-    "appsecret": "1b385c7dd14274c5e0898b9b208580b7",
-    "proxysess": "http://web-jydev-xzh.jianyu360.cn/front/sess/%s",
+    "webdomain": "http://web-jydev-ws.jianyu360.cn",
+    "appid": "wx5b1c6e7cc4dac0e4",
+    "apptoken": "top2015top2015",
+    "appsecret": "b026103ffebd2291b3edb7a269612112",
+    "proxysess": "http://web-jydev-ws.jianyu360.cn/front/sess/%s",
     "followCompany": 10,
     "welcomemsg": "用剑鱼标讯,所有功能完全免费,\n和传统的会员制说再见!\n\n<a href='%s'>点击这里</a>设置关键词,或直接回复“订阅 关键词”,如“订阅 教学设备”,您将随时随地接收招标信息!\n\n剑鱼标讯,让投标无限可能!",
     "tpl_subscribe_push_id": "IY_RWWzMlwDK6hcd6RAzTec6qre8n5r8PNOOUM_hgk0",
@@ -72,7 +72,7 @@
         "description": ""
     },
     "2017policy": "2017年招投标政策法规大盘点下载:https://share.weiyun.com/66b98209cefd61860fd32b9416ed52d9",
-    "activesign": true,
+    "activesign": false,
     "activeArr": [
         {
             "keysReplay": false,
@@ -89,5 +89,11 @@
             "activeEnd": 1586185600,
             "subSecondRP": "https://www.jianyu360.com/images/t3.jpg"
         }
-    ]
+    ],
+	"preheatingState":true,
+	"preheatingReply": {
+        "href_vip":"/front/vipsubscribe/toSetPage",
+        "href_notvip":"/front/vipsubscribe/introducePage",
+        "content":"<a href='%s'>剑鱼标讯VIP订阅新上线</a>"
+	}
 }

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

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

+ 5 - 4
src/jfw/public/historypush.go

@@ -314,12 +314,13 @@ func (h *historyPush) getJyPushs(datas []map[string]interface{}) (pushCas []*jy.
 			Date:       util.Int64All(v["date"]),
 			InfoId:     util.ObjToString(v["infoid"]),
 			Visit:      util.IntAll(v["isvisit"]),
-			Index:      1,
+			Index:      util.IntAll(v["id"]),
 			Area:       util.ObjToString(v["area"]),
 			City:       util.ObjToString(v["city"]),
 			Buyerclass: util.ObjToString(v["buyerclass"]),
 			Keys:       strings.Split(keys, " "),
 			Type:       util.IntAll(v["type"]),
+			Isvip:      util.IntAll(v["isvip"]),
 		})
 		//		if len(pushCas) == 4000 {
 		//			return
@@ -540,11 +541,11 @@ func (h *historyPush) UserInfo(userId string) (*map[string]interface{}, int64) {
 	}
 	return user, util.Int64All((*user)["l_firstpushtime"])
 }
-func (h *historyPush) Visit_Mysql(userId, infoId string) {
-	if infoId == "" || userId == "" {
+func (h *historyPush) Visit_Mysql(userId, Id string) {
+	if Id == "" || userId == "" {
 		return
 	}
-	ok := Mysql.UpdateOrDeleteBySql("update pushsubscribe set isvisit=1 where userid='" + userId + "' and infoid='" + util.DecodeArticleId2ByCheck(infoId)[0] + "'")
+	ok := Mysql.UpdateOrDeleteBySql("update pushsubscribe set isvisit=1 where userid='" + userId + "' and id='" + Id + "'")
 	log.Println("--update:", ok)
 }
 

+ 2 - 2
src/web/staticres/vipsubscribe/css/vip_update.css

@@ -775,8 +775,8 @@
   height: .64rem;
   line-height: .64rem;
   font-size: .26rem;
-  color: #FFB901;
-  background-color: rgba(255, 185, 1, 0.12);
+  color: #fff;
+  background-color: #FFB901;
   text-align: center;
 }
 

+ 5 - 1
src/web/staticres/vipsubscribe/js/updateArea.js

@@ -625,7 +625,11 @@ $(function () {
         //     province: 0,
         //     city: 0
         // }
-
+		//
+		sessionStorage.removeItem("vipAddCount")
+		sessionStorage.removeItem("vipSubSelectCity")
+		sessionStorage.removeItem("vipSubSelectAreaUpgrade")
+		sessionStorage.removeItem("vipSubSelectAreaAdd")
         // 数组置0,在重新从数据中计算初始状态结果并返回
         for (let i in alreadyBuy) {
             for(let ii in alreadyBuy[i]) {

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

@@ -367,9 +367,10 @@
 					datatypeTable=datatype+"公告"
 				}
 				//行业
+				var ca_isvip = obj.ca_isvip
 				var	industryname = "";
 				var industryListname ="";
-				if(isVipSub){
+				if(ca_isvip){
 					if(obj.ca_buyerclass!=null&&obj.ca_buyerclass!=""){
 						industryname=obj.ca_buyerclass
 						industryListname='<span class="buyerclass">'+industryname+'</span>';
@@ -418,7 +419,7 @@
 										+'<span class="xh '+visited+'">'+count+'.</span>'
 									+'</div>'
 									+'<div class="two bt-parent" style="padding-left:'+paddingLeft+'px;">'
-										+'<a class="bt '+visited+'" eid="'+obj["_id"]+'" href="javascript:void(0);"  push_date="'+obj["ca_date"]+'" openlist_index="'+obj["ca_openlist_index"]+'" projectM="'+obj["ca_type"]+'">'+title+'</a>'
+										+'<a class="bt '+visited+'" eid="'+obj["_id"]+'" href="javascript:void(0);"  push_date="'+obj["ca_date"]+'" list_index="'+obj["ca_index"]+'" projectM="'+obj["ca_type"]+'">'+title+'</a>'
 									+'</div>'
 								+'</div>'
 								+'<div style="clear:both;">'
@@ -436,7 +437,7 @@
 										+'<span class="xh '+visited+'">'+count+'.</span>'
 									+'</div>'
 									+'<div class="two bt-parent" style="padding-left:'+paddingLeft+'px;">'
-										+'<a class="bt '+visited+'" eid="'+obj["_id"]+'" href="javascript:void(0);"  push_date="'+obj["ca_date"]+'" openlist_index="'+obj["ca_openlist_index"]+'" projectM="'+obj["ca_type"]+'">'+title+'</a>'
+										+'<a class="bt '+visited+'" eid="'+obj["_id"]+'" href="javascript:void(0);"  push_date="'+obj["ca_date"]+'" list_index="'+obj["ca_index"]+'" projectM="'+obj["ca_type"]+'">'+title+'</a>'
 									+'</div>'
 								+'</div>'
 								+'<div style="clear:both;">'
@@ -515,11 +516,7 @@
 			}
 			obj.find("a.bt").addClass("visited");
 			obj.find("span.xh").addClass("visited");
-			var vsid=obj.find("a.bt").attr("eid");
-			if (eid != ""){
-				obj.addClass("visited");
-				vsid = eid;
-			}
+			var vsid=obj.find("a.bt").attr("list_index");
 			if(vsid){
 				$.post("/wxpush/bid/ajaxReq",{vsid:vsid});
 			}

+ 6 - 0
src/web/templates/weixin/vipsubscribe/renew_pay.html

@@ -40,6 +40,9 @@
 	    border-bottom: 1px solid #e0e0e0;
 	    border-top: 1px solid #e0e0e0;
 	}
+	.weui-check__label:active {
+		background-color: #fff!important;
+	}
 </style>
 <body class="no-touch">
     <div class="vip_renew">
@@ -464,6 +467,9 @@
             } else {
                 $('#number_box_month button').removeAttr('disabled')
             }
+			if(val==="1"){
+				$('#number_box_month button:first').attr('disabled', true);
+			}
             let result = (Number(val) * monthPrice).toFixed(1);
             $('.computed_price').html('¥' + result)
 

+ 162 - 146
src/web/templates/weixin/vipsubscribe/vip_upgrade.html

@@ -37,7 +37,9 @@
 	::-webkit-input-placeholder{
 		color: #000;
 	}
-	
+	.weui-check__label:active {
+		background-color: #fff!important;
+	}
 </style>
 <body class="no-touch">
     <div class="vip_update">
@@ -393,6 +395,9 @@
 		        })
 		        return
             }
+			if($(".month_number").text() === "1"){
+				$('#number_box_month button:first').attr('disabled', true);
+			}
             $('#time_cycle').show(200);
         })
         // 对订阅时间选择的 input绑定点击事件
@@ -857,17 +862,17 @@
 						}
 					}
 				}
-				if(sessionStorage.vipSubSelectAreaAdd!==""&&sessionStorage.vipSubSelectAreaAdd!==undefined){
-					areasArr = addAreaObj();
-				}else{
-					areasArr = null;
-				}
+				// if(sessionStorage.vipSubSelectAreaAdd!==""&&sessionStorage.vipSubSelectAreaAdd!==undefined){
+				// 	areasArr = addAreaObj();
+				// }else{
+				// 	areasArr = null;
+				// }
 				if(buyCheck){
 					$(".save_upgrade").removeAttr("disabled");
 				}
 			}else{
 				areas_arr = null
-				areasArr = null
+				// areasArr = null
 				if(buyArea !== ""&&buyArea !== undefined){
 					// for(let province in buyArea){
 			  //   		let citys = buyArea[province];
@@ -902,20 +907,20 @@
 			// }
 			//
 			console.log("areasArr",areasArr)
-			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.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){
 				var vipIndustry = JSON.parse(sessionStorage.vipSubSelectIndustryUpgrade);
@@ -944,16 +949,16 @@
 			    }
 			}
 			//
-			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++;
-		            }
-		       	}
-			}
+			// 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 j =x+1; j <allIndustry.length; ) {
 	                if (allIndustry[x] === allIndustry[j]){
@@ -1035,32 +1040,34 @@
 			
 			//
 			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]);
-				}
-				// let yearprice = getsubVipOrderPrice(allArea,allIndustry,[nowUpgradeYear,1]);
-				// let monthprice = getsubVipOrderPrice(allArea,allIndustry,[nowUpgrade,2]);
+				// ------- 升级价格交叉计算 ---------
+				// 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 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]);
-//				price = yearprice + monthprice;
-				price = addAreaPriceY + addAreaPriceM + oldAreaPriceY + oldAreaPriceM + addIndustryPriceY + addIndustryPriceM;
-//				let yearprice = addAreaPriceY + oldAreaPriceY + addIndustryPriceY;
-//				let monthprice = addAreaPriceM + oldAreaPriceM + addIndustryPriceM;
+				price = newPriceY + newPriceM - oldPrice;
+				// ------- 升级延长周期价格计算 ---------
 				if(monthprice === 0){
 					completeMonth = ((yearprice / nowUpgradeYear) / 10).toFixed(1);
 					completeYear = (yearprice / nowUpgradeYear).toFixed(1);
@@ -1068,28 +1075,36 @@
 					completeMonth = (monthprice / nowUpgrade).toFixed(1);
 					completeYear = ((monthprice / nowUpgrade)*10).toFixed(1);
 				}
+				// ------- 升级延长周期价格计算 ---------
 				console.log("yearprice",yearprice);
 				console.log("monthprice",monthprice);
 				console.log(">=1",price);
 			}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]);
-				}
-				// let monthprice = getsubVipOrderPrice(allArea,allIndustry,[nowUpgrade,2]);
+				// ------- 升级价格交叉计算 ---------
+				// 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]);
-//				price = getsubVipOrderPrice(areasArr,industrysArr,[nowUpgrade,2]);
-				price = addAreaPriceM + oldAreaPriceM + addIndustryPriceM;
+				
+				// ------- 升级价格差价计算 ---------
+				let newPrice = getsubVipOrderPrice(allBuyArea,allIndustry,[nowUpgrade,2]);
+				price = newPrice - oldPrice;
+				// ------- 升级价格差价计算 ---------
+				// ------- 升级延长周期价格计算 ---------
 				completeMonth = (monthprice / nowUpgrade).toFixed(1);
 				completeYear = ((monthprice / nowUpgrade)*10).toFixed(1);
+				// ------- 升级延长周期价格计算 ---------
 				console.log("<1",price)
 			}
 			
@@ -1100,6 +1115,7 @@
 			}
 			console.log("completeMonth",completeMonth)
 			console.log("completeYear",completeYear)
+			// ------- 延长周期价格赋值 ---------
 			if(sessionStorage.upgrade_cyclecount !== undefined && sessionStorage.upgrade_cycleunit !== undefined){
 				if(sessionStorage.upgrade_cycleunit === "1"){
 					let price = (Number(sessionStorage.upgrade_cyclecount)*completeYear).toFixed(1);
@@ -1148,38 +1164,38 @@
         $(".save_upgrade").on("click", function(){
         	$(".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";
-        	}
+        	// 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(areas_arr !== null){
+        	// 	if(areas_arr["全国"]){
+	        //         areas_arr={};
+	        //     }
+        	// 	areas_arr = JSON.stringify(areas_arr);
+        	// }else{
+        	// 	areas_arr = "no";
+        	// }
         	if(allBuyArea["全国"]){
                 allBuyArea={};
             }
@@ -1215,10 +1231,10 @@
             }
             //
 	    	var param = {
-	    		"area": areas_arr,
-	    		"industry": industryArr,
+	    		// "area": areas_arr,
+	    		// "industry": industryArr,
 	    		"areas": JSON.stringify(areaarr),
-	    		"areas_arr": areaArr,
+	    		// "areas_arr": areaArr,
 	    		"industryarr": industryarr.join(","),
 	    		// "allArea": JSON.stringify(allAreaArr),
 	    		"allIndustry": allIndustryArr.join(","),
@@ -1267,48 +1283,48 @@
 		    return false;
 		}
 	    //
-	    function addAreaObj(){
-	    	let areaObj = JSON.parse(sessionStorage.vipSubSelectAreaUpgrade)
-	    	let buyset = JSON.parse(sessionStorage.vipSubSelectAreaAdd)
-	    	//
-	    	let provinceArr = [];
-	    	let areasObj = {};
-	    	if(buyset.country === -1){
-	    		areasObj["全国"] = [];
-	    	}else{
-	    		for(let province in areaObj){
-	//	    		console.log("666666",buyset.citys[province]);
-					let cityLen = areaObj[province].length
-		    		if(cityLen === 0){
-		    			provinceArr.push(province);
-		    		}else{
-		    			let citys = areaObj[province];
-		    			for(let i in buyset.city){
-		    				let cityCount = buyset.city[i];
-		    				if(province === i){
-		    					if(cityLen > cityCount){
-					    			let reduce = cityLen - cityCount;
-					    			areasObj[province] = citys.slice(0, -reduce);
-					    		}else{
-					    			areasObj[province] = citys;
-					    		}
-		    				}
-		    			}
-		    		}
-		    	}
-	    		if(provinceArr.length > buyset.province){
-	    			let reduce = provinceArr.length - buyset.province;
-	    			provinceArr = provinceArr.slice(0, -reduce);
-	    		}
-	    		console.log(provinceArr)
-	    		for(let a in provinceArr){
-	    			let province = provinceArr[a];
-	    			areasObj[province] = [];
-	    		}
-	    		console.log(areasObj)
-	    	}
-	    	return areasObj
-	    }
+	//     function addAreaObj(){
+	//     	let areaObj = JSON.parse(sessionStorage.vipSubSelectAreaUpgrade)
+	//     	let buyset = JSON.parse(sessionStorage.vipSubSelectAreaAdd)
+	//     	//
+	//     	let provinceArr = [];
+	//     	let areasObj = {};
+	//     	if(buyset.country === -1){
+	//     		areasObj["全国"] = [];
+	//     	}else{
+	//     		for(let province in areaObj){
+	// //	    		console.log("666666",buyset.citys[province]);
+	// 				let cityLen = areaObj[province].length
+	// 	    		if(cityLen === 0){
+	// 	    			provinceArr.push(province);
+	// 	    		}else{
+	// 	    			let citys = areaObj[province];
+	// 	    			for(let i in buyset.city){
+	// 	    				let cityCount = buyset.city[i];
+	// 	    				if(province === i){
+	// 	    					if(cityLen > cityCount){
+	// 				    			let reduce = cityLen - cityCount;
+	// 				    			areasObj[province] = citys.slice(0, -reduce);
+	// 				    		}else{
+	// 				    			areasObj[province] = citys;
+	// 				    		}
+	// 	    				}
+	// 	    			}
+	// 	    		}
+	// 	    	}
+	//     		if(provinceArr.length > buyset.province){
+	//     			let reduce = provinceArr.length - buyset.province;
+	//     			provinceArr = provinceArr.slice(0, -reduce);
+	//     		}
+	//     		console.log(provinceArr)
+	//     		for(let a in provinceArr){
+	//     			let province = provinceArr[a];
+	//     			areasObj[province] = [];
+	//     		}
+	//     		console.log(areasObj)
+	//     	}
+	//     	return areasObj
+	//     }
 	    
     </script>
 </body>

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

@@ -392,7 +392,7 @@
 </style>
 </head>
 <body>
-	<div class="tipHeader" style="display:none;">根据您的设置,为您推荐的预览信息,点击标题可查看详情。</div>
+	<div class="tipHeader" style="display:none;">根据您的设置为您推荐的预览信息,点击标题可查看详情。</div>
 	<div class="listcontent">
 		<div id="list"></div>
 	</div>