Browse Source

Merge branch 'dev2.8.5' of ssh://192.168.3.207:10022/qmx/jy into dev2.8.5

wcj 5 years ago
parent
commit
d7ae81a7d6

+ 18 - 37
src/jfw/public/historypush.go

@@ -439,7 +439,7 @@ type resultData struct {
 	Ca_isvip        int      `json:"ca_isvip"`
 	Ca_date         int64    `json:"ca_date"`
 	Ca_isvisit      int      `json:"ca_isvisit"`
-	Ca_index        int      `json:"ca_index"`
+	Ca_index        int64    `json:"ca_index"`
 	Matchkeys       []string `json:"matchkeys"`
 }
 
@@ -453,7 +453,7 @@ func (p resultSort) Less(i, j int) bool { return p[i].Ca_index > p[j].Ca_index }
 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 = ``
+	//	allquery = ``
 	keys, list := PushView(userId, allquery, field, 1, 50)
 	log.Println(list)
 	if list == nil || len(*list) == 0 {
@@ -492,25 +492,10 @@ func (h *historyPush) MakeHistoryDatas(userId, field string) (bool, []*resultDat
 		myInsert["isvip"] = 0
 		myInsert["buyerclass"] = v["buyerclass"]
 		id := Mysql.Insert("pushsubscribe", myInsert)
-		info := map[string]interface{}{
-			"area":            area_check,
-			"_id":             util.EncodeArticleId2ByCheck(util.ObjToString(v["_id"])),
-			"publishtime":     v["publishtime"],
-			"stype":           v["type"],
-			"toptype":         v["toptype"],
-			"subtype":         v["subtype"],
-			"s_subscopeclass": v["s_subscopeclass"],
-			"title":           title,
-			"ca_isvip":        0,
-			"ca_date":         now.Unix(),
-			"ca_isvisit":      0,
-			"ca_index":        id,
+		if area_check == "A" {
+			area_check = "全国"
 		}
-		area := util.ObjToString(info["area"])
-		if area == "A" {
-			info["area"] = "全国"
-		}
-		industry := util.ObjToString(info["s_subscopeclass"])
+		industry := util.ObjToString(v["s_subscopeclass"])
 		scs := strings.Split(industry, ",")
 		if len(scs) > 0 {
 			industry = scs[0]
@@ -520,35 +505,31 @@ func (h *historyPush) MakeHistoryDatas(userId, field string) (bool, []*resultDat
 					industry = iss[0]
 				}
 			}
-			info["s_subscopeclass"] = industry
 		}
-		infotype := util.ObjToString(info["subtype"])
+		infotype := util.ObjToString(v["subtype"])
 		if infotype == "" {
-			infotype = util.ObjToString(info["toptype"])
+			infotype = util.ObjToString(v["toptype"])
 		}
 		if infotype == "" {
-			infotype = util.ObjToString(info["type"])
+			infotype = util.ObjToString(v["type"])
 			if infotype == "tender" {
 				infotype = "招标"
 			} else if infotype == "bid" {
 				infotype = "中标"
 			}
 		}
-		info["type"] = infotype
-		delete(info, "subtype")
-		delete(info, "toptype")
 
 		resultList = append(resultList, &resultData{
-			util.ObjToString(info["area"]),
-			util.ObjToString(info["_id"]),
-			util.Int64All(info["publishtime"]),
-			util.ObjToString(info["stype"]),
-			util.ObjToString(info["s_subscopeclass"]),
-			util.ObjToString(info["title"]),
-			util.IntAll(info["ca_isvip"]),
-			util.Int64All(info["ca_date"]),
-			util.IntAll(info["ca_isvisit"]),
-			util.IntAll(info["ca_index"]),
+			area_check,
+			util.EncodeArticleId2ByCheck(util.ObjToString(v["_id"])),
+			util.Int64All(v["publishtime"]),
+			infotype,
+			industry,
+			title,
+			0,
+			now.Unix(),
+			0,
+			id,
 			matchkeys,
 		})
 	}

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

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

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

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