zhangxinlei1996 5 years ago
parent
commit
f45466911e

+ 2 - 7
src/jfw/modules/app/src/web/templates/dataExport/dataExport_toMyOrder.html

@@ -1004,20 +1004,15 @@
 					}
 					}
 					$(".loading_").show();
 					$(".loading_").show();
 					interval_ent=setInterval(function(){
 					interval_ent=setInterval(function(){
-						$.post("/entniche/ispaysuccess",{code:order_entcode},function(r){
+						$.post("/entniche/ispaysuccess",{ordercode:order_entcode},function(r){
 							if(r.data.status==1){
 							if(r.data.status==1){
 								$(".loading_").show();
 								$(".loading_").show();
 								setTimeout(function(){
 								setTimeout(function(){
 									$(".loading_").hide();
 									$(".loading_").hide();
 										setSessionStorage();
 										setSessionStorage();
-									try{
-										JyObj.checkLab()//刷新搜索首页和订阅首页
-										sessionStorage.reloadHomePage = true;
-										sessionStorage.reloadSubPage = true;
-									}catch(e){}	
 									window.location.href="/page_entniche/page/buy_production/pay_success.html?ordercode="+order_entcode;
 									window.location.href="/page_entniche/page/buy_production/pay_success.html?ordercode="+order_entcode;
 									clearInterval(interval_ent);
 									clearInterval(interval_ent);
-								})
+								},800)
 							}
 							}
 						})
 						})
 					},3000)
 					},3000)

+ 4 - 8
src/jfw/modules/app/src/web/templates/entniche/entniche_order_detail.html

@@ -601,7 +601,7 @@ body .loading_ p span {
 										$(".loading_").hide();
 										$(".loading_").hide();
 						                $('.pay_way').hide(200)
 						                $('.pay_way').hide(200)
 										canpay=true;
 										canpay=true;
-						                checkPaySuccess_ent(data.order);
+						                checkPaySuccess_ent(orderCode);
 						    	}else{
 						    	}else{
 									canpay=false;
 									canpay=false;
 								}
 								}
@@ -655,22 +655,18 @@ body .loading_ p span {
 		    });
 		    });
 		}
 		}
 		
 		
+		var interval_ent
 		function checkPaySuccess_ent(order_code){
 		function checkPaySuccess_ent(order_code){
 			if(interval_ent){
 			if(interval_ent){
 				clearInterval(interval_ent)
 				clearInterval(interval_ent)
 			}
 			}
 			$(".loading_").show();
 			$(".loading_").show();
 			interval_ent=setInterval(function(){
 			interval_ent=setInterval(function(){
-				$.post("/entniche/ispaysuccess",{code:order_code},function(r){
+				$.post("/entniche/ispaysuccess",{ordercode:order_code},function(r){
 					if(r.data.status==1){
 					if(r.data.status==1){
 						clearInterval(interval_ent);
 						clearInterval(interval_ent);
 						$(".loading_").hide();
 						$(".loading_").hide();
-						try{
-							JyObj.checkLab()//刷新搜索首页和订阅首页
-							sessionStorage.reloadHomePage = true;
-							sessionStorage.reloadSubPage = true;
-						}catch(e){}	
-						window.location.href="/page_entniche/page/buy_production/pay_success.html?ordercode="+order_entcode;
+						window.location.href="/page_entniche/page/buy_production/pay_success.html?ordercode="+order_code;
 					}
 					}
 				})
 				})
 			},3000)
 			},3000)

+ 5 - 0
src/jfw/modules/app/src/web/templates/entniche/entniche_seniorset.html

@@ -29,6 +29,11 @@
 			font-size: 14px;
 			font-size: 14px;
 			color: #686868;
 			color: #686868;
 		}
 		}
+		.seniorsetpage .navchoose li:last-child.on {
+		    padding: 28px 0px 27px 0px;
+		    line-height: 0px;
+		    height: inherit;
+		}
 	</style>
 	</style>
     <script>
     <script>
 		var keepOneTipWayMsg = "请保留一种推送方式,<br>剑鱼标讯还要推送信息给您";
 		var keepOneTipWayMsg = "请保留一种推送方式,<br>剑鱼标讯还要推送信息给您";

+ 9 - 5
src/jfw/modules/entniche/src/service/distribute/distribute.go

