|
@@ -100,11 +100,10 @@
|
|
|
<div class="com-title" id="com-title">
|
|
|
<!-- <span style="border-bottom:1px solid #2cb7ca">{{.T.obj.title}}</span>-->
|
|
|
{{.T.obj.title}}
|
|
|
-
|
|
|
</div>
|
|
|
<div class="com-statusbar" id="statusbar">
|
|
|
<!-- 自定义标签弹框 -->
|
|
|
- <div class="tags-box">
|
|
|
+ <div class="tags-box" id="collectTags">
|
|
|
<div class="tags-inputs">
|
|
|
<div class="tag-input">
|
|
|
<div class="tag-labels"></div>
|
|
@@ -172,7 +171,7 @@
|
|
|
toastFn('收藏成功')
|
|
|
$('#bidCollected').show()
|
|
|
$('#bidCollect').hide()
|
|
|
- $('.tags-box').show().css('top', top)
|
|
|
+ $('#collectTags.tags-box').show().css({'top': top, 'right' : 0, 'left':'unset'})
|
|
|
getUserTags()
|
|
|
} else {
|
|
|
toastFn(r.error_msg)
|
|
@@ -194,44 +193,44 @@
|
|
|
})
|
|
|
})
|
|
|
// 标签输入框事件
|
|
|
- $('.tags-box').click(function(e) {
|
|
|
+ $('#collectTags.tags-box').click(function(e) {
|
|
|
e.stopPropagation()
|
|
|
})
|
|
|
|
|
|
- $('.tag-input').click(function(e) {
|
|
|
+ $('#collectTags .tag-input').click(function(e) {
|
|
|
e.stopPropagation()
|
|
|
$(this).children('.tag-placeholder').hide()
|
|
|
$(this).children('input').focus()
|
|
|
})
|
|
|
// 标签输入框回车事件
|
|
|
- $('.tag-input .clear-input').keydown(function(event){
|
|
|
+ $('#collectTags .tag-input .clear-input').keydown(function(event){
|
|
|
event.stopPropagation()
|
|
|
if (event.keyCode == 13) {
|
|
|
if (!$('.tags-box').is(':hidden')) {
|
|
|
- $('.tags-inputs .add-tag-button').trigger('click')
|
|
|
+ $('#collectTags .tags-inputs .add-tag-button').trigger('click')
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
// 添加标签按钮事件
|
|
|
- $('.tags-inputs .add-tag-button').on('click', function () {
|
|
|
- var input = $('.tag-input .clear-input')
|
|
|
+ $('#collectTags .tags-inputs .add-tag-button').on('click', function () {
|
|
|
+ var input = $('#collectTags .tag-input .clear-input')
|
|
|
if(input.val().length >= 2 && input.val().length < 6) {
|
|
|
// ajax提交自定义标签
|
|
|
addTagsAjax(input.val())
|
|
|
}
|
|
|
})
|
|
|
// 标签输入框失去焦点事件
|
|
|
- $('.tag-input .clear-input').blur(function() {
|
|
|
+ $('#collectTags .tag-input .clear-input').blur(function() {
|
|
|
if($('.tag-labels').children().length == 0 && $(this).val() == '') {
|
|
|
$('.tag-placeholder').show()
|
|
|
}
|
|
|
})
|
|
|
// 点击确定按钮,绑定标签
|
|
|
- $('.tags-footer .button-confirm').on('click', function () {
|
|
|
- if (!$('.tags-box').is(':hidden')){
|
|
|
+ $('#collectTags .tags-footer .button-confirm').on('click', function () {
|
|
|
+ if (!$('#collectTags.tags-box').is(':hidden')){
|
|
|
var lids = ""
|
|
|
var lname = ""
|
|
|
- $('.tags-item.tags-active').each(function() {
|
|
|
+ $('#collectTags .tags-item.tags-active').each(function() {
|
|
|
if ($(this).attr('data-id')){
|
|
|
if(lids != ""){
|
|
|
lids += ",";
|
|
@@ -253,12 +252,12 @@
|
|
|
// 执行保存绑定标签操作
|
|
|
if (params.lids !== '') {
|
|
|
saveChooseTags(params, function () {
|
|
|
- $('.tags-footer .button-cancel').trigger('click')
|
|
|
+ $('#collectTags .tags-footer .button-cancel').trigger('click')
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
- $('.tags-footer .button-cancel').on('click', function () {
|
|
|
+ $('#collectTags .tags-footer .button-cancel').on('click', function () {
|
|
|
$('.tags-box').hide(function() {
|
|
|
// 标签弹框消失时 清除上次选择的标签分类
|
|
|
activeTags = []
|
|
@@ -339,7 +338,72 @@
|
|
|
}
|
|
|
})
|
|
|
</script>
|
|
|
+ {{else if .T.isEntnicheNew }}
|
|
|
+ <!-- 新商机管理关注项目 -->
|
|
|
+ <span class="com-guanzhu" id="followedProject" style="display: none">
|
|
|
+ <img class="icon-title-img" src="{{Msg "seo" "cdn"}}/images/focused.png">
|
|
|
+ <font>已关注</font>
|
|
|
+ </span>
|
|
|
+ <span class="com-guanzhu" id="unfollowedProject" style="display: none;cursor: pointer;">
|
|
|
+ <img class="icon-title-img" src="{{Msg "seo" "cdn"}}/images/focus.png">
|
|
|
+ <font>关注项目</font>
|
|
|
+ </span>
|
|
|
|
|
|
+ <script>
|
|
|
+ $(function(){
|
|
|
+ var followProjectId = ""
|
|
|
+ var doReq = false
|
|
|
+
|
|
|
+ $.post("/entnicheNew/follow/project/check",{sid:{{.T.obj._id}}},function(res){
|
|
|
+ if(res.data.showFollow){
|
|
|
+ if( res.data.flag ){
|
|
|
+ //已关注
|
|
|
+ $("#followedProject").css("display","")
|
|
|
+ }else {
|
|
|
+ //未关注
|
|
|
+ $("#unfollowedProject").css("display","")
|
|
|
+ }
|
|
|
+ followProjectId= res.data.fig
|
|
|
+ //取消关注
|
|
|
+ $("#followedProject").on("click",cancelFollow)
|
|
|
+ //关注
|
|
|
+ $("#unfollowedProject").on("click",addFollow)
|
|
|
+ } else {
|
|
|
+ $('.bid_dev').hide()
|
|
|
+ }
|
|
|
+ });
|
|
|
+ function cancelFollow() {
|
|
|
+ if (followProjectId ===""||doReq){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ doReq = true
|
|
|
+ $.post("/entnicheNew/follow/project/cance",{fid:followProjectId},function(r){
|
|
|
+ if (r.data === "success"){
|
|
|
+ followProjectId= ""
|
|
|
+ $("#followedProject").css("display","none")
|
|
|
+ $("#unfollowedProject").css("display","")
|
|
|
+ }
|
|
|
+ doReq = false
|
|
|
+ });
|
|
|
+ }
|
|
|
+ function addFollow() {
|
|
|
+ if (doReq){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ doReq = true
|
|
|
+ $.post("/entnicheNew/follow/project/add",{sid:{{.T.obj._id}}},function(r){
|
|
|
+ if(r.error_code===0&&r.data!==""){
|
|
|
+ followProjectId = r.data
|
|
|
+ $("#unfollowedProject").css("display","none")
|
|
|
+ $("#followedProject").css("display","")
|
|
|
+ } else {
|
|
|
+ EasyAlert.show(r.error_msg, { 'max-width': 'unset' }, 1500);
|
|
|
+ }
|
|
|
+ doReq = false
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ </script>
|
|
|
{{else}}
|
|
|
<!--非大会员用户,只能扫码跳转微信关注项目 -->
|
|
|
<span class="com-guanzhu">
|
|
@@ -636,7 +700,11 @@
|
|
|
<div class="cont-cont portrait_img" href-data="/swordfish/page_big_pc/unit_portrayal/{{.T.obj.buyer}}" tip-data="查看采购单位画像">{{.T.obj.buyer}} </div>
|
|
|
{{end}}
|
|
|
<div class="cont-recy" onclick="recoveryerr(this,'buyer','')">纠错</div>
|
|
|
+ {{if .T.isEntnicheNew}}
|
|
|
+ <div class="claim">{{if .T.obj.buyer}}认领{{end}}</div>
|
|
|
+ {{else}}
|
|
|
<div class="portrait_img only-text">{{if .T.obj.buyer}}立即查看{{end}}</div>
|
|
|
+ {{end}}
|
|
|
<div style="display:none;"></div>
|
|
|
{{else}}
|
|
|
<el-popover
|
|
@@ -1157,6 +1225,22 @@
|
|
|
}
|
|
|
</script>
|
|
|
</div>
|
|
|
+ <!-- 商机管理认领-自定义标签弹框 -->
|
|
|
+ <div class="tags-box" id="entNicheTags">
|
|
|
+ <div class="tags-inputs">
|
|
|
+ <div class="tag-input">
|
|
|
+ <div class="tag-labels"></div>
|
|
|
+ <input type="text" class="clear-input" maxlength="5" oninput="this.value=this.value.replace(/\s+/g,'')">
|
|
|
+ <div class="tag-placeholder">新增标签回车保存</div>
|
|
|
+ </div>
|
|
|
+ <div class="add-tag-button">添加并使用</div>
|
|
|
+ </div>
|
|
|
+ <div class="tags-list clearfix"></div>
|
|
|
+ <div class="tags-footer">
|
|
|
+ <div class="tags-button button-confirm">确认添加</div>
|
|
|
+ <div class="tags-button button-cancel">暂不添加</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div id="popup" class="pop-up poperr">
|
|
|
<div class="pop-head" id="pop-head">
|
|
@@ -1200,7 +1284,8 @@ var ucbs_source="pc_rec",ucbsId="{{.T.obj.ucbsId}}";
|
|
|
<script src=//cdn-common.jianyu360.com/cdn/lib/element-ui/2.15.7/lib/index.js></script>
|
|
|
<script src="{{Msg "seo" "cdn"}}/js/pc-collect-bid-info.js?v={{Msg "seo" "version"}}"></script>
|
|
|
<script src="{{Msg "seo" "cdn"}}/js/pc-collect-user-info.js?v={{Msg "seo" "version"}}"></script>
|
|
|
- <script>
|
|
|
+ <script type="text/javascript" src="{{Msg "seo" "cdn"}}/js/pc_entniche_tags.js?v={{Msg "seo" "version"}}"></script>
|
|
|
+ <script>
|
|
|
console.log({{.T.isEntnicheNew}})
|
|
|
// 广告点击事件
|
|
|
var IframeOnClick = {
|
|
@@ -3680,7 +3765,131 @@ function fromwhere(text){
|
|
|
$('.super-vip-show').hide()
|
|
|
}
|
|
|
}
|
|
|
+ var isEntnicheNew = {{.T.isEntnicheNew}}
|
|
|
+ var isHasBuyer = {{.T.obj.buyer}}
|
|
|
+ console.log(isEntnicheNew, isHasBuyer)
|
|
|
+ // 新商机管理用户是否认领该采购单位
|
|
|
+ function getClaimStatus() {
|
|
|
+ if (!isEntnicheNew || !isHasBuyer) return
|
|
|
+ var params = {
|
|
|
+ names:{{.T.obj.buyer}}
|
|
|
+ }
|
|
|
+ $.ajax({
|
|
|
+ type:'post',
|
|
|
+ url:'/entnicheNew/customer/claimcheck',
|
|
|
+ contentType: "application/json",
|
|
|
+ data: JSON.stringify(params),
|
|
|
+ success: function(res){
|
|
|
+ if (res.data) {
|
|
|
+ if (res.data.iscoll) {
|
|
|
+ $('.claim').addClass('claim-yes').removeClass('claim-no').text('已认领')
|
|
|
+ // 认领
|
|
|
+ $('.claim-yes').unbind('click').click(function() {
|
|
|
+ cancelClaim()
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ $('.claim').addClass('claim-no').removeClass('claim-yes').text('认领')
|
|
|
+ // 认领
|
|
|
+ $('.claim-no').unbind('click').click(function(e) {
|
|
|
+ var top = e.target.offsetParent.offsetTop + 50
|
|
|
+ var left = e.target.offsetLeft
|
|
|
+ $('#entNicheTags.tags-box').show().css({'top': top, 'left': left})
|
|
|
+ geEntNicheUserTags()
|
|
|
+ // 点击确定按钮,绑定标签
|
|
|
+ $('#entNicheTags .tags-footer .button-confirm').on('click', function () {
|
|
|
+ if (!$('#entNicheTags.tags-box').is(':hidden')){
|
|
|
+ var lids = ""
|
|
|
+ var lname = ""
|
|
|
+ $('#entNicheTags .tags-item.tags-active').each(function() {
|
|
|
+ if ($(this).attr('data-id')){
|
|
|
+ if(lids != ""){
|
|
|
+ lids += ",";
|
|
|
+ }
|
|
|
+ if(lname != "") {
|
|
|
+ lname+= ",";
|
|
|
+ }
|
|
|
+ lids += $(this).attr('data-id');
|
|
|
+ lname += $(this).text()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ let lidArr = []
|
|
|
+ activeTags.forEach(v => {
|
|
|
+ lidArr.push(v.lid)
|
|
|
+ })
|
|
|
+ var params = {
|
|
|
+ name: {{.T.obj.buyer}},
|
|
|
+ mold: 1,
|
|
|
+ D: false,
|
|
|
+ label: lidArr.toString()
|
|
|
+ }
|
|
|
+ console.log(params)
|
|
|
+ // 执行保存绑定标签操作
|
|
|
+ if (params.name !== '') {
|
|
|
+ confirmClaim(params, function(res) {
|
|
|
+ if (res.data) {
|
|
|
+ toastFn('认领成功', 1000)
|
|
|
+ $('.claim').addClass('claim-yes').removeClass('claim-no').text('已认领')
|
|
|
+ getClaimStatus()
|
|
|
+ } else {
|
|
|
+ toastFn(res.error_msg)
|
|
|
+ }
|
|
|
+ $('#entNicheTags .tags-footer .button-cancel').trigger('click')
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // confirmClaim()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 新商机管理-认领采购单位
|
|
|
+ function confirmClaim (params, callback) {
|
|
|
+ if (!isEntnicheNew || !isHasBuyer) return
|
|
|
+ $.ajax({
|
|
|
+ type:'post',
|
|
|
+ url:'/entnicheNew/customer/attention',
|
|
|
+ contentType: "application/json",
|
|
|
+ data: JSON.stringify(params),
|
|
|
+ success: function(res){
|
|
|
+ if (res.error_code == 0) {
|
|
|
+ callback && callback(res)
|
|
|
+ } else {
|
|
|
+ console.log(res.error_msg)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 新商机管理-取消认领采购单位
|
|
|
+ function cancelClaim() {
|
|
|
+ if (!isEntnicheNew || !isHasBuyer) return
|
|
|
+ var params = {
|
|
|
+ name:{{.T.obj.buyer}},
|
|
|
+ mold: 1,
|
|
|
+ D: true, // false:认领 true:取消认领
|
|
|
+ }
|
|
|
+ $.ajax({
|
|
|
+ type:'post',
|
|
|
+ url:'/entnicheNew/customer/attention',
|
|
|
+ contentType: "application/json",
|
|
|
+ data: JSON.stringify(params),
|
|
|
+ success: function(res){
|
|
|
+ if (res.error_code == 0) {
|
|
|
+ if (res.data) {
|
|
|
+ toastFn('已取消认领', 1000)
|
|
|
+ $('.claim').addClass('claim-no').removeClass('claim-yes').text('认领')
|
|
|
+ getClaimStatus()
|
|
|
+ } else {
|
|
|
+ toastFn(res.error_msg)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
$(function() {
|
|
|
+ getClaimStatus()
|
|
|
getFileData();
|
|
|
// 定时取login.js里isAdd接口返回的用户身份(暴露给window变量) 取到清除定时器
|
|
|
var timer = null
|