Browse Source

fix:招标搜素页关键词处理方法未获取到vue实例修改、未登录标讯详情页未获取到节点报错修改

zhangsiya 1 year ago
parent
commit
9dd2000c78
2 changed files with 20 additions and 14 deletions
  1. 12 9
      src/web/staticres/js/superSearch.js
  2. 8 5
      src/web/staticres/tags/js/no-login-detail.js

+ 12 - 9
src/web/staticres/js/superSearch.js

@@ -35,7 +35,7 @@ $(function() {
     let selectMinPrices = $(".PriceInput [name='minprice']").val();
 		let selectMaxPrices =  $(".PriceInput [name='maxprice']").val();
     console.log(selectMinPrices,selectMaxPrices)
-    
+
     if(selectMinPrices && selectMaxPrices){
       let val = selectMinPrices+'万'+'~'+selectMaxPrices+'万'
       $('.selectorMoney .valueBox .title').text(val)
@@ -1621,7 +1621,7 @@ function distributeInit(){
         if(r.data.admin_system || r.data.admin_department){
           $('#right-distribute').show();
           $('.line-distribute').show();
-        }  
+        }
       }
     }
   })
@@ -1630,7 +1630,7 @@ function distributeInit(){
   $('#right-distribute').off('click').bind('click',function(e){
     e.stopPropagation()
     let len = $('.custom-checkbox:not(".check-all"):checked').length;
-    let checkedArea = [] 
+    let checkedArea = []
     let checked_id = []
     $('.custom-checkbox:not(".check-area"):checked').each(function(){
       if ($(this).attr('data-area')) {
@@ -1646,7 +1646,7 @@ function distributeInit(){
         person_Dialog.selectAreas = checkedArea
       }else{
         // 无地区
-        person_Dialog.selectArea = []  
+        person_Dialog.selectArea = []
       }
       person_Dialog.titleMsg = '选择接收人员' // 设置弹窗标题
       person_Dialog.searchVal = ''
@@ -1722,7 +1722,7 @@ function joinBidsClick() {
     e.stopPropagation()
     var $that = $(this)
     var checked = $(this).hasClass('checked')
-    var checkedId =  $(this).attr('dataid')   
+    var checkedId =  $(this).attr('dataid')
     if (checked) {
       toastFn('如需终止参标,需要在详情页进行操作。', 800)
     } else {
@@ -1948,10 +1948,13 @@ function getWhetherInAntiSpiderWhiteList () {
         // 延迟执行,需要等到Vue实例初始化, clear按钮事件绑定完成, whitelist内容获取完成之后在校验
         var urlSearchValue = getParam('keywords')
         if (urlSearchValue && !onAntiSpiderWhitelist) {
-          setTimeout(function () {
-            var hasCommonWords = checkAndClearTextIncludesCommonWords(searchvalue || urlSearchValue)
-            if (hasCommonWords) {
-              showToast('请输入项目名称等关键词')
+          var timer = setInterval(function () {
+            if (typeof searchInnerVue === 'object' ) {
+              clearInterval(timer)
+              var hasCommonWords = checkAndClearTextIncludesCommonWords(searchvalue || urlSearchValue)
+              if (hasCommonWords) {
+                showToast('请输入项目名称等关键词')
+              }
             }
           }, 500)
         }

+ 8 - 5
src/web/staticres/tags/js/no-login-detail.js

@@ -1079,11 +1079,14 @@ function companyAdd(){
   }
 
   function getElementLeft(element){
-    var actualLeft = element.offsetLeft;
-    var current = element.offsetParent;
-    while (current !== null){
-      actualLeft += current.offsetLeft;
-      current = current.offsetParent;
+    var actualLeft = 0
+    if(element) {
+      actualLeft = element.offsetLeft;
+      var current = element.offsetParent;
+      while (current !== null){
+        actualLeft += current.offsetLeft;
+        current = current.offsetParent;
+      }
     }
     return actualLeft;
   }