Prechádzať zdrojové kódy

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

wangshan 3 rokov pred
rodič
commit
2d51667524

+ 6 - 6
src/jfw/modules/app/src/web/staticres/jyapp/big-member/js/analysis_result.js

@@ -180,12 +180,12 @@ var vNode = {
     },
     },
     beforeDestroy() {
     beforeDestroy() {
         window.removeEventListener("resize", this.init,20);
         window.removeEventListener("resize", this.init,20);
-        if(this.hotChartRef) {
-          this.hotChartRef.dispose();
-        }
-        if(this.pieChartRef) {
-          this.pieChartRef.dispose();
-        }
+        // if(this.hotChartRef) {
+        //   this.hotChartRef.dispose();
+        // }
+        // if(this.pieChartRef) {
+        //   this.pieChartRef.dispose();
+        // }
     },
     },
     mounted() {
     mounted() {
         this.year = new Date().getFullYear() - 2;
         this.year = new Date().getFullYear() - 2;

+ 10 - 0
src/jfw/modules/app/src/web/staticres/jyapp/big-member/js/ent_portrait.js

@@ -387,6 +387,14 @@ var vNode = {
                 _this.getEntPortrait()
                 _this.getEntPortrait()
               }
               }
             }
             }
+          } else {
+            _this.loading.clear()
+            _this.show.yearData = false
+            _this.show.monthData = false
+            _this.show.areaData = false
+            _this.show.rate = false
+            _this.show.top10 = false
+            _this.show.topShow = false
           }
           }
         },
         },
         error: function (error) {
         error: function (error) {
@@ -470,6 +478,8 @@ var vNode = {
             }
             }
           } else {
           } else {
             // _this.$toast(res.error_msg)
             // _this.$toast(res.error_msg)
+            _this.loading.clear()
+            _this.show.dt = false
           }
           }
         },
         },
         error: function (error) {
         error: function (error) {

+ 1 - 7
src/jfw/modules/app/src/web/staticres/jyapp/big-member/js/unit_portrayal.js

@@ -191,16 +191,10 @@ var vNode = {
         
         
         this.getNewMsg(); // 中标动态
         this.getNewMsg(); // 中标动态
         this.getChartData(); // 企业画像
         this.getChartData(); // 企业画像
-        this.init();
+        // this.init();
     },
     },
     beforeDestroy() {
     beforeDestroy() {
       window.removeEventListener("resize", this.init,20);
       window.removeEventListener("resize", this.init,20);
-      if(this.hotChart) {
-        this.hotChart.dispose();
-      }
-      if(this.pieChart) {
-        this.pieChart.dispose();
-      }
     },
     },
     methods: {
     methods: {
         // 获取权限信息
         // 获取权限信息

+ 96 - 54
src/jfw/modules/app/src/web/staticres/jyapp/js/searchindex.js

@@ -439,73 +439,115 @@ var SuperSearch = {
       SuperSearch.dyDiv=true;
       SuperSearch.dyDiv=true;
     });
     });
 
 
