Răsfoiți Sursa

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

wangkaiyue 5 ani în urmă
părinte
comite
ac0a456235

+ 11 - 7
src/jfw/modules/subscribepay/src/service/vipRenewUpgrade.go

@@ -132,7 +132,9 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 		//		} else if date_unit == 2 { //月
 		//			endTime = endTime.AddDate(0, date_count, 0)
 		//		}
-		endTime = util.GetDATE(date_unit, date_count, end)
+		if date_unit >= 1 {
+			endTime = util.GetDATE(date_unit, date_count, end)
+		}
 		log.Println("endend", endTime)
 		if pay_source == "Renew" && now.Unix() > end { //到期后的续费从当前时间往后延长
 			startTime = now
@@ -159,15 +161,17 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 		if pay_source == "Renew" {
 			totalfee = entity.JyVipSubStruct.GetSubVipPrice(area, industry, date_count, date_unit)
 		} else if pay_source == "Upgrade" {
-			upgradeYear, upgradeMonth := MaxUpgradeMonth(end, effect)                       //获取最大升级月数
-			addY := entity.JyVipSubStruct.GetSubVipPrice(area, industry, upgradeYear, 1)    //已购+新增,以年为单位的价格
-			addM := entity.JyVipSubStruct.GetSubVipPrice(area, industry, upgradeMonth, 2)   //已购+新增,以月为单位的价格
-			addPrice := addM + addY                                                         //已购+新增总价格
+			upgradeYear, upgradeMonth := MaxUpgradeMonth(end, effect)                     //获取最大升级月数
+			addY := entity.JyVipSubStruct.GetSubVipPrice(area, industry, upgradeYear, 1)  //已购+新增,以年为单位的价格
+			addM := entity.JyVipSubStruct.GetSubVipPrice(area, industry, upgradeMonth, 2) //已购+新增,以月为单位的价格
+			addPrice := addM + addY                                                       //已购+新增总价格
+			log.Println("1", addPrice)
 			nowY := entity.JyVipSubStruct.GetSubVipPrice(areas, industrys, upgradeYear, 1)  //已购,以年为单位的价格
 			nowM := entity.JyVipSubStruct.GetSubVipPrice(areas, industrys, upgradeMonth, 2) //已购,以月为单位的价格
 			nowPrice := nowM + nowY                                                         //已购总价格
-			totalfee = addPrice - nowPrice                                                  //已购+新增的总价格 - 已购总价格 = 升级差价
-			if date_unit == 1 {                                                             //升级中的延长时间
+			log.Println("2", nowPrice)
+			totalfee = addPrice - nowPrice //已购+新增的总价格 - 已购总价格 = 升级差价
+			if date_unit == 1 {            //升级中的延长时间
 				lengPrice := entity.JyVipSubStruct.GetSubVipPrice(area, industry, date_count, 1) //单位为年的已购+新增延长时间价格
 				totalfee = totalfee + lengPrice                                                  //已购+新增延长时间价格 + 升级差价 = 最终价格
 			} else if date_unit == 2 {

+ 1 - 0
src/web/staticres/vipsubscribe/css/keyWord.css

@@ -145,6 +145,7 @@
     -webkit-line-clamp: 1;
     -webkit-box-orient: vertical;
     width: 4rem;
+	text-align:right;
 }
 
 .keyWord .all-classify-column .classify-list .classify-item .classify-item-r {

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

@@ -342,7 +342,7 @@ text-decoration: none;
   top: 0.88rem;
   bottom: 0;
   width: 100%;
-  height: calc(100vh - 1.82rem);
+  height: calc(100vh - 0.82rem);
   margin-left: -0.3rem;
   background: #000;
   opacity: 0.5;

+ 2 - 15
src/web/staticres/vipsubscribe/js/keyWord.js

@@ -255,20 +255,7 @@ var reloadFunc = function(){
 
     // 显示关键词分类弹框
     $('.classify-r').on('click', function(){
-        // 如果是苹果手机,打开时候要设置top
-        var agent = navigator.userAgent.toLowerCase();
-        var dialog = $('.classify-edit-pop .weui-dialog')
-        if( /iphone|ipod|ipad|ios/.test(agent) ){
-            dialog.css({ 'top': '30%' })
-        } else {
-            dialog.css({ 'top': '50%' })
-        }
-        $('.classify-edit-pop').show()
-        var currentClassifyName = $(this).find('.classify-detail').text()
-        if(currentClassifyName=="未分类"){
-            currentClassifyName = ""
-        }
-        $('input.classify-keyword').val(currentClassifyName).focus()
+		modalOne();
     })
     //
 
@@ -318,4 +305,4 @@ var reloadFunc = function(){
         $('.classify-edit-pop').hide()
         $('input.classify-keyword').val('')
     })
-}
+}

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

@@ -606,10 +606,15 @@
 			window.location.href = "/front/vipsubscribe/introducePage";
 		}
 		//vip设置
-		function tosetkeyspage(){
+		function tosetpage(){
 			setSessionStorage();
 			window.location.href="/front/vipsubscribe/toSetPage";
 		}
+		//vip关键词设置
+		function tosetkeyspage(){
+			setSessionStorage();
+			window.location.href="/front/vipsubscribe/toSetKeyWordPage";
+		}
 		//续费
 		function torepay(){
 			setSessionStorage();
@@ -747,9 +752,6 @@
 		.overClass{
 			overflow: hidden;
 		}
-		.filter_tab .screen{
-			top:1.88rem;
-		}
 		.buyerclass {
 		    border: 1px solid #CFAD89;
 		    background: #CFAD89;
@@ -804,7 +806,7 @@
                   	</div>
               	</div>
               	<div class="vip_set" style="display: none;">
-              		<a onclick="tosetkeyspage()" class="vip_set_box"  style="text-decoration: none;">
+              		<a onclick="tosetpage()" class="vip_set_box"  style="text-decoration: none;">
               			<span class="free7days_pic"></span>
               			<span style="text-decoration: none;">VIP订阅设置</span>
               		</a>
@@ -993,8 +995,15 @@
         		ajaxFun("",selectCity);
         	}
         }
+		//禁止默认行为方法
+		function stopScroll(e) {
+		    e.preventDefault()
+		}
         //
         $(function () { 
+			document.querySelector('.screen').addEventListener('touchmove', stopScroll, false);
+			document.querySelector('.tab_left').addEventListener('touchmove', stopScroll, false);
+			document.querySelector('.tab_right').addEventListener('touchmove', stopScroll, false);
 			if(firstTime!=""){
 				date = formatDate(firstTime/1000,"1");
         	}

+ 20 - 8
src/web/templates/weixin/vipsubscribe/choose_area_upgrade.html

@@ -482,14 +482,16 @@
               	$(dom).parents().siblings('.tab_content').find(".city").attr({"disabled":!canClick});
               }
             }
-            if(province === "全国"){
-            	$('.tab .province').each(function(){
-            		$(this).children('.checkbox').attr({"checked": true,"disabled":!canClick});//选中此省份
-            	});
-            	$('.tab_content .city').each(function(){
-            		$(this).attr("disabled",!canClick);
-            	});
-            	$(".tips_d_money").hide();
+            if(!canClick){
+            	if(province === "全国"){
+	            	$('.tab .province').each(function(){
+	            		$(this).children('.checkbox').attr({"checked": true,"disabled":!canClick});//选中此省份
+	            	});
+	            	$('.tab_content .city').each(function(){
+	            		$(this).attr("disabled",!canClick);
+	            	});
+	            	$(".tips_d_money").hide();
+	            }
             }
           })
         },
