Эх сурвалжийг харах

fix: 修复金额标签文本展示错误

zhangyuhan 3 жил өмнө
parent
commit
53b1a8e02d

+ 34 - 25
src/web/templates/pc/supsearch.html

@@ -86,7 +86,7 @@
     }
     return tempList.join(',')
   }
-  
+
   function formarForSelectType () {
     selectType = selectType.split(',').filter(function(v) {
       return v.length
@@ -130,12 +130,12 @@
   {{end}}
   var dataId = "";
   $(function(){
-  
+
     // console.log("是否有会员筛选权限 showVipScreen", {{.T.showVipScreen}})
-  
+
     var oInput=document.getElementById("searchinput");
     moveEnd(oInput)
-  
+
     $(".working").show();
     $('.searchname').keydown(function(e){
         if(e.keyCode == "13"){
@@ -204,7 +204,7 @@
       $("#searchinput").val("").focus();
       //$("#zbSeatchT [name='searchvalue']").val("");
     })
-  
+
     var industryhtml = '<span id="induAll" class="active">全部</span>';
     if (sortArray!=null&&sortArray.length>0){
       sortArray.forEach(function(i) {
@@ -303,7 +303,7 @@
         searchInnerVue.$refs.areaRefs.setCitySelected({})
       }
     }
-    
+
     /*
       if(areas != ""){
         $("#regionBtn").removeClass("active");
@@ -345,7 +345,7 @@
         $(this).addClass("secondActice");
       }
     });
-  
+
     //
     var reg = /^[\u4e00-\u9fa5]+$/;
     var minnum = {{.T.minprice}};
@@ -384,13 +384,13 @@
                 minnum = minp;
               }
             }
-  
+
           }
         }
       }else{
         minnum = minp;
       }
-  
+
     })
     //
     var maxnum = {{.T.maxprice}};
@@ -429,14 +429,14 @@
                 maxnum = maxp;
               }
             }
-  
+
           }
         }
       }else{
         maxnum = maxp;
       }
     })
-  
+
     // 采购单位类型
     if (buyclassArr) {
       var buyhtml = '';
@@ -450,7 +450,7 @@
         buyhtml+="</div>"
       }
       $(".buyclass-content").html(buyhtml)
-  
+
     }
     // 回显模板里返回选中的采购单位
     if (buyerclassVal){
@@ -528,7 +528,7 @@
     }
     **/
   })
-  
+
   </script>
 <script src='/js/biddingSearch.js?v={{Msg "seo" "version"}}'></script>
 <script src='/js/superSearch.js?v={{Msg "seo" "version"}}'></script>
@@ -1205,7 +1205,7 @@ var IframeOnClick = {
           <div class="save-value-bg"><span>搜索范围:</span>${curFilter.scope}</div>
           <div class="save-value-bg" v-if="curFilter.industry"><span>行业:</span>${curFilter.industry}</div>
           <div style="display: flex;">
-            <div class="save-value-bg" v-if="curFilter.price"><span>价格区间:</span>${curFilter.price}万元</div>
+            <div class="save-value-bg" v-if="curFilter.price"><span>价格区间:</span>${curFilter.price}</div>
             <div class="save-value-bg" v-if="curFilter.publishTime"><span>发布时间:</span>${curFilter.publishTime}</div>
             <div class="save-value-bg" v-if="curFilter.fileExists != '全部'"><span>附件:</span>${curFilter.fileExists}</div>
           </div>
@@ -2118,7 +2118,7 @@ if(sessionselect){
         window.addEventListener('scroll', this.watchScroll)
       })
       this.getFilterList()
-      
+
     },
     destroyed: function () {
       window.removeEventListener('scroll', this.watchScroll)
@@ -2299,10 +2299,10 @@ if(sessionselect){
           var i = arr.length;
           while (i--) {
             if (arr[i] == ele) {
-                  return true;  
-              }  
-          }  
-          return false;  
+                  return true;
+              }
+          }
+          return false;
       },
       // 校验免费用户是否满足搜索订阅
       getFreeSub: function() {
@@ -2822,7 +2822,7 @@ if(sessionselect){
         temp.keywords = item.searchvalue ? item.searchvalue : ''
         temp.scope = item.selectType ? this.formatScope(item.selectType, 'CN') : ''
         temp.industry = item.industry ? this.formatIndustry(item.industry) : ''
-        temp.price =  item.minprice || item.maxprice ? this.formatPriceScope(item.minprice, item.maxprice) : ''
+        temp.price =  this.formatPriceScope(item.minprice, item.maxprice)
         temp.publishTime = item.publishtime ? this.formatPushTime(item.publishtime) : ''
         temp.region = this.formatRegion(item.area,item.city)
         temp.infoType = item.subtype ? this.formatInfoType(item.subtype) : ''
@@ -2889,11 +2889,20 @@ if(sessionselect){
       },
       // 处理筛选数据-价格区间
       formatPriceScope: function(min, max) {
-        if (min && max) {
-          return min + '-' + max
+        var hasMin = min || (Number(min) === 0 && String(min) !== "")
+        var hasMax = max || (Number(max) === 0 && String(max) !== "")
+        var prefixUnit = '万元'
+        if (hasMin && hasMax) {
+          return min + '-' + max + prefixUnit
         } else {
-          return min || max
+          if (hasMin) {
+            return min + prefixUnit + '以上'
+          }
+          if (hasMax) {
+            return max + prefixUnit + '以下'
+          }
         }
+        return ''
       },
       // 处理筛选数据-有无联系方式
       formatContact: function(val) {
@@ -2990,7 +2999,7 @@ if(sessionselect){
                   arr.push(item)
                 })
               }
-            } 
+            }
           }
         }
         return arr.toString().replace(/,/g, ",")
@@ -3032,7 +3041,7 @@ if(sessionselect){
         if (!val) return
         return val.replaceAll(',', ' ')
       },
-      removeEmptyArrayEle: function(arr){    
+      removeEmptyArrayEle: function(arr){
         for(var i = 0; i < arr.length; i++) {
         if(!arr[i]) {
             arr.splice(i,1)