@@ -118,7 +118,8 @@ func (ac *Action) Distribute_persons() {
 	if len(persons) > 0 {
 	if len(persons) > 0 {
 		person_arr := []interface{}{}
 		person_arr := []interface{}{}
 		for _, v := range persons {
 		for _, v := range persons {
-			person_arr = append(person_arr, strconv.Itoa(int(v["id"].(int64))))
+			//			person_arr = append(person_arr, strconv.Itoa(int(v["id"].(int64))))
+			person_arr = append(person_arr, strconv.Itoa(v["id"].(int)))
 		}
 		}
 		sql := "SELECT user_id AS id,COUNT(1) AS COUNT FROM entniche_user_rule WHERE user_id IN ("
 		sql := "SELECT user_id AS id,COUNT(1) AS COUNT FROM entniche_user_rule WHERE user_id IN ("
 		for i := 0; i < len(person_arr); i++ {
 		for i := 0; i < len(person_arr); i++ {
@@ -164,7 +165,6 @@ func (ac *Action) Distribute_add() {
 		ac.ServeJson(Result{Data: M{"status": status}})
 		ac.ServeJson(Result{Data: M{"status": status}})
 		return
 		return
 	}
 	}
-	log.Println(distribute_ruleMap)
 	createtime := time.Now().Unix()
 	createtime := time.Now().Unix()
 	if len(distribute_ruleMap) > 0 {
 	if len(distribute_ruleMap) > 0 {
 		if distribute_ruleMap["area"] != nil {
 		if distribute_ruleMap["area"] != nil {
@@ -190,7 +190,8 @@ func (ac *Action) Distribute_add() {
 		ac.ServeJson(Result{Data: M{"status": status}})
 		ac.ServeJson(Result{Data: M{"status": status}})
 		return
 		return
 	}
 	}
-	if distribute_ruleMap["persons"] != nil {
+	persons := distribute_ruleMap["persons"].([]interface{})
+	if len(persons) > 0 {
 		//转化
 		//转化
 		person := []interface{}{}
 		person := []interface{}{}
 		if len(distribute_ruleMap["persons"].([]interface{})) > 0 {
 		if len(distribute_ruleMap["persons"].([]interface{})) > 0 {
@@ -226,12 +227,16 @@ func (ac *Action) Distribute_delete() {
 	}
 	}
 	id := ac.GetString("id")
 	id := ac.GetString("id")
 	log.Println(id)
 	log.Println(id)
+	deletelb := true
 	//分发规则状态    0--未删除  1--删除
 	//分发规则状态    0--未删除  1--删除
 	bl := util.MQFW.UpdateById(util.Entniche_distribute, id, bson.M{"$set": bson.M{"i_status": 1}})
 	bl := util.MQFW.UpdateById(util.Entniche_distribute, id, bson.M{"$set": bson.M{"i_status": 1}})
-	deletelb := util.Mysql.Delete(util.Entniche_user_rule, M{"rule_id": id})
+	if util.Mysql.FindOne(util.Entniche_user_rule, M{"rule_id": id}, "user_id", "") != nil {
+		deletelb = util.Mysql.Delete(util.Entniche_user_rule, M{"rule_id": id})
+	}
 	if bl && deletelb {
 	if bl && deletelb {
 		status = 1
 		status = 1
 	}
 	}
+	log.Println("删除分发规则接口:", status)
 	ac.ServeJson(Result{Data: M{"status": status}})
 	ac.ServeJson(Result{Data: M{"status": status}})
 	return
 	return
 }
 }
@@ -331,7 +336,6 @@ func (ac *Action) Distribute_update() {
 				"o_area":       distribute_rule["o_area"],
 				"o_area":       distribute_rule["o_area"],
 				"a_buyerclass": distribute_rule["a_buyerclass"],
 				"a_buyerclass": distribute_rule["a_buyerclass"],
 			}})
 			}})
-			log.Println(addbl, "---", ok)
 			if ok && addbl {
 			if ok && addbl {
 				status = 1
 				status = 1
 			}
 			}

+ 27 - 25
src/jfw/modules/entniche/src/service/subscribe/subscribe.go

@@ -45,6 +45,7 @@ func (ac *Action) Subscribe_index() error {
 	}
 	}
 	var o_entniche *map[string]interface{}
 	var o_entniche *map[string]interface{}
 	model := entInfo.Ent.Model //1-统一订阅 2-个人订阅
 	model := entInfo.Ent.Model //1-统一订阅 2-个人订阅
+	log.Println("model:", model)
 	if model == 1 {
 	if model == 1 {
 		o_entniche, _ = util.MQFW.FindOne("entniche_rule", map[string]interface{}{
 		o_entniche, _ = util.MQFW.FindOne("entniche_rule", map[string]interface{}{
 			"i_deptid": entInfo.Dept.Id,
 			"i_deptid": entInfo.Dept.Id,
@@ -260,7 +261,7 @@ func (ac *Action) Get_infotype() {
 	delete(*res, "_id")
 	delete(*res, "_id")
 	//转换
 	//转换
 	o_entniche := qutil.ObjToMap((*res)["o_entniche"])
 	o_entniche := qutil.ObjToMap((*res)["o_entniche"])
-	if len(*o_entniche) != 0 {
+	if (*o_entniche)["a_infotype"] != nil {
 		data = qutil.ObjArrToStringArr((*o_entniche)["a_infotype"].([]interface{}))
 		data = qutil.ObjArrToStringArr((*o_entniche)["a_infotype"].([]interface{}))
 	} else {
 	} else {
 		data = nil
 		data = nil
@@ -360,15 +361,15 @@ func (ac *Action) Get_key() {
 			status = 1
 			status = 1
 		}
 		}
 	}
 	}
-	log.Println(o_entniche)
-	if len(*o_entniche) != 0 {
+	log.Println("----", o_entniche)
+	if (*o_entniche)["a_items"] != nil {
 		//data = qutil.ObjArrToStringArr((*o_entniche)["a_items"].([]interface{}))
 		//data = qutil.ObjArrToStringArr((*o_entniche)["a_items"].([]interface{}))
 		data = qutil.ObjArrToMapArr((*o_entniche)["a_items"].([]interface{}))
 		data = qutil.ObjArrToMapArr((*o_entniche)["a_items"].([]interface{}))
 	} else {
 	} else {
 		data = nil
 		data = nil
 	}
 	}
 
 
-	log.Println("查看key:", data)
+	log.Println("status", status, "查看key:", data)
 	ac.ServeJson(Result{Data: M{"data": data, "status": status}})
 	ac.ServeJson(Result{Data: M{"data": data, "status": status}})
 	return
 	return
 }
 }
@@ -517,29 +518,30 @@ func (ac *Action) Get_fastimport() {
 		ac.ServeJson(Result{Data: M{"status": 0}})
 		ac.ServeJson(Result{Data: M{"status": 0}})
 		return
 		return
 	}
 	}
+	if o_entniche["a_items"] != nil {
+		a_items_ent = qutil.ObjArrToMapArr(o_entniche["a_items"].([]interface{}))
+		for k, v := range a_items_ent {
+			s_item := qutil.ObjToString(v["s_item"])
+			a[s_item] = k + 1
+			a_key := qutil.ObjArrToMapArr(v["a_key"].([]interface{}))
+			for _, n := range a_key {
+				notkey := []string{}
+				appendkey := []string{}
+				if n["notkey"] != nil {
+					notkey = qutil.ObjArrToStringArr(n["notkey"].([]interface{}))
+				}
+				key := qutil.ObjArrToStringArr(n["key"].([]interface{}))
+				if n["appendkey"] != nil {
+					appendkey = qutil.ObjArrToStringArr(n["appendkey"].([]interface{}))
+				}
 
 
-	a_items_ent = qutil.ObjArrToMapArr(o_entniche["a_items"].([]interface{}))
-	for k, v := range a_items_ent {
-		s_item := qutil.ObjToString(v["s_item"])
-		a[s_item] = k + 1
-		a_key := qutil.ObjArrToMapArr(v["a_key"].([]interface{}))
-		for _, n := range a_key {
-			notkey := []string{}
-			appendkey := []string{}
-			if n["notkey"] != nil {
-				notkey = qutil.ObjArrToStringArr(n["notkey"].([]interface{}))
-			}
-			key := qutil.ObjArrToStringArr(n["key"].([]interface{}))
-			if n["appendkey"] != nil {
-				appendkey = qutil.ObjArrToStringArr(n["appendkey"].([]interface{}))
-			}
-
-			key_str := strings.Join(key, "")
-			notkey_str := strings.Join(notkey, "")
-			appendkey_str := strings.Join(appendkey, "")
-			keys := key_str + notkey_str + appendkey_str
+				key_str := strings.Join(key, "")
+				notkey_str := strings.Join(notkey, "")
+				appendkey_str := strings.Join(appendkey, "")
+				keys := key_str + notkey_str + appendkey_str
 
 
-			b[keys] = true
+				b[keys] = true
+			}
 		}
 		}
 	}
 	}
 	//vip设置关键词
 	//vip设置关键词