@@ -795,9 +797,19 @@
                     "checked": false
                 })
 				AreaChoose.showSelected(false);
+				AreaChoose.getResult();
 				sessionStorage.removeItem("vipSubSelectArea");
             })
             //
+            if(sessionStorage.vipSubSelectArea!==undefined&&sessionStorage.vipSubSelectArea!==""){
+            	let areas = JSON.parse(sessionStorage.vipSubSelectArea);
+            	for(var province in areas){
+            		if(province === "全国"){
+            			console.log("23123")
+              			$(".other").trigger("click");
+            		}
+            	}
+            }
         },
         reset:function(){
            var checked = $(".other").is(':checked');

+ 21 - 9
src/web/templates/weixin/vipsubscribe/keyWord.html

@@ -311,15 +311,7 @@
             $('.classify-show-pop .dialog__btn_confirm').on('click', function() {
                 $('.classify-show-pop').hide();
                 setTimeout(function(){
-                    // 如果是苹果手机,打开时候要设置top
-                    var agent = navigator.userAgent.toLowerCase();
-                    var dialog = $('.classify-edit-pop .weui-dialog')
-                    if( /iphone|ipod|ipad|ios/.test(agent) ){
-                        dialog.css({ 'top': '30%' })
-                    } else {
-                        dialog.css({ 'top': '50%' })
-                    }
-                    $('.classify-edit-pop').show();
+                    modalOne();
                 },200)
             })
             // 关键词分类 - 取消按钮点击事件
@@ -728,6 +720,23 @@
                 }
             }
         }
