Browse Source

新用户区域、行业宣选择

TANGSHIZHE 4 năm trước cách đây
mục cha
commit
6c511a561a

+ 15 - 1
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/change_area.js

@@ -67,6 +67,8 @@ $(function () {
     var keyItems = []
     // 是否是新用户
     var isNew = 0
+    // 判断行业是否为null
+    var industryNull = false
 
     function slideFunc() {
         if (isAnimating) return
@@ -515,7 +517,12 @@ $(function () {
                 res.data.area = {}
             }
             if(!res.data.industry) {
+                industryNull = true
                 res.data.industry = []
+                sessionStorage.setItem('industryNull', 'true')
+            } else {
+                industryNull = false
+                sessionStorage.removeItem('industryNull')
             }
             if(res.data.items) {
                 res.data.items.forEach(function (item, index) {
@@ -553,9 +560,15 @@ $(function () {
     $('.save-btn').on('click', function () {
         // 获取点亮的城市详情
         areaData.data.area = getActiveCityDetail()
+        let industryParam = ''
+        if(industryNull) {
+            industryParam = ''
+        } else {
+            industryParam = (areaData.data.industry).join(',')
+        }
         var params = {
           area: JSON.stringify(areaData.data.area).indexOf('全国') > -1 ? '{}' : JSON.stringify(areaData.data.area),
-          industry: (areaData.data.industry).join(',')
+          industry: industryParam
         }
         console.log(areaData, 'areaData')
         if (getParam('header') === 'save') {
@@ -567,6 +580,7 @@ $(function () {
             }
           $DoPost(url, params, function (res) {
             if (res.data && res.data.doSuccess) {
+              sessionStorage.removeItem('areaNull')
               weui.toast('修改成功', {
                 duration: 2000,
                 className: 'custom-toast',

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

@@ -31,6 +31,8 @@ var buyCount = data.data.buyset.buyerclasscount;//已购买的行业数量  -1
 var array = data.data.industry;//已选择的行业(数组)
 var otherBuyClass = 0
 var result = [];//声明一个空数组为选择结果
+// 判断地区是否为null
+var areaNull = false
 // 初始化行业数据,渲染到页面
 function initData() {
     if (data.data.isTrial) {
@@ -338,11 +340,16 @@ $(function () {
     // 确认按钮事件
     $('.save-btn').on('click', function () {
         data.data.industry = result
-        console.log(data.data)
         let switch_other = $('.switch_other').hasClass('active')
+        let areaParams = ''
+        if(areaNull) {
+          areaParams = ''
+        } else {
+          areaParams = data.data.industry.join(',')
+        }
         var params = {
           area: JSON.stringify(data.data.area),
-          industry: data.data.industry.join(',')
+          industry: areaParams
         }
         console.log(switch_other)
         if(switch_other) {
@@ -360,6 +367,7 @@ $(function () {
           }
           $DoPost(url, params, function (res) {
             if (res.data && res.data.doSuccess) {
+              sessionStorage.removeItem('industryNull')
               weui.toast('修改成功', {
                 duration: 2000,
                 className: 'custom-toast',
@@ -385,7 +393,11 @@ $(function () {
         $DoPost('/subscribepay/vipsubscribe/getSubBuyMsg', {}, function (res) {
             if (!res.success) return;
             if(!res.data.area) {
+              areaNull = true
               res.data.area = {}
+              sessionStorage.setItem('areaNull', 'true')
+            } else {
+              areaNull = false
             }
             if(!res.data.industry) {
                 res.data.industry = []

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

@@ -724,6 +724,8 @@ $(function () {
       checkmerge(state.industry, state.isread)
       // init 已选择的区域和行业
       // var selectedAreaAndInd = getBuySet(state.area, state.industry);
+      //刷新展示周期
+      flushShowTime(state.isTrial, selectTime, stratFlag, endflag);
       // 2021-5-21修改 初始化已选择的区域和行业 
       var selectedAreaAndInd = getSelectBuyset(state.area, state.industry)
       setSelectedAreaAndInd(selectedAreaAndInd);
@@ -735,8 +737,6 @@ $(function () {
       selectTime = sessionStorage.getItem("vip_change_time");
       var endflag = state.endTime;
       var stratFlag = state.startTime;
-      //刷新展示周期
-      flushShowTime(state.isTrial, selectTime, stratFlag, endflag);
 
       // 初始化关键词
     //   if (state.items.length === 0) {

+ 9 - 1
src/jfw/modules/app/src/web/templates/vipsubscribe/vip_introduce.html

@@ -54,7 +54,7 @@
                     </div>
                 </div>
                 <div class="setaction" v-show="!compShow">
-                    <sub-component type="introduce" :linkobj="linkObj" :initdata="initData"></sub-component>
+                    <sub-component @footershow="footerShow" type="introduce" :linkobj="linkObj" :initdata="initData"></sub-component>
                 </div>
                 <div class="group-title" v-show="compShow">
                     <span class="title-text line-title">超级订阅服务特权</span>
@@ -252,6 +252,14 @@
                         }
                     })
                 }
+            },
+            footerShow: function(data) {
+                console.log(data)
+                if(data == 'true') {
+                    $('.vip-footer-container').hide()
+                } else {
+                    $('.vip-footer-container').show()
+                }
             }
         }
     })

+ 26 - 1
src/web/staticres/common-module/vipsubscribe/js/vip-subscribe-set-template.js

@@ -238,6 +238,11 @@ var subComponent = {
       } else {
         this.info.area = '请选择区域'
       }
+      var areaNull = sessionStorage.getItem('areaNull')
+      if(areaNull) {
+        this.initdata.area = {}
+        this.info.area = '请选择区域'
+      }
     },
     // 设置行业
     setIndustry: function() {
@@ -251,6 +256,11 @@ var subComponent = {
       } else {
         this.info.industry = '请选择采购单位行业'
       }
+      var industryNull = sessionStorage.getItem('industryNull')
+      if(industryNull) {
+        this.initdata.industry = []
+        this.info.industry = '请选择采购单位行业'
+      }
     },
     // 设置关键词
     setKeyword: function() {
@@ -369,10 +379,15 @@ var subComponent = {
       // })
     },
     hideActionSheet: function() {
+      var update_renew = $('.update_renew')
       var $iosMask = $('#iosMask');
       var $iosActionsheet = $('#iosActionsheet');
       $iosActionsheet.removeClass('weui-actionsheet_toggle');
       $iosMask.fadeOut(200);
+      if(update_renew) {
+        update_renew.show()
+      }
+      this.$emit('footershow', 'false')
     },
     iosMask: function() {
         this.hideActionSheet()
@@ -381,22 +396,32 @@ var subComponent = {
       this.hideActionSheet()
     },
     matchWay: function() {
+      var update_renew = $('.update_renew')
       var $iosMask = $('#iosMask');
       var $iosActionsheet = $('#iosActionsheet');
       $iosActionsheet.addClass('weui-actionsheet_toggle');
       $iosMask.fadeIn(200);
+      if(update_renew) {
+        update_renew.hide()
+      }
+      this.$emit('footershow', 'true')
     },
     actionSheet: function(title, index) {
       let _this = this
+      var update_renew = $('.update_renew')
       $.post("/subscribepay/afterPay/setUserInfo", {pageType: "saveSeniorset", matchtype: index}, function (r) {
           if (r.flag) {
             var subVipState = sessionStorage.getItem('sub_vip_state');
             var reqData = JSON.parse(subVipState);
-            this.active = index
+            _this.active = index
             var $iosMask = $('#iosMask');
             var $iosActionsheet = $('#iosActionsheet');
             $iosActionsheet.removeClass('weui-actionsheet_toggle');
             $iosMask.fadeOut(200);
+            if(update_renew) {
+              update_renew.show()
+            }
+            _this.$emit('footershow', 'false')
             $('.match-way-value').text(title)
             if(index == 1) {
               $('.titleMacth').addClass('active')

+ 15 - 1
src/web/staticres/vipsubscribe/js/change_area.js

@@ -67,6 +67,8 @@ $(function () {
     var keyItems = []
     // 是否是新用户
     var isNew = 0
+    // 判断行业是否为null
+    var industryNull = false
 
     function slideFunc() {
         if (isAnimating) return
@@ -525,7 +527,12 @@ $(function () {
                 res.data.area = {}
             }
             if(!res.data.industry) {
+                industryNull = true
                 res.data.industry = []
+                sessionStorage.setItem('industryNull', 'true')
+            } else {
+                industryNull = false
+                sessionStorage.removeItem('industryNull')
             }
             if(res.data.items) {
                 res.data.items.forEach(function (item, index) {
@@ -564,9 +571,15 @@ $(function () {
         areaData.data.area = getActiveCityDetail()
 
         // 超级订阅新套餐 修改订阅条件需要提交后台保存, 因是共用页面,为不影响其他页面逻辑,url加上参数进行判断
+        let industryParam = ''
+        if(industryNull) {
+            industryParam = ''
+        } else {
+            industryParam = (areaData.data.industry).join(',')
+        }
         var params = {
           area: JSON.stringify(areaData.data.area).indexOf('全国') > -1 ? '{}' : JSON.stringify(areaData.data.area),
-          industry: (areaData.data.industry).join(',')
+          industry: industryParam
         }
         if (getParam('header') === 'save') {
           let url = ''
@@ -577,6 +590,7 @@ $(function () {
           }
           $DoPost(url, params, function (res) {
             if (res.data && res.data.doSuccess) {
+              sessionStorage.removeItem('areaNull')
               weui.toast('修改成功', {
                 duration: 2000,
                 className: 'custom-toast',

+ 15 - 1
src/web/staticres/vipsubscribe/js/change_industry.js

@@ -31,6 +31,8 @@ var buyCount = data.data.buyset.buyerclasscount;//已购买的行业数量  -1
 var array = data.data.industry;//已选择的行业(数组)
 var otherBuyClass = 0
 var result = [];//声明一个空数组为选择结果
+// 判断地区是否为null
+var areaNull = false
 // 初始化行业数据,渲染到页面
 function initData() {
     if (data.data.isTrial) {
@@ -322,9 +324,15 @@ $(function () {
     $('.save-btn').on('click', function () {
         data.data.industry = result
         let switch_other = $('.switch_other').hasClass('active')
+        let areaParams = ''
+        if(areaNull) {
+          areaParams = ''
+        } else {
+          areaParams = data.data.industry.join(',')
+        }
         var params = {
           area: JSON.stringify(data.data.area),
-          industry: data.data.industry.join(',')
+          industry: areaParams
         }
         if(switch_other) {
           setotherbuyerclass(1)
@@ -341,6 +349,7 @@ $(function () {
           }
           $DoPost(url, params, function (res) {
             if (res.data && res.data.doSuccess) {
+              sessionStorage.removeItem('industryNull')
               weui.toast('修改成功', {
                 duration: 2000,
                 className: 'custom-toast',
@@ -366,7 +375,12 @@ $(function () {
         $DoPost('/subscribepay/vipsubscribe/getSubBuyMsg', {}, function (res) {
             if (!res.success) return;
             if(!res.data.area) {
+              areaNull = true
               res.data.area = {}
+              sessionStorage.setItem('areaNull', 'true')
+            } else {
+              areaNull = false
+              sessionStorage.removeClass('areaNull')
             }
             if(!res.data.industry) {
                 res.data.industry = []

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

@@ -718,6 +718,8 @@ $(function () {
         checkmerge(state.industry, state.isread)
         // init 已选择的区域和行业
         // var selectedAreaAndInd = getBuySet(state.area, state.industry);
+        //刷新展示周期
+        flushShowTime(state.isTrial, selectTime, stratFlag, endflag);
         // 2021-5-21修改
         var selectedAreaAndInd = getSelectBuyset(state.area, state.industry)
         setSelectedAreaAndInd(selectedAreaAndInd);
@@ -729,8 +731,6 @@ $(function () {
         selectTime = sessionStorage.getItem("vip_change_time");
         var endflag = state.endTime;
         var stratFlag = state.startTime;
-        //刷新展示周期
-        flushShowTime(state.isTrial, selectTime, stratFlag, endflag);
 
         // 初始化关键词
         if (state.items.length === 0) {

+ 1 - 0
src/web/templates/weixin/vipsubscribe/messageType.html

@@ -247,6 +247,7 @@
                     isLockButton(true);
                 } else {
                     $('.all span').addClass('active');
+                    isLockButton(true);
                 }
             } else {
                 $('.all span').addClass('active');

+ 9 - 1
src/web/templates/weixin/vipsubscribe/vip_introduce.html

@@ -49,7 +49,7 @@
                         </div>
                     </div>
                     <div class="setaction" v-show="!compShow">
-                        <sub-component type="introduce" :linkobj="linkObj" :initdata="initData"></sub-component>
+                        <sub-component @footershow="footerShow" type="introduce" :linkobj="linkObj" :initdata="initData"></sub-component>
                     </div>
                     <div class="group-title" v-show="compShow">
                         <span class="title-text line-title">超级订阅服务特权</span>
@@ -259,6 +259,14 @@
                     reg = null;
                     r = null;
                     return context == null || context == "" || context == "undefined" ? "" : context;
+                },
+                footerShow: function(data) {
+                    console.log(data)
+                    if(data == 'true') {
+                        $('.vip-footer-container').hide()
+                    } else {
+                        $('.vip-footer-container').show()
+                    }
                 }
             }
         })