Browse Source

Merge branch 'dev2.8.5' of ssh://192.168.3.207:10022/qmx/jy into dev2.8.5

wcj 5 years ago
parent
commit
9a7c7ba5b6

+ 2 - 2
src/jfw/front/vipsubscribe.go

@@ -31,13 +31,13 @@ type Subscribepay struct {
 	submitEditSub     xweb.Mapper `xweb:"/front/vipsubscribe/submitEditSub"`     //提交订阅收费
 
 	//升级
-	toUpgradePage xweb.Mapper `xweb:"/front/vipsubscribe/toUpgradePage"`           //订阅收费升级服务页面
+	toUpgradePage xweb.Mapper `xweb:"/weixin/pay/toUpgradePage"`                   //订阅收费升级服务页面
 	addArea       xweb.Mapper `xweb:"/front/vipsubscribe/toChooseAreaUpgrade"`     //订阅收费升级新增区域页面
 	addIndustry   xweb.Mapper `xweb:"/front/vipsubscribe/toChooseIndustryUpgrade"` //订阅收费升级新增行业页面
 
 	//续费
 	renewPage    xweb.Mapper `xweb:"/front/vipsubscribe/renewPage/(.*)"` //订阅到期(will:即将到期,exprie:已到期)
-	renewPayPage xweb.Mapper `xweb:"/front/vipsubscribe/renewPayPage"`   //订阅到期续费
+	renewPayPage xweb.Mapper `xweb:"/weixin/pay/renewPayPage"`           //订阅到期续费
 
 	//发票
 	openInvoice xweb.Mapper `xweb:"/front/vipsubscribe/openInvoice/(\\w+)"` //开发票

+ 12 - 1
src/jfw/modules/subscribepay/src/entity/subscribeVip.go

@@ -23,6 +23,17 @@ type VipSimpleMsg struct {
 	Industry   []string                `json:"industry"`
 	Cyclecount int                     `json:"cyclecount"`
 	Cycleunit  int                     `json:"cycleunit"`
+	PaySource  string                  `json:"paysource"`
+}
+
+type VipUpgradeMsg struct {
+	Id            string                  `json:"_id"`
+	Area          *map[string]interface{} `json:"area"`
+	Industry      []string                `json:"industry"`
+	PaySource     string                  `json:"paysource"`
+	ProCyclecount int                     `json:"procyclecount"`
+	ProCycleunit  int                     `json:"procycleunit"`
+	Effect        string                  `json:"effect"`
 }
 
 //支付完成回调
@@ -171,7 +182,7 @@ func (this *vipSubscribeStruct) SubEditCheckArea(area *map[string]interface{}, b
 		return true
 	}
 	pCount := 0
-	for k, v := range (*area) {
+	for k, v := range *area {
 		citys := qutil.ObjArrToStringArr(v.([]interface{}))
 		if len(citys) > 0 {
 			if len(citys) > qutil.IntAll(buySet.Citys[k]) {

+ 3 - 1
src/jfw/modules/subscribepay/src/service/afterPay.go

@@ -193,8 +193,10 @@ func (a *AfterPay) GetUserInfo() error {
 			var _cyclecount = qutil.IntAll((*data)["i_cyclecount"])
 			if _cycleunit == 1 {
 				(*data)["cycle"] = strconv.Itoa(_cyclecount) + "年"
-			} else {
+			} else if _cycleunit == 2 {
 				(*data)["cycle"] = strconv.Itoa(_cyclecount) + "月"
+			} else {
+				(*data)["cycle"] = strconv.Itoa(_cyclecount) + "天"
 			}
 			//是否到期
 			if qutil.Int64All(_endtime)-time.Now().Unix() < threeRemind && qutil.Int64All(_endtime)-time.Now().Unix() >= twoRemind {

+ 102 - 21
src/jfw/modules/subscribepay/src/service/vipRenewUpgrade.go

@@ -7,7 +7,9 @@ import (
 	"log"
 	qutil "qfw/util"
 	//	"strings"
+	"fmt"
 	"pay"
+	"strconv"
 	"strings"
 	"time"
 	"util"
@@ -38,6 +40,7 @@ func (this *RenewUpgrade) GetBuyMsg() {
 		start := time.Unix(starttime, 0).Format("2006-01-02")
 		endtime := qutil.Int64All((*data)["l_vip_endtime"])
 		end := time.Unix(endtime, 0).Format("2006-01-02")
+		now := time.Unix(time.Now().Unix(), 0).Format("2006-01-02")
 		areaArr := qutil.ObjToMap(area)
 		buyerclassArr := qutil.ObjArrToStringArr(buyerclass.([]interface{}))
 		monthprice := entity.JyVipSubStruct.GetSubVipPrice(areaArr, buyerclassArr, 1, 2)
@@ -54,6 +57,7 @@ func (this *RenewUpgrade) GetBuyMsg() {
 			"endtime":    endtime,
 			"start":      start,
 			"end":        end,
+			"now":        now,
 			"monthprice": float64(monthprice) / 100,
 			"yearprice":  float64(yearprice) / 100,
 		}
@@ -121,6 +125,8 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 	industry := strings.Split(this.GetString("industry"), ",")
 	date := this.GetString("time")
 	payWay := this.GetString("payWay")
+	effect := this.GetString("effect")
+	pay_source := this.GetString("pay_source")
 	userId := qutil.ObjToString(this.GetSession("userId"))
 	openId := qutil.ObjToString(this.GetSession("s_m_openid"))
 	r := func() *entity.FuncResult {
@@ -132,27 +138,64 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 		if !(payWay == "wx_js" || payWay == "wx_app" || payWay == "ali_app") {
 			return &entity.FuncResult{false, errors.New("未知支付"), nil}
 		}
-		date_count, date_unit, err := checkReqDate(date)
-		if err != nil {
-			return &entity.FuncResult{false, err, nil}
+		var date_count int
+		var date_unit int
+		var pro_count int
+		var pro_unit int
+		var err error
+		if effect != "" {
+			if date != "" {
+				pro_count, pro_unit, err = checkReqDates(date)
+				if err != nil {
+					return &entity.FuncResult{false, err, nil}
+				}
+			}
+		} else {
+			date_count, date_unit, err = checkReqDates(date)
+			if err != nil {
+				return &entity.FuncResult{false, err, nil}
+			}
 		}
+		log.Println("effect", effect)
+		log.Println("pay_source", pay_source)
+		log.Println("pro_count", pro_count)
+		log.Println("pro_unit", pro_unit)
+		log.Println("effect", effect)
 		log.Println(area, industry, date, payWay)
-		//插入订单表
-		mog_id := util.MQFW.Save("subvip_select", map[string]interface{}{
-			"o_area":       area,     //地区(对象)
-			"a_industry":   industry, //行业(数组)
-			"s_userid":     userId,
-			"s_openid":     openId,
-			"i_cyclecount": date_count, //时长
-			"i_cycleunit":  date_unit,  //单位
-			"i_comeintime": now.Unix(),
-		})
+		mog_id := ""
+		if effect != "" {
+			//插入订单表
+			mog_id = util.MQFW.Save("subvip_select", map[string]interface{}{
+				"o_area":       area,     //地区(对象)
+				"a_industry":   industry, //行业(数组)
+				"s_userid":     userId,
+				"s_openid":     openId,
+				"i_comeintime": now.Unix(),
+			})
+		} else {
+			mog_id = util.MQFW.Save("subvip_select", map[string]interface{}{
+				"o_area":       area,     //地区(对象)
+				"a_industry":   industry, //行业(数组)
+				"s_userid":     userId,
+				"s_openid":     openId,
+				"i_cyclecount": date_count, //时长
+				"i_cycleunit":  date_unit,  //单位
+				"i_comeintime": now.Unix(),
+			})
+		}
+
 		if mog_id == "" {
 			return &entity.FuncResult{false, errors.New("创建订单出错"), nil}
 		}
 		//计算价格
-		//totalfee := entity.GetSubVipPrice(area, industry, date_count, date_unit)
-		totalfee := 1
+		var totalfee int
+		if effect != "" {
+			totalfee = qutil.IntAll(this.GetString("price")) * 100
+		} else {
+			totalfee = entity.JyVipSubStruct.GetSubVipPrice(area, industry, date_count, date_unit)
+		}
+		log.Println("price", totalfee)
+
 		//创建订单
 		tradeno, prepayid, payStr := "", "", ""
 
@@ -185,13 +228,28 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 			prepayid = qutil.ObjToString((*ret)["prepayid"])
 			payStr = pay.WxStruct.GetAppWxPayStr(prepayid)
 		}
-		filter := entity.VipSimpleMsg{
-			mog_id,
-			area,
-			industry,
-			date_count,
-			date_unit,
+		var filter interface{}
+		if effect != "" {
+			filter = entity.VipUpgradeMsg{
+				mog_id,
+				area,
+				industry,
+				pay_source,
+				pro_count,
+				pro_unit,
+				effect,
+			}
+		} else {
+			filter = entity.VipSimpleMsg{
+				mog_id,
+				area,
+				industry,
+				date_count,
+				date_unit,
+				pay_source,
+			}
 		}
+
 		filterStr, _ := json.Marshal(filter)
 		ordercode := pay.GetOrderCode(userId)
 		orderid := util.Mysql.Insert("dataexport_order", map[string]interface{}{
@@ -222,3 +280,26 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 	}
 	this.ServeJson(r.Format())
 }
+
+//cycleunit(1:年 2:月)
+//cyclecount 数字长度
+func checkReqDates(dateStr string) (cyclecount, cycleunit int, err error) {
+	if strings.HasSuffix(dateStr, "年") {
+		cycleunit = 1
+		dateStr = strings.Replace(dateStr, "年", "", -1)
+		cyclecount, err = strconv.Atoi(dateStr)
+		if cyclecount > 3 && err == nil {
+			err = errors.New(fmt.Sprintf("日期%s返回超出最大值", dateStr))
+		}
+		return
+	} else if strings.HasSuffix(dateStr, "月") {
+		cycleunit = 2
+		dateStr = strings.Replace(dateStr, "个月", "", -1)
+		cyclecount, err = strconv.Atoi(dateStr)
+		if cyclecount > 12 && err == nil {
+			err = errors.New(fmt.Sprintf("日期%s范围超出最大值", dateStr))
+		}
+		return
+	}
+	return -1, -1, errors.New(fmt.Sprintf("日期%s格式化出错", dateStr))
+}

+ 1 - 0
src/jfw/modules/subscribepay/src/service/vipSubscribePay.go

@@ -104,6 +104,7 @@ func (this *SubVipPayOrder) CreateOrder() {
 			industry,
 			date_count,
 			date_unit,
+			"open",
 		}
 		filterStr, _ := json.Marshal(filter)
 		ordercode := pay.GetOrderCode(userId)

+ 1 - 26
src/web/templates/weixin/historypush.html

@@ -803,32 +803,7 @@
 	     </div>
     </div>
 	<div class="subscribe">
-      <!-- 列表 -->
-      <div class="list" style="display: none;">
-      	<div class="list_item">
-      		<p class="item_title"> 1.普通订阅设置显示列表分类颜色<i style="color: #25C78C;">#25C78C</i>,普通订阅设置显示列表内容颜色<i style="color: #25C78C">#25C78C</i>,普通订阅设置显示列表内容颜色</p>
-      		<p class="item_type">
-      			<span class="area">江苏</span>
-      			<span class="type">招标</span>
-      			<span class="industry">建筑工程</span>
-      			<span class="time">
-      				<i class="icon iconfont">&#xe62a;</i>3小时前
-      			</span>
-      			</p>
-      		</div>
-      		<div class="list_item">
-      			<p class="item_title">2.VIP订阅设置显示列表分类颜色<i style="color: #CFAD89;opacity: 0.72;">#CFAD89</i>,VIP订阅设置显示列表内容颜色<i style="color: #CFAD89">#CFAD89</i>,VIP订阅设置显示列表内容颜色</p>
-      			<p class="item_type">
-	      			<span class="area">江苏</span>
-	      			<span class="type">招标</span>
-	      			<!-- <span class="industry">建筑工程</span> -->
-	      			<span class="v_industry">出版广电</span>
-	      			<span class="time">
-	      				<i class="icon iconfont">&#xe62a;</i>2019-08-25
-	      			</span>
-      			</p>
-      		</div>
-      	</div>
+      	<!-- 列表 -->
       	<div class="listcontent">
 			<div id="list"></div>
 		</div>

+ 6 - 2
src/web/templates/weixin/vipsubscribe/keyWord.html

@@ -232,9 +232,11 @@
         weui.loading();
         setTimeout(function(){
             weui.loading().hide();
-            if(history.state){
+            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 = "";//分类名称
@@ -493,6 +495,7 @@
         }
         //跳转附加词
         function toappendkey(th){
+			history.replaceState("","","/front/vipsubscribe/toSetKeyWordPage?page=1")
             if(!$('.enter.addkeyWord').is(':hidden')){
                 if($('.addkeyWord input.enterOne').val()==""){
                     return
@@ -510,6 +513,7 @@
         }
         //
         function tonotkey(th){
+			history.replaceState("","","/front/vipsubscribe/toSetKeyWordPage?page=1")
             if(!$('.enter.addkeyWord').is(':hidden')){
                 if($('.addkeyWord input.enterOne').val()==""){
                     return

+ 71 - 5
src/web/templates/weixin/vipsubscribe/renew_pay.html

@@ -48,7 +48,7 @@
                             </p>
                             <p>
                                 <!-- 正常点击vip首页续费进入显示去升级,即将到期点击vip首页续费显示订阅修改 -->
-                                <a href="/front/vipsubscribe/toUpgradePage" class="go_update renew_upgrade">去升级</a>
+                                <a href="/weixin/pay/toUpgradePage" class="go_update renew_upgrade">去升级</a>
                                 <a href="/front/vipsubscribe/toEditSubPage" class="go_update renew_update">订阅修改</a>
                             </p>
                         </div>
@@ -199,6 +199,7 @@
     <script src="/vipsubscribe/js/common.js"></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>
+    {{include "/common/weixin.html"}}
     <script type="text/javascript">
     	try{
 			var signature = {{.T.signature}};
@@ -238,7 +239,6 @@
   				function(r){
 				    if(r.err_msg == "get_brand_wcpay_request:ok"){
 						setTimeout(function(){
-							
 							window.location.replace("/front/vipsubscribe/toPaySuccessPage?orderCode="+ordercode);
 						},500)
 					}else if(r.err_msg == "get_brand_wcpay_request:cancel"){               
@@ -261,6 +261,15 @@
 		}
     </script>
     <script>
+    	// 当续费时间 + 当前已经买的时间超过36个月,给出提醒
+//      var overtimeWarning = `最长订阅周期不可超过3年<br />当前订阅周期:16个月`
+//      weui.toast(overtimeWarning, {
+//          duration: 3000,
+//          className: 'custom-toast',
+//          callback: function() {
+//              console.log('close') 
+//          }
+//      })
         // 隐藏dialog选择框
         function hideDialog() {
             $('#pay_way').hide(200);
@@ -339,6 +348,9 @@
                     .numboxStep;
             }
             $number.text(currentNum)
+            if(currentNum >= 10){
+            	currentNum = 10;
+            }
             var price = (monthPrice * currentNum).toFixed(1);
             $('.computed_price').html('¥' + price)
             var firstButton = $('#number_box_month button:first')
@@ -382,6 +394,7 @@
             let val = $('.month_number').text();
             if (val >= 10) {
                 $('.profit_tips').show()
+                val = 10;
             }
 //          console.log(val)
             if (!isChecked) {
@@ -449,6 +462,7 @@
 	    var ends = "";
 	    var monthPrice = "";
 	    var yearPrice = "";
+	    //
 	    $DoPost("/subscribepay/renewUpgrade/getBuyMsg", {}, function (data) {
             if (data) {
                 area = data.area;
@@ -527,6 +541,50 @@
 			 	var cityLen = cityArr.length;
 		    }
         }, false);
+        //
+        var nowDate = new Date().toLocaleDateString();
+		nowDate = nowDate.split("/");
+		var nowMonth = Number(nowDate[1]);
+		var nowYear = Number(nowDate[0]);
+		var nowDay = Number(nowDate[2]);
+		//
+		var endDate = new Date(endTime).toLocaleDateString();
+		endDate = endDate.split("/");
+		var endMonth = Number(endDate[1]);
+		var endYear = Number(endDate[0]);
+		var endDay = Number(endDate[2]);
+		var nowUpgrade = 0;
+		if(endYear === nowYear){
+			if(endMonth === nowMonth){
+				nowUpgrade = 1;
+			}else{
+				if(endDay > nowDay){
+					nowUpgrade = endMonth - nowMonth +1;
+				}else{
+					nowUpgrade = endMonth - nowMonth;
+				}
+			}
+		}else{
+			if(endMonth === nowMonth){
+				if(endDay <= nowDay){
+					nowUpgrade = (endYear - nowYear) * 12;
+				}else{
+					nowUpgrade = (endYear - nowYear) * 12 +1;
+				}
+			}else if(endMonth > nowMonth){
+				if(endDay <= nowDay){
+					nowUpgrade = (endYear - nowYear) * 12 + (endMonth - nowMonth);
+				}else{
+					nowUpgrade = (endYear - nowYear) * 12 + (endMonth - nowMonth)+1;
+				}
+			}else{
+				if(endDay <= nowDay){
+					nowUpgrade = (endYear - nowYear-1) * 12 + (12-nowMonth+endMonth);
+				}else{
+					nowUpgrade = (endYear - nowYear-1) * 12 + (12-nowMonth+endMonth)+1;
+				}
+			}
+		}
 	    //
 	    if(sessionStorage.renew_cyclecount!==""&&sessionStorage.renew_cycleunit!==""){
 	 		var cycleunit = sessionStorage.renew_cycleunit;
@@ -558,15 +616,23 @@
 	    	$(".finally_price").html(sessionStorage.renew_finally_price);
 	    	$(".save_renew").removeAttr("disabled");
 	    }
-	    
 	    //
 	    $(".save_renew").on("click", function(){
 	    	var param = {
-	    		"area": area,
+	    		"area": JSON.stringify(area),
 	    		"industry": buyerclass.toString(),
 	    		"time": $('.choose_item.select_cycle .info').attr('placeholder'),
-	    		"payWay":"wx_js"
+	    		"payWay":"wx_js",
+	    		"pay_source": "Renew",
 	    	}
+	    	console.log(param)
+	    	$DoPost("/subscribepay/renewUpgrade/renewUpgradeCreateOrder",param,function(r){
+                if(r.success){
+//                  clearSessionStorage();
+                    onBridgeReady(JSON.parse(r.data.res),r.data.code);
+                }
+                $("#payHandle").removeAttr("disabled")  
+            })
 	    });
 	    
     </script>

+ 3 - 3
src/web/templates/weixin/vipsubscribe/vip_index.html

@@ -119,13 +119,13 @@
                 <div>
                     <i class="icon iconfont" id="close_renew">&#xe61a;</i>
                     <span>VIP订阅服务还有 <span class="renew_day"></span> 天到期,请及时续费!</span>
-                    <a href="/front/vipsubscribe/renewPayPage">去续费</a>
+                    <a href="/weixin/pay/renewPayPage">去续费</a>
                 </div>
             </div>
             <!-- 升级 续费 -->
             <div class="tabbar">
-                <a href="/front/vipsubscribe/toUpgradePage" class="update_btn">升级</a>
-                <a href="/front/vipsubscribe/renewPayPage" class="renew_btn">续费</a>
+                <a href="/weixin/pay/toUpgradePage" class="update_btn">升级</a>
+                <a href="/weixin/pay/renewPayPage" class="renew_btn">续费</a>
             </div>
         </div>
         <!-- 自动续费关闭提醒 -->

+ 69 - 4
src/web/templates/weixin/vipsubscribe/vip_upgrade.html

@@ -235,7 +235,7 @@
                         <label class="weui-cell weui-check__label now_label" for="nowTime">
                             <div class="weui-cell__bd read">
                                 <p class="effective_name now">立即生效,需支付当月费用差价</p>
-                                <p class="effective_time">2019.08.23 - 2020.06.06</p>
+                                <p class="effective_time nownow">2019.08.23 - 2020.06.06</p>
                             </div>
                             <div class="weui-cell__hd">
                                 <input type="radio" class="weui-check" name="date" value="立即生效,需支付当月费用差价" id="nowTime" checked />
@@ -245,7 +245,7 @@
                         <label class="weui-cell weui-check__label next_label" for="nextMonth">
                             <div class="weui-cell__bd read">
                                 <p class="effective_name notnow"></p>
-                                <p class="effective_time">2019.09.01 - 2020.06.06</p>
+                                <p class="effective_time notnownow">2019.09.01 - 2020.06.06</p>
                             </div>
                             <div class="weui-cell__hd">
                                 <input type="radio" class="weui-check" name="date" value="" id="nextMonth" />
@@ -294,6 +294,7 @@
     <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>
+    {{include "/common/weixin.html"}}
     <script type="text/javascript">
     	try{
 			var signature = {{.T.signature}};
@@ -332,6 +333,7 @@
   				},
   				function(r){
 				    if(r.err_msg == "get_brand_wcpay_request:ok"){
+				    	//
 						setTimeout(function(){
 							window.location.replace("/front/vipsubscribe/toPaySuccessPage?orderCode="+ordercode);
 						},500)
@@ -393,6 +395,9 @@
         })
         //
 		var effectiveName = new Date().getMonth()+2;
+		if(effectiveName > 12){
+	    	effectiveName = effectiveName - 12
+	   	}
 		var effectiveNames = effectiveName+"月1日生效"
 		$(".effective_name.notnow").text(effectiveNames);
 		$('#nextMonth').val(effectiveNames);
@@ -403,6 +408,9 @@
             $('#effective_date').hide(200);
             var effective = "";
             var effectiveName = new Date().getMonth()+2;
+            if(effectiveName > 12){
+	    		effectiveName = effectiveName - 12
+	    	}
             var effectiveNames = effectiveName+"月1日生效"
             if(checkValue === "立即生效,需支付当月费用差价"){
             	effective = "now";
@@ -584,6 +592,9 @@
             $('#time_cycle').hide(function () { 
                 $('.choose_item.lengthen .info').text(val)
             })
+            var proPrice = $(".computed_price").html().replace("¥","")
+            sessionStorage.proPrice = proPrice;
+            window.location.reload();
         })
         //新增区域
 	    if(sessionStorage.vipSubSelectArea!==""&&sessionStorage.vipSubSelectArea!==undefined){
@@ -645,6 +656,9 @@
 	    		effectiveHtml = "立即生效,需支付当月费用差价";
 	    	}else if(effective === "notnow"){
 	    		var effectiveName = new Date().getMonth()+2;
+	    		if(effectiveName > 12){
+	    			effectiveName = effectiveName - 12
+	    		}
 	    		effectiveHtml = effectiveName+"月1日生效";
 	    	}
 	    	$(".effective_name").each(function(){
@@ -770,6 +784,12 @@
 		//	    	$(".item_industry .label_for").text(buyerclassHtml);
 					$('#buyerclass').val(buyerclassHtml);
 			    }
+			    //
+			    var nowDate = data.now.replace(/-/g, ".");
+			    var a = nowDate+ " - " +endTime
+			    console.log(a)
+			    $(".nownow").text(nowDate+ " - " +endTime)
+			    
 			}
         },false);
         //
@@ -777,9 +797,9 @@
         var completeYear = 0;
         var oldYearPrice = 0;
         var oldMonthPrice = 0;
+        var areasArr = {};
+	    var industrysArr = [];
         function FinallyPrice(){
-        	var areasArr = {};
-	    	var industrysArr = [];
 	    	var nowUpgrade = "";
 			//
 			var nowDate = new Date().toLocaleDateString();
@@ -957,10 +977,55 @@
 			console.log("oldPrice", oldPrice);
 			var cPrice = (price - oldPrice).toFixed(1);
 			console.log(cPrice);
+			if(sessionStorage.proPrice!==""&&sessionStorage.proPrice!==undefined){
+				let proPrice = sessionStorage.proPrice;
+				console.log("proprice",proPrice);
+				cPrice = (Number(cPrice) + Number(proPrice)).toFixed(1);
+			}
 			$(".finally_price").html("¥"+cPrice);
 			$(".save_upgrade").removeAttr('disabled');
         }
         FinallyPrice();
+        
+        //
+        $(".save_upgrade").on("click", function(){
+        	let effective = $("#effect_date_name").text();
+        	var effect = "now";
+        	if(effective !== "立即生效,需支付当月费用差价"){
+        		effect = "notnow";
+        	}
+        	let areas = areasArr;
+        	let industrys = industrysArr;
+        	if(areas["全国"]){
+                areas={};
+            }
+            if(industrys.length==1&&industrys[0]=="全部行业"){
+                industrys=[];
+            }
+            let renew_time = $('.choose_item.lengthen .info').text();
+            let times = "";
+            if(renew_time !== "不延长"){
+            	times = $('.choose_item.lengthen .info').text();
+            }
+            let price = $(".finally_price").html().replace("¥","");
+	    	var param = {
+	    		"area": JSON.stringify(areas),
+	    		"industry": industrys.join(","),
+	    		"payWay": "wx_js",
+	    		"effect": effect,
+	    		"pay_source" : "Upgrade",
+	    		"time": times,
+	    		"price": Number(price),
+	    	}
+	    	console.log(param)
+	    	$DoPost("/subscribepay/renewUpgrade/renewUpgradeCreateOrder",param,function(r){
+                if(r.success){
+//                  clearSessionStorage();
+                    onBridgeReady(JSON.parse(r.data.res),r.data.code);
+                }
+                $("#payHandle").removeAttr("disabled");
+            })
+	    });
     </script>
 </body>
 

+ 113 - 1
src/web/templates/weixin/wxkeyset/index.html

@@ -9,6 +9,84 @@
 <script src="{{Msg "seo" "cdn"}}/js/jquery.js"></script>
 <script src="{{Msg "seo" "cdn"}}/wxswordfish/share.js?v={{Msg "seo" "version"}}"></script>
 <script src="{{Msg "seo" "cdn"}}/js/common.js?v={{Msg "seo" "version"}}"></script>
+<!-- 2.8.5 -->
+<link rel="stylesheet" href="/vipsubscribe/iconfont/iconfont.css" />
+<script src="/vipsubscribe/js/rem.js"></script>
+<style>
+._header {
+    position: fixed;
+    top: 0;
+    width: 100%;
+    z-index: 999;
+}
+.vip_banner .box {
+    width: 100%;
+    height: .94rem;
+    padding: 0 .3rem;
+    box-sizing: border-box;
+    background: url(../image/curve.png) no-repeat center center #34355A;
+    background-size: 100% 100%;
+	    display: flex;
+    align-items: center;
+    justify-content: space-between;
+}
+.vip_banner .box .left{
+	display: flex;
+    align-items: center;
+}
+.vip_banner .box .right {
+    color: #CFAD89;
+    font-size: .26rem;
+    float: right;
+}
+.vip_banner .box .left img {
+    width: .56rem;
+    height: .56rem;
+    margin-right: .24rem;
+}
+.vip_banner .box .left h4 {
+    font-size: .32rem;
+    color: #FFDAB1;
+}
+.msg_alert {
+    position: fixed;
+    left: 0;
+    bottom: 0;
+    width: 100%;
+    height: auto;
+}
+.open_remind .remind_box {
+    padding: .2rem .3rem;
+    background-color: #2CB7CA;
+    color: #fff;
+    font-size: .26rem;
+	    display: flex;
+    align-items: center;
+    justify-content: space-between;
+}
+.open_remind .remind_box .remind_text {
+    flex: 1;
+}
+.open_remind .remind_box .remind_btn {
+    display: inline-block;
+    margin-left: .26rem;
+    width: 1.5rem;
+    height: .64rem;
+    line-height: .64rem;
+    color: #fff;
+    border: 1px solid #fff;
+    border-radius: .32rem;
+    text-align: center;
+	    text-decoration: none;
+}
+.open_remind > div i {
+    font-size: .32rem;
+	margin-right: .2rem;
+}
+._margin_b{
+	margin-bottom: 1rem;
+}
+</style>
 <script>
 initShare({{.T.signature}},{{.T.openid}},2,"jy_extend",{{.T.nickname}},{{.T.avatar}});
 var isIOS = !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
@@ -24,6 +102,11 @@ var surpriseflag = {{.T.s_surprise}}
 var myArray=new Array()
 var suphtml = "";//'<span id="sp1"></span><span id="sp2"></span><div id="surprise"><img src="/images/wxkeyset/spg.gif"/>点此有惊喜!</div>';
 $(function(){
+	// 关闭设置弹窗
+	$('#close_set').on('click',() =>{
+		$('.msg_alert').hide();
+		$(".keyWordContent").removeClass("_margin_b");
+	})
 	if(sessionStorage){
 		if(sessionStorage.keysetindexToHistory=="2"){
 			sessionStorage.keysetindexToHistory="3"
@@ -111,6 +194,7 @@ $(function(){
 	}).on('compositionend', function(){
 	    $(this).prop('comStart', false);
 	}).blur(function(){
+		$(".vip_banner").show();
 		isfocusing = false;
 		var thisClass = $(this);
 		$(".keyword").attr("readonly",false);
@@ -138,6 +222,7 @@ $(function(){
 			}
 		},300);
 	}).focus(function(){
+		$(".vip_banner").hide();
 		$(".header,.keyWordContent").addClass("absolute");
 		if(focusinputindex != $(this).parents(".keyWordGroup").index()){
 			istiped = false;
@@ -592,6 +677,13 @@ function saveSeniorset(r){
 		
 	});
 }
+//
+function tointroducepage(){
+	setSessionStorage();
+	window.location.href = "/front/vipsubscribe/introducePage";
+}
+
+
 </script>
 </head>
 <body class="keysetpage">
@@ -601,7 +693,16 @@ function saveSeniorset(r){
 		<span class="complate hide">完成</span>
 		<span class="seniorset" style="float: right;font-size: 15px;color: #686868;"><img src="{{Msg "seo" "cdn"}}/images/wxkeyset/set.png" style="width: 17px;margin-right: 4px;margin-top: -3px;">推送设置</span>
 	</div>
-	<div class="keyWordContent">
+	<div class="vip_banner" style="">
+		<div class="box">
+			<div class="left">
+				<img src="/vipsubscribe/image/v.png" alt="v">
+				<h4>剑鱼标讯 VIP订阅</h4>
+			</div>
+			<a onclick="tointroducepage()" class="right">了解详情 &gt; </a>
+		</div>
+	</div>
+	<div class="keyWordContent _margin_b">
 		<div class="keyWordGroup">
 			<lable>1</lable>
 			<div class="keyWordDiv">
@@ -737,6 +838,17 @@ function saveSeniorset(r){
 		<span>您订阅的关键词字数过多,可能会收不到推送信息。查看<a href="http://mp.weixin.qq.com/s/uXTI0Qmva2ZX1adLxxXD9Q">订阅帮助页面</a></span>
 		<span>您订阅的关键词包含特殊符号,可能会收不到推送信息。查看<a href="http://mp.weixin.qq.com/s/2u1rBaTZ7T_o8k7TbuM_fw">订阅帮助页面</a></span>
 	</div>
+	<div  class="msg_alert">
+		<div class="open_remind">
+            <div class="remind_box">
+				<i class="icon iconfont" id="close_set"></i>
+                <div class="remind_text">
+                    10个关键词不够用?<br>开通VIP订阅,支持最多300个关键词
+                </div>
+                <a onclick="tointroducepage()" class="remind_btn">了解详情</a>
+            </div>
+        </div>
+	</div>
 	{{include "/common/baiducc.html"}}
 </body>
 </html>