+		//
+		function modalOne(){
+		    // 如果是苹果手机,打开时候要设置top
+		    var agent = navigator.userAgent.toLowerCase();
+		    var dialog = $('.classify-edit-pop .weui-dialog')
+		    if( /iphone|ipod|ipad|ios/.test(agent) ){
+		        dialog.css({ 'top': '30%' })
+		    } else {
+		        dialog.css({ 'top': '50%' })
+		    }
+		    $('.classify-edit-pop').show()
+		    var currentClassifyName = $(".classify").find('.classify-detail').text()
+		    if(currentClassifyName.indexOf("未分类")>-1){
+		        currentClassifyName = ""
+		    }
+		    $('input.classify-keyword').val(currentClassifyName).focus()
+		}
     </script>
     <script src="{{Msg "seo" "cdn"}}/vipsubscribe/js/keyWord.js?v={{Msg "seo" "version"}}21"></script>
     <script>
@@ -770,6 +779,9 @@
                 $(".enter.addkeyWord").find("input").val("");
                 $(".enter.addkeyWord").show();
                 $(".add-keyword-container .addNewKeyword").hide();
+                setTimeout(function(){
+                    modalOne();
+                },200)
             })
             // 通过判断是那个隐藏来判断是添加关键词还是添加新分类
             $(".addNewKeyword i").on('click', function () {

+ 14 - 10
src/web/templates/weixin/vipsubscribe/renew_pay.html

@@ -129,10 +129,10 @@
                             </label>
                             <div class="number_box active" id="number_box_month" data-numbox-step="1" data-numbox-min="1"
                                 data-numbox-max="12">
-                                <button class="weui-btn weui-btn_plain-default" type="button">
+                                <button class="weui-btn weui-btn_plain-default" type="button" disabled>
                                     <div class="jy_icon decrease"></div>
                                 </button>
-                                <span class="month_number">6</span>
+                                <span class="month_number">1</span>
                                 <button class="weui-btn weui-btn_plain-default add" type="button">
                                     <div class="jy_icon increase"></div>
                                 </button>
@@ -198,7 +198,7 @@
         </div>
     </div>
     <script src="/vipsubscribe/js/jquery-2.1.4.js"></script>
-    <script src="/vipsubscribe/js/common.js?v={{Msg "seo" "version"}}3"></script>
+    <script src="/vipsubscribe/js/common.js?v={{Msg "seo" "version"}}4"></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">
@@ -462,7 +462,8 @@
             sessionStorage.renew_cyclecount = flagValLen;
             sessionStorage.renew_price = $(".computed_price").html();
             $('#time_cycle').hide(function () { 
-                $('.choose_item.select_cycle .info').attr('placeholder', val);
+//              $('.choose_item.select_cycle .info').attr('placeholder', val);
+                $('.choose_item.select_cycle .info').val(val);
             })
             $(".finally_price").html($(".computed_price").html());
             sessionStorage.renew_finally_price = $(".finally_price").html();
@@ -589,7 +590,7 @@
 			    		$(".item_cycle .label_for").text(month+"个月");
 			    	}
 			    }
-			    var val = monthPrice * 6
+			    var val = monthPrice * 1
 			    $(".computed_price").html("¥"+val.toFixed(1))
 			 	//
 			 	var threeDay = ends - 86400 * 3;
@@ -607,7 +608,7 @@
 		    }
         }, false);
         //
-        var nowDate = new Date().toLocaleDateString();
+        var nowDate = new Date(startTime).toLocaleDateString();
 		nowDate = nowDate.split("/");
 		var nowMonth = Number(nowDate[1]);
 		var nowYear = Number(nowDate[0]);
@@ -664,14 +665,16 @@
 	 				}
 	 			})
 	 			dateName = cyclecount + "年";
-	 			$('.choose_item.select_cycle .info').attr('placeholder', dateName);
+//	 			$('.choose_item.select_cycle .info').attr('placeholder', dateName);
+	 			$('.choose_item.select_cycle .info').val(dateName);
 	 		}else if(cycleunit === "2"){
 	 			$("#monthly").prop("checked", true);
 	 			$('#number_box_month').addClass('active');
                 $('#number_box_year span').removeClass('active');
                 $(".month_number").text(cyclecount);
                 dateName = cyclecount + "个月";
-                $('.choose_item.select_cycle .info').attr('placeholder', dateName);
+//              $('.choose_item.select_cycle .info').attr('placeholder', dateName);
+                $('.choose_item.select_cycle .info').val(dateName);
 	 		}
 	 	}
 	 	if(sessionStorage.renew_price!==""&&sessionStorage.renew_price!==undefined){
@@ -684,7 +687,8 @@
 	    //
 	    $(".save_renew").on("click", function(){
 	    	console.log(nowUpgrade)
-	    	let times = $('.choose_item.select_cycle .info').attr('placeholder');
+//	    	let times = $('.choose_item.select_cycle .info').attr('placeholder');
+	    	let times = $('.choose_item.select_cycle .info').val();
 	        if (times.match("月") !== null){
 	        	times = Number(times.replace("个月",""));
 	        }else if (times.match("年") !== null){
@@ -706,7 +710,7 @@
 	    	var param = {
 	    		"area": JSON.stringify(area),
 	    		"industry": buyerclass.toString(),
-	    		"time": $('.choose_item.select_cycle .info').attr('placeholder'),
+	    		"time": $('.choose_item.select_cycle .info').val(),
 	    		"payWay":"wx_js",
 	    		"pay_source": "Renew",
 	    		"endtime": ends,

+ 38 - 19
src/web/templates/weixin/vipsubscribe/vip_upgrade.html

@@ -41,7 +41,7 @@
                 <li class="choose_item">
                     <a href="/front/vipsubscribe/toChooseIndustryUpgrade">
                         <span class="label">行业</span>
-                        <input type="text" id="buyerclass" disabled value="" placeholder="选择采购单位行业" class="info">
+                        <input type="text" id="buyerclass" value="" placeholder="选择采购单位行业" class="info">
                         <i class="iconfont icon-arrow"></i>
                     </a>
                     <p class="add_tips industry-list" style="display: none;">已新增 2 个行业</p>
@@ -86,16 +86,16 @@
                                 <td colspan="2">按月购买</td>
                             </tr>
                             <tr>
-                                <td>5.8元 月/市/行业</td>
-                                <td>18元 月/市/全行业</td>
+                                <td><span>5.8</span>元 月/市/行业</td>
+                                <td><span>18</span>元 月/市/全行业</td>
                             </tr>
                             <tr>
-                                <td>11.8元 月/省/行业</td>
-                                <td>38元 月/省/全行业</td>
+                                <td><span>11.8</span>元 月/省/行业</td>
+                                <td><span>38</span>元 月/省/全行业</td>
                             </tr>
                             <tr>
-                                <td>118元 月/全国/行业</td>
-                                <td>388元 月/全国/全行业</td>
+                                <td><span>118</span>元 月/全国/行业</td>
+                                <td><span>388</span>元 月/全国/全行业</td>
                             </tr>
                         </table>
                         <table class="yearly">
@@ -103,16 +103,16 @@
                                 <td colspan="2">按年购买</td>
                             </tr>
                             <tr>
-                                <td>58元 年/市/行业</td>
-                                <td>180元 年/市/全行业</td>
+                                <td><span>58</span>元 年/市/行业</td>
+                                <td><span>180</span>元 年/市/全行业</td>
                             </tr>
                             <tr>
-                                <td>118元 年/省/行业</td>
-                                <td>380元 年/省/全行业</td>
+                                <td><span>118</span>元 年/省/行业</td>
+                                <td><span>380</span>元 年/省/全行业</td>
                             </tr>
                             <tr>
-                                <td>1180元 年/全国/行业</td>
-                                <td>3880元 年/全国/全行业</td>
+                                <td><span>1180</span>元 年/全国/行业</td>
+                                <td><span>3880</span>元 年/全国/全行业</td>
                             </tr>
                         </table>
                         <dl class="tips">
@@ -194,7 +194,7 @@
                                 <button class="weui-btn weui-btn_plain-default" type="button">
                                     <div class="jy_icon decrease"></div>
                                 </button>
-                                <span class="month_number">6</span>
+                                <span class="month_number">1</span>
                                 <button class="weui-btn weui-btn_plain-default add" type="button">
                                     <div class="jy_icon increase"></div>
                                 </button>
@@ -297,7 +297,7 @@
     <script src="/vipsubscribe/js/jquery-2.1.4.js"></script>
     <!--<script src="/vipsubscribe/js/fastclick.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/common.js?v={{Msg "seo" "version"}}3"></script>
     <script type="text/javascript">
     	//
     	try{
@@ -374,7 +374,24 @@
 			    isPageHide = true;
 			});  
 		});
-		
+		//加载价格
+        $DoPost("/subscribepay/vipsubscribe/getPrice",{},function(r){
+          	if(r){
+            	$('.monthly span:eq(0)').text(r.month.oneCity_oneBuyerClass/100);
+		        $('.monthly span:eq(1)').text(r.month.oneCity_allBuyerClass/100);
+		        $('.monthly span:eq(2)').text(r.month.oneProvince_oneBuyerClass/100);
+		        $('.monthly span:eq(3)').text(r.month.oneProvince_allBuyerClass/100);
+		        $('.monthly span:eq(4)').text(r.month.allProvince_oneBuyerClass/100);
+		        $('.monthly span:eq(5)').text(r.month.allProvince_allBuyerClass/100);
+		          
+		        $('.yearly span:eq(0)').text(r.year.oneCity_oneBuyerClass/100);
+		        $('.yearly span:eq(1)').text(r.year.oneCity_allBuyerClass/100);
+		        $('.yearly span:eq(2)').text(r.year.oneProvince_oneBuyerClass/100);
+		        $('.yearly span:eq(3)').text(r.year.oneProvince_allBuyerClass/100);
+		        $('.yearly span:eq(4)').text(r.year.allProvince_oneBuyerClass/100);
+		        $('.yearly span:eq(5)').text(r.year.allProvince_allBuyerClass/100);
+          	}
+        },false)
 		var monthPrice = "";
         var yearPrice = "";
 
@@ -489,7 +506,6 @@
             $("#monthly").prop('checked', true);
             $('#number_box_month').addClass('active')
             $('.number_box span').removeClass('active')
-
             var $number = $('#number_box_month span.month_number');
             var $monthlyInput = $('#monthly');
             // 未整理的data数组,里面的值都是字符串
@@ -599,12 +615,15 @@
                 $('.profit_tips').text("已选择"+val+"个月,建议“按年订阅”更划算哦~");
                 $('.profit_tips').show();
             }
-            console.log(val)
+            
             if (!isChecked) {
                 $('#number_box_month button').attr('disabled', true)
             } else {
                 $('#number_box_month button').removeAttr('disabled')
             }
+            if(val==="1"){
+				$('#number_box_month button:first').attr('disabled', true);
+			}
             if(Number(val)>=10){
             	val = 10
             }
@@ -854,7 +873,7 @@
         function FinallyPrice(){
 	    	var nowUpgrade = "";
 			//
-			var nowDate = new Date().toLocaleDateString();
+			var nowDate = new Date(startTime).toLocaleDateString();
 			nowDate = nowDate.split("/");
 			var nowMonth = Number(nowDate[1]);
 			var nowYear = Number(nowDate[0]);