Browse Source

Merge branch 'dev4.5' of http://192.168.3.207:8080/qmx/jy into dev4.5

zhangyuhan 4 years ago
parent
commit
aed068e69d

+ 18 - 16
src/jfw/modules/app/src/web/staticres/jyapp/js/historypush.js

@@ -27,24 +27,28 @@ var vm = new Vue({
       screenShow: false
     }
   },
+  created () {
+    this.getUserRoot()
+  },
   methods: {
     // 判断是否是有筛选条件
     getUserRoot: function() {
+      let _this = this
       $.ajax({
         url: '/publicapply/bidcoll/power',
         type: 'POST',
         success: function(res) {
           console.log(res)
           if(res.data) {
-            this.screenShow = true
+            _this.screenShow = true
           } else {
-            this.screenShow = false
+            _this.screenShow = false
           }
         }
       })
     },
     confirm: function(data){
-      console.log(data)
+      this.setToggle()
       if(data.name === 'dateItem'){
         if ((data.data.start / 1000).toFixed(0) == 0 && (data.data.end / 1000).toFixed(0) == 0) {
           this.time = ''
@@ -55,53 +59,51 @@ var vm = new Vue({
         } else {
           this.time = (data.data.start / 1000).toFixed(0) + '_' + (data.data.end / 1000).toFixed(0)
         }
-        this.$refs.dateItem.toggle()
         FTAGData(this.time)
         return
       } else if(data.name === 'areaItem'){
-        this.$refs.areaItem.toggle()
         this.area = data.data.join('、')
       } else if(data.name === 'industryItem'){
-        this.$refs.industryItem.toggle()
         this.subscopeclass = data.data.join(',')
       } else if(data.name === 'cateItem'){
-        this.$refs.cateItem.toggle()
         this.buyerclass = data.data.join(',')
       } else if(data.name === 'keywordItem'){
         this.$refs.keywordItem.toggle()
-        this.key = data.data.join(',')
       } else if(data.name === 'noticeItem'){
-        this.$refs.noticeItem.toggle()
         this.subtype = data.data.join(',')
+      } else if(data.name === 'rootItem'){
+        location.href = '/jyapp/vipsubscribe/introducePage'
       }
       this.getAjaXParams()
     },
     cancel: function(data){
       console.log(data)
       if(data.name === 'dateItem'){
-        this.$refs.dateItem.toggle()
         firstTime = (data.data.start / 1000).toFixed(0) + '_' + (data.data.end / 1000).toFixed(0)
-        // this.time = data.data
         initpage()
       } else if(data.name === 'areaItem'){
-        this.$refs.areaItem.toggle()
         // this.area = data.data.join('、')
       } else if(data.name === 'industryItem'){
-        this.$refs.industryItem.toggle()
         // this.subscopeclass = data.data.join(',')
       } else if(data.name === 'cateItem'){
-        this.$refs.cateItem.toggle()
         // this.subscopeclass = data.data.join(',')
       } else if(data.name === 'keywordItem'){
-        this.$refs.keywordItem.toggle()
         // this.subscopeclass = data.data.join(',')
       } else if(data.name === 'noticeItem'){
-        this.$refs.noticeItem.toggle()
         // this.subscopeclass = data.data.join(',')
       }
+      this.setToggle()
     },
     getAjaXParams: function() {
       ajaxFun(this.time, this.area, this.subscopeclass, this.buyerclass, this.key, this.subtype)
+    },
+    setToggle: function() {
+      this.$refs.dateItem.toggle(false)
+      this.$refs.areaItem.toggle(false)
+      this.$refs.industryItem.toggle(false)
+      this.$refs.cateItem.toggle(false)
+      this.$refs.keywordItem.toggle(false)
+      this.$refs.noticeItem.toggle(false)
     }
   }
 })

+ 1 - 0
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/price.js

@@ -40,6 +40,7 @@ var Calculation = {
                 "oneProvince_allBuyerClass": 3800,
                 "allProvince_allBuyerClass": 59900
             },
