123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240 |
- <template>
- <section class="tab-actions safe-area-inside-bottom bg-white">
- <ActionCollection
- :id="id"
- class="tab-action"
- :before-action="beforeActionBindPhoneCheck"
- :before-redirect="beforeLeavePage"
- @syncLabels="syncLabels"
- />
- <QuickMonitor
- v-if="showMonitor"
- :id="id"
- class="tab-action"
- type="project"
- :cache="true"
- :auto="true"
- popover
- :before-action="beforeActionBindPhoneCheck"
- :before-leave-page="beforeLeavePage"
- @initd="afterMonitorFetch"
- @change="afterMonitorFetch"
- />
- <ActionDownloadReport
- v-if="showDownloadReportBtn"
- class="tab-action"
- :buyers="buyers"
- :winners="winners"
- :project-name="projectName"
- :id="id"
- :show-credit="showCreditReport"
- :btnInfo="reportBtn"
- />
- <ActionShareToWorkmate
- :id="id"
- class="tab-action"
- :before-action="beforeShareToWorkMateAction"
- />
- <ActionInBidding
- :id="id"
- class="tab-action"
- @change="biddingStatusChange"
- />
- </section>
- </template>
- <script>
- import { mapMutations, mapState } from 'vuex'
- import ActionCollection from '@/views/article/components/ActionCollection.vue'
- import QuickMonitor from '@/composables/quick-monitor/component/QuickMonitor.vue'
- import ActionShareToWorkmate from '@/views/article/components/ActionShareToWorkmate.vue'
- import ActionInBidding from '@/views/article/components/ActionInBidding.vue'
- import ActionDownloadReport from '@/views/article/components/ActionDownloadReport.vue'
- import { openAppOrWxPage } from '@/utils'
- import { LINKS } from '@/data'
- export default {
- name: 'TabActions',
- components: {
- ActionShareToWorkmate,
- ActionCollection,
- QuickMonitor,
- ActionInBidding,
- ActionDownloadReport
- },
- props: {
- beforeLeavePage: Function,
- showMonitor: {
- type: Boolean,
- default: false
- },
- // 排序列表,根据key排序
- orderList: {
- type: Array,
- default() {
- return []
- }
- }
- },
- data() {
- return {
- tabState: {
- inBidding: false
- }
- }
- },
- computed: {
- ...mapState({
- userSimpleInfo: (state) => state.user.userSimpleInfo,
- content: (state) => state.article.mainModel.content,
- reportBtn: (state) => state.article.reportBtn
- }),
- id() {
- return this.content.id
- },
- winners() {
- const { ent_crn } = this.reportBtn
- // 当中标企业有1个以上时,需要根据crn是否有值处理供应商分析报告中标企业名称是否可点击
- const arr = this.content?._summary?.winners || []
- if (arr.length > 0) {
- const formatArr = arr.map((v) => {
- return {
- ...v,
- valid:
- ent_crn && Object.keys(ent_crn).length > 0
- ? ent_crn[v.name]
- : false
- }
- })
- return formatArr
- } else {
- return arr
- }
- },
- buyers() {
- return this.content?._summary.buyers || []
- },
- // 是否展示投标企业信用报告
- showCreditReport() {
- return ['采购意向', '预告', '招标'].includes(
- this.content?._ob?.topType || this.content?._ob?.subType || ''
- )
- },
- showDownloadReportBtn() {
- const info = this.reportBtn
- return (
- info.buyer_report_button ||
- info.ent_report_button ||
- info.project_report_button
- )
- },
- projectName() {
- return this.content?.projectName
- }
- },
- created() {},
- methods: {
- ...mapMutations('article', ['setOtherModelChild']),
- removeHideUnderline() {
- this.setOtherModelChild({
- key: 'hasProject',
- data: true
- })
- // 移除下划线
- this.setOtherModelChild({
- key: 'forecastShow',
- data: true
- })
- },
- syncLabels({ list }) {
- if (Array.isArray(list)) {
- this.setOtherModelChild({
- key: 'collectionTags',
- data: list
- })
- }
- },
- showForecast() {},
- afterMonitorFetch(payload) {
- // console.log(payload)
- this.setOtherModelChild({
- key: 'projectFollowState',
- data: payload
- })
- if (payload.model && payload.model.canFollow) {
- this.showForecast()
- this.removeHideUnderline()
- }
- },
- biddingStatusChange(i) {
- const userName = i.userName || ''
- const userNameList = userName.split(',').filter((i) => i)
- this.setOtherModelChild({
- key: 'inBiddingPersonList',
- data: userNameList
- })
- },
- toBindPhonePage() {
- openAppOrWxPage(LINKS.绑定手机号, {
- query: {
- mode: 'mergeBind'
- }
- })
- },
- // mp标记短信邀请进入的详情页,需要判断手机号是否绑定
- beforeActionBindPhoneCheck() {
- const query = this.$route.query
- if (query.mp) {
- const { phone } = this.userSimpleInfo
- if (phone) {
- return true
- } else {
- this.toBindPhonePage()
- return false
- }
- } else {
- return true
- }
- },
- beforeShareToWorkMateAction() {
- const { phone, expBinding } = this.userSimpleInfo
- if (phone || expBinding === 1) {
- return true
- } else {
- this.toBindPhonePage()
- return false
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- $height: 48px;
- ::v-deep {
- .action-text {
- font-size: 10px;
- line-height: 16px;
- }
- }
- .tab-actions {
- position: relative;
- display: flex;
- align-items: center;
- justify-content: space-between;
- box-shadow: 0px -2px 8px 0px rgba(54, 147, 179, 0.05);
- border-top: 1px solid $border_color_3;
- z-index: 2002;
- ::v-deep {
- .tab-action-item {
- height: $height;
- }
- }
- }
- .tab-action {
- flex: 1;
- height: $height;
- }
- </style>
|