Эх сурвалжийг харах

Merge branch 'dev/v1.0.59_yf' of jianyu/web into feature/v1.0.59

yangfeng 1 жил өмнө
parent
commit
320d47b0cf

+ 208 - 0
apps/mobile/src/components/no-login/NoLoginTabbar.vue

@@ -0,0 +1,208 @@
+<template>
+  <van-tabbar
+    :active-key="getNowActiveKey"
+    class="footer-box"
+    :fixed="false"
+    :safe-area-inset-bottom="true"
+    active-color="#2DA0FF"
+    inactive-color="#B7B7B7"
+    v-model="nowNavKey"
+    @change="onChange"
+  >
+    <van-tabbar-item
+      v-for="item in navs"
+      :name="item.key"
+      :key="item.key"
+    >
+      <div class="tabbar-image" slot="icon" slot-scope="props">
+        <AppIcon v-show="!props.active" :name="item.icon" />
+        <div
+          v-show="props.active"
+          class="lottie-an-tabbar"
+          ref="lottie"
+          :data-lottie-key="item.lottie"
+        />
+      </div>
+      <span
+        class="tabbar-title"
+        :class="{ active: props.active }"
+        slot-scope="props"
+        >{{ item.label }}</span
+      >
+    </van-tabbar-item>
+  </van-tabbar>
+</template>
+<script>
+// TODO 混合旧项目,暂时无法直接使用 route 模式,需手动跳转路由
+import lottie from 'lottie-web'
+import { Tabbar, TabbarItem } from 'vant'
+import { AppIcon } from '@/ui'
+import TabbarAnimationData from '@/assets/lottie/tabbar'
+import { mapGetters } from 'vuex'
+
+export default {
+  name: 'FooterTabbar',
+  components: {
+    [Tabbar.name]: Tabbar,
+    [TabbarItem.name]: TabbarItem,
+    [AppIcon.name]: AppIcon
+  },
+  props: {},
+  data: function () {
+    return {
+      isMounted: false,
+      nowNavKey: this.$route.meta?.tabbar || 'search',
+      navs: [
+        {
+          key: 'search',
+          label: '首页',
+          link: '/home',
+          icon: 'nav_un_home',
+          lottie: 'home'
+        },
+        {
+          key: 'subscribe',
+          label: '订阅',
+          link: '/subscribe',
+          icon: 'nav_un_book',
+          lottie: 'subscribe'
+        },
+        {
+          key: 'message',
+          label: '消息',
+          link: '/message',
+          icon: 'nav_un_message',
+          lottie: 'message'
+        },
+        {
+          key: 'box',
+          label: '工作台',
+          link: '/box',
+          icon: 'workSpace',
+          lottie: 'box'
+        },
+        {
+          key: 'me',
+          label: '我的',
+          link: '/me',
+          icon: 'nav_un_mine',
+          lottie: 'mine'
+        }
+      ]
+    }
+  },
+  computed: {
+    getTabbarKeys() {
+      return this.navs.map((v) => v.key)
+    },
+    getNowActiveKey() {
+      const nowKey = this.$route.meta?.tabbar
+      if (this.isMounted) {
+        this.refreshActiveIndex()
+      }
+      return nowKey
+    },
+    ...mapGetters('user', ['isLogin'])
+  },
+  mounted() {
+    this._LottieItems = this.navs.map((v, index) => {
+      return {
+        op: TabbarAnimationData[v.lottie].op,
+        lottie: lottie.loadAnimation({
+          animationData: Object.assign({}, TabbarAnimationData[v.lottie]),
+          loop: false,
+          autoplay: false,
+          renderer: 'svg',
+          container: this.$refs.lottie[index]
+        })
+      }
+    })
+    this.isMounted = true
+    this.setActiveIcon(this.nowNavKey)
+  },
+  methods: {
+    getIndex(key) {
+      return this.getTabbarKeys.indexOf(key)
+    },
+    refreshActiveIndex() {
+      this.nowNavKey = this.$route.meta?.tabbar
+      this.setActiveIcon(this.nowNavKey)
+    },
+    setActiveIcon(key) {
+      const index = this.getIndex(key)
+      if (index === -1) {
+        return
+      }
+      this._LottieItems[index].lottie.goToAndPlay(0, true)
+    },
+    onChange(key) {
+      const navIndex = this.getIndex(key)
+      if (navIndex === -1) {
+        return
+      }
+      const item = this.navs[navIndex]
+      this.setActiveIcon(key)
+      if (key === 'subscribe') {
+        window.location.replace('/jyapp/frontPage/seo/free/subscribe')
+      } else if (key === 'box') {
+        window.location.replace('/jyapp/frontPage/seo/free/workbench')
+      } else {
+        this.$router.replace({
+          name: `tabbar-${item.key}`
+        })
+      }
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+$icon-size: 24px;
+$label-color: #171826;
+$label-color--active: #2abed1;
+
+.footer-box {
+  background: #fff;
+  box-shadow: inset 0px 0.5px 0px rgba(0, 0, 0, 0.04);
+  &::after {
+    border-color: transparent;
+  }
+}
+.van-tabbar-item__icon {
+  margin-bottom: 1px;
+}
+.van-tabbar-item {
+  padding-top: 5px;
+  justify-content: flex-start;
+  ::v-deep .van-info {
+    z-index: 1;
+  }
+}
+
+.tabbar-image {
+  position: relative;
+  width: $icon-size;
+  height: $icon-size;
+  .lottie-an-tabbar {
+    position: absolute;
+    top: 0;
+    left: 0;
+    z-index: 1;
+    width: inherit;
+    height: inherit;
+  }
+  i {
+    font-size: $icon-size;
+    color: $label-color;
+  }
+}
+.van-tabbar-item__text span.tabbar-title {
+  &.active {
+    color: $label-color--active;
+  }
+  color: $label-color;
+  font-size: 10px;
+  font-weight: 500;
+  line-height: 16px;
+  transition: color 0.2s;
+}
+</style>

+ 23 - 6
apps/mobile/src/components/search/bidding/NoLoginBidList.vue

@@ -23,6 +23,17 @@
         v-visited:content="item.id"
         v-visited:content="item.id"
         @click="onClick(item)"
         @click="onClick(item)"
       >
       >
+        <template slot="icon">
+          <div class="right-event" @click.stop="onKeep(item, index)">
+            <AppIcon
+              style="margin-right: 4px"
+              svg
+              size="20"
+              :name="item.isCollected ? 'shoucang' : 'shoucang_weishoucang'"
+            />
+            <span class="label-icon">收藏</span>
+          </div>
+        </template>
       </project-cell>
       </project-cell>
     </div>
     </div>
   </div>
   </div>
@@ -34,7 +45,8 @@ import { AppEmpty, AppIcon, ProjectCell } from '@/ui'
 import { ajaxGetIndexList } from '@/api/modules'
 import { ajaxGetIndexList } from '@/api/modules'
 import {
 import {
   formatMoney,
   formatMoney,
-  openAppOrWxPage
+  openAppOrWxPage,
+  openLinkOfOther
 } from '@/utils'
 } from '@/utils'
 import { LINKS } from '@/data'
 import { LINKS } from '@/data'
 import qs from 'qs'
 import qs from 'qs'
@@ -141,11 +153,7 @@ export default {
                 buyerClass,
                 buyerClass,
                 v?.type || v?.subtype,
                 v?.type || v?.subtype,
                 // 有中标金额取中标金额,没有取预算,预算没有置空
                 // 有中标金额取中标金额,没有取预算,预算没有置空
-                v?.bidamount
-                  ? formatMoney(v?.bidamount)
-                  : v?.budget
-                  ? formatMoney(v?.budget)
-                  : ''
+                '登录即可免费查看'
               ].filter((v) => v),
               ].filter((v) => v),
               time: v?.publishTime ? v.publishTime * 1000 : '',
               time: v?.publishTime ? v.publishTime * 1000 : '',
               data: v
               data: v
@@ -162,6 +170,15 @@ export default {
             this.loadList()
             this.loadList()
           }
           }
         })
         })
