|
@@ -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,282 @@ 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)
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+
|
|
|
+ monitorCancellation (){ // 取消监控
|
|
|
+ this.$dialog({
|
|
|
+ width: 303,
|
|
|
+ className: 'monitor-dialog',
|
|
|
+ title: '确定不再监控?',
|
|
|
+ message: `取消监控,将错过企业最新动态推送`,
|
|
|
+ messageAlign:'center',
|
|
|
+ confirmButtonText: '确认取消',
|
|
|
+ confirmButtonColor: '#2ABED1',
|
|
|
+ showConfirmButton: true,
|
|
|
+ showCancelButton: true,
|
|
|
+ cancelButtonText: '我再想想',
|
|
|
+ cancelButtonColor: '#2ABED1'
|
|
|
+ }).then(() =>{
|
|
|
+ this.changeFollowStateRequest()
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
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.monitorCancellation()
|
|
|
+
|
|
|
+ } 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
|
|
|
+ if(_this.selectedItem.follow) {
|
|
|
+ _this.$toast({
|
|
|
+ duration: 2000,
|
|
|
+ message: '取消监控成功'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ _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
|