Ver Fonte

feat:pc订阅搜索优化

yangfeng há 3 anos atrás
pai
commit
f53f7add78

+ 160 - 156
src/jfw/modules/app/src/web/templates/weixin/search/tabSearch.html

@@ -594,162 +594,165 @@
     }
 
     .cor-list-item {
-            display: flex;
-            flex-direction: column;
-            justify-content: space-between;
-            padding: .28rem .32rem;
-        }
-        .cor-list-item:after {
-            left: .32rem;
-        }
-        .cor-item-left {
-            display: flex;
-        }
-        .cor-item-right {
-            display: flex;
-            justify-content: flex-end;
-            align-items: center;
-        }
-        .cor-item-right .j-icon {
-            width: .4rem;
-            height: .4rem;
-        }
-        .cor-item-l-r {
-            margin: 0 .16rem;
-            flex: 1;
-        }
-        .cor-item-title {
-            margin-bottom: .12rem;
-            font-size: .28rem;
-            font-weight: 700;
-            line-height: .4rem;
-            color: #171826;
-        }
-        .cor-item-info,
-        .cor-item-location {
-            display: flex;
-            align-items: center;
-            font-size: .24rem;
-            line-height: .36rem;
-            color: #5F5E64;
-        }
-        .cor-item-location {
-            margin-top: .12rem;
-            font-size: .22rem;
-            color: #5F5E64;
-        }
-        .cor-item-project {
-            margin-right: .48rem;
-        }
-        .cor-item-right .more-action{
-          display: flex;
-          align-items: center;
-        }
-        .cor-item-right .more-action .j-icon{
-          margin-right: .08rem;
-        }
-        .tooltip{
-          margin-left: .32rem;
-        }
-        .keywordpopup{
-          z-index: 2100;
-        }
-        .onekey-sub-dialog .van-dialog__header{
-          padding-top: 24px;
-          color: #171826;
-          font-size: .36rem;
-        }
-        .onekey-sub-dialog .sub-dialog-message{
-          font-size: .3rem;
-          color: #5F5E64;
-          line-height: .44rem;
-          text-align: justify;
-        }
-        .onekey-sub-dialog .van-cell{
-          margin-top: .32rem;
-          border: 1px solid rgba(0, 0, 0, 0.1);
-          border-radius: 4px;
-          font-size: .3rem;
-        }
-        .onekey-sub-dialog .sub-dialog-checkbox{
-          margin: .48rem 0 .2rem;
-        }
-        .onekey-sub-dialog .van-checkbox__icon--checked .van-icon{
-          color: #fff;
-          background: #2ABED1;
-          border-color: #2ABED1;
-        }
-        .onekey-sub-dialog .sub-dialog-checkbox .van-checkbox__label{
-          font-size: .24rem;
-          color: #9B9CA3;
-        }
-        .onekey-sub-dialog .van-dialog__content{
-          padding: 0;
-        }
-        .onekey-sub-dialog .sub-dialog-content{
-          padding: 0.16rem 0.6rem
-        }
-        .onekey-sub-dialog .sub-dialog-footer{
-          position: relative;
-          display: flex;
-          overflow: hidden;
-          -webkit-user-select: none;
-          user-select: none;
-        }
-        .onekey-sub-dialog .sub-dialog-footer::after{
-          position: absolute;
-          box-sizing: border-box;
-          content: ' ';
-          pointer-events: none;
-          top: -50%;
-          right: -50%;
-          bottom: -50%;
-          left: -50%;
-          border: 0 solid #ebedf0;
-          -webkit-transform: scale(.5);
-          transform: scale(.5);
-          border-top-width: 1px;
-        }
-        .onekey-sub-dialog .sub-button{
-          position: relative;
-          flex: 1;
-          height: 48px;
-          margin: 0;
-          border: 0;
-          font-size: .36rem;
-          line-height: 26px;
-          background: transparent;
-        }
-        .onekey-sub-dialog .sub-button::before{
-          position: absolute;
-          top: 50%;
-          left: 50%;
-          width: 100%;
-          height: 100%;
-          background-color: #000;
-          border: inherit;
-          border-color: #000;
-          border-radius: inherit;
-          -webkit-transform: translate(-50%,-50%);
-          transform: translate(-50%,-50%);
-          opacity: 0;
-          content: ' ';
-        }
-        .onekey-sub-dialog .sub-button-confirm{
-          color: #2ABED1;
-        }
-        .onekey-sub-dialog .sub-button-confirm:disabled{
-          opacity: 0.5;
-        }
-        .sub-area-picker .van-picker-column__item{
-          width: 100%;
-        }
-        .sub-area-picker .van-picker__cancel,.sub-area-picker .van-picker__confirm{
-          font-size: 16px;
-        }
-        .sub-area-picker .van-picker__confirm{
-          color: #2ABED1;
-        }
+        display: flex;
+        flex-direction: column;
+        justify-content: space-between;
+        padding: .28rem .32rem;
+    }
+    .cor-list-item:after {
+        left: .32rem;
+    }
+    .cor-item-left {
+        display: flex;
+    }
+    .cor-item-right {
+        display: flex;
+        justify-content: flex-end;
+        align-items: center;
+    }
+    .cor-item-right .j-icon {
+        width: .4rem;
+        height: .4rem;
+    }
+    .cor-item-l-r {
+        margin: 0 .16rem;
+        flex: 1;
+    }
+    .cor-item-title {
+        margin-bottom: .12rem;
+        font-size: .28rem;
+        font-weight: 700;
+        line-height: .4rem;
+        color: #171826;
+    }
+    .cor-item-info,
+    .cor-item-location {
+        display: flex;
+        align-items: center;
+        font-size: .24rem;
+        line-height: .36rem;
+        color: #5F5E64;
+    }
+    .cor-item-location {
+        margin-top: .12rem;
+        font-size: .22rem;
+        color: #5F5E64;
+    }
+    .cor-item-project {
+        margin-right: .48rem;
+    }
+    .cor-item-right .more-action{
+      display: flex;
+      align-items: center;
+    }
+    .cor-item-right .more-action .j-icon{
+      margin-right: .08rem;
+    }
+    .tooltip{
+      margin-left: .32rem;
+    }
+    .keywordpopup{
+      z-index: 2100;
+    }
+    .onekey-sub-dialog .van-dialog__header{
+      padding-top: 24px;
+      color: #171826;
+      font-size: .36rem;
+    }
+    .onekey-sub-dialog .sub-dialog-message{
+      font-size: .3rem;
+      color: #5F5E64;
+      line-height: .44rem;
+      text-align: justify;
+    }
+    .onekey-sub-dialog .van-cell{
+      margin-top: .32rem;
+      border: 1px solid rgba(0, 0, 0, 0.1);
+      border-radius: 4px;
+      font-size: .3rem;
+    }
+    .onekey-sub-dialog .sub-dialog-checkbox{
+      margin: .48rem 0 .2rem;
+    }
+    .onekey-sub-dialog .van-checkbox__icon--checked .van-icon{
+      color: #fff;
+      background: #2ABED1;
+      border-color: #2ABED1;
+    }
+    .onekey-sub-dialog .sub-dialog-checkbox .van-checkbox__label{
+      font-size: .24rem;
+      color: #9B9CA3;
+    }
+    .van-cell__right-icon{
+      color: #C0C4CC;
+    }
+    .onekey-sub-dialog .van-dialog__content{
+      padding: 0;
+    }
+    .onekey-sub-dialog .sub-dialog-content{
+      padding: 0.16rem 0.6rem
+    }
+    .onekey-sub-dialog .sub-dialog-footer{
+      position: relative;
+      display: flex;
+      overflow: hidden;
+      -webkit-user-select: none;
+      user-select: none;
+    }
+    .onekey-sub-dialog .sub-dialog-footer::after{
+      position: absolute;
+      box-sizing: border-box;
+      content: ' ';
+      pointer-events: none;
+      top: -50%;
+      right: -50%;
+      bottom: -50%;
+      left: -50%;
+      border: 0 solid #ebedf0;
+      -webkit-transform: scale(.5);
+      transform: scale(.5);
+      border-top-width: 1px;
+    }
+    .onekey-sub-dialog .sub-button{
+      position: relative;
+      flex: 1;
+      height: 48px;
+      margin: 0;
+      border: 0;
+      font-size: .36rem;
+      line-height: 26px;
+      background: transparent;
+    }
+    .onekey-sub-dialog .sub-button::before{
+      position: absolute;
+      top: 50%;
+      left: 50%;
+      width: 100%;
+      height: 100%;
+      background-color: #000;
+      border: inherit;
+      border-color: #000;
+      border-radius: inherit;
+      -webkit-transform: translate(-50%,-50%);
+      transform: translate(-50%,-50%);
+      opacity: 0;
+      content: ' ';
+    }
+    .onekey-sub-dialog .sub-button-confirm{
+      color: #2ABED1;
+    }
+    .onekey-sub-dialog .sub-button-confirm:disabled{
+      opacity: 0.5;
+    }
+    .sub-area-picker .van-picker-column__item{
+      width: 100%;
+    }
+    .sub-area-picker .van-picker__cancel,.sub-area-picker .van-picker__confirm{
+      font-size: 16px;
+    }
+    .sub-area-picker .van-picker__confirm{
+      color: #2ABED1;
+    }
 </style>
 
 <!--S-Loading-->