+    },
+    onKeep() {
+      if (!this.isLogin) {
+        return openLinkOfOther(LINKS.APP登录页.app, {
+          query: {
+            to: 'back'
+          }
+        })
+      }
     }
     }
   }
   }
 }
 }

+ 22 - 5
apps/mobile/src/views/article/index.vue

@@ -34,27 +34,30 @@
                 v-if="contentInfo.publishEntName"
                 v-if="contentInfo.publishEntName"
               >
               >
                 <label>发布单位</label>
                 <label>发布单位</label>
-                <div>{{ contentInfo.publishEntName }}</div>
+                <div v-if="isLogin">{{ contentInfo.publishEntName }}</div>
+                <div v-else class="login-see" @click="toLogin">登录即可免费查看</div>
               </div>
               </div>
               <div class="content-item jy-hairline--bottom">
               <div class="content-item jy-hairline--bottom">
                 <label>发布人</label>
                 <label>发布人</label>
-                <div>
+                <div v-if="isLogin">
                   {{
                   {{
                     contentInfo.infoDetailContact.name
                     contentInfo.infoDetailContact.name
                       ? contentInfo.infoDetailContact.name
                       ? contentInfo.infoDetailContact.name
                       : '-'
                       : '-'
                   }}
                   }}
                 </div>
                 </div>
+                <div v-else class="login-see" @click="toLogin">登录即可免费查看</div>
               </div>
               </div>
               <div class="content-item jy-hairline--bottom">
               <div class="content-item jy-hairline--bottom">
                 <label>联系电话</label>
                 <label>联系电话</label>
-                <div>
+                <div v-if="isLogin">
                   {{
                   {{
                     contentInfo.infoDetailContact.phone
                     contentInfo.infoDetailContact.phone
                       ? contentInfo.infoDetailContact.phone
                       ? contentInfo.infoDetailContact.phone
                       : '-'
                       : '-'
                   }}
                   }}
                 </div>
                 </div>
