Browse Source

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

汤世哲 6 months ago
parent
commit
4fe4b6af46

+ 10 - 4
src/jfw/modules/app/src/web/staticres/jyapp/big-member/js/ent_follow.js

@@ -151,11 +151,17 @@ var vNode = {
         },
         // 设置企业分组数据
         setEntGroupData (data) {
+          let all_count = 0
+          all_count = data.reduce((accumulator, currentValue) => accumulator + currentValue.count, 0);
+          data.unshift({
+            count: all_count,
+            id: "",
+            isPut: 0,
+            name: "全部"
+          })
+
           data.forEach(item => {
-            if(item.name === '默认分组') {
-              item.name = '全部'
-            }
-            item.active = !item.isPut ? true : false
+            item.active = item.name === '全部' ? true : false
           })
           this.groupingList = data
         },

+ 132 - 13
src/jfw/modules/app/src/web/staticres/jyapp/big-member/js/ent_portrait.js

@@ -197,7 +197,8 @@ var vNode = {
       moreSesame: false,
       isOneRow: false,
       showGroupingDialog: false,
-      groupingList: [],
+      groupingList: [], // 监控分组列表
+      groupLimit: {}, // 监控达到上限返回值
       sourceMap: {
         app: 'app_ent_more',
         wx: 'wx_ent_more',
@@ -228,7 +229,6 @@ var vNode = {
     // 判断用户是否登录
     this.getUserSimpleInfo()
     this.getPowerInfo()
-    this.getEntGroupList()
     if (!this.restore) {
       // 获取企业基本信息
       this.getEntBaseInfo()
@@ -408,11 +408,41 @@ var vNode = {
     getEntGroupList () {
       var _this = this
       $.ajax({
-        url: '/bigmember/follow/ent/labelGroupList',
+        url: '/bigmember/follow/ent/labelGroup',
         type: 'POST',
+        data: {
+          type: 'get'
+        },
         success: function (res) {
           if (res.error_code === 0) {
-            _this.groupingList = res.data?.groupUserArr || []
+            _this.groupingList = res.data || []
+            this.showGroupingDialog = true
+            if(!this.entInfo.follow) {
+              this.$refs.portrayalGrouping.setState(['默认分组'])
+            }
+          } else {
+            if(!res?.data?.status) {
+                // 监控达到上限
+              _this.$dialog({
+                width: 303,
+                className: 'monitor-dialog',
+                title: '监控企业个数已达上限',
+                message: '您最多可监控'+res?.data.limit_count+'个企业,可联系客服,申请监控更多企业',
+                messageAlign:'center',
+                confirmButtonText: '联系客服',
+                confirmButtonColor: '#2ABED1',
+                showConfirmButton: true,
+                showCancelButton: true,
+                cancelButtonText: '我再想想',
+                // cancelButtonColor: '#5F5E64'
+              }).then(() =>{
+                if(utils.$envs.inWX){
+                  window.location.href = '/big/wx/page/customer'
+                } else{
+                  window.location.href = '/jyapp/free/customer'
+                }
+              })
+            }
           }
         }
       })
@@ -444,6 +474,9 @@ var vNode = {
         this.changeFollowStateRequest(params)
       }
     },
+    cancelGrouping () {
+      this.showGroupingDialog = false
+    },
     // 监听画像页面滚动
     onEntScroll: utils.debounce(function (e) {
       this.pageScrollTop = e.target.scrollTop
@@ -879,12 +912,11 @@ var vNode = {
       this.showGroupingDialog = true
       const followedGroup = this.entInfo.followedGroup
       let groupList = []
-      if(followedGroup.indexOf(',') !== -1) {
-        groupList = followedGroup.split(',')
-      } else {
-        groupList = [followedGroup]
+      const isManyGroup = followedGroup.includes(',')
+      groupList = isManyGroup ? followedGroup.split(',') : [followedGroup]
+      if(!groupList.includes('默认分组')) {
+        this.$refs.portrayalGrouping.setState(groupList)
       }
-      this.$refs.portrayalGrouping.setState(groupList)
     },
     // 查询企业是否存在和企业关注状态
     getEntFollowState: function () {
@@ -904,7 +936,7 @@ var vNode = {
               _this.entInfo.follow = !!res.data.followed
               _this.entInfo.entExist = !!res.data.isShow
               _this.entInfo.followedGroup = res.data.followedGroup
-
+              _this.entInfo.info = res.data.info
             } else {
               _this.entInfo.entExist = false
             }
@@ -940,8 +972,7 @@ var vNode = {
         }
         
       } else {
-        this.showGroupingDialog = true
-        this.$refs.portrayalGrouping.setState(['默认分组'])
+        this.getEntGroupList()
         // this.changeFollowStateRequest()
       }
     },
@@ -1109,7 +1140,7 @@ var vNode = {
             if (res.data === 'success' || res.data.status) {
               _this.entInfo.follow = !_this.entInfo.follow
               _this.getEntFollowState()
-              _this.$refs.portrayalFooter.no_monitor(res.data)
+              _this.no_monitor(res.data)
             } else {
               return _this.showToast(res.error_msg || '监控失败')
             }
@@ -1130,6 +1161,93 @@ var vNode = {
         }
       })
     },
+    no_monitor (data){
+      if(utils.$envs.inApp && JyObj.checkNoticePermission()!=1 && data.status){
+        this.$dialog({
+          width: 303,
+          className: 'monitor-dialog',
+          title: '监控成功',
+          message: '您可前往“工作台-商机-企业情报监控”查看企业最新动态。为保证您能及时获取新增监控信息推送,请前往开启推送提醒。',
+          messageAlign:'center',
+          confirmButtonText: '去开启',
+          confirmButtonColor: '#2ABED1',
+          showConfirmButton: true,
+          showCancelButton: true,
+          cancelButtonText: '暂不开启',
+          // cancelButtonColor: '#5F5E64'
+        }).then(() =>{
+          //  展开监控菜单 active:4
+          window.location.href = location.origin + '/jy_mobile/push/pushsetting?active=4'
+        })
+        return
+      }
+      if(!this.powerInfo.isFree && !data.msg_open && data.status){
+        this.$dialog({
+          width: 303,
+          className: 'monitor-dialog',
+          title: '监控成功',
+          message: '您可前往“工作台-商机-业主监控”查看业主最新招标动态。为保证您能及时获取新增监控信息推送,请前往开启推送提醒。',
+          messageAlign:'center',
+          confirmButtonText: '去开启',
+          confirmButtonColor: '#2ABED1',
+          showConfirmButton: true,
+          showCancelButton: true,
+          cancelButtonText: '暂不开启',
+          // cancelButtonColor: '#5F5E64'
+        }).then(() =>{
+          //  展开监控菜单 active:4
+          window.location.href = location.origin + '/jy_mobile/push/pushsetting?active=4'
+        })
+
+      } else if(!this.powerInfo.isFree && data.msg_open && data.status){
+        this.$toast({
+          duration: 2000,
+          message: '监控成功,您可前往“工作台-商机-企业情报监控”查看'
+      })
+
+      }else if(!this.powerInfo.isFree && data.limit_status === 1){
+        let href_
+        if(utils.$envs.inWX){
+          href_ = '/weixin/frontPage/bigmember/free/perfect_info?source=' + this.sourceLimitMap.wx
+        }else if(utils.$envs.inApp){
+          href_ = '/jyapp/frontPage/bigmember/free/perfect_info?source=' + this.sourceLimitMap.app
+        }else if(utils.$envs.inH5){
+          href_ = '/jyapp/frontPage/bigmember/free/perfect_info?source=' +  + this.sourceLimitMap.h5
+        }
+        window.location.href = href_
+      } else if(!this.powerInfo.isFree && data.limit_status === 2){
+        this.$dialog({
+          width: 303,
+          className: 'monitor-dialog',
+          title: '监控企业个数已达上限',
+          message: '您最多可监控'+data.limit_count+'个企业,可联系客服,申请监控更多企业',
+          messageAlign:'center',
+          confirmButtonText: '联系客服',
+          confirmButtonColor: '#2ABED1',
+          showConfirmButton: true,
+          showCancelButton: true,
+          cancelButtonText: '返回',
+          // cancelButtonColor: '#5F5E64'
+        }).then(() =>{
+          if(utils.$envs.inWX){
+             window.location.href = '/big/wx/page/customer'
+          } else{
+            window.location.href = '/jyapp/free/customer'
+          }
+        })
+      }else if(this.powerInfo.isFree){
+        let href_
+        if(utils.$envs.inWX){
+          href_ = '/weixin/frontPage/bigmember/free/perfect_info?source=' + this.sourceLimitMap.wx
+        }else if(utils.$envs.inApp){
+          href_ = '/jyapp/frontPage/bigmember/free/perfect_info?source=' + this.sourceLimitMap.app
+        }else if(utils.$envs.inH5){
+          href_ = '/jyapp/frontPage/bigmember/free/perfect_info?source=' + this.sourceLimitMap.h5
+        }
+        window.location.href = href_
+      }
+
+    },
     // 赚剑鱼币任务完成提示
     pointsTaskSuccessTip: function() {
       // 获取剑鱼币任务信息
@@ -1647,6 +1765,7 @@ var vNode = {
         svipBuyset: this.svipBuyset,
         bidcollPowerInfo: this.bidcollPowerInfo,
         scrollTop: this.scrollTop + scrollTopOffset,
+        showGroupingDialog: this.showGroupingDialog,
         gotTab2: this.gotTab2
       }
       sessionStorage.setItem(this.sessKey, JSON.stringify(data))

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

@@ -704,7 +704,7 @@
                   :source-limit-map="sourceLimitMap"
                   :source-map="sourceMap"
                   :monitorshow="entInfo.followSearchFinish && entInfo.entExist"
-                  :followed-group="entInfo.followedGroup"
+                  :ent-info="entInfo"
                   :allpower="powerInfo"
                   :monitor="!!entInfo.follow"
                   @change="changeGroupState"
@@ -718,6 +718,7 @@
                 <mobile-portrayal-grouping-script
                   ref="portrayalGrouping"
                   @confirm="confirmGrouping"
+                  @cancel="cancelGrouping"
                   @update="updateGroupList"
                   :grouping-list="groupingList"
                   :show-grouping-dialog="showGroupingDialog"

+ 133 - 12
src/web/staticres/common-module/collection/js/ent_portrait.js

@@ -196,7 +196,8 @@ var vNode = {
       moreSesame: false,
       isOneRow: false,
       showGroupingDialog: false,
-      groupingList: [],
+      groupingList: [], // 监控分组列表
+      groupLimit: {}, // 监控达到上限返回值
       sourceMap: {
         app: 'app_ent_more',
         wx: 'wx_ent_more',
@@ -225,7 +226,6 @@ var vNode = {
     this.entInfo.name = ''
     this.restore = this.reStoreState()
     this.getPowerInfo()
-    this.getEntGroupList()
     if (!this.restore) {
       // 获取企业基本信息
       this.getEntBaseInfo()
@@ -389,9 +389,39 @@ var vNode = {
       $.ajax({
         url: '/bigmember/follow/ent/labelGroupList',
         type: 'POST',
+        data: {
+          type: 'get'
+        },
         success: function (res) {
           if (res.error_code === 0) {
-            _this.groupingList = res.data?.groupUserArr || []
+            _this.groupingList = res.data || []
+            this.showGroupingDialog = true
+            if(!this.entInfo.follow) {
+              this.$refs.portrayalGrouping.setState(['默认分组'])
+            }
+          } else {
+            if(!res?.data?.status) {
+              // 监控达到上限
+              _this.$dialog({
+                width: 303,
+                className: 'monitor-dialog',
+                title: '监控企业个数已达上限',
+                message: '您最多可监控'+res?.data.limit_count+'个企业,可联系客服,申请监控更多企业',
+                messageAlign:'center',
+                confirmButtonText: '联系客服',
+                confirmButtonColor: '#2ABED1',
+                showConfirmButton: true,
+                showCancelButton: true,
+                cancelButtonText: '我再想想',
+                // cancelButtonColor: '#5F5E64'
+              }).then(() =>{
+                if(utils.$envs.inWX){
+                  window.location.href = '/big/wx/page/customer'
+                } else{
+                  window.location.href = '/jyapp/free/customer'
+                }
+              })
+            }
           }
         }
       })
@@ -423,6 +453,9 @@ var vNode = {
         this.changeFollowStateRequest(params)
       }
     },
+    cancelGrouping () {
+      this.showGroupingDialog = false
+    },
     // 监听画像页面滚动
     onEntScroll: utils.debounce(function(e){
       this.pageScrollTop = e.target.scrollTop
@@ -838,12 +871,11 @@ var vNode = {
       this.showGroupingDialog = true
       const followedGroup = this.entInfo.followedGroup
       let groupList = []
-      if(followedGroup.includes(',')) {
-        groupList = followedGroup.split(',')
-      } else {
-        groupList = [followedGroup]
+      const isManyGroup = followedGroup.includes(',')
+      groupList = isManyGroup ? followedGroup.split(',') : [followedGroup]
+      if(!groupList.includes('默认分组')) {
+        this.$refs.portrayalGrouping.setState(groupList)
       }
-      this.$refs.portrayalGrouping.setState(groupList)
     },
     // 查询企业是否存在和企业关注状态
     getEntFollowState: function () {
@@ -862,6 +894,7 @@ var vNode = {
               _this.entInfo.follow = !!res.data.followed
               _this.entInfo.entExist = !!res.data.isShow
               _this.entInfo.followedGroup = res.data.followedGroup
+              _this.entInfo.info = res.data.info
             } else {
               _this.entInfo.entExist = false
             }
@@ -893,8 +926,7 @@ var vNode = {
         }
         
       } else {
-        this.showGroupingDialog = true
-        this.$refs.portrayalGrouping.setState(['默认分组'])
+        this.getEntGroupList()
         // this.changeFollowStateRequest()
       }
     },
@@ -1059,7 +1091,7 @@ var vNode = {
             if (res.data === 'success' || res.data.status) {
               _this.entInfo.follow = !_this.entInfo.follow
               _this.getEntFollowState()
-              _this.$refs.portrayalFooter.no_monitor(res.data)
+              _this.no_monitor(res.data)
             } else {
               return _this.showToast(res.error_msg || '监控失败')
             }
@@ -1077,7 +1109,95 @@ var vNode = {
           console.log(error)
         }
       })
-    }, // 赚剑鱼币任务完成提示
+    },
+    no_monitor (data){
+      if(utils.$envs.inApp && JyObj.checkNoticePermission()!=1 && data.status){
+        this.$dialog({
+          width: 303,
+          className: 'monitor-dialog',
+          title: '监控成功',
+          message: '您可前往“工作台-商机-企业情报监控”查看企业最新动态。为保证您能及时获取新增监控信息推送,请前往开启推送提醒。',
+          messageAlign:'center',
+          confirmButtonText: '去开启',
+          confirmButtonColor: '#2ABED1',
+          showConfirmButton: true,
+          showCancelButton: true,
+          cancelButtonText: '暂不开启',
+          // cancelButtonColor: '#5F5E64'
+        }).then(() =>{
+          //  展开监控菜单 active:4
+          window.location.href = location.origin + '/jy_mobile/push/pushsetting?active=4'
+        })
+        return
+      }
+      if(!this.powerInfo.isFree && !data.msg_open && data.status){
+        this.$dialog({
+          width: 303,
+          className: 'monitor-dialog',
+          title: '监控成功',
+          message: '您可前往“工作台-商机-业主监控”查看业主最新招标动态。为保证您能及时获取新增监控信息推送,请前往开启推送提醒。',
+          messageAlign:'center',
+          confirmButtonText: '去开启',
+          confirmButtonColor: '#2ABED1',
+          showConfirmButton: true,
+          showCancelButton: true,
+          cancelButtonText: '暂不开启',
+          // cancelButtonColor: '#5F5E64'
+        }).then(() =>{
+          //  展开监控菜单 active:4
+          window.location.href = location.origin + '/jy_mobile/push/pushsetting?active=4'
+        })
+
+      } else if(!this.powerInfo.isFree && data.msg_open && data.status){
+        this.$toast({
+          duration: 2000,
+          message: '监控成功,您可前往“工作台-商机-企业情报监控”查看'
+      })
+
+      }else if(!this.powerInfo.isFree && data.limit_status === 1){
+        let href_
+        if(utils.$envs.inWX){
+          href_ = '/weixin/frontPage/bigmember/free/perfect_info?source=' + this.sourceLimitMap.wx
+        }else if(utils.$envs.inApp){
+          href_ = '/jyapp/frontPage/bigmember/free/perfect_info?source=' + this.sourceLimitMap.app
+        }else if(utils.$envs.inH5){
+          href_ = '/jyapp/frontPage/bigmember/free/perfect_info?source=' +  + this.sourceLimitMap.h5
+        }
+        window.location.href = href_
+      } else if(!this.powerInfo.isFree && data.limit_status === 2){
+        this.$dialog({
+          width: 303,
+          className: 'monitor-dialog',
+          title: '监控企业个数已达上限',
+          message: '您最多可监控'+data.limit_count+'个企业,可联系客服,申请监控更多企业',
+          messageAlign:'center',
+          confirmButtonText: '联系客服',
+          confirmButtonColor: '#2ABED1',
+          showConfirmButton: true,
+          showCancelButton: true,
+          cancelButtonText: '返回',
+          // cancelButtonColor: '#5F5E64'
+        }).then(() =>{
+          if(utils.$envs.inWX){
+             window.location.href = '/big/wx/page/customer'
+          } else{
+            window.location.href = '/jyapp/free/customer'
+          }
+        })
+      }else if(this.powerInfo.isFree){
+        let href_
+        if(utils.$envs.inWX){
+          href_ = '/weixin/frontPage/bigmember/free/perfect_info?source=' + this.sourceLimitMap.wx
+        }else if(utils.$envs.inApp){
+          href_ = '/jyapp/frontPage/bigmember/free/perfect_info?source=' + this.sourceLimitMap.app
+        }else if(utils.$envs.inH5){
+          href_ = '/jyapp/frontPage/bigmember/free/perfect_info?source=' + this.sourceLimitMap.h5
+        }
+        window.location.href = href_
+      }
+
+    },
+    // 赚剑鱼币任务完成提示
     pointsTaskSuccessTip: function() {
       // 获取剑鱼币任务信息
       const from =  utils.getParam('from')
@@ -1579,6 +1699,7 @@ var vNode = {
         svipBuyset: this.svipBuyset,
         bidcollPowerInfo: this.bidcollPowerInfo,
         scrollTop: this.scrollTop + scrollTopOffset,
+        showGroupingDialog: this.showGroupingDialog,
         gotTab2: this.gotTab2
       }
       sessionStorage.setItem(this.sessKey, JSON.stringify(data))

+ 33 - 13
src/web/staticres/common-module/mobile-portrayal-footer/js/mobile-portrayal-footer.js

@@ -28,7 +28,7 @@ var mobileportrayalfootertemp = `
       </div>
       <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>
+          <p class="look-text">{{ entInfo.followedGroup }}</p>
           <span @click="editorGroupEvent" class="editor-group">更改></span>
         </div>
         <div class="monitor-box-item">
@@ -37,7 +37,7 @@ var mobileportrayalfootertemp = `
         <div class="monitor-box-item">
           <p class="look-text look-text--monitor" @click="lookList">查看监控列表</p>
           <p class="look-desc">已监控 <span class="look-num" v-text="use"></span> 个,剩余 <span class="look-num" v-text="surplus"></span> 个</p>
-          <div class="look-btn" @click="lookMore">申请监控更多业主</div>
+          <div class="look-btn" @click="lookMore">申请监控更多{{ setMonitorObj }}</div>
         </div>
         <div class="monitor-box-item">
           <p class="look-cancellation"  @click="monitorCancellation">取消监控</p>
@@ -77,7 +77,7 @@ var mobilePortrayalFooter = {
       type: Boolean,
       default: false
     },
-    followedGroup: { // 监控分组
+    entInfo: { // 监控分组
       type: String,
       default: ''
     },
@@ -140,6 +140,11 @@ var mobilePortrayalFooter = {
   mounted () {
 
   },
+  computed: {
+    setMonitorObj () {
+      return this.portraitOrigin === 'ent' ? '企业' : '业主'
+    }
+  },
  watch: {
   islogin (val){
     if(val){
@@ -220,12 +225,22 @@ var mobilePortrayalFooter = {
     },
     //  采购单位监控点击相关
     lookList (){
-      // 跳转至监控列表页
-      if(utils.$envs.inWX){
-        window.location.href = '/big/wx/page/client_list'
-     } else {
-       window.location.href = '/jyapp/big/page/client_list'
-     }
+      // 大会员企业画像点击查看监控列表跳转到大会员企业情报监控列表页
+      if (this.portraitOrigin === 'ent'){
+        if(utils.$envs.inWX){
+          window.location.href = '/jylab/followent/entList'
+        } else {
+          window.location.href = '/jyapp/big/page/ent_follow'
+        }
+      } else {
+        // 非企业画像跳转至对应的监控列表页
+        if(utils.$envs.inWX){
+          window.location.href = '/big/wx/page/client_list'
+        } else {
+          window.location.href = '/jyapp/big/page/client_list'
+        }
+      }
+      
     },
     lookMore (){
       if(this.allpower.vipStatus > 0){
@@ -243,8 +258,8 @@ var mobilePortrayalFooter = {
         this.$dialog({
           width: 303,
           className: 'monitor-dialog',
-          title: '申请监控更多业主',
-          message: '您可联系客服,申请升级产品套餐,监控更多业主',
+          title: `申请监控更多${this.setMonitorObj}`,
+          message: `您可联系客服,申请升级产品套餐,监控更多${this.setMonitorObj}`,
           messageAlign:'center',
           confirmButtonText: '联系客服',
           confirmButtonColor: '#2ABED1',
@@ -262,8 +277,13 @@ var mobilePortrayalFooter = {
       }
     },
     yes_monitor (data, isInit){
-      this.surplus = data.count.surplus
-      this.use = data.count.use
+      if(this.portraitOrigin === 'ent'){
+        this.surplus = this.entInfo.info.surplus
+        this.use = this.entInfo.info.used
+      } else {
+        this.surplus = data.count.surplus
+        this.use = data.count.use
+      }
       if (isInit !== true) {
         this.monitorboxShow = !this.monitorboxShow
         this.monitorGroupShow = this.portraitOrigin === 'ent' ? true : false

+ 6 - 2
src/web/staticres/common-module/mobile-portrayal-footer/js/mobile-portrayal-grouping.js

@@ -6,6 +6,7 @@ var mobilePortrayalGrouping = `
       show-cancel-button
       class="grouping-dialog"
       @confirm="confirmGrouping"
+      @cancel="cancelGrouping"
       >
       <div class="add-grouping" @click="addMonitor">
         <van-icon color="#2ABED1" name="plus" />
@@ -14,7 +15,7 @@ var mobilePortrayalGrouping = `
       <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 checked-color="#2ABED1" :name="item.s_name" v-for="(item, index) in groupingList" :key="index">{{item.s_name}}</van-checkbox>
         </van-checkbox-group>
       </div>
     </van-dialog>
@@ -119,7 +120,7 @@ var mobilePortrayalGroupingScript = {
       const idArr = []
       this.groupingList.forEach(item => {
         this.groupingResult.forEach(group => {
-          if (item.name === group) {
+          if (item.s_name === group) {
             idArr.push(item.id)
           }
         })
@@ -129,6 +130,9 @@ var mobilePortrayalGroupingScript = {
         entId: this.entId
       }
       this.$emit('confirm', params)
+    },
+    cancelGrouping () {
+      this.$emit('cancel')
     }
   }
 }