Browse Source

feat: 超级订阅2.2内容修改

cuiyalong 4 years ago
parent
commit
8c1ee911e5

+ 1 - 0
src/web/staticres/css/selector/selector.css

@@ -49,6 +49,7 @@
 }
 
 .selector-card-header {
+    position: relative;
     margin-right: 10px;
     min-width: 100px;
     line-height: 36px;

File diff suppressed because it is too large
+ 4 - 0
src/web/staticres/frontRouter/pc/collection/css/index-pc.css


+ 74 - 18
src/web/staticres/frontRouter/pc/collection/js/index-pc.js

@@ -12,7 +12,6 @@ var vm = new Vue({
         return {
             sessKey: '$data-collection-index',
             powerInfo: {},
-            power: false,
             powerLoaded: false,
             toast: {
                 show: false,
@@ -64,11 +63,25 @@ var vm = new Vue({
                 toastShow: false,
                 show: false,
                 currentDelTagInfo: {}, // 当前要删除标签的信息
-            }
+            },
+            addTagInfo: {
+                content: ''
+            },
+            powerDialogShow: false,
+            urlFilterTagId: []
+        }
+    },
+    computed: {
+        power: function () {
+            return this.powerInfo.entniche || this.powerInfo.member || this.powerInfo.vip !== 0
         }
     },
     created: function () {
         var _this = this
+        var tag = utils.getParam('tag')
+        if (tag) {
+            this.urlFilterTagId = tag.split(',')
+        }
         this.getPower(function () {
             if (_this.hasRestoreState()) {
                 // 等TagList请求完成后在恢复数据
@@ -81,13 +94,15 @@ var vm = new Vue({
                     }, 0)
                 })
             } else {
-                _this.getTagList()
-                _this.getList()
+                _this.getTagList(function () {
+                    _this.getList()
+                })
             }
         })
     },
     methods: {
         showToast: function (content, timer, callback) {
+            if (this.toast.show) return
             content = content || '暂无数据'
             timer = timer || 2000
             this.toast.content = content
@@ -104,7 +119,9 @@ var vm = new Vue({
                 success: function (res) {
                     if (res.error_code === 0 && res.data) {
                         this.powerInfo = res.data
-                        this.checkPower()
+                        if (!this.power) {
+                            this.listState.pageSize = 100
+                        }
                     }
                 }.bind(this),
                 complete: function () {
@@ -113,12 +130,6 @@ var vm = new Vue({
                 }.bind(this)
             })
         },
-        checkPower: function () {
-            this.power = this.powerInfo.entniche || this.powerInfo.member || this.powerInfo.vip !== 0
-            if (!this.power) {
-                this.listState.pageSize = 100
-            }
-        },
         getTagList: function (callback) {
             $.ajax({
                 url: '/publicapply/bidcoll/getLabel',
@@ -127,6 +138,9 @@ var vm = new Vue({
                     if (res.error_code === 0) {
                         this.tagList = res.data || []
                         this.initSelectTagList()
+                        if (this.urlFilterTagId.length) {
+                            this.filterState.tags = this.filterState.tags.concat(this.urlFilterTagId)
+                        }
                         callback && callback()
                     }
                 }.bind(this)
@@ -200,6 +214,31 @@ var vm = new Vue({
                 }.bind(this)
             })
         },
+        addTagConfirmed: function () {
+            var name = this.addTagInfo.content
+            if (!name) return
+            $.ajax({
+                url: '/publicapply/bidcoll/addLabel',
+                type: 'POST',
+                data: {
+                    name: name
+                },
+                success: function (res) {
+                    if (res.error_code === 0 && res.data) {
+                        this.addTagInfo.content = ''
+                        this.tagList.push({
+                            count: 0,
+                            lanme: name,
+                            lid: res.data
+                        })
+                        this.initSelectTagList()
+                        this.resetListState()
+                    } else {
+                        this.showToast(res.error_msg)
+                    }
+                }.bind(this)
+            })
+        },
         resetListState: function () {
             var state = {
                 loaded: false,
@@ -250,16 +289,29 @@ var vm = new Vue({
             this.doQuery()
         },
         buyerClassFilterChange: function (buyerclass) {
-            var buyerclassArr = []
-            this.filterState.buyerclassObj = buyerclass
-            for (var key in buyerclass) {
-                buyerclassArr = buyerclassArr.concat(buyerclass[key])
+            if (this.power) {
+                var buyerclassArr = []
+                this.filterState.buyerclassObj = buyerclass
+                for (var key in buyerclass) {
+                    buyerclassArr = buyerclassArr.concat(buyerclass[key])
+                }
+                this.filterState.buyerclass = buyerclassArr
+                this.doQuery()
+            } else {
+                this.$refs.buyerClassFilter.setState()
+                this.filterState.buyerclass = ''
+                this.powerDialogShow = true
             }
-            this.filterState.buyerclass = buyerclassArr
-            this.doQuery()
+            
         },
         otherFilterChange: function (t) {
-            this.doQuery()
+            if (this.power) {
+                this.doQuery()
+            } else {
+                this.filterState.buyerPhone = 0
+                this.filterState.winnerPhone = 0
+                this.powerDialogShow = true
+            }
         },
         changeListType: function (type) {
             this.listState.listType = type
@@ -398,6 +450,9 @@ var vm = new Vue({
         openTagDrawer: function () {
             this.tagDrawer.show = true
         },
+        openVipPage: function () {
+            window.open('/front/subscribe.html')
+        },
         drawerConfirm: function () {
             this.tagDrawer.show = false
         },
@@ -429,6 +484,7 @@ var vm = new Vue({
                             setTimeout(function () {
                                 _this.tagDrawer.toastShow = false
                                 _this.getTagList()
+                                _this.resetListState()
                             }, 1500)
                         }
                     }

+ 60 - 2
src/web/staticres/js/ent-search-index-pc.js

@@ -161,6 +161,11 @@ var vm = new Vue({
                 focus: false,
                 list: []
             },
+            entUseInfo: {
+                used: 0,
+                total: 0,
+                province: 0
+            },
             powerInfo: {
                 entniche: '',
                 member: '',
@@ -199,6 +204,21 @@ var vm = new Vue({
                     return '升级'
                 }
             }
+        },
+        showEntUsage: function () {
+            return !this.powerInfo.member && this.powerInfo.vip > 1
+        },
+        getVipSubText: function () {
+            var count = this.entUseInfo.provin
+            if (count == -1) {
+                return '全国'
+            } else {
+                if (count) {
+                    return count + '个省'
+                } else {
+                    ''
+                }
+            }
         }
     },
     created: function () {
@@ -228,6 +248,9 @@ var vm = new Vue({
                         Object.assign(this.powerInfo, res.data)
                         this.checkPower()
                         this.doSearch()
+                        if (this.showEntUsage) {
+                            this.getEntProtUsage()
+                        }
                     } else {
                         this.checkLogin()
                     }
@@ -240,6 +263,7 @@ var vm = new Vue({
         },
         checkPower: function () {
             this.power = this.powerInfo.member || this.powerInfo.vip !== 0
+            return this.power
         },
         initPageData: function () {
             if (pageInfo.searchContent) {
@@ -261,6 +285,7 @@ var vm = new Vue({
         initDOMEvents: function () {
             ewmMoveHover()
             refreshEwmText(this.searchContent)
+            insertVipIcon($('.search-type .el-checkbox:last-of-type'))
             setTimeout(function () {
                 tabHover()
             }, 300)
@@ -323,6 +348,26 @@ var vm = new Vue({
                 this.powerDialogShow = true
             }
         },
+        getEntProtUsage: function () {
+            $.ajax({
+                url: '/bigmember/portrait/subVipPortrait/usage',
+                method: 'POST',
+                data: data,
+                success: function (res) {
+                    if (res.error_code === 0) {
+                        if (res.data.total) {
+                            this.entUseInfo.total = res.data.total
+                        }
+                        if (res.data.provin) {
+                            this.entUseInfo.province = res.data.provin
+                        }
+                        if (res.data.usage) {
+                            this.entUseInfo.used = res.data.usage
+                        }
+                    }
+                }.bind(this)
+            })
+        },
         doSearch: function () {
             this.resetListState()
             this.getList()
@@ -441,13 +486,23 @@ var vm = new Vue({
             // 企业搜索单位类型-去开通
             // 企业搜索联系方式-去开通
             // 企业搜索底部第五条-去开通
-            if(param === 'more') {
-              this.baiduName = '底部第五条'
+            // 企业搜索popover-去开通
+            if (param === 'more') {
+                this.baiduName = '底部第五条'
+            } else if (param === 'popover-link') {
+                this.baiduName = '-超级订阅用户-当月已使用hover'
             }
             var str = '企业搜索' + this.baiduName + '-去开通'
             baiduEvent(str) // 去开通按钮百度统计
             window.open('/front/subscribe.html')
         },
+        openEntHistory: function () {
+            baiduEvent('企业画像查看历史记录')
+            window.open('/swordfish/frontPage/seeHistory/sess/index')
+        },
+        openCustomerService: function () {
+            $('#go-customer-4').trigger('click')
+        },
         toDetail: function (id) {
             window.open('/swordfish/page_big_pc/svip/ent_ser_portrait/' + id)
         },
@@ -520,6 +575,9 @@ var vm = new Vue({
     }
 })()
 
+function insertVipIcon (target) {
+    $(target).append('<span class="icon-hot-vip"></span>')
+}
 function tabHover () {
     $('#tab-zb').on('mouseover', function () {
         $(this).siblings('.el-tabs__active-bar').css({transform: 'translateX(0)'})

+ 36 - 1
src/web/staticres/js/pc_detail_tags.js

@@ -267,6 +267,7 @@ function saveChooseTags(params) {
     success: function(r){
       if (r.data) {
         toastFn("标签绑定成功", 1000)
+        getContentTags()
       }
     }
   })
@@ -331,4 +332,38 @@ function toastFn (text, duration = 1000) {
 	setTimeout(function(){
 		$(".custom-toast").fadeOut().remove();
 	},duration)
-}
+}
+
+// 获取当前文章个人标签方法
+function getContentTags () {
+  $.ajax({
+    type:'post',
+    url:'/publicapply/bidcoll/isColl?t=' + Date.now(),
+    data: {
+      bids: id,
+      label: 'info'
+    },
+    success: function (r) {
+      if (r.error_code === 0) {
+        if (r.data.iscoll && $.isArray(r.data.labels) && r.data.labels.length) {
+          var labelHtmlArr = []
+          r.data.labels.forEach(function (item) {
+            labelHtmlArr.push('<span data-id="' + item.id + '" class="tag-item">' + item.labelname + '</span>')
+          })
+          $('.personal-tags').show().children('.p-l-content').html(labelHtmlArr.join(','))
+        } else {
+          $('.personal-tags').hide()
+        }
+      } 
+    }
+  })
+}
+
+$(function () {
+  getContentTags()
+  $('.personal-tags').on('click', '.tag-item', function (e) {
+    var $this = $(e.target)
+    var tagId = $this.attr('data-id')
+    window.open('/swordfish/frontPage/collection/sess/index?tag=' + tagId)
+  })
+})

+ 43 - 0
src/web/staticres/pccss/ent-search-index-pc.css

@@ -50,6 +50,10 @@
 .input-container {
     position: relative;
 }
+.selector-card-footer {
+    display: flex;
+    align-items: center;
+}
 
 .el-input__prefix {
     display: flex;
@@ -332,3 +336,42 @@
 .el-select + .select-title {
     margin-left: 14px;
 }
+
+.search-type .icon-hot-vip {
+    margin-top: -4px;
+    margin-left: 8px;
+    width: 40px;
+    height: 18px;
+}
+.used-counter {
+    padding: 0 8px;
+    font-size: 14px;
+    color: #686868;
+    line-height: 22px;
+    border: 1px solid #ececec;
+    border-radius: 15px;
+    cursor: pointer;
+}
+.count-used {
+    font-size: 16px;
+    color: #2cb7ca;
+}
+.count-total {
+    color: #1d1d1d;
+}
+.to-ent-history {
+    margin-left: 8px;
+    font-size: 14px;
+    line-height: 22px;
+    color: #2cb7ca;
+    cursor: pointer;
+}
+.popover-link {
+    color: #2cb7ca;
+    cursor: pointer;
+}
+.popover-content {
+    font-size: 14px;
+    color: #1d1d1d;
+    line-height: 22px;
+}

File diff suppressed because it is too large
+ 218 - 0
src/web/staticres/pccss/pc-detail.css


+ 37 - 7
src/web/templates/frontRouter/pc/collection/sess/index.html

@@ -34,8 +34,8 @@
         <div class="collection-header w">
             <h3 class="tab-title">标讯收藏</h3>
         </div>
-        <div class="search-content w" v-cloak v-show="powerLoaded">
-            <div class="selector-card-container search-filters" v-if="power">
+        <div class="search-content w" v-cloak>
+            <div class="selector-card-container search-filters">
                 <div class="selector-card">
                     <div class="selector-card-header">个人标签:</div>
                     <div class="selector-card-content tag-list-container">
@@ -58,6 +58,16 @@
                             <span class="tag-count" v-text="tagSelectList.length"></span>
                         </template>
                         <div class="tag-container">
+                            <div class="tag-header flex">
+                                <el-input
+                                    placeholder="输入标签"
+                                    v-model.trim="addTagInfo.content"
+                                    maxlength="5"
+                                    clearable
+                                    @keyup.enter.native="addTagConfirmed">
+                                </el-input>
+                                <div class="add-tag-confirm-button flex no-select" @click="addTagConfirmed">确认添加</div>
+                            </div>
                             <div class="tag-main">
                                 <el-tag
                                     :key="tag.value"
@@ -86,18 +96,25 @@
                         ></date-time-component>
                     </div>
                 </div>
-                <div class="selector-card">
-                    <div class="selector-card-header">采购单位类型:</div>
+                <div class="selector-card vip">
+                    <div class="selector-card-header">
+                        <span class="s-h-title">采购单位类型</span>
+                        <span class="icon-hot-vip"></span>
+                    </div>
                     <div class="selector-card-content">
                         <select-level2-component
                             :init-selected="filterState.buyerclassObj"
                             :map="buyclassMap"
+                            ref="buyerClassFilter"
                             @change="buyerClassFilterChange"
                         ></select-level2-component>
                     </div>
                 </div>
-                <div class="selector-card">
-                    <div class="selector-card-header">其他筛选条件:</div>
+                <div class="selector-card vip">
+                    <div class="selector-card-header">
+                        <span class="s-h-title">其他筛选条件</span>
+                        <span class="icon-hot-vip"></span>
+                    </div>
                     <div class="selector-card-content flex mini-select other-filter">
                         <div class="select-title">采购单位联系方式</div>
                         <el-select v-model="filterState.buyerPhone" @change="otherFilterChange" placeholder="采购单位联系方式">
@@ -213,6 +230,19 @@
                     @current-change="onPageChange"
                 ></el-pagination>
             </div>
+            <el-dialog
+                title="您暂无使用权限"
+                :visible.sync="powerDialogShow"
+                custom-class="j-el-confirm"
+                :show-close="false"
+                top="25vh"
+                width="30%">
+                <span>开通超级订阅,全国企业随手查,搜索信息更高效!</span>
+                <span slot="footer" class="dialog-footer">
+                    <button class="j-t-button confirm active" @click="openVipPage">去开通</el-button>
+                    <button class="j-t-button cancel" @click="powerDialogShow=false">取 消</button>
+                </span>
+            </el-dialog>
             <el-dialog
                 :modal="false"
                 top="0"
@@ -244,7 +274,7 @@
                 :show-close="false"
                 top="25vh"
                 width="30%">
-                <span>确定删除该标签?</span>
+                <span>确定删除${tagDrawer.currentDelTagInfo.label ? ('“' + tagDrawer.currentDelTagInfo.label + '”') : ''}标签?</span>
                 <span slot="footer" class="dialog-footer">
                     <button class="j-t-button confirm active" @click="delThisTagConfirm">确 定</el-button>
                     <button class="j-t-button cancel" @click="tagDrawer.dialogShow=false">取 消</button>

File diff suppressed because it is too large
+ 4 - 216
src/web/templates/pc/biddetail_rec.html


+ 23 - 1
src/web/templates/pc/entsearchindex.html

@@ -87,7 +87,7 @@
             </div>
             <div class="search-content w">
                 <div class="selector-card-container search-filters">
-                    <div class="selector-card">
+                    <div class="selector-card search-type">
                         <div class="selector-card-header">搜索范围:</div>
                         <div class="selector-card-content">
                             <select-list-component
@@ -98,6 +98,28 @@
                                 @change="searchTypeChange"
                             ></select-list-component>
                         </div>
+                        <div class="selector-card-footer" v-if="showEntUsage">
+                            <el-popover
+                                placement="top"
+                                width="292"
+                                trigger="hover">
+                                <div class="popover-content" v-if="entUseInfo.used < entUseInfo.total" key="popover-content">
+                                    <p>超级订阅用户,每购买一个省,每月可看50个画像。</p>
+                                    <p>您当前订阅了${getVipSubText},如需查看更多,请前往订阅更多省份。<span class="popover-link" @click="openVipPage('popover-link')">前往</span></p>
+                                </div>
+                                <div class="popover-content" v-else key="popover-content">
+                                    <p>超级订阅用户,每购买一个省,每月可看50个画像。</p>
+                                    <p>您当前订阅了${getVipSubText},查看机会已经消耗完毕。如需要更多服务,请前往<span class="popover-link" @click="openCustomerService">联系客服</span></p>
+                                </div>
+                                <div class="used-counter" slot="reference">
+                                    <span>当月已使用:</span>
+                                    <span class="u-c-label">
+                                        <span class="count-used highlight-text">${entUseInfo.used}</span><span class="count-total">/${entUseInfo.total}</span>
+                                    </span>
+                                </div>
+                            </el-popover>
+                            <div class="to-ent-history" @click="openEntHistory" id="to-ent-history">历史记录查看</div>
+                        </div>
                     </div>
                     <div class="selector-card">
                         <div class="selector-card-header">注册地:</div>

Some files were not shown because too many files changed in this diff