Jelajahi Sumber

feat: 兴趣偏好设置页面部门显示逻辑调整

cuiyalong 1 tahun lalu
induk
melakukan
46275ffaef

+ 23 - 1
src/web/staticres/frontRouter/pc/user/js/set_favorite.js

@@ -39,7 +39,7 @@ var favorite = new Vue({
             userBindInfo: null,
             wxDialogShow: false,
             timer: null,
-            currentSwitchKey: null
+            currentSwitchKey: null,
         }
     },
     computed: {},
@@ -151,6 +151,22 @@ var favorite = new Vue({
                 }
             }
         },
+        checkShowPosition: function () {
+            if (this.selectInfo.position) {
+                var position = this.selectInfo.position.join('')
+                var show = position.indexOf('总裁') === -1 && position.indexOf('总经理')=== -1
+                return show
+            } else {
+                return false
+            }
+        },
+        checkShowLine: function (iitem) {
+            if (iitem.key === 'department') {
+                return this.checkShowPosition()
+            } else {
+                return true
+            }
+        },
         setCompanyBlur () {
           setTimeout(() => {
             this.showSearchResult=false
@@ -239,6 +255,12 @@ var favorite = new Vue({
                     params[key] = codesArr[key]
                 }
             }
+
+            var showPosition = this.checkShowPosition()
+            if (!showPosition) {
+                delete params.department
+            }
+
             // var platform = 'pc'
             // 已关注公众号&跳过设置时,将默认开始所有微信提醒
             // if(!type && this.userBindInfo.state === 3) {

+ 1 - 1
src/web/templates/frontRouter/pc/user/sess/set_favorite.html

@@ -49,7 +49,7 @@
                         <!-- item.type: 1多选 2彩色按钮 5单个输入框 -->
                         <!-- 职位 -->
                         <div class="key_condition" v-if="item.type === 1 || item.type === 2" :data-key="item.key" :class="{'has-more-color': item.type === 2}">
-                            <div class="key_condition_item" v-for="(iitem, iindex) in item.data" :key="iindex">
+                            <div class="key_condition_item" v-for="(iitem, iindex) in item.data" :key="iindex" v-show="checkShowLine(iitem)">
                                 <div class="key_condition_item_label" v-if="iitem.title">${iitem.title}</div>
                                 <div class="key_condition_item_content" v-if="iitem.choose">
                                     <span