Explorar o código

Merge branch 'dev/v4.9.93_tsz' of qmx/jy into feature/v4.9.93

汤世哲 hai 6 meses
pai
achega
30a4d129c1

+ 43 - 1
src/jfw/modules/app/src/web/staticres/jyapp/big-member/css/ent_follow.css

@@ -5,6 +5,10 @@
     color: #171826;
 }
 
+.ent-grouping {
+  margin-bottom: .2rem;
+}
+
 .dot-red {
     width: .16rem;
     height: .16rem;
@@ -139,4 +143,42 @@
     margin-right: .08rem;
     width: .24rem;
     height: .24rem;
-}
+}
+
+.ent-grouping .grouping-list {
+  display: flex;
+  flex-wrap: wrap;
+}
+
+.ent-grouping .grouping-list .grouping-item {
+  margin: 0 .16rem .16rem 0;
+  padding: 0 .24rem;
+  border: 0.5px solid rgba(192, 196, 204, 1);
+  border-radius: .3rem;
+  line-height: .52rem;
+  color: #5F5E64;
+}
+
+.ent-grouping .grouping-list .grouping-item.active {
+  background: #2ABED1;
+  border-color: #2ABED1;
+  color: #fff;
+}
+
+.ent-grouping .grouping-list .grouping-item.disabled {
+  background: #F5F6F7;
+}
+
+.ent-grouping .grouping-footer {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  margin-top: .04rem;
+  font-size: .28rem;
+  line-height: .4rem;
+  color: #2ABED1;
+}
+
+.ent-grouping .grouping-footer .grouping-item-name {
+  margin-right: .08rem;
+}

+ 74 - 2
src/jfw/modules/app/src/web/staticres/jyapp/big-member/js/ent_follow.js

@@ -20,13 +20,18 @@ var vNode = {
             scrollTop: 0
         },
         entFollowList: [],
-        loading: ''
+        loading: '',
+        activeNames: [],
+        groupingList: [],
+        selectGroupList: []
     },
     created: function () {
         var recover = this.recover()
         if (!recover) {
             this.getPowerInfo()
         }
+        this.getEntGroupList()
+
     },
     mounted: function () {
         $(this.$refs.jList).scrollTop(this.listInfo.scrollTop)
@@ -69,7 +74,21 @@ var vNode = {
                 }
             })
         },
