|
@@ -1,45 +1,70 @@
|
|
|
<template>
|
|
|
<div class="page--sub-push">
|
|
|
<div class="page-content">
|
|
|
- <div class="clearfix">
|
|
|
- <span class="card-title">订阅推送</span>
|
|
|
- <el-button v-if="canSubmanager" @click="goManage" class="sub-manager" type="plain" icon="el-icon-jy-edit">订阅管理
|
|
|
- </el-button>
|
|
|
+ <div class="content-header">
|
|
|
+ <span class="header-left card-title">订阅推送</span>
|
|
|
+ <div class="header-right">
|
|
|
+ <el-button v-if="free" @click="toBuySvip" class="sub-manager" type="plain" icon="el-icon-jy-vip">开通超级订阅</el-button>
|
|
|
+ <el-button v-if="showManageButton" @click="goManage" class="sub-manager" type="plain" icon="el-icon-jy-edit">订阅管理</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="max-push-tip red" v-show="tip.maxPushTip">
|
|
|
+ <div class="left">
|
|
|
+ <span class="el-icon-close" @click="tip.maxPushTip = false"></span>
|
|
|
+ </div>
|
|
|
+ <div class="center">本次推送已达150条信息上限,开通超级订阅,支持每天最多推送2000条信息!</div>
|
|
|
+ <div class="right">
|
|
|
+ <button class="action-btn" @click="toBuySvip">立即开通</button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="border-box">
|
|
|
<TimeSelector ref="timeSelector" selectorTime="sub" @onChange="changeTime" selectorType="line">
|
|
|
- <div slot="header">选择时间:</div>
|
|
|
+ <div class="filter-label" slot="header">选择时间:<span class="el-icon-jy-vip visibility-hidden"></span></div>
|
|
|
</TimeSelector>
|
|
|
- <AreaSelector @onChange="changeArea" ref="areaSelector" selectorType="line">
|
|
|
- <div slot="header">选择区域:</div>
|
|
|
+ <AreaSelector @onChange="changeArea" :beforeTabClick="beforeSelected" ref="areaSelector" selectorType="line">
|
|
|
+ <div class="filter-label" slot="header">选择区域:<span class="el-icon-jy-vip"></span></div>
|
|
|
</AreaSelector>
|
|
|
- <IndustrySelector @onChange="changeIndustry" selectorType="line">
|
|
|
- <div slot="header">行业:</div>
|
|
|
+ <IndustrySelector @onChange="changeIndustry" :beforeChange="beforeSelected" selectorType="line">
|
|
|
+ <div class="filter-label" slot="header">行业:<span class="el-icon-jy-vip"></span></div>
|
|
|
</IndustrySelector>
|
|
|
- <PriceSelector @onChange="onPriceChange" selectorType="line">
|
|
|
- <div slot="header">价格区间:</div>
|
|
|
+ <PriceSelector @onChange="onPriceChange" :beforeConfirm="beforeSelected" selectorType="line">
|
|
|
+ <div class="filter-label" slot="header">价格区间:<span class="el-icon-jy-vip"></span></div>
|
|
|
</PriceSelector>
|
|
|
- <IndustrySelector @onChange="changeBuyer" dataType="buyer" selectorType="line">
|
|
|
- <div slot="header">采购单位类型:</div>
|
|
|
+ <IndustrySelector class="buyer" @onChange="changeBuyer" :beforeChange="beforeSelected" dataType="buyer" selectorType="line">
|
|
|
+ <div class="filter-label" slot="header">采购单位类型:<span class="el-icon-jy-vip"></span></div>
|
|
|
</IndustrySelector>
|
|
|
- <InfoTypeSelector class="my-line" @onChange="changeInfo" selectorType="line">
|
|
|
- <div slot="header">信息类型:</div>
|
|
|
+ <InfoTypeSelector class="my-line" @onChange="changeInfo" :beforeChange="beforeSelected" selectorType="line">
|
|
|
+ <div class="filter-label" slot="header">信息类型:<span class="el-icon-jy-vip"></span></div>
|
|
|
</InfoTypeSelector>
|
|
|
- <PopSelector @onChange="changeKeys" ref="keySelector" selectorType="line">
|
|
|
- <div slot="header">关键词:</div>
|
|
|
+ <PopSelector @onChange="changeKeys" ref="keySelector" :beforeTabClick="beforeSelected" selectorType="line">
|
|
|
+ <div class="filter-label" slot="header">关键词:<span class="el-icon-jy-vip"></span></div>
|
|
|
</PopSelector>
|
|
|
<selectorCard cardType="line">
|
|
|
- <div slot="header" class="s-header">
|
|
|
- <slot name="header">附件:</slot>
|
|
|
+ <div slot="header" class="s-header filter-label">
|
|
|
+ <slot name="header">附件:<span class="el-icon-jy-vip"></span></slot>
|
|
|
</div>
|
|
|
<RadioGroup
|
|
|
:sourceList="withFileList"
|
|
|
v-model="filters.fileExists"
|
|
|
+ :beforeChange="beforeSelected"
|
|
|
@onChange="onFileStateChange"
|
|
|
/>
|
|
|
</selectorCard>
|
|
|
</div>
|
|
|
<push-list :config="config" :filters="filters" class="m-24" ref="pushList" :showMore="false"></push-list>
|
|
|
+ <Dialog
|
|
|
+ title="开通超级订阅"
|
|
|
+ class="text-center"
|
|
|
+ width="380px"
|
|
|
+ center
|
|
|
+ :visible.sync="dialog.buyVip">
|
|
|
+ 立享更多搜索权限,寻找商机更精准
|
|
|
+ <template #footer>
|
|
|
+ <button class="action-button confirm" @click="toBuySvip">去开通</button>
|
|
|
+ <button class="action-button cancel" @click="dialog.buyVip = false">取消</button>
|
|
|
+ </template>
|
|
|
+ </Dialog>
|
|
|
+ <FollowOfficialAccountDialog :visible.sync="dialog.toFollowOfficialAccount"></FollowOfficialAccountDialog>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -55,8 +80,12 @@ import IndustrySelector from '@/components/selector/IndustrySelector.vue'
|
|
|
import InfoTypeSelector from '@/components/selector/InfoTypeSelector.vue'
|
|
|
import PriceSelector from '@/components/selector/PriceSelector.vue'
|
|
|
import RadioGroup from '@/components/selector/RadioGroup.vue'
|
|
|
+import Dialog from '@/components/dialog/Dialog.vue'
|
|
|
+import FollowOfficialAccountDialog from '@/components/dialog/FollowOfficialAccountDialog.vue'
|
|
|
+
|
|
|
+import { getFreeUserPushInfo } from '@/api/modules/'
|
|
|
|
|
|
-import { mapState } from 'vuex'
|
|
|
+import { mapState, mapGetters, mapActions } from 'vuex'
|
|
|
|
|
|
export default {
|
|
|
name: 'SubPush',
|
|
@@ -70,10 +99,20 @@ export default {
|
|
|
InfoTypeSelector,
|
|
|
PriceSelector,
|
|
|
RadioGroup,
|
|
|
+ Dialog,
|
|
|
+ FollowOfficialAccountDialog,
|
|
|
[Button.name]: Button
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
+ tip: {
|
|
|
+ maxPushTip: false
|
|
|
+ },
|
|
|
+ dialog: {
|
|
|
+ buyVip: false,
|
|
|
+ toFollowOfficialAccount: false
|
|
|
+ },
|
|
|
+ Show: false,
|
|
|
config: {
|
|
|
gray: true,
|
|
|
table: true,
|
|
@@ -94,7 +133,7 @@ export default {
|
|
|
}
|
|
|
],
|
|
|
filters: {
|
|
|
- vt: 'm',
|
|
|
+ vt: '',
|
|
|
area: '',
|
|
|
time: '',
|
|
|
selectTime: '',
|
|
@@ -109,32 +148,103 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ vt () {
|
|
|
+ const { vt } = this.filters
|
|
|
+ if (vt) {
|
|
|
+ return vt
|
|
|
+ } else {
|
|
|
+ return this.autoVt
|
|
|
+ }
|
|
|
+ },
|
|
|
+ showManageButton () {
|
|
|
+ // 免费f / 商机管理s / 超级订阅v / 大会员m
|
|
|
+ // 商机管理不显示
|
|
|
+ if (this.vt === 's') {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ // 子账号不显示
|
|
|
+ if (this.vt === 'm' && this.isSubCount) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ return true
|
|
|
+ },
|
|
|
+ ...mapState({
|
|
|
+ subscribeKeyList: state => state.user.subscribeKeyList
|
|
|
+ }),
|
|
|
+ ...mapGetters('user', {
|
|
|
+ autoVt: 'vt'
|
|
|
+ }),
|
|
|
+ ...mapGetters('user', [
|
|
|
+ 'isSubCount',
|
|
|
+ 'free',
|
|
|
+ 'entniche',
|
|
|
+ 'bigmember',
|
|
|
+ 'svip'
|
|
|
+ ])
|
|
|
+ },
|
|
|
+ async created () {
|
|
|
+ this.getParams()
|
|
|
+ this.getInitInfo()
|
|
|
+ await this.getSubScribeKeyList({ vt: this.vt })
|
|
|
+ },
|
|
|
mounted () {
|
|
|
this.initQuery()
|
|
|
this.initKeyMap()
|
|
|
},
|
|
|
watch: {
|
|
|
- bigKeywordsData: function () {
|
|
|
+ subscribeKeyList: function () {
|
|
|
this.initKeyMap()
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ ...mapActions('user', [
|
|
|
+ 'getSubScribeKeyList'
|
|
|
+ ]),
|
|
|
+ getParams () {
|
|
|
+ const { vt } = this.$route.query
|
|
|
+ if (vt) {
|
|
|
+ this.filters.vt = vt
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getInitInfo () {
|
|
|
+ if (this.vt === 'f') {
|
|
|
+ this.getFreeUserPushInfo()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async getFreeUserPushInfo () {
|
|
|
+ const { isPassCount } = await getFreeUserPushInfo()
|
|
|
+ if (this.free && isPassCount) {
|
|
|
+ this.tip.maxPushTip = true
|
|
|
+ }
|
|
|
+ },
|
|
|
initKeyMap () {
|
|
|
- console.log(this.bigKeywordsData, 'ss')
|
|
|
const tempKeys = {}
|
|
|
- // eslint-disable-next-line no-unused-expressions
|
|
|
- this.bigKeywordsData?.member_jy?.a_items.forEach(v => {
|
|
|
+ if (this.vt === 'f') {
|
|
|
let tempArr = []
|
|
|
- v.a_key.forEach(s => {
|
|
|
+ // eslint-disable-next-line no-unused-expressions
|
|
|
+ this.subscribeKeyList.forEach(s => {
|
|
|
let tempList = s?.key || []
|
|
|
if (s?.appendkey && s?.key) {
|
|
|
tempList = [s?.key + ' ' + s?.appendkey.join(' ')]
|
|
|
}
|
|
|
tempArr = tempArr.concat(tempList)
|
|
|
})
|
|
|
- tempKeys[v.s_item] = tempArr
|
|
|
- })
|
|
|
- console.log(tempKeys, 'keys')
|
|
|
+ tempKeys['未分类'] = tempArr
|
|
|
+ } else {
|
|
|
+ // eslint-disable-next-line no-unused-expressions
|
|
|
+ this.subscribeKeyList.forEach(v => {
|
|
|
+ let tempArr = []
|
|
|
+ v.a_key.forEach(s => {
|
|
|
+ let tempList = s?.key || []
|
|
|
+ if (s?.appendkey && s?.key) {
|
|
|
+ tempList = [s?.key + ' ' + s?.appendkey.join(' ')]
|
|
|
+ }
|
|
|
+ tempArr = tempArr.concat(tempList)
|
|
|
+ })
|
|
|
+ tempKeys[v.s_item] = tempArr
|
|
|
+ })
|
|
|
+ }
|
|
|
this.$refs.keySelector.initDataMap(tempKeys)
|
|
|
},
|
|
|
initQuery () {
|
|
@@ -184,10 +294,36 @@ export default {
|
|
|
this.doQuery()
|
|
|
},
|
|
|
doQuery () {
|
|
|
- this.$refs.pushList.doQuery(this.filters)
|
|
|
+ const payload = {
|
|
|
+ ...this.filters,
|
|
|
+ vt: this.vt === 'f' ? '' : this.vt
|
|
|
+ }
|
|
|
+ this.$refs.pushList.doQuery(payload)
|
|
|
},
|
|
|
goManage () {
|
|
|
- this.$router.push('/set_subscribe/config')
|
|
|
+ if (this.vt === 'f') {
|
|
|
+ // 免费用户
|
|
|
+ // 弹窗提示关注公众号
|
|
|
+ this.dialog.toFollowOfficialAccount = true
|
|
|
+ } else if (this.vt === 'v') {
|
|
|
+ // 超级订阅
|
|
|
+ this.dialog.toFollowOfficialAccount = true
|
|
|
+ } else if (this.vt === 'm') {
|
|
|
+ this.$router.push('/set_subscribe/config')
|
|
|
+ } else {
|
|
|
+ // 商机管理该按钮被隐藏,无操作
|
|
|
+ }
|
|
|
+ },
|
|
|
+ toBuySvip () {
|
|
|
+ this.$router.push('/free/svip/buy?type=buy')
|
|
|
+ },
|
|
|
+ beforeSelected () {
|
|
|
+ if (this.free) {
|
|
|
+ this.dialog.buyVip = true
|
|
|
+ return false
|
|
|
+ } else {
|
|
|
+ return true
|
|
|
+ }
|
|
|
},
|
|
|
changeTime (item) {
|
|
|
let time = parseInt(item.start / 1000)
|
|
@@ -221,22 +357,12 @@ export default {
|
|
|
this.filters.city = citys.join(',')
|
|
|
this.doQuery()
|
|
|
}
|
|
|
- },
|
|
|
- computed: {
|
|
|
- canSubmanager () {
|
|
|
- return !this.$store.state.user.info?.isSubCount
|
|
|
- },
|
|
|
- ...mapState({
|
|
|
- bigKeywordsData: state => state.user.bigKeywordsData
|
|
|
- })
|
|
|
- },
|
|
|
- async created () {
|
|
|
- await this.$store.dispatch('user/getKeywordsList')
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
+ @include diy-icon('vip', 38, 18);
|
|
|
@include diy-icon('edit', 20, 20);
|
|
|
.page--sub-push {
|
|
|
background-color: #fff;
|
|
@@ -281,9 +407,62 @@ export default {
|
|
|
color: #1d1d1d;
|
|
|
line-height: 36px;
|
|
|
}
|
|
|
- .clearfix .sub-manager {
|
|
|
- float: right;
|
|
|
- margin-bottom: 24px;
|
|
|
+ .content-header {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 24px 0;
|
|
|
+ .header-right {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+ .sub-manager {
|
|
|
+ &:not(:last-of-type) {
|
|
|
+ margin-right: 20px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .visibility-hidden {
|
|
|
+ visibility: hidden;
|
|
|
+ }
|
|
|
+ .buyer {
|
|
|
+ padding-left: 6px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .max-push-tip {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ height: 40px;
|
|
|
+ padding: 0 20px;
|
|
|
+ font-size: 14px;
|
|
|
+ border-radius: 4px;
|
|
|
+ &.red {
|
|
|
+ color: #FF3A20;
|
|
|
+ background-color: rgba(255,58,32,0.1);
|
|
|
+ }
|
|
|
+ .left {
|
|
|
+ font-size: 18px;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ .el-icon-close {
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ .center {
|
|
|
+ margin: 0 12px;
|
|
|
+ }
|
|
|
+ .action-btn {
|
|
|
+ margin-left: 12px;
|
|
|
+ padding: 4px 16px;
|
|
|
+ background-color: transparent;
|
|
|
+ border: 1px solid #FF3A20;
|
|
|
+ border-radius: 4px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .filter-label {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: flex-end;
|
|
|
}
|
|
|
|
|
|
.sub-manager {
|
|
@@ -309,6 +488,7 @@ export default {
|
|
|
padding-bottom: 80px;
|
|
|
}
|
|
|
.border-box {
|
|
|
+ margin-top: 12px;
|
|
|
border: 1px solid #ececec;
|
|
|
border-radius: 5px;
|
|
|
}
|