communicate.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <layout-page class="ss-m-x-15">
  3. <SwiperAd :list="swiperAdListTest"></SwiperAd>
  4. <view class="card">
  5. <uni-list>
  6. <uni-list-item v-for="item in list" :clickable="true" :key="item.title" :title="item.title" showArrow :rightText="item.rightTex || ''" @click="handleToLink(item)"></uni-list-item>
  7. </uni-list>
  8. </view>
  9. </layout-page>
  10. </template>
  11. <script setup>
  12. import SwiperAd from '@/components/SwiperAd'
  13. import layoutPage from '@/layout'
  14. import { swiperAdListTest } from '@/utils/testData'
  15. import { getAccessToken } from '@/utils/request'
  16. import { showAuthModal } from '@/hooks/useModal'
  17. const list = [
  18. { title: '附件简历', path: '/pagesA/resume/index' },
  19. { title: '我的收藏', path: '/pagesA/collect/index' },
  20. { title: '前往门墩儿甄选商城', appId: 'wx6decdf12f9e7a061' },
  21. { title: '切换为招聘者', rightTex: '我要招人' }
  22. ]
  23. // 列表跳转
  24. const handleToLink = (item) => {
  25. if (item.appId) {
  26. uni.navigateToMiniProgram({
  27. appId: item.appId,
  28. // extraData: {} // 要传递的数据
  29. })
  30. return
  31. }
  32. if (!item.path) return
  33. if (!getAccessToken()) {
  34. uni.showToast({
  35. title: '请先登录',
  36. icon: 'none'
  37. })
  38. showAuthModal()
  39. return
  40. }
  41. uni.navigateTo({
  42. url: item.path
  43. })
  44. }
  45. </script>
  46. <style scoped lang="scss">
  47. ::v-deep .uni-list-item{
  48. height: 140rpx !important;
  49. line-height: 140rpx !important;
  50. }
  51. ::v-deep .uni-list-item__content-title{
  52. font-size: 32rpx !important;
  53. font-weight: 500;
  54. }
  55. </style>