wangkaiyue 5 éve
szülő
commit
80a55eda6f

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 13 - 8
src/web/staticres/vipsubscribe/css/choose_area.css


+ 5 - 5
src/web/staticres/vipsubscribe/js/UpgradePrice.js

@@ -197,10 +197,6 @@ function needUpgrade(newBuyset, oldBuyset) {
 //-1 不用升级 -2 不能升级
 function getUpgradeFinalStatus(newBuyset, oldBuyset, t, endUnix, renewList, isTrail) {
     var Upgradestatus = needUpgrade(newBuyset, oldBuyset);
-    if (isTrail) {
-        var trailPay = getsubVipOrderPriceBybuyset(newBuyset, t);//试用用户购买
-        return [trailPay, Upgradestatus[1], Upgradestatus[2], []]
-    }
     var Upgrade = Upgradestatus[0];
     console.log("Upgrade", Upgrade, Upgradestatus);
     if (Upgrade === -1) {
@@ -210,6 +206,10 @@ function getUpgradeFinalStatus(newBuyset, oldBuyset, t, endUnix, renewList, isTr
         var renewPrice = getsubVipOrderPriceBybuyset(oldBuyset, t);//续费
         return [renewPrice, false, false, []]
     }
+    if (isTrail) {
+        var trailPay = getsubVipOrderPriceBybuyset(newBuyset, t);//试用用户购买
+        return [trailPay, Upgradestatus[1], Upgradestatus[2], []]
+    }
     var final_price = 0;
     var nowEndTime = endUnix;
 
@@ -250,7 +250,7 @@ function getUpgradeFinalStatus(newBuyset, oldBuyset, t, endUnix, renewList, isTr
     //清单数组
     subtotail.push({
         "buyset": oldBuyset,
-        "startTime": endUnix,
+        "startTime": new Date().getTime()/1000,
         "endTime": nowEndTime,
         "price": now_price,
         "type": 0

+ 58 - 45
src/web/staticres/vipsubscribe/js/change_area.js

@@ -123,7 +123,7 @@ $(function () {
                         pCount: 0
                     }
                 }
-                return setDataInResult(selectedCount);
+                return setDataInResult('.result-selected .result-info .info-overview', getBuySet(selected, []));
             }
 
             if (selected[p].length === 0) {
@@ -135,28 +135,42 @@ $(function () {
                 })
             }
         }
-        setDataInResult(selectedCount);
+        if ($.isEmptyObject(selected)) {
+        //    1. 隐藏提示,并清空已选择
+            $('.result .info-tip').hide().siblings('.info-overview').text('');
+        } else {
+            setDataInResult('.result-selected .result-info .info-overview', getBuySet(selected, []));
+        }
     }
 
-    function setDataInResult(selected) {
-        // 已选择数量数据渲染
-        if (selected.country === -1) {
-            $('.result-selected .result-info .info-overview').text('全国')
-            return
+    // 参数1:selector 需要赋值的选择器
+    // 参数2:selectedData 数据
+    // 注意:selectedData的数据结构
+    function setDataInResult (selector ,selectedData) {
+        // selectedData = {
+        //     areacount: 2,
+        //     buyerclasscount: 2,
+        //     newcitys: []
+        // }
+        // 设置已选择区域
+        var citySum = arrSum(selectedData.citys);
+        var text = {
+            p: selectedData.areacount === 0 ? '' : selectedData.areacount + '个省',
+            c: citySum === 0 ? '' : citySum + '个市',
+            s: selectedData.citys.length === 1 ? '' : '(分布在' + selectedData.citys.length + '个省内)'
+        };
+
+        if (selectedData.areacount === -1) {
+            $(selector).text('全国')
         } else {
-            // 已选择数量
-            var count = {
-                p: selected.province + '个省',
-                c: selected.city.totalCount + '个市',
-                s: '分布在' + selected.city.pCount + '个省内'
+            var dunhao = '';
+            if (citySum !== 0 && selectedData.areacount !== 0) {
+                dunhao = '、'
             }
-            if (selected.province === 0) {
-                $('.result-selected .result-info .info-overview').text(count.c + '(' + count.s + ')')
-            } else if (selected.city.totalCount === 0) {
-                $('.result-selected .result-info .info-overview').text(count.p)
-            } else {
-                $('.result-selected .result-info .info-overview').text(count.p + '、' + count.c + '(' + count.s + ')')
+            if (citySum === 0 || citySum === 1) {
+                text.s = ''
             }
+            $(selector).text(text.p + dunhao + text.c + text.s);
         }
     }
 
@@ -229,7 +243,13 @@ $(function () {
 
     // 初始选择的城市恢复,根据传入的p恢复为Active蓝色按钮
     // 需要放到init之后
-    function renderSelectedCityActive(p = {}) {
+    function renderSelectedCityActive(p) {
+
+        if (Object.keys(p).length === 0) {
+            $('.area-list li:not(.index):eq(0)').find('input').trigger('click')
+            return
+        }
+
         for (const k in p) {
             if (k === '全国') {
                 $('.area-list li:not(.index):eq(0)').find('input').trigger('click')
@@ -271,37 +291,28 @@ $(function () {
 
     // 根据数据进行求总数 --- 上方已购买数据信息的初始化
     function initAlreadyBuy(buyset, citys) {
+        // 购买的全省的数量(不包含市)
+        alreadyBuy.province = buyset.areacount;
+        // 购买的城市总数量
+        alreadyBuy.city.pCount = citys.length
+        alreadyBuy.city.totalCount = arrSum(citys)
+
+        var text = {
+            p: alreadyBuy.province === 0 ? '' : alreadyBuy.province + '个省',
+            c: alreadyBuy.city.totalCount === 0 ? '' : alreadyBuy.city.totalCount + '个市',
+            s: alreadyBuy.city.pCount === 1 ? '' : '(分布在' + alreadyBuy.city.pCount + '个省内)'
+        }
         if (buyset.areacount === -1) {
             $('.result-purchased .result-info .buy-set-info').text('全国')
-            alreadyBuy = {
-                country: -1,
-                province: 0,
-                city: {
-                    totalCount: 0,
-                    pCount: 0
-                }
-            }
-            return
         } else {
-            // 购买的全省的数量(不包含市)
-            alreadyBuy.province = buyset.areacount;
-            // 购买的城市总数量
-            alreadyBuy.city.pCount = citys.length
-            alreadyBuy.city.totalCount = arrSum(citys)
-
-            var buySetInfo = {
-                p: alreadyBuy.province + '个省',
-                c: alreadyBuy.city.totalCount + '个市',
-                s: '分布在' + alreadyBuy.city.pCount + '个省内'
+            var dunhao = '';
+            if (alreadyBuy.city.totalCount !== 0 && alreadyBuy.province !== 0) {
+                dunhao = '、'
             }
-
-            if (alreadyBuy.province === 0) {
-                $('.result-purchased .result-info .buy-set-info').text(buySetInfo.c + '(' + buySetInfo.s + ')')
-            } else if (alreadyBuy.city.totalCount === 0) {
-                $('.result-purchased .result-info .buy-set-info').text(buySetInfo.p)
-            } else {
-                $('.result-purchased .result-info .buy-set-info').text(buySetInfo.p + '、' + buySetInfo.c + '(' + buySetInfo.s + ')')
+            if (alreadyBuy.city.totalCount === 0 || alreadyBuy.city.totalCount === 1) {
+                text.s = ''
             }
+            $('.result-purchased .result-info .buy-set-info').text(text.p + dunhao + text.c + text.s);
         }
     }
 
@@ -421,6 +432,8 @@ $(function () {
         $DoPost('/subscribepay/vipsubscribe/getSubBuyMsg', {}, function (res) {
             if (!res.success) return
             areaData.data = res.data
+            res.data.oldArea = res.data.area;
+            res.data.oldIndustry = res.data.industry;
             sessionStorage.setItem('sub_vip_state', JSON.stringify(res.data))
             init()
         })

+ 11 - 5
src/web/staticres/vipsubscribe/js/change_industry.js

@@ -80,12 +80,16 @@ function resultCount() {
                 canChangeArr.push($(this).text())
             }
         })
-        if (count > buyCount) {
+        if (count > buyCount && buyCount != -1) {
             $('.update_tips').show();
         } else {
             $('.update_tips').hide();
         }
-        $('.result_count').html(count + '个行业');
+        if(count>0){
+            $('.result_count').html(count + '个行业');
+        }else {
+            $('.result_count').html("");
+        }
 
         if ($('.list').find('.industry_item.active:not(.whole)').length === 0) {
             $('.save-btn').prop('disabled', true)
@@ -141,9 +145,11 @@ $(function () {
 
     function getDataWitXHR() {
         $DoPost('/subscribepay/vipsubscribe/getSubBuyMsg', {}, function (res) {
-            if (!res.success) return
-            data.data = res.data
-            sessionStorage.setItem('sub_vip_state', JSON.stringify(res.data))
+            if (!res.success) return;
+            data.data = res.data;
+            res.data.oldArea = res.data.area;
+            res.data.oldIndustry = res.data.industry;
+            sessionStorage.setItem('sub_vip_state', JSON.stringify(res.data));
             initData();
         })
     }

+ 80 - 30
src/web/staticres/vipsubscribe/js/vip_index_new.js

@@ -29,13 +29,19 @@ $(function () {
             if (list[i].buyset.areacount === -1) {
                 showArea = "全国"
             } else {
-                showArea = list[i].buyset.areacount + "个省";
+                if (list[i].buyset.areacount > 0) {
+                    showArea = list[i].buyset.areacount + "个省";
+                }
                 if (list[i].buyset.citys.length > 0) {
                     var cityCount = 0;
                     for (var j = 0; j < list[i].buyset.citys.length; j++) {
                         cityCount += list[i].buyset.citys[j];
                     }
-                    showArea += "、" + 3 + "个市(分布在" + list[i].buyset.citys.length + "个省内)";
+                    if (list[i].buyset.areacount > 0) showArea += "、";
+                    showArea += cityCount + "个市";
+                    if (showArea > 1) {
+                        showArea += "(分布在" + list[i].buyset.citys.length + "个省内)"
+                    }
                 }
             }
             var industryShow = "";
@@ -91,6 +97,11 @@ $(function () {
 
     // 设置已选择的区域和行业
     function setSelectedAreaAndInd(selected) {
+        // buySet = {
+        //     areacount: 2,
+        //     buyerclasscount: 2,
+        //     newcitys: []
+        // }
         // 设置已选择区域
         var citySum = arrSum(selected.citys);
         var text = {
@@ -156,15 +167,14 @@ $(function () {
 
     function showTimeOut(endTime, isTrail) {
         var timeSub = endTime * 1000 - new Date().getTime();
-        console.log("timeSub", timeSub);
         if (timeSub > 0 && timeSub < 60 * 60 * 24 * 1000 * 3) {
             var hours = Math.floor(timeSub / (60 * 60 * 1000));
             var day = Math.floor(hours / 24);
             if (day > 0) {
                 if (!isTrail) {
-                    $(".vip-header .expire-remind .remind-text").text("VIP订阅服务还有" + (day) + "天到期,请及时续费!");
+                    $(".vip-header .expire-remind .remind-text").text("VIP订阅服务还有" + (day + 1) + "天到期,请及时续费!");
                 } else {
-                    $(".vip-header .expire-remind .remind-text").text("VIP订阅服务还有" + (day) + "天到期,请及时购买!");
+                    $(".vip-header .expire-remind .remind-text").text("VIP订阅服务还有" + (day + 1) + "天到期,请及时购买!");
                 }
             } else {
                 if (!isTrail) {
@@ -177,10 +187,6 @@ $(function () {
         }
     }
 
-    function clearSession() {
-        sessionStorage.removeItem("vip_index_read");
-        sessionStorage.removeItem('sub_vip_state');
-    }
 
     function arrSum(arr) {
         var sum = 0
@@ -244,7 +250,6 @@ $(function () {
         sessionStorage.setItem("vip_index_read", state ? "1" : "0");
     });
 
-
     // switch点击切换
     $('.switch').on('click', function (e) {
         var $this = $(this);
@@ -266,15 +271,53 @@ $(function () {
         }
     })
 
-    //保存取消提示 module 1 修改 2升级
+    //返回提示使用
+    function pushHistory() {
+        var state = {
+            title: "title",
+            url: "#"
+        };
+        window.history.pushState(state, "title", "#");
+    }
+
+
+    function initBack(module) {
+        pushHistory();
+        //weui.toast(module);
+        $('.vip-footer .button-l.reset').off("click").on("click", function () {
+            cancelTip(module);
+        });
+        window.addEventListener("popstate", function (e) {
+            cancelTip(module);
+            pushHistory();
+        }, false);
+    }
+
+    //保存取消提示 module 1 修改 2升级 3续费 4购买
     function cancelTip(module) {
+        var content = "";
+        var labName = "";
+        if (module === 1) {
+            content = "所选订阅设置已做修改,返回后修改的设置将不做保存。";
+            labName = "保存修改";
+        } else if (module === 2) {
+            content = "所选订阅设置已超出购买范围,升级后方才生效,返回后修改的设置将不做保存。";
+            labName = "立即升级"
+        } else if (module === 3) {
+            content = "所选订阅设置已超出购买范围,续费后方才生效,返回后修改的设置将不做保存。";
+            labName = "立即续费"
+        } else {
+            content = "所选订阅设置已超出购买范围,购买后方才生效,返回后修改的设置将不做保存。";
+            labName = "立即购买"
+        }
+
         weui.dialog({
             title: '提示信息',
-            content: module == 1 ? '所选订阅设置已做修改,返回后修改的设置将不做保存。' : '所选订阅设置已超出购买范围,升级后方才生效,返回后修改的设置将不做保存。',
+            content: content,
             className: 'jy-dialog',
             buttons: [
                 {
-                    label: module == 1 ? '保存修改' : '立即升级',
+                    label: labName,
                     type: 'primary',
                     onClick: function () {
                         doSubmit();
@@ -284,8 +327,8 @@ $(function () {
                     label: '取消',
                     type: 'default',
                     onClick: function () {
-                        clearSession()
-                        window.history.go(-1);
+                        clearSessionStorage();
+                        window.history.go(-2);
                     }
                 }
             ]
@@ -479,9 +522,11 @@ $(function () {
         }
         if (change) {
             var afterEndTime;
-            if (state.isTrial) $(".body-item.cycle .tip").text(change);
-
-            $(".body-item.cycle .tip").show();
+            if (state.isTrial) {
+                $(".body-item.cycle .tip").text(change).show();
+            } else {
+                $(".body-item.cycle .tip").text("延长订阅周期" + change).show();
+            }
             if (change.indexOf("月") > -1) {
                 var monthNum = parseInt(change.replace("个月", ""));
                 afterEndTime = getVipEndDate(2, monthNum, endflag);
@@ -555,7 +600,7 @@ $(function () {
         var tmp1 = getAreaClassArr(reqData.oldArea);
         var tmp2 = getAreaClassArr(reqData.area);
         var areaNoChange = (JSON.stringify(tmp1[0].sort()) === JSON.stringify(tmp2[0].sort())) && (JSON.stringify(tmp1[1].sort()) === JSON.stringify(tmp2[1].sort()));
-        if (IndustryNoChange && areaNoChange && changeTime.length == 0) {
+        if (IndustryNoChange && areaNoChange && changeTime.length === 0) {
             return
         }
 
@@ -573,16 +618,15 @@ $(function () {
             });
             return
         }
-
         if (status[0] === -1) {
             //直接修改
             $(".vip-footer.modify").show();
-
-            $('.vip-footer .button-l.reset').on("click", function () {
-                cancelTip(1);
-            });
+            initBack(1);
             return
         }
+
+        initBack(2);
+
         //区域需要升级
         if (status[1]) {
             if (reqData.isTrial) {
@@ -604,6 +648,7 @@ $(function () {
             });
             return
         }
+
         if (status[0] > 0) {
             //需要付钱
             $(".vip-footer.upgrade").show();
@@ -613,8 +658,11 @@ $(function () {
         }
 
 
-        if (!status[1] && !status[2]) {
+        if (!status[1] && !status[2]) { //续费
+            console.log("wwwwwwwwwww")
+            initBack(3);
             $(".vip-footer.upgrade .confirm").text("立即续费");
+            $(".jy-dialog .weui-dialog__bd").text("所选订阅设置已超出购买范围,续费后方才生效,返回后修改的设置将不做保存。")
         } else {
             //升级展示计价清单
             if (!reqData.isTrial) {
@@ -626,11 +674,12 @@ $(function () {
             }
         }
 
-        if (reqData.isTrial) $(".vip-footer.upgrade .confirm").text("立即购买");
+        if (reqData.isTrial) {//购买
+            initBack(4);
+            $(".vip-footer.upgrade .confirm").text("立即购买");
+        }
+
 
-        $('.vip-footer .button-l.reset').on("click", function () {
-            cancelTip(2);
-        })
     } else {
         getDataWitXHR()
     }
@@ -662,7 +711,8 @@ $(function () {
                 } else {
                     //订阅修改
                     if (r.data.doSuccess) {
-                        window.history.go(-1);
+                        clearSessionStorage();
+                        window.location.reload();
                     } else {
                         weui.toast('修改保存失败', {
                             duration: 1500,

+ 2 - 2
src/web/templates/weixin/vipsubscribe/change_area.html

@@ -32,13 +32,13 @@
         <div class="result-purchased result-item">
             <span class="result-label">区域</span>
             <span class="result-info">
-                    <p class="buy-set-info ellipsis">9个省、3个市(分布在2个省内)</p>
+                    <p class="buy-set-info ellipsis"></p>
                 </span>
         </div>
         <div class="result-selected result-item">
             <span class="result-label">已选择</span>
             <span class="result-info">
-                    <p class="info-overview ellipsis">9个省、3个市(分布在2个省内)</p>
+                    <p class="info-overview ellipsis"></p>
                     <p class="info-tip ellipsis">已超出现订单购买范围,需升级</p>
                 </span>
         </div>

+ 11 - 0
src/web/templates/weixin/vipsubscribe/change_time.html

@@ -108,6 +108,17 @@
             var dEnd = new Date(end * 1000).pattern('yyyy年MM月dd日');
             var sDuration = dStart + ' - ' + dEnd;
             $('.extend_item .item_bottom span').text(sDuration);
+            //超过三年提示
+            var MaxEnd = getVipEndDate(1, 3, Math.floor(new Date().getTime()/1000));
+            if (end > MaxEnd) {
+                weui.toast('订阅时长超过3年', {
+                    duration: 3000,
+                    className: 'custom-toast',
+                });
+                $("#enter").attr("disabled","disabled");
+            } else {
+                $("#enter").removeAttr("disabled");
+            }
         }
 
         initButton();

+ 10 - 9
src/web/templates/weixin/vipsubscribe/choose_area.html

@@ -459,7 +459,7 @@
                         $(dom).addClass('active').attr('disabled', !canClick).parents().siblings('.tab')
                             .addClass('selected').children('.province').children('.checkbox').attr({
                             "checked": true
-                        }).addClass('half');
+                        }).addClass('opt');
                     }
                 })
             })
@@ -468,7 +468,7 @@
             //如果选中所有,则转为全国
             if ($(".city").length == $(".city.active").length) {
                 $(".checkbox.other").trigger("click");
-                $(".checkbox").removeClass("half");
+                $(".checkbox").removeClass("opt");
                 return
             }
             var tmpSelect = {};
@@ -679,18 +679,18 @@
                     $(".province input").prop('checked', false);
                     $(".city").removeClass('active');
                     $(this).prop('checked', true);
-                    $(".checkbox").removeClass("half");
+                    $(".checkbox").removeClass("opt");
                 } else {
                     $(".checkbox.other").prop('checked', false);
                     if (!$(this).is(':checked')) {
-                        if ($(this).hasClass("half")) {//判断当前是否是半选
-                            $(this).prop("checked", true).removeClass("half");
+                        if ($(this).hasClass("opt")) {//判断当前是否是半选
+                            $(this).prop("checked", true).removeClass("opt");
                             $(this).parent().parent().siblings('.tab_content').children('.city').addClass('active');
                         } else {
                             $(this).parent().parent().siblings('.tab_content').children('.city').removeClass('active');
                             if ($(".province .checkbox:checked").length == 0) {//若没有省份被选中 则选中全国
                                 //$(".checkbox.other").prop('checked', true);
-                                $(".checkbox").removeClass("half");
+                                $(".checkbox").removeClass("opt");
                             }
                         }
                     } else {
@@ -711,13 +711,13 @@
                     window.input = input
                     input.prop('checked', true)
                     if (isActive != $(this).parent().find('.city').length) {//是否全选
-                        $(this).parent('div').siblings('.tab').find('.province .checkbox').addClass('half');
+                        $(this).parent('div').siblings('.tab').find('.province .checkbox').addClass('opt');
                     } else {
-                        $(this).parent('div').siblings('.tab').find('.province .checkbox').removeClass('half');
+                        $(this).parent('div').siblings('.tab').find('.province .checkbox').removeClass('opt');
                     }
                 } else {
                     $(this).parent('div').siblings('.tab').children().children('.checkbox').prop(
-                        'checked', false).removeClass('half');
+                        'checked', false).removeClass('opt');
                 }
                 //AreaChoose.isAllSelected()
                 AreaChoose.getResult($(this).parent('div').siblings('.tab').find('.province').text()) //出入选择的省份
@@ -749,6 +749,7 @@
                 "disabled": false,
                 "checked": false
             })
+            $('input').removeClass('opt')
             AreaChoose.getResult()
         },
         flushPrice: function (flag) {

+ 1 - 1
src/web/templates/weixin/vipsubscribe/choose_industry.html

@@ -2,7 +2,7 @@
 <html>
 <head>
     <meta charset="utf-8">
-    <title>行业选择</title>
+    <title>采购单位行业选择</title>
     <meta name="viewport"
           content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
     <meta name="apple-mobile-web-app-capable" content="yes">

+ 7 - 3
src/web/templates/weixin/vipsubscribe/vip_index_new.html

@@ -14,6 +14,11 @@
     <link rel="stylesheet" type="text/css" href="/vipsubscribe/css/base2.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_index_new.css?v={{Msg "seo" "version"}}">
+    <style>
+        .jy-switch:before {
+            background-color: #fbfbfb;
+        }
+    </style>
 </head>
 
 <body class="no-touch">
@@ -375,7 +380,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={{Msg "seo" "version"}}"></script>
+<script src="/vipsubscribe/js/vip_index_new.js?v=1275{{Msg "seo" "version"}}"></script>
 {{include "/common/weixin.html"}}
 </body>
 <script>
@@ -388,7 +393,7 @@
         var signature = {{.T.signature}};
         var isConfigSuccess = true;
         var id = {{.T._id}}
-        if (signature && signature.length == 4) {
+        if (signature && signature.length === 4) {
             wx.config({
                 debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
                 appId: signature[0], // 必填,公众号的唯一标识
@@ -441,6 +446,5 @@
     } catch (e) {
         console.log(e)
     }
-
 </script>
 </html>

+ 33 - 34
src/web/templates/weixin/vipsubscribe/vip_purchase.html

@@ -34,7 +34,7 @@
                 </li>
                 <li class="choose_item">
                     <a href="/front/vipsubscribe/toChooseIndustry">
-                        <span class="label">行业</span>
+                        <span class="label" style="white-space: nowrap;">采购单位行业</span>
                         {{if not .T.isTrial }}
                             <input type="text" disabled value="" placeholder="1个行业"
                                    class="info choose_industry">
@@ -129,8 +129,12 @@
                         </table>
                         <dl class="tips">
                             <dt>购买须知:</dt>
-                            <dd>套餐周期内,不支持套餐降级,即将到期时续费可降级;</dd>
+                            <dd>套餐周期内,不支持套餐降级,续费可降级;</dd>
+                            <dd>用户最多购买/续费3年套餐;</dd>
                             <dd>支持套餐升级,补差价(按月进行补差价,不足一个月按一个月计算)。</dd>
+
+
+
                         </dl>
                     </div>
                 </div>
@@ -178,7 +182,7 @@
                             1-2年5折,3年4折
                         </div> -->
                     <div class="tips profit_tips" style="display: none">已选择10个月,建议“按年订阅”</div>
-                    <div class="computed_price">¥58.0</div>
+                    <div class="computed_price"></div>
                     <div class="bd_select">
                         <div class="weui-cells weui-cells_checkbox choose-form">
                             <label class="weui-cell weui-check__label monthly_label" for="monthly">
@@ -339,6 +343,7 @@
             industrySelect: ["一个行业"],// 已选择行业 一个行业(计算价格临时变量)
             timeSelect: [1, 2],//已选择时间 timeSelect[0]时长  timeSelect[1] 1:年 2:月
             price: {}, //价格
+            nowBuyset: {},
             vipSubisTrial: false,
             initData: function () {
                 //已选择
@@ -416,34 +421,26 @@
                 } catch (e) {
                     console.log(e)
                 }
+                this.nowBuyset = getBuySet(purchase.areaSelect, purchase.industrySelect,this.price);
             },
             showArea: function () {
-                var cityArr = [];//城市
-                var provinceArr = [];//省份
-                var cityProvinceCount = 0;
-                var data = this.areaSelect;
-                for (var i in data) {
-                    var citys = data[i];
-                    if (citys.length > 0) {
-                        cityArr = cityArr.concat(citys);
-                        cityProvinceCount++;
+                if (!$.isEmptyObject(this.areaSelect)&&!this.areaSelect["一个省"]) { //有选择
+                    if (this.nowBuyset.areacount === -1) {
+                        $(".choose_area").val("全国");
                     } else {
-                        provinceArr.push(i)
-                    }
-                }
-
-                if (!$.isEmptyObject(this.areaSelect) && !this.areaSelect["全国"] && !this.areaSelect["一个省"]) { //选择有行业信息 且不是全国
-                    var tipTxt = "已选择 ";
-                    if (provinceArr.length > 0) tipTxt += provinceArr.length + " 个省";
-                    if (cityArr.length > 0) {
-                        if (provinceArr.length > 0) tipTxt += "、";
-                        tipTxt += cityArr.length + " 个市";
-                        if (cityArr.length > 1) tipTxt += "(分布在" + cityProvinceCount + "个省内)"
+                        var tipTxt = "已选择 ";
+                        if (this.nowBuyset.areacount > 0) tipTxt += this.nowBuyset.areacount + " 个省";
+                        var count = 0;
+                        this.nowBuyset.citys.forEach(function (item, index) {
+                            count += item;
+                        });
+                        if (count > 0) {
+                            if (this.nowBuyset.areacount > 0) tipTxt += "、";
+                            tipTxt += count + " 个市";
+                            if(this.nowBuyset.citys.length>1) tipTxt += "(分布在" + this.nowBuyset.citys.length + "个省内)"
+                        }
+                        $(".choose_area").val(tipTxt);
                     }
-                    $(".choose_area").val(tipTxt);
-                    //$(".add_tips.area").text(tipTxt).css("display", "");
-                } else if (!$.isEmptyObject(this.areaSelect) && this.areaSelect["全国"]) {
-                    $(".choose_area").val("全国");
                 } else {
                     $(".choose_area").val("");
                     //是否勾选已阅读
@@ -468,12 +465,13 @@
                 $('.yearly span:eq(5)').text(purchase.price.year.allProvince_allBuyerClass / 100);
             },
             showIndustry: function () {
-                var data = this.industrySelect;
-                if (this.industrySelect.length > 0 && this.industrySelect[0] != "全部行业" && this.industrySelect[0] != "一个行业") { //选择有行业信息
-                    var tipTxt = "已选择 ";
-                    $(".choose_industry").val(tipTxt + this.industrySelect.length + " 个行业");
-                } else if (this.industrySelect.length > 0 && this.industrySelect[0] == "全部行业") {
-                    $(".choose_industry").val("全部行业");
+                if (this.industrySelect.length > 0 && this.industrySelect[0] != "一个行业") { //选择有行业信息
+                    if(this.nowBuyset.buyerclasscount==-1){
+                        $(".choose_industry").val("全部行业");
+                    }else{
+                        var tipTxt = "已选择 ";
+                        $(".choose_industry").val(tipTxt + this.nowBuyset.buyerclasscount + " 个行业");
+                    }
                 } else {
                     $(".choose_industry").val("");
                     //是否勾选已阅读
@@ -510,7 +508,8 @@
                 if (this.vipSubisTrial) {
                     $('.price strong').text('¥0.00');
                 } else {
-                    var price = getsubVipOrderPrice(this.areaSelect, this.industrySelect, time, this.price);
+                    var price=getsubVipOrderPriceBybuyset(this.nowBuyset,time);
+                    //var price = getsubVipOrderPrice(this.areaSelect, this.industrySelect, time, this.price);
                     var showPrice = formatMoney(price);
                     if (flag === 1) {
                         $('.price strong').text('¥' + showPrice);

+ 52 - 37
src/web/templates/weixin/vipsubscribe/vip_renew.html

@@ -14,10 +14,22 @@
     <link rel="stylesheet" type="text/css" href="/vipsubscribe/css/base2.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_renew.css?v={{Msg "seo" "version"}}">
+    <style>
+        .vip-header {
+            display: none;
+            padding: .26rem .3rem;
+            font-size: .26rem;
+            color: #FE737A;
+        }
+    </style>
 </head>
 
 <body class="no-touch">
 <div class="vip-renew">
+    <div class="vip-header">
+        <span class="header-left">提示:</span>
+        <span class="header-right">您的VIP订阅服务即将到期,为不影响您的使用。请立即续费</span>
+    </div>
     <ul class="vip-body">
         <li class="body-item area">
             <a class="item-container" href="/front/vipsubscribe/toChooseArea">
@@ -26,11 +38,11 @@
                             <span class="item-label">区域</span>
                         </span>
                     <span class="item-r">
-                            <span class="selected-area-name ellipsis">河南省、河南省、河南省、河南省、河南省、河南省、河南省、河南省、河南省</span>
+                            <span class="selected-area-name ellipsis"></span>
                             <span class="iconfont icon-arrow"></span>
                         </span>
                 </div>
-                <div class="sub-item text selected-area">2个省、2个市(分布在2个省内)</div>
+                <div class="sub-item text selected-area"></div>
             </a>
         </li>
         <li class="body-item industry">
@@ -40,11 +52,11 @@
                             <span class="item-label">采购单位行业</span>
                         </span>
                     <span class="item-r">
-                            <span class="selected-industry-name industry-text ellipsis">绿化、财政、出版广电、出版广电、出版广电</span>
+                            <span class="selected-industry-name industry-text ellipsis"></span>
                             <span class="iconfont icon-arrow"></span>
                         </span>
                 </div>
-                <div class="sub-item text selected-industry-count">3个行业</div>
+                <div class="sub-item text selected-industry-count"></div>
             </a>
         </li>
         <li class="body-item select_cycle">
@@ -62,7 +74,7 @@
                     <span class="sub-l">有效日期:</span>
                     <span class="sub-r">
                             <span class="ellipsis">
-                                (<span class="month">3个月</span>)<span class="duration">2019年8月1日-2019年8月7日</span>
+                                (<span class="month">3个月</span>)<span class="duration"></span>
                             </span>
                         </span>
                 </div>
@@ -93,7 +105,7 @@
                 <span class="preview-label"></span>
                 <span class="preview-content">
                         <span class="billing-list-btn"></span>
-                        <span class="billing-price">¥366.50</span>
+                        <span class="billing-price"></span>
                     </span>
             </div>
         </div>
@@ -175,7 +187,7 @@
         </div>
         <div class="box_bd">
             <div class="tips profit_tips">已选择10个月,建议“按年订阅”更换算哦~</div>
-            <div class="computed_price">¥58.0</div>
+            <div class="computed_price"></div>
             <div class="bd_select">
                 <div class="weui-cells weui-cells_checkbox choose-form">
                     <label class="weui-cell weui-check__label monthly_label" for="monthly">
@@ -332,6 +344,7 @@
         timeValue: "一个月",
         endTime: "",
         price: {}, //价格
+        nowBuyset: {},
         payWay: "wx_js",
         initData: function () {
             //已选择
@@ -382,33 +395,26 @@
             } catch (e) {
                 console.log(e)
             }
+            this.nowBuyset = getBuySet(purchase.areaSelect, purchase.industrySelect, this.price);
         },
         showArea: function () {
-            var cityArr = [];//城市
-            var provinceArr = [];//省份
-            var cityProvinceCount = 0;
-            var data = this.areaSelect;
-            for (var i in data) {
-                var citys = data[i];
-                if (citys.length > 0) {
-                    cityArr = cityArr.concat(citys);
-                    cityProvinceCount++;
+            if (!$.isEmptyObject(this.areaSelect) && !this.areaSelect["一个省"]) { //有选择
+                if (this.nowBuyset.areacount === -1) {
+                    $(".selected-area").text("全国");
                 } else {
-                    provinceArr.push(i)
-                }
-            }
-
-            if (!$.isEmptyObject(this.areaSelect) && !this.areaSelect["全国"] && !this.areaSelect["一个省"]) { //选择有行业信息 且不是全国
-                var tipTxt = "";
-                if (provinceArr.length > 0) tipTxt += provinceArr.length + " 个省";
-                if (cityArr.length > 0) {
-                    if (provinceArr.length > 0) tipTxt += "、";
-                    tipTxt += cityArr.length + " 个市(分布在" + cityProvinceCount + "个省内)";
+                    var tipTxt = "";
+                    if (this.nowBuyset.areacount > 0) tipTxt += this.nowBuyset.areacount + " 个省";
+                    var count = 0;
+                    this.nowBuyset.citys.forEach(function (item, index) {
+                        count += item;
+                    });
+                    if (count > 0) {
+                        if (this.nowBuyset.areacount > 0) tipTxt += "、";
+                        tipTxt += count + " 个市";
+                        if (this.nowBuyset.citys.length > 1) tipTxt += "(分布在" + this.nowBuyset.citys.length + "个省内)"
+                    }
+                    $(".selected-area").text(tipTxt);
                 }
-                $(".selected-area").text(tipTxt);
-                //$(".add_tips.area").text(tipTxt).css("display", "");
-            } else if (!$.isEmptyObject(this.areaSelect) && this.areaSelect["全国"]) {
-                $(".selected-area").text("全国");
             } else {
                 $(".selected-area").text("");
             }
@@ -429,12 +435,13 @@
             $('.yearly span:eq(5)').text(purchase.price.year.allProvince_allBuyerClass / 100);
         },
         showIndustry: function () {
-            var data = this.industrySelect;
-            if (this.industrySelect.length > 0 && this.industrySelect[0] != "全部行业" && this.industrySelect[0] != "一个行业") { //选择有行业信息
-                var tipTxt = "";
-                $(".selected-industry-count").text(tipTxt + this.industrySelect.length + " 个行业");
-            } else if (this.industrySelect.length > 0 && this.industrySelect[0] == "全部行业") {
-                $(".selected-industry-count").text("全部行业");
+            if (this.industrySelect.length > 0 && this.industrySelect[0] != "一个行业") { //选择有行业信息
+                if (this.nowBuyset.buyerclasscount == -1) {
+                    $(".selected-industry-count").text("全部行业");
+                } else {
+                    var tipTxt = "";
+                    $(".selected-industry-count").text(tipTxt + this.nowBuyset.buyerclasscount + " 个行业");
+                }
             } else {
                 $(".selected-industry-count").text("");
             }
@@ -464,7 +471,8 @@
             this.flushSelectTime();
         },
         flushPrice: function (time, flag) {
-            var price = getsubVipOrderPrice(this.areaSelect, this.industrySelect, time, this.price);
+            //var price = getsubVipOrderPrice(this.areaSelect, this.industrySelect, time, this.price);
+            var price = getsubVipOrderPriceBybuyset(this.nowBuyset, time);
             var showPrice = formatMoney(price);
             if (flag === 1) {
                 $('.billing-price').text('¥' + showPrice);
@@ -487,6 +495,12 @@
                 $(".select_cycle .duration").hide();
             }
 
+        },
+        showTip() {//是否展示即将到期
+            var timeSub = this.endTime * 1000 - new Date().getTime();
+            if (timeSub > 0 && timeSub < 60 * 60 * 24 * 1000 * 3) {
+                $(".vip-header").show();
+            }
         }
     };
 
@@ -497,6 +511,7 @@
         purchase.showIndustry();
         purchase.showPrice();
         purchase.showTime();
+        purchase.showTip();
         purchase.flushPrice(purchase.timeSelect);
         var time_limit;//定义一个周期变量
         /*------ 关闭弹窗事件  点击取消或遮罩层 -----*/

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott