Преглед на файлове

Merge branch 'dev/v1.0.77_tsz' of jianyu/web into feature/v1.0.77

汤世哲 преди 9 месеца
родител
ревизия
c84ef6a75a
променени са 2 файла, в които са добавени 156 реда и са изтрити 125 реда
  1. 9 0
      apps/mobile/src/api/modules/public.js
  2. 147 125
      apps/mobile/src/views/tabbar/Subscribe.vue

+ 9 - 0
apps/mobile/src/api/modules/public.js

@@ -333,3 +333,12 @@ export function getIsWhiteList() {
     method: 'get'
   })
 }
+
+// 获取公众号置顶教程入口显示时间
+export function getConfiguration(data) {
+  return request({
+    url: '/publicapply/configuration/get',
+    method: 'post',
+    data
+  })
+}

+ 147 - 125
apps/mobile/src/views/tabbar/Subscribe.vue

@@ -1,31 +1,33 @@
 <template>
   <div class="j-container" @touchstart="appTabShow">
     <header class="subscribe-header-container">
-      <div class="tabbar-header-top-placeholder" v-if="$envs.inApp"></div>
+      <div v-if="$envs.inApp" class="tabbar-header-top-placeholder" />
       <div class="subscribe-header tabbar-header">
         <div class="subscribe-header-l">
-          <h1 class="subscribe-header-title">{{ headerConf.titleText }}</h1>
+          <h1 class="subscribe-header-title">
+            {{ headerConf.titleText }}
+          </h1>
           <PowerSwitch
-            ref="powerSwitch"
             v-if="powerSwitchShow"
-            :vSwitch="vSwitch"
-            :showTypes="vSwitchList"
-            :beforeLeave="beforeLeavePage"
+            ref="powerSwitch"
+            :v-switch="vSwitch"
+            :show-types="vSwitchList"
+            :before-leave="beforeLeavePage"
             @change="changeVSwitch"
           />
           <div
             v-else
+            v-show="pageState.topBannerAd.textShow"
             ref="topAdText"
             class="top-ad-text"
-            v-show="pageState.topBannerAd.textShow"
           >
             立即使用 超级订阅
           </div>
         </div>
         <div class="subscribe-header-r">
           <div
-            class="action-button subscribe-header-sub-title"
             v-if="showEntSubscribeButton"
+            class="action-button subscribe-header-sub-title"
             @click="switchSubscribeType"
           >
             {{ headerConf.subTitleText }}
@@ -48,61 +50,61 @@
       </div>
       <ad-single
         v-if="topSuperVipAdShow"
-        :show="pageState.topBannerAd.bannerShow"
         ref="topAd"
+        :show="pageState.topBannerAd.bannerShow"
         :ad="topAdId"
         cache
-        :showTag="false"
-        :showCloseIcon="false"
-        :beforeOpen="beforeLeavePage"
+        :show-tag="false"
+        :show-close-icon="false"
+        :before-open="beforeLeavePage"
+        class="ad-container subscribe-top-box"
         @loaded="onTopAdLoaded"
         @close="onListAdClose()"
-        class="ad-container subscribe-top-box"
       />
       <DropFilter
-        v-model="filters"
         ref="dropFilter"
+        v-model="filters"
         class="subscribe-drop-filter van-hairline--top"
         :default-state="defaultDropFilterState"
         :options="dropFilterOptions"
-        :dropdownMenuOptions="dropdownMenuOptions"
+        :dropdown-menu-options="dropdownMenuOptions"
         @open="onFilterOpen"
         @close="onFilterClose"
         @confirm="onFilterConfirm"
         @cancel="onFilterCancel"
       >
         <template v-if="isFree" #vipIcon>
-          <span class="v-vip-icon"></span>
+          <span class="v-vip-icon" />
         </template>
-        <template v-slot:more>
+        <template #more>
           <SubscribeMoreFilters
-            :disabledFilters="disabledFilters"
-            :isPersonal="isPersonalSubscribe"
             ref="moreFiltersRef"
+            :disabled-filters="disabledFilters"
+            :is-personal="isPersonalSubscribe"
             @onNoPower="onNoPower"
           />
         </template>
       </DropFilter>
-      <div class="tab-switch bg-white border-line-b" v-if="tabSwitchShow">
+      <div v-if="tabSwitchShow" class="tab-switch bg-white border-line-b">
         <van-tabs
-          class="tab-left"
           v-model="listTabActive"
+          class="tab-left"
           :ellipsis="false"
           :before-change="beforeTabActiveChange"
           @change="onListTabChange"
         >
           <van-tab
             v-for="(tab, index) in conf.tabList"
+            :key="index"
             :name="tab.name"
             :title="tab.title"
-            :key="index"
-          ></van-tab>
+          />
         </van-tabs>
         <div class="tab-right">
           <div
+            v-if="listState.count > 0"
             class="data-export clickable"
             @click="dataExport"
-            v-if="listState.count > 0"
           >
             <AppIcon name="shujudaochu_xiao1" />
             <span class="text">数据导出</span>
@@ -112,8 +114,8 @@
       <div class="">
         <!-- 超前项目推荐 & 定制化分析报告 -->
         <RecommendCard
-          :key="recommendInfo.key"
           v-if="recommendInfo.show"
+          :key="recommendInfo.key"
           v-model="recommendInfo.showContent"
           :chart-data="recommendInfo.chart"
           :brief-list="recommendInfo.brief"
@@ -125,24 +127,24 @@
       </div>
     </header>
     <main
-      class="j-main subscribe-list"
       ref="listContainer"
+      class="j-main subscribe-list"
       @scroll="scrollWrapFn"
     >
       <van-list
         v-show="listTabActive === 'list' || listTabActive === 'detailedList'"
+        ref="vanList"
         v-model="listState.loading"
         :finished="listState.finished"
         :offset="listState.offset"
         :finished-text="finishedText"
         :immediate-check="false"
-        @load="getList"
         class="more-list"
         :class="{ 'calc-height-1px': !hasMorePage }"
-        ref="vanList"
+        @load="getList"
       >
         <div class="tab-search-info">
-          <p class="search-total-count" v-if="listState.count > 0">
+          <p v-if="listState.count > 0" class="search-total-count">
             搜索到<span class="highlight-text">
               {{ calcListTotalText(listState.count) }} </span
             >条信息
@@ -150,38 +152,38 @@
         </div>
         <div class="list-wrapper">
           <van-popup
+            v-model="showBidStatus"
             get-container="body"
             :style="popupHeight"
-            v-model="showBidStatus"
             round
             position="bottom"
           >
-            <bid-status-node
+            <BidStatusNode
+              :project-cell-info="projectCellInfo"
               @cancel-update="cancelUpdate"
               @save-success="saveSuccess"
-              :project-cell-info="projectCellInfo"
               @set-height="setHeight"
-            ></bid-status-node>
+            />
           </van-popup>
           <template v-for="(item, index) in subscribeList">
             <ProjectCell
               v-if="!item.ad"
+              :key="item.id"
+              v-visited:subscribe="item._id"
               class="list-item"
               :class="item.className"
-              :cardType="calcProjectCardType(item)"
-              :detailList="item.detailList"
-              @click="onClickCell(item)"
+              :card-type="calcProjectCardType(item)"
+              :detail-list="item.detailList"
               :title="item.title"
               :time="item.dateTime"
               :detail="item.detail"
               :filetext_search="item.filetext_search"
-              :isFile="item.isFile"
+              :is-file="item.isFile"
               :keys="item.matchKeys"
-              :leftTopBadgeText="item.leftTopBadgeText"
+              :left-top-badge-text="item.leftTopBadgeText"
               :tags="item.tagList"
-              :pushSource="item.pushSource"
-              :key="item.id"
-              v-visited:subscribe="item._id"
+              :push-source="item.pushSource"
+              @click="onClickCell(item)"
             >
               <template #buyerText="{ item }">
                 <span
@@ -192,15 +194,15 @@
               </template>
               <template #winnerText="{ item }">
                 <span
+                  v-for="(winner, index) in item.children"
+                  :key="index"
                   class="winner-item highlight-text link-clickable j-splitter"
                   data-j-splitter="、"
-                  v-for="(winner, index) in item.children"
                   @click.stop="toToEntProfile(winner.id)"
-                  :key="index"
                   >{{ winner.text }}</span
                 >
               </template>
-              <template slot="icon" v-if="item.isCB.id">
+              <template v-if="item.isCB.id" slot="icon">
                 <div
                   class="right-event"
                   :class="{ cb_blue: item.isCB.value }"
@@ -229,43 +231,44 @@
                       'icon-star-fill': item.star,
                       'icon-star-streak': !item.star
                     }"
-                  ></span>
+                  />
                   <span>&nbsp;{{ item.star ? '已收藏' : '收藏' }}</span>
                 </div>
               </template>
             </ProjectCell>
             <div
               v-else
-              :key="[item.id, index].join('-')"
               v-show="item.show"
+              :key="[item.id, index].join('-')"
               class="middle-list-container"
             >
               <ad-single
+                key="ad-item"
                 :class="item.className"
                 :ad="getContentAdID"
-                key="ad-item"
-                :showCloseIcon="true"
+                :show-close-icon="true"
                 cache
-                :beforeOpen="beforeLeavePage"
+                :before-open="beforeLeavePage"
                 :vt="vSwitch"
-                @close="onListAdClose(item)"
                 class="ad-container middle-list-ad"
+                @close="onListAdClose(item)"
               />
             </div>
           </template>
         </div>
-        <div class="free-see-more" v-if="freeSeeMoreButtonShow">
+        <div v-if="freeSeeMoreButtonShow" class="free-see-more">
           <van-button
             class="free-see-more-button"
             size="large"
             plain
             @click="toLeaveInfoPage"
-            >查看更多</van-button
           >
+            查看更多
+          </van-button>
         </div>
         <AppEmpty
-          state="sleep"
           v-show="listState.list.length === 0 && listState.finished"
+          state="sleep"
         >
           <!-- 有订阅管理权限的 -->
           <div v-if="showSubscribeManageButton">
@@ -303,8 +306,8 @@
           </template>
         </AppEmpty>
       </van-list>
-      <div class="table-container" v-show="listTabActive === 'table'">
-        <div class="scroll" v-show="listState.list.length">
+      <div v-show="listTabActive === 'table'" class="table-container">
+        <div v-show="listState.list.length" class="scroll">
           <table class="table">
             <tr class="table-header">
               <td v-if="containsNiJian">项目代码</td>
@@ -322,10 +325,10 @@
             </tr>
             <tr
               v-for="item in listState.list.slice(0, 20)"
-              class="table-content-tr"
+              :key="item.id"
               v-visited:subscribe="item._id"
+              class="table-content-tr"
               @click="onClickCell(item)"
-              :key="item.id"
             >
               <!-- 项目代码 -->
               <td v-if="containsNiJian">
@@ -339,7 +342,7 @@
                     pageState.splitKeys
                   )
                 "
-              ></td>
+              />
               <!-- 公告类型 -->
               <td v-if="!containsNiJian">
                 {{ item.subtype ? `${item.subtype}公告` : '-' }}
@@ -364,7 +367,9 @@
                 }}
               </td>
               <!-- 招标单位 -->
-              <td v-if="!containsNiJian">{{ item.buyer || '-' }}</td>
+              <td v-if="!containsNiJian">
+                {{ item.buyer || '-' }}
+              </td>
               <!-- 开标时间 -->
               <td v-if="!containsNiJian">
                 {{
@@ -398,14 +403,14 @@
             </tr>
           </table>
         </div>
-        <div class="to-look-more" v-show="listState.list.length > 20">
-          <van-button plain size="small" type="primary" @click="dataExport"
-            >查看更多</van-button
-          >
+        <div v-show="listState.list.length > 20" class="to-look-more">
+          <van-button plain size="small" type="primary" @click="dataExport">
+            查看更多
+          </van-button>
         </div>
         <AppEmpty
-          state="sleep"
           v-show="listState.list.length === 0 && listState.finished"
+          state="sleep"
         >
           <!-- 有订阅管理权限的 -->
           <div v-if="showSubscribeManageButton">
@@ -446,67 +451,68 @@
     </main>
     <footer class="j-footer">
       <NoticeBar
-        rightText="了解详情"
+        v-if="pushMaxNoticeBarShow"
+        right-text="了解详情"
         @clickLeft="noticeBar.pushMaxShow = false"
         @clickRight="toVipIntroducePage"
-        v-if="pushMaxNoticeBarShow"
-        >本次推送已达150条信息上限!开通超级订阅,支持每天最多推送2000条信息
+      >
+        本次推送已达150条信息上限!开通超级订阅,支持每天最多推送2000条信息
       </NoticeBar>
       <NoticeBar
+        v-if="vipNoticeBarShow"
         theme="red"
+        :right-text="noticeBar.vipRightText"
         @clickLeft="noticeBar.vipShow = false"
         @clickRight="toBuyVip"
-        :rightText="noticeBar.vipRightText"
-        v-if="vipNoticeBarShow"
-        >{{ noticeBar.vipContentText }}
+      >
+        {{ noticeBar.vipContentText }}
       </NoticeBar>
       <NoticeBar
+        v-if="keywordsSettingNoticeBarShow"
+        right-text="去设置"
         @clickLeft="noticeBar.settingKeywordsShow = false"
         @clickRight="toKeysetPage"
-        rightText="去设置"
-        v-if="keywordsSettingNoticeBarShow"
-        >您未设置关键词,设置后接收信息更精准!
+      >
+        您未设置关键词,设置后接收信息更精准!
       </NoticeBar>
     </footer>
-    <!--    客服-->
-    <customer-corner
+    <!--    客服 -->
+    <CustomerCorner
       v-show="isLogin"
       :scroll-status="scrollStatus"
       bottom-position="12%"
     />
     <!-- 招采 -->
     <CustomerBid
-      v-show="isLogin && $envs.inWX"
+      v-show="isLogin && $envs.inWX && showTutorial"
       :scroll-status="scrollStatus"
       bottom-position="19%"
       @jumpBidPage="jumpBidPage"
     />
     <DataReportTip
       v-model="dataReport.tip"
-      :vSwitch="vSwitch"
-      :tipInfo="dataReport.tipInfo"
+      :v-switch="vSwitch"
+      :tip-info="dataReport.tipInfo"
     />
-    <popupDataexport
-      ref="popup_dataExport"
-      @next="next_export"
-    ></popupDataexport>
+    <PopupDataexport ref="popup_dataExport" @next="next_export" />
     <CheckUserDialog />
   </div>
 </template>
 
 <script>
-import { mapState, mapActions, mapGetters } from 'vuex'
-import { List, Badge, Button, Tabs, Tab, Tag, Popup } from 'vant'
+import { mapActions, mapGetters, mapState } from 'vuex'
+import { Badge, Button, List, Popup, Tab, Tabs, Tag } from 'vant'
 import dayjs from 'dayjs'
 import qs from 'qs'
+import { throttle } from 'lodash'
 import bidStatusNode from '@/components/bid-update/BidUpdate'
 import {
-  AppIcon,
   AppEmpty,
-  ProjectCell,
-  DropFilter,
+  AppIcon,
   DatetimePicker,
-  NoticeBar
+  DropFilter,
+  NoticeBar,
+  ProjectCell
 } from '@/ui'
 // 三级地区筛选
 import AreaThreeSidebar from '@/components/selector/area-three-sidebar/index'
@@ -520,37 +526,37 @@ import popupDataexport from '@/components/dataExport/popupDataexport.vue'
 import CheckUserDialog from '@/views/identity/components/CheckUserDialog'
 import CustomerCorner from '@/components/customer/index'
 import CustomerBid from '@/components/customerBid/index'
-import { LINKS, vtMap, AdCode } from '@/data'
+import { AdCode, LINKS, vtMap } from '@/data'
 import { wxShareMixin } from '@/utils/mixins/modules/wx-share'
 import { iosBackRefresh } from '@/utils/utils'
-import { throttle } from 'lodash'
 import {
-  callHideTab,
+  FilterHistoryViewModel2AjaxModel,
+  InfoTypeTransform,
   callHideRedSpotOnMenu,
+  callHideTab,
+  dateFormatter,
   formatMoney,
-  moneyUnit,
+  getRandomNumber,
+  getRandomString,
   iOSVersionLt14,
-  dateFormatter,
-  replaceKeyword,
+  moneyUnit,
   openAppOrWxPage,
   openLinkOfOther,
-  getRandomString,
-  getRandomNumber,
-  FilterHistoryViewModel2AjaxModel,
-  InfoTypeTransform
+  replaceKeyword
 } from '@/utils'
 import {
-  selectEnt,
+  ajaxCanBiaoAction,
+  ajaxCanBiaoStatus,
+  checkDataReportTip,
+  checkHasReportData,
+  getConfiguration,
   getPushListDataExportId,
+  getSubscribePageAreaPackTip,
+  getUserSubscribeKeywords,
   getUserSubscribeList,
   getUserSubscribeSomeInfo,
-  checkDataReportTip,
-  getSubscribePageAreaPackTip,
+  selectEnt,
   setSubscribePageAreaPackTipClose,
-  checkHasReportData,
-  ajaxCanBiaoStatus,
-  ajaxCanBiaoAction,
-  getUserSubscribeKeywords,
   setUserSubscribeListVisited
 } from '@/api/modules'
 import { leadGetDate } from '@/api/modules/leadGeneration'
@@ -567,7 +573,6 @@ const leaveSourceMap = {
 
 export default {
   name: 'AppSubscribe',
-  mixins: [wxShareMixin],
   components: {
     PowerSwitch,
     SubscribeMoreFilters,
@@ -589,12 +594,18 @@ export default {
     [IndustrySidebar.name]: IndustrySidebar,
     CheckUserDialog,
     RecommendCard,
-    bidStatusNode,
-    popupDataexport,
+    BidStatusNode: bidStatusNode,
+    PopupDataexport: popupDataexport,
     AreaThreeSidebar,
     CustomerCorner,
     CustomerBid
   },
+  mixins: [wxShareMixin],
+  provide() {
+    return {
+      getActiveSubscribeTypeState: this.getActiveSubscribeTypeState
+    }
+  },
   data() {
     return {
       restored: false, // 本次页面加载数据是否从缓存中获取
@@ -832,12 +843,8 @@ export default {
       projectCellInfo: {},
       mergedKeywords: [],
       alreadyLeave: false, // 免费用户是否已经留资. true为已留资,false为未留资或者留资信息不全
-      scrollStatus: true
-    }
-  },
-  provide() {
-    return {
-      getActiveSubscribeTypeState: this.getActiveSubscribeTypeState
+      scrollStatus: true,
+      showTutorial: false
     }
   },
   computed: {
@@ -1134,7 +1141,7 @@ export default {
         // changed后会进行一次查询
         // 默认查询
         // this.subscribeTypeActive = 'my'
-        this.doSearch('firstInit') //初始化调用接口
+        this.doSearch('firstInit') // 初始化调用接口
       }
       this.getMergedEntSubscribeKeywords()
     }
@@ -1146,6 +1153,7 @@ export default {
     this.setDocumentTitle()
     this.initScrollEvents()
     this.appTabShow()
+    this.getConfigurationApi()
     console.log(this.restfulApiUserTypeWitchVSwitch, 'mounted')
   },
   methods: {
@@ -1157,9 +1165,23 @@ export default {
       'userVipSwitchState',
       'getUserIdentityList'
     ]),
-    jumpBidPage () {
+    jumpBidPage() {
       this.$router.push('/course/index')
     },
+    async getConfigurationApi() {
+      const { error_code: code, data } = await getConfiguration()
+      if (code === 0) {
+        const thisTime = Math.round(new Date() / 1000)
+        if (
+          thisTime >= data?.bulletFrameStart &&
+          thisTime <= data?.bulletFrameEnd
+        ) {
+          this.showTutorial = true
+        } else {
+          this.showTutorial = false
+        }
+      }
+    },
     // 检测是否需要处理ios兼容性问题
     // ios13以及以下需要处理兼容性问题
     checkIOSCompatible() {
@@ -1550,7 +1572,7 @@ export default {
           }
           case 'industry': {
             const result = Object.keys(values).map((k) => {
-              return values[k].map((v) => k + '_' + v).join(',')
+              return values[k].map((v) => `${k}_${v}`).join(',')
             })
             params[key] = result.join(',')
             break
@@ -1697,7 +1719,7 @@ export default {
       await this.getList(type)
     },
     // 下拉刷新,暂未用到
-    onRefresh: function () {
+    onRefresh() {
       // 重置数据
       this.listState.pageNum = 1
       // 解除加载完成状态
@@ -1922,7 +1944,7 @@ export default {
           ? item?.buyerClass
           : undefined
       // 有city时展示city,无展示area
-      const region = city ? city : area
+      const region = city || area
       // 标签
       item.tagList = [
         region || '',
@@ -2007,7 +2029,7 @@ export default {
         }
       ]
     },
-    dropdownMenuItemClick: function () {
+    dropdownMenuItemClick() {
       if (this.noLoginOrFree && this.isPersonalSubscribe) {
         this.onNoPower()
       }
@@ -2143,7 +2165,7 @@ export default {
     // 标讯收藏
     async doCollection(item, index) {
       if (!this.isLogin) {
-        this.pageState.cacheStar = index + ''
+        this.pageState.cacheStar = `${index}`
         this.saveState()
         return openLinkOfOther(LINKS.APP登录页.app, {
           query: {
@@ -2156,7 +2178,7 @@ export default {
         stopLeaveInfo: !this.isFree || this.alreadyLeave, // 非免费用户或者已留资过的用户,不再重复留资
         id: item._id,
         beforeRedirect: () => {
-          this.pageState.cacheStar = index + ''
+          this.pageState.cacheStar = `${index}`
           this.saveState()
         },
         complete: ({ type, message }) => {
@@ -2266,7 +2288,7 @@ export default {
               count += stateCounter[key]?._children_selectedCount || 0
             }
             const countString = count || ''
-            areaTitle = '地区' + countString
+            areaTitle = `地区${countString}`
             this.searchState.areaDropdownMenuTitleText = areaTitle
           } else {
             const { areaDropdownMenuTitleText } = this.searchState
@@ -2280,7 +2302,7 @@ export default {
             .map((k) => this.filters.industry[k])
             .flat().length
           const countString = count || ''
-          this.dropFilterOptions[2].menu.title = '行业' + countString
+          this.dropFilterOptions[2].menu.title = `行业${countString}`
           break
         }
         case 'more': {
@@ -2387,7 +2409,7 @@ export default {
       const { listContainer } = this.$refs
       this.saveActiveTab()
       this.listState.scrollTop = listContainer
-        ? parseInt(listContainer.scrollTop)
+        ? Number.parseInt(listContainer.scrollTop)
         : 0
       this.$storage.set(
         this.$route.path,