|
@@ -16,6 +16,27 @@ if(sessionStorage){
|
|
|
<script src="https://cdn-common.jianyu360.com/cdn/lib/jquery/3.6.0/jquery.min.js"></script>
|
|
|
<link href="/jylab/followent/css/weui.min.css" rel="stylesheet">
|
|
|
<link href="/jylab/followent/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资源-->
|
|
|
+<!--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>
|
|
|
<link href="/jylab/followent/css/follow.css?v={{Msg "seo" "version"}}" rel="stylesheet">
|
|
|
<link href="/jylab/followent/css/merge-wx.css?v={{Msg "seo" "version"}}" rel="stylesheet">
|
|
|
{{include "/common/header-assets.html"}}
|
|
@@ -40,6 +61,26 @@ if(sessionStorage){
|
|
|
}
|
|
|
</style>
|
|
|
<body class="listpage">
|
|
|
+ <div id="grouping-container" style="display: none;">
|
|
|
+ <van-sticky>
|
|
|
+ <van-collapse v-if="listInfo.list && listInfo.list.length" class="ent-grouping" v-model="activeNames" @change="setCollapseActive">
|
|
|
+ <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>
|
|
|
+ </van-sticky>
|
|
|
+ <div class="grouping-bot-line"></div>
|
|
|
+ </div>
|
|
|
<ul>
|
|
|
</ul>
|
|
|
<div class="divbtn"{{if .T.datas}}{{if eq (len .T.datas) 10}} disabled="disabled"{{end}}{{end}}>
|
|
@@ -82,9 +123,15 @@ initShare({{.T.signature}},{{.T.openid}},2,"jy_extend",{{.T.nickname}},{{.T.avat
|
|
|
//
|
|
|
var followEntLimit = {{.T.followEntLimit}};
|
|
|
var params = {
|
|
|
- pageSize: 100
|
|
|
+ pageSize: 500
|
|
|
}
|
|
|
- $.post("/bigmember/follow/ent/list?t="+new Date().getTime(),params,function(r) {
|
|
|
+ ajaxListData(params).then((r) => {
|
|
|
+ $('#grouping-container').show()
|
|
|
+ setDataAction(r)
|
|
|
+ groupDataInfo(r.data);
|
|
|
+ })
|
|
|
+
|
|
|
+ function setDataAction(r) {
|
|
|
const res = r.data
|
|
|
if (r && res && res.followMax) {
|
|
|
followEntLimit = res.followMax
|
|
@@ -192,28 +239,26 @@ initShare({{.T.signature}},{{.T.openid}},2,"jy_extend",{{.T.nickname}},{{.T.avat
|
|
|
+tdf+"</li>";
|
|
|
}
|
|
|
html = fronthtml + lasthtml;
|
|
|
- $(".listpage ul").append(html);
|
|
|
+ $(".listpage ul").html(html);
|
|
|
|
|
|
$(".tip").show();
|
|
|
-
|
|
|
- $(".listpage li").click(function(){
|
|
|
+ $(".listpage li").click(function(){
|
|
|
if(sessionStorage){
|
|
|
sessionStorage.version="0";
|
|
|
}
|
|
|
$(this).find(".redspot").remove();
|
|
|
window.location.href = "/jylab/followent/detail/"+$(this).attr("data-id") + '?entId=' + $(this).attr("ent-id");
|
|
|
});
|
|
|
-
|
|
|
- var flag = {{.T.flag}};
|
|
|
- $("#addDiv").click(function(){
|
|
|
- if(flag){
|
|
|
- EasyAlert.show("最多可关注<br>"+followEntLimit+"个企业!");
|
|
|
- return;
|
|
|
- }
|
|
|
- window.location.href = "/jylab/followent/addEnt";
|
|
|
- });
|
|
|
- })
|
|
|
-
|
|
|
+ var flag = {{.T.flag}};
|
|
|
+ $("#addDiv").click(function(){
|
|
|
+ if(flag){
|
|
|
+ EasyAlert.show("最多可关注<br>"+followEntLimit+"个企业!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ window.location.href = "/jylab/followent/addEnt";
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
$(".jylistbottom").click(function(){
|
|
|
easyPopup.show("easypopup");
|
|
|
});
|
|
@@ -247,7 +292,125 @@ initShare({{.T.signature}},{{.T.openid}},2,"jy_extend",{{.T.nickname}},{{.T.avat
|
|
|
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: {
|
|
|
+ setCollapseActive(activeNames) {
|
|
|
+ this.activeNames = activeNames
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取企业分组数据
|
|
|
+ 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({
|
|
|
+ pageSize: 500,
|
|
|
+ pageNum: this.listInfo.pageNum,
|
|
|
+ group: lengthBool ? this.selectGroupList.map(s => s.id).join(',') : ''
|
|
|
+ }).then((r) => {
|
|
|
+ setDataAction(r)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
</script>
|
|
|
<!-- {{include "/common/baiducc.html"}} -->
|