ソースを参照

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

汤世哲 6 ヶ月 前
コミット
82227bcb46

+ 264 - 4
src/jfw/modules/app/src/web/staticres/jyapp/big-member/js/potential_cor_list.js

@@ -12,6 +12,9 @@ var titleMap = {
 var vConfig = {
     delimiters: ['${', '}'],
     el: '#potential-cor-list',
+    components: {
+      mobilePortrayalGroupingScript: mobilePortrayalGroupingScript,
+    },
     data: {
         surplusCount: 0, // 试用版剩余竞争对手数量(非试用)
         // 是否显示引导购买入口
@@ -63,6 +66,15 @@ var vConfig = {
             }
         },
         power: [],
+        showGroupingDialog: false,
+        isLogin: false,
+        groupingList: [],
+        selectedItem: {},
+        sourceLimitMap: {
+          app: 'app_ent_limit',
+          wx: 'wx_ent_limit',
+          h5: 'h5_ent_limit'
+        },
     },
     computed: {
         showTrialGuideBuy: function () {
@@ -85,6 +97,7 @@ var vConfig = {
     created: function () {
         this.type = utils.getParam('type') || '1'
         this.getVipStatus()
+        this.getUserSimpleInfo()
     },
     mounted: function () {
         // 恢复数据
@@ -176,6 +189,7 @@ var vConfig = {
                 url: '/bigmember/use/isAdd',
                 success: function (res) {
                     if (res.data) {
+                        _this.powerInfo = res.data
                         _this.bigVipStatus = res.data.memberStatus || 0
                         if ($.isArray(res.data.power)) {
                             _this.power = res.data.power
@@ -281,12 +295,258 @@ var vConfig = {
                 }
             })
         },
+        // 判断当前用户是登录
+        getUserSimpleInfo() {
+          const _this = this
+          $.ajax({
+            type: 'POST',
+            url: '/jypay/user/getSimpleData',
+            success: function (res) {
+              if(res && res.userId) {
+                _this.isLogin = true
+              }
+            },error:function (e) {
+              _this.isLogin = false
+            }
+          })
+        },
+        // changeFollowState: function (item) {
+        //     if (!this.pagePower){
+        //     	this.changeFS_normal(item)
+        //     } else {
+        //     	this.changeFS_bigvip(item)
+        //     }
+        // },
+        
         changeFollowState: function (item) {
-            if (!this.pagePower){
-            	this.changeFS_normal(item)
-            } else {
-            	this.changeFS_bigvip(item)
+          var _this = this
+          _this.selectedItem = item
+          if(!_this.isLogin) {
+            window.location.href = "/jyapp/free/login?to=back";
+            return
+          }
+          if (item.follow) {
+            _this.changeFollowStateRequest()
+            
+          } else {
+            this.getEntFollowState(item, (res) => {
+              const { surplus, used } = res.info
+              const monitorEntNum = surplus + used  // 可监控企业总数
+              let limit = this.powerInfo.memberStatus > 0 || this.powerInfo.entniche
+              // 1.超出可监控企业数量
+              if (surplus <= 0) {
+                // 大会员或商机管理用户
+                if (limit) {
+                  this.$dialog({
+                    width: 303,
+                    className: 'monitor-dialog',
+                    title: '监控企业个数已达上限',
+                    message: '您最多可监控'+monitorEntNum+'个企业,可联系客服,申请监控更多企业',
+                    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 {
+                  // 非大会员非商机管理用户,进入留资页面
+                  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 {
+                this.getEntGroupList()
+              }
+            })
+          }
+        },
+        // 修改企业关注状态
+        changeFollowStateRequest: function (params = {}) {
+          var _this = this
+          var loading = this.showLoading()
+          var urls = {
+            addFollow: '/bigmember/follow/ent/addFollow',
+            delFollow: '/bigmember/follow/ent/delFollow'
+          }
+          var url = !!this.selectedItem.follow ? urls.delFollow : urls.addFollow
+          $.ajax({
+            type: 'POST',
+            url: url,
+            data: {
+              ...params,
+              entId: _this.selectedItem.entId,
+            },
+            timeout: 5000,
+            success: function (res) {
+              if (res.error_code == 0) {
+                loading.clear()
+                if (res.data === 'success' || res.data.status) {
+                  const active = !_this.powerInfo.isFree ? 4 : 3
+                  _this.selectedItem.follow = !_this.selectedItem.follow
+                  // _this.getEntFollowState()
+                  if(utils.$envs.inApp && JyObj.checkNoticePermission()!=1 && res.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=' + active
+                    })
+                    return
+                  }
+                  if(!res.data.msg_open && res.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:3
+                      window.location.href = location.origin + '/jy_mobile/push/pushsetting?active=' + active
+                    })
+            
+                  } else if(res.data.msg_open && res.data.status){
+                    _this.$toast({
+                      duration: 2000,
+                      message: '监控成功,您可前往“工作台-商机-企业情报监控”查看'
+                    })
+            
+                  }
+                } else {
+                  return _this.showToast(res.error_msg || '监控失败')
+                }
+                // if(_this.selectedItem.follow) {
+                //   _this.pointsTaskSuccessTip()
+                // }
+
+                // if (!_this.selectedItem.follow) {
+                //   history.back()
+                // }
+              } else {
+                _this.showToast(res.error_msg)
+              }
+            },
+            error: function (error) {
+              console.log(error)
+              loading.clear()
+            }
+          })
+        },
+        // 获取企业分组列表
+        getEntGroupList () {
+          var _this = this
+          $.ajax({
+            url: '/bigmember/follow/ent/labelGroup',
+            type: 'POST',
+            data: {
+              type: 'get'
+            },
+            success: function (res) {
+              if (res.error_code === 0) {
+                _this.groupingList = res.data || []
+                _this.showGroupingDialog = true
+                // 回显上次选择的分组
+                const filterSelect = _this.groupingList.filter(item => !!item.isSelect)
+                const selectList = filterSelect.map(item => item.s_name) || ['默认分组']
+                _this.$refs.portrayalGrouping.setState(selectList)
+                
+              } 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'
+                    }
+                  })
+                }
+              }
+            }
+          })
+        },
+        getEntFollowState: function (item, callback) {
+          var _this = this
+          // _this.selectedItem.followSearchFinish = false
+          $.ajax({
+            type: 'POST',
+            url: '/bigmember/follow/ent/followCheck',
+            data: {
+              entId: item.entId
+            },
+            timeout: 5000,
+            success: function (res) {
+              if (res.error_code == 0) {
+                // _this.selectedItem.followSearchFinish = true
+                if (res.data) {
+                  _this.selectedItem.follow = !!res.data.followed
+                  // _this.selectedItem.entExist = !!res.data.isShow
+                  // _this.selectedItem.followedGroup = res.data.followedGroup
+                  _this.selectedItem.info = res.data.info
+                  callback && callback(res.data)
+                } else {
+                  // _this.selectedItem.entExist = false
+                }
+              } else {
+                _this.$toast(res.error_msg)
+              }
+            },
+            error: function (error) {
+              console.log(error)
             }
+          })
+        },
+        confirmGrouping: function(params) {
+          this.showGroupingDialog = false
+          this.changeFollowStateRequest(params)
+        },
+        cancelGrouping: function () {
+          this.showGroupingDialog = false
+        },
+        updateGroupList () {
+          this.getEntGroupList()
         },
         changeFS_normal:function(item){
         	var _this = this

+ 13 - 4
src/jfw/modules/app/src/web/templates/big-member/page_potential_cor_list.html

@@ -16,6 +16,7 @@
     <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/reset-css/5.0.1/reset.min.css />
     <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/index.css />
     <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/icon/local.css />
+    <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"}}'/>
     <!--E-当前页面的css资源-->
     <style>
         /* 头部样式,兼容长字 */
@@ -78,14 +79,14 @@
             width: .4rem;
             height: .4rem;
         }
-        /* .cor-item-right .cor-yjk {
+        .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;
@@ -238,11 +239,10 @@
                                 </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"
-                                    :class="item.follow ? 'icon-favorite' : 'icon-no-favorite'"
+                                    :class="item.follow ? 'cor-yjk' : 'cor-jk'"
                                     @click.stop.prevent="changeFollowState(item)"
                                 ></span>
                                 <span class="more-action tooltip" @click.stop.prevent="showMoreActionPanel" v-if="pageConf.moreActionShow">
@@ -264,6 +264,14 @@
                 </div>
             </div>
         </div>
+        <mobile-portrayal-grouping-script 
+          ref="portrayalGrouping"
+          @confirm="confirmGrouping"
+          @cancel="cancelGrouping"
+          @update="updateGroupList"
+          :show-grouping-dialog="showGroupingDialog"
+          :grouping-list="groupingList"
+        ></mobile-portrayal-grouping-script>
     </div>
 </div>
 
@@ -278,6 +286,7 @@
 <script src=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/vant.min.js></script>
 <script src=//cdn-common.jianyu360.com/cdn/lib/zepto/1.2.0/zepto.min.js></script>
 {{include "/big-member/commonjs.html"}}
+<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}}/jyapp/big-member/js/potential_cor_list.js?v={{Msg "seo" "version"}}'></script>
 
 </body>

+ 165 - 3
src/jfw/modules/app/src/web/templates/followent/list.html

@@ -5,10 +5,31 @@
 <link rel="stylesheet" type="text/css" href="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/local/layout.css" />
 <link href="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/css/font.css?v={{Msg "seo" "version"}}" rel="stylesheet">
 <link href="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/css/common.css?v={{Msg "seo" "version"}}" rel="stylesheet">
+<!--S-当前页必定需要预加载的资源-->
+<link rel="preload" as="style" href=//cdn-common.jianyu360.com/cdn/lib/reset-css/5.0.1/reset.min.css />
+<link rel="preload" as="style" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/index.css />
+<link rel="preload" as="style" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/icon/local.css />
+<!--E-当前页必定需要预加载的资源-->
+
+<!--S-当前页面的css资源-->
+<link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/reset-css/5.0.1/reset.min.css />
+<link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/index.css />
+<link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/icon/local.css />
+<!--E-当前页面的css资源-->
 <link href="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/followent/css/follow.css?v={{Msg "seo" "version"}}" rel="stylesheet">
 <script src="https://cdn-common.jianyu360.com/cdn/lib/jquery/3.6.0/jquery.min.js"></script>
 <script src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/local/fastclick.min.js"></script>
 {{include "/common/js.html"}}
+<!--S-必定需要预加载的资源-->
+<script rel="preload" as="script" src=//cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js></script>
+<script rel="preload" as="script" src=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/vant.min.js></script>
+<script rel="preload" as="script" src=//cdn-common.jianyu360.com/cdn/lib/zepto/1.2.0/zepto.min.js></script>
+<!--E-必定需要预加载的资源-->
+
+<!--S-当前页面的资源-->
+<script src=//cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js></script>
+<script src=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/vant.min.js></script>
+<script src=//cdn-common.jianyu360.com/cdn/lib/zepto/1.2.0/zepto.min.js></script>
 <script>
 	var isPageHide = false;
 	window.addEventListener('pageshow', function () {
@@ -23,8 +44,15 @@
 <script type="text/javascript">
 	$(function () {
 		new FastClick(document.body);
-        var followEntLimit = {{.T.followEntLimit}};
-		$.post("/bigmember/follow/ent/list?t="+new Date().getTime(),null,function(r){
+    var followEntLimit = {{.T.followEntLimit}};
+    ajaxListData().then((r) => {
+      setDataAction(r)
+    })
+		// $.post("/bigmember/follow/ent/list?t="+new Date().getTime(),null,function(r){
+      
+		// });
+
+    function setDataAction (r) {
       const res = r.data
 			$("#addDiv").click(function(){
 				if(res.list.length >=followEntLimit){
@@ -137,7 +165,9 @@
 	            }
 	            window.location.href = "/jyapp/followent/detail/"+$(this).attr("data-id") + '?entId=' + $(this).attr("ent-id");
 	        });
-		});
+      // 获取分组列表
+      groupDataInfo(res);
+    }
 
 		$(".jylistbottom").click(function(){
 			easyPopup.show("easypopup");
@@ -172,6 +202,121 @@
 				EasyAlert.show("暂无30天无更新的数据<br>可删除!");
 			}
 		});
+    function ajaxListData (params = {}) {
+      return new Promise(function (resolve, reject) {
+        $.ajax({
+          type: 'post',
+          url: '/bigmember/follow/ent/list?t=' + new Date().getTime(),
+          data: params,
+          success: function (res) {
+            resolve(res)
+          },
+          error: function (err) {
+            reject(err)
+          }
+        })
+      })
+    }
+    function groupDataInfo (listInfo) {
+      var groupNode = new Vue({
+          delimiters: ['${', '}'],
+          el: '#grouping-container',
+          data: {
+            activeNames: [],
+            groupingList: [],
+            selectGroupList: [],
+            listInfo: listInfo
+          },
+          created: function () {
+            this.getEntGroupList()
+          },
+
+          methods: {
+            // 获取企业分组数据
+            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 || [])
+                        }
+                    }
+                })
+            },
+            // 设置企业分组数据
+            setEntGroupData (data) {
+              data.unshift({
+                count: this.listInfo.count,
+                id: "",
+                isPut: -1,
+                name: "全部"
+              })
+
+              data.forEach(item => {
+                item.active = item.name === '全部' ? true : false
+              })
+              this.groupingList = data
+            },
+            groupManage: function () {
+              location.href = '/jy_mobile/entgroup/index'
+            },
+            changeGrouping: function (item) {
+              const isAll = item.name === '全部'
+              if(isAll) {
+                item.count = this.listInfo.count
+              }
+              if (!item.count) return
+              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
+              if(!lengthBool) {
+                this.groupingList.forEach(s => {
+                  s.active = false
+                  if(s.name === '全部') {
+                    s.active = true
+                  }
+                })
+              }
+              this.listInfo.pageNum = 0
+              ajaxListData({
+                pageNum: this.listInfo.pageNum,
+                group: lengthBool ? this.selectGroupList.map(s => s.id).join(',') : ''
+              }).then((r) => {
+                setDataAction(r)
+              })
+              this.activeNames = []
+            },
+          }
+      });
+    }
 	});
 function receivePushMessageHandle(type,url){
 	if(type=="entname"){
@@ -207,6 +352,23 @@ function receivePushMessageHandle(type,url){
                 <div class="pur_btn">立即购买</div>
             </a>
         </div>
+        <div id="grouping-container">
+          <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 >= 0}" v-for="(item, index) in groupingList" :key="index" @click="changeGrouping(item)">
+                      <span class="grouping-item-name">${ item.name }</span>
+                      <span v-if="item.name === '全部'" class="grouping-item-count">${ listInfo.count }</span>
+                      <span v-else 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>
+        </div>
         <div class="list-container">
             <ul>
             </ul>

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

@@ -5,6 +5,7 @@ var mobilePortrayalGrouping = `
       :title="title"
       show-cancel-button
       confirmButtonText="确定"
+      confirm-button-color="#2ABED1"
       class="grouping-dialog"
       @confirm="confirmGrouping"
       @cancel="cancelGrouping"

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

@@ -748,8 +748,8 @@
 <script src='{{Msg "seo" "cdn"}}/common-module/collection/js/visited.js?v={{Msg "seo" "version"}}'></script>
 <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/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>