-    //订阅
-    $("#supersearchPage #zjdy").on("tap",function(even){
-      if(userId == ""||userId == null){
-        SuperSearch.setSessionStorage();
-        window.location.href = "/jyapp/free/login?to=back";
-        return;
-      }
-      var rFlag = false;
-      if(SuperSearch.isVip || window.jyUserPower.member){
-        $.ajax({
-          type: "post",
-          url: "/publicapply/subscribe/setUserInfo",
-          data: {
-            pageType:'keyWords',
-            actionType: 'directSubKWS',
-            kws_name:SuperSearch.s_words,
-            vSwitch: vSwitch
-          },
-          // dataType: "json",
-          async: false,
-          success: function(r){
-            if(r.flag=="y"){
-              rFlag = true;
-            }else if(r.flag=="o"){
-              EasyAlert.show("您已经订阅过此关键字");
-            }else if(r.flag=="m"){
-              EasyAlert.show("您已经超过订阅<br>关键字上限");
+    // 获取用户信息-用于立即订阅按钮
+    function getKeyUserInfo () {
+      // 免费用户
+      // --> 已设置10组关键词,订阅失败提示
+      // --> 小于10组
+      //    --> 历史老用户-未选择区域-提示更新
+      //           --> -选择区域-关键词列表
+      //    --> 新用户-未选择区域-关键词列表
+
+      var isOldUser = false
+      var nowKeyLength = 8
+      var isSelectArea = false
+
+     // 获取用户关键词数据
+      $.ajax({
+        url: '/publicapply/free/subscribe',
+        type: 'post',
+        success: function (res) {
+          if (res.error_code === 0 && res.data) {
+            try {
+              isSelectArea = !!res.data.area
+              nowKeyLength = res.data.keys.length
+            } catch (e) {
+              console.warn('error format keys length')
             }
             }
-          },error: function(){
-            rFlag = true;
           }
           }
-        });
-        if(rFlag){
+        },
+      })
+
+      // S-直接订阅
+      $("#supersearchPage #zjdy").on("tap",function(even){
+        if(userId == ""||userId == null){
           SuperSearch.setSessionStorage();
           SuperSearch.setSessionStorage();
-          window.location.href = "/jyapp/vipsubscribe/toSetKeyWordPage";
+          window.location.href = "/jyapp/free/login?to=back";
+          return;
         }
         }
-      }else{
-        $.ajax({
-          type: "post",
-          url: "/jyapp/member/swordfish/ajaxReq",
-          data: {keys:SuperSearch.s_words,reqType: "subscribe"},
-          dataType: "json",
-          async: false,
-          success: function(r){
-            if(r.flag=="y"){
+        var rFlag = false;
+        if(SuperSearch.isVip || window.jyUserPower.member){
+          $.ajax({
+            type: "post",
+            url: "/publicapply/subscribe/setUserInfo",
+            data: {
+              pageType:'keyWords',
+              actionType: 'directSubKWS',
+              kws_name:SuperSearch.s_words,
+              vSwitch: vSwitch
+            },
+            // dataType: "json",
+            async: false,
+            success: function(r){
+              if(r.flag=="y"){
+                rFlag = true;
+              }else if(r.flag=="o"){
+                EasyAlert.show("您已经订阅过此关键字");
+              }else if(r.flag=="m"){
+                EasyAlert.show("您已经超过订阅<br>关键字上限");
+              }
+            },error: function(){
               rFlag = true;
               rFlag = true;
-            }else if(r.flag=="o"){
-              EasyAlert.show("您已经超过订阅<br>关键字上限");
             }
             }
-          },error: function(){
-            rFlag = true;
+          });
+          if(rFlag){
+            SuperSearch.setSessionStorage();
+            window.location.href = "/jyapp/vipsubscribe/toSetKeyWordPage";
           }
           }
-        });
-        if(rFlag){
-          //JyObj.redirectKeyset();
-          if (!newUserType) {
-            $('#tipsType').show()
+        }else{
+          // 免费用户
+          isOldUser = !jyAddInfo.isUpgrade
+          if (nowKeyLength >= 10) {
+            return EasyAlert.show("您已经超过订阅<br>关键字上限");
           } else {
           } else {
+            if (isSelectArea) {
+              // 执行下方原有逻辑
+            } else if (isOldUser) {
+              return $('#tipsType').show()
+            }
+          }
+
+          $.ajax({
+            type: "post",
+            url: "/jyapp/member/swordfish/ajaxReq",
+            data: {keys:SuperSearch.s_words,reqType: "subscribe"},
+            dataType: "json",
+            async: false,
+            success: function(r){
+              if(r.flag=="y"){
+                rFlag = true;
+              }else if(r.flag=="o"){
+                EasyAlert.show("您已经超过订阅<br>关键字上限");
+              }
+            },
+            error: function(){
+              rFlag = true;
+            }
+          });
+          if(rFlag){
             SuperSearch.setSessionStorage();
             SuperSearch.setSessionStorage();
             setTimeout(function(){
             setTimeout(function(){
-              window.location.href = "/jyapp/wxkeyset/keyset/index";
+              window.location.href = "/jyapp/vipsubscribe/toSetKeyWordPage";
             },100);
             },100);
           }
           }
         }
         }
-      }
-    });
-    //订阅结束==========================================================================
+      });
+      // E-直接订阅
+    }
+
+    getKeyUserInfo()
+
+
     //删除历史搜索
     //删除历史搜索
     $("#supersearchPage").on("click", " #del_history", function(){
     $("#supersearchPage").on("click", " #del_history", function(){
       if(localStorage){
       if(localStorage){

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

@@ -38,9 +38,6 @@ var subNode = new Vue({
         this.$nextTick(function () {
         this.$nextTick(function () {
             $(".app-layout-content-b").removeAttr('v-cloak')
             $(".app-layout-content-b").removeAttr('v-cloak')
         })
         })
-        // this.userAreaNum = 0
-        // this.userType = true
-        // this.userAreaAllNum = 1
     },
     },
     methods: {
     methods: {
         // 省份订阅包续费
         // 省份订阅包续费
@@ -62,7 +59,6 @@ var subNode = new Vue({
                     _this.userAreaNum = res.data.areanum
                     _this.userAreaNum = res.data.areanum
                     _this.userType = res.data.provincenum === 0 ? false : true
                     _this.userType = res.data.provincenum === 0 ? false : true
                     _this.userAreaAllNum = res.data.provincenum === -1 ? '全国' : res.data.provincenum
                     _this.userAreaAllNum = res.data.provincenum === -1 ? '全国' : 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.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
                     _this.initdata = res.data
                 }
                 }
@@ -147,11 +143,6 @@ var subNode = new Vue({
                     if(res.data) {
                     if(res.data) {
                         _this.vSwitch = res.data.vt || 'f'
                         _this.vSwitch = res.data.vt || 'f'
                         // f 免费 m 大会员 v 超级订阅
                         // f 免费 m 大会员 v 超级订阅
-                        if (_this.vSwitch === 'f') {
-                            // 判断是否购买省份订阅包
-                            _this.getUserSubscribe()
-                            $('.update_renew').hide()
-                        }
                         if(res.data.vt == 'm') {
                         if(res.data.vt == 'm') {
                             _this.vipLink = 'javascript:;'
                             _this.vipLink = 'javascript:;'
                             _this.arrowShow = false
                             _this.arrowShow = false
@@ -173,6 +164,17 @@ var subNode = new Vue({
                         if(bms) {
                         if(bms) {
                             _this.memberStatus = bms
                             _this.memberStatus = bms
                         }
                         }
+                        if (_this.vSwitch === 'f') {
+                            // 判断是否购买省份订阅包
+                            _this.getUserSubscribe()
+                            $('.update_renew').hide()
+                        } else {
+                            $DoPost('/subscribepay/vipsubscribe/getSubBuyMsg', {}, function(sum) {
+                                if(sum.success) {
+                                    getDataWitXHR(sum)
+                                }
+                            })
+                        }
                     }
                     }
                 }
                 }
             })
             })
@@ -304,9 +306,8 @@ $(function () {
       }
       }
       $(".list-content").html(returnHtml);
       $(".list-content").html(returnHtml);
   }
   }
-  function getDataWitXHR() {
+  window.getDataWitXHR = function (res) {
       $DoPost(subNode.subInfoAjax, {}, function (r) {
       $DoPost(subNode.subInfoAjax, {}, function (r) {
-          let res  = resObj
           let switchProduct = sessionStorage.getItem('switch-product')
           let switchProduct = sessionStorage.getItem('switch-product')
           if(switchProduct) {
           if(switchProduct) {
               if(switchProduct == 'bigmember') {
               if(switchProduct == 'bigmember') {
@@ -360,15 +361,6 @@ $(function () {
           init(res.data)
           init(res.data)
       })
       })
   }
   }
-  var resObj = {}
-  // 每次请求接口
-    let subUrl = '/subscribepay/vipsubscribe/getSubBuyMsg'
-    $DoPost(subUrl, {}, function(sum) {
-        if(sum.success) {
-            resObj = sum
-            getDataWitXHR()
-        }
-    })
 
 
   // 设置已选择的区域和行业
   // 设置已选择的区域和行业
   function setSelectedAreaAndInd(selected) {
   function setSelectedAreaAndInd(selected) {

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

@@ -255,7 +255,7 @@
             <div class="zb-time-frame border-line-t">
             <div class="zb-time-frame border-line-t">
               <span>数据统计范围:</span>
               <span>数据统计范围:</span>
               <span>${entPortraitInfo.timeRangeStart ? new Date(entPortraitInfo.timeRangeStart *
               <span>${entPortraitInfo.timeRangeStart ? new Date(entPortraitInfo.timeRangeStart *
-                1000).pattern('yyyy/MM/dd') : '2016'}</span>
+                1000).pattern('yyyy/MM/dd') : ''}</span>
               <span>-</span>
               <span>-</span>
               <span>${entPortraitInfo.timeRangeEnd ? new Date(entPortraitInfo.timeRangeEnd * 1000).pattern('yyyy/MM/dd')
               <span>${entPortraitInfo.timeRangeEnd ? new Date(entPortraitInfo.timeRangeEnd * 1000).pattern('yyyy/MM/dd')
                 : '至今'}</span>
                 : '至今'}</span>

+ 1 - 3
src/jfw/modules/app/src/web/templates/vipsubscribe/vip_index_new.html

@@ -291,7 +291,7 @@
               </li>
               </li>
             </ul>
             </ul>
           </li>
           </li>
-          <sub-component :linkobj="linkObj" :initdata="initData" :v-switch="vSwitch"></sub-component>
+          <sub-component ref="subComponent" :linkobj="linkObj" :initdata="initData" :v-switch="vSwitch"></sub-component>
           <div class="provincePayWarp" v-show="userType">
           <div class="provincePayWarp" v-show="userType">
             <span class="provincePayTips">省份订阅包</span>
             <span class="provincePayTips">省份订阅包</span>
             <div class="provincePay">
             <div class="provincePay">
@@ -363,8 +363,6 @@
     <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/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/big-member/js/utils.js?v={{Msg "seo" "mod_version"}}'></script>
     <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/big-member/js/utils.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}}/common-module/coupon/js/pay-order-template.js?v={{Msg "seo" "version"}}'></script> -->
     <script>
     <script>
       $(window).on("pageshow", function (event) {
       $(window).on("pageshow", function (event) {
         if (event.originalEvent.persisted) {
         if (event.originalEvent.persisted) {

+ 9 - 3
src/jfw/modules/app/src/web/templates/vipsubscribe/vip_purchase.html

@@ -783,6 +783,8 @@
       data: function () {
       data: function () {
         return {
         return {
           sessKey: '$data-vipsubscribe_new_goods_order',
           sessKey: '$data-vipsubscribe_new_goods_order',
+          // 返回提示标志,为true则返回时不弹出提示
+          iDoNotNeedConfirmed: true,
           dialog: {
           dialog: {
             backTip: false,
             backTip: false,
             backTipShowCount: 0
             backTipShowCount: 0
@@ -812,6 +814,11 @@
         this.init(this.$data)
         this.init(this.$data)
         this.restoreState()
         this.restoreState()
         this.getBuyInfo()
         this.getBuyInfo()
+        // 解决ios从上个页面返回触发popstate的问题
+        // 基本逻辑:刚进入页面100ms内不允许触发popstate请求
+        setTimeout(function () {
+          this.iDoNotNeedConfirmed = false
+        }.bind(this), 100)
       },
       },
       methods: {
       methods: {
         // 获取已购买信息
         // 获取已购买信息
@@ -832,9 +839,7 @@
         toBuyAreaPack: function () {
         toBuyAreaPack: function () {
           this.dialog.backTip = false
           this.dialog.backTip = false
           this.saveState()
           this.saveState()
-          setTimeout(function () {
-            location.href = '/jyapp/areaPack/page/buy'
-          }, 20)
+          location.href = '/jyapp/areaPack/page/buy'
         },
         },
         restoreState: function () {
         restoreState: function () {
           var k = sessionStorage.getItem(this.sessKey)
           var k = sessionStorage.getItem(this.sessKey)
@@ -858,6 +863,7 @@
             history.pushState(pushContent, null, pushContent.url);
             history.pushState(pushContent, null, pushContent.url);
           }
           }
           $(window).on('popstate', function () {
           $(window).on('popstate', function () {
+            if (_this.iDoNotNeedConfirmed) return
             _this.dialog.backTip = true
             _this.dialog.backTip = true
             _this.dialog.backTipShowCount++
             _this.dialog.backTipShowCount++
           })
           })

+ 10 - 15
src/jfw/modules/app/src/web/templates/weixin/search/mainSearch.html

@@ -729,7 +729,7 @@
     var distance = {{Msg "seo" "distance"}};
     var distance = {{Msg "seo" "distance"}};
     var member_status;
     var member_status;
     var isMember = false;
     var isMember = false;
-    var vSwitch = 'v'
+    var vSwitch = 'f'
     // 消息总数
     // 消息总数
     try {
     try {
         checkMsgCount(true, 0)
         checkMsgCount(true, 0)
@@ -737,25 +737,20 @@
         console.log(e)
         console.log(e)
     }
     }
     // 子账户判断
     // 子账户判断
+    window.jyAddInfo = {
+        isUpgrade: false
+    }
     $.ajax({
     $.ajax({
         type:'POST',
         type:'POST',
         url:'/bigmember/use/isAdd?t' + new Date().getTime(),
         url:'/bigmember/use/isAdd?t' + new Date().getTime(),
         success: function (r) {
         success: function (r) {
             if (r && r.data) {
             if (r && r.data) {
-                $.ajax({
-                    url: '/publicapply/subscribe/vipSwitch',
-                    type: 'POST',
-                    success: function(res) {
-                        if(res.error_code == 0) {
-                            vSwitch = res.data.vt
-                            if(vSwitch == 'm' && r.data.isSubCount) {
-                                $('#resbm').hide()
-                            } else {
-                                $('#resbm').show()
-                            }
-                        }
-                    }
-                })
+                window.jyAddInfo = r.data
+                if(res.data.memberStatus > 0 && r.data.isSubCount) {
+                    $('#resbm').hide()
+                } else {
+                    $('#resbm').show()
+                }
                 if (r.data.isSubCount) {
                 if (r.data.isSubCount) {
                     $("#mainSearch-tab4").attr('data-sub','true')
                     $("#mainSearch-tab4").attr('data-sub','true')
                 }
                 }

+ 1 - 7
src/web/staticres/big-member/js/unit_portrayal.js

@@ -187,16 +187,10 @@ var vNode = {
       
       
         this.getNewMsg(); // 中标动态
         this.getNewMsg(); // 中标动态
         this.getChartData(); // 企业画像
         this.getChartData(); // 企业画像
-        this.init();
+        // this.init();
     },
     },
     beforeDestroy() {
     beforeDestroy() {
       window.removeEventListener("resize", this.init,20);
       window.removeEventListener("resize", this.init,20);
-      if(this.hotChart) {
-        this.hotChart.dispose();
-      }
-      if(this.pieChart) {
-        this.pieChart.dispose();
-      }
     },
     },
     methods: {
     methods: {
         // 获取权限信息
         // 获取权限信息

+ 10 - 0
src/web/staticres/common-module/collection/js/ent_portrait.js

@@ -392,6 +392,14 @@ var vNode = {
                 _this.getEntPortrait()
                 _this.getEntPortrait()
               }
               }
             }
             }
+          } else {
+            _this.loading.clear()
+            _this.show.yearData = false
+            _this.show.monthData = false
+            _this.show.areaData = false
+            _this.show.rate = false
+            _this.show.top10 = false
+            _this.show.topShow = false
           }
           }
         },
         },
         error: function (error) {
         error: function (error) {
@@ -472,6 +480,8 @@ var vNode = {
             }
             }
           } else {
           } else {
             // _this.$toast(res.error_msg)
             // _this.$toast(res.error_msg)
+            _this.loading.clear()
+            _this.show.dt = false
           }
           }
         },
         },
         error: function (error) {
         error: function (error) {

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

@@ -495,7 +495,7 @@
   border-radius: 0.08rem 0.08rem 0.08rem 0.08rem;
   border-radius: 0.08rem 0.08rem 0.08rem 0.08rem;
   font-size: 0.32rem;
   font-size: 0.32rem;
   font-weight: 500;
   font-weight: 500;
-  color: #C0C4CC;
+  color: #5f5e64;
   line-height: 0.8rem;
   line-height: 0.8rem;
   text-align: center;
   text-align: center;
 }
 }
@@ -520,9 +520,6 @@
   background-size: 100% 100%;
   background-size: 100% 100%;
   z-index: 2;
   z-index: 2;
 }
 }
-.thisChange {
-  color:#5f5e64 !important;
-}
 @keyframes bottomUp {
 @keyframes bottomUp {
   0% {
   0% {
     transform: translateY(100%);
     transform: translateY(100%);

+ 52 - 128
src/web/staticres/common-module/vipsubscribe/js/vip-subscribe-set-template.js

@@ -159,14 +159,14 @@ var subScribeTemplate = `
         <div class="close-btn" @click="closeInfoType"></div>
         <div class="close-btn" @click="closeInfoType"></div>
       </div>
       </div>
       <div class="menu-content">
       <div class="menu-content">
-        <div class="infoType-btn" @click="changeBtnType('全部')" :class="infoTypeData.indexOf('全部') !== -1 ? 'infoTypeActive' : ''">全部</div>
+        <div class="infoType-btn" @click="changeBtnType('all')" :class="infoTypeData.length === 0 ? 'infoTypeActive' : ''">全部</div>
         <div v-for="(item, index) in infoTypeList" :key="index" class="infoType-item">
         <div v-for="(item, index) in infoTypeList" :key="index" class="infoType-item">
           <div class="infoType-btn" @click="changeBtnType(item.value)" :class="infoTypeData.indexOf(item.value) !== -1 ? 'infoTypeActive' : ''">{{item.title}}</div>
           <div class="infoType-btn" @click="changeBtnType(item.value)" :class="infoTypeData.indexOf(item.value) !== -1 ? 'infoTypeActive' : ''">{{item.title}}</div>
           <div class="infoType-msg">{{item.desc}}</div>
           <div class="infoType-msg">{{item.desc}}</div>
         </div>
         </div>
       </div>
       </div>
       <div class="bottom-btn-wrap">
       <div class="bottom-btn-wrap">
-        <div class="bottom-btn cancel" @click="reset" :class="isChange?'thisChange':''">重置</div>
+        <button class="bottom-btn cancel" @click="reset" :disabled="infoTypeData.length === 0">重置</button>
         <div class="bottom-btn enter" @click="confirm">确认</div>
         <div class="bottom-btn enter" @click="confirm">确认</div>
       </div>
       </div>
     </div>
     </div>
@@ -255,8 +255,7 @@ var subComponent = {
       userType: false, // 用户是否为付费用户
       userType: false, // 用户是否为付费用户
       userAreaAllNum: 1, // 用户可修改地区总次数
       userAreaAllNum: 1, // 用户可修改地区总次数
       infoTypeMenu: false, // 信息类型弹窗状态
       infoTypeMenu: false, // 信息类型弹窗状态
-      infoTypeData: ['全部'], // 信息类型选择列表
-      isChange: false, // 信息类型是否做过更改
+      infoTypeData: [], // 信息类型选择列表
       conf: {}, // 信息类型数据
       conf: {}, // 信息类型数据
       noAreaFreeType: false, // 免费用户未设置地区时显示弹窗
       noAreaFreeType: false, // 免费用户未设置地区时显示弹窗
       backTipShowCount: 0, // 离开页面展示弹窗次数
       backTipShowCount: 0, // 离开页面展示弹窗次数
@@ -288,7 +287,6 @@ var subComponent = {
       }
       }
     },
     },
     vSwitch: function (val) {
     vSwitch: function (val) {
-      sessionStorage.setItem('infoTypeVswitch', val)
       if (val === 'f') {
       if (val === 'f') {
         this.getUserSubscribe()
         this.getUserSubscribe()
       }
       }
@@ -730,25 +728,35 @@ var subComponent = {
     },
     },
     // 重置信息类型
     // 重置信息类型
     reset: function () {
     reset: function () {
-      if (this.isChange) {
-        this.infoTypeData = ['全部']
-        this.isChange = false
-      }
+      this.infoTypeData = []
     },
     },
     // 确认信息类型
     // 确认信息类型
     confirm: function () {
     confirm: function () {
       this.infoTypeMenu = false
       this.infoTypeMenu = false
-      // var callback = utils.getParam('callback')
-      // 如果有callback,则使用页面内部自己定义的方法来恢复和保存数据
-      if (true) {
-          try {
-              custom['_setting_save'](this.infoTypeData)
-          } catch (error) {
-              console.log(error)
+      this.saveInfoTypeChange()
+    },
+    saveInfoTypeChange: function () {
+      var _this = this
+      $.ajax({
+        type:'POST',
+        url:'/publicapply/subscribe/setUserInfo',
+        data: {
+          pageType: 'infoType',
+          infoTypeArr: this.infoTypeData.join(','),
+          vSwitch: this.vSwitch
+        },
+        success:function(res){
+          if(res.flag) {
+            if (_this.infoTypeData.length) {
+              _this.info.infoType = _this.infoTypeData.join('、')
+            } else {
+              _this.info.infoType = '全部类型'
+            }
+          } else {
+            _this.$toast(res.data.error_msg)
           }
           }
-      } else {
-          setInfoTypeFn.saveToSessionStorage(this.infoTypeData)
-      }
+        }
+      })
     },
     },
     // 关闭信息类型菜单
     // 关闭信息类型菜单
     closeInfoType: function () {
     closeInfoType: function () {
@@ -756,23 +764,15 @@ var subComponent = {
     },
     },
     // 点击按钮改变按钮状态
     // 点击按钮改变按钮状态
     changeBtnType: function (item) {
     changeBtnType: function (item) {
-      this.isChange = true
-      let thisIndex = this.infoTypeData.indexOf(item)
-      let allType = this.infoTypeData.indexOf('全部')
-      if (allType !== -1) {
-        this.infoTypeData.splice(allType,1)
-      }
-      if (item === '全部') {
-        this.infoTypeData = ['全部']
+      if (item === 'all') {
+        this.infoTypeData = []
       } else {
       } else {
+        let thisIndex = this.infoTypeData.indexOf(item)
         if (thisIndex !== -1) {
         if (thisIndex !== -1) {
-          this.infoTypeData.splice(thisIndex,1)
+          this.infoTypeData.splice(thisIndex, 1)
         } else {
         } else {
           this.infoTypeData.push(item)
           this.infoTypeData.push(item)
         }
         }
-        if (this.infoTypeData.length === 0 || this.infoTypeData.length === this.infoTypeList.length) {
-          this.infoTypeData = ['全部']
-        }
       }
       }
     },
     },
     // 跳转地区选择
     // 跳转地区选择
@@ -787,53 +787,31 @@ var subComponent = {
     getUserSubscribe: function () {
     getUserSubscribe: function () {
       let _this = this
       let _this = this
       $.ajax({
       $.ajax({
-          url: '/publicapply/free/subscribe',
-          type: 'POST',
-          success: function (res) {
-              let freeArea = JSON.stringify(res.data)
-              sessionStorage.setItem('sub_free_state', freeArea)
-              _this.UserSubscribe = res
-              _this.info.area = res.data.area
-              _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
+        url: '/publicapply/free/subscribe',
+        type: 'POST',
+        success: function (res) {
+          _this.UserSubscribe = res
+          if (res.data) {
+            _this.info.area = res.data.area
+            _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.infoTypeData = res.data.infotype || []
 
 
-              let areaArr = []
-              if (res.data) {
-                if (!res.data.area) {
-                  _this.noAreaFreeType = true
-                } else {
-                  for (const key in res.data.area) {
+            _this.info.infoType = _this.infoTypeData.length === 0 ? '全部类型' : _this.infoTypeData.join('、')
+            let areaArr = []
+            if (!res.data.area) {
+                _this.noAreaFreeType = true
+                _this.info.area = '请选择区域'
+            } else {
+                for (const key in res.data.area) {
                     areaArr.push(key)
                     areaArr.push(key)
-                  }
                 }
                 }
-              }
-              $('#menuArea').text('已选:'+ areaArr.join('、'))
-              _this.info.infoType = sessionStorage.getItem('thisUserInfoType')
+                _this.info.area = '已选:' + (areaArr.length === 0 ? '全国': areaArr.join('、'))
+            }
           }
           }
+        }
       })
       })
     },
     },
     // 关闭未选择地区提示
     // 关闭未选择地区提示
@@ -922,57 +900,3 @@ var subComponent = {
     },
     },
   },
   },
 }
 }
-
-var setInfoTypeFn = {
-  conf: {
-      sKey: 'big-setInfoType'
-  },
-  init: function () {
-      var setKey = ''
-      if (setKey) {
-          this.conf.sKey = setKey
-      }
-
-      var initData = sessionStorage.getItem(this.conf.sKey)
-      if (initData) {
-          initData = JSON.parse(initData)
-          console.log(initData)
-          // vNode.data.initInfoType = initData
-          // vueComponent.setInfoTypeState(vNode.data.initInfoType)
-      }
-  },
-  saveToSessionStorage: function (data) {
-      sessionStorage.setItem(this.conf.sKey, JSON.stringify(data))
-  }
-}
-
-var custom = {
-  _setting_save: function (setdata) {
-      if(setdata.length == 0) {
-          setdata = ''
-      } else {
-          setdata = setdata.join(',')
-      }
-      sessionStorage.setItem('thisUserInfoType', setdata)
-      let vswitch = sessionStorage.getItem('infoTypeVswitch')
-      $.ajax({
-          type:'POST',
-          url:'/publicapply/subscribe/setUserInfo',
-          data: {
-              pageType: 'infoType',
-              infoTypeArr: setdata,
-              vSwitch: vswitch
-          },
-          success:function(res){
-            sessionStorage.removeItem('infoTypeVswitch')
-              if(res.flag) {
-                  sessionStorage.removeItem('big-setInfoType')
-                  location.reload()
-              } else {
-                  vueComponent.$toast(res.data.error_msg)
-              }
-          }
-      })
-  }
-}
-setInfoTypeFn.init()

+ 93 - 46
src/web/staticres/js/wxSupersearch.js

@@ -10,11 +10,9 @@ function getUserType() {
       type: 'POST',
       type: 'POST',
       url: '/publicapply/subscribe/vipSwitch',
       url: '/publicapply/subscribe/vipSwitch',
       success: function(res) {
       success: function(res) {
-          if (res.data.vt !== 'v' ) {
-              vSwitch = 'f'
-          } else {
-              vSwitch = 'v'
-          }
+        if (res && res.data) {
+          vSwitch = res.data.vt || 'f'
+        }
       }
       }
   })
   })
 }
 }
@@ -28,11 +26,16 @@ function gotoPay() {
 }
 }
 // 获取用户是否为新用户
 // 获取用户是否为新用户
 function getUserNewType() {
 function getUserNewType() {
+  window.jyAddInfo = {
+    isUpgrade: false
+  }
   $.ajax({
   $.ajax({
       url: '/bigmember/use/isAdd',
       url: '/bigmember/use/isAdd',
       type: 'POST',
       type: 'POST',
-      success: function (res) {
-        newUserType = res.data.isUpgrade
+      success: function (r) {
+        if (r && r.data) {
+          window.jyAddInfo = r.data
+        }
       }
       }
   })
   })
 }
 }
@@ -50,7 +53,7 @@ function updateJump2() {
       location.href = '/front/vipsubscribe/toSubVipSetPage'
       location.href = '/front/vipsubscribe/toSubVipSetPage'
     }
     }
   })
   })
-  
+
 }
 }
 var nowClientHeight = document.documentElement.clientHeight || document.body.clientHeight
 var nowClientHeight = document.documentElement.clientHeight || document.body.clientHeight
 // 监听banner高度变化
 // 监听banner高度变化
@@ -420,18 +423,52 @@ var SuperSearch = {
       SuperSearch.dyDiv=true;
       SuperSearch.dyDiv=true;
     });
     });
 
 
-    //订阅
+        // 获取用户信息-用于立即订阅按钮
+    function getKeyUserInfo () {
+      // 免费用户
+      // --> 已设置10组关键词,订阅失败提示
+      // --> 小于10组
+      //    --> 历史老用户-未选择区域-提示更新
+      //           --> -选择区域-关键词列表
+      //    --> 新用户-未选择区域-关键词列表
+
+      var isOldUser = false
+      var nowKeyLength = 8
+      var isSelectArea = false
+
+     // 获取用户关键词数据
+      $.ajax({
+        url: '/publicapply/free/subscribe',
+        type: 'post',
+        success: function (res) {
+          if (res.error_code === 0 && res.data) {
+            try {
+              isSelectArea = !!res.data.area
+              nowKeyLength = res.data.keys.length
+            } catch (e) {
+              console.warn('error format keys length')
+            }
+          }
+        },
+      })
+
+      // S-直接订阅
     $("#supersearchPage #zjdy").on("tap",function(){
     $("#supersearchPage #zjdy").on("tap",function(){
       var rFlag = false;
       var rFlag = false;
       if (SuperSearch.s_words==""){
       if (SuperSearch.s_words==""){
         SuperSearch.s_words=$.trim($("#supersearchPage [name='super_searchinput']").val());
         SuperSearch.s_words=$.trim($("#supersearchPage [name='super_searchinput']").val());
         SuperSearch.s_words=SuperSearch.s_words.replace(/\s+/g," ");
         SuperSearch.s_words=SuperSearch.s_words.replace(/\s+/g," ");
       }
       }
-      if(SuperSearch.isVip){
+      if(SuperSearch.isVip ||  window.jyUserPower.member){
         $.ajax({
         $.ajax({
           type: "post",
           type: "post",
-          url: "/subscribepay/afterPay/directSubKWS",
-          data: {keys:SuperSearch.s_words},
+          url: "/publicapply/subscribe/setUserInfo",
+          data: {
+            pageType:'keyWords',
+            actionType: 'directSubKWS',
+            kws_name:SuperSearch.s_words,
+            vSwitch: vSwitch
+          },
           dataType: "json",
           dataType: "json",
           async: false,
           async: false,
           success: function(r){
           success: function(r){
@@ -451,6 +488,17 @@ var SuperSearch = {
           window.location.href = "/front/vipsubscribe/toSetKeyWordPage";
           window.location.href = "/front/vipsubscribe/toSetKeyWordPage";
         }
         }
       }else{
       }else{
+      // 免费用户
+          isOldUser = !jyAddInfo.isUpgrade
+          if (nowKeyLength >= 10) {
+            return EasyAlert.show("您已经超过订阅<br>关键字上限");
+          } else {
+            if (isSelectArea) {
+              // 执行下方原有逻辑
+            } else if (isOldUser) {
+              return $('#tipsType').show()
+            }
+          }
         $.ajax({
         $.ajax({
           type: "post",
           type: "post",
           url: "/member/swordfish/ajaxReq",
           url: "/member/swordfish/ajaxReq",
@@ -468,16 +516,15 @@ var SuperSearch = {
           }
           }
         });
         });
         if(rFlag){
         if(rFlag){
-          if (!newUserType) {
-            $('#tipsType').show()
-          } else {
             SuperSearch.setSessionStorage();
             SuperSearch.setSessionStorage();
-            window.location.href = "/wxkeyset/keyset/index";
-          }
+            window.location.href = "/front/vipsubscribe/toSetKeyWordPage";
         }
         }
       }
       }
     });
     });
-    //订阅结束==========================================================================
+      // E-直接订阅
+    }
+
+    getKeyUserInfo()
     //删除历史搜索
     //删除历史搜索
     $("#supersearchPage").on("click", " #del_history", function(){
     $("#supersearchPage").on("click", " #del_history", function(){
       if(localStorage){
       if(localStorage){
@@ -1377,26 +1424,26 @@ var SuperSearch = {
       $(".newdialog .sub-show-list").find("li[dataval='showlist']").addClass("active");
       $(".newdialog .sub-show-list").find("li[dataval='showlist']").addClass("active");
     }
     }
     var IframeOnClick = {
     var IframeOnClick = {
-      resolution: 200,  
-      iframes: [],  
-      interval: null,  
-      Iframe: function() {  
-          this.element = arguments[0];  
-          this.cb = arguments[1];   
-          this.hasTracked = false;  
-      },  
-      track: function(element, cb) {  
-          this.iframes.push(new this.Iframe(element, cb));  
-          var _this = this;  
-              this.interval = setInterval(function() { _this.checkClick(); }, this.resolution);  
-      },  
-      checkClick: function() {  
-          if (document.activeElement) {  
-              var activeElement = document.activeElement;  
-              for (var i in this.iframes) {  
-                  if (activeElement === this.iframes[i].element) { // user is in this Iframe  
-                      if (this.iframes[i].hasTracked == false) {   
-                          this.iframes[i].cb.apply(window, []);   
+      resolution: 200,
+      iframes: [],
+      interval: null,
+      Iframe: function() {
+          this.element = arguments[0];
+          this.cb = arguments[1];
+          this.hasTracked = false;
+      },
+      track: function(element, cb) {
+          this.iframes.push(new this.Iframe(element, cb));
+          var _this = this;
+              this.interval = setInterval(function() { _this.checkClick(); }, this.resolution);
+      },
+      checkClick: function() {
+          if (document.activeElement) {
+              var activeElement = document.activeElement;
+              for (var i in this.iframes) {
+                  if (activeElement === this.iframes[i].element) { // user is in this Iframe
+                      if (this.iframes[i].hasTracked == false) {
+                          this.iframes[i].cb.apply(window, []);
                           this.iframes[i].hasTracked = true;
                           this.iframes[i].hasTracked = true;
                           $.ajax({
                           $.ajax({
                               type: 'POST',
                               type: 'POST',
@@ -1410,15 +1457,15 @@ var SuperSearch = {
                                   console.log(res)
                                   console.log(res)
                               }
                               }
                           })
                           })
-                      }  
-                  } else {  
-                      this.iframes[i].hasTracked = false;  
-                  }  
-              }  
-          }  
-      }  
+                      }
+                  } else {
+                      this.iframes[i].hasTracked = false;
+                  }
+              }
+          }
+      }
   };
   };
-    
+
     $.ajax({
     $.ajax({
       type: "post",
       type: "post",
       url: "/swordfish/searchlist/paging",
       url: "/swordfish/searchlist/paging",

+ 1 - 1
src/web/templates/frontRouter/wx/collection/sess/ent_portrait.html

@@ -250,7 +250,7 @@
                     </div>
                     </div>
                     <div class="zb-time-frame border-line-t">
                     <div class="zb-time-frame border-line-t">
                         <span>数据统计范围:</span>
                         <span>数据统计范围:</span>
-                        <span>${entPortraitInfo.timeRangeStart ? new Date(entPortraitInfo.timeRangeStart * 1000).pattern('yyyy/MM/dd') : '2016'}</span>
+                        <span>${entPortraitInfo.timeRangeStart ? new Date(entPortraitInfo.timeRangeStart * 1000).pattern('yyyy/MM/dd') : ''}</span>
                         <span>-</span>
                         <span>-</span>
                         <span>${entPortraitInfo.timeRangeEnd ? new Date(entPortraitInfo.timeRangeEnd * 1000).pattern('yyyy/MM/dd') : '至今'}</span>
                         <span>${entPortraitInfo.timeRangeEnd ? new Date(entPortraitInfo.timeRangeEnd * 1000).pattern('yyyy/MM/dd') : '至今'}</span>
                     </div>
                     </div>

+ 9 - 3
src/web/templates/weixin/vipsubscribe/vip_purchase.html

@@ -761,6 +761,8 @@
               data: function () {
               data: function () {
                 return {
                 return {
                   sessKey: '$data-vipsubscribe_new_goods_order',
                   sessKey: '$data-vipsubscribe_new_goods_order',
+                  // 返回提示标志,为true则返回时不弹出提示
+                  iDoNotNeedConfirmed: true,
                   dialog: {
                   dialog: {
                     backTip: false,
                     backTip: false,
                     backTipShowCount: 0
                     backTipShowCount: 0
@@ -790,6 +792,11 @@
                 this.init(this.$data)
                 this.init(this.$data)
                 this.restoreState()
                 this.restoreState()
                 this.getBuyInfo()
                 this.getBuyInfo()
+                // 解决ios从上个页面返回触发popstate的问题
+                // 基本逻辑:刚进入页面100ms内不允许触发popstate请求
+                setTimeout(function () {
+                  this.iDoNotNeedConfirmed = false
+                }.bind(this), 100)
               },
               },
               methods: {
               methods: {
                 // 获取已购买信息
                 // 获取已购买信息
@@ -810,9 +817,7 @@
                 toBuyAreaPack: function () {
                 toBuyAreaPack: function () {
                   this.dialog.backTip = false
                   this.dialog.backTip = false
                   this.saveState()
                   this.saveState()
-                  setTimeout(function () {
-                    location.href = '/areaPack/wx/page/buy'
-                  }, 20)
+                  location.href = '/areaPack/wx/page/buy'
                 },
                 },
                 restoreState: function () {
                 restoreState: function () {
                   var k = sessionStorage.getItem(this.sessKey)
                   var k = sessionStorage.getItem(this.sessKey)
@@ -836,6 +841,7 @@
                     history.pushState(pushContent, null, pushContent.url);
                     history.pushState(pushContent, null, pushContent.url);
                   }
                   }
                   $(window).on('popstate', function () {
                   $(window).on('popstate', function () {
+                    if (_this.iDoNotNeedConfirmed) return
                     _this.dialog.backTip = true
                     _this.dialog.backTip = true
                     _this.dialog.backTipShowCount++
                     _this.dialog.backTipShowCount++
                   })
                   })