+                <div v-else class="login-see" @click="toLogin">登录即可免费查看</div>
               </div>
               </div>
               <div class="content-item jy-hairline--bottom">
               <div class="content-item jy-hairline--bottom">
                 <label>有效期至</label>
                 <label>有效期至</label>
@@ -203,6 +206,7 @@ import {
 } from '@/utils'
 } from '@/utils'
 import { callPhone, downLoadFile, compareVersion } from '@/utils/callFn'
 import { callPhone, downLoadFile, compareVersion } from '@/utils/callFn'
 import { emailRegExp, customerServiceTel } from '@/utils/constant/'
 import { emailRegExp, customerServiceTel } from '@/utils/constant/'
+import { openLinkOfOther } from '@/utils'
 import { LINKS } from '@/data'
 import { LINKS } from '@/data'
 // api
 // api
 import { supplyInfoDetail } from '@/api/modules/jyinfo'
 import { supplyInfoDetail } from '@/api/modules/jyinfo'
@@ -263,7 +267,8 @@ export default {
       'isSuper',
       'isSuper',
       'isMember',
       'isMember',
       'bigMemberPower',
       'bigMemberPower',
-      'isBusiness'
+      'isBusiness',
+      'isLogin'
     ]),
     ]),
     // 免费用户免费体验次数
     // 免费用户免费体验次数
     freeFileNum() {
     freeFileNum() {
@@ -400,7 +405,7 @@ export default {
         data,
         data,
         error_code: code,
         error_code: code,
         error_msg: msg
         error_msg: msg
-      } = await getEntInfo({ entId })
+      } = await getEntInfo({ entId, noToast: true })
       if (code === 0 && data) {
       if (code === 0 && data) {
         // this.contentInfo.publishEntName = data.name
         // this.contentInfo.publishEntName = data.name
         // 信息中没有省市,从企业信息中获取
         // 信息中没有省市,从企业信息中获取
@@ -656,6 +661,15 @@ export default {
     },
     },
     chargeFilePack() {
     chargeFilePack() {
       this.$router.push('/common/order/create/filepack')
       this.$router.push('/common/order/create/filepack')
+    },
+    toLogin() {
+      if (!this.isLogin) {
+        return openLinkOfOther(LINKS.APP登录页.app, {
+          query: {
+            to: 'back'
+          }
+        })
+      }
     }
     }
   }
   }
 }
 }
@@ -906,6 +920,9 @@ export default {
       margin-right: 12px;
       margin-right: 12px;
       color: #5f5e64;
       color: #5f5e64;
     }
     }
+    .login-see {
+      color: $color_main;
+    }
   }
   }
 }
 }
 ::v-deep {
 ::v-deep {

+ 6 - 2
apps/mobile/src/views/search/middle/bidding/index.vue

@@ -45,6 +45,9 @@
           <NoLoginBidList v-if="!isLogin"></NoLoginBidList>
           <NoLoginBidList v-if="!isLogin"></NoLoginBidList>
         </div>
         </div>
       </div>
       </div>
+      <div class="j-footer" v-if="!isLogin">
+        <NoLoginTabbar></NoLoginTabbar>
+      </div>
     </div>
     </div>
     <CheckUserDialog />
     <CheckUserDialog />
   </div>
   </div>
@@ -55,6 +58,7 @@ import { HistoryList, AppIcon } from '@/ui'
 import HotKeyCard from '@/components/search/middle/HotKeyCard.vue'
 import HotKeyCard from '@/components/search/middle/HotKeyCard.vue'
 import CheckUserDialog from '@/views/identity/components/CheckUserDialog'
 import CheckUserDialog from '@/views/identity/components/CheckUserDialog'
 import NoLoginBidList from '@/components/search/bidding/NoLoginBidList.vue'
 import NoLoginBidList from '@/components/search/bidding/NoLoginBidList.vue'
+import NoLoginTabbar from '@/components/no-login/NoLoginTabbar.vue'
 import {
 import {
   getBiddingSearchHistory,
   getBiddingSearchHistory,
   getBiddingFilterList,
   getBiddingFilterList,
@@ -84,7 +88,8 @@ export default {
     HotKeyCard,
     HotKeyCard,
     CheckUserDialog,
     CheckUserDialog,
     HistoryList,
     HistoryList,
-    NoLoginBidList
+    NoLoginBidList,
+    NoLoginTabbar
   },
   },
   inject: {
   inject: {
     topSearch: {
     topSearch: {
@@ -444,7 +449,6 @@ export default {
         // }
         // }
         getHistoryQuery({ type: '1' }).then((res) => {
         getHistoryQuery({ type: '1' }).then((res) => {
           if (res.success) {
           if (res.success) {
-            console.log(res, 'resssss');
             this.biddingSearchHistory = res?.search || []
             this.biddingSearchHistory = res?.search || []
           }
           }
         })
         })