Ver Fonte

推送缺陷修改

zhangxinlei1996 há 5 anos atrás
pai
commit
91a4d2f3ff

+ 5 - 1
src/jfw/front/swordfish.go

@@ -2431,7 +2431,10 @@ func (f *Front) HasPushHistory() {
 				isExpire = 1 //即将到期
 			}
 			//判断首次用户是否推送的带有”其他“
-			if public.Mysql.CountBySql("select count(1) as count from pushsubscribe where userid =? and buyerclass=? order by date desc", f.GetSession("userId"), 93) > 0 {
+			t, _ := time.ParseInLocation("2006-01-02", time.Now().Format("2006-01-02"), time.Local)
+			today_1 := t.Unix()
+			today_2 := t.AddDate(0, 0, 1).Unix()
+			if public.Mysql.CountBySql("select count(1) as count from pushsubscribe where userid =? and buyerclass=?  and (date between ? and ? )", f.GetSession("userId"), 93, today_1, today_2) > 0 {
 				otherFlag = true
 			}
 		} else {
@@ -2509,6 +2512,7 @@ func (f *Front) Historypush() error {
 	f.T["openid"] = se.EncodeString(myopenid)
 	f.T["stime"] = times
 	f.T["isVip"] = util.IntAll((*data)["i_vip_status"]) > 0
+	f.T["userId"] = userId
 	return f.Render("/weixin/historypush.html", &f.T)
 }
 

+ 5 - 1
src/jfw/modules/app/src/app/front/swordfish.go

@@ -682,7 +682,10 @@ func (f *Front) HasPushHistory() {
 	} else {
 		hasNextPage, list = jy.SubscribePush.Datas(public.MQFW, public.PushMysql, userId, pageNum, formatTime, area)
 		//首次用户推送查询“其他”
-		if public.Mysql.CountBySql("select count(1) as count from pushsubscribe where userid =? and buyerclass=? order by date desc", f.GetSession("userId"), 93) > 0 {
+		t, _ := time.ParseInLocation("2006-01-02", time.Now().Format("2006-01-02"), time.Local)
+		today_1 := t.Unix()
+		today_2 := t.AddDate(0, 0, 1).Unix()
+		if public.Mysql.CountBySql("select count(1) as count from pushsubscribe where userid =? and buyerclass=?  and (date between ? and ? )", f.GetSession("userId"), 93, today_1, today_2) > 0 {
 			otherFlag = true
 		}
 	}
@@ -746,6 +749,7 @@ func (f *Front) Historypush() error {
 			}
 		}
 		f.T["vipSubtips"] = vipSubtips
+		f.T["userId"] = userId
 	}
 	return f.Render("/weixin/historypush.html", &f.T)
 }

+ 6 - 5
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/vip_index_new.js

