Răsfoiți Sursa

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

wangshan 5 ani în urmă
părinte
comite
45fc96d1af

+ 3 - 0
src/jfw/modules/app/src/app/front/swordfish.go

@@ -633,6 +633,7 @@ func (f *Front) HasPushHistory() {
 			formatTime = ""
 		}
 	}
+	var industry_ = []string{}
 	userId, _ := f.GetSession("userId").(string)
 	if userId == "" {
 		return
@@ -657,6 +658,7 @@ func (f *Front) HasPushHistory() {
 		if util.IntAll((*user)["i_vip_status"]) == 1 || util.IntAll((*user)["i_vip_status"]) == 2 {
 			var o_vipjy map[string]interface{}
 			o_vipjy, _ = (*user)["o_vipjy"].(map[string]interface{})
+			industry_ = util.ObjArrToStringArr(o_vipjy["a_buyerclass"].([]interface{}))
 			if o_vipjy["a_items"] != nil {
 				a_itmes := util.ObjArrToMapArr(o_vipjy["a_items"].([]interface{}))
 				hasKeyFlag = len(a_itmes) > 0
@@ -702,6 +704,7 @@ func (f *Front) HasPushHistory() {
 		"userId":      util.EncodeArticleId(userId),
 		"keys":        keys,
 		"otherFlag":   otherFlag,
+		"industry":    industry_,
 	})
 }
 

+ 107 - 0
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/vip_index_new.js

@@ -604,6 +604,7 @@ $(function () {
 
     function init(state) {
     	console.log(state)
+        checkmerge(state.industry)
         // init 已选择的区域和行业
         var selectedAreaAndInd = getBuySet(state.area, state.industry);
         setSelectedAreaAndInd(selectedAreaAndInd);
@@ -827,4 +828,110 @@ function clearSessionStorage() {
 function toRead() {
     sessionStorage.setItem('index_read_cache', '0');
     window.location.href = "/jyapp/front/staticPage/wx-serviceterms.html";
+}
+
+var mergedlist = []
+function checkmerge(state) {
+    var tips = "<span style='font-size:15px;font-family:PingFang SC;font-weight:bold;color:rgba(29,29,29,1);opacity:1;'>随着政府机构改革和只能转变工作深入推进,部分采购单位行业与实现不一致,为了提高订阅推送数据的准确性,剑鱼标讯需要针对采购单位行业名称进行优化。</span><br><span style='font-size:13px;font-family:PingFang SC;font-weight:400;color:rgba(104,104,104,1);opacity:1;'>采购单位名称的调整不影响所购买的采购单位数量,您仍可按需调整<br><br>您订阅的:<br></span>"
+    var hasMerged = false
+    var merge_industry = ["国土","林业","环保","卫生","工商","质监","食药","安监","地震","公安","文化","旅游","银监","保监"]
+    var nature_source = [];
+    var health_commission = []
+    var market_supervision = []
+    var contingency_management = []
+    var cultural_tourism = []
+    var CBRC = []
+    var ecological_environment = []
+    state.forEach(function (item,index) {
+        if (merge_industry.indexOf(item)>-1){
+            if (item == "国土"||item == "林业"){
+                mergedlist.push("自然资源")
+                hasMerged = true
+                nature_source.push(item)
+            } else if (item == "环保"){
+                mergedlist.push("生态环境")
+                hasMerged = true
+                ecological_environment.push(item)
+            } else if ( item == "卫生"){
+                mergedlist.push("卫健委")
+                hasMerged = true
+                health_commission.push(item)
+            } else if (item == "工商"||item == "质监"||item == "食药"){
+                mergedlist.push("市场监管")
+                hasMerged = true
+                market_supervision.push(item)
+            } else if (item == "地震"||item=="安监"||item=="公安"){
+                mergedlist.push("应急管理")
+                hasMerged = true
+                contingency_management.push(item)
+            } else if (item=="文化"||item == "旅游"){
+                mergedlist.push("文旅")
+                hasMerged = true
+                cultural_tourism.push(item)
+            } else if  (item == "银监"||item == "保监"){
+                mergedlist.push("银保监")
+                hasMerged = true
+                CBRC.push(item)
+            }
+        }else{
+            mergedlist.push(item)
+        }
+    })
+    if(nature_source.length>=1){
+        tips +=Highlight(nature_source).join(',')+" 合并为 【自然资源】<br>"
+    }
+    if (ecological_environment.length>=1){
+        tips +=Highlight(ecological_environment).join(',')+" 合并为 【生态环境】<br>"
+    }
+    if (health_commission.length>=1){
+        tips +=Highlight(health_commission).join(',')+" 合并为 【卫健委】<br>"
+    }
+    if (market_supervision.length>=1){
+        tips +=Highlight(market_supervision).join(',')+" 合并为 【市场监管】<br>"
+    }
+    if (contingency_management.length>=1){
+        tips +=Highlight(contingency_management).join(',')+" 合并为 【应急管理】<br>"
+    }
+    if (cultural_tourism.length>=1){
+        tips +=Highlight(cultural_tourism).join(',')+" 合并为 【文旅】<br>"
+    }
+    if (CBRC.length>=1){
+        tips +=Highlight(CBRC).join(',')+" 合并为 【银保监】<br>"
+    }
+    if (hasMerged){
+        $("#merge_content").html(tips)
+        $("#merge_dialog").show()
+    }
+}
+function Highlight(key) {
+    var t = new Array()
+    key.forEach(function (item,index) {
+        var m = "<span style='color:red'>"+item+"</span>"
+        t.push(m)
+    })
+    return t
+}
+
+function acceptchange() {
+    var q=removeDuplicatedItem(mergedlist)
+    $.post("/subscribepay/vipsubscribe/mergeIndustry",{"industry":q.toString()},function (r) {
+        if (r.success){
+            sessionStorage.removeItem("sub_vip_state")
+            console.log("行业合并成功")
+        }else{
+            console.log("行业合并失败")
+        }
+    })
+    $("#merge_dialog").hide()
+}
+function removeDuplicatedItem(ar) {
+    var ret = [];
+
+    for (var i = 0, j = ar.length; i < j; i++) {
+        if (ret.indexOf(ar[i]) === -1) {
+            ret.push(ar[i]);
+        }
+    }
+
+    return ret;
 }

+ 16 - 1
src/jfw/modules/app/src/web/templates/vipsubscribe/vip_index_new.html

@@ -32,6 +32,9 @@
         .other-buyerclass > .weui-toast{
              width: 4.3rem !important;
         }
+        .merge-dialog{
+            z-index: 99999;
+        }
     </style>
 </head>
 
@@ -418,11 +421,23 @@
             </div>
         </div>
     </div>
+    <!-- 行业合并弹窗-->
+    <div class="js_dialog merge" id="merge_dialog" style="display: none">
+        <div class="weui-mask merge-dialog"></div>
+        <div class="weui-dialog merge-dialog">
+            <div class="weui-dialog__bd" id="merge_content" style="text-align:justify;font-size: .28rem;line-height: .48rem;">
+
+            </div>
+            <div class="weui-dialog__ft">
+                <a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_primary know" onclick="acceptchange()">已阅读,同意调整</a>
+            </div>
+        </div>
+    </div>
     <script src="{{Msg "seo" "cdn"}}/jyapp/vipsubscribe/js/jquery-2.1.4.js?v={{Msg "seo" "version"}}"></script>
     <script src="{{Msg "seo" "cdn"}}/jyapp/vipsubscribe/js/weui.min.js?v={{Msg "seo" "version"}}"></script>
     <script src="{{Msg "seo" "cdn"}}/jyapp/vipsubscribe/js/common.js?v={{Msg "seo" "version"}}"></script>
     <script src="{{Msg "seo" "cdn"}}/jyapp/vipsubscribe/js/UpgradePrice.js?v={{Msg "seo" "version"}}"></script>
-    <script src="{{Msg "seo" "cdn"}}/jyapp/vipsubscribe/js/vip_index_new.js?v={{Msg "seo" "version"}}"></script>
+    <script src="{{Msg "seo" "cdn"}}/jyapp/vipsubscribe/js/vip_index_new.js?v={{Msg "seo" "version"}}1"></script>
     <script src="{{Msg "seo" "cdn"}}/jyapp/js/common.js?v={{Msg "seo" "version"}}"></script>
 </div>
 </body>

+ 1 - 1
src/jfw/modules/app/src/web/templates/vipsubscribe/vip_seniorset.html

@@ -268,7 +268,7 @@
 					<li onclick="docheck('1',this)" dataid="1">
 						实时推送
 						<img src="{{Msg "seo" "cdn"}}/jyapp/images/wxkeyset/checked.png?v={{Msg "seo" "version"}}" class="checked-img">
-						<span>上午8点至晚上10点</span>
+						<span>上午8点至晚上10点不定时推送</span>
 					</li>
           <li onclick="docheck('2',this)" dataid="2">
 						每天推送

+ 122 - 0
src/jfw/modules/app/src/web/templates/weixin/historypush.html

@@ -10,6 +10,11 @@
     <script src="{{Msg "seo" "cdn"}}/jyapp/vipsubscribe/js/common.js?v={{Msg "seo" "version"}}"></script>
     <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/jyapp/vipsubscribe/css/weui.min.css?v={{Msg "seo" "version"}}"/>
     <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/jyapp/vipsubscribe/iconfont/iconfont.css?v={{Msg "seo" "version"}}"/>
+    <style>
+        .merge-dialog{
+            z-index: 99999;
+        }
+    </style>
     <script>
 		//
     		function afterReceivePushMessage(type,url){
@@ -225,6 +230,7 @@
                       async: false,
                       dataType: 'json',
                       success: function (data) {
+                          checkmerge(data.industry)
                        if (data.otherFlag){
                           localStorage.setItem({{.T.userId}}+"_otherFlag",data.otherFlag) 
                         }
@@ -962,6 +968,18 @@
 </div>
 <!--弹窗 其他采购单位-->
 <div class="jy-alert jy-alert-other" style="display:none"> <div class="weui-mask weui-animate-fade-in"></div> <div class="weui-dialog weui-animate-fade-in">  <div class="weui-dialog__hd"><strong class="weui-dialog__title">提 示</strong></div>  <div class="weui-dialog__bd">每条信息的采购单位行业属性由机器自动识别,会存在少数无法识别的情况,此时将归类为“其它”。如无需订阅,可在VIP订阅设置内手动关闭。(注:当采购单位行业选择为全部时,关闭无效)</div> <div class="weui-dialog__ft">  <a href="javascript:;" onclick="close_other()" class="weui-dialog__btn weui-dialog__btn_">我知道了</a>  </div> </div> </div>
+<!-- 行业合并弹窗-->
+<div class="js_dialog merge" id="merge_dialog" style="display: none">
+    <div class="weui-mask merge-dialog"></div>
+    <div class="weui-dialog merge-dialog">
+        <div class="weui-dialog__bd" id="merge_content" style="text-align:justify;font-size: .28rem;line-height: .48rem;">
+
+        </div>
+        <div class="weui-dialog__ft">
+            <a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_primary know" onclick="acceptchange()">已阅读,同意调整</a>
+        </div>
+    </div>
+</div>
 <!--	<img src="/jyapp/images/gotosetpage.png" id="gotosetpage">-->
 {{include "/common/baiducc.html"}}
 
@@ -1408,5 +1426,109 @@
         })
 
     })
+    var mergedlist = []
+    function checkmerge(state) {
+        var tips = "<span style='font-size:15px;font-family:PingFang SC;font-weight:bold;color:rgba(29,29,29,1);opacity:1;'>随着政府机构改革和只能转变工作深入推进,部分采购单位行业与实现不一致,为了提高订阅推送数据的准确性,剑鱼标讯需要针对采购单位行业名称进行优化。</span><br><span style='font-size:13px;font-family:PingFang SC;font-weight:400;color:rgba(104,104,104,1);opacity:1;'>采购单位名称的调整不影响所购买的采购单位数量,您仍可按需调整<br><br>您订阅的:<br></span>"
+        var hasMerged = false
+        var merge_industry = ["国土","林业","环保","卫生","工商","质监","食药","安监","地震","公安","文化","旅游","银监","保监"]
+        var nature_source = [];
+        var health_commission = []
+        var market_supervision = []
+        var contingency_management = []
+        var cultural_tourism = []
+        var CBRC = []
+        var ecological_environment = []
+        state.forEach(function (item,index) {
+            if (merge_industry.indexOf(item)>-1){
+                if (item == "国土"||item == "林业"){
+                    mergedlist.push("自然资源")
+                    hasMerged = true
+                    nature_source.push(item)
+                } else if (item == "环保"){
+                    mergedlist.push("生态环境")
+                    hasMerged = true
+                    ecological_environment.push(item)
+                } else if ( item == "卫生"){
+                    mergedlist.push("卫健委")
+                    hasMerged = true
+                    health_commission.push(item)
+                } else if (item == "工商"||item == "质监"||item == "食药"){
+                    mergedlist.push("市场监管")
+                    hasMerged = true
+                    market_supervision.push(item)
+                } else if (item == "地震"||item=="安监"||item=="公安"){
+                    mergedlist.push("应急管理")
+                    hasMerged = true
+                    contingency_management.push(item)
+                } else if (item=="文化"||item == "旅游"){
+                    mergedlist.push("文旅")
+                    hasMerged = true
+                    cultural_tourism.push(item)
+                } else if  (item == "银监"||item == "保监"){
+                    mergedlist.push("银保监")
+                    hasMerged = true
+                    CBRC.push(item)
+                }
+            }else{
+                mergedlist.push(item)
+            }
+        })
+        if(nature_source.length>=1){
+            tips +=Highlight(nature_source).join(',')+" 合并为 【自然资源】<br>"
+        }
+        if (ecological_environment.length>=1){
+            tips +=Highlight(ecological_environment).join(',')+" 合并为 【生态环境】<br>"
+        }
+        if (health_commission.length>=1){
+            tips +=Highlight(health_commission).join(',')+" 合并为 【卫健委】<br>"
+        }
+        if (market_supervision.length>=1){
+            tips +=Highlight(market_supervision).join(',')+" 合并为 【市场监管】<br>"
+        }
+        if (contingency_management.length>=1){
+            tips +=Highlight(contingency_management).join(',')+" 合并为 【应急管理】<br>"
+        }
+        if (cultural_tourism.length>=1){
+            tips +=Highlight(cultural_tourism).join(',')+" 合并为 【文旅】<br>"
+        }
+        if (CBRC.length>=1){
+            tips +=Highlight(CBRC).join(',')+" 合并为 【银保监】<br>"
+        }
+        if (hasMerged){
+            $("#merge_content").html(tips)
+            $("#merge_dialog").show()
+        }
+    }
+
+    function acceptchange() {
+        var q = removeDuplicatedItem(mergedlist)
+        $.post("/subscribepay/vipsubscribe/mergeIndustry",{"industry":q.toString()},function (r) {
+            if (r.success){
+                console.log("行业合并成功")
+            }else{
+                console.log("行业合并失败")
+            }
+        })
+        $("#merge_dialog").hide()
+    }
+    function Highlight(key) {
+        var t = new Array()
+        key.forEach(function (item,index) {
+            var m = "<span style='color:red'>"+item+"</span>"
+            t.push(m)
+        })
+        return t
+    }
+    function removeDuplicatedItem(ar) {
+        var ret = [];
+
+        for (var i = 0, j = ar.length; i < j; i++) {
+            if (ret.indexOf(ar[i]) === -1) {
+                ret.push(ar[i]);
+            }
+        }
+
+        return ret;
+    }
 </script>
 </html>

+ 2 - 2
src/jfw/modules/pushsubscribe/src/match/config.json

@@ -6,7 +6,7 @@
 	"vipMaxPushSize":2000,
 	"mgoAddr":"192.168.3.128:27080",
 	"mgoSize":10,
-	"testIds":["5d9fe93a27573439d033b294"],
+	"testIds":["5ed463f327573456002068d3"],
 	"filterReg":"^(项目|中标|公告)$",
 	"retainReg":"[\\p{Han}a-zA-Z0-9]",
 	"matchPoolSize":60,
@@ -32,7 +32,7 @@
 		"安监":"应急管理",
 		"地震":"应急管理",
 		"文化":"文旅",
-		"旅游":"旅",
+		"旅游":"旅",
 		"银监":"银保监",
 		"保监":"银保监"
 	}

Fișier diff suprimat deoarece este prea mare
+ 0 - 0
src/jfw/modules/pushsubscribe/src/push/config.json


+ 3 - 0
src/jfw/modules/pushsubscribe/src/push/job/nothingjob.go

@@ -35,6 +35,9 @@ func (n *NothingJob) PushNothing(ratetype int) {
 	all := mongodb.Find("user", query, nil, `{"_id":1,"s_nickname":1,"o_vipjy":1,"a_jpushid":1,"s_jpushid":1,"s_opushid":1,"s_m_openid":1,"s_appponetype":1,"i_applystatus":1}`, false, 0, 0)
 	t, _ := time.ParseInLocation("2006-01-02", time.Now().Format("2006-01-02"), time.Local)
 	for _, v := range *all {
+		if v["o_vipjy"] == nil {
+			continue
+		}
 		ratemode := util.IntAll(v["o_vipjy"].(map[string]interface{})["i_ratemode"])
 		userid := util.BsonIdToSId(v["_id"])
 		day1, day2 := n.ComputTime(ratemode, t)

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

@@ -13,7 +13,6 @@ import (
 	"qfw/util/mail"
 	"qfw/util/mongodb"
 	"strconv"
-	"strings"
 	"sync"
 	"time"
 
@@ -276,7 +275,7 @@ func (p *PushJob) doPush(pusher Pusher, taskType int, pushWay *putil.PushWay, u
 		if IsVipUser(u.VipStatus) {
 			according = Config.Vip_mail_according
 		} else {
-			according = fmt.Sprintf(Config.Mail_according, strings.Replace(strings.Join(u.Keys, ";"), "+", " ", -1))
+			according = Config.Mail_according
 		}
 		html := fmt.Sprintf(Config.Mail_html, according, pushParam.MailContent)
 		isPushOk := p.sendMail(u.Email, Config.Mail_title, html, nil)

+ 26 - 0
src/jfw/modules/subscribepay/src/service/vipSubscribeChange.go

@@ -22,6 +22,7 @@ type SubscribeChange struct {
 	*xweb.Action
 	getSubBuyMsg xweb.Mapper `xweb:"/vipsubscribe/getSubBuyMsg"` //获取vip订阅详情
 	saveChange   xweb.Mapper `xweb:"/vipsubscribe/saveChange"`   //订阅修改 or 升级
+	mergeIndustry   xweb.Mapper `xweb:"/vipsubscribe/mergeIndustry"`   //行业合并
 }
 
 func init() {
@@ -581,3 +582,28 @@ func getDateSub(start, end int64) (monthNum, yearNum int) {
 	//upgradeYear, upgradeMonth
 	return yearNum, monthNum
 }
+
+
+func (this *SubscribeChange)MergeIndustry(){
+	industry := strings.Split(this.GetString("industry"),",")
+	userId := qutil.ObjToString(this.GetSession("userId"))
+	r := func() *entity.FuncResult {
+		if userId != ""{
+			updateOk := util.MQFW.UpdateById("user", userId,
+				bson.M{"$set": bson.M{
+					"o_vipjy.a_buyerclass": industry, //设置行业
+				}})
+			if updateOk{
+				return &entity.FuncResult{true, nil, nil}
+			}else{
+
+				return &entity.FuncResult{false, nil, nil}
+			}
+		}else{
+			return &entity.FuncResult{false, nil, nil}
+		}
+
+	}()
+
+		this.ServeJson(r.Format())
+}

+ 107 - 1
src/web/staticres/vipsubscribe/js/vip_index_new.js

@@ -603,7 +603,7 @@ $(function () {
     var selectTime = "";
 
     function init(state) {
-    	console.log(state)
+        checkmerge(state.industry)
         // init 已选择的区域和行业
         var selectedAreaAndInd = getBuySet(state.area, state.industry);
         setSelectedAreaAndInd(selectedAreaAndInd);
@@ -826,3 +826,109 @@ function clearSessionStorage() {
     sessionStorage.removeItem("endTime");
 
 }
+
+var mergedlist = []
+function checkmerge(state) {
+    var tips = "<span style='font-size:15px;font-family:PingFang SC;font-weight:bold;color:rgba(29,29,29,1);opacity:1;'>随着政府机构改革和只能转变工作深入推进,部分采购单位行业与实现不一致,为了提高订阅推送数据的准确性,剑鱼标讯需要针对采购单位行业名称进行优化。</span><br><span style='font-size:13px;font-family:PingFang SC;font-weight:400;color:rgba(104,104,104,1);opacity:1;'>采购单位名称的调整不影响所购买的采购单位数量,您仍可按需调整<br><br>您订阅的:<br></span>"
+    var hasMerged = false
+    var merge_industry = ["国土","林业","环保","卫生","工商","质监","食药","安监","地震","公安","文化","旅游","银监","保监"]
+    var nature_source = [];
+    var health_commission = []
+    var market_supervision = []
+    var contingency_management = []
+    var cultural_tourism = []
+    var CBRC = []
+    var ecological_environment = []
+    state.forEach(function (item,index) {
+        if (merge_industry.indexOf(item)>-1){
+            if (item == "国土"||item == "林业"){
+                mergedlist.push("自然资源")
+                hasMerged = true
+                nature_source.push(item)
+            } else if (item == "环保"){
+                mergedlist.push("生态环境")
+                hasMerged = true
+                ecological_environment.push(item)
+            } else if ( item == "卫生"){
+                mergedlist.push("卫健委")
+                hasMerged = true
+                health_commission.push(item)
+            } else if (item == "工商"||item == "质监"||item == "食药"){
+                mergedlist.push("市场监管")
+                hasMerged = true
+                market_supervision.push(item)
+            } else if (item == "地震"||item=="安监"||item=="公安"){
+                mergedlist.push("应急管理")
+                hasMerged = true
+                contingency_management.push(item)
+            } else if (item=="文化"||item == "旅游"){
+                mergedlist.push("文旅")
+                hasMerged = true
+                cultural_tourism.push(item)
+            } else if  (item == "银监"||item == "保监"){
+                mergedlist.push("银保监")
+                hasMerged = true
+                CBRC.push(item)
+            }
+        }else{
+            mergedlist.push(item)
+        }
+    })
+    if(nature_source.length>=1){
+        tips +=Highlight(nature_source).join(',')+" 合并为 【自然资源】<br>"
+    }
+    if (ecological_environment.length>=1){
+        tips +=Highlight(ecological_environment).join(',')+" 合并为 【生态环境】<br>"
+    }
+    if (health_commission.length>=1){
+        tips +=Highlight(health_commission).join(',')+" 合并为 【卫健委】<br>"
+    }
+    if (market_supervision.length>=1){
+        tips +=Highlight(market_supervision).join(',')+" 合并为 【市场监管】<br>"
+    }
+    if (contingency_management.length>=1){
+        tips +=Highlight(contingency_management).join(',')+" 合并为 【应急管理】<br>"
+    }
+    if (cultural_tourism.length>=1){
+        tips +=Highlight(cultural_tourism).join(',')+" 合并为 【文旅】<br>"
+    }
+    if (CBRC.length>=1){
+        tips +=Highlight(CBRC).join(',')+" 合并为 【银保监】<br>"
+    }
+    if (hasMerged){
+        $("#merge_content").html(tips)
+        $("#merge_dialog").show()
+    }
+}
+function Highlight(key) {
+    var t = new Array()
+    key.forEach(function (item,index) {
+        var m = "<span style='color:red'>"+item+"</span>"
+        t.push(m)
+    })
+    return t
+}
+
+function acceptchange() {
+    var q=removeDuplicatedItem(mergedlist)
+    $.post("/subscribepay/vipsubscribe/mergeIndustry",{"industry":q.toString()},function (r) {
+        if (r.success){
+            sessionStorage.removeItem("sub_vip_state")
+            console.log("行业合并成功")
+        }else{
+            console.log("行业合并失败")
+        }
+    })
+    $("#merge_dialog").hide()
+}
+function removeDuplicatedItem(ar) {
+    var ret = [];
+
+    for (var i = 0, j = ar.length; i < j; i++) {
+        if (ret.indexOf(ar[i]) === -1) {
+            ret.push(ar[i]);
+        }
+    }
+
+    return ret;
+}

+ 126 - 0
src/web/templates/weixin/historypush.html

@@ -159,6 +159,7 @@
                         if (data.otherFlag){
                           localStorage.setItem({{.T.userId}}+"_otherFlag",data.otherFlag) 
                         }
+                        checkmerge(data.industry)
                         pageIndex = 2;
                         isInTSguide = data.isInTSguide;
                         hasNextPage = data.hasNextPage;
@@ -1071,6 +1072,13 @@
            border-top: 0px;
            height: inherit;
         }
+        .merge-dialog{
+            z-index: 99999;
+        }
+        .merge_content {
+            padding: 2.7em 20px 1.7em;
+            color: #353535;
+        }
     </style>
 </head>
 <body>
@@ -1226,6 +1234,18 @@
   </div>
 </div><!--弹窗 其他采购单位-->
 <div class="jy-alert jy-alert-other" style="display:none"> <div class="weui-mask weui-animate-fade-in"></div> <div class="weui-dialog weui-animate-fade-in">  <div class="weui-dialog__hd"><strong class="weui-dialog__title">提 示</strong></div>  <div class="weui-dialog__bd">每条信息的采购单位行业属性由机器自动识别,会存在少数无法识别的情况,此时将归类为“其它”。如无需订阅,可在VIP订阅设置内手动关闭。(注:当采购单位行业选择为全部时,关闭无效)</div> <div class="weui-dialog__ft">  <a href="javascript:;" onclick="close_other()" class="weui-dialog__btn weui-dialog__btn_">我知道了</a>  </div> </div> </div>
+<!-- 行业合并弹窗-->
+<div class="js_dialog merge" id="merge_dialog" style="display: none">
+    <div class="weui-mask merge-dialog"></div>
+    <div class="weui-dialog merge-dialog">
+        <div class="merge_content" id="merge_content" style="text-align:justify;font-size: .28rem;line-height: .48rem;">
+
+        </div>
+        <div class="weui-dialog__ft">
+            <a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_primary know" onclick="acceptchange()">已阅读,同意调整</a>
+        </div>
+    </div>
+</div>
 <script src="{{Msg "seo" "cdn"}}/vipsubscribe/js/weui.min.js?v={{Msg "seo" "version"}}"></script>
 <script src="{{Msg "seo" "cdn"}}/vipsubscribe/js/mapArea.js?v={{Msg "seo" "version"}}"></script>
 <script type="text/javascript" charset="UTF-8">
@@ -1632,6 +1652,112 @@
             ADHtml += AD.s_script
         }
         $("#advertscript").html(ADHtml);
+        var mergedlist = []
+        function checkmerge(state) {
+            console.log("state",state)
+            var tips = "<span style='font-size:15px;font-family:PingFang SC;font-weight:bold;color:rgba(29,29,29,1);opacity:1;'>随着政府机构改革和只能转变工作深入推进,部分采购单位行业与实现不一致,为了提高订阅推送数据的准确性,剑鱼标讯需要针对采购单位行业名称进行优化。</span><br><span style='font-size:13px;font-family:PingFang SC;font-weight:400;color:rgba(104,104,104,1);opacity:1;'>采购单位名称的调整不影响所购买的采购单位数量,您仍可按需调整<br><br>您订阅的:<br></span>"
+            var hasMerged = false
+            var merge_industry = ["国土","林业","环保","卫生","工商","质监","食药","安监","地震","公安","文化","旅游","银监","保监"]
+            var nature_source = [];
+            var health_commission = []
+            var market_supervision = []
+            var contingency_management = []
+            var cultural_tourism = []
+            var CBRC = []
+            var ecological_environment = []
+            state.forEach(function (item,index) {
+                if (merge_industry.indexOf(item)>-1){
+                    if (item == "国土"||item == "林业"){
+                        mergedlist.push("自然资源")
+                        hasMerged = true
+                        nature_source.push(item)
+                    } else if (item == "环保"){
+                        mergedlist.push("生态环境")
+                        hasMerged = true
+                        ecological_environment.push(item)
+                    } else if ( item == "卫生"){
+                        mergedlist.push("卫健委")
+                        hasMerged = true
+                        health_commission.push(item)
+                    } else if (item == "工商"||item == "质监"||item == "食药"){
+                        mergedlist.push("市场监管")
+                        hasMerged = true
+                        market_supervision.push(item)
+                    } else if (item == "地震"||item=="安监"||item=="公安"){
+                        mergedlist.push("应急管理")
+                        hasMerged = true
+                        contingency_management.push(item)
+                    } else if (item=="文化"||item == "旅游"){
+                        mergedlist.push("文旅")
+                        hasMerged = true
+                        cultural_tourism.push(item)
+                    } else if  (item == "银监"||item == "保监"){
+                        mergedlist.push("银保监")
+                        hasMerged = true
+                        CBRC.push(item)
+                    }
+                }else{
+                    mergedlist.push(item)
+                }
+            })
+            if(nature_source.length>=1){
+                tips +=Highlight(nature_source).join(',')+" 合并为 【自然资源】<br>"
+            }
+            if (ecological_environment.length>=1){
+                tips +=Highlight(ecological_environment).join(',')+" 合并为 【生态环境】<br>"
+            }
+            if (health_commission.length>=1){
+                tips +=Highlight(health_commission).join(',')+" 合并为 【卫健委】<br>"
+            }
+            if (market_supervision.length>=1){
+                tips +=Highlight(market_supervision).join(',')+" 合并为 【市场监管】<br>"
+            }
+            if (contingency_management.length>=1){
+                tips +=Highlight(contingency_management).join(',')+" 合并为 【应急管理】<br>"
+            }
+            if (cultural_tourism.length>=1){
+                tips +=Highlight(cultural_tourism).join(',')+" 合并为 【文旅】<br>"
+            }
+            if (CBRC.length>=1){
+                tips +=Highlight(CBRC).join(',')+" 合并为 【银保监】<br>"
+            }
+            if (hasMerged){
+                $("#merge_content").html(tips)
+                $("#merge_dialog").show()
+            }
+        }
+
+        function acceptchange() {
+            var q = removeDuplicatedItem(mergedlist)
+            $.post("/subscribepay/vipsubscribe/mergeIndustry",{"industry":q.toString()},function (r) {
+                if (r.success){
+                    sessionStorage.removeItem("sub_vip_state")
+                    console.log("行业合并成功")
+                }else{
+                    console.log("行业合并失败")
+                }
+            })
+            $("#merge_dialog").hide()
+        }
+        function Highlight(key) {
+            var t = new Array()
+            key.forEach(function (item,index) {
+                var m = "<span style='color:red'>"+item+"</span>"
+                t.push(m)
+            })
+            return t
+        }
+        function removeDuplicatedItem(ar) {
+            var ret = [];
+
+            for (var i = 0, j = ar.length; i < j; i++) {
+                if (ret.indexOf(ar[i]) === -1) {
+                    ret.push(ar[i]);
+                }
+            }
+
+            return ret;
+        }
     </script>
 </div>
 </body>

+ 16 - 1
src/web/templates/weixin/vipsubscribe/vip_index_new.html

@@ -25,6 +25,9 @@
         .other-buyerclass > .weui-toast{
           width: 4.3rem !important;
         }
+        .merge-dialog{
+            z-index: 99999;
+        }
     </style>
 </head>
 
@@ -420,11 +423,23 @@
         </div>
     </div>
 </div>
+<!-- 行业合并弹窗-->
+<div class="js_dialog merge" id="merge_dialog" style="display: none">
+    <div class="weui-mask merge-dialog"></div>
+    <div class="weui-dialog merge-dialog">
+        <div class="weui-dialog__bd" id="merge_content" style="text-align:justify;font-size: .28rem;line-height: .48rem;">
+
+        </div>
+        <div class="weui-dialog__ft">
+            <a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_primary know" onclick="acceptchange()">已阅读,同意调整</a>
+        </div>
+    </div>
+</div>
 <script src="/vipsubscribe/js/jquery-2.1.4.js?v={{Msg "seo" "version"}}"></script>
 <script src="/vipsubscribe/js/weui.min.js?v={{Msg "seo" "version"}}"></script>
 <script src="/vipsubscribe/js/common.js?v={{Msg "seo" "version"}}"></script>
 <script src="/vipsubscribe/js/UpgradePrice.js?v={{Msg "seo" "version"}}"></script>
-<script src="/vipsubscribe/js/vip_index_new.js?v=15{{Msg "seo" "version"}}6"></script>
+<script src="/vipsubscribe/js/vip_index_new.js?v=10{{Msg "seo" "version"}}11"></script>
 {{include "/common/weixin.html"}}
 </body>
 <script>

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff