瀏覽代碼

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

wangkaiyue 5 年之前
父節點
當前提交
486e93dcc8

+ 3 - 0
src/jfw/modules/pushsubscribe/src/match/job/matchjob.go

@@ -466,6 +466,7 @@ func (m *MatchJob) EachAllBidInfo(matcher Matcher, datas *[]map[string]interface
 		matchWaitGroup.Add(1)
 		go func(info map[string]interface{}) {
 			defer func() {
+				util.Catch()
 				matchWaitGroup.Done()
 				<-matchPool
 			}()
@@ -523,6 +524,7 @@ func (m *MatchJob) ToMatch(batchIndex int, matcher Matcher, datas *[]map[string]
 		saveWaitGroup.Add(1)
 		go func(user *UserInfo, infos *SortList) {
 			defer func() {
+				util.Catch()
 				<-savePool
 				saveWaitGroup.Done()
 			}()
@@ -639,6 +641,7 @@ func (m *MatchJob) ToRelationProject(projectUser *map[*UserInfo]*[]string, myMat
 		saveWaitGroup.Add(1)
 		go func(user *UserInfo, _ids *[]string) {
 			defer func() {
+				util.Catch()
 				<-savePool
 				saveWaitGroup.Done()
 			}()

二進制
src/jfw/modules/pushsubscribe/src/match/match


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

@@ -49,6 +49,7 @@ func (m *MoveJob) Execute() {
 		index++
 		go func(temp map[string]interface{}) {
 			defer func() {
+				util.Catch()
 				<-movePool
 				moveWait.Done()
 			}()
@@ -134,6 +135,7 @@ func (m *MoveJob) merge(number *int, nowUnix int64, moveUsers map[string]*MoveUs
 		mergeWait.Add(1)
 		go func(userId string, moveUser *MoveUser) {
 			defer func() {
+				util.Catch()
 				<-mergePool
 				mergeWait.Done()
 			}()

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

@@ -41,6 +41,7 @@ func (p *ProjectPushJob) Execute() {
 			pushWait.Add(1)
 			go func(userId string, list []map[string]interface{}) {
 				defer func() {
+					util.Catch()
 					<-pushPool
 					pushWait.Done()
 				}()
@@ -269,6 +270,7 @@ func (p *ProjectPushJob) loadProject() *sync.Map {
 		loadWait.Add(1)
 		go func(data map[string]interface{}) {
 			defer func() {
+				util.Catch()
 				<-loadPool
 				loadWait.Done()
 			}()

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

@@ -96,6 +96,7 @@ func (p *PushJob) StartPush(pusher Pusher, taskType int) {
 			pushWait.Add(1)
 			go func(v map[string]interface{}, take bool) {
 				defer func() {
+					util.Catch()
 					if take {
 						<-pushPool
 					}

二進制
src/jfw/modules/pushsubscribe/src/push/push


+ 7 - 5
src/jfw/modules/subscribepay/src/entity/subscribeVip.go

@@ -54,11 +54,13 @@ type subVipPrice struct {
 //订单简单信息
 type VipSimpleMsg struct {
 	//Id         string                  `json:"_id"`        //mgo id
-	Area       *map[string]interface{} `json:"area"`       //地区
-	Industry   []string                `json:"industry"`   //行业
-	Cyclecount int                     `json:"cyclecount"` //日期数量
-	Cycleunit  int                     `json:"cycleunit"`  //日期单位
-	OrderType  int                     `json:"ordertype"`  //类型 1:订单 2:续费 3:立即升级 4:下月升级 5:即将到期(升降级)6:升级订单未生效再次升级
+	Area        *map[string]interface{} `json:"area"`        //地区
+	Industry    []string                `json:"industry"`    //行业
+	Addarea     *map[string]interface{} `json:"addarea"`     //新增地区
+	Addindustry []string                `json:"addindustry"` //新增行业
+	Cyclecount  int                     `json:"cyclecount"`  //日期数量
+	Cycleunit   int                     `json:"cycleunit"`   //日期单位
+	OrderType   int                     `json:"ordertype"`   //类型 1:订单 2:续费 3:立即升级 4:下月升级 5:即将到期(升降级)6:升级订单未生效再次升级
 }
 
 //购买内容

+ 52 - 26
src/jfw/modules/subscribepay/src/service/vipRenewUpgrade.go

@@ -43,29 +43,39 @@ func (this *RenewUpgrade) GetBuyMsg() {
 		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"]
 		//		isvalidOk := true
 
-		//		str, oks := util.MQFW.FindOne("vip_upgrade", bson.M{"s_userid": userId, "i_isvalid": 0})
-		//		if oks && len(*str) > 0 && *str != nil {
-		//			area = (*str)["o_area"]
-		//			buyerclass = (*str)["a_buyerclass"]
-		//			isvalidOk = false
-		//		}
-
-		dataArr := map[string]interface{}{
-			"area":       area,
-			"buyerclass": buyerclass,
-			"cycleunit":  cycleunit,
-			"cyclecount": cyclecount,
-			"starttime":  starttime,
-			"endtime":    endtime,
-			"start":      start,
-			"end":        end,
-			"now":        now,
-			"vipStatus":  vipStatus,
-			//			"isvalidOk":  isvalidOk,
+		orderdata := util.Mysql.FindOne("dataexport_order", map[string]interface{}{
+			"user_id":      userId,
+			"order_status": 1,
+		}, "filter", "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
+			}
+			allArea := vmsg.Area
+			allIndustry := vmsg.Industry
+			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,
+			}
+			this.ServeJson(dataArr)
 		}
-		this.ServeJson(dataArr)
 	}
 }
 
@@ -179,13 +189,29 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 		//			//			}
 		//			endTime = util.GetDATE(date_unit, date_count, startTime.Unix())
 		//		}
-		filter := entity.VipSimpleMsg{
-			area,
-			industry,
-			date_count,
-			date_unit,
-			orderType,
+		filter := entity.VipSimpleMsg{}
+		if pay_source == "Renew" {
+			filter = entity.VipSimpleMsg{
+				area,
+				industry,
+				nil,
+				nil,
+				date_count,
+				date_unit,
+				orderType,
+			}
+		} else if pay_source == "Upgrade" {
+			filter = entity.VipSimpleMsg{
+				allArea,
+				allIndustry,
+				area,
+				industry,
+				date_count,
+				date_unit,
+				orderType,
+			}
 		}
+
 		mog_id := entity.JyVipSubStruct.SaveSelectLog(userId, openId, &filter)
 		if mog_id == "" {
 			return &entity.FuncResult{false, errors.New("创建订单出错"), nil}

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

@@ -63,6 +63,8 @@ func (this *SubVipPayOrder) CreateOrder() {
 		filter := entity.VipSimpleMsg{
 			area,
 			industry,
+			nil,
+			nil,
 			date_count,
 			date_unit,
 			orderType,

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

@@ -284,6 +284,8 @@ func (this *TrialOrder) TrialPay() {
 		filter := entity.VipSimpleMsg{
 			area,
 			industry,
+			nil,
+			nil,
 			date_count,
 			date_unit,
 			0,

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

@@ -235,6 +235,7 @@
 			$(".tab_left .time").show();
 			//地区渲染
   			mapData();
+			//
 			if(!isVipSub){
 				$(".normal_set").show();
 				$(".tab_left .area").hide();
@@ -246,15 +247,9 @@
 				if(!firstPage.length>0 && !haskey){
 					if(sessionStorage&&(sessionStorage.keysetindexToHistory=="1"||sessionStorage.keysetindexToHistory=="2"||sessionStorage.keysetindexToHistory=="3")){
 						sessionStorage.removeItem("keysetindexToHistory");
-						if(sessionStorage.keysetindexToHistory=="1"){
-							wx.ready(function () {
-								wx.closeWindow();
-							});
-						}else{
-							setTimeout(function(){
-								wx.closeWindow();
-							},2000);
-						}
+						setTimeout(function(){
+							wx.closeWindow();
+						},2000);
 						return
 					}
 					history.pushState({},"","");
@@ -794,7 +789,7 @@
 		}
 		._header{
 			position: fixed;
-			top: 0;
+			top: 0.02rem;
 			width: 100%;
 			z-index: 999;
 		}

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

@@ -574,7 +574,9 @@
         
         //
         var area = "";
+        var areas = "";
 	    var buyerclass = "";
+	    var industrys = "";
 	    var cycleunit = "";
 	    var cyclecount = "";
 	    var startTime = "";
@@ -588,13 +590,15 @@
             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;
-			    monthPrice = getsubVipOrderPrice(area, buyerclass, [1, 2]);
-			    yearPrice = getsubVipOrderPrice(area, buyerclass, [1, 1]);
+			    monthPrice = getsubVipOrderPrice(areas, industrys, [1, 2]);
+			    yearPrice = getsubVipOrderPrice(areas, industrys, [1, 1]);
 			    //
 			    var areaHtml = "";
 			    var provinceArr = [];

+ 7 - 1
src/web/templates/weixin/vipsubscribe/vip_seniorset.html

@@ -140,6 +140,7 @@
 					parentLi.children(".turn-on").hide();
 				}else{
 					if(s_email == ""){
+						$("input#email").focus();
 						emailSetModalShow();
 						return;
 					}else{
@@ -150,10 +151,14 @@
 				saveData();
 			});
 			$(".emailset>img").click(function(){
+				$("input#email").focus();
 				emailSetModalShow();
 			});
 			$("#sure").click(function(){
-				var thisValue = $("#email").val();
+				var thisValue = $.trim($("#email").val());
+				if(thisValue==""){
+					return
+				}
 				var szReg=/^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.|-|\-]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/; 
 				if(!szReg.test(thisValue)){
 					$(".error").removeClass("hide");
@@ -201,6 +206,7 @@
 				"matchtype":1,
 				"email": $("#email").val(),
 			};
+			s_email = $("#email").val();
 			if($("#matchType li:eq(2)").hasClass("checked")){
 				param["matchtype"] = 2;
 			}

+ 4 - 2
src/web/templates/weixin/vipsubscribe/vip_upgrade.html

@@ -924,8 +924,10 @@
 //	    var isvalidOk = "";
 	 	$DoPost("/subscribepay/renewUpgrade/getBuyMsg", {}, function (data) {
             if (data) {
-                area = data.area;
-			    buyerclass = data.buyerclass;
+                area = data.allarea;
+			    buyerclass = data.allindustry;
+			    console.log(area)
+			    console.log(buyerclass)
 			    cycleunit = data.cycleunit;
 			    cyclecount = data.cyclecount;
 			    startTime = data.start;

+ 1 - 0
src/web/templates/weixin/wxkeyset/index.html

@@ -703,6 +703,7 @@ function saveSeniorset(r){
 }
 //
 function tointroducepage(){
+	sessionStorage.removeItem("keysetindexToHistory");
 	window.location.replace("/front/vipsubscribe/introducePage");
 }