@@ -240,9 +240,9 @@ $(function () {
     })
     // 其他采购单位行业问号点击事件
     $('.other .icon-bangzhu').on('click', function () {
-        var str = '每条信息的采购单位行业属性由机器自动识别,会存在少数无法识别的情况,此时将归类为"其他"。'
+        var str = '每条信息的采购单位行业属性由机器自动识别,会存在少数无法识别的情况,此时将归类为“其他”。'
         weui.alert(str, {
-            title: '"其他"采购单位',
+            title: '“其他”采购单位',
             className: 'jy-alert',
             buttons: [{
                 label: '我知道了'
@@ -308,9 +308,9 @@ $(function () {
         } else {
             $this.removeClass('checked');
             setotherbuyerclass(0);
-            weui.toast('"其他"采购单位已关闭', {
+            weui.toast('“其他”采购单位已关闭', {
                 duration: 1500,
-                className: 'jy-toast',
+                className: 'jy-toast other-buyerclass',
                 callback: function () {
                     console.log('close')
                 }
@@ -602,6 +602,7 @@ $(function () {
     var selectTime = "";
 
     function init(state) {
+    	console.log(state)
         // init 已选择的区域和行业
         var selectedAreaAndInd = getBuySet(state.area, state.industry);
         setSelectedAreaAndInd(selectedAreaAndInd);
@@ -642,7 +643,7 @@ $(function () {
         }
         
          // 初始化“其他"开关
-        if (state.otherbuyerclass==1) {
+        if (state.otherbuyerclass==1 ||state.otherbuyerclass==null) {
             $('.switch_other').addClass('checked')
         } else {
             $('.switch_other').removeClass('checked')

+ 16 - 14
src/jfw/modules/app/src/web/templates/me/set.html

@@ -119,24 +119,23 @@
 	 </script>
 	<script type="text/javascript">
   	//苹果刷新js
-		$(function () {    
-			var isPageHide = false;   
+		$(function(){
+      var isPageHide = false;   
 			window.addEventListener('pageshow', function () {      
 			    if (isPageHide) {
-	                location.reload();
+	               window.location.reload();
 			    }    
 			});    
-			window.addEventListener('pagehide', function () {
+			window.addEventListener('pagehide', function(){
 			    isPageHide = true;
-			});  
-		});
-		$(function(){
-	        var pushSettingMap = {
-	            1: '每天推送',
-	            2: '每天推送',
-	            3: '每周推送',
-	            4: '每月推送',
-	        }
+			}); 
+      
+      var pushSettingMap = {
+          1: '每天推送',
+          2: '每天推送',
+          3: '每周推送',
+          4: '每月推送',
+      }
 			var version = "";
 			setTimeout(function(){
 				version = JyObj.getVersion();
@@ -148,12 +147,15 @@
 			//
 			if (isvip){
 				$(".pushsetting").attr("href","/jyapp/vipsubscribe/toSetPushSetPage");
-				$.post("/subscribepay/vipsubscribe/getSubBuyMsg",{},function(r){
+        setTimeout(function(){
+          $.post("/subscribepay/vipsubscribe/getSubBuyMsg",{},function(r){
 					if (r.success){
 						var ratemode=r.data.ratemode;
+            alert(ratemode)
 						$('#pushMsgSet .push-setting-text').text(pushSettingMap[ratemode]);
 					}
 				})
+        },300)
 			}else{
 				$(".pushsetting").attr("href","/jyapp/wxkeyset/keyset/seniorset");
 			}

+ 6 - 2
src/jfw/modules/app/src/web/templates/vipsubscribe/vip_index_new.html

@@ -28,6 +28,10 @@
         .weui-dialog__ft{
             font-size: 16px;
         }
+        
+        .other-buyerclass > .weui-toast{
+             width: 4.3rem !important;
+        }
     </style>
 </head>
 
@@ -193,7 +197,7 @@
                         <span class="item-l">
                             <span class="leading_ jy-icon-othter-match"></span>
                             <span class="item-label-other">
-                                <span class="label-text">"其他"采购单位</span>
+                                <span class="label-text">“其他”采购单位</span>
                                 <i class="iconfont icon-bangzhu"></i>
                             </span>
                         </span>
@@ -418,7 +422,7 @@
     <script src="/jyapp/vipsubscribe/js/weui.min.js?v={{Msg "seo" "version"}}"></script>
     <script src="/jyapp/vipsubscribe/js/common.js?v={{Msg "seo" "version"}}"></script>
     <script src="/jyapp/vipsubscribe/js/UpgradePrice.js?v={{Msg "seo" "version"}}"></script>
-    <script src="/jyapp/vipsubscribe/js/vip_index_new.js?v={{Msg "seo" "version"}}"></script>
+    <script src="/jyapp/vipsubscribe/js/vip_index_new.js?v={{Msg "seo" "version"}}1"></script>
     <script src="/jyapp/js/common.js?v={{Msg "seo" "version"}}"></script>
 </div>
 </body>

+ 48 - 21
src/jfw/modules/app/src/web/templates/weixin/historypush.html

@@ -57,8 +57,18 @@
             }
         }
         $(function () {
+            var alert_other;
+            alert_other=setInterval(function(){
+              if(localStorage.canshowother && localStorage.getItem({{.T.userId}}+"_otherFlag")&&localStorage.getItem({{.T.userId}}+"_alert")==null){
+                $(".jy-alert-other").show();
+                localStorage.setItem({{.T.userId}}+"_alert","1")
+                clearInterval(alert_other);
+              }
+            },1000)
+            
             //到期提醒页面
             var vipSubtips = {{.T.vipSubtips}};
+          
             if (Number(vipSubtips) === 0 && sessionStorage.vipSubtips == undefined) {
                 history.pushState({}, "", "");
                 sessionStorage.vipSubtips = "t";
@@ -78,7 +88,7 @@
                 isinitpage = true;
             }
         });
-
+      
         var firstTime = {{.T.selectTime}};
         var userId = "";
         var selectCity = "";
@@ -293,16 +303,8 @@
                       async: false,
                       dataType: 'json',
                       success: function (data) {
-                        if (data.otherFlag&&localStorage.getItem(userId+"_otherFlag")==null){
-                          var str = '每条信息的采购单位行业属性由机器自动识别,会存在少数无法识别的情况,此时将归类为"其他"。'       
-                          weui.alert(str, {
-                                    title: '"其他"采购单位',
-                                    className: 'jy-alert',
-                                    buttons: [{
-                                        label: '我知道了'
-                                    }]
-                          });
-                          localStorage.setItem(userId+"_otherFlag",data.otherFlag) 
+                       if (data.otherFlag){
+                          localStorage.setItem({{.T.userId}}+"_otherFlag",data.otherFlag) 
                         }
                         firstPage = data.data;
                         if (r.userType=="" && !firstPage.length > 0 && !r.haskey) {
@@ -338,6 +340,7 @@
                   }
                   dataCache = dataCache.concat(firstPage);
                   structureHtml(firstPage, true);
+                 
                   setTimeout(function () {
                       $(".listcontent").scrollTop(0);
                       //$("#list").css("visibility","visible");
@@ -1441,15 +1444,26 @@
             font-size: .36rem;
             border-radius: .4rem;
         }
-        .weui-dialog__btn {
-            display: block;
-            -webkit-box-flex: 1;
-            -webkit-flex: 1;
-            flex: 1;
-            color: #0987ff;
-            text-decoration: none;
-            -webkit-tap-highlight-color: rgba(0,0,0,0);
-            position: relative;
+       .jy-alert-other  .weui-dialog__btn {
+            color: #0987ff !important;
+        }
+        .jy-alert-other .weui-dialog__title {
+            font-size: 16 !important;
+            font-weight: 600 !important;
+        }
+        .jy-alert-other .weui-dialog__ft{
+          font-size:14 !important;
+        }
+        .jy-alert-other .weui-dialog__hd{
+          text-align:center !important;
+        }
+       .jy-alert-other .weui-dialog__bd {
+            font-size: 14 !important;
+            text-align: left;
+            word-break: normal;
+        }
+        .jy-alert-other .weui-dialog__ft{
+          text-align:center !important;
         }
     </style>
 </head>
@@ -1552,7 +1566,7 @@
             <div class="open_remind" style="display: none;">
                 <div class="remind_box">
                     <div class="remind_text">
-                        本次推送已达50条信息上限!开通VIP订阅,支持每天最多推送2000条信息
+                        本次推送已达150条信息上限!开通VIP订阅,支持每天最多推送2000条信息
                     </div>
                     <a onclick="tointroducepage()" class="remind_btn" style="text-decoration: none;">了解详情</a>
                 </div>
@@ -1651,6 +1665,8 @@
         </div>
     </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>
 <!--	<img src="/jyapp/images/gotosetpage.png" id="gotosetpage">-->
 {{include "/common/baiducc.html"}}
 
@@ -1896,17 +1912,23 @@
     }
     //用户合并
     $(".dialog_alert .close").on("click",function(){
+      localStorage.canshowother=true
       $(".dialog_alert").hide()
     })
     $(".dialog_alert .dialog_ft").on("click",function(){
+      localStorage.canshowother=true
       window.location.href='/page_entniche/page/user/account_merge.html'
     })
     function userMergeQuery(){
       var tipTime = localStorage.tipUserMerge==undefined?new Date().getTime():parseInt(localStorage.tipUserMerge);
       if (new Date().getTime() < tipTime){
+          localStorage.canshowother=true //用于记录和“其他”弹窗先后顺序
         return
       }
       $.post("/jypay/usermerge/query",{"notice":"1"},function(r){
+        if(r.message=="success"&&r.data.needMerge==false){
+          localStorage.canshowother=true //用于记录和“其他”弹窗先后顺序
+        } 
         if(r.message=="success"&&r.data.needMerge==true){
           var showText='<em style="color:#2ABED1">手机号:'+r.data.phone+'、微信号:'+r.data.nickname+'</em><br> 为保证您的正常使用,您可以根据自身情况进行设置。'
           if(r.data.vip.length==2){
@@ -1924,6 +1946,11 @@
         localStorage.tipUserMerge=tipTime
       },"json")
     }
+    //关闭 其他采购单位行业 弹窗
+    function close_other(){
+      $(".jy-alert-other").hide();
+    }
+    
     //
     $(function () {
         userMergeQuery()

+ 4 - 4
src/jfw/modules/app/src/web/templates/weixin/resultpreview.html

@@ -34,6 +34,9 @@ if(firstPage != null && firstPage.length == 1){
 	if(sessionStorage){
 		sessionStorage.version="1"
 	}
+  function back(){
+    window.location.href="/jyapp/wxkeyset/keyset/index";
+  }
 	$(function(){
 		new FastClick(document.body);
 		if(keys.length > 0){
@@ -43,9 +46,6 @@ if(firstPage != null && firstPage.length == 1){
 			hasNoData();
 			return;
 		}
-    $("#back").on("click",function(){
-        window.location.href="/jyapp/wxkeyset/keyset/index";
-    })
 		$(".app-layout-content-b").scroll(function(){
 			scrollTop = $(this).scrollTop();
 		});
@@ -359,7 +359,7 @@ a{
 			</div>
 			<span style="color:#1d1d1d;font-size:16px;">没有找到和你订阅关键词匹配的信息<br/></span>
 			<div style="width:100%;" class="text-center">
-				<img style="width: 200px;margin-top: 25px;" src="/jyapp/images/wx/jydyshz.png" id="back" >
+				<img style="width: 200px;margin-top: 25px;" src="/jyapp/images/wx/jydyshz.png" onClick="back()" >
 			</div>
 		</span>
 	</div>

+ 1 - 1
src/jfw/modules/subscribepay/src/service/vipSubscribeChange.go

@@ -54,7 +54,7 @@ func (this *SubscribeChange) GetSubBuyMsg() {
 			"ratemode":        (*o_vipjy)["i_ratemode"],
 			"startTime":       (*rData)["l_vip_starttime"],
 			"endTime":         (*rData)["l_vip_endtime"],
-			"ohterbuyerclass": (*o_vipjy)["i_matchbuyerclass_other"],
+			"otherbuyerclass": (*o_vipjy)["i_matchbuyerclass_other"],
 		}}
 	}()
 	if r.Err != nil {

+ 5 - 6
src/web/staticres/vipsubscribe/js/vip_index_new.js

@@ -20,7 +20,6 @@ $(function () {
         if (checkedflag_other) {
             checkedflag_other = false;
             $.post("/subscribepay/afterPay/setUserInfo", {pageType: "other_buyerclass", other: index}, function (r) {
-            	console.log(index)
                 if (r.flag) {
                     checkedflag_other = true;
                     reqData.otherbuyerclass = index;
@@ -243,9 +242,9 @@ $(function () {
     
     // 其他采购单位行业问号点击事件
     $('.other .icon-bangzhu').on('click', function () {
-        var str = '每条信息的采购单位行业属性由机器自动识别,会存在少数无法识别的情况,此时将归类为"其他"。'
+        var str = '每条信息的采购单位行业属性由机器自动识别,会存在少数无法识别的情况,此时将归类为“其他”。'
         weui.alert(str, {
-            title: '"其他"采购单位',
+            title: '“其他”采购单位',
             className: 'jy-alert',
             buttons: [{
                 label: '我知道了'
@@ -312,9 +311,9 @@ $(function () {
         } else {
             $this.removeClass('checked');
             setotherbuyerclass(0);
-            weui.toast('"其他"采购单位已关闭', {
+            weui.toast('“其他”采购单位已关闭', {
                 duration: 1500,
-                className: 'jy-toast',
+                className: 'jy-toast other-buyerclass',
                 callback: function () {
                     console.log('close')
                 }
@@ -651,7 +650,7 @@ $(function () {
         }
         
          // 初始化“其他"开关
-        if (state.otherbuyerclass==1) {
+        if (state.otherbuyerclass==1||state.otherbuyerclass==null) {
             $('.switch_other').addClass('checked')
         } else {
             $('.switch_other').removeClass('checked')

+ 46 - 13
src/web/templates/weixin/historypush.html

@@ -45,6 +45,14 @@
         var words = ""
         initShare({{.T.signature}},{{.T.openid}}, 2, "jy_extend",{{.T.nickname}},{{.T.avatar}});
         $(function () {
+            var alert_other;
+            alert_other=setInterval(function(){
+              if(localStorage.canshowother && localStorage.getItem({{.T.userId}}+"_otherFlag")&&localStorage.getItem({{.T.userId}}+"_alert")==null){
+                $(".jy-alert-other").show();
+                localStorage.setItem({{.T.userId}}+"_alert","1")
+                clearInterval(alert_other);
+              }
+            },1000)
             var isinitpage = false;
             $(window).bind("pageshow", function (event) {
                 if (event.originalEvent.persisted) {
@@ -71,6 +79,7 @@
             $(window).scroll(function () {
                 scrollTop = $(this).scrollTop();
             });
+            
         });
 
         var isInTSguide = false;//订阅向导
@@ -147,16 +156,8 @@
                     async: false,
                     dataType: 'json',
                     success: function (data) {
-                       if (data.otherFlag&&localStorage.getItem(userId+"_otherFlag")==null){
-                          var str = '每条信息的采购单位行业属性由机器自动识别,会存在少数无法识别的情况,此时将归类为"其他"。'       
-                          weui.alert(str, {
-                                    title: '"其他"采购单位',
-                                    className: 'jy-alert',
-                                    buttons: [{
-                                        label: '我知道了'
-                                    }]
-                          });
-                          localStorage.setItem(userId+"_otherFlag",data.otherFlag) 
+                        if (data.otherFlag){
+                          localStorage.setItem({{.T.userId}}+"_otherFlag",data.otherFlag) 
                         }
                         pageIndex = 2;
                         isInTSguide = data.isInTSguide;
@@ -1020,7 +1021,27 @@
             font-size: .36rem;
             border-radius: .4rem;
         }
-        
+        .jy-alert-other  .weui-dialog__btn {
+            color: #0987ff !important;
+        }
+        .jy-alert-other .weui-dialog__title {
+            font-size: 16 !important;
+            font-weight: 600 !important;
+        }
+        .jy-alert-other .weui-dialog__ft{
+          font-size:14 !important;
+        }
+        .jy-alert-other .weui-dialog__hd{
+          text-align:center !important;
+        }
+       .jy-alert-other .weui-dialog__bd {
+            font-size: 14 !important;
+            text-align: left;
+            word-break: normal;
+        }
+        .jy-alert-other .weui-dialog__ft{
+          text-align:center !important;
+        }
     </style>
 </head>
 <body>
@@ -1104,7 +1125,7 @@
         <div class="open_remind" style="display: none;">
             <div class="remind_box">
                 <div class="remind_text">
-                    本次推送已达50条信息上限!开通VIP订阅,支持每天最多推送2000条信息
+                    本次推送已达150条信息上限!开通VIP订阅,支持每天最多推送2000条信息
                 </div>
                 <a onclick="tointroducepage()" class="remind_btn" style="text-decoration: none;">了解详情</a>
             </div>
@@ -1173,7 +1194,8 @@
           <a class="common_btn">去设置</a>
       </div>
   </div>
-</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>
 <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">
@@ -1352,17 +1374,23 @@
     }
     //用户合并
     $(".dialog_alert .close").on("click",function(){
+      localStorage.canshowother=true //用于记录和“其他”弹窗先后顺序
       $(".dialog_alert").hide()
     })
     $(".dialog_alert .dialog_ft").on("click",function(){
+      localStorage.canshowother=true //用于记录和“其他”弹窗先后顺序
       window.location.href='/page_entniche/page/user/account_merge.html'
     })
     function userMergeQuery(){
       var tipTime = localStorage.tipUserMerge==undefined?new Date().getTime():parseInt(localStorage.tipUserMerge);
       if (new Date().getTime() < tipTime){
+        localStorage.canshowother=true //用于记录和“其他”弹窗先后顺序
         return
       }
       $.post("/jypay/usermerge/query",{"notice":"1"},function(r){
+        if(r.message=="success"&&r.data.needMerge==false){
+          localStorage.canshowother=true //用于记录和“其他”弹窗先后顺序
+        } 
         if(r.message=="success"&&r.data.needMerge==true){
           var showText='<em style="color:#2ABED1">手机号:'+r.data.phone+'、微信号:'+r.data.nickname+'</em><br> 为保证您的正常使用,您可以根据自身情况进行设置。'
           if(r.data.vip.length==2){
@@ -1380,6 +1408,11 @@
         localStorage.tipUserMerge=tipTime
       },"json")
     }
+    
+    //关闭 其他采购单位行业 弹窗
+    function close_other(){
+      $(".jy-alert-other").hide();
+    }
     //
     $(function () {
         userMergeQuery();

+ 5 - 2
src/web/templates/weixin/vipsubscribe/vip_index_new.html

@@ -22,6 +22,9 @@
             width: auto;
             padding: 0 .1rem;
         }
+        .other-buyerclass > .weui-toast{
+          width: 4.3rem !important;
+        }
     </style>
 </head>
 
@@ -196,7 +199,7 @@
                         <span class="item-l">
                             <span class="leading_ jy-icon-othter-match"></span>
                             <span class="item-label-other">
-                                <span class="label-text">"其他"采购单位</span>
+                                <span class="label-text">“其他”采购单位</span>
                                 <i class="iconfont icon-bangzhu"></i>
                             </span>
                         </span>
@@ -421,7 +424,7 @@
 <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"}}1"></script>
+<script src="/vipsubscribe/js/vip_index_new.js?v=15{{Msg "seo" "version"}}2"></script>
 {{include "/common/weixin.html"}}
 </body>
 <script>

+ 1 - 1
src/web/templates/weixin/wxkeyset/seniorset.html

@@ -303,7 +303,7 @@ function saveData(){
 		"ratemode": 1,
 		"wxpush":0,
 		"mailpush":0,
-		"email": $("#email").val(),
+		"email": $(".emailset > span").text(),
 	};
 	if($("#pushfrequency li:eq(2)").hasClass("checked")){
 		param["ratemode"] = 2;