@@ -1841,6 +1844,7 @@
       <div class="sub-dialog-message">剑鱼标讯推荐您将搜索词 <span style="color: #2ABED1;">“${sub.keyWords}”</span> 添加到您的订阅中,以保证及时接收项目信息。</div>
       <van-field
         v-if="sub.showArea"
+        :border="false"
         readonly
         clickable
         name="picker"

+ 18 - 18
src/web/staticres/js/superSearch.js

@@ -756,8 +756,8 @@ function getVIPData(clickpaging){
 function beforeSubmit(n){
   // n有值即执行的是点击搜索按钮或回车搜索事件
   // n有值且关键词不为空时 存sessionStorage值
-  if (n == 'F' && $("#zbSeatchT [name='keywords']").val() !=="") {
-    sessionStorage.setItem('is-click-search', n)
+  if ($("#zbSeatchT [name='keywords']").val() !=="") {
+    sessionStorage.setItem('is-click-search', 1)
   } else {
     sessionStorage.removeItem('is-click-search')
   }
@@ -960,22 +960,22 @@ function searchOnsubmit(clickpaging){
 		$(".nbprev").addClass("disabled");
 	}
 	var param = {
-				pageNumber: currentPage,
-				reqType: "bidSearch",
-				searchvalue: $("#zbSeatchT [name='keywords']").val(),
-				area: $("#zbSeatchT [name='area']").val(),
-				subtype: $("#zbSeatchT [name='subtype']").val(),
-				publishtime: $("#zbSeatchT [name='publishtime']").val(),
-				selectType : this_selectType || 'title',
-				minprice : $("#zbSeatchT [name='minprice']").val(),
-				maxprice : $("#zbSeatchT [name='maxprice']").val(),
-				industry : $("#zbSeatchT [name='industry']").val(),
-        tabularflag: "Y",
-        buyerclass: $("#zbSeatchT [name='buyerclass']").val(),
-        buyertel: $("#zbSeatchT [name='buyertel']").val(),
-        winnertel: $("#zbSeatchT [name='winnertel']").val(),
-		notkey: $(".not-key-input-group input").val().slice(0, 10)
-			};
+    pageNumber: currentPage,
+    reqType: "bidSearch",
+    searchvalue: $("#zbSeatchT [name='keywords']").val(),
+    area: $("#zbSeatchT [name='area']").val(),
+    subtype: $("#zbSeatchT [name='subtype']").val(),
+    publishtime: $("#zbSeatchT [name='publishtime']").val(),
+    selectType : this_selectType || 'title',
+    minprice : $("#zbSeatchT [name='minprice']").val(),
+    maxprice : $("#zbSeatchT [name='maxprice']").val(),
+    industry : $("#zbSeatchT [name='industry']").val(),
+    tabularflag: "Y",
+    buyerclass: $("#zbSeatchT [name='buyerclass']").val(),
+    buyertel: $("#zbSeatchT [name='buyertel']").val(),
+    winnertel: $("#zbSeatchT [name='winnertel']").val(),
+    notkey: $(".not-key-input-group input").val().slice(0, 10)
+  };
 	$.post("/front/pcAjaxReq",param,function(r){
 		if(r.limitFlag){
 			LimitClass.limitFlag = true;

+ 11 - 10
src/web/templates/pc/index.html

@@ -305,7 +305,7 @@
                                       position: '首页-最新公告上方'
                                     },
                                     success: function(res) {
-                                        console.log(res)
+                                        // console.log(res)
                                     }
                                 })
                             }
@@ -329,7 +329,7 @@
                       });
                       getAjaxAdv()
                       var frames = document.getElementById("iframeu6603897_0");