+            "quarter": {oneProvince_allBuyerClass: 9900, allProvince_allBuyerClass: 149900},
             "year": {
                 "oneProvince_allBuyerClass": 38000,
                 "allProvince_allBuyerClass": 599900

+ 4 - 0
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/vip_index_new.js

@@ -55,6 +55,10 @@ function getNewYearMarketing () {
 //     }
 // });
 $(function () {
+  // 清除商品规格当前选择
+  sessionStorage.removeItem("vip-cur-select-size")
+  // 清除商品优惠券当前选择
+  sessionStorage.removeItem("vip-cur-select-coupon")
   var $dialog;
   /* vue 代码 start 提交订单 */
   /* 

+ 117 - 13
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/vip_renew.js

@@ -37,16 +37,23 @@ var renew = {
             result.area = '全国'
         } else {
             var strArr = []
-            if (buySet.areacount) {
+            if (buySet.upgrade == 1) {
+              if (buySet.areacount) {
+                strArr.push(buySet.areacount + '')
+              }
+            } else {
+              if (buySet.areacount) {
                 strArr.push(buySet.areacount + '个省')
+              }
+              if (buySet.newcitys && buySet.newcitys.length !== 0) {
+                  var count = 0
+                  buySet.newcitys.forEach(function (item) {
+                      count += item
+                  })
+                  strArr.push(count + '个市(分布在' + buySet.newcitys.length + '个省内')
+              }
             }
-            if (buySet.newcitys && buySet.newcitys.length !== 0) {
-                var count = 0
-                buySet.newcitys.forEach(function (item) {
-                    count += item
-                })
-                strArr.push(count + '个市(分布在' + buySet.newcitys.length + '个省内')
-            }
+            
             result.area = strArr.join('、')
         }
 
@@ -88,6 +95,17 @@ var renew = {
                             _this.buyInfo.buyset.upgrade || 0
                         )
                     )
+                    // 新超级订阅续费
+                    if (r.data.buyset.upgrade == 1) {
+                      $("[data-new-vip]").show()
+                      $("[data-old-vip]").hide()
+                      if (_this.buyInfo.buyset.areacount == -1) {
+                        goodsSize.props.areaCount = 16
+                      } else {
+                        goodsSize.props.areaCount = _this.buyInfo.buyset.areacount
+                      }
+                      
+                    }
                     // 初始化默认金额
                     _this.setPrice(_this.calcPrice())
                 }
@@ -101,7 +119,9 @@ var renew = {
             type: 'POST',
             success: function (r) {
                 if (r) {
-                    _this.requestRules = r
+                  _this.requestRules = r
+                  // 将价格列表传至商品规格组件
+                  goodsSize.props.priceInfo = r.new
                 }
             }
         })
@@ -113,7 +133,23 @@ var renew = {
     // 设置价格
     setPrice: function (price) {
         this.price = parseInt(price)
-        coupon.updatePrice(this.price / 100)
+        var size = JSON.parse(sessionStorage.getItem('vip-cur-select-size')) 
+        console.log(renew.buyInfo.buyset)
+        var count = renew.buyInfo.buyset.areacount == -1 ? 16 : renew.buyInfo.buyset.areacount
+        if (this.buyInfo.buyset.upgrade == 1) {
+          // 新规则初始化价格
+          if (size) {
+            // 初始化上次选择的商品规格
+            coupon.updatePrice(size.price / 100)
+          } else {
+            // 初始化默认一个月*省份数量
+            coupon.updatePrice(3800*count / 100)
+          }
+        } else {
+          // 旧规则初始化价格
+          coupon.updatePrice(this.price / 100)
+        }
+        // coupon.updatePrice(this.price / 100)
     },
     // 根据选中结果得到续费了多长时间的字符串
     getDuration: function (timeSelect) {
@@ -281,18 +317,30 @@ var renew = {
             _this.setPrice(_this.calcPrice())
             _this.saveState()
         })
-
         $('.vip-footer.renew .confirm').on('click', function () {
+          var upgrade = renew.buyInfo.buyset.upgrade
+          var size = goodsSize.defaultSize
+          var sizeTime = ''
+          if (size && size.period) {
+            if(size.period.indexOf('月') > -1) {
+              size.period = size.period.replace('月', '个月')
+            }
+            sizeTime = size.period
+          } else {
+            sizeTime = '1个月'
+          }
+          console.log(upgrade,sizeTime, '新or老')
             $('.vip-footer.renew .confirm').prop('disabled', true)
             //支付请求
             var data = {
                 userLotteryId :coupon.$refs.couponRef.coupon.userLotteryId,
                 lotteryId : coupon.$refs.couponRef.coupon.lotteryId,
-                time : _this.getDuration(_this.timeSelect).trim(),
+                time : upgrade == 0 ? _this.getDuration(_this.timeSelect).trim() : sizeTime,
                 orderType: 5,
                 disWord :GetQueryString('disWord'),
-                price: _this.price
+                price: coupon.initPrice*10000/100
             }
+            console.log(data, '提交参数')
             $.ajax({
                 // url: '/subscribepay/vipsubscribe/createOrder',
                 url: '/subscribepay/vipsubscribe/renew',
@@ -485,6 +533,8 @@ function clearSessionStorage() {
     sessionStorage.removeItem("pay_read_cache")
     sessionStorage.removeItem("liveActiveCode_renew");
     sessionStorage.removeItem("liveActiveCode_new");
+    // 清除商品规格当前选择
+    sessionStorage.removeItem("vip-cur-select-size")
 }
 function showToast(text) {
     weui.toast(text, {
@@ -506,6 +556,60 @@ function pickerShow(selector, f) {
     }
 }
 /* vue 代码 start */
+// vip商品规格
+var goodsSize = new Vue({
+  el:'#goods-size-vue',
+  data: function() {
+    return {
+      props: {
+        defaultSize: {},
+        areaCount: 1,
+        priceInfo: {}
+      }
+    }
+  },
+  created () {
+    
+  },
+  mounted () {
+    this.getSizeStorage()
+  },
+  methods: {
+    // 父组件传省份数量至子组件
+    getAreaCount: function() {
+      var areaStorage = JSON.parse(sessionStorage.getItem('vipSubSelectArea'))
+      console.log(renew.buyInfo.buyset.areacount)
+      if (areaStorage) {
+        var count = 0
+        for (var key in areaStorage) {
+          if (key.indexOf('全国') > -1) {
+            count = 16
+          } else {
+            count++
+          }
+        }
+        this.props.areaCount = count
+      }
+    },
+    getSizeStorage: function() {
+      // 恢复商品规格选择
+      var size = JSON.parse(sessionStorage.getItem('vip-cur-select-size')) 
+      console.log(size, '恢复的商品规格')
+      if (size) {
+        this.$refs.goodsSize.goodsActive = size.index
+        this.defaultSize = size
+        this.$nextTick(function(){
+          coupon.updatePrice(size.price/100)
+        })
+      }
+    },
+    getGoodSize: function(data) {
+      console.log(data, '父组件接收子组件传来的商品规格')
+      this.defaultSize = data
+      coupon.updatePrice(data.price/100)
+    }
+  }
+})
 var coupon = new Vue({ 
   el: '#coupon-vue',
   data: function () {

+ 0 - 15
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/vip_upgrade.js

@@ -649,21 +649,6 @@ function pickerShow (selector, f) {
   }
 }
 /* vue 代码 start */
-var goodsSize = new Vue({
-  el:'#goods-size-vue',
-  data: function() {
-    return {}
-  },
-  mounted () {},
-  methods: {
-    getGoodSize: function(data) {
-      console.log(data, '父组件接收子组件传来的商品规格')
-    },
-    getAutoRenew: function(data) {
-      console.log(data, '父组件接收子组件传来的是否开启自动续费')
-    }
-  }
-})
 var coupon = new Vue({
   el: '#coupon-vue',
   data: function () {

+ 0 - 6
src/jfw/modules/app/src/web/templates/vipsubscribe/vip_UpgradePage.html

@@ -17,7 +17,6 @@
   <link rel="stylesheet" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/vipsubscribe/css/vip_upgrade.css?v={{Msg "seo" "version"}}'>
   <link rel="stylesheet" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/local/layout.css' />
   <link rel="stylesheet" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/css/font.css?v={{Msg "seo" "version"}}' />
-  <link rel="stylesheet" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/vipsubscribe/css/vip-size-template.css?v={{Msg "seo" "version"}}' />
   <link rel="stylesheet" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/coupon/css/pay-order-template.css?v={{Msg "seo" "version"}}' />
   <style>
     .vip-header {
@@ -92,10 +91,6 @@
             </a>
           </li>
         </ul>
-        <!-- 商品规格 -->
-        <div id="goods-size-vue">
-          <vip-size-template @select-vip-size="getGoodSize" @select-auto-renew="getAutoRenew"></vip-size-template>
-        </div>
         <!-- 超级订阅专属权益 封装为公共页面-->
         {{include "/vipsubscribe/commonRules.html"}}
       </div>
@@ -206,7 +201,6 @@
   <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/vipsubscribe/js/vip-size-template.js?v={{Msg "seo" "version"}}'></script>
   <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/coupon/js/pay-order-template.js?v={{Msg "seo" "version"}}'>
   </script>
   <script>

+ 127 - 37
src/jfw/modules/app/src/web/templates/vipsubscribe/vip_purchase.html

@@ -4,7 +4,7 @@
 <head>
   <meta charset="utf-8">
   <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
-  <title>超级订阅</title>
+  <title>开通超级订阅</title>
   <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/local/rem.js'></script>
   <link rel="stylesheet" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/vipsubscribe/css/base.css?v={{Msg "seo" "version"}}'/>
   <link rel="stylesheet" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/local/weui.min.css'>
@@ -66,13 +66,26 @@
     text-align: left;
     margin-top: 2px;
   }
+  .area-result{
+    /* width:1.2rem; */
+    height: .38rem;
+    padding: 0 .16rem;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    background: #2abed1;
+    border: 1px solid #2abed1;
+    border-radius: 41px;
+    font-size: .22rem;
+    color: #fff;
+  }
   </style>
   <!--E-手机号输入样式-->
 </head>
 <body  data-weui-theme="light">
   <div class="app-layout-header jy-app-header" style="z-index: 8;">
     <span class="app-back jyapp-icon jyapp-icon-zuojiantou"></span>
-    超级订阅{{if not .T.isTrial }}{{else}}(试用){{end}}
+    开通超级订阅{{if not .T.isTrial }}{{else}}(试用){{end}}
     <span></span>
   </div>
   <div class="app-layout-content-b">
@@ -99,14 +112,23 @@
         <div class="choose_condition">
             <ul class="chooseList">
               <li class="choose_item">
-                <a href="/jyapp/vipsubscribe/toChooseArea">
-                  <span class="label">省份数量</span>
-                  {{if not .T.isTrial }}
-                    <input type="text" disabled value="" placeholder="1个省" class="info choose_area">
-                  {{else}}
-                    <input type="text" disabled value="" placeholder="选择全国、省份、地市" class="info choose_area">
-                  {{end}}
-                  <i class="iconfont icon-arrow"></i>
+                <a href="javascript:;" onclick="toChooseArea()">
+                  <div style="display: flex;align-items: center;flex: 1;">
+                    <span class="label">省份数量</span>
+                    <div class="area-result">
+                      {{if not .T.isTrial }}
+                      <input type="hidden" disabled value="" placeholder="1个省" class="info choose_area">
+                      <span class="area-result-text"></span>
+                      {{else}}
+                        <input type="hidden" disabled value="" placeholder="选择全国、省份、地市" class="info choose_area">
+                        <span class="area-result-text"></span>
+                      {{end}}
+                    </div>
+                  </div>
+                  <div style="display: flex;align-items: center;">
+                    <em style="color: #9B9CA3;font-size: .28rem;">选择</em>
+                    <i class="iconfont icon-arrow"></i>
+                  </div>
                 </a>
                 <p class="add_tips area_warn" style="display: none;">请选择区域</p>
                 <!-- 无选择时不显示 -->
@@ -145,11 +167,11 @@
             </ul>
             <!-- 商品规格 -->
             <div id="goods-size-vue">
-              <vip-size-template @select-vip-size="getGoodSize" @select-auto-renew="getAutoRenew"></vip-size-template>
+              <goods-size-template ref="goodsSize" :config="props" @select-vip-size="getGoodSize"></goods-size-template>
             </div>
             <!-- 商品优惠券 -->
             <div id="goods-coupon-vue">
-              <vip-coupon-template></vip-coupon-template>
+              <goods-coupon-template ref="goodsCoupon" @update-coupon="updateCoupon"></goods-coupon-template>
             </div>
             <!-- <div class="pay_mode">
               {{if not .T.isTrial }}
@@ -628,41 +650,89 @@
           //试用用户
         {{end}}
 
+        // 跳转区域选择清除商品规格及优惠券选择
+        function toChooseArea() {
+          sessionStorage.removeItem('vip-cur-select-coupon')
+          sessionStorage.removeItem('vip-cur-select-size')
+          location.href = '/jyapp/vipsubscribe/toChooseArea'         
+        }
         /* vue 代码 start */
         // vip商品规格
         var goodsSize = new Vue({
           el:'#goods-size-vue',
           data: function() {
             return {
-
+              props: {
+                areaCount: 1,
+                priceInfo: {}
+              }
             }
           },
+          created () {
+            this.getAreaCount()
+          },
           mounted () {
-
+            this.getSizeStorage()
           },
           methods: {
+            // 父组件传省份数量至子组件
+            getAreaCount: function() {
+              var areaStorage = JSON.parse(sessionStorage.getItem('vipSubSelectArea'))
+              if (areaStorage) {
+                var count = 0
+                for (var key in areaStorage) {
+                  if (key.indexOf('全国') > -1) {
+                    count = 16
+                  } else {
+                    count++
+                  }
+                }
+                this.props.areaCount = count
+              }
+            },
+            getSizeStorage: function() {
+              // 恢复商品规格选择
+              var size = JSON.parse(sessionStorage.getItem('vip-cur-select-size')) 
+              if (size) {
+                this.$refs.goodsSize.goodsActive = size.index
+                this.$nextTick(function(){
+                  console.log(size.price, 'size.price')
+                  coupon.updatePrice(size.price/100)
+                  goodsCoupon.updatePrice(size.price/100)
+                })
+              }
+            },
             getGoodSize: function(data) {
               console.log(data, '父组件接收子组件传来的商品规格')
-            },
-            getAutoRenew: function(data) {
-              console.log(data, '父组件接收子组件传来的是否开启自动续费')
+              coupon.updatePrice(data.price/100)
+              goodsCoupon.updatePrice(data.price/100)
             }
           }
         })
-        // vip活动
         // vip优惠券
         var goodsCoupon = new Vue({
           el:'#goods-coupon-vue',
           data: function() {
             return {
-
+              curSelectCoupon: {}
             }
           },
-          mounted () {
-
-          },
+          mounted () {},
           methods: {
-            
+            updatePrice: function(data){
+              this.$refs.goodsCoupon.getCoupon(data)
+            },
+            updateCoupon: function(data) {
+              console.log(data, '更新优惠券选择')
+              this.curSelectCoupon = data
+              var curSize = JSON.parse(sessionStorage.getItem('vip-cur-select-size'))
+              // 更新优惠券选择同时更新订单组件的价格及优惠金额
+              if (curSize) {
+                coupon.updatePrice(curSize.price/100)
+              } else {
+                coupon.updatePrice(coupon.initPrice)
+              }
+            }
           }
         })
         // 订单提交
@@ -697,10 +767,17 @@
             // 更新价格相关
             updatePrice: function (before) {
               console.log( '原价:' + before)
+              var curCoupon = JSON.parse(sessionStorage.getItem('vip-cur-select-coupon'))
+              console.log(curCoupon, '当前选择的优惠券')
+              if (curCoupon) {
+                this.$refs.couponRef.coupon.value = curCoupon.reduce
+              } else {
+                this.$refs.couponRef.coupon.value = 0
+              }
               this.initPrice = before;
               // 调用子组件查询最优卡券
               if (!{{.T.isTrial }}) {
-                this.$refs.couponRef.getCoupon();
+                // this.$refs.couponRef.getCoupon();
               }
             },
             // 初始化及回显相关
@@ -843,6 +920,8 @@
                   //     showGiveStatus(false)
                   // }
                   Calculation.Init(false, undefined, [], 0)
+                  // 将价格列表传至商品规格组件
+                  goodsSize.props.priceInfo = r.new
                 }
               }, false)
               sessionStorage.removeItem("pay_read_cache");
@@ -854,23 +933,26 @@
           showArea: function () {
             if (!$.isEmptyObject(this.areaSelect) && !this.areaSelect["一个省"]) { //有选择
               if (this.nowBuyset.areacount === -1) {
-                $(".choose_area").val("全国");
+                $(".choose_area").val("已选: 全国");
+                $(".area-result-text").text("已选: 全国");
               } else {
-                var tipTxt = "已选 ";
-                if (this.nowBuyset.areacount > 0) tipTxt += this.nowBuyset.areacount + " 个省";
+                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 + "个省内)"
-                }
+                // 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);
+                $(".area-result-text").text(tipTxt);
               }
             } else {
               $(".choose_area").val("");
+              $(".area-result-text").text("");
               //是否勾选已阅读
               if (sessionStorage.getItem("vipSub_read") === "true") {
                 $(".area_warn").css("display", "");
@@ -952,7 +1034,6 @@
                 // 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')
                 obj.areacount = obj.areacount == 0 ? 1 : obj.areacount
                 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]])
@@ -975,7 +1056,11 @@
                   $('.discount-price .dis-price').text(formatMoney(givePrice))
                 }
                 console.log(price, '计算的价格')
-                coupon.updatePrice(price)
+                var size = JSON.parse(sessionStorage.getItem('vip-cur-select-size')) 
+                if (!size) {
+                  coupon.updatePrice(price)
+                  goodsCoupon.updatePrice(price)
+                }
               }
             }
         };
@@ -986,6 +1071,7 @@
           purchase.showIndustry();
           purchase.showPrice();
           purchase.showTime();
+          console.log(purchase.timeSelect, 'purchase.timeSelect')
           purchase.flushPrice(purchase.timeSelect);
           checkOk();
           var time_limit;//定义一个周期变量
@@ -1180,7 +1266,7 @@
           $("input").bind("input propertychange change", function (event) {
             checkOk();
           });
-          console.log(coupon.$refs.couponRef.coupon, '用户优惠券id')
+          // console.log(coupon.$refs.couponRef.coupon, '用户优惠券id')
           $('#payHandle').click(function () {
             $("#payHandle").attr("disabled", "disabled");
             //支付请求
@@ -1202,8 +1288,8 @@
             }
             //付费用户
             var param = {
-              "userLotteryId":coupon.$refs.couponRef.coupon.userLotteryId,
-              "lotteryId": coupon.$refs.couponRef.coupon.lotteryId,
+              "userLotteryId":goodsCoupon.curSelectCoupon.userLotteryId,
+              "lotteryId": goodsCoupon.curSelectCoupon.lotteryId,
               "area": JSON.stringify(area),
               // "industry": industry.join(","),
               "time": $(".info:eq(2)").val().trim(),
@@ -1304,6 +1390,10 @@
 
           sessionStorage.removeItem("pay_read_cache");
           sessionStorage.removeItem("liveActiveCode_purchase");
+          // 清除商品规格当前选择
+          sessionStorage.removeItem("vip-cur-select-size")
+          // 清除商品优惠券当前选择
+          sessionStorage.removeItem("vip-cur-select-coupon")
         }
 
         /******* 获取url参数(正则)********/

+ 52 - 2
src/jfw/modules/app/src/web/templates/vipsubscribe/vip_renew.html

@@ -17,6 +17,7 @@
     <link rel="stylesheet" type="text/css" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/vipsubscribe/css/vip_renew.css?v={{Msg "seo" "version"}}'>
     <link rel="stylesheet" type="text/css" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/local/layout.css'/>
     <link rel="stylesheet" type="text/css" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/css/font.css?v={{Msg "seo" "version"}}'/>
+    <link rel="stylesheet" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/vipsubscribe/css/vip-size-template.css?v={{Msg "seo" "version"}}' />
     <link rel="stylesheet" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/coupon/css/pay-order-template.css?v={{Msg "seo" "version"}}' />
     <style>
         .vip-header {
@@ -33,6 +34,41 @@
         button[disabled] {
             opacity: .5;
         }
+        .area-result{
+          position: relative;
+          padding: .3rem .32rem;
+          display: flex;
+          align-items: center;
+          background-color: #fff;
+        }
+        .area-result::after{
+          position: absolute;
+          box-sizing: border-box;
+          content: ' ';
+          pointer-events: none;
+          right: 0;
+          bottom: 0;
+          left: .32rem;
+          border-bottom: 1px solid #f5f5f5;
+          -webkit-transform: scaleY(0.7);
+          transform: scaleY(0.7);
+        }
+        .a-r-label{
+          margin-right: 0.08rem;
+          font-size: .32rem;
+          color: #171826;
+        }
+        .a-r-val{
+          height: .38rem;
+          padding: 0 .16rem;
+          display: flex;
+          align-items: center;
+          background: #2abed1;
+          border: 1px solid #2abed1;
+          border-radius: 41px;
+          font-size: .22rem;
+          color: #fff;
+        }
     </style>
 </head>
 <body class="no-touch"  data-weui-theme="light">
@@ -52,8 +88,18 @@
             <span class="header-right">您的超级订阅服务即将到期,为不影响您的使用。请立即续费</span>
         </div>
         <div class="vip-body">
+          <div class="area-result" data-new-vip style="display: none;">
+            <div class="item area" style="display: flex;align-items: center;">
+              <span class="item-l a-r-label">省份数量</span>
+              <span class="a-r-val"><span class="item-r"></span></span>
+            </div>
+          </div>
+          <!-- 商品规格 -->
+          <div id="goods-size-vue" data-new-vip style="display: none;">
+            <goods-size-template ref="goodsSize" :config="props" @select-vip-size="getGoodSize"></goods-size-template>
+          </div>
             <div class="j-notice-bar bar-red vip-bar" style="text-align: center;">限时续费,3个月起,续多久送多久!</div>
-            <ul style="padding: .16rem .24rem;">
+            <ul style="padding: .16rem .24rem;" data-old-vip>
                 <li class="body-item area-industry">
                     <div class="item-container">
                         <div class="item area">
@@ -102,13 +148,16 @@
                     </div>
                 </li>
             </ul>
-            <div class="tips">
+            <div class="tips" data-old-vip>
                 <div class="tip-title l-line">续费说明</div>
                 <div class="tip-content">
                     <div>1、仅支持原套餐延长周期续费,不支持套餐变更(含增加、减少、更改)原订阅的省份、城市、行业。 <br />续费费用=续费周期(按月/年)/原地区/原行业</div>
                     <div>2、套餐周期内,用户也可以选择升级超级订阅2.0版享受更多权益。</div>
                 </div>
             </div>
+            <div data-new-vip style="display: none;">
+              {{include "/vipsubscribe/commonRules.html"}}
+            </div>
         </div>
         <!-- vue组件 -->
         <div class="vip-footer" id="coupon-vue">
@@ -340,6 +389,7 @@
     <script src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/js/common.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/vipsubscribe/js/vip-size-template.js?v={{Msg "seo" "version"}}'></script>
     <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/coupon/js/pay-order-template.js?v={{Msg "seo" "version"}}'></script>
 	<script>
       $(window).bind("pageshow", function (event) {

+ 16 - 11
src/jfw/modules/app/src/web/templates/weixin/historypush.html

@@ -59,6 +59,12 @@
             height: .88rem;
             /* padding-left: 16px; */
         }
+        .app-layout-content-b .app-content::after{
+            content: '';
+            width: 100%;
+            height: 8px;
+            background: #F5F6F7;
+        }
     </style>
 </head>
 <body class="p13" id="viperSuper">
@@ -76,8 +82,8 @@
     </li>
     <li>
         <div class="tab_right">
-            <span class="report_book"></span>
             <div class="vip_report" style="display: none;">
+                <span class="report_book"></span>
                 <a></a>报告
             </div>
         </div>
@@ -87,13 +93,13 @@
 </div>
 {{include "/big-member/commonjs.html"}}
 <div class="app-layout-content-b">
-    <div class="app-content">
+    <div class="app-content" style="background:#fff">
       {{if and (not .T.isIosExam) (not .T.isIosExamPhone)}}
   		<div class="header_header" style="height: 60px;display:none;transition: all 0.1s;">
-  			<div class="only-personal" style="position: absolute;top: .2rem;left: 4%;background-image: url(/jyapp/vipsubscribe/image/entback.png?v=51430);background-size: 100%;background-repeat: no-repeat;border-radius: 8px;width: 92%;display: flex;align-items: center;justify-content: space-between;height: 44px;">
+  			<div class="only-personal" style="position: absolute;top: .35rem;left: 4%;background-image: url(/jyapp/vipsubscribe/image/entback.png?v=51430);background-size: 100%;background-repeat: no-repeat;border-radius: 8px;width: 92%;display: flex;align-items: center;justify-content: space-between;height: 44px;">
   				<img style="width: 20px;height: 20px; margin-left: .3rem;" src="/jyapp/vipsubscribe/image/vip-icon.png?v=1">
-  				<span  data-name="doubleEleven_title" style="color:#fff;font-weight: bold;font-size: 13px;text-align: left;">全国企业随手查,竞争实力尽展示!</span>
-  				<span  data-name="doubleEleven_button" class="switch_ext" id="app-historypush-vipSub-banner" style="border-radius: 32px;display: flex;flex-direction: row;padding: 3px 12px;font-size: 12px;color: #FAE7CA;margin-right: .2rem;background: linear-gradient(to bottom, #F1D090 0%, #FAE7CA 100%);color: #33323A;font-family: PingFang SC;font-size: 12px;line-height: 18px;letter-spacing: 0px;text-align: center;white-space: nowrap;">立即使用</span>
+  				<span  data-name="doubleEleven_title" style="position: absolute;color:#fff;font-weight: bold;font-size: 15px;text-align: left;left: 43px;">直接对接项目联系人</span>
+  				<span  data-name="doubleEleven_button" class="switch_ext" id="app-historypush-vipSub-banner" style="border-radius: 32px;display: flex;flex-direction: row;padding: 3px 12px;font-size: 12px;color: #FAE7CA;margin-right: .2rem;background: linear-gradient(to bottom, #F1D090 0%, #FAE7CA 100%);color: #33323A;font-family: PingFang SC;font-size: 12px;line-height: 18px;letter-spacing: 0px;text-align: center;white-space: nowrap;">免费试用</span>
   			</div>
   		</div>
       {{end}}
@@ -124,7 +130,7 @@
                                 </span>
                             </template>
                             <area-component v-if="screenShow" @cancel="cancel" @confirm="confirm"></area-component>
-                            <root-component v-if="!screenShow"></root-component>
+                            <root-component v-if="!screenShow" @cancel="cancel" @confirm="confirm"></root-component>
                         </van-dropdown-item>
                         <van-dropdown-item ref="industryItem">
                             <template #title>
@@ -135,7 +141,7 @@
                                 </span>
                             </template>
                             <industry-component v-if="screenShow" @cancel="cancel" @confirm="confirm"></industry-component>
-                            <root-component v-if="!screenShow"></root-component>
+                            <root-component v-if="!screenShow" @cancel="cancel" @confirm="confirm"></root-component>
                         </van-dropdown-item>
                         <van-dropdown-item  ref="cateItem">
                             <template #title>
@@ -146,7 +152,7 @@
                                 </span>
                             </template>
                             <cate-component @cancel="cancel" v-if="screenShow" @confirm="confirm"></cate-component>
-                            <root-component v-if="!screenShow"></root-component>
+                            <root-component v-if="!screenShow" @cancel="cancel" @confirm="confirm"></root-component>
                         </van-dropdown-item>
                         <van-dropdown-item title="关键词" ref="keywordItem">
                             <template #title>
@@ -157,7 +163,7 @@
                                 </span>
                             </template>
                             <keyword-component @cancel="cancel" v-if="screenShow" @confirm="confirm"></keyword-component>
-                            <root-component v-if="!screenShow"></root-component>
+                            <root-component v-if="!screenShow" @cancel="cancel" @confirm="confirm"></root-component>
                         </van-dropdown-item>
                         <van-dropdown-item title="公告类型" ref="noticeItem">
                             <template #title>
@@ -168,7 +174,7 @@
                                 </span>
                             </template>
                             <notice-component @cancel="cancel" v-if="screenShow" @confirm="confirm"></notice-component>
-                            <root-component v-if="!screenShow"></root-component>
+                            <root-component v-if="!screenShow" @cancel="cancel" @confirm="confirm"></root-component>
                         </van-dropdown-item>
                     </van-dropdown-menu>
                 </div>
@@ -247,7 +253,6 @@
             </div>
         </div>
     </div>
-</div>
 <div class="vip_report_tip">
     <div class="weui-mask weui-animate-fade-in"></div>
     <div class="weui-dialog weui-animate-fade-in">

+ 11 - 0
src/jfw/modules/common/src/qfw/util/jy/subscribepush.go

@@ -514,6 +514,17 @@ func (s *subscribePush) MakeHistoryDatas(MQFW mg.MongodbSim, PushMysql *mysql.My
 				myInsert["buyerclass"] = buyerclass_mapping
 			}
 		}
+		if s_subscopeclass := ObjToString(v["s_subscopeclass"]); s_subscopeclass != "" {
+			subscopeclass := []string{}
+			for _, v := range strings.Split(s_subscopeclass, ",") {
+				if subscopeclass_mapping, ok := PushMapping.Subscopeclass[v]; ok {
+					subscopeclass = append(subscopeclass, fmt.Sprint(subscopeclass_mapping))
+				}
+			}
+			if len(subscopeclass) > 0 {
+				myInsert["subscopeclass"] = strings.Join(subscopeclass, ",")
+			}
+		}
 		id := PushMysql.Insert("pushsubscribe", myInsert)
 		if id > 0 {
 			redis.Put("pushcache_2_a", redisKey, 1, 86400)

+ 56 - 61
src/web/staticres/common-module/vipsubscribe/js/vip-coupon-template.js

@@ -1,67 +1,16 @@
-Vue.component('vip-coupon-template', {
+var vipCouponTem = {
   delimiters: ['@@', '@@'],
-  props: {
-    
-  },
+  props: {},
   data: function () {
     return {
-      couponList: [
-        {
-          "lotteryId": "4159",
-          "lotteryAttribute": "满减卷",
-          "lotteryBeginDate": "2021-04-08",
-          "lotteryEndDate": "2021-05-10",
-          "products": [],
-          "available": true,
-          "full": 100,
-          "reduce": 10,
-          "instructions": "使用说明",
-          "userLotteryId": "465c"
-        },
-        {
-          "lotteryId": "4159",
-          "lotteryAttribute": "折扣卷",
-          "lotteryBeginDate": "2021-04-08",
-          "lotteryEndDate": "2021-05-10",
-          "products": [],
-          "available": true,
-          "full": 100,
-          "reduce": 10,
-          "instructions": "使用说明",
-          "userLotteryId": "465c"
-        },
-        {
-          "lotteryId": "4159",
-          "lotteryAttribute": "折扣卷",
-          "lotteryBeginDate": "2021-04-08",
-          "lotteryEndDate": "2021-05-10",
-          "products": [],
-          "available": true,
-          "full": 100,
-          "reduce": 10,
-          "instructions": "使用说明",
-          "userLotteryId": "465c"
-        },
-        {
-          "lotteryId": "4159",
-          "lotteryAttribute": "折扣卷",
-          "lotteryBeginDate": "2021-04-08",
-          "lotteryEndDate": "2021-05-10",
-          "products": [],
-          "available": true,
-          "full": 100,
-          "reduce": 10,
-          "instructions": "使用说明",
-          "userLotteryId": "465c"
-        }
-      ]
+      couponList: []
     }
   },
   template: `
   <div class="vip-coupon-template" id="vip-coupon-template">
     <div class="vip-coupon-list" v-for="(item,index) in couponList" :key="item.lotteryId">
-      <div :class="['list-left', item.lotteryAttribute == '满减卷' ? 'red-bg': '', item.lotteryAttribute == '折扣卷' ? 'yellow-bg' : '']">
-        <div :class="['c-name', item.lotteryAttribute == '满减卷' ? 'red-bg': '', item.lotteryAttribute == '折扣卷' ? 'yellow-bg' : '']">@@item.lotteryAttribute@@</div>
+      <div :class="['list-left', item.lotteryAttribute == '满减券' ? 'red-bg': '', item.lotteryAttribute == '折扣券' ? 'yellow-bg' : '']">
+        <div :class="['c-name', item.lotteryAttribute == '满减券' ? 'red-bg': '', item.lotteryAttribute == '折扣券' ? 'yellow-bg' : '']">@@item.lotteryAttribute@@</div>
         <div class="c-result">@@item.reduce@@</div>
         <div class="c-sub">满@@item.full@@元可用</div>
       </div>
@@ -71,9 +20,8 @@ Vue.component('vip-coupon-template', {
           <p class="valid-value">@@item.lotteryBeginDate@@ - @@item.lotteryEndDate@@</p>
         </div>
         <div class="handle">
-          <button v-if="1 !== 2" :class="['handle-use', item.lotteryAttribute == '满减卷' ? 'red-color': 'yellow-color']" @click="useFn(item)">使用</button>
-          <button v-else-if="1 == 3" class="handle-disabled">暂不可用</button>
-          <button v-else class="handle-selected">已选择</button>
+          <button v-if="item.available" :class="['handle-use', item.active ? 'handle-selected' : '', item.lotteryAttribute == '满减券' ? 'red-color': 'yellow-color']" @click="useFn(item)" v-html="item.active ? '已选择': '使用'"></button>
+          <button v-else-if="!item.available" class="handle-disabled">暂不可用</button>
         </div>
       </div> 
     </div>
@@ -82,7 +30,54 @@ Vue.component('vip-coupon-template', {
   mounted() {},
   methods: {
     useFn: function(item) {
-      console.log(item)
+      this.couponList.forEach(function(item) {
+        item.active = false
+      })
+      item.active = true
+      sessionStorage.setItem('vip-cur-select-coupon', JSON.stringify(item))
+      this.$emit('update-coupon', item)
+    },
+    getCoupon: function(price) {
+      var _this = this
+      $.ajax({
+        type:'POST',
+        url:'/jyCoupon/showCoupons',
+        data:{
+          pId: 101,
+          price: parseInt(price*10000/100) ,
+          JYR: 1
+        },
+        success:function(res) {
+          if (res.data) {
+            res.data.forEach(function(item) {
+              if (item.lotteryBeginDate) {
+                item.lotteryBeginDate = item.lotteryBeginDate.replace(/-/g, '.')
+              }
+              if (item.lotteryEndDate) {
+                item.lotteryEndDate = item.lotteryEndDate.replace(/-/g, '.')
+              }
+              // 如当前选择过优惠券,将其状态回显至已选择
+              var curCoupon = JSON.parse(sessionStorage.getItem('vip-cur-select-coupon'))
+              if (curCoupon) {
+                if (curCoupon.userLotteryId && curCoupon.userLotteryId == item.userLotteryId) {
+                  item.active = true
+                } else {
+                  item.active = false
+                }
+              } else {
+                item.active = false
+              }
+            })
+            _this.couponList = res.data
+          }
+        },
+        error:function(err) {
+          console.log(err)
+        }
+      })
     }
   }
-})
+}
+if (typeof Vue !== 'undefined') {
+  Vue.component('goods-coupon-template', vipCouponTem)
+}

+ 66 - 24
src/web/staticres/common-module/vipsubscribe/js/vip-size-template.js

@@ -1,28 +1,20 @@
-Vue.component('vip-size-template', {
+var goodsSizeTem = {
   delimiters: ['@@', '@@'],
   props: {
-    
+    config: {
+      type: Object,
+      default: function() {
+        return {
+          areaCount: Number,
+          priceInfo: Object
+        }
+      }
+    }
   },
   data: function () {
     return {
       goodsActive: 0,
-      goodsSize: [
-        {
-          period: '1月',
-          price: 38,
-          summary: '每天仅需1.27元'
-        },
-        {
-          period: '1季',
-          price: 99,
-          summary: '每天仅需1.09元'
-        },
-        {
-          period: '1年',
-          price: 380,
-          summary: '每天仅需1.04元'
-        }
-      ],
+      goodsInfo: {},
       isShowAuto: false, // 是否显示自动续费,本次版本不显示
       autoChecked: false, // 自动续费是否勾选
     }
@@ -30,13 +22,13 @@ Vue.component('vip-size-template', {
   template: `
   <div class="goods-size-template">
     <div class="goods">
-      <div :class="['goods-list', goodsActive == index ? 'goods-active' : '']" v-for="(item,index) in goodsSize" :key="item.price" @click="chooseGoods(item, index)">
+      <div :class="['goods-list', goodsActive == index ? 'goods-active' : '']" v-for="(item,index) in priceList" :key="item.period" @click="chooseGoods(item, index)">
         <div class="goods-period">@@item.period@@</div>
         <div class="goods-price">
           <span>¥</span>
-          <strong>@@item.price@@</strong>
+          <strong>@@item.price/100@@</strong>
         </div>
-        <div class="goods-summary">@@item.summary@@</div>
+        <div class="goods-summary">每天仅需@@(item.price/item.days/100).toFixed(2)@@元</div>
       </div>
     </div>
     <div class="auto-renew" v-if="isShowAuto">
@@ -45,11 +37,58 @@ Vue.component('vip-size-template', {
     </div>
   </div>
   `,
-  mounted() {},
+  mounted() {
+    
+  },
+  computed: {
+    priceList: function() {
+      var list = []
+      var count = this.config.areaCount
+      var obj = {
+        '1月': this.config.priceInfo.month,
+        '1季': this.config.priceInfo.quarter,
+        '1年': this.config.priceInfo.year
+      }
+      for (var key in obj) {
+        var days = 30
+        if (obj[key]) {
+          switch (key) {
+            case '1月':
+              days = 30
+              break;
+            case '1季':
+              days = 90
+              break;
+            case '1年':
+              days = 365
+              break;
+          }
+          if (count < 16) {
+            list.push({
+              period: key,
+              price: obj[key].oneProvince_allBuyerClass * count,
+              days: days
+            })
+          } else {
+            list.push({
+              period: key,
+              price: obj[key].allProvince_allBuyerClass,
+              days: days
+            })
+          }
+        }
+      }
+      console.log(list)
+      return list
+    }
+  },
   methods: {
     // 选择商品规格
     chooseGoods: function(item, index) {
       this.goodsActive = index
+      sessionStorage.removeItem('vip-cur-select-coupon')
+      item.index = index
+      sessionStorage.setItem('vip-cur-select-size', JSON.stringify(item))
       this.$emit('select-vip-size', item)
     },
     // 自动续费
@@ -58,4 +97,7 @@ Vue.component('vip-size-template', {
       this.$emit('select-auto-renew', this.autoChecked)
     }
   }
-})
+}
+if (typeof Vue !== 'undefined') {
+  Vue.component('goods-size-template', goodsSizeTem)
+}