瀏覽代碼

fix: 免费用户搜索超500条弹出提示窗

熊啸云 3 年之前
父節點
當前提交
5305bbd133

+ 39 - 0
src/jfw/modules/app/src/web/staticres/jyapp/js/searchindex.js

@@ -1,4 +1,25 @@
 var nowClientHeight = document.documentElement.clientHeight || document.body.clientHeight
+var userReadnum = 0
+var vSwitch = 'f'
+// 判断用户权限版本
+function getUserType() {
+  $.ajax({
+      type: 'POST',
+      url: '/publicapply/subscribe/vipSwitch',
+      success: function(res) {
+        vSwitch = res.data.vt || 'f'
+      }
+  })
+}
+getUserType()
+function hiddenTips() {
+  $('#UserTips').hide()
+}
+function updateJump() {
+  $('#UserTips').hide()
+  location.href = '/jyapp/areaPack/page/buy?type=buy'
+}
+
 $(function () {
   // var vConsole = new VConsole();
   if(mySysIsIos()){//ios登陆后页面不刷新;导致重复登陆
@@ -1006,6 +1027,15 @@ var SuperSearch = {
             data: SuperSearch.reqParam,
             dataType: 'json',
             success: function(data){
+              if (vSwitch === 'f') {
+                userReadnum += data.list.length
+                if (userReadnum >= 500) {
+                  // 展示提示窗
+                  $('#UserTips').show()
+                } else {
+                  $('#UserTips').hide()
+                }
+              }
               //没有数据
               if(data["list"] == null || data["list"].length == 0){
                 SuperSearch.noMoreData();
@@ -1353,6 +1383,15 @@ var SuperSearch = {
       data: SuperSearch.reqParam,
       dataType: "json",
       success: function(data){
+        if (vSwitch === 'f') {
+          userReadnum += data.list.length
+          if (userReadnum >= 500) {
+            // 展示提示窗
+            $('#UserTips').show()
+          } else {
+            $('#UserTips').hide()
+          }
+        }
         SuperSearch.secondList=data.secondList;
         SuperSearch.secondFlag=data.secondFlag;
         SuperSearch.secondKWS=data.secondKWS;

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

@@ -125,9 +125,85 @@
     }
 
 </style>
+<style>
+    .oldUserTips{
+        position: fixed;
+        top: 0;
+        left: 0;
+        right: 0;
+        bottom: 0;
+        z-index: 99999;
+        background-color:rgba(0, 0, 0, 0.7);
+        display: none;
+    }
+    .updateTips-wrap{
+        width: 6.06rem;
+        height: 3.74rem;
+        background: #FFFFFF;
+        border-radius: 0.16rem 0.16rem 0.16rem 0.16rem;
+        position: absolute;
+        top: 50%;
+        left: 50%;
+        transform: translateX(-50%) translateY(-50%);
+    }
+    .updateTips-title{
+        text-align: center;
+        padding-top: 0.48rem;
+        font-size: 0.36rem;
+        font-weight: 500;
+        color: #161826;
+    }
+    .updateTips-text{
+        text-align: left;
+        padding: 0.16rem 0.6rem 0.1rem;
+        font-size: 0.3rem;
+        font-weight: 500;
+        color: #5E5E64;
+        line-height: 0.44rem;
+    }
+    .updateTips-btnWrap{
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        margin-top: 0.32rem;
+        border-top:0.02rem solid rgba(0, 0, 0, 0.1) ;
+    }
+    .updateTips-btn{
+        font-size: 0.36rem;
+        font-weight: 500;
+        color: #161826;
+        width: 50%;
+        height: 0.92rem;
+        line-height: 0.92rem;
+        text-align: center;
+        cursor: pointer;
+    }
+    .updateTips-line{
+        height: 0.92rem;
+        width: 0.02rem;
+        background-color: rgba(0, 0, 0, 0.1);
+    }
+    .levelUp{
+        color: #2ABDD1;
+    }
+    #freeArea{
+        color: #2ABDD1;
+    }
+</style>
 <div id="jyKeepComponent">
     <keep-component ref="vKeepComponent" @on-change-keep="changeKeepStatus" :bid="nowOpenBid" :first="false"></keep-component>
 </div>
+<div class="oldUserTips" id="UserTips">
+    <div class="updateTips-wrap">
+        <div class="updateTips-title">开通超级订阅</div>
+        <div class="updateTips-text">免费用户最多可查看500条招标搜索结果,可前往购买超级订阅解锁查看更多信息</div>
+        <div class="updateTips-btnWrap">
+            <div class="updateTips-btn" id="cancel" onclick="hiddenTips()">取消</div>
+            <div class="updateTips-line"></div>
+            <div class="updateTips-btn levelUp" id="gotoPay"  onclick="gotoPay()">去开通</div>
+        </div>
+    </div>
+</div>
 <div class="loading_Top" style="display: none;">
     <p><span></span></p>
 </div>

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

@@ -540,4 +540,64 @@
   font-weight: 500;
   color: #FA483C;
   margin-left: 0.24rem;
-}
+}
+
+  .oldUserTips{
+      position: fixed;
+      top: 0;
+      left: 0;
+      right: 0;
+      bottom: 0;
+      z-index: 99999;
+      background-color:rgba(0, 0, 0, 0.7);
+  }
+  .updateTips-wrap{
+      width: 6.06rem;
+      height: 3.4rem;
+      background: #FFFFFF;
+      border-radius: 0.16rem 0.16rem 0.16rem 0.16rem;
+      position: absolute;
+      top: 50%;
+      left: 50%;
+      transform: translateX(-50%) translateY(-50%);
+  }
+  .updateTips-title{
+      text-align: center;
+      padding-top: 0.48rem;
+      font-size: 0.36rem;
+      font-weight: 500;
+      color: #161826;
+  }
+  .updateTips-text{
+      text-align: left;
+      padding: 0.6rem 0.6rem 0.4rem;
+      font-size: 0.3rem;
+      font-weight: 500;
+      color: #5E5E64;
+      line-height: 0.44rem;
+  }
+  .updateTips-btnWrap{
+      display: flex;
+      justify-content: center;
+      align-items: center;
+  }
+  .updateTips-btn{
+      font-size: 0.36rem;
+      font-weight: 500;
+      color: #161826;
+      width: 50%;
+      height: 0.92rem;
+      line-height: 0.92rem;
+      text-align: center;
+      cursor: pointer;
+      background-color: #2ABDD1;
+      border-radius: 0.12rem;
+  }
+  .updateTips-line{
+      height: 0.92rem;
+      width: 0.02rem;
+      background-color: rgba(0, 0, 0, 0.1);
+  }
+  .levelUp{
+      color: #fff;
+  }

+ 24 - 3
src/web/staticres/common-module/vipsubscribe/js/vip-subscribe-set-template.js

@@ -171,6 +171,15 @@ var subScribeTemplate = `
       </div>
     </div>
   </div>
+  <!-- 免费用户未设置地区弹窗 -->
+  <div class="oldUserTips" v-show="noAreaFreeType">
+    <div class="updateTips-wrap">
+        <div class="updateTips-text">您的订阅区域尚未设置,为了不影响您的使用,还请您尽快完善哦</div>
+        <div class="updateTips-btnWrap">
+            <div class="updateTips-btn levelUp" id="gotoPay"  @click="gotoArea">去完善</div>
+        </div>
+    </div>
+  </div>
 </div>
 `
 
@@ -248,6 +257,7 @@ var subComponent = {
       infoTypeData: ['全部'], // 信息类型选择列表
       isChange: false, // 信息类型是否做过更改
       conf: {}, // 信息类型数据
+      noAreaFreeType: false, // 免费用户未设置地区时显示弹窗
     }
   },
   mounted () {
@@ -734,7 +744,14 @@ var subComponent = {
         }
       }
     },
-
+    // 跳转地区选择
+    gotoArea: function () {
+      if (location.href.indexOf('front') !== -1) {
+        location.href = '/areaPack/wx/page/set_area'
+      } else {
+        location.href = '/jyapp/areaPack/page/set_area'
+      }
+    },
     // 获取用户权限
     getUserSubscribe: function () {
       let _this = this
@@ -747,8 +764,12 @@ var subComponent = {
               _this.userAreaAllNum = res.data.provincenum
               // _this.$emit('UserSubscribe',res)
               let areaArr = []
-              for (const key in res.data.area) {
-                areaArr.push(key)
+              if (res.data.area === {} || res.data.areanum) {
+                _this.noAreaFreeType = true
+              } else {
+                for (const key in res.data.area) {
+                  areaArr.push(key)
+                }
               }
               $('#menuArea').text(areaArr)
           }

+ 44 - 1
src/web/staticres/js/wxSupersearch.js

@@ -1,6 +1,31 @@
 /*
 * fixed top input for zyh @date 2020/6/8
 * */
+var userReadnum = 0
+var vSwitch = 'f'
+// 判断用户权限版本
+function getUserType() {
+  $.ajax({
+      type: 'POST',
+      url: '/publicapply/subscribe/vipSwitch',
+      success: function(res) {
+          if (res.data.vt !== 'v' ) {
+              vSwitch = 'f'
+          } else {
+              vSwitch = 'v'
+          }
+      }
+  })
+}
+getUserType()
+function hiddenTips() {
+  $('#UserTips').hide()
+}
+function updateJump() {
+  $('#UserTips').hide()
+  location.href = '/areaPack/wx/page/buy?type=buy'
+}
+
 var nowClientHeight = document.documentElement.clientHeight || document.body.clientHeight
 // 监听banner高度变化
 $(function () {
@@ -971,13 +996,21 @@ var SuperSearch = {
             SuperSearch.noMoreData();
             return;
           }
-
           $.ajax({
             type: 'post',
             url: '/swordfish/searchlist/paging',
             data: SuperSearch.reqParam,
             dataType: 'json',
             success: function(data){
+              if (vSwitch === 'f') {
+                userReadnum += data.list.length
+                if (userReadnum >= 500) {
+                  // 展示提示窗
+                  $('#UserTips').show()
+                } else {
+                  $('#UserTips').hide()
+                }
+              }
               //没有数据
               if(data["list"] == null || data["list"].length == 0){
                 SuperSearch.noMoreData();
@@ -1355,12 +1388,22 @@ var SuperSearch = {
           }  
       }  
   };
+    
     $.ajax({
       type: "post",
       url: "/swordfish/searchlist/paging",
       data: SuperSearch.reqParam,
       dataType: "json",
       success: function(data){
+        if (vSwitch === 'f') {
+          userReadnum += data.list.length
+          if (userReadnum >= 500) {
+            // 展示提示窗
+            $('#UserTips').show()
+          } else {
+            $('#UserTips').hide()
+          }
+        }
         SuperSearch.secondList=data.secondList;
         SuperSearch.secondFlag=data.secondFlag;
         SuperSearch.secondKWS=data.secondKWS;

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

@@ -71,8 +71,10 @@ var subNode = new Vue({
                 success: function(res) {
                     if (res.data.vt !== 'v' ) {
                         _this.vSwitch = 'f'
+                        $('.update_renew').hide()
                     } else {
                         _this.vSwitch = 'v'
+                        $('.update_renew').show()
                     }
                 }
             })

+ 76 - 0
src/web/templates/weixin/search/mainSearch.html

@@ -438,12 +438,88 @@
         }
 
 
+    </style>
+	<style>
+        .oldUserTips{
+            position: fixed;
+            top: 0;
+            left: 0;
+            right: 0;
+            bottom: 0;
+            z-index: 99999;
+            background-color:rgba(0, 0, 0, 0.7);
+			display: none;
+        }
+        .updateTips-wrap{
+            width: 6.06rem;
+			height: 3.74rem;
+            background: #FFFFFF;
+            border-radius: 0.16rem 0.16rem 0.16rem 0.16rem;
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            transform: translateX(-50%) translateY(-50%);
+        }
+        .updateTips-title{
+            text-align: center;
+            padding-top: 0.48rem;
+            font-size: 0.36rem;
+            font-weight: 500;
+            color: #161826;
+        }
+        .updateTips-text{
+            text-align: left;
+            padding: 0.16rem 0.6rem 0.1rem;
+            font-size: 0.3rem;
+            font-weight: 500;
+            color: #5E5E64;
+            line-height: 0.44rem;
+        }
+        .updateTips-btnWrap{
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            margin-top: 0.32rem;
+            border-top:0.02rem solid rgba(0, 0, 0, 0.1) ;
+        }
+        .updateTips-btn{
+            font-size: 0.36rem;
+            font-weight: 500;
+            color: #161826;
+            width: 50%;
+            height: 0.92rem;
+            line-height: 0.92rem;
+            text-align: center;
+            cursor: pointer;
+        }
+        .updateTips-line{
+            height: 0.92rem;
+            width: 0.02rem;
+            background-color: rgba(0, 0, 0, 0.1);
+        }
+        .levelUp{
+            color: #2ABDD1;
+        }
+        #freeArea{
+            color: #2ABDD1;
+        }
     </style>
 </head>
 <body  style="min-height:100vh;" class="p13">
 <div id="jyKeepComponent">
     <keep-component ref="vKeepComponent" @on-change-keep="changeKeepStatus" :bid="nowOpenBid" :first="false"></keep-component>
 </div>
+<div class="oldUserTips" id="UserTips">
+    <div class="updateTips-wrap">
+        <div class="updateTips-title">开通超级订阅</div>
+        <div class="updateTips-text">免费用户最多可查看500条招标搜索结果,可前往购买超级订阅解锁查看更多信息</div>
+        <div class="updateTips-btnWrap">
+            <div class="updateTips-btn" id="cancel" onclick="hiddenTips()">取消</div>
+            <div class="updateTips-line"></div>
+            <div class="updateTips-btn levelUp" id="gotoPay"  onclick="gotoPay()">去开通</div>
+        </div>
+    </div>
+</div>
 <div class="modal fade" data-backdrop="static"  id="homePageTap" style="display: none;align-items: center;justify-content: center;" tabindex="-1" role="dialog">
   <div class="modal-dialog" role="document">
     <div class="modal-content" style="background: unset;margin:auto;/*top: 3rem;*/">

+ 1 - 1
src/web/templates/weixin/vipsubscribe/vip_index_new.html

@@ -360,7 +360,7 @@
     </div>
     <!-- 升级 -->
     <!-- 升级 -->
-    <div class="update_renew">
+    <div class="update_renew" v-show="vSwitch === 'v'">
       <div class="update-tips" data-update-tips>因系统升级,已购买用户可选择原套餐续费,或升级到新版本享受更多权益。</div>
       <div class="footer-button-group j-button-group">
         <button class="j-button-confirm" data-bind-renew data-cl-event="c_wx_buy_buttonclick">续费</button>