Browse Source

feat:移动端搜索时间筛选增加3年、5年

yangfeng 3 years ago
parent
commit
451c5a87c6

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

@@ -1834,6 +1834,7 @@
     <div id="tempDiv" style="display:none;"></div>
 </div>
 <div class="collection" id="date-picker-other-box"></div>
+<!-- 一键订阅关键词 -->
 <div id="oneKeySubCom">
   <van-dialog class-name="onekey-sub-dialog" v-model="subDialog" width="303px" title="订阅搜索词" :show-confirm-button="false">
     <div class="sub-dialog-content">

+ 45 - 5
src/web/staticres/common-module/collection/js/date-mobile.js

@@ -2,7 +2,10 @@ var dateComponentTemplate = `
 <div class="j-container">
   <div class="dateTags j-main" v-if="type === 'more-picker'">
       <div class="timeTag">
-          <div class="area-card-item" :class="{active:item.selected==true}" v-for="(item, index) in timeSelectList" :key="index" @click="selectFixedDate(item)">{{item.name}}</div>
+          <div class="area-card-item diy-item" :class="{active:item.selected==true}" v-for="(item, index) in timeSelectList" :key="index" @click="selectFixedDate(item)">
+            <span>{{item.name}}</span>
+            <span class="root_open" v-if="!rootopen && !item.isFree">开通</span>
+          </div>
           <div v-show="diy" class="area-card-item diy-item" :class="{active:dateStyle==true}"  @click="dateShowEvent">
                 自定义
                 <span class="root_open" v-if="!rootopen">开通</span>
@@ -150,17 +153,32 @@ var dateComponent = {
           {
             name: '最近7天',
             value: 'lately7',
-            selected: true
+            selected: true,
+            isFree: true
           },
           {
             name: '最近30天',
             value: 'lately30',
-            selected: false
+            selected: false,
+            isFree: true
           },
           {
-            name: '最近年',
+            name: '最近1年',
             value: 'lastYear',
-            selected: false
+            selected: false,
+            isFree: true
+          },
+          {
+            name: '最近3年',
+            value: 'lastThreeYear',
+            selected: false,
+            isFree: false
+          },
+          {
+            name: '最近5年',
+            value: 'lastFiveYear',
+            selected: false,
+            isFree: false
           }
         ]
       }
@@ -199,6 +217,14 @@ var dateComponent = {
       this.timeSelectList = this.datatype
       this.rootopen = true
     }
+    if (this.rootopen) {
+      this.timeSelectList.forEach(function(v) {
+        v.selected = false
+        if (v.value == "lastFiveYear") {
+          v.selected = true
+        }
+      })
+    }
     this.setState()
   },
   computed: {
@@ -399,6 +425,20 @@ var dateComponent = {
     },
     selectFixedDate: function(item) {
       if (item.selected) return
+      if (!item.isFree && !this.rootopen) {
+        var _this = this
+        this.$dialog.close()
+        this.$dialog.confirm({
+          title: '开通超级订阅',
+          message: '立享更多搜索权限<br>寻找商机更精准',
+          className: 'ent-search-dialog center-text',
+          overlayClass: 'z-2030',
+          confirmButtonText: '去开通',
+        }).then(function () {
+          _this.getWeixin()
+        }).catch(function () {});
+        return
+      }
       this.timeSelectList.forEach(v => (v.selected = false))
       item.selected = true
       this.dateStyle = false

+ 26 - 6
src/web/staticres/common-module/ent-search/ent-search-template.js

@@ -1118,7 +1118,6 @@ if (navigator.userAgent.toLowerCase().indexOf('micromessenger') === -1) {
           type: 'POST',
           url: '/entnicheNew/customer/history',
           success: function(res) {
-            console.log(res)
             if(res.error_code == 0) {
               if(res.data.list && res.data.list.length > 0) {
                 _this.entHistoryList = res.data.list
@@ -1838,17 +1837,32 @@ window.vMainSearchComponent = new Vue({
       {
         name: '最近7天',
         value: 'lately7',
-        selected: false
+        selected: false,
+        isFree: true
       },
       {
         name: '最近30天',
         value: 'lately30',
-        selected: false
+        selected: false,
+        isFree: true
       },
       {
-        name: '最近年',
+        name: '最近1年',
         value: 'lastYear',
-        selected: true
+        selected: true,
+        isFree: true
+      },
+      {
+        name: '最近3年',
+        value: 'lastThreeYear',
+        selected: false,
+        isFree: false
+      },
+      {
+        name: '最近5年',
+        value: 'lastFiveYear',
+        selected: false,
+        isFree: false
       }
     ],
       selectDate: {
@@ -2184,6 +2198,7 @@ window.vMainSearchComponent = new Vue({
       return ''
     },
     changeConditionStrMap (i, type) {
+      console.log(tempPower, '111');
       this.isSelectConditionTabs[i] = type
       var nowTabTitle = this.entTabs[i].title
       switch (nowTabTitle) {
@@ -2235,7 +2250,6 @@ window.vMainSearchComponent = new Vue({
             tempParams = this.$refs.dateComponent.resetAll()
             this.dateComponentKey = new Date().getTime()
           }
-          console.log(tempParams)
           if (tempParams && tempParams.data) {
             if (tempParams.data.start === '' && tempParams.data.end === '') {
               this.selectDate = {
@@ -2265,6 +2279,12 @@ window.vMainSearchComponent = new Vue({
               if (tempDate === 'lastYear') {
                 tempDate = 'thisyear'
               }
+              if (tempDate === 'lastThreeYear') {
+                tempDate = 'threeyear'
+              }
+              if (tempDate === 'lastFiveYear') {
+                tempDate = 'fiveyear'
+              }
             }
             this.conditionStrMap.publishtime = tempDate
             if (this.conditionStrMap.publishtime === '_' || this.conditionStrMap.publishtime === 'all') {

+ 8 - 1
src/web/staticres/common-module/ent-search/ent-search-template.prefixer.css

@@ -353,7 +353,7 @@
     font-size: 0.2rem;
     line-height: 0.32rem;
     color: #FB483D;
-    margin: 0 0.04rem;
+    /* margin: 0 0.04rem; */
     padding: 0;
     margin-left: 0.08rem;
 }
@@ -1028,3 +1028,10 @@
     font-weight: 500;
     height: 0.88rem;
 }
+/* 订阅搜索优化新增-最近3年、最近5年 */
+.v-ent-search-group .more-popup-content .timeTag .area-card-item{
+  display: flex;
+  align-items: center;
+  width: auto;
+  padding: 0.12rem 0.2rem;
+}

+ 87 - 2
src/web/staticres/js/wxSupersearch.js

@@ -190,7 +190,75 @@ function showSearchTipForTimeRange () {
   tempDom.find('span').text(tempStr)
   tempDom.show();
 }
-
+// 一键订阅
+var vOneKeySubComponent  = new Vue({
+  delimiters: ['${', '}'],
+  el: '#oneKeySubCom',
+  data: {
+    subDialog: false,
+    showAreaPicker: false,
+    sub: {
+      showArea: true,
+      keyWords: '',
+      region: '',
+      remindChecd: false
+    },
+    regionData: [
+      '安徽','澳门','北京','重庆','福建','广东','广西','贵州','甘肃','河北','湖北','黑龙江','海南','河南','湖南','吉林','江苏','江西','辽宁','内蒙古','宁夏',
+      '青海','山西','陕西','上海','山东','四川','天津','台湾','西藏','新疆','香港','云南','浙江'
+    ],
+    freeSubArea: false
+  },
+  computed: {
+    subDisabled: function () {
+      if (this.sub.showArea) {
+        return !this.sub.region
+      } else {
+        return false
+      }
+    }
+  },
+  methods: {
+    onConfirm: function() {
+      // console.log(this.$refs.subAreaPicker.getValues(), '333');
+      var value = this.$refs.subAreaPicker.getValues()
+      this.sub.region = value[0];
+      this.showAreaPicker = false;
+    },
+    // 一键订阅、暂不订阅
+    oneKeySub: function(type) {
+      var _this = this
+      var data = type ? {
+        isNoSubscribe: 'Y', // 一键订阅
+        subsequentPrompt: _this.sub.remindChecd ? 'Y' : 'N',
+        key: _this.sub.keyWords,
+        area: _this.sub.region
+      } : {
+        isNoSubscribe: 'N', // 暂不订阅
+        subsequentPrompt: _this.sub.remindChecd ? 'Y' : 'N'
+      }
+      $.ajax({
+        type:'post',
+        url: '/bigmember/subscribe/freeUser/subscribeSearch',
+        data: data,
+        success: function(r){
+          if (r.data && r.data.status) {
+            if (type) { // 选择的一键订阅
+              _this.subDialog = false
+              _this.successDialog = true
+              _this.$toast('订阅关键词成功')
+            } else { // 选择的暂不订阅
+              _this.subDialog = false
+            }
+          } else {
+            // console.log('一键订阅失败', r.error_code);
+            _this.subDialog = false
+          }
+        }
+      })
+    }
+  }
+})
 var SuperSearch = {
   // 筛选企业信息
   filterWin: {},
@@ -1548,6 +1616,24 @@ var SuperSearch = {
           $(".loading_").hide();
           return
         }else{
+          // 免费用户是否弹出一键订阅弹框
+          $.ajax({
+            type:'get',
+            url:'/bigmember/subscribe/freeUser/searchSubscribe',
+            success: function(r){
+              if (r.data) {
+                vOneKeySubComponent.sub.showArea = r.data.areaSet
+                vOneKeySubComponent.freeSubArea = r.data.freeArea
+                vOneKeySubComponent.sub.keyWords = SuperSearch.s_words
+                // console.log(SuperSearch.s_words, vOneKeySubComponent, 'SuperSearch.s_words');
+                if (r.data.prompt) {
+                  vOneKeySubComponent.subDialog = true
+                } else {
+                  vOneKeySubComponent.subDialog = false
+                }
+              }
+            }
+          })
           SuperSearch.showNull = false;
           SuperSearch.hasData();
           SuperSearch.limitFlag = data["limitFlag"]
@@ -2650,7 +2736,6 @@ var SuperSearch = {
   checkNewsVisited: function () {
     $('.home_data .data_list p[sid]').each(function () {
       var $this = $(this)
-      console.log($this)
       var id = $this.attr('sid')
       if (id) {
         var visited = visitedPath.pathVisited(

+ 6 - 6
src/web/templates/pc/supsearch.html

@@ -17,7 +17,7 @@
 <link rel="stylesheet" type="text/css" href="{{Msg "seo" "cdn"}}/pccss/public-nav-1200.css?v={{Msg "seo" "version"}}" />
 <script type="text/javascript" src="{{Msg "seo" "cdn"}}/js/public-nav.js?v={{Msg "seo" "version"}}"></script>
 <script src="{{Msg "seo" "cdn"}}/js/jquery.cookie.js"></script>
-<link href="//cdn.jsdelivr.net/npm/element-ui@2.13.2/lib/theme-chalk/index.css" rel="stylesheet" />
+<link href="//cdn-common.jianyu360.com/cdn/lib/element-ui/2.15.7/lib/theme-chalk/index.css" rel="stylesheet" />
 <link href='{{Msg "seo" "cdn"}}/css/collect-user-info.css?v={{Msg "seo" "version"}}' rel="stylesheet">
 <link href='{{Msg "seo" "cdn"}}/css/ele-reset.css?v={{Msg "seo" "version"}}' rel="stylesheet">
 <style type="text/css">
@@ -521,8 +521,8 @@ $(function(){
 	} else {
     if (vipState) {
       // 付费用户默认选择最近5年
-      selectPublishtime = 'fiveYear'
-      $(".timer [data-value='fiveYear']").addClass("active").siblings().removeClass('active');
+      selectPublishtime = 'fiveyear'
+      $(".timer [data-value='fiveyear']").addClass("active").siblings().removeClass('active');
     } else {
       // 免费用户默认选择最近1年
       selectPublishtime = 'thisyear'
@@ -1150,9 +1150,9 @@ var IframeOnClick = {
 						<li data-value="lately-7">最近7天</li>
 						<li data-value="lately-30">最近30天</li>
 						<li data-value="thisyear">最近1年</li>
-            <li data-value="threeYear" data-auth  onClick="if(!vipState) return openVipDialog();">最近3年</li>
+            <li data-value="threeyear" data-auth  onClick="if(!vipState) return openVipDialog();">最近3年</li>
             <img class="icon-vip" src="/images/biddingSearch/VIP.png" alt="">
-            <li data-value="fiveYear" data-auth  onClick="if(!vipState) return openVipDialog();">最近5年</li>
+            <li data-value="fiveyear" data-auth  onClick="if(!vipState) return openVipDialog();">最近5年</li>
             <img class="icon-vip" src="/images/biddingSearch/VIP.png" alt="">
 					</ul>
 				</div>
@@ -1588,7 +1588,7 @@ var IframeOnClick = {
 <script src='{{Msg "seo" "cdn"}}/common-module/public/js/china-map-data.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Msg "seo" "cdn"}}/common-module/selector/js/static-data.js?v={{Msg "seo" "version"}}'></script>
 <script src="https://cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js"></script>
-<script src="//cdn.jsdelivr.net/npm/element-ui@2.13.2/lib/index.js"></script>
+<script src="//cdn-common.jianyu360.com/cdn/lib/element-ui/2.15.7/lib/index.js"></script>
 <script src='{{Msg "seo" "cdn"}}/js/pc-collect-user-info.js?v={{Msg "seo" "version"}}'></script>
 <script type="text/javascript">
 $(function(){

+ 5 - 4
src/web/templates/weixin/search/mainSearch.html

@@ -27,7 +27,6 @@
 <script src="{{Msg "seo" "cdn"}}/js/dropload.js?v={{Msg "seo" "version"}}"></script>
 <script type="text/javascript" src='{{Msg "seo" "cdn"}}/common-module/collection/js/visited.js?v={{Msg "seo" "version"}}'></script>
 <script type="text/javascript" src="{{Msg "seo" "cdn"}}/js/wxEntsesearch.js?v={{Msg "seo" "version"}}"></script>
-<script type="text/javascript" src="{{Msg "seo" "cdn"}}/js/wxSupersearch.js?v={{Msg "seo" "version"}}"></script>
 <!--2.8-->
 <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wx_dataExport/css/base_myorder.css?v={{Msg "seo" "version"}}">
 <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wx_dataExport/iconfont/iconfont.css?v={{Msg "seo" "version"}}">
@@ -77,9 +76,7 @@
 	var searchWord = {{.T.searchWord}};
 	//initShare({{.T.signature}},{{.T.openid}},2,"jy_extend",{{.T.nickname}},{{.T.avatar}},"",{{.T.i_applystatus}});
   PageShareInit(2,"jy_extend","")
-	SuperSearch.ZBADDRESS = {{Msg "seo" "ZBADDRESS"}};
-	SuperSearch.industry = {{.T.industry}};
-	SuperSearch.sortArray = {{.T.sortArray}};
+	
     // 动画隐藏tab栏
     function hideTab() {
         $('.newdialog .tab-box .sub-search-title').slideUp('fast');
@@ -109,6 +106,9 @@
     }
 
 	$(function(){
+    SuperSearch.ZBADDRESS = {{Msg "seo" "ZBADDRESS"}};
+    SuperSearch.industry = {{.T.industry}};
+    SuperSearch.sortArray = {{.T.sortArray}};
         //移除账号合并代码时 误删首页弹窗 现重新加上(同app)
         showActiveTip();
         // 搜索选择的显示隐藏
@@ -973,6 +973,7 @@
 <script src='{{Msg "seo" "cdn"}}/common-module/collection/js/cate-mobile.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Msg "seo" "cdn"}}/common-module/collection/js/industry-mobile.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Msg "seo" "cdn"}}/common-module/ent-search/ent-search-template.js?v={{Msg "seo" "version"}}'></script>
+<script type="text/javascript" src="{{Msg "seo" "cdn"}}/js/wxSupersearch.js?v={{Msg "seo" "version"}}"></script>
 <script>
 	function scrollSideIconHide(el) {
 		var sNode = $('#sideIcon')

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

@@ -600,6 +600,102 @@
     #diyDateComponent .area-card-item {
         width: auto;
     }
+    .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;
+    }
 </style>
 
 <!--S-Loading-->
@@ -1497,6 +1593,45 @@
     <div id="tempDiv" style="display:none;"></div>
 </div>
 <div class="collection" id="date-picker-other-box"></div>
+<!-- 一键订阅关键词 -->
+<div id="oneKeySubCom">
+  <van-dialog class-name="onekey-sub-dialog" v-model="subDialog" width="303px" title="订阅搜索词" :show-confirm-button="false">
+    <div class="sub-dialog-content">
+      <div class="sub-dialog-message">剑鱼标讯推荐您将搜索词 <span style="color: #2ABED1;">“${sub.keyWords}”</span> 添加到您的订阅中,以保证及时接收项目信息。</div>
+      <van-field
+        v-if="sub.showArea"
+        readonly
+        clickable
+        name="picker"
+        :value="sub.region"
+        placeholder="请选择订阅区域"
+        @click="showAreaPicker = true"
+        is-link
+      ></van-field>
+      <div class="sub-dialog-checkbox">
+        <van-checkbox v-model="sub.remindChecd" icon-size="18px">后续不再提醒</van-checkbox>
+      </div>
+    </div>
+    <div class="sub-dialog-footer">
+      <button @click="oneKeySub(false)" type="button" class="sub-button sub-button-cancel van-hairline--right">暂不订阅</button>
+      <button @click="oneKeySub(true)" type="button" class="sub-button sub-button-confirm" :disabled="subDisabled">一键订阅</button>
+    </div>
+  </van-dialog>
+  <van-popup v-model="showAreaPicker" position="bottom" style="border-radius: 16px 16px 0 0;">
+    <van-picker 
+      ref="subAreaPicker"
+      class="sub-area-picker"
+      :show-toolbar="false"
+      :columns="regionData"
+    ></van-picker>
+    <div class="jyshxbottom sl-jyshxbottom">
+      <ul class="text-center j-button-group">
+          <li class="jydqreset j-button-cancel" @click="showAreaPicker = false">取消</li>
+          <li class="jydqsure j-button-confirm" @click="onConfirm">确定</li>
+      </ul>
+  </div>
+  </van-popup>
+</div>
 <!--S-底部提示-->
 <div class="resbm hidden" id="resbm">
     <div class="resbm0">