فهرست منبع

feat: 微信端订阅购买升级

yangfeng 4 سال پیش
والد
کامیت
5f892121d9

+ 0 - 20
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/css/vip_upgrade.css

@@ -407,23 +407,3 @@
 .text-red {
   color: #FB483D;
 }
-/* 专属权益 */
-.vip-upgrade .rights{
-  padding: 0 .32rem;
-}
-.vip-upgrade .rights-title{
-  padding: .36rem 0 .16rem;
-  display: flex;
-  align-items: center;
-  color: #171826;
-  line-height: .44rem;
-  font-size: .3rem;
-}
-.rights-title .title-line{
-  display: inline-block;
-  width: 3px;
-  height: .32rem;
-  border-radius: .22rem;
-  background-color: #2abed1;
-  margin-right: .16rem;
-}

+ 2 - 2
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/choose_area.js

@@ -305,7 +305,7 @@ var AreaChoose = {
               $(this).prop('checked', true);
               $(".checkbox").removeClass("opt");
           } else {
-              console.log($(".checkbox.other").prop('checked', false).parents('.all-country'))
+              // console.log($(".checkbox.other").prop('checked', false).parents('.all-country'))
               $(".checkbox.other").prop('checked', false).parents('.all-country').removeClass('active');
               if (!$(this).is(':checked')) {
                   if ($(this).hasClass("opt")) {//判断当前是否是半选
@@ -394,7 +394,7 @@ var AreaChoose = {
           }
           $('.tips_d_money').text('¥' + price);
       }
-      if (flag === -1) {
+      if (flag === -1 || getUrlParam('header') == 'upgrade') {
           $('.tips_d_money').css("display", "none");
       }
   },

+ 44 - 14
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/vip_upgrade.js

@@ -10,16 +10,16 @@ var purchase = {
   nowBuyset: {},
   timeCheckOk: false,
   payWay: "wx_app",
-  isUpdate: 0, // 0未升级到新套餐 1已升级到新套餐
+  renewList: [],
+  isTrial: false,
+  oldBuySet: {},
   initData: function () {
     //已选择
     try {
       //即将到期 回显已购买
-      console.log(sessionStorage.getItem("pay_read_cache"))
       if (!sessionStorage.getItem("pay_read_cache")) {
         $DoPost("/subscribepay/vipsubscribe/getSubBuyMsg", {}, function (r) {
           if (r.success) {
-            purchase.isUpdate = r.data.buyset.upgrade
             if (!$.isEmptyObject(r.data.area)) {
               purchase.areaSelect = r.data.area
             } else {
@@ -39,8 +39,13 @@ var purchase = {
             sessionStorage.setItem("vipSubSelectIndustry", JSON.stringify(purchase.industrySelect));
             sessionStorage.setItem("endTime", JSON.stringify(purchase.endTime))
             sessionStorage.setItem("vipSub_read", true);
-            // 缓存是否升级到新套餐
-            sessionStorage.setItem('vipSub_is_upgrade', r.data.buyset.upgrade)
+            // 以下为2021/5/20修改 缓存是否是试用用户、计价列表、老套餐
+            sessionStorage.setItem("vipSub_isTrial", r.data.isTrial);
+            sessionStorage.setItem("vipSub_renewList", JSON.stringify(r.data.renewList))
+            sessionStorage.setItem("vipSub_oldBuySet", JSON.stringify(r.data.buyset))
+            purchase.isTrial = r.data.isTrial
+            purchase.renewList = r.data.renewList
+            purchase.oldBuySet = r.data.buyset
           }
         }, false)
       } else {
@@ -54,6 +59,16 @@ var purchase = {
         if (sessionStorage.getItem("endTime")) {
           this.endTime = parseInt(sessionStorage.getItem("endTime"))
         }
+        // 以下为2021-5-20修改
+        if (sessionStorage.getItem("vipSub_isTrial")) {
+          purchase.isTrial = sessionStorage.getItem("vipSub_isTrial")
+        }
+        if (sessionStorage.getItem("vipSu(b_renewList")) {
+          purchase.renewList = JSON.parse(sessionStorage.getItem("vipSub_renewList"))
+        }
+        if (sessionStorage.getItem("vipSub_oldBuySet")) {
+          purchase.oldBuySet = JSON.parse(sessionStorage.getItem("vipSub_oldBuySet"))
+        }
       }
       if (sessionStorage.getItem("vipSubSelectTime")) {
         this.timeSelect = JSON.parse(sessionStorage.getItem("vipSubSelectTime"));
@@ -65,9 +80,8 @@ var purchase = {
       }
       //加载价格
       $DoPost("/subscribepay/vipsubscribe/getPrice", {}, function (r) {
-        // r.new 新套餐价格 r.old旧套餐价格
-        if (r.new) {
-          purchase.price = r.new;
+        if (r) {
+          purchase.price = r;
           purchase.can1111 = r.isActiving && r.isWritten === 0
           if (purchase.can1111) {
             if (!sessionStorage.getItem("vipSubSelectTime")) {
@@ -90,6 +104,11 @@ var purchase = {
     }
     this.nowBuyset = getBuySet(purchase.areaSelect, purchase.industrySelect, this.price);
 
+    var old = this.oldBuySet
+    //初始化 非试用用户 已经购买了 1个省份 两个省份【1个城市、两个城市】 3个行业 非升级版超级订阅
+    console.log(new Buyset(old.areacount, old.newcitys, old.buyerclasscount,old.upgrade))
+    Calculation.Init(this.isTrial,new Buyset(old.areacount, old.newcitys, old.buyerclasscount,old.upgrade),this.renewList, undefined, this.endTime)
+
     if (sessionStorage.getItem("payWay")) {
       if (sessionStorage.getItem("payWay").indexOf("ali") > -1) {
         this.payWay = "ali_app";
@@ -100,7 +119,8 @@ var purchase = {
   },
   showArea: function () {
     if (!$.isEmptyObject(this.areaSelect) && !this.areaSelect["一个省"]) { //有选择
-      if (this.nowBuyset.areacount === -1) {
+      console.log(this.nowBuyset, '----------123---------')
+      if (this.nowBuyset.areacount === -1 || this.nowBuyset.areacount >= 16) {
         $(".selected-area").text("全国");
       } else {
         var tipTxt = "";
@@ -174,9 +194,14 @@ var purchase = {
   flushPrice: function (time, flag) {
     //var price = getsubVipOrderPrice(this.areaSelect, this.industrySelect, time, this.price);
     var times = [time[0], time[1]];
-    var price = getsubVipOrderPriceBybuyset(this.nowBuyset, time);
-    var givePrice = getsubVipOrderPriceBybuyset(this.nowBuyset, [time[1] === 1 ? 1 : time[0], time[1]]);
-
+    // var price = getsubVipOrderPriceBybuyset(this.nowBuyset, time); // 2021-5-20
+    // var givePrice = getsubVipOrderPriceBybuyset(this.nowBuyset, [time[1] === 1 ? 1 : time[0], time[1]]); // 2021-5-20
+    var obj = this.nowBuyset
+    console.log(obj, 'obj')
+    var price = Calculation.GetUpgradeDetail(new Buyset(obj.areacount,[],obj.buyerclasscount,1), time)
+    var givePrice = Calculation.GetUpgradeDetail(new Buyset(obj.areacount,[],obj.buyerclasscount,1), [time[1] === 1 ? 1 : time[0], time[1]])
+    console.log(typeof price,price, 'price')
+    price = price[0] / 100
     var showPrice = formatMoney(price);
     if (flag === 1) {
       $('.billing-price').text(showPrice);
@@ -196,7 +221,7 @@ var purchase = {
       $('.computed_price').html(showPrice);
     }
     this.flushSelectTime(times, flag === undefined ? 1 : flag);
-    console.log(givePrice,price,showPrice)
+    
     coupon.updatePrice(price)
   },
   flushSelectTime (thisValue, flag) {
@@ -268,7 +293,7 @@ $(function () {
   purchase.initData();
   purchase.showArea();
   // purchase.showIndustry(); // 新套餐不展示行业(2021/5/19)
-  purchase.showPrice();
+  // purchase.showPrice(); // (不展示计价清单 2021/5/20)
   purchase.showTime();
   purchase.showTip();
   purchase.flushPrice(purchase.timeSelect);
@@ -544,6 +569,11 @@ function clearSessionStorage () {
   sessionStorage.removeItem("endTime");
   sessionStorage.removeItem("payWay");
   sessionStorage.To_introducePage = 2;
+  // 2021-5-20添加
+  sessionStorage.removeItem("vipSub_isTrial");
+  sessionStorage.removeItem("vipSub_renewList");
+  sessionStorage.removeItem("vipSub_oldBuySet");
+  
   //订阅首页
   sessionStorage.removeItem("sub_vip_state");
   sessionStorage.removeItem("vip_index_read");

+ 1 - 1
src/jfw/modules/app/src/web/templates/big-member/page_ai_add.html

@@ -501,7 +501,7 @@
                     id: this.project.id,
                     buyerContent: this.getListValue(),
                     buyer: this.formData.buyer,
-                    budget: this.formData.budget,
+                    budget: Number(this.formData.budget),
                     area: this.result.province,
                     city: this.result.city,
                     type: '',

+ 151 - 0
src/jfw/modules/app/src/web/templates/vipsubscribe/commonRules.html

@@ -0,0 +1,151 @@
+<style>
+  .vip-rights{
+    padding: 0 .3rem;
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    text-align: center;
+    font-size: .26rem;
+    color: #5F5E64;
+  }
+  .rights-item{
+    padding: .32rem .28rem;
+  }
+  .rights-title{
+    margin-bottom: 0.08rem;
+    text-align: left;
+    color: #171826;
+    font-size: .28rem;
+    line-height: .4rem;
+  }
+  .rights-content{
+    color: #5f5e64;
+    font-size: .24rem;
+    line-height: .36rem;
+    text-align: left;
+  }
+  .table{
+    margin-bottom: .32rem;
+    width: 100%;
+    border-collapse: collapse;
+  }
+  .table_title {
+    margin-bottom: .3rem;
+    margin-top: .3rem;
+    text-align: left;
+    font-size: .3rem;
+  }
+  .b-line {
+    position: relative;
+    margin-left: .18rem;
+    font-size: .3rem;
+    color: #171826;
+  }
+  .b-line:before {
+    content: '';
+    position: absolute;
+    left: -0.18rem;
+    top: 50%;
+    width: .06rem;
+    height: .32rem;
+    background-color: #2ABED1;
+    transform: translateY(-50%);
+    border-radius: .06rem;
+  }
+  .table td{
+    border: 1px solid #E5E5E5
+  }
+</style>
+<div class="vip-rights">
+  <table class="table">
+    <caption class="table_title b-line">超级订阅2.0版专属权益</caption>
+    <tr>
+      <td class="rights-item" colspan="2">
+        <p class="rights-title">超级订阅</p>
+        <p class="rights-content">300组关键词订阅,获取招标信息更全面。</p>
+      </td>
+    </tr>
+    <tr>
+      <td class="rights-item" colspan="2">
+        <p class="rights-title">更全信息</p>
+        <p class="rights-content">每天可接收2000条订阅地区的实时招标、采购、中标信息</p>
+      </td>
+    </tr>
+    <tr>
+      <td class="rights-item" colspan="2">
+        <p class="rights-title">企业画像</p>
+        <p class="rights-content">对企业进行全景透视,提供企业基本信息,中标项目分析、重点客户等,帮你挖掘销售线索。</p>
+      </td>
+    </tr>
+    <tr>
+      <td class="rights-item" colspan="2">
+        <p class="rights-title">企业搜索</p>
+        <p class="rights-content">搜索全国超七千万企业,获取企业情报信息,全方位监控竞争对手或用户关注的企业。</p>
+      </td>
+    </tr>
+    <tr>
+      <td class="rights-item" colspan="2">
+        <p class="rights-title">中标企业联系方式</p>
+        <p class="rights-content">招标公告与国家企业公示2种提取模式,让你直面企业。</p>
+      </td>
+    </tr>
+    <tr>
+      <td class="rights-item" colspan="2">
+        <p class="rights-title">项目匹配</p>
+        <p class="rights-content">智能匹配项目信息,为你推送所匹配项目后续的全部动态。</p>
+      </td>
+    </tr>
+    <tr>
+      <td class="rights-item" colspan="2">
+        <p class="rights-title">标题+全文匹配</p>
+        <p class="rights-content">关键词匹配标题或全文任你选,精准推送,随时获取你最需要的招标项目。</p>
+      </td>
+    </tr>
+    <tr>
+      <td class="rights-item" colspan="2">
+        <p class="rights-title">数据周报\月报</p>
+        <p class="rights-content">根据为您推送的招标项目信息,提供周报/月报,助您掌握最新市场动态。 更多升级功能即将上线,敬请期待!</p>
+      </td>
+    </tr>
+  </table>
+  <table class="table">
+    <caption class="table_title b-line">开通超级订阅2.0版,解锁以下20项权限</caption>
+    <tr>
+      <td class="rights-item" colspan="2">
+        <p class="rights-title">信息权益</p>
+        <p class="rights-content">采购项目商机、全国中标信息、企业联系方式、拟建项目信息</p>
+      </td>
+    </tr>
+    <tr>
+      <td class="rights-item" colspan="2">
+        <p class="rights-title">服务权益</p>
+        <p class="rights-content">企业库 项目库 企业监控 项目监控 大数据专项服务</p>
+      </td>
+    </tr>
+    <tr>
+      <td class="rights-item" colspan="2">
+        <p class="rights-title">数据服务</p>
+        <p class="rights-content">
+          中标信息统计<br>
+          项目动态<br> 
+          年度项目统计<br> 
+          月度中标金额统计<br> 
+          市场区域分布<br> 
+          各类客户平均折扣率<br> 
+          重点客户分析<br> 
+          客户类型分布
+        </p>
+      </td>
+    </tr>
+    <tr>
+      <td class="rights-item" colspan="2">
+        <p class="rights-title">专项查询</p>
+        <p class="rights-content">
+          企业基本信息<br> 
+          企业主要人员<br> 
+          企业联系方式
+        </p>
+      </td>
+    </tr>
+  </table>
+</div>

+ 3 - 7
src/jfw/modules/app/src/web/templates/vipsubscribe/vip_UpgradePage.html

@@ -84,13 +84,8 @@
             </a>
           </li>
         </ul>
-        <!-- 超级订阅专属权益 -->
-        <div class="rights">
-          <div class="rights-title">
-            <span class="title-line"></span>
-            <span>超级订阅专属权益</span>
-          </div>
-        </div>
+        <!-- 超级订阅专属权益 封装为公共页面-->
+        {{include "/vipsubscribe/commonRules.html"}}
       </div>
       <!-- vue组件 现带优惠券的订单提交(与原订单提交事件绑定,原订单提交不可删除) -->
       <div class="vip-footer" id="coupon-vue">
@@ -196,6 +191,7 @@
   <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/vipsubscribe/js/common.js?v={{Msg "seo" "version"}}'></script>
   <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/vipsubscribe/js/UpgradePrice.js?v={{Msg "seo" "version"}}'></script>
   <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/js/common.js?v={{Msg "seo" "mod_version"}}'></script>
+  <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/vipsubscribe/js/price.js?v={{Msg "seo" "mod_version"}}'></script>
   {{include "/common/iosJS.html"}}
   <script src=//cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js></script> 
   <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/coupon/js/pay-order-template.js?v={{Msg "seo" "version"}}'>

+ 51 - 39
src/jfw/modules/app/src/web/templates/vipsubscribe/vip_purchase.html

@@ -98,9 +98,9 @@
             <ul class="chooseList">
               <li class="choose_item">
                 <a href="/jyapp/vipsubscribe/toChooseArea">
-                  <span class="label">区域</span>
+                  <span class="label">省份数量</span>
                   {{if not .T.isTrial }}
-                    <input type="text" disabled value="" placeholder="1个" class="info choose_area">
+                    <input type="text" disabled value="" placeholder="1个" class="info choose_area">
                   {{else}}
                     <input type="text" disabled value="" placeholder="选择全国、省份、地市" class="info choose_area">
                   {{end}}
@@ -110,7 +110,7 @@
                 <!-- 无选择时不显示 -->
                 <p class="add_tips area" style="display:none">已选择 0 个省级区域、0 个地市</p>
               </li>
-              <li class="choose_item">
+              <li class="choose_item" style="display: none;">
                 <a href="/jyapp/vipsubscribe/toChooseIndustry">
                   <span class="label" style="white-space: nowrap;">采购单位行业</span>
                   {{if not .T.isTrial }}
@@ -120,7 +120,6 @@
                   {{end}}
                   <i class="iconfont icon-arrow"></i>
                 </a>
-                <!-- 无选择时不显示 -->
                 <p class="add_tips industry_warn" style="display: none;">请选择行业</p>
                 <p class="add_tips industry" style="display:none">已选择 0 个行业</p>
               </li>
@@ -194,48 +193,50 @@
                   </label>
                 </div>
               -->
+              <!-- 超级订阅专属权益 封装为公共页面-->
+              {{include "/vipsubscribe/commonRules.html"}}
               <div class="vip_prise_table">
-                <table class="monthly">
+                <table class="monthly" style="display: none;">
                   <caption class="table_title b-line">超级订阅价格</caption>
                   <tr>
                     <td class="table-label" colspan="2">按月购买</td>
                   </tr>
                   <tr>
-                    <td><span>5.8</span>元 月/市/行业</td>
-                    <td><span>18</span>元 月/市/全行业</td>
+                    <!-- <td><span>5.8</span>元 月/市/行业</td> -->
+                    <!-- <td><span>18</span>元 月/市/全行业</td> -->
                   </tr>
                   <tr>
-                    <td><span>11.8</span>元 月/省/行业</td>
-                    <td><span>38</span>元 月/省/全行业</td>
+                    <!-- <td><span>11.8</span>元 月/省/行业</td> -->
+                    <td><span class="oneP_allB">38</span>元 月/省/全行业</td>
                   </tr>
                   <tr>
-                    <td><span>118</span>元 月/全国/行业</td>
-                    <td><span>388</span>元 月/全国/全行业</td>
+                    <!-- <td><span>118</span>元 月/全国/行业</td> -->
+                    <td><span class="allP_allB">388</span>元 月/全国/全行业</td>
                   </tr>
                 </table>
-                <table class="yearly">
+                <table class="yearly" style="display: none;">
                   <tr>
                     <td class="table-label" colspan="2">按年购买</td>
                   </tr>
                   <tr>
-                    <td><span>58</span>元 年/市/行业</td>
-                    <td><span>180</span>元 年/市/全行业</td>
+                    <!-- <td><span>58</span>元 年/市/行业</td> -->
+                    <!-- <td><span>180</span>元 年/市/全行业</td> -->
                   </tr>
                   <tr>
-                    <td><span>118</span>元 年/省/行业</td>
-                    <td><span>380</span>元 年/省/全行业</td>
+                    <!-- <td><span>118</span>元 年/省/行业</td> -->
+                    <td><span class="oneP_allB">380</span>元 年/省/全行业</td>
                   </tr>
                   <tr>
-                    <td><span>1180</span>元 年/全国/行业</td>
-                    <td><span>3880</span>元 年/全国/全行业</td>
+                    <!-- <td><span>1180</span>元 年/全国/行业</td> -->
+                    <td><span class="allP_allB">3880</span>元 年/全国/全行业</td>
                   </tr>
                 </table>
                 <dl class="tips">
                   <dt class="b-line">购买须知</dt>
                   <dd>套餐周期内,不支持套餐降级,续费可降级;</dd>
                   <dd>用户最多购买/续费3年套餐;</dd>
-                  <dd>支持套餐升级,补差价(按月进行补差价,不足一个月按一个月计算)。</dd>
-                  <dd>3个市及以上即为全省,10个省及以上即为全国。4个行业及以上即为全行业。</dd>
+                  <dd>支持套餐升级,补差价(按月进行补差价,不足一个月按一个月计算。</dd>
+                  <!-- <dd>3个市及以上即为全省,16个省及以上即为全国。4个行业及以上即为全行业。</dd> -->
                   <dd>购买的采购单位行业与地域为个数,购买后可不限次数进行更换。</dd>
                 </dl>
               </div>
@@ -460,8 +461,9 @@
       <script src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/local/jquery.min.js"></script>
       <script src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/local/weui.min.js"></script>
       <script src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/vipsubscribe/js/common.js?v={{Msg "seo" "version"}}"></script>
-      <script src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/js/common.js?v={{Msg "seo" "mod_version"}}"></script>
+      <!-- <script src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/js/common.js?v={{Msg "seo" "mod_version"}}"></script> -->
       <!--<script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/js/check-bind-phone.js?v={{Msg "seo" "version"}}'></script>-->
+      <script src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/vipsubscribe/js/price.js?v={{Msg "seo" "version"}}"></script>
       <script src=//cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js></script>
       <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/coupon/js/pay-order-template.js?v={{Msg "seo" "version"}}'></script>
       <script>
@@ -784,12 +786,13 @@
               //加载价格
               $DoPost("/subscribepay/vipsubscribe/getPrice", {}, function (r) {
                 if (r) {
-                  purchase.price = r;
+                  purchase.price = r.new;
                   // if (r.isActiving && r.isWritten === 0) {
                   //     showGiveStatus(true)
                   // } else {
                   //     showGiveStatus(false)
                   // }
+                  Calculation.Init(false, undefined, [], 0)
                 }
               }, false)
               sessionStorage.removeItem("pay_read_cache");
@@ -825,19 +828,24 @@
             }
           },
           showPrice: function () {
-            $('.monthly span:eq(0)').text(purchase.price.month.oneCity_oneBuyerClass / 100);
-            $('.monthly span:eq(1)').text(purchase.price.month.oneCity_allBuyerClass / 100);
-            $('.monthly span:eq(2)').text(purchase.price.month.oneProvince_oneBuyerClass / 100);
-            $('.monthly span:eq(3)').text(purchase.price.month.oneProvince_allBuyerClass / 100);
-            $('.monthly span:eq(4)').text(purchase.price.month.allProvince_oneBuyerClass / 100);
-            $('.monthly span:eq(5)').text(purchase.price.month.allProvince_allBuyerClass / 100);
+            // $('.monthly span:eq(0)').text(purchase.price.month.oneCity_oneBuyerClass / 100);
+            // $('.monthly span:eq(1)').text(purchase.price.month.oneCity_allBuyerClass / 100);
+            // $('.monthly span:eq(2)').text(purchase.price.month.oneProvince_oneBuyerClass / 100);
+            // $('.monthly span:eq(3)').text(purchase.price.month.oneProvince_allBuyerClass / 100);
+            // $('.monthly span:eq(4)').text(purchase.price.month.allProvince_oneBuyerClass / 100);
+            // $('.monthly span:eq(5)').text(purchase.price.month.allProvince_allBuyerClass / 100);
+
+            // $('.yearly span:eq(0)').text(purchase.price.year.oneCity_oneBuyerClass / 100);
+            // $('.yearly span:eq(1)').text(purchase.price.year.oneCity_allBuyerClass / 100);
+            // $('.yearly span:eq(2)').text(purchase.price.year.oneProvince_oneBuyerClass / 100);
+            // $('.yearly span:eq(3)').text(purchase.price.year.oneProvince_allBuyerClass / 100);
+            // $('.yearly span:eq(4)').text(purchase.price.year.allProvince_oneBuyerClass / 100);
+            // $('.yearly span:eq(5)').text(purchase.price.year.allProvince_allBuyerClass / 100);
 
-            $('.yearly span:eq(0)').text(purchase.price.year.oneCity_oneBuyerClass / 100);
-            $('.yearly span:eq(1)').text(purchase.price.year.oneCity_allBuyerClass / 100);
-            $('.yearly span:eq(2)').text(purchase.price.year.oneProvince_oneBuyerClass / 100);
-            $('.yearly span:eq(3)').text(purchase.price.year.oneProvince_allBuyerClass / 100);
-            $('.yearly span:eq(4)').text(purchase.price.year.allProvince_oneBuyerClass / 100);
-            $('.yearly span:eq(5)').text(purchase.price.year.allProvince_allBuyerClass / 100);
+            $('.monthly span.oneP_allB').text(purchase.price.month.oneProvince_allBuyerClass / 100);
+            $('.monthly span.allP_allB').text(purchase.price.month.allProvince_allBuyerClass / 100);
+            $('.yearly span.oneP_allB').text(purchase.price.year.oneProvince_allBuyerClass / 100);
+            $('.yearly span.allP_allB').text(purchase.price.year.allProvince_allBuyerClass / 100);
           },
           showIndustry: function () {
             if (this.industrySelect.length > 0 && this.industrySelect[0] != "一个行业") { //选择有行业信息
@@ -891,9 +899,12 @@
                 $('.price .billing-price').text('0.00');
                 $('.now-price .dis-price').text('0.00');  // 优惠明细
               } else {
-                var price = getsubVipOrderPriceBybuyset(this.nowBuyset, time);
-                var givePrice = getsubVipOrderPriceBybuyset(this.nowBuyset, [time[1] === 1 ? 1 :time[0], time[1]]);
-                //var price = getsubVipOrderPrice(this.areaSelect, this.industrySelect, time, this.price);
+                // var price = getsubVipOrderPriceBybuyset(this.nowBuyset, time);
+                // var givePrice = getsubVipOrderPriceBybuyset(this.nowBuyset, [time[1] === 1 ? 1 :time[0], time[1]]);
+                var obj = this.nowBuyset
+                var price = Calculation.GetTotal(new Buyset(obj.areacount,[],obj.buyerclasscount, 1),time)
+                var givePrice = Calculation.GetTotal(new Buyset(obj.areacount,[],obj.buyerclasscount, 1),[time[1] === 1 ? 1 :time[0], time[1]])
+                price = (price / 100)
                 var showPrice = formatMoney(price);
                 if (flag === 1) {
                   $('.price .billing-price').text(showPrice);
@@ -911,6 +922,7 @@
                   $('.computed_price').html(showPrice);
                   $('.discount-price .dis-price').text(formatMoney(givePrice))
                 }
+                console.log(price, '计算的价格')
                 coupon.updatePrice(price)
               }
             }
@@ -1141,7 +1153,7 @@
               "userLotteryId":coupon.$refs.couponRef.coupon.userLotteryId,
               "lotteryId": coupon.$refs.couponRef.coupon.lotteryId,
               "area": JSON.stringify(area),
-              "industry": industry.join(","),
+              // "industry": industry.join(","),
               "time": $(".info:eq(2)").val().trim(),
               "orderType":{{.T.orderType}},
               "activeCode": activeCodes,
@@ -1170,7 +1182,7 @@
             //试用用户
             $DoPost("/subscribepay/order/trialPay", {
               "area": JSON.stringify(area),
-              "industry": industry.join(","),
+              // "industry": industry.join(","),
               "order_phone": OrderPhoneCheck.phone
             }, function (r) {
               if (r.success) {

+ 0 - 20
src/web/staticres/vipsubscribe/css/vip_upgrade.css

@@ -410,24 +410,4 @@ height: 20px;
 
 .text-red {
   color: #FB483D;
-}
-/* 专属权益 */
-.vip-upgrade .rights{
-  padding: 0 .32rem;
-}
-.vip-upgrade .rights-title{
-  padding: .36rem 0 .16rem;
-  display: flex;
-  align-items: center;
-  color: #171826;
-  line-height: .44rem;
-  font-size: .3rem;
-}
-.rights-title .title-line{
-  display: inline-block;
-  width: 3px;
-  height: .32rem;
-  border-radius: .22rem;
-  background-color: #2abed1;
-  margin-right: .16rem;
 }

+ 1 - 1
src/web/staticres/vipsubscribe/js/choose_area.js

@@ -375,7 +375,7 @@ var AreaChoose = {
           var price = getsubVipOrderPrice(this.selectObj, this.selectedIndustryArr, this.timeSelect);
           $('.tips_d_money').text('¥' + price);
       }
-      if (flag === -1) {
+      if (flag === -1 || getParam('header') == 'upgrade') {
           $('.tips_d_money').css("display", "none");
       }
   },

+ 373 - 0
src/web/staticres/vipsubscribe/js/price.js

@@ -0,0 +1,373 @@
+//超级订阅价格计算
+class Buyset {
+    constructor(areacount, cityArr = [], buyerCount, upgrade) {
+        this.areacount = areacount; //省份数量 -1 全国
+        this.citys = cityArr; //购买的城市数组
+        this.buyerclasscount = buyerCount; //行业数量
+        this.upgrade = upgrade; //是否是升级版的超级订阅
+    }
+}
+
+var Calculation = {
+    PriceRule: {
+        "old": {
+            "month": {
+                "oneCity_oneBuyerClass": 580,
+                "oneCity_allBuyerClass": 1800,
+                "oneProvince_oneBuyerClass": 1180,
+                "oneProvince_allBuyerClass": 3800,
+                "allProvince_oneBuyerClass": 11800,
+                "allProvince_allBuyerClass": 38800
+            },
+            "year": {
+                "oneCity_oneBuyerClass": 5800,
+                "oneCity_allBuyerClass": 18000,
+                "oneProvince_oneBuyerClass": 11800,
+                "oneProvince_allBuyerClass": 38000,
+                "allProvince_oneBuyerClass": 118000,
+                "allProvince_allBuyerClass": 388000
+            },
+            "cityPrice": 580,
+            "provincePrice": 1180,
+            "buyerClassPrice": 580,
+            "cityMaxCount": 2,
+            "provinceMaxCount": 9,
+            "buyerClassMaxCount": 3,
+            "monthMaxCount": 9
+        },
+        "new": {
+            "month": {
+                "oneProvince_allBuyerClass": 3800,
+                "allProvince_allBuyerClass": 59900
+            },
+            "year": {
+                "oneProvince_allBuyerClass": 38800,
+                "allProvince_allBuyerClass": 599900
+            },
+            "provincePrice": 3800,
+            "provinceMaxCount": 15,
+            "monthMaxCount": 9
+        },
+        "discount": 1
+    }, //套餐价格表
+    IsTrial: true, //是否时试用用户
+    OldBuyset: new Buyset(),//用户之前套餐
+    EndTime: 0, //会员到期时间
+    RenewList: [],
+    Init: function (isTrial, oldBuyset, renewList, price, endTime) { //首次购买时oldBuyset传入undefined
+        this.IsTrial = isTrial;
+        this.OldBuyset = oldBuyset;
+        this.RenewList = renewList;
+        this.EndTime = endTime;
+        //this.PriceRule = price;
+    },
+    Check: function (tmpBuyset, oldBuyset) { //校验是否合法
+        if (!oldBuyset) {
+            oldBuyset = this.OldBuyset;
+        }
+        if (!oldBuyset) {
+            return true
+        }
+        if (oldBuyset.upgrade === 1) { //升级后省份数量必须大于升级前的
+            return (tmpBuyset.areacount === -1 && oldBuyset.areacount !== -1) || tmpBuyset.areacount > oldBuyset.areacount;
+        } else {
+            return tmpBuyset.areacount === -1 || tmpBuyset.areacount >= oldBuyset.areacount + oldBuyset.citys.length;
+        }
+    },
+    /*
+    首次购买 或 单独续费
+    param newBuyset 选择套餐 [*续费时传入undefined]
+          buyTime  [数量,单位(1:年,2月)]
+    return 价格
+    */
+    GetTotal: function (newBuyset, buyTime = [1, 2]) { //newBuyset 用户选择的套餐;
+        if (newBuyset) {//首次购买
+            return this.getBuysetPrice(newBuyset, buyTime)
+        }
+        return this.getBuysetPrice(this.OldBuyset, buyTime)   //续费
+    },
+    /*
+    套餐升级
+    param  newBuyset 选择套餐
+           buyTime  [数量,单位(1:年,2月)]
+    return 价格、计价清单
+     */
+    GetUpgradeDetail: function (newBuyset = new Buyset(), buyTime = [1, 2]) { //升级计价 time[数量,单位(1:年,2月)]
+        let subtotail = []; //计价清单
+        let final_price = 0; //最终计算价格
+        let nowEndTime = this.EndTime;
+        //续费升级价格
+        if (this.RenewList.length > 0) {
+            for (var i = this.RenewList.length - 1; i >= 0; i--) {
+                let thisBuyset = this.RenewList[i].o_buyset;
+                let thisStartTime = this.RenewList[i].l_validtime;
+                let old = new Buyset(thisBuyset.areacount, thisBuyset.newcitys, thisBuyset.buyerclasscount, this.upgrade || 0)
+                var this_price = this.GetSubPrice(old, newBuyset, thisStartTime, nowEndTime);
+                if (this_price < 0) {
+                    return [-2, []]  //已续费升级异常
+                }
+                //清单数组
+                subtotail.push({
+                    "buyset": old,
+                    "startTime": thisStartTime,
+                    "endTime": nowEndTime,
+                    "price": this_price,
+                    "type": 1
+                });
+                final_price = this.numAdd(final_price, this_price);
+                nowEndTime = thisStartTime;
+            }
+        }
+        //现在使用升级价格
+        let now_price = this.GetSubPrice(this.OldBuyset, newBuyset, new Date().getTime() / 1000, nowEndTime);
+        if (now_price < 0) {
+            return [-2, []] //当前套餐升级异常
+        }
+        subtotail.push({ //清单数组
+            "buyset": this.OldBuyset,
+            "startTime": new Date().getTime() / 1000,
+            "endTime": nowEndTime,
+            "price": now_price,
+            "type": 0
+        });
+        final_price = this.numAdd(final_price, now_price);
+        //新增续费升级价格
+        if (buyTime.length === 2) {
+            let thisPrice = this.getBuysetPrice(newBuyset, buyTime);
+            if (thisPrice < 0) {
+                return [-2, []] //本次升级中续费时间异常
+            }
+            console.log(newBuyset, buyTime, "额外升级费用", thisPrice);
+            final_price = this.numAdd(final_price, thisPrice);
+            subtotail.push({//清单数组
+                "buyset": newBuyset,
+                "startTime": this.EndTime,
+                "endTime": this.getVipEndDate(buyTime[1], buyTime[0]),
+                "price": thisPrice,
+                "type": 2
+            });
+        }
+        return [final_price, subtotail]
+    },
+    GetSubPrice: function (oldBuyset, newBuyset, start, end) { //升级-计算套餐差价
+        if (!this.Check(newBuyset, oldBuyset)) {
+            console.error("当前所选套餐等级低于已购买套餐")
+            return -1
+        }
+        let beforePrice = 0;
+        let newPrice = 0;
+        let t = this.getDateSub(start, end);
+
+        if (t[1] !== 0) {//月
+            beforePrice = this.numAdd(beforePrice, this.getBuysetPrice(oldBuyset, [t[1], 2]))
+            newPrice = this.numAdd(newPrice, this.getBuysetPrice(newBuyset, [t[1], 2]))
+        }
+        if (t[0] !== 0) {//年
+            beforePrice = this.numAdd(beforePrice, this.getBuysetPrice(oldBuyset, [t[0], 1]))
+            newPrice = this.numAdd(newPrice, this.getBuysetPrice(newBuyset, [t[0], 1]))
+        }
+        console.log("old ", oldBuyset, " \n new ", newBuyset, " \n 相差", t[0], "年 ", t[1], "个月\n price:", newPrice, "-", beforePrice, "=", (newPrice * 10000 - beforePrice * 10000) / 10000);
+        return (newPrice * 10000 - beforePrice * 10000) / 10000
+    },
+    getBuysetPrice: function (vipbuyset = new Buyset(), t) { //获取套餐价格
+        if (t.length !== 2) {
+            console.error("选择时间格式异常")
+            return -1
+        }
+        if (vipbuyset.upgrade === 0) { //旧版大会员价格计算
+            if (t[0] > this.PriceRule.old.monthMaxCount && t[1] === 2) t[0] = 10;//月份十个月以上价格一样
+            if (vipbuyset.areacount === -1) {//计算全国套餐价格
+                if (vipbuyset.buyerclasscount === 1) return this.getSetMealPrice_old(0, 1, t[1]) * t[0] / 100; //全国1行业套餐
+                if (vipbuyset.buyerclasscount === 0) return this.getSetMealPrice_old(0, 0, t[1]) * t[0] / 100; //全国全行业套餐
+                return this.getSetMealPrice_old(0, vipbuyset.buyerclasscount, t[1]) * t[0] / 100 //全国多行业套餐
+            }
+            let final_price = 0;//计算省份价格
+            for (var i in vipbuyset.citys) {
+                var thisPrice = 0;
+                if (vipbuyset.citys[i] === 1) {//单城市
+                    thisPrice = this.getSetMealPrice_old(2, vipbuyset.buyerclasscount, t[1]) * t[0];
+                } else {//多城市
+                    if (vipbuyset.buyerclasscount === 0 || vipbuyset.buyerclasscount === 1) {//多城市 单行业
+                        if (vipbuyset.citys[i] > this.PriceRule.old.cityMaxCount) {
+                            vipbuyset.areacount++;
+                        } else {
+                            thisPrice = vipbuyset.citys[i] * this.getSetMealPrice_old(2, vipbuyset.buyerclasscount, t[1]) * t[0];
+                        }
+                    } else {//多城市 多行业
+                        if (vipbuyset.citys[i] > this.PriceRule.old.cityMaxCount) {
+                            vipbuyset.areacount++;
+                        } else {
+                            thisPrice = this.getSetMealPrice_old(2, vipbuyset.buyerclasscount, t[1]) * vipbuyset.citys[i] * t[0];
+                        }
+                    }
+                }
+                final_price += thisPrice;
+            }
+            final_price += vipbuyset.areacount * this.getSetMealPrice_old(1, vipbuyset.buyerclasscount, t[1]) * t[0];
+            return final_price / 100
+        } else {//新版大会员价格计算
+            let pCount = vipbuyset.areacount
+            let count = t[0]
+            if (pCount > this.PriceRule.new.provinceMaxCount) {
+                pCount = -1
+            }
+            if (pCount === -1) {
+                pCount = 0
+            }
+            //当选择月份大于  按照全年计算
+            if (t[0] > this.PriceRule.new.monthMaxCount && t[1] === 2) { //月份十个月以上价格一样
+                count = 10
+            }
+            return this.getSetMealPrice_new(pCount, t[1]) * count //全国1行业套餐
+        }
+    },
+    getSetMealPrice_old: function (c, iCount, u) { //旧套餐价格计算
+        var t = u === 2; //是否是月单位
+        switch (c) {
+            case 0:
+                if (iCount === -1) {
+                    if (t) return this.PriceRule.old.month.allProvince_allBuyerClass;  //1月全国全行业
+                    return this.PriceRule.old.year.allProvince_allBuyerClass; //1年全国全行业
+                } else {
+                    if (t) return this.PriceRule.old.month.allProvince_oneBuyerClass * iCount; //1月全国icount个行业
+                    return this.PriceRule.old.year.allProvince_oneBuyerClass * iCount;	//1年全国icount个行业
+                }
+            case 1:
+                if (iCount === -1) {
+                    if (t) return this.PriceRule.old.month.oneProvince_allBuyerClass;  //1月1省全行业
+                    return this.PriceRule.old.year.oneProvince_allBuyerClass	//1年1省全行业
+                } else {
+                    if (t) return this.PriceRule.old.month.oneProvince_oneBuyerClass * iCount; //1月1省icount个行业
+                    return this.PriceRule.old.year.oneProvince_oneBuyerClass * iCount	//1年1省icount个行业
+                }
+            default:
+                if (iCount === -1) {
+                    if (t) return this.PriceRule.old.month.oneCity_allBuyerClass;  //1月1市全行业
+                    return this.PriceRule.old.year.oneCity_allBuyerClass	//1年1市全行业
+                } else {
+                    if (t) return this.PriceRule.old.month.oneCity_oneBuyerClass * iCount; //1月1市icount个行业
+                    return this.PriceRule.old.year.oneCity_oneBuyerClass * iCount	//1年1市icount个行业
+                }
+        }
+    },
+    getSetMealPrice_new: function (p, u) { //新套餐价格计算 p省份格式,u时间单位
+        let t = u === 2 //是否是月单位
+        switch (p) {
+            case 0:
+                if (t) {
+                    return this.PriceRule.new.month.allProvince_allBuyerClass // 1月全国全行业
+                }
+                return this.PriceRule.new.year.allProvince_allBuyerClass //1年全国全行业
+            default :
+                if (t) {
+                    return this.PriceRule.new.month.oneProvince_allBuyerClass * p //1月p省全行业
+                }
+                return this.PriceRule.new.year.oneProvince_allBuyerClass * p //1年p省全行业
+        }
+    },
+    getDateSub: function (start, end) { //计算时间间隔差 [年个数, 月个数]
+        let startTime = new Date(start * 1000);
+        let endTime = new Date(end * 1000);
+
+        let startYear = startTime.getFullYear();
+        let startMonth = startTime.getMonth();
+        let startDay = startTime.getDate();
+
+        let endYear = endTime.getFullYear();
+        let endMonth = endTime.getMonth();
+        let endDay = endTime.getDate();
+
+        let finalMonthNum = 0;
+        let finalYearNum = 0;
+        if (startYear === endYear) {
+            if (startMonth === endMonth) {
+                finalMonthNum = 1;
+            } else {
+                if (endDay > startDay) {
+                    finalMonthNum = endMonth - startMonth + 1;
+                } else {
+                    finalMonthNum = endMonth - startMonth;
+                }
+            }
+        } else {
+            if (startMonth === endMonth) {
+                if (endDay <= startDay) {
+                    finalMonthNum = (endYear - startYear) * 12;
+                } else {
+                    finalMonthNum = (endYear - startYear) * 12 + 1;
+                }
+            } else if (endMonth > startMonth) {
+                if (endDay <= startDay) {
+                    finalMonthNum = (endYear - startYear) * 12 + (endMonth - startMonth);
+                } else {
+                    finalMonthNum = (endYear - startYear) * 12 + (endMonth - startMonth) + 1;
+                }
+            } else {
+                if (endDay <= startDay) {
+                    finalMonthNum = (endYear - startYear - 1) * 12 + (12 - startMonth + endMonth);
+                } else {
+                    finalMonthNum = (endYear - startYear - 1) * 12 + (12 - startMonth + endMonth) + 1;
+                }
+            }
+            finalYearNum = Math.floor(finalMonthNum / 12);
+            if (finalYearNum > 0) {
+                finalMonthNum = finalMonthNum - finalYearNum * 12
+            }
+        }
+        return [finalYearNum, finalMonthNum]
+    },
+    getVipEndDate: function (flag, value) {
+        let EndTime = new Date(this.EndTime * 1000);
+        let startDay = EndTime.getDate();
+        let yearNum = EndTime.getFullYear();
+        let monthNum = EndTime.getMonth();
+        if (flag === 1) {//将年转换成月
+            //年
+            yearNum += value;
+        } else {
+            //月
+            if (monthNum + value > 11) {
+                monthNum = monthNum + value - 12;
+                yearNum++
+            } else {
+                monthNum += value
+            }
+        }
+        //获取当月最后一天
+        let lastDay = new Date(yearNum, monthNum + 1, 0).getDate();
+        if (startDay < lastDay) {
+            return new Date(yearNum, monthNum, startDay, 23, 59, 59).getTime() / 1000;
+        } else {
+            return new Date(yearNum, monthNum, lastDay, 23, 59, 59).getTime() / 1000;
+        }
+    },
+    numAdd: function (num1, num2) {
+        return (num1 * 10000 + num2 * 10000) / 10000
+    }
+}
+
+/*
+//首次购买
+Calculation.Init(false, undefined, [], 0)
+Calculation.GetTotal(new Buyset(15, [], -1, 1), [1, 2])  //首次购买
+
+//续费
+Calculation.Init(false, new Buyset(1, [1, 2], 3, 0))
+Calculation.GetTotal(undefined, [1, 2])
+
+//续费
+//初始化 非试用用户 已经购买了 1个省份 两个省份【1个城市、两个城市】 3个行业 非升级版超级订阅
+Calculation.Init(false, new Buyset(1, [1, 2], 3, 0),
+    [{
+        "l_validtime": 1622476799,
+        "o_buyset": {
+            "areacount": 3,
+            "buyerclasscount": -1,
+            "newcitys": []
+        }
+    }], undefined, 1625068799)
+//计算价格 升级为 15个省份 并续费一个月价格
+Calculation.GetUpgradeDetail(new Buyset(15, [], -1, 1), [1, 2])
+ */
+
+

+ 77 - 77
src/web/staticres/vipsubscribe/js/vip_index_new.js

@@ -61,80 +61,80 @@ function getNewYearMarketing () {
 
 $(function () {
     /* vue 代码 start 提交订单 */
-  var coupon = new Vue({ 
-    el: '#coupon-vue',
-    data: function () {
-      return {
-        type: 'vip-update',
-        initPrice: 0, // 原价
-        realPrice: 0, // 实付价
-        checkboxStatus: false, // checkbox状态
-        submitStatus: true,  // 提交按钮状态
-        links: [
-          {
-            text: '《剑鱼标讯线上购买与服务条款》',
-            url: '/front/staticPage/wx-serviceterms.html',
-            event: this.readEvent
-          }
-        ],
-        buttons: {
-          submit: this.submitOrder,
-          cancel: this.cancelEvent
-        },
-      }
-    },
-    mounted () {
-      this.init()
-    }, 
-    methods: {
-      // 更新价格相关
-      updatePrice: function (before) {
-        console.log( '原价:' + before)
-        this.initPrice = before;
-        // 调用子组件查询最优卡券
-        this.$refs.couponRef.getCoupon();
-      },
-      // 初始化及回显相关
-      init: function () {
-        if (sessionStorage.getItem("vip_index_read") === "true") {
-          this.checkboxStatus = true
-          this.$refs.couponRef.submitStatus = false
-        } else {
-          this.checkboxStatus = false
-          this.$refs.couponRef.submitStatus = true
-        }
-      },
-      // 勾选阅读协议
-      updateS: function(data) {
-        data.callback(this.checkSubmitStatus(data.check))
-      },
-      // 校验checkbox
-      checkSubmitStatus: function (checkStatus) {
-        if(checkStatus) {
-          $('.checkbox').addClass("checked");
-        } else {
-          $('.checkbox').removeClass("checked");
-        }
-        $('.vip-footer.upgrade .confirm').prop('disabled', !checkStatus);
-        sessionStorage.setItem("vip_index_read", checkStatus ? true : false);
-        return sessionStorage.getItem("vip_index_read") == 'true';
-      },
-      // 阅读协议点击事件
-      readEvent: function () {},
-      // 点击优惠券跳转存储当前页面数据
-      savePageData: function () {
-        sessionStorage.setItem('index_read_cache', '0');
-      },
-      cancelEvent: function() {
-        $('.weui-mask').trigger('click')
-        window.history.back();
-      },
-      // 订单提交事件
-      submitOrder: function () {
-        doSubmit()
-      }
-    }
-  })
+  // var coupon = new Vue({ 
+  //   el: '#coupon-vue',
+  //   data: function () {
+  //     return {
+  //       type: 'vip-update',
+  //       initPrice: 0, // 原价
+  //       realPrice: 0, // 实付价
+  //       checkboxStatus: false, // checkbox状态
+  //       submitStatus: true,  // 提交按钮状态
+  //       links: [
+  //         {
+  //           text: '《剑鱼标讯线上购买与服务条款》',
+  //           url: '/front/staticPage/wx-serviceterms.html',
+  //           event: this.readEvent
+  //         }
+  //       ],
+  //       buttons: {
+  //         submit: this.submitOrder,
+  //         cancel: this.cancelEvent
+  //       },
+  //     }
+  //   },
+  //   mounted () {
+  //     this.init()
+  //   }, 
+  //   methods: {
+  //     // 更新价格相关
+  //     updatePrice: function (before) {
+  //       console.log( '原价:' + before)
+  //       this.initPrice = before;
+  //       // 调用子组件查询最优卡券
+  //       this.$refs.couponRef.getCoupon();
+  //     },
+  //     // 初始化及回显相关
+  //     init: function () {
+  //       if (sessionStorage.getItem("vip_index_read") === "true") {
+  //         this.checkboxStatus = true
+  //         this.$refs.couponRef.submitStatus = false
+  //       } else {
+  //         this.checkboxStatus = false
+  //         this.$refs.couponRef.submitStatus = true
+  //       }
+  //     },
+  //     // 勾选阅读协议
+  //     updateS: function(data) {
+  //       data.callback(this.checkSubmitStatus(data.check))
+  //     },
+  //     // 校验checkbox
+  //     checkSubmitStatus: function (checkStatus) {
+  //       if(checkStatus) {
+  //         $('.checkbox').addClass("checked");
+  //       } else {
+  //         $('.checkbox').removeClass("checked");
+  //       }
+  //       $('.vip-footer.upgrade .confirm').prop('disabled', !checkStatus);
+  //       sessionStorage.setItem("vip_index_read", checkStatus ? true : false);
+  //       return sessionStorage.getItem("vip_index_read") == 'true';
+  //     },
+  //     // 阅读协议点击事件
+  //     readEvent: function () {},
+  //     // 点击优惠券跳转存储当前页面数据
+  //     savePageData: function () {
+  //       sessionStorage.setItem('index_read_cache', '0');
+  //     },
+  //     cancelEvent: function() {
+  //       $('.weui-mask').trigger('click')
+  //       window.history.back();
+  //     },
+  //     // 订单提交事件
+  //     submitOrder: function () {
+  //       doSubmit()
+  //     }
+  //   }
+  // })
   /* vue 代码 end */
     //项目匹配开关
     var checkedflag = true;
@@ -574,7 +574,7 @@ $(function () {
                     onClick: function () {
                         // doSubmit();
                         // $('.vip-footer .button-r.confirm').trigger('click')
-                        coupon.submitOrder()
+                        // coupon.submitOrder()
                     }
                 }
             ]
@@ -973,7 +973,7 @@ $(function () {
                 // 优惠提示
                 $('.j-notice-bar.vip-bar').css('display', 'flex')
             }
-            coupon.updatePrice(status[0])
+            // coupon.updatePrice(status[0])
         }
 
         if (reqData.isTrial) {//试用购买
@@ -995,7 +995,7 @@ $(function () {
             }
             initBack(4);
             $(".vip-footer.upgrade .confirm").text("立即购买");
-            coupon.$refs.couponRef.btnText = "立即购买"
+            // coupon.$refs.couponRef.btnText = "立即购买"
         } else if ((!status[1] && !status[2])) {//续费
             initBack(2);
         } else {//升级

+ 37 - 8
src/web/staticres/vipsubscribe/js/vip_upgrade.js

@@ -6,6 +6,9 @@ var purchase = {
   endTime: "",
   price: {}, // 价格
   nowBuyset: {},
+  renewList: [],
+  isTrial: false,
+  oldBuySet: {},
   timeCheckOk: false,
   payWay: "wx_js",
   initData: function () {
@@ -46,6 +49,14 @@ var purchase = {
             sessionStorage.setItem("vipSubSelectIndustry", JSON.stringify(purchase.industrySelect));
             sessionStorage.setItem("endTime", JSON.stringify(purchase.endTime))
             sessionStorage.setItem("vipSub_read", true);
+
+            // 以下为2021/5/20修改 缓存是否是试用用户、计价列表、老套餐
+            sessionStorage.setItem("vipSub_isTrial", r.data.isTrial);
+            sessionStorage.setItem("vipSub_renewList", JSON.stringify(r.data.renewList))
+            sessionStorage.setItem("vipSub_oldBuySet", JSON.stringify(r.data.buyset))
+            purchase.isTrial = r.data.isTrial
+            purchase.renewList = r.data.renewList
+            purchase.oldBuySet = r.data.buyset
           }
         }, false)
       }
@@ -53,6 +64,16 @@ var purchase = {
         // console.log("ggggg", sessionStorage.getItem("vipSubSelectTime"))
         this.timeSelect = JSON.parse(sessionStorage.getItem("vipSubSelectTime"));
       }
+      // 以下为2021-5-20修改
+      if (sessionStorage.getItem("vipSub_isTrial")) {
+        purchase.isTrial = sessionStorage.getItem("vipSub_isTrial")
+      }
+      if (sessionStorage.getItem("vipSu(b_renewList")) {
+        purchase.renewList = JSON.parse(sessionStorage.getItem("vipSub_renewList"))
+      }
+      if (sessionStorage.getItem("vipSub_oldBuySet")) {
+        purchase.oldBuySet = JSON.parse(sessionStorage.getItem("vipSub_oldBuySet"))
+      }
 
       //加载价格
       $DoPost("/subscribepay/vipsubscribe/getPrice", {}, function (r) {
@@ -92,10 +113,13 @@ var purchase = {
       console.log(e)
     }
     this.nowBuyset = getBuySet(purchase.areaSelect, purchase.industrySelect, this.price);
+    var old = this.oldBuySet
+    //初始化 非试用用户 已经购买了 1个省份 两个省份【1个城市、两个城市】 3个行业 非升级版超级订阅
+    Calculation.Init(this.isTrial,new Buyset(old.areacount, old.newcitys, old.buyerclasscount,old.upgrade),this.renewList, undefined, this.endTime)
   },
   showArea: function () {
     if (!$.isEmptyObject(this.areaSelect) && !this.areaSelect["一个省"]) { //有选择
-      if (this.nowBuyset.areacount === -1) {
+      if (this.nowBuyset.areacount === -1 || this.nowBuyset.areacount >= 16) {
         $(".area-result .item-r").text("全国");
       } else {
         var tipTxt = "";
@@ -147,9 +171,7 @@ var purchase = {
     if (this.timeSelect[1] === 1) {
       tmp += "年";
       $("#yearly").prop('checked', true);
-      //$('.year_number:eq(' + (this.timeSelect[0] - 1) + ')').trigger("click");
       $('.year_number:eq(' + (this.timeSelect[0] - 1) + ')').addClass("active")
-      //$(".number_box:eq(1)").addClass("active");
     } else {
       tmp += "个月";
       $("#monthly").prop('checked', true);
@@ -167,10 +189,17 @@ var purchase = {
     this.timeValue = tmp;
   },
   flushPrice: function (time, flag) {
-    //var price = getsubVipOrderPrice(this.areaSelect, this.industrySelect, time, this.price);
     var times = [time[0], time[1]];
-    var price = getsubVipOrderPriceBybuyset(this.nowBuyset, time);
-    var givePrice = getsubVipOrderPriceBybuyset(this.nowBuyset, [time[1] === 1 ? 1 :time[0], time[1]]);
+    // var price = getsubVipOrderPriceBybuyset(this.nowBuyset, time);
+    // var givePrice = getsubVipOrderPriceBybuyset(this.nowBuyset, [time[1] === 1 ? 1 :time[0], time[1]]);
+
+    var obj = this.nowBuyset
+    console.log(obj, 'obj')
+    var price = Calculation.GetUpgradeDetail(new Buyset(obj.areacount,[],obj.buyerclasscount,1), time)
+    var givePrice = Calculation.GetUpgradeDetail(new Buyset(obj.areacount,[],obj.buyerclasscount,1), [time[1] === 1 ? 1 : time[0], time[1]])
+    console.log(typeof price,price, 'price')
+    price = price[0] / 100
+
     var showPrice = formatMoney(price);
     var nowTime = new Date().getTime();
     var startTime = live20200707.startTime;
@@ -272,8 +301,8 @@ var purchase = {
 $(function () {
   purchase.initData();
   purchase.showArea();
-  purchase.showIndustry();
-  purchase.showPrice();
+  // purchase.showIndustry();
+  // purchase.showPrice();
   purchase.showTime();
   // purchase.showTip(); // 2021-5-20
   purchase.flushPrice(purchase.timeSelect);

+ 151 - 0
src/web/templates/common/commonRules.html

@@ -0,0 +1,151 @@
+<style>
+  .vip-rights{
+    padding: 0 .3rem;
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    text-align: center;
+    font-size: .26rem;
+    color: #5F5E64;
+  }
+  .rights-item{
+    padding: .32rem .28rem;
+  }
+  .rights-title{
+    margin-bottom: 0.08rem;
+    text-align: left;
+    color: #171826;
+    font-size: .28rem;
+    line-height: .4rem;
+  }
+  .rights-content{
+    color: #5f5e64;
+    font-size: .24rem;
+    line-height: .36rem;
+    text-align: left;
+  }
+  .table{
+    margin-bottom: .32rem;
+    width: 100%;
+    border-collapse: collapse;
+  }
+  .table_title {
+    margin-bottom: .3rem;
+    margin-top: .3rem;
+    text-align: left;
+    font-size: .3rem;
+  }
+  .b-line {
+    position: relative;
+    margin-left: .18rem;
+    font-size: .3rem;
+    color: #171826;
+  }
+  .b-line:before {
+    content: '';
+    position: absolute;
+    left: -0.18rem;
+    top: 50%;
+    width: .06rem;
+    height: .32rem;
+    background-color: #2ABED1;
+    transform: translateY(-50%);
+    border-radius: .06rem;
+  }
+  .table td{
+    border: 1px solid #E5E5E5
+  }
+</style>
+<div class="vip-rights">
+  <table class="table">
+    <caption class="table_title b-line">超级订阅2.0版专属权益</caption>
+    <tr>
+      <td class="rights-item" colspan="2">
+        <p class="rights-title">超级订阅</p>
+        <p class="rights-content">300组关键词订阅,获取招标信息更全面。</p>
+      </td>
+    </tr>
+    <tr>
+      <td class="rights-item" colspan="2">
+        <p class="rights-title">更全信息</p>
+        <p class="rights-content">每天可接收2000条订阅地区的实时招标、采购、中标信息</p>
+      </td>
+    </tr>
+    <tr>
+      <td class="rights-item" colspan="2">
+        <p class="rights-title">企业画像</p>
+        <p class="rights-content">对企业进行全景透视,提供企业基本信息,中标项目分析、重点客户等,帮你挖掘销售线索。</p>
+      </td>
+    </tr>
+    <tr>
+      <td class="rights-item" colspan="2">
+        <p class="rights-title">企业搜索</p>
+        <p class="rights-content">搜索全国超七千万企业,获取企业情报信息,全方位监控竞争对手或用户关注的企业。</p>
+      </td>
+    </tr>
+    <tr>
+      <td class="rights-item" colspan="2">
+        <p class="rights-title">中标企业联系方式</p>
+        <p class="rights-content">招标公告与国家企业公示2种提取模式,让你直面企业。</p>
+      </td>
+    </tr>
+    <tr>
+      <td class="rights-item" colspan="2">
+        <p class="rights-title">项目匹配</p>
+        <p class="rights-content">智能匹配项目信息,为你推送所匹配项目后续的全部动态。</p>
+      </td>
+    </tr>
+    <tr>
+      <td class="rights-item" colspan="2">
+        <p class="rights-title">标题+全文匹配</p>
+        <p class="rights-content">关键词匹配标题或全文任你选,精准推送,随时获取你最需要的招标项目。</p>
+      </td>
+    </tr>
+    <tr>
+      <td class="rights-item" colspan="2">
+        <p class="rights-title">数据周报\月报</p>
+        <p class="rights-content">根据为您推送的招标项目信息,提供周报/月报,助您掌握最新市场动态。 更多升级功能即将上线,敬请期待!</p>
+      </td>
+    </tr>
+  </table>
+  <table class="table">
+    <caption class="table_title b-line">开通超级订阅2.0版,解锁以下20项权限</caption>
+    <tr>
+      <td class="rights-item" colspan="2">
+        <p class="rights-title">信息权益</p>
+        <p class="rights-content">采购项目商机、全国中标信息、企业联系方式、拟建项目信息</p>
+      </td>
+    </tr>
+    <tr>
+      <td class="rights-item" colspan="2">
+        <p class="rights-title">服务权益</p>
+        <p class="rights-content">企业库 项目库 企业监控 项目监控 大数据专项服务</p>
+      </td>
+    </tr>
+    <tr>
+      <td class="rights-item" colspan="2">
+        <p class="rights-title">数据服务</p>
+        <p class="rights-content">
+          中标信息统计<br>
+          项目动态<br> 
+          年度项目统计<br> 
+          月度中标金额统计<br> 
+          市场区域分布<br> 
+          各类客户平均折扣率<br> 
+          重点客户分析<br> 
+          客户类型分布
+        </p>
+      </td>
+    </tr>
+    <tr>
+      <td class="rights-item" colspan="2">
+        <p class="rights-title">专项查询</p>
+        <p class="rights-content">
+          企业基本信息<br> 
+          企业主要人员<br> 
+          企业联系方式
+        </p>
+      </td>
+    </tr>
+  </table>
+</div>

+ 5 - 9
src/web/templates/weixin/vipsubscribe/vip_UpgradePage.html

@@ -36,10 +36,10 @@
   <div class="vip-upgrade">
     <div class="vip-header"></div>
     <div class="vip-body">
-      <div class="j-notice-bar bar-red vip-bar" style="text-align: center;">限时续费,3个月起,续多久送多久!</div>
+      <!-- <div class="j-notice-bar bar-red vip-bar" style="text-align: center;">限时续费,3个月起,续多久送多久!</div> -->
       <ul style="padding: .16rem .24rem;">
           <li class="body-item area-industry">
-            <a class="item-container" href="/front/vipsubscribe/toChooseArea">
+            <a class="item-container" href="/front/vipsubscribe/toChooseArea?header=upgrade">
               <div class="item area">
                 <span class="item-l">省份数量</span>
                 <span class="iconfont icon-arrow"></span>
@@ -87,13 +87,8 @@
           </div>
         </li>
       </ul>
-      <!-- 超级订阅专属权益 -->
-      <div class="rights">
-        <div class="rights-title">
-          <span class="title-line"></span>
-          <span>超级订阅专属权益</span>
-        </div>
-      </div>
+      <!-- 超级订阅专属权益 封装为公共页面-->
+      {{include "/common/commonRules.html"}}
     </div>
     <!-- vue组件 -->
     <div class="vip-footer renew" id="coupon-vue">
@@ -359,6 +354,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/price.js?v={{Msg "seo" "version"}}"></script>
   <script src='{{Msg "seo" "cdn"}}/common-module/coupon/js/pay-order-template.js?v={{Msg "seo" "version"}}'></script>
   {{include "/common/weixin.html"}}
   <script>

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

@@ -63,6 +63,18 @@
     .banner-ad-box .iconfont.icon-arrow {
         color: #fff;
     }
+    .update-tips {
+      padding: .14rem .32rem;
+      background: #fff4e8;
+      color: #ff9f40;
+      font-size: .26rem;
+      text-align: center;
+    }
+
+    .j-button-confirm {
+      flex: none;
+      border-radius: 0.08rem;
+    }
     </style>
 </head>
 
@@ -77,14 +89,14 @@
       <div class="super-navbar">
         <!-- 占位 -->
         <div></div>
-        <div class="super-status">
+        <div class="super-status" style="top: .26rem;">
           <span class="try-seven">试用7天</span>
           <span class="super-title">超级订阅</span>
         </div>
-        <div class="super-handle">
+        <!-- <div class="super-handle">
           <a href="/front/vipsubscribe/vipsubscribe_new" class="trail" style="display: none;">去购买</a>
           <a href="/front/vipsubscribe/vipsubscribe_renew" class="renew" style="display: none;">续费</a>
-        </div>
+        </div> -->
       </div>
     </div>
     <ul class="vip-body">
@@ -327,7 +339,15 @@
       </div>
     </div>
     <!-- 升级 -->
-    <div class="vip-footer upgrade" id="coupon-vue">
+    <!-- 升级 -->
+    <div class="update_renew">
+      <div class="update-tips">因系统升级,已购买用户可选择原套餐续费,或升级到新版本享受更多权益。</div>
+      <div class="footer-button-group j-button-group">
+        <button class="j-button-confirm" data-bind-renew>续费</button>
+        <button class="j-button-confirm" data-bind-update>升级</button>
+      </div>
+    </div>
+    <div class="vip-footer upgrade" id="coupon-vue" style="display: none;">
       <pay-order-template ref="couponRef" :config="$data" @update="updateS" @cancel="cancelEvent"></pay-order-template>
     </div>
     <!-- <div class="vip-footer upgrade">
@@ -669,7 +689,15 @@
 		startTime: {{.T.liveActiveStartTime}},
 		endTime: {{.T.liveActiveEndTime}},
 	    activeDiscount: {{.T.activeDiscount}}
-	}
+  }
+  // 跳转到续费页面
+  $('*[data-bind-renew]').on('click',function() {
+    location.href = '/front/vipsubscribe/vipsubscribe_renew'
+  })
+  // 直接跳转到升级页面
+  $('*[data-bind-update]').on('click',function() {
+    location.href = '/front/vipsubscribe/upgradePage'
+  })
 </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>

+ 14 - 7
src/web/templates/weixin/vipsubscribe/vip_purchase.html

@@ -92,7 +92,7 @@
                 <ul class="chooseList">
                     <li class="choose_item">
                         <a href="/front/vipsubscribe/toChooseArea">
-                            <span class="label">区域</span>
+                            <span class="label">省份数量</span>
                             {{if not .T.isTrial }}
                                 <input type="text" disabled value="" placeholder="1个市"
                                        class="info choose_area">
@@ -105,7 +105,7 @@
                         <!-- 无选择时不显示 -->
                         <p class="add_tips area" style="display:none">已选择 0 个省级区域、0 个地市</p>
                     </li>
-                    <li class="choose_item">
+                    <li class="choose_item" style="display: none;">
                         <a href="/front/vipsubscribe/toChooseIndustry">
                             <span class="label" style="white-space: nowrap;">采购单位行业</span>
                             {{if not .T.isTrial }}
@@ -172,7 +172,9 @@
                           </label>
                       </div>
                     -->
-                    <div class="vip_prise_table">
+                    <!-- 超级订阅专属权益 封装为公共页面-->
+                    {{include "/common/commonRules.html"}}
+                    <div class="vip_prise_table" style="display: none;">
                         <table class="monthly">
                             <caption class="table_title b-line">超级订阅价格</caption>
                             <tr>
@@ -439,6 +441,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='{{Msg "seo" "cdn"}}/js/check-bind-phone.js?v={{Msg "seo" "version"}}'></script>-->
+        <script src="/vipsubscribe/js/price.js?v={{Msg "seo" "version"}}"></script>
         <script src=//cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js></script>
         <script src='{{Msg "seo" "cdn"}}/common-module/coupon/js/pay-order-template.js?v={{Msg "seo" "version"}}'></script>
         {{include "/common/weixin.html"}}
@@ -762,12 +765,13 @@
                         //加载价格
                         $DoPost("/subscribepay/vipsubscribe/getPrice", {}, function (r) {
                             if (r) {
-                                purchase.price = r;
+                                purchase.price = r.new;
                                 // if (r.isActiving && r.isWritten === 0) {
                                 //     showGiveStatus(true)
                                 // } else {
                                 //     showGiveStatus(false)
                                 // }
+                                Calculation.Init(false, undefined, [], 0)
                             }
                         }, false)
                     } catch (e) {
@@ -869,9 +873,12 @@
                         $('.now-price .dis-price').text('0.00');  // 优惠明细
                         coupon.updatePrice(0)
                     } else {
-                        var price = getsubVipOrderPriceBybuyset(this.nowBuyset, time);
-                        var givePrice = getsubVipOrderPriceBybuyset(this.nowBuyset, [time[1] === 1 ? 1 : time[0], time[1]]);
-                        //var price = getsubVipOrderPrice(this.areaSelect, this.industrySelect, time, this.price);
+                        // var price = getsubVipOrderPriceBybuyset(this.nowBuyset, time);
+                        // var givePrice = getsubVipOrderPriceBybuyset(this.nowBuyset, [time[1] === 1 ? 1 : time[0], time[1]]);
+                        var obj = this.nowBuyset
+                        var price = Calculation.GetTotal(new Buyset(obj.areacount,[],obj.buyerclasscount, 1),time)
+                        var givePrice = Calculation.GetTotal(new Buyset(obj.areacount,[],obj.buyerclasscount, 1),[time[1] === 1 ? 1 :time[0], time[1]])
+                        price = (price / 100)
                         var showPrice = formatMoney(price);
 
                         if (flag === 1) {