Browse Source

fix: 修改订阅管理页

熊啸云 3 years ago
parent
commit
37ffb73b08

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

@@ -57,7 +57,7 @@ var subNode = new Vue({
                 success: function (res) {
                     _this.userAreaNum = res.data.areanum
                     _this.userType = res.data.provincenum === 0 ? false : true
-                    _this.userAreaAllNum = res.data.areanum + res.data.provincenum
+                    _this.userAreaAllNum = res.data.provincenum
                     // _this.$emit('UserSubscribe',res)
                     _this.subscribeTime = new Date(res.data.ppstart * 1000).pattern('yyyy年MM月dd日') + "-" + new Date(res.data.ppend * 1000).pattern('yyyy年MM月dd日')
                     _this.initdata = res.data

+ 7 - 5
src/jfw/modules/app/src/web/templates/areaPack/page_set_area.html

@@ -179,9 +179,10 @@
                 toPay: function () {
                     this.popupType = false
                     if (userType) {
-                        location.href = '/jyapp/areaPack/page/buy?type=renew'
+                        // /jyapp/areaPack/page/buy?type=buy&area= + encodeURIComponent(JSON.stringify())
+                        location.href = '/jyapp/areaPack/page/buy?type=renew&area=' +  encodeURIComponent(JSON.stringify(thisData))
                     } else {
-                        location.href = '/jyapp/areaPack/page/buy?type=buy'
+                        location.href = '/jyapp/areaPack/page/buy?type=buy&area=' +  encodeURIComponent(JSON.stringify(thisData))
                     }
                 },
                 
@@ -218,7 +219,7 @@
                 type: 'POST',
                 success: function (res) {
                     userType = res.data.provincenum === 0 ? false : true
-                    maxSelect = res.data.areanum !== -1 ? res.data.areanum + res.data.provincenum : res.data.areanum
+                    maxSelect = res.data.areanum !== -1 ? res.data.provincenum : res.data.areanum
                     // _this.$emit('UserSubscribe',res)
                     if (maxSelect === -1) {
                         $('#canSelect').text(`全国`)
@@ -272,17 +273,18 @@
             } else {
                 var areaData = {}
                 selectDataList.forEach(function (item, index) {
-                    console.info(index, item)
                     areaData[item] = []
                 })
                 areaData = JSON.stringify(areaData)
                 userUpdate(areaData)
                 sessionStorage.setItem('sub_vip_state', areaData)
-                window.history.back()
+                // window.history.back()
             }
         }
+        var thisData = []
         // 页面选中状态改变时触发
         function onChange (selectedData) {
+            thisData = selectedData
             var selectDataList = []
             for (const key in selectedData) {
                 selectDataList.push(key)

+ 8 - 1
src/jfw/modules/app/src/web/templates/weixin/historypush.html

@@ -1640,7 +1640,14 @@ function hasNoData() {
           return year + "<br>" + month + "" + date;
       }
   }
-
+    function hiddenTips2() {
+        $('#tipsType').hide()
+    }
+    function updateJump2() {
+        $('#tipsType').hide()
+        // location.replace('/jyapp/vipsubscribe/toSubVipSetPage?vSwitch=v')
+        location.href = '/jyapp/vipsubscribe/toSubVipSetPage'
+    }
   //
   function appendList(content) {
       content.children(".tslist").on("click", function (event) {

+ 0 - 1
src/jfw/modules/app/src/web/templates/weixin/search/mainSearch.html

@@ -134,7 +134,6 @@
         bottom: 0;
         z-index: 99999;
         background-color:rgba(0, 0, 0, 0.7);
-        display: none;
     }
     .updateTips-wrap{
         width: 6.06rem;

+ 0 - 1
src/jfw/modules/app/src/web/templates/weixin/wxkeyset/index.html

@@ -130,7 +130,6 @@
             bottom: 0;
             z-index: 99999;
             background-color:rgba(0, 0, 0, 0.7);
-            display: none;
         }
         .updateTips-wrap{
             width: 6.06rem;

+ 0 - 1
src/web/staticres/common-module/vipsubscribe/css/vip-subscribe-set-template.css

@@ -550,7 +550,6 @@
       bottom: 0;
       z-index: 99999;
       background-color:rgba(0, 0, 0, 0.7);
-      display: none;
   }
   .updateTips-wrap{
       width: 6.06rem;

+ 30 - 2
src/web/staticres/common-module/vipsubscribe/js/vip-subscribe-set-template.js

@@ -260,6 +260,8 @@ var subComponent = {
       conf: {}, // 信息类型数据
       noAreaFreeType: false, // 免费用户未设置地区时显示弹窗
       backTipShowCount: 0, // 离开页面展示弹窗次数
+      thisvSwitch: 'f',
+      UserSubscribe: {}, // 免费用户数据
     }
   },
   mounted () {
@@ -286,6 +288,7 @@ var subComponent = {
       }
     },
     vSwitch: function (val) {
+      sessionStorage.setItem('infoTypeVswitch', val)
       if (val === 'f') {
         this.getUserSubscribe()
       }
@@ -703,7 +706,6 @@ var subComponent = {
     },
     // 重置信息类型
     reset: function () {
-      console.info(setInfoTypeFn.saveToSessionStorage())
       if (this.isChange) {
         this.infoTypeData = ['全部']
         this.isChange = false
@@ -764,10 +766,34 @@ var subComponent = {
           url: '/publicapply/free/subscribe',
           type: 'POST',
           success: function (res) {
+              _this.UserSubscribe = res
               _this.userAreaNum = res.data.areanum
               _this.userType = res.data.provincenum === 0 ? false : true
               _this.userAreaAllNum = res.data.provincenum
+              _this.initdata.infotype = res.data.infotype
+              _this.info.infoType = _this.initdata.infotype.join('、')
               // _this.$emit('UserSubscribe',res)
+
+              // let proStr = ''
+              // Object.keys(res.data.area).forEach(function(item,index) {
+              //   if(res.data.area[item].length == 0) {
+              //     proStr += item + '、'
+              //   } else {
+              //     let cityStr = ''
+              //     res.data.area[item].forEach(function(data, i) {
+              //       cityStr += data + '、'
+              //     })
+              //     if (cityStr.length > 0) {
+              //       cityStr = cityStr.substr(0,cityStr.length - 1);
+              //     }
+              //     proStr += item+ '(' + cityStr + ')' + '、'
+              //   }
+              // })
+              // if(proStr[proStr.length - 1] == '、') {
+              //   proStr = proStr.substr(0,proStr.length - 1);
+              // }
+              // _this.info.area = '已选:' + proStr
+
               let areaArr = []
               if (res.data.area === {} || res.data.areanum) {
                 _this.noAreaFreeType = true
@@ -897,15 +923,17 @@ var custom = {
       } else {
           setdata = setdata.join(',')
       }
+      let vswitch = sessionStorage.getItem('infoTypeVswitch')
       $.ajax({
           type:'POST',
           url:'/publicapply/subscribe/setUserInfo',
           data: {
               pageType: 'infoType',
               infoTypeArr: setdata,
-              vSwitch: 'm'
+              vSwitch: vswitch
           },
           success:function(res){
+            sessionStorage.removeItem('infoTypeVswitch')
               if(res.flag) {
                   sessionStorage.removeItem('big-setInfoType')
                   location.reload()

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

@@ -47,7 +47,7 @@ var subNode = new Vue({
                 success: function (res) {
                     _this.userAreaNum = res.data.areanum
                     _this.userType = res.data.provincenum === 0 ? false : true
-                    _this.userAreaAllNum = res.data.areanum + res.data.provincenum
+                    _this.userAreaAllNum = res.data.provincenum
                     // _this.$emit('UserSubscribe',res)
                     _this.subscribeTime = new Date(res.data.ppstart * 1000).pattern('yyyy年MM月dd日') + "-" + new Date(res.data.ppend * 1000).pattern('yyyy年MM月dd日')
                     _this.initdata = res.data

+ 5 - 5
src/web/templates/areaPack/wx/page_set_area.html

@@ -176,11 +176,10 @@
                     this.popupType = false
                 },
                 toPay: function () {
-                    this.popupType = false
                     if (userType) {
-                        location.href = '/jyapp/areaPack/page/buy?type=renew'
+                        location.href = '/areaPack/wx/page/buy?type=renew&area=' +  encodeURIComponent(JSON.stringify(thisData))
                     } else {
-                        location.href = '/jyapp/areaPack/page/buy?type=buy'
+                        location.href = '/areaPack/wx/page/buy?type=buy&area=' +  encodeURIComponent(JSON.stringify(thisData))
                     }
                 },
                 
@@ -214,7 +213,7 @@
                 type: 'POST',
                 success: function (res) {
                     userType = res.data.provincenum === 0 ? false : true
-                    maxSelect = res.data.areanum !== -1 ? res.data.areanum + res.data.provincenum : res.data.areanum
+                    maxSelect = res.data.areanum !== -1 ? res.data.provincenum : res.data.areanum
                     // _this.$emit('UserSubscribe',res)
                     if (maxSelect === -1) {
                         $('#canSelect').text(`全国`)
@@ -269,7 +268,6 @@
             } else {
                 var areaData = {}
                 selectDataList.forEach(function (item, index) {
-                    console.info(index, item)
                     areaData[item] = []
                 })
                 areaData = JSON.stringify(areaData)
@@ -277,8 +275,10 @@
                 window.history.back()
             }
         }
+        var thisData = []
         // 页面选中状态改变时触发
         function onChange (selectedData) {
+            thisData = selectedData
             var selectDataList = []
             for (const key in selectedData) {
                 selectDataList.push(key)

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

@@ -658,6 +658,17 @@
                 </div>
             </div>
         </div>
+        <div class="oldUserTips" id="tipsType">
+            <div class="updateTips-wrap" style="height: 3.3rem;">
+                <div class="updateTips-title">版本更新</div>
+                <div class="updateTips-text" style="text-align: center;">免费订阅新版来了,请前往订阅设置更新功能后使用。</div>
+                <div class="updateTips-btnWrap">
+                    <div class="updateTips-btn" id="cancel2" onclick="hiddenTips2()">取消</div>
+                    <div class="updateTips-line"></div>
+                    <div class="updateTips-btn levelUp" id="newLevelUp"  onclick="updateJump2()">立即升级</div>
+                </div>
+            </div>
+        </div>
     </div>
     <!-- banner -->
     <div class="vip_banner" style="display: none;">
@@ -1728,7 +1739,14 @@
               return year + "<br>" + month + "" + date;
           }
       }
-
+        function hiddenTips2() {
+            $('#tipsType').hide()
+        }
+        function updateJump2() {
+            $('#tipsType').hide()
+            // location.replace('/jyapp/vipsubscribe/toSubVipSetPage?vSwitch=v')
+            location.href = '/front/vipsubscribe/toSubVipSetPage'
+        }
       //
       function appendList(content) {
           content.children(".tslist").on("click", function () {

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

@@ -32,7 +32,6 @@
             bottom: 0;
             z-index: 99999;
             background-color:rgba(0, 0, 0, 0.7);
-            display: none;
         }
         .updateTips-wrap{
             width: 6.06rem;