瀏覽代碼

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

zhangxinlei1996 5 年之前
父節點
當前提交
3f62a6b20b

+ 10 - 9
src/jfw/front/swordfish.go

@@ -2379,8 +2379,10 @@ func (f *Front) HasPushHistory() {
 		var oneRemind = int64(1 * 24 * 60 * 60)
 		var o_vipjy map[string]interface{}
 		o_vipjy, _ = (*user)["o_vipjy"].(map[string]interface{})
-		a_itmes := util.ObjArrToMapArr(o_vipjy["a_items"].([]interface{}))
-		hasKeyFlag = len(a_itmes) > 0
+		if o_vipjy["a_items"] != nil {
+			a_itmes := util.ObjArrToMapArr(o_vipjy["a_items"].([]interface{}))
+			hasKeyFlag = len(a_itmes) > 0
+		}
 		isVipFlag = true
 		isPassCount = redis.GetInt("pushcache_2_a", "oncecount_"+tedayNum+"_"+userId) > 2000
 		isOnTail = util.IntAll((*user)["i_vip_status"])
@@ -2405,19 +2407,18 @@ func (f *Front) HasPushHistory() {
 		}
 		isPassCount = redis.GetInt("pushcache_2_a", "oncecount_"+tedayNum+"_"+userId) > 50
 	}
-	//	hasNextPage, list, err := public.HistoryPush.Datas(userId, 1, firstPushTime, formatTime)
-	//	if err == nil && hasKeyFlag && len(list) == 0 && formatTime == "" && !isVipFlag {
-	//		flag, data := public.HistoryPush.MakeHistoryDatas(userId, bidSearch_field_1)
-	//		if flag && data != nil {
-	//			list = data
-	//		}
-	//	}
 	pageNum, _ := f.GetInteger("pageNum")
 	if pageNum == 0 {
 		pageNum = 1
 	}
 	area := f.GetString("area")
 	hasNextPage, list := public.HistoryPush.Datas_Mysql(userId, pageNum, formatTime, area)