-                      console.log(frames, 'frames')
+                      // console.log(frames, 'frames')
                       IframeOnClick.track(frames, function() {
                         jQuery(document).click();
                       });
@@ -806,7 +806,7 @@ $(function () {
     }else{
       console.log("11号后或者2号前")
     }
-    console.log(loginflag, '登录or未登录')
+    // console.log(loginflag, '登录or未登录')
     // 从login.js isAdd接口取大会员状态  赋值给全局变量
     clearInterval(memberTimer)
     var memberTimer = setInterval(() => {
@@ -940,7 +940,7 @@ var timer=null,timer1 = null
           clearInterval(timer)
           clearInterval(timer1)
           var that = this,l = $(this).find('img').position().top
-          console.log($(this).find('img').position().top)
+          // console.log($(this).find('img').position().top)
               timer1 = setInterval(function(){
                 if(l < 0){
                     l += 64;
@@ -1063,7 +1063,7 @@ if(right_img_index > 0){
 
 // 首页底部广告位
 {{$bottom:=(Ad "jy_pc_index_bottom" -1)}}
-console.log({{$bottom}})
+// console.log({{$bottom}})
 var bottom_img = ({{$bottom}})
 
 $('.pc-index-bottom .bottom-member-ad').attr('src', bottom_img[0].s_pic)
@@ -1173,12 +1173,13 @@ $(function(){
 })
 
 function zbSeatch(id){
-  // if (window.memberStatus || window.vipStatus || window.entniche) {
-  //   $("#"+id).attr('action', '/jylab/supsearch/index.html?publishtime=fiveYear').submit()
-  // } else {
-  //   $("#"+id).attr('action', '/jylab/supsearch/index.html').submit()
-  // }
+  if ($("#keywords").val()!=="" && $('.tips span.active').text() == '招标搜索') {
+    sessionStorage.setItem('is-click-search', 1)
+  } else {
+    sessionStorage.removeItem('is-click-search')
+  }
   $("#"+id).submit();
+  
 }
 </script>
 {{include "/common/baiducc.html"}}

+ 35 - 29
src/web/templates/pc/supsearch.html

@@ -408,20 +408,11 @@ $(function(){
 	//
 	$("#searchinput").focus();
 	if(searchvalue!=""&&searchvalue!=null){
-		$(".wx-inner-bottom").html('');
+		// $(".wx-inner-bottom").html('');
 		$("#t-clear").show();
 		// $("#newsclass").show();
 		// $("#newsnow").hide();
 		nbflag = true;
-    // console.log("是否是付费用户:" ,vipState, "免费用户订阅管理是否订阅区域:",searchInnerVue.freeSubArea);
-    // 未输入关键词或免费用户输入关键词但订阅管理-订阅区域为空时 不能订阅
-    if (!vipState && !searchInnerVue.freeSubArea) {
-      $(".wx-inner-bottom").html('微信扫一扫<br>随时随地掌握招标信息');
-		  $(".wx-inner-title").html('扫码关注剑鱼标讯');
-      return
-    }
-		$(".wx-inner-bottom").html('微信扫一扫,及时获取<span class="side-bar-bottom-font">“'+keys+'”</span>相关招标信息');
-		$(".wx-inner-title").html('扫码订阅关键词');
 		if(list == null || list.length == 0){
 			$(".tabContainer").hide();
 			$(".pagination").hide();
@@ -2303,25 +2294,10 @@ document.querySelector(".searchControl").oncopy = function(){
     mounted: function () {
       console.log('总页码:' + totalPage + ',当前页:' + currentPage + ',一页数量:' + pageSize + ',总条数:' + totalCount)
       var isClickSearch = sessionStorage.getItem('is-click-search')
-      // console.log('是否手动进行的搜索', isClickSearch);
-      // 当前搜索有关键词且返回的有搜索结果且执行的是搜索点击事件时
-      if(totalCount > 0 && isClickSearch) {
-        var _this = this
-        $.ajax({
-          type:'get',
-          url:'/bigmember/subscribe/freeUser/searchSubscribe',
-          success: function(r){
-            if (r.data) {
-              _this.sub.showArea = r.data.areaSet
-              _this.freeSubArea = r.data.freeArea
-              if (r.data.prompt) {
-                _this.subDialog = true
-              } else {
-                _this.subDialog = false
-              }
-            }
-          }
-        })
+      var val =  $("#zbSeatchT [name='keywords']").val()
+      // 当前搜索有关键词且执行的是搜索点击事件且有搜索结果时
+      if(val && isClickSearch && totalCount > 0) {
+        this.getFreeSub()
       }
     },
     methods: {
@@ -2385,6 +2361,34 @@ document.querySelector(".searchControl").oncopy = function(){
           }
         }
       },
+      // 校验免费用户是否满足搜索订阅
+      getFreeSub: function() {
+        var _this = this
+        var val =  $("#zbSeatchT [name='keywords']").val()
+        $.ajax({
+          type:'get',
+          url:'/bigmember/subscribe/freeUser/searchSubscribe',
+          success: function(r){
+            if (r.data) {
+              _this.sub.showArea = r.data.areaSet
+              _this.freeSubArea = r.data.freeArea
+              if (r.data.prompt) {
+                _this.subDialog = true
+              } else {
+                _this.subDialog = false
+              }
+              // 未输入关键词或免费用户输入关键词但订阅管理-订阅区域为空时 不能订阅
+              if (!r.data.freeArea) {
+                $(".wx-inner-bottom").html('微信扫一扫<br>随时随地掌握招标信息');
+                $(".wx-inner-title").html('扫码关注剑鱼标讯');
+              } else {
+                $(".wx-inner-bottom").html('微信扫一扫,及时获取<span class="side-bar-bottom-font">“'+val+'”</span>相关招标信息');
+                $(".wx-inner-title").html('扫码订阅关键词');
+              }
+            }
+          }
+        })
+      },
       // 一键订阅
       oneKeySub: function(type) {
         // console.log(typeof type);
@@ -2407,6 +2411,8 @@ document.querySelector(".searchControl").oncopy = function(){
               if (type) { // 选择的一键订阅
                 _this.subDialog = false
                 _this.successDialog = true
+                // 一键订阅成功后区域设置可能已更改再执查询一次是否已设置区域,为了筛选-后面的二维码转化
+                _this.getFreeSub()
               } else { // 选择的暂不订阅
                 _this.subDialog = false
               }

+ 4 - 0
src/web/templates/weixin/search/tabSearch.html

@@ -629,6 +629,9 @@
       font-size: .24rem;
       color: #9B9CA3;
     }
+    .van-cell__right-icon{
+      color: #C0C4CC;
+    }
     .onekey-sub-dialog .van-dialog__content{
       padding: 0;
     }
@@ -1601,6 +1604,7 @@
       <van-field
         v-if="sub.showArea"
         readonly
+        :border="false"
         clickable
         name="picker"
         :value="sub.region"