-        getEntFollowList: function () {
+        // 获取企业分组数据
+        getEntGroupList: function () {
+            var _this = this
+            $.ajax({
+                type: 'POST',
+                url: '/bigmember/follow/ent/labelGroupList?t=' + new Date().getTime(),
+                success: function (res) {
+                    if (res.error_code == 0) {
+                        // 获取企业分组列表
+                        _this.setEntGroupData(res.data?.groupUserArr || [])
+                    }
+                }
+            })
+        },
+        getEntFollowList: function (params = {}) {
             var _this = this
             $.ajax({
                 type: 'POST',
@@ -77,6 +96,7 @@ var vNode = {
                 data: {
                     pageNum: _this.listInfo.pageNum,
                     pageSize: _this.listInfo.pageSize,
+                    ...params
                 },
                 success: function (res) {
                     if (_this.listInfo.pageNum === 0) {
@@ -85,6 +105,7 @@ var vNode = {
                     }
                     if (res.error_code == 0) {
                         if (res.data && res.data) {
+
                             // 判断是否为刷新
                             if (_this.listInfo.refreshing) {
                                 _this.entFollowList = []
@@ -128,6 +149,56 @@ var vNode = {
                 }
             })
         },
+        // 设置企业分组数据
+        setEntGroupData (data) {
+          data.forEach(item => {
+            if(item.name === '默认分组') {
+              item.name = '全部'
+            }
+            item.active = !item.isPut ? true : false
+          })
+          this.groupingList = data
+        },
+        changeGrouping: function (item) {
+          if (!item.count) return
+          const isAll = item.name === '全部'
+          if(item.active) {
+            if(isAll) {
+              this.selectGroupList = []
+            } else {
+              item.active = !item.active
+              this.selectGroupList = this.selectGroupList.filter(s => s.name !== item.name)
+            }
+          } else {
+            if(isAll) {
+              this.selectGroupList = []
+              item.active = !item.active
+              this.groupingList.forEach(s => {
+                if(s.name !== '全部') {
+                  s.active = false
+                }
+              })
+            } else {
+              this.groupingList.forEach(s => {
+                if(s.name === '全部') {
+                  s.active = false
+                }
+              })
+              item.active = !item.active
+              this.selectGroupList.push(item)
+            }
+          }
+          console.log(this.selectGroupList)
+          const lengthBool = this.selectGroupList.length > 0
+
+          this.getEntFollowList({
+            group: lengthBool ? this.selectGroupList.map(s => s.id).join(',') : ''
+          })
+          this.activeNames = []
+        },
+        groupManage: function () {
+            location.href = '/jy_mobile/entgroup/index'
+        },
         onRefresh: function () {
             // 重置数据
             this.listInfo.pageNum = 0
@@ -138,6 +209,7 @@ var vNode = {
             this.listInfo.loading = true
             // 请求数据
             this.getEntFollowList()
+            
         },
         connectEnt: function (phone) {
             try {

+ 97 - 15
src/jfw/modules/app/src/web/staticres/jyapp/big-member/js/ent_portrait.js

@@ -6,6 +6,7 @@ var vNode = {
     hisproComponent: hisproComponent,
     forwardshare: vmForward,
     mobilePortrayalFooter:mobilePortrayalFooter,
+    mobilePortrayalGroupingScript: mobilePortrayalGroupingScript,
     downloadpopup: downloadpopup,
 
   },
@@ -194,7 +195,20 @@ var vNode = {
       isFree: false,
       balance:0,
       moreSesame: false,
-      isOneRow: false
+      isOneRow: false,
+      showGroupingDialog: false,
+      groupingList: [],
+      sourceMap: {
+        app: 'app_ent_more',
+        wx: 'wx_ent_more',
+        h5: 'h5_ent_more'
+      },
+      sourceLimitMap: {
+        app: 'app_ent_limit',
+        wx: 'wx_ent_limit',
+        h5: 'h5_ent_limit'
+      },
+      setGroupState: '' // 如果为put说明是企业画像-已监控-更改
     }
   },
   created: function () {
@@ -214,6 +228,7 @@ var vNode = {
     // 判断用户是否登录
     this.getUserSimpleInfo()
     this.getPowerInfo()
+    this.getEntGroupList()
     if (!this.restore) {
       // 获取企业基本信息
       this.getEntBaseInfo()
@@ -386,6 +401,48 @@ var vNode = {
         referer: location.href
       }
     },
+    updateGroupList () {
+      this.getEntGroupList()
+    },
+    // 获取企业分组列表
+    getEntGroupList () {
+      var _this = this
+      $.ajax({
+        url: '/bigmember/follow/ent/labelGroupList',
+        type: 'POST',
+        success: function (res) {
+          if (res.error_code === 0) {
+            _this.groupingList = res.data?.groupUserArr || []
+          }
+        }
+      })
+    },
+    confirmGrouping (params) {
+      var _this = this;
+      // 确认分组事件
+      console.log(params, 'params')
+      this.showGroupingDialog = false
+      // 企业画像-已监控-更改分组
+      if(this.setGroupState === 'put') {
+        $.ajax({
+          url: '/bigmember/follow/ent/changeGroup',
+          type: 'POST',
+          data: params,
+          success: function (res) {
+            if (res.data === 'success') {
+              _this.$toast('修改分组成功')
+              // 更新分组内容
+              _this.getEntFollowState()
+            } else {
+              // 处理错误情况
+              _this.$toast(res.error_msg)
+            }
+          }
+        })
+      } else {
+        this.changeFollowStateRequest(params)
+      }
+    },
     // 监听画像页面滚动
     onEntScroll: utils.debounce(function (e) {
       this.pageScrollTop = e.target.scrollTop
@@ -814,6 +871,20 @@ var vNode = {
         },
       })
     },
+    changeGroupState: function (type) {
+      console.log(type);
+      
+      this.setGroupState = type
+      this.showGroupingDialog = true
+      const followedGroup = this.entInfo.followedGroup
+      let groupList = []
+      if(followedGroup.indexOf(',') !== -1) {
+        groupList = followedGroup.split(',')
+      } else {
+        groupList = [followedGroup]
+      }
+      this.$refs.portrayalGrouping.setState(groupList)
+    },
     // 查询企业是否存在和企业关注状态
     getEntFollowState: function () {
       var _this = this
@@ -831,6 +902,8 @@ var vNode = {
             if (res.data) {
               _this.entInfo.follow = !!res.data.followed
               _this.entInfo.entExist = !!res.data.isShow
+              _this.entInfo.followedGroup = res.data.followedGroup
+
             } else {
               _this.entInfo.entExist = false
             }
@@ -843,25 +916,31 @@ var vNode = {
         }
       })
     },
-    changeFollowState: function () {
+    changeFollowState: function (state) {
       var _this = this
       if(!this.isLogin) {
         window.location.href = "/jyapp/free/login?to=back";
         return
       }
       if (this.entInfo.follow) {
-        this.$dialog.confirm({
-          title: '提示信息',
-          message: '取消对“' + _this.entInfo.name + '”的关注?',
-          confirmButtonColor: '#2cb7ca'
-        }).then(function () {
-          _this.changeFollowStateRequest()
-        })
+        if(!state) {
+          this.$dialog.confirm({
+            title: '提示信息',
+            message: '取消对“' + _this.entInfo.name + '”的关注?',
+            confirmButtonColor: '#2cb7ca'
+          }).then(function () {
+            _this.changeFollowStateRequest()
+          })
           .catch(function () {
             console.log('取消操作')
           })
+        } else {
+          _this.changeFollowStateRequest()
+        }
+        
       } else {
-        this.changeFollowStateRequest()
+        this.showGroupingDialog = true
+        // this.changeFollowStateRequest()
       }
     },
     canReadConf13: function () {
@@ -1004,7 +1083,7 @@ var vNode = {
       })
     },
     // 修改企业关注状态
-    changeFollowStateRequest: function () {
+    changeFollowStateRequest: function (params = {}) {
       var _this = this
       var loading = this.showLoading()
       var urls = {
@@ -1016,7 +1095,8 @@ var vNode = {
         type: 'POST',
         url: url,
         data: {
-          entId: _this.entInfo.id
+          entId: _this.entInfo.id,
+          ...params
         },
         timeout: 5000,
         success: function (res) {
@@ -1026,6 +1106,8 @@ var vNode = {
             loading.clear()
             if (res.data === 'success' || res.data.status) {
               _this.entInfo.follow = !_this.entInfo.follow
+              _this.getEntFollowState()
+              _this.$refs.portrayalFooter.no_monitor(res.data)
             } else {
               return _this.showToast(res.error_msg || '监控失败')
             }
@@ -1033,9 +1115,9 @@ var vNode = {
               _this.pointsTaskSuccessTip()
             }
 
-            if (!_this.entInfo.follow) {
-              history.back()
-            }
+            // if (!_this.entInfo.follow) {
+            //   history.back()
+            // }
           } else {
             _this.showToast(res.error_msg)
           }

+ 14 - 0
src/jfw/modules/app/src/web/templates/big-member/page_ent_follow.html

@@ -34,6 +34,20 @@
         <div class="j-container" v-else key="list">
             <div class="j-main" ref="jList">
                 <div>
+                    <van-collapse class="ent-grouping" v-model="activeNames">
+                      <van-collapse-item title="企业分组" name="1">
+                        <div class="grouping-list">
+                            <div class="grouping-item" :class="{'active': item.active, 'disabled': !item.count && item.isPut}" v-for="(item, index) in groupingList" :key="index" @click="changeGrouping(item)">
+                                <span class="grouping-item-name">${ item.name }</span>
+                                <span class="grouping-item-count">${ item.count }</span>
+                            </div>
+                        </div>
+                        <div class="grouping-footer" @click="groupManage()">
+                          <span class="grouping-item-name">分组管理</span>
+                          <van-icon color="#2ABED1" name="arrow" />
+                        </div>
+                      </van-collapse-item>
+                    </van-collapse>
                     <van-pull-refresh v-model="listInfo.refreshing" @refresh="onRefresh">
                         <van-list
                             v-model="listInfo.loading"

+ 27 - 1
src/jfw/modules/app/src/web/templates/big-member/page_ent_portrait.html

@@ -22,6 +22,7 @@
   <link rel="stylesheet" type="text/css" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/forward-share/css/forward.css?v={{Msg "seo" "version"}}'/>
   <link rel="stylesheet" type="text/css" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/dataExport/css/popup-data-export.css?v={{Msg "seo" "version"}}'/>
   <link rel="stylesheet" type="text/css" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/mobile-portrayal-footer/css/mobile-portrayal-footer.css?v={{Msg "seo" "version"}}'/>
+  <link rel="stylesheet" type="text/css" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/mobile-portrayal-footer/css/mobile-portrayal-grouping.css?v={{Msg "seo" "version"}}'/>
   <link rel="stylesheet" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/portrait/css/downloadpopup.css?v={{Msg "seo" "version"}}' />
   <!--E-当前页面的css资源-->
 </head>
@@ -696,8 +697,32 @@
                 'othertwo':entPortraitInfo.buyer_count ? entPortraitInfo.buyer_count + '个' : '--',balance}">
                  </downloadpopup>
                 <!-- 底部按钮组件 -->
-                <mobile-portrayal-footer ref="portrayalFooter":monitorshow="entInfo.followSearchFinish && entInfo.entExist" :monitor="!!entInfo.follow" @monitorclick="changeFollowState" :custom-monitor="true"  :downshow="true" :islogin="isLogin" :params="entParams" :shareshow="true">
+                <mobile-portrayal-footer
+                  ref="portrayalFooter"
+                  portrait-origin="ent"
+                  :custom-monitor="false"
+                  :source-limit-map="sourceLimitMap"
+                  :source-map="sourceMap"
+                  :monitorshow="entInfo.followSearchFinish && entInfo.entExist"
+                  :followed-group="entInfo.followedGroup"
+                  :allpower="powerInfo"
+                  :monitor="!!entInfo.follow"
+                  @change="changeGroupState"
+                  @monitorclick="changeFollowState"
+                  :downshow="true"
+                  :islogin="isLogin"
+                  :params="entParams"
+                  :shareshow="true">
                 </mobile-portrayal-footer>
+                <!-- 分组组件 -->
+                <mobile-portrayal-grouping-script
+                  ref="portrayalGrouping"
+                  @confirm="confirmGrouping"
+                  @update="updateGroupList"
+                  :grouping-list="groupingList"
+                  :show-grouping-dialog="showGroupingDialog"
+                  :ent-id="entInfo.id"
+                ></mobile-portrayal-grouping-script>
     <popup-data-export ref="popup_dataExport" @next="next_export"></popup-data-export>
   </div>
   <div id="jyKeepComponent">
@@ -726,6 +751,7 @@
 </script>
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/portrait/js/downloadpopup.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module//mobile-portrayal-footer/js/mobile-portrayal-footer.js?v={{Msg "seo" "version"}}'></script>
+<script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module//mobile-portrayal-footer/js/mobile-portrayal-grouping.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/forward-share/js/forward.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/big-member/js/ent_portrait.js?v={{Msg "seo" "version"}}'>
 </script>

+ 9 - 0
src/jfw/modules/app/src/web/templates/big-member/page_potential_cor_list.html

@@ -78,6 +78,14 @@
             width: .4rem;
             height: .4rem;
         }
+        /* .cor-item-right .cor-yjk {
+          background-size: 100% 100%;
+          background-image: url('{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/big-member/image/yjk.png?v={{Msg "seo" "version"}}');
+        }
+        .cor-item-right .cor-jk {
+          background-size: 100% 100%;
+          background-image: url('{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/big-member/image/jk.png?v={{Msg "seo" "version"}}');
+        } */
         .cor-item-l-r {
             margin: 0 .16rem;
             flex: 1;
@@ -230,6 +238,7 @@
                                 </span>
                             </span>
                             <span class="cor-item-right" v-if="pagePower">
+                              <!-- 关注图标改为监控图标可以直接使用 :class="item.follow ? 'cor-yjk' : 'cor-jk'" -->
                                 <span
                                     v-if="pageConf.followShow"
                                     class="j-icon"

BIN=BIN
src/web/staticres/common-module/big-member/image/jk.png


BIN=BIN
src/web/staticres/common-module/big-member/image/yjk.png


+ 96 - 15
src/web/staticres/common-module/collection/js/ent_portrait.js

@@ -6,6 +6,7 @@ var vNode = {
     hisproComponent: hisproComponent,
     forwardshare: vmForward,
     mobilePortrayalFooter:mobilePortrayalFooter,
+    mobilePortrayalGroupingScript: mobilePortrayalGroupingScript,
     downloadpopup: downloadpopup,
   },
   data () {
@@ -193,7 +194,20 @@ var vNode = {
       isFree: false,
       balance:0,
       moreSesame: false,
-      isOneRow: false
+      isOneRow: false,
+      showGroupingDialog: false,
+      groupingList: [],
+      sourceMap: {
+        app: 'app_ent_more',
+        wx: 'wx_ent_more',
+        h5: 'h5_ent_more'
+      },
+      sourceLimitMap: {
+        app: 'app_ent_limit',
+        wx: 'wx_ent_limit',
+        h5: 'h5_ent_limit'
+      },
+      setGroupState: '' // 如果为put说明是企业画像-已监控-更改
     }
   },
   created: function () {
@@ -211,6 +225,7 @@ var vNode = {
     this.entInfo.name = ''
     this.restore = this.reStoreState()
     this.getPowerInfo()
+    this.getEntGroupList()
     if (!this.restore) {
       // 获取企业基本信息
       this.getEntBaseInfo()
@@ -365,6 +380,48 @@ var vNode = {
         referer: location.href
       }
     },
+    updateGroupList () {
+      this.getEntGroupList()
+    },
+    // 获取企业分组列表
+    getEntGroupList () {
+      var _this = this
+      $.ajax({
+        url: '/bigmember/follow/ent/labelGroupList',
+        type: 'POST',
+        success: function (res) {
+          if (res.error_code === 0) {
+            _this.groupingList = res.data?.groupUserArr || []
+          }
+        }
+      })
+    },
+    confirmGrouping (params) {
+      var _this = this;
+      // 确认分组事件
+      console.log(params, 'params')
+      this.showGroupingDialog = false
+      // 企业画像-已监控-更改分组
+      if(this.setGroupState === 'put') {
+        $.ajax({
+          url: '/bigmember/follow/ent/changeGroup',
+          type: 'POST',
+          data: params,
+          success: function (res) {
+            if (res.data === 'success') {
+              _this.$toast('修改分组成功')
+              // 更新分组内容
+              _this.getEntFollowState()
+            } else {
+              // 处理错误情况
+              _this.$toast(res.error_msg)
+            }
+          }
+        })
+      } else {
+        this.changeFollowStateRequest(params)
+      }
+    },
     // 监听画像页面滚动
     onEntScroll: utils.debounce(function(e){
       this.pageScrollTop = e.target.scrollTop
@@ -773,6 +830,20 @@ var vNode = {
         },
       })
     },
+    changeGroupState: function (type) {
+      console.log(type);
+      
+      this.setGroupState = type
+      this.showGroupingDialog = true
+      const followedGroup = this.entInfo.followedGroup
+      let groupList = []
+      if(followedGroup.includes(',')) {
+        groupList = followedGroup.split(',')
+      } else {
+        groupList = [followedGroup]
+      }
+      this.$refs.portrayalGrouping.setState(groupList)
+    },
     // 查询企业是否存在和企业关注状态
     getEntFollowState: function () {
       var _this = this
@@ -789,6 +860,7 @@ var vNode = {
             if (res.data) {
               _this.entInfo.follow = !!res.data.followed
               _this.entInfo.entExist = !!res.data.isShow
+              _this.entInfo.followedGroup = res.data.followedGroup
             } else {
               _this.entInfo.entExist = false
             }
@@ -801,21 +873,27 @@ var vNode = {
         }
       })
     },
-    changeFollowState: function () {
+    changeFollowState: function (state) {
       var _this = this
       if (this.entInfo.follow) {
-        this.$dialog.confirm({
-          title: '提示信息',
-          message: '取消对“' + _this.entInfo.name + '”的关注?',
-          confirmButtonColor: '#2cb7ca'
-        }).then(function () {
-          _this.changeFollowStateRequest()
-        })
+        if(!state) {
+          this.$dialog.confirm({
+            title: '提示信息',
+            message: '取消对“' + _this.entInfo.name + '”的关注?',
+            confirmButtonColor: '#2cb7ca'
+          }).then(function () {
+            _this.changeFollowStateRequest()
+          })
           .catch(function () {
             console.log('取消操作')
           })
+        } else {
+          _this.changeFollowStateRequest()
+        }
+        
       } else {
-        this.changeFollowStateRequest()
+        this.showGroupingDialog = true
+        // this.changeFollowStateRequest()
       }
     },
     goToUnlock: function () {
@@ -956,7 +1034,7 @@ var vNode = {
       })
     },
     // 修改企业关注状态
-    changeFollowStateRequest: function () {
+    changeFollowStateRequest: function (params = {}) {
       var _this = this
       var loading = this.showLoading()
       var urls = {
@@ -968,7 +1046,8 @@ var vNode = {
         type: 'POST',
         url: url,
         data: {
-          entId: _this.entInfo.id
+          entId: _this.entInfo.id,
+          ...params
         },
         success: function (res) {
           if (res.error_code == 0) {
@@ -977,15 +1056,17 @@ var vNode = {
             loading.clear()
             if (res.data === 'success' || res.data.status) {
               _this.entInfo.follow = !_this.entInfo.follow
+              _this.getEntFollowState()
+              _this.$refs.portrayalFooter.no_monitor(res.data)
             } else {
               return _this.showToast(res.error_msg || '监控失败')
             }
             if(_this.entInfo.follow) {
               _this.pointsTaskSuccessTip()
             }
-            if (!_this.entInfo.follow) {
-              history.back()
-            }
+            // if (!_this.entInfo.follow) {
+            //   history.back()
+            // }
           } else {
             _this.showToast(res.error_msg)
           }

+ 21 - 1
src/web/staticres/common-module/mobile-portrayal-footer/css/mobile-portrayal-footer.css

@@ -25,13 +25,14 @@
   border-top: 0.01rem solid #0000001A;
 }
 .m-footer-box .footer-item{
+  display: flex;
+  flex-direction: column;
   flex: 1;
   padding-top: 0.1rem;
   justify-content: center;
 }
 .monitor-box{
   width: 3.22rem;
-  height: 3.84rem;
   background-color: #fff;
   box-sizing: border-box;
   border: 0.01rem solid #0000000D;
@@ -41,10 +42,29 @@
   left: 0.32rem;
   top: -4rem;
 }
+.monitor-box.action {
+  top: -4.8rem;
+}
 .monitor-box .monitor-box-item{
   padding: 0.24rem 0;
   border-bottom: 0.01rem solid #0000000D;
 }
+.monitor-box .monitor-box-item.monitor-group {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  padding: .24rem .16rem;
+}
+.monitor-box-item.monitor-group .look-text{
+  width: 2rem;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
+.monitor-box .monitor-box-item.monitor-group .editor-group {
+  color: #2ABED1;
+  font-size: .28rem;
+}
 .monitor-box .monitor-box-item:last-child{
   border-bottom: none;
 }

+ 66 - 0
src/web/staticres/common-module/mobile-portrayal-footer/css/mobile-portrayal-grouping.css

@@ -0,0 +1,66 @@
+.mobile-portrayal-grouping .van-dialog {
+  padding: 0 .32rem;
+}
+.mobile-portrayal-grouping .van-dialog .van-dialog__header {
+  padding-top: 24px;
+  font-weight: 400;
+}
+.mobile-portrayal-grouping .van-dialog.grouping-dialog .van-dialog__content {
+  padding: 0;
+  margin-bottom: .44rem;
+}
+.mobile-portrayal-grouping .van-dialog__content .add-grouping {
+  margin: .16rem 0;
+  height: .4rem;
+  line-height: .4rem;
+  text-align: right;
+}
+.mobile-portrayal-grouping .van-dialog__content .add-grouping .add-grouping-text {
+  font-size: .28rem;
+  color: #2ABED1;
+}
+.mobile-portrayal-grouping .grouping-list {
+  min-height: 2.4rem;
+  max-height: 8rem;
+  overflow: hidden;
+  overflow-y: auto;
+}
+.mobile-portrayal-grouping .grouping-list .van-checkbox {
+  padding: .2rem 0;
+  border-bottom: 0.5px solid rgba(0, 0, 0, 0.05);
+}
+.mobile-portrayal-grouping .grouping-list .van-checkbox .van-checkbox__label {
+  width: 5.94rem;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
+
+.mobile-portrayal-grouping .add-grouping-dialog .van-dialog__content {
+  padding: 0;
+  margin: .32rem 0 .44rem 0;
+}
+.mobile-portrayal-grouping .add-grouping-dialog .van-cell {
+  padding: 0;
+}
+.mobile-portrayal-grouping .add-grouping-dialog .van-cell .van-field__body {
+  padding-bottom: .22rem;
+  border-bottom: 0.5px solid rgba(0, 0, 0, 0.05);
+}
+.mobile-portrayal-grouping .add-grouping-dialog .van-field__control::placeholder {
+  color: #9B9CA3;
+}
+.mobile-portrayal-grouping .add-grouping-dialog .van-field__word-limit {
+  position: absolute;
+  right: 0;
+  top: 0;
+}
+.mobile-portrayal-grouping .add-grouping-dialog .van-field__word-limit .van-field__word-num {
+  color: #2ABED1;
+}
+.mobile-portrayal-grouping .add-grouping-dialog .van-field__error-message {
+  margin-top: .16rem;
+  font-size: .28rem;
+  color: #FB483D;
+  line-height: .4rem;
+}

+ 46 - 12
src/web/staticres/common-module/mobile-portrayal-footer/js/mobile-portrayal-footer.js

@@ -26,7 +26,11 @@ var mobileportrayalfootertemp = `
         </div>
         <p class="footer-text">下载报告</p>
       </div>
-      <div class="monitor-box" v-show="monitorboxShow">
+      <div class="monitor-box" :class="{'action': monitorGroupShow }" v-show="monitorboxShow">
+        <div class="monitor-box-item monitor-group" v-if="monitorGroupShow">
+          <p class="look-text">{{ followedGroup }}</p>
+          <span @click="editorGroupEvent" class="editor-group">更改></span>
+        </div>
         <div class="monitor-box-item">
           <p class="look-text" @click="lookDynamic">查看监控动态</p>
         </div>
@@ -73,6 +77,10 @@ var mobilePortrayalFooter = {
       type: Boolean,
       default: false
     },
+    followedGroup: { // 监控分组
+      type: String,
+      default: ''
+    },
     customMonitor:{ // 是否自定义监控点击
       type: Boolean,
       default: false
@@ -89,10 +97,31 @@ var mobilePortrayalFooter = {
       type: Boolean,
       default: false
     },
-    allpower:{ // 权限状态
-
-    }
-
+    allpower:{}, // 权限状态
+    portraitOrigin: { // 页面来源
+      type: String,
+      default: ''
+    },
+    sourceMap: {
+      type: Object,
+      default: function (){
+        return {
+          app: 'app_buyer_monitor_more',
+          wx: 'wx_buyer_monitor_more',
+          h5: 'h5_buyer_monitor_more'
+        }
+      }
+    },
+    sourceLimitMap: {
+      type: Object,
+      default: function (){
+        return {
+          app: 'app_buyer_monitor_limit',
+          wx: 'wx_buyer_monitor_limit',
+          h5: 'h5_buyer_monitor_limit'
+        }
+      }
+    },
   },
   data: function () {
     return {
@@ -101,7 +130,8 @@ var mobilePortrayalFooter = {
       showIframe: false,
       monitorboxShow: false,
       use:'',
-      surplus:''
+      surplus:'',
+      monitorGroupShow: false // 监控分组是否展示, 也用来设置弹窗的定位高度
     }
   },
   created () {
@@ -135,6 +165,9 @@ var mobilePortrayalFooter = {
       // }
       this.$parent.$refs.downloadpopup.show() //触发引用此组件父级组件的下载弹框
     },
+    editorGroupEvent () { // 更改监控分组事件
+      this.$emit('change', 'put')
+    },
     monitorClick: utils.debounce(function(){
       let this_ = this
       let params = {
@@ -198,11 +231,11 @@ var mobilePortrayalFooter = {
       if(this.allpower.vipStatus > 0){
         let href_
         if(utils.$envs.inWX){
-          href_ = '/weixin/frontPage/bigmember/free/perfect_info?source=wx_buyer_monitor_more'
+          href_ = '/weixin/frontPage/bigmember/free/perfect_info?source=' + this.sourceMap.wx
         }else if(utils.$envs.inApp){
-          href_ = '/jyapp/frontPage/bigmember/free/perfect_info?source=app_buyer_monitor_more'
+          href_ = '/jyapp/frontPage/bigmember/free/perfect_info?source=' + this.sourceMap.app
         }else if(utils.$envs.inH5){
-          href_ = '/jyapp/frontPage/bigmember/free/perfect_info?source=h5_buyer_monitor_more'
+          href_ = '/jyapp/frontPage/bigmember/free/perfect_info?source=' + this.sourceMap.h5
         }
         window.location.href = href_
 
@@ -233,6 +266,7 @@ var mobilePortrayalFooter = {
       this.use = data.count.use
       if (isInit !== true) {
         this.monitorboxShow = !this.monitorboxShow
+        this.monitorGroupShow = this.portraitOrigin === 'ent' ? true : false
       }
     },
     no_monitor (data){
@@ -282,11 +316,11 @@ var mobilePortrayalFooter = {
       }else if(!this.allpower.isFree && data.limit_status === 1){
         let href_
         if(utils.$envs.inWX){
-          href_ = '/weixin/frontPage/bigmember/free/perfect_info?source=wx_buyer_monitor_limit'
+          href_ = '/weixin/frontPage/bigmember/free/perfect_info?source=' + this.sourceLimitMap.wx
         }else if(utils.$envs.inApp){
-          href_ = '/jyapp/frontPage/bigmember/free/perfect_info?source=app_buyer_monitor_limit'
+          href_ = '/jyapp/frontPage/bigmember/free/perfect_info?source=' + this.sourceLimitMap.app
         }else if(utils.$envs.inH5){
-          href_ = '/jyapp/frontPage/bigmember/free/perfect_info?source=h5_buyer_monitor_limit'
+          href_ = '/jyapp/frontPage/bigmember/free/perfect_info?source=' +  + this.sourceLimitMap.h5
         }
         window.location.href = href_
       } else if(!this.allpower.isFree && data.limit_status === 2){

+ 134 - 0
src/web/staticres/common-module/mobile-portrayal-footer/js/mobile-portrayal-grouping.js

@@ -0,0 +1,134 @@
+var mobilePortrayalGrouping = `
+  <div class="mobile-portrayal-grouping">
+    <van-dialog
+      v-model="showGroupingDialog"
+      :title="title"
+      show-cancel-button
+      class="grouping-dialog"
+      @confirm="confirmGrouping"
+      >
+      <div class="add-grouping" @click="addMonitor">
+        <van-icon color="#2ABED1" name="plus" />
+        <span class="add-grouping-text">新增分组</span>
+      </div>
+      <div class="grouping-list">
+
+        <van-checkbox-group v-model="groupingResult" @change="handleGroupChange">
+          <van-checkbox checked-color="#2ABED1" :name="item.name" v-for="(item, index) in groupingList" :key="index">{{item.name}}</van-checkbox>
+        </van-checkbox-group>
+      </div>
+    </van-dialog>
+    <van-dialog
+      class="add-grouping-dialog"
+      v-model="showAddGroupingDialog"
+      title="新增分组"
+      @confirm="addGrouping"
+      show-cancel-button>
+      <van-field 
+        v-model="groupingName"
+        show-word-limit 
+        maxlength="15"
+        :error-message="errorMessageText"
+        placeholder="请输入分组名称"
+        @input="setGroupingName"
+      ></van-field>
+    </van-dialog>
+  </div>
+`
+
+var mobilePortrayalGroupingScript = {
+  name: 'mobile-portrayal-grouping',
+  template: mobilePortrayalGrouping,
+  props: {
+    title: {
+      type: String,
+      default: '选择分组'
+    },
+    showGroupingDialog: {
+      type: Boolean,
+      default: true
+    },
+    groupingList: {
+      type: Array,
+      default: () => []
+    },
+    entId: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      groupingResult: ['默认分组'],
+      groupingName: '',
+      showAddGroupingDialog: false,
+      errorMessageText: '',
+      isUpdating: false // 标志位,避免死循环
+    }
+  },
+  methods: {
+    setState (data) {
+      this.groupingResult = data
+    },
+    addMonitor () {
+      this.showAddGroupingDialog = true
+    },
+    addGrouping () {
+      // 添加分组确定事件
+      $.ajax({
+        url: '/bigmember/follow/ent/labelGroup',
+        type: 'post',
+        data: {
+          type: 'add',
+          name: this.groupingName
+        },
+        success: (res) => {
+          if (res.error_code === 0) {
+            this.$toast('新增分组成功')
+            this.groupingName = ''
+            this.$emit('update')
+          } else {
+            this.$toast(res.error_msg || '新增分组失败')
+          }
+        }
+      })
+      this.showAddGroupingDialog = false
+    },
+    setGroupingName (val) {
+      this.groupingName = val.trim().replace(/\s+/g, '')
+    },
+    handleGroupChange (checked) {
+      if (this.isUpdating) {
+        // 如果正在更新,直接返回,避免递归调用
+        return;
+      }
+      this.isUpdating = true; // 设置标志位
+
+      if (checked.indexOf('默认分组') > 0) {
+        // 如果选择了默认分组,清空其他分组的选择
+        this.groupingResult = ['默认分组'];
+      } else {
+        // 如果选择了其他分组,移除默认分组的选择
+        this.groupingResult = this.groupingResult.filter(item => item !== '默认分组');
+      }
+      this.$nextTick(() => {
+        this.isUpdating = false; // 更新完成后重置标志位
+      });
+    },
+    confirmGrouping () {
+      const idArr = []
+      this.groupingList.forEach(item => {
+        this.groupingResult.forEach(group => {
+          if (item.name === group) {
+            idArr.push(item.id)
+          }
+        })
+      })
+      const params = {
+        groups: idArr.length ? idArr.join(',') : '',
+        entId: this.entId
+      }
+      this.$emit('confirm', params)
+    }
+  }
+}

+ 28 - 1
src/web/templates/frontRouter/wx/collection/sess/ent_portrait.html

@@ -29,6 +29,7 @@
         <link rel="stylesheet" href='{{Msg "seo" "cdn"}}/common-module/mainSearch/css/j-icons.css?v={{Msg "seo" "version"}}' />
         <link rel="stylesheet" type="text/css" href='{{Msg "seo" "cdn"}}/common-module/dataExport/css/popup-data-export.css?v={{Msg "seo" "version"}}'/>
         <link rel="stylesheet" type="text/css" href='{{Msg "seo" "cdn"}}/common-module/mobile-portrayal-footer/css/mobile-portrayal-footer.css?v={{Msg "seo" "version"}}'/>
+        <link rel="stylesheet" type="text/css" href='{{Msg "seo" "cdn"}}/common-module/mobile-portrayal-footer/css/mobile-portrayal-grouping.css?v={{Msg "seo" "version"}}'/>
         <link rel="stylesheet" href='{{Msg "seo" "cdn"}}/common-module/portrait/css/downloadpopup.css?v={{Msg "seo" "version"}}' />
 </head>
 <style>
@@ -694,7 +695,32 @@
     'othertwo':entPortraitInfo.buyer_count ? entPortraitInfo.buyer_count + '个' : '--',balance}">
      </downloadpopup>
     <!-- 底部按钮组件 -->
-    <mobile-portrayal-footer ref="portrayalFooter":monitorshow="entInfo.followSearchFinish && entInfo.entExist" :monitor="!!entInfo.follow" @monitorclick="changeFollowState" ::custom-monitor="true" :downshow="true" :islogin="isLogin" :params="entParams" :shareshow="true"></mobile-portrayal-footer>
+    <mobile-portrayal-footer
+      ref="portrayalFooter"
+      portrait-origin="ent"
+      :custom-monitor="false"
+      :source-limit-map="sourceLimitMap"
+      :source-map="sourceMap"
+      :monitorshow="entInfo.followSearchFinish && entInfo.entExist"
+      :followed-group="entInfo.followedGroup"
+      :allpower="powerInfo" 
+      :monitor="!!entInfo.follow" 
+      @change="changeGroupState"
+      @monitorclick="changeFollowState"
+      :downshow="true"
+      :islogin="isLogin"
+      :params="entParams"
+      :shareshow="true"
+      ></mobile-portrayal-footer>
+    <!-- 分组组件 -->
+    <mobile-portrayal-grouping-script
+      ref="portrayalGrouping"
+      @confirm="confirmGrouping"
+      @update="updateGroupList"
+      :grouping-list="groupingList"
+      :show-grouping-dialog="showGroupingDialog"
+      :ent-id="entInfo.id"
+    ></mobile-portrayal-grouping-script>
     <popup-data-export ref="popup_dataExport" @next="next_export"></popup-data-export>
     </div>
   <div id="jyKeepComponent">
@@ -721,6 +747,7 @@
 <script src='{{Msg "seo" "cdn"}}/common-module/forward-share/js/forward.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Msg "seo" "cdn"}}/common-module/portrait/js/downloadpopup.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Msg "seo" "cdn"}}/common-module//mobile-portrayal-footer/js/mobile-portrayal-footer.js?v={{Msg "seo" "version"}}'></script>
+<script src='{{Msg "seo" "cdn"}}/common-module//mobile-portrayal-footer/js/mobile-portrayal-grouping.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Msg "seo" "cdn"}}/common-module/collection/js/ent_portrait.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Msg "seo" "cdn"}}/common-module/keep-tags/keep-tags-template.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Msg "seo" "cdn"}}/common-module/keep-tags/keep-ent-tags-template.js?v={{Msg "seo" "version"}}'></script>