+	if hasKeyFlag && len(list) == 0 && formatTime == "" && !isVipFlag {
+		flag, data := public.HistoryPush.MakeHistoryDatas(userId, bidSearch_field_1)
+		if flag && data != nil {
+			list = data
+		}
+	}
 	//
 	f.ServeJson(map[string]interface{}{
 		"haskey":      hasKeyFlag,

+ 23 - 13
src/jfw/public/historypush.go

@@ -426,15 +426,25 @@ func (h *historyPush) getInfoByIds(pushCas []*jy.PushCa) []map[string]interface{
 func (h *historyPush) MakeHistoryDatas(userId, field string) (bool, []map[string]interface{}) {
 	allquery := `{"range":{"publishtime":{"gt":%s}}}`
 	allquery = fmt.Sprintf(allquery, fmt.Sprint(time.Now().AddDate(0, 0, -7).Unix()))
-	//allquery := ``
-	_, list := PushView(userId, allquery, field, 1, 50)
+	allquery = ``
+	keys, list := PushView(userId, allquery, field, 1, 50)
 	if list == nil || len(*list) == 0 {
 		return true, nil
 	}
+	matchkeys := []string{}
+	if len(keys) > 0 {
+		for _, v := range keys {
+			for _, k := range util.ObjArrToStringArr(v.([]interface{})) {
+				matchkeys = append(matchkeys, k)
+			}
+		}
+	}
 	result := []map[string]interface{}{}
-	pushinfo := []string{}
+	fields := []string{"userid", "infoid", "date", "matchkeys", "area", "city", "type", "subscopeclass"}
+	values := []interface{}{}
 	publishTitle := map[string]bool{}
 	now := time.Now()
+	keystr := strings.Join(matchkeys, " ")
 	for k, v := range *list {
 		title := strings.Replace(v["title"].(string), "\n", "", -1)
 		area_check := util.ObjToString(v["area"])
@@ -443,8 +453,7 @@ func (h *historyPush) MakeHistoryDatas(userId, field string) (bool, []map[string
 		} else {
 			publishTitle[area_check+title] = true
 		}
-		pushinfo = append(pushinfo, util.ObjToString(v["_id"]))
-
+		values = append(values, userId, util.ObjToString(v["_id"]), now.Unix(), keystr, area_check, "", 0, v["s_subscopeclass"])
 		info := map[string]interface{}{
 			"area":             area_check,
 			"_id":              util.EncodeArticleId2ByCheck(util.ObjToString(v["_id"])),
@@ -462,6 +471,8 @@ func (h *historyPush) MakeHistoryDatas(userId, field string) (bool, []map[string
 			"title":            title,
 			"ca_isvisit_index": k + 1,
 			"ca_date":          now.Unix(),
+			"ca_isvisit":       0,
+			"matchkeys":        matchkeys,
 		}
 		area := util.ObjToString(info["area"])
 		if area == "A" {
@@ -505,14 +516,13 @@ func (h *historyPush) MakeHistoryDatas(userId, field string) (bool, []map[string
 
 		result = append(result, info)
 	}
-	wxpush := map[string]interface{}{
-		"dateymd":  now.Format(util.Date_yyyyMMdd),
-		"date":     now.Unix(),
-		"uid":      userId,
-		"pushinfo": strings.Join(pushinfo, ","),
-	}
-	flag := Ca_Push.SaveCacheByTimeOut("jy_pushhistory", wxpush, 10)
-	return flag, result
+	go func(fields []string, values []interface{}) {
+		count := Mysql.InsertBatch("pushsubscribe", fields, values)
+		if int(count) == len(values) {
+			log.Println("mysql insert  true")
+		}
+	}(fields, values)
+	return true, result
 }
 
 //获取用户信息

+ 1 - 1
src/web/staticres/vipsubscribe/css/vip_update.css

@@ -877,7 +877,7 @@
 }
 
 .vip_renew .detail_item .item_info .label {
-  width: 1.56rem;
+  width: 1.6rem;
 }
 
 .vip_renew .detail_item .item_info .label_for {

+ 4 - 4
src/web/staticres/vipsubscribe/js/keyWord.js

@@ -1,4 +1,5 @@
-$(function () {
+
+var reloadFunc = function(){
     
     //去空格方法
     // String.prototype.trim = function () {
@@ -41,7 +42,7 @@ $(function () {
     // 添加 确认按钮的点击事件
     $('.content .addkeyWord .btn button').on('click', function () {
         var keyWord = $('.addkeyWord input.enterOne').val();
-		if($.inArray(keyWord, kws_arr)>-1){
+		if(kws_arr[keyWord]!=undefined){
             weui.toast('您设置的关键词已存在,请调整后再添加。', {
                 duration: 2000,
                 className: 'custom-toast',
@@ -285,5 +286,4 @@ $(function () {
         $('.classify-edit-pop').hide()
         $('input.classify-keyword').val('')
     })
-
-})
+}

+ 2 - 2
src/web/templates/weixin/historypush.html

@@ -149,8 +149,8 @@
 				setSessionStorage();
 				window.location.href='/wxkeyset/keyset/index';
 			});
-			console.log(firstPage.length)
-			if(firstPage.length==0){
+			//console.log(firstPage.length)
+			if(firstPage==null||firstPage.length==0){
 				//最开始没有数据 
 				hasNoData();
 				$(".findnull_").show();

+ 32 - 10
src/web/templates/weixin/vipsubscribe/choose_area_upgrade.html

@@ -363,7 +363,8 @@
         <div class="tips_btn">
             <div class="tips_discount">
                 <div class="tips_d_money" style="display: block">&yen;38</div>
-                <div class="tips_d_text">已选择4个市,建议购买“全省”更划算哦~</div>
+                <div class="tips_d_text citys">已选择4个市,建议购买“全省”更划算哦~</div>
+                <div class="tips_d_text all">已选择10个省,建议购买“全国”更划算哦~</div>
             </div>
             <div class="btns">
                 <button class="reset-btn">重置</button>
@@ -390,7 +391,7 @@
         </div>
     </div>
     <script src="/vipsubscribe/js/jquery-2.1.4.js?v={{Msg "seo" "version"}}"></script>
-    <script src="/vipsubscribe/js/fastclick.js?v={{Msg "seo" "version"}}"></script>
+    <!--<script src="/vipsubscribe/js/fastclick.js?v={{Msg "seo" "version"}}"></script>-->
     <script src="/vipsubscribe/js/mapJSON.js?v={{Msg "seo" "version"}}"></script>
     <script src="/vipsubscribe/js/common.js?v={{Msg "seo" "version"}}"></script>
     <script>
@@ -401,7 +402,7 @@
             	buystr = data.area;
         	}
         }, false);
-        console.log(buystr)
+//      console.log(buystr)
       var AreaChoose={
         selectObj:{},//已选择,未购买城市;
         buyObj:{},//已购买
@@ -426,7 +427,7 @@
             if(checkObj(buystr)){
             	this.buyObj = {"全国":[]}
             }
-            console.log(this.buyObj)
+//          console.log(this.buyObj)
             //是否试用界面
             if(sessionStorage.getItem("vipSubisTrial")) this.vipSubisTrial=true;
           }catch(e){
@@ -522,6 +523,7 @@
           $('.result_name').empty()
           var data = []; //定义一个总数组
           var cityArr =[]; //定义一个选中城市数组
+          var provincesArr = [];
           var val = $('.other').parents('.province').text().trim();
           if ($('.other').is(':checked')) {
             // data.push(val)
@@ -533,13 +535,14 @@
               let arr =[];
               // 判断省份下的城市是否等于选中的城市长度,相等就是全部选中
               if (length == activeLeng) {
-                  $('.tips_btn .tips_d_text').hide()
+                  $('.tips_btn .tips_d_text.citys').hide()
                   // data.push($(this).parent('.tab_content').siblings('.tab:not(.whole)').children('.province').text().trim())
                   let province = $(this).parent('.tab_content').siblings('.tab:not(.whole)').children('.province').text().trim();
                   data.push({
                       name:province,
                       children:[]
-                  })
+                  });
+                  provincesArr.push(province);
               } else { 
                   let province = $(this).parent('.tab_content').siblings('.tab:not(.whole)').children('.province').text().trim();
                   let city = $(this).html()
@@ -561,7 +564,8 @@
           data = data.reduce((cur,next) =>{
               obj[next.name] ? "" : obj[next.name] = true && cur.push(next);
               return cur
-          },[]) 
+          },[]);
+          
           // 数组筛选
           let result = data.map(v =>{
               let filterArr = v.children.filter(s =>{
@@ -579,7 +583,8 @@
                   // 判断每个省份下选中的城市长度,当大于等于4的时候 弹出"选择全省更划算的弹窗"
                   let childrenArr=[];
                   if (children.length >= 4 && !this.vipSubisTrial) {
-                      $('.tips_btn .tips_d_text').show()
+                      $('.tips_btn .tips_d_text.citys').text("已选择"+children.length+"个市,建议购买“全省”更划算哦~");
+                      $('.tips_btn .tips_d_text.citys').show();
                   } 
                   html += `${result[i].name}(`
                   for(var j = 0;j < children.length;j++){
@@ -605,6 +610,21 @@
                   this.selectObj[result[i].name]=[];//
               }
           }
+          	for (var x = 0; x < provincesArr.length; x++) {
+	            for (var j =x+1; j <provincesArr.length; ) {
+	                if (provincesArr[x] === provincesArr[j]){
+	                    provincesArr.splice(j, 1);
+	                }
+	                else j++;
+	            }
+	        }
+          	if(provincesArr.length > 9){
+          		$('.tips_d_text.all').text("已选择"+provincesArr.length+"个省,建议购买“全国”更划算哦~");
+          		$('.tips_d_text.all').show();
+          		$('.tips_d_text.citys').hide();
+          	}else{
+          		$('.tips_d_text.all').hide();
+          	}
 //        console.log("this.selectObj:",this.selectObj)
           $('.result_name').append(html)
           AreaChoose.isOpen()
@@ -642,7 +662,7 @@
           let minHeight = $('.result_text').css('min-height')
           let rows = Math.round(Math.round(pHeight)/ parseFloat(minHeight));
           $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
-          console.log("高度:"+ pHeight,"最小高度"+ minHeight,"行数:" + rows)
+//        console.log("高度:"+ pHeight,"最小高度"+ minHeight,"行数:" + rows)
           if(rows == 1){
               if(length >= 50){
                   $('.detail').show()
@@ -652,7 +672,7 @@
                   $('.packup').hide()
               }
           }else if(rows == 2){
-              console.log($('.result_name').html().trim().length)
+//            console.log($('.result_name').html().trim().length)
               let length = $('.result_name').html().trim().length;
               if(length >= 50){
                   $('.detail').show()
@@ -819,6 +839,8 @@
 		    }
 		    return false;
 		}
+	    //
+
     </script>
 </body>
 

+ 67 - 44
src/web/templates/weixin/vipsubscribe/keyWord.html

@@ -232,15 +232,7 @@
 	<script src="{{Msg "seo" "cdn"}}/wxswordfish/share.js?v={{Msg "seo" "version"}}"></script>
     <script>
 		initShare({{.T.signature}},{{.T.openid}},2,"jy_extend",{{.T.nickname}},{{.T.avatar}});
-        weui.loading();
-        setTimeout(function(){
-            weui.loading().hide();
-            if(window.location.search.indexOf("page=1")>-1){
-				history.replaceState("{id:1}","","/front/vipsubscribe/toSetKeyWordPage")
-            }else if(history.state){
-                window.history.go(-1)
-			}
-        },500)
+        
         var a_items = [];//全部数据
         var classify_name = "";//分类名称
         var classify_index = 0;//分类索引
@@ -251,15 +243,69 @@
         var addition_kws = []; //附加词
         var not_kws = []; //排除词
         var classify_arr = [];//分类对象
-        var kws_arr = [];//所有关键词对象
+        var kws_arr = {};//所有关键词对象
         var kws_tips = 0;
         // 页面状态
         var pageState = {
             //是否第一次设置关键词
             isFirstSetKeyword: true
         }
+		//
+		function initSess(){
+			weui.loading();
+	        setTimeout(function(){
+	            weui.loading().hide();
+	            if(window.location.search.indexOf("page=2")>-1){
+					history.replaceState("{id:1}","","/front/vipsubscribe/toSetKeyWordPage")
+	            }else if(history.state){
+	                window.history.go(-1)
+				}
+	        },500)
+		}
+		//
         $(function(){
-            init();
+			var isinitpage = false;
+			$(window).bind("pageshow", function(event){
+				if(event.originalEvent.persisted){
+					initpage();
+					isinitpage = true;
+					initSess();
+					reloadFunc();
+				}
+			});
+			if(!isinitpage) {
+				initpage();
+				initSess();
+				reloadFunc();
+			}
+			window.addEventListener('popstate', function(event){
+				if(!isinitpage){
+					if(a_items.length==0){
+		                window.history.go(-1)
+		            }
+		            var loading = weui.loading('loading...', {
+		                className: 'custom-classname'
+		            })
+		            $('.classify-show-pop').hide();
+		            $('.classify-edit-pop').hide();
+		            //重新加载数据
+		            initpage();
+		            // 用定时器模拟请求耗时
+		            setTimeout(function () {
+		                loading.hide(function() {
+		                    console.log('`loading` has been hidden');
+		                })
+		                // 判断是否是第一次(没有关键词进入)
+		                // 隐藏关键词列表section,显示分类列表section
+		                var isClassifyColumnShow = $('.add-keyword-container').is(':hidden')
+		                if (!isClassifyColumnShow) {
+		                    $('.add-keyword-container').hide()
+		                    $('.all-classify-column').show()
+		                }
+		            }, 500)
+				}
+				isinitpage = false
+			})
             // 关键词分类 - 去设置按钮点击事件
             $('.classify-show-pop .dialog__btn_confirm').on('click', function() {
                 $('.classify-show-pop').hide();
@@ -275,7 +321,6 @@
                     $('.classify-edit-pop').show();
                 },200)
             })
-
             // 关键词分类 - 取消按钮点击事件
             $('.classify-show-pop .dialog__btn_cancel').on('click', function() {
 				$('.enterOne').focus();
@@ -283,7 +328,7 @@
             })
         })
         //获取数据
-        function init(){
+        function initpage(){
             if(sessionStorage&&sessionStorage.kwspage){
                 if(sessionStorage.addition_kws!=undefined){
                     addition_kws = JSON.parse(sessionStorage.addition_kws);
@@ -293,6 +338,7 @@
                 }
                 showKorshowC(sessionStorage.kwspage);
                 a_items = JSON.parse(sessionStorage.a_items)
+                kws_arr = JSON.parse(sessionStorage.kws_arr)
                 classify_name = sessionStorage.classify_name;
                 classify_index = sessionStorage.classify_index;
                 kws_name = sessionStorage.kws_name;
@@ -352,6 +398,7 @@
             kws_count = 0;
             var classifyHtml = '';
             classify_arr = [];//每次初始化分类对象
+			kws_arr = {};//每次初始化关键词对象
             for (var i = 0;  i < kwsdata.length; i++) {
                 var s_item = kwsdata[i]["s_item"]
                 if(s_item==""){
@@ -366,7 +413,7 @@
                         keystr += "、"
                     }
                     keystr += a_key[j]["key"].join('、');
-					kws_arr = kws_arr.concat(a_key[j]["key"])
+					kws_arr[a_key[j]["key"].join(' ')]=j+"-"+i
                 } 
                 classifyHtml +='<li class="classify-item">'
                             +'<div><span class="classify-item-l">'+s_item+'</span>'
@@ -501,7 +548,7 @@
         }
         //跳转附加词
         function toappendkey(th){
-			history.replaceState("","","/front/vipsubscribe/toSetKeyWordPage?page=1")
+			history.replaceState("","","/front/vipsubscribe/toSetKeyWordPage?page=211")
             if(!$('.enter.addkeyWord').is(':hidden')){
                 if($('.addkeyWord input.enterOne').val()==""){
                     return
@@ -519,7 +566,7 @@
         }
         //
         function tonotkey(th){
-			history.replaceState("","","/front/vipsubscribe/toSetKeyWordPage?page=1")
+			history.replaceState("","","/front/vipsubscribe/toSetKeyWordPage?page=211")
             if(!$('.enter.addkeyWord').is(':hidden')){
                 if($('.addkeyWord input.enterOne').val()==""){
                     return
@@ -545,6 +592,7 @@
             sessionStorage.a_items = JSON.stringify(a_items);//当前数据
             sessionStorage.addition_kws =  JSON.stringify(addition_kws);//当前编辑关键词附加词
             sessionStorage.not_kws =  JSON.stringify(not_kws);//当前编辑关键词排除词
+            sessionStorage.kws_arr =  JSON.stringify(kws_arr);//当前所有关键词排
 
             sessionStorage.kws_count=kws_count;//关键词个数
         }
@@ -562,12 +610,13 @@
             sessionStorage.removeItem("addition_kws");
             sessionStorage.removeItem("not_kws");
             sessionStorage.removeItem("kws_count");
+            sessionStorage.removeItem("kws_arr");
         }
         //保存关键词
         function saveK(th,i){
             var $this = $(th);
             kws_name = $(th).siblings('textarea').val();
-			if($.inArray(kws_name, kws_arr)>-1){
+			if(kws_arr[kws_name]!=undefined&&kws_arr[kws_name]!=(kws_index+"-"+classify_index)){
                 weui.toast('您设置的关键词已存在,请调整后再添加。', {
                     duration: 2000,
                     className: 'custom-toast',
@@ -661,7 +710,7 @@
             not_kws = [];
         }
     </script>
-    <script src="{{Msg "seo" "cdn"}}/vipsubscribe/js/keyWord.js?v={{Msg "seo" "version"}}1"></script>
+    <script src="{{Msg "seo" "cdn"}}/vipsubscribe/js/keyWord.js?v={{Msg "seo" "version"}}124"></script>
     <script>
         // 设置一条空记录,用户第一次进入添加关键词点击确定时候调用
         function setEmptyHistory() {
@@ -672,7 +721,6 @@
         }
         //
         $(function(){
-
             $(".addNewKeyword div").on('click', function () {
                 history.pushState({id:1}, "","");
                 classify_index = $(".classify-list li").length;
@@ -741,31 +789,6 @@
                 toSetKws();
             })
         })
-        window.addEventListener('popstate', function(event){
-            if(a_items.length==0){
-                window.history.go(-1)
-            }
-            var loading = weui.loading('loading...', {
-                className: 'custom-classname'
-            })
-            $('.classify-show-pop').hide();
-            $('.classify-edit-pop').hide();
-            //重新加载数据
-            init();
-            // 用定时器模拟请求耗时
-            setTimeout(function () {
-                loading.hide(function() {
-                    console.log('`loading` has been hidden');
-                })
-                // 判断是否是第一次(没有关键词进入)
-                // 隐藏关键词列表section,显示分类列表section
-                var isClassifyColumnShow = $('.add-keyword-container').is(':hidden')
-                if (!isClassifyColumnShow) {
-                    $('.add-keyword-container').hide()
-                    $('.all-classify-column').show()
-                }
-            }, 500)
-        })
     </script>
 	{{include "/common/baiducc.html"}}
 </body>

+ 22 - 15
src/web/templates/weixin/vipsubscribe/renew_pay.html

@@ -13,7 +13,7 @@
     <link rel="stylesheet" type="text/css" href="/vipsubscribe/css/weui.min.css?v={{Msg "seo" "version"}}" />
     <link rel="stylesheet" type="text/css" href="/vipsubscribe/css/base.css?v={{Msg "seo" "version"}}" />
     <link rel="stylesheet" type="text/css" href="/vipsubscribe/iconfont/iconfont.css?v={{Msg "seo" "version"}}" />
-    <link rel="stylesheet" href="/vipsubscribe/css/vip_update.css?v={{Msg "seo" "version"}}3">
+    <link rel="stylesheet" href="/vipsubscribe/css/vip_update.css?v={{Msg "seo" "version"}}5">
 	{{include "/common/weixin.html"}}
 </head>
 <style type="text/css">
@@ -30,7 +30,7 @@
              <!-- 正常点击vip首页续费进入显示下列提示 -->
             <p class="update_tip renew_upgrade">提示:订阅续费可在已购买的服务基础上,延长订阅服务周期</p>
              <!-- 即将到期点击vip首页续费显示下列提示 -->
-            <p class="expire_tip renew_update">提示:您的VIP订阅服务即将到期,为不影响您的使用请立即续费</p>
+            <p class="expire_tip renew_update">提示:您的VIP订阅服务即将到期,为不影响您的使用请立即续费</p>
             <ul class="chooseList">
                 <li class="detail_item">
                         <div class="item_info item_area">
@@ -46,10 +46,8 @@
                             <span class="label_for">10个月</span>
                         </div>
                         <div class="item_info item_validity">
-                            <p>
-                                <span class="label">有效日期:</span>
-                                <span class="label_for">2020.01.31 - 2020.10.31</span>
-                            </p>
+                            <span class="label">有效日期:</span>
+                            <span class="label_for">2020.01.31 - 2020.10.31</span>
                             <p>
                                 <!-- 正常点击vip首页续费进入显示去升级,即将到期点击vip首页续费显示订阅修改 -->
                                 <a href="/weixin/pay/toUpgradePage" class="go_update renew_upgrade">去升级</a>
@@ -200,7 +198,7 @@
         </div>
     </div>
     <script src="/vipsubscribe/js/jquery-2.1.4.js"></script>
-    <script src="/vipsubscribe/js/common.js"></script>
+    <script src="/vipsubscribe/js/common.js?v={{Msg "seo" "version"}}3"></script>
     <!--<script src="/vipsubscribe/js/fastclick.js?v={{Msg "seo" "version"}}"></script>-->
     <script src="https://res.wx.qq.com/open/libs/weuijs/1.1.4/weui.min.js?v={{Msg "seo" "version"}}"></script>
     <script type="text/javascript">
@@ -246,9 +244,10 @@
 							window.location.replace("/front/vipsubscribe/toPaySuccessPage?orderCode="+ordercode);
 						},500)
 					}else if(r.err_msg == "get_brand_wcpay_request:cancel"){               
-	                	alert("开发环境【支付跳转完成】")
+//	                	alert("开发环境【支付跳转完成】")
 		                try{
-		  					window.location.replace("/front/vipsubscribe/toPaySuccessPage?orderCode="+ordercode);
+//		  					window.location.replace("/front/vipsubscribe/toPaySuccessPage?orderCode="+ordercode);
+		                    window.location.reload();
 		                }catch(e){
 		                  alert(e)
 		                }
@@ -353,6 +352,12 @@
                 currentNum = currentNum <= data.numboxMin ? data.numboxMin : currentNum - data
                     .numboxStep;
             }
+            if (currentNum >= 10) {
+            	$('.profit_tips').text("已选择"+currentNum+"个月,建议“按年订阅”更划算哦~");
+                $('.profit_tips').show();
+            } else {
+                $('.profit_tips').hide()
+            }
             $number.text(currentNum)
             if(currentNum >= 10){
             	currentNum = 10;
@@ -361,11 +366,12 @@
             $('.computed_price').html('¥' + price)
             var firstButton = $('#number_box_month button:first')
             var lastButton = $('#number_box_month button:last')
-            if (currentNum >= 10) {
-                $('.profit_tips').show()
-            } else {
-                $('.profit_tips').hide()
-            }
+//          if (currentNum >= 10) {
+//          	$('.profit_tips').text("已选择"+currentNum+"个月,建议“按年订阅”更划算哦~");
+//              $('.profit_tips').show();
+//          } else {
+//              $('.profit_tips').hide()
+//          }
             // 如果为操作后的结果为1,则锁定减号按钮
             if (currentNum === data.numboxMin) {
                 firstButton.attr('disabled', true)
@@ -399,7 +405,8 @@
             let isChecked = $(this).is(':checked')
             let val = $('.month_number').text();
             if (val >= 10) {
-                $('.profit_tips').show()
+            	$('.profit_tips').text("已选择"+val+"个月,建议“按年订阅”更划算哦~");
+                $('.profit_tips').show();
                 val = 10;
             }
 //          console.log(val)

+ 16 - 8
src/web/templates/weixin/vipsubscribe/vip_upgrade.html

@@ -342,9 +342,10 @@
 							window.location.replace("/front/vipsubscribe/toPaySuccessPage?orderCode="+ordercode);
 						},500)
 					}else if(r.err_msg == "get_brand_wcpay_request:cancel"){               
-	                	alert("开发环境【支付跳转完成】")
+//	                	alert("开发环境【支付跳转完成】")
 		                try{
-		  					window.location.replace("/front/vipsubscribe/toPaySuccessPage?orderCode="+ordercode);
+//		  					window.location.replace("/front/vipsubscribe/toPaySuccessPage?orderCode="+ordercode);
+		                	window.location.reload();
 		                }catch(e){
 		                  alert(e)
 		                }
@@ -526,6 +527,12 @@
 		        return
             }
             $(".computed_price").show();
+            if (currentNum >= 10) {
+            	$('.profit_tips').text("已选择"+currentNum+"个月,建议“按年订阅”更划算哦~");
+                $('.profit_tips').show();
+            } else {
+                $('.profit_tips').hide()
+            }
             $number.text(currentNum)
             if(currentNum >= 10){
             	currentNum = 10;
@@ -534,11 +541,11 @@
             $('.computed_price').html('¥' + price)
             var firstButton = $('#number_box_month button:first')
             var lastButton = $('#number_box_month button:last')
-            if (currentNum >= 10) {
-                $('.profit_tips').show()
-            } else {
-                $('.profit_tips').hide()
-            }
+//          if (currentNum >= 10) {
+//              $('.profit_tips').show()
+//          } else {
+//              $('.profit_tips').hide()
+//          }
             // 如果为操作后的结果为1,则锁定减号按钮
             if (currentNum === data.numboxMin) {
                 firstButton.attr('disabled', true)
@@ -584,7 +591,8 @@
             let isChecked = $(this).is(':checked')
             let val = $('.month_number').text();
             if (val >= 10) {
-                $('.profit_tips').show()
+                $('.profit_tips').text("已选择"+val+"个月,建议“按年订阅”更划算哦~");
+                $('.profit_tips').show();
             }
             console.log(val)
             if (!isChecked) {