123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350 |
- <template>
- <layout-page>
- <scroll-view class="scrollBox" scroll-y="true" @scrolltolower="loadingMore" style="position:relative;">
- <view class="content defaultBgc">
- <view class="content-top">
- <view class="content-top-title">
- <view class="content-top-title-label">
- <text class="content-top-title-label-l">猎聘</text>
- <text class="content-top-title-label-s">全球海量岗位 | 推荐有赏</text>
- </view>
- <view class="content-top-title-local" @tap="handleMap">
- <uni-icons type="icon-map" custom-prefix="iconfont" color="#999"/>
- {{ useUserStore.isLogin ? localtion : null }}
- </view>
- </view>
- <view class="content-top-carousel">
- <view class="content-top-carousel-box">
- <SwiperAd :list="swiperAdList"></SwiperAd>
- </view>
- </view>
- <view class="content-top-recommend">
- <view class="content-top-recommend-box">
- <resume-status>
- <template #header>
- <view class="content-top-recommend-box-title">
- <text class="title">我的推荐</text>
- <view class="route">
- <text>推荐好友入职得赏金</text>
- <uni-icons type="icon-right" custom-prefix="iconfont" color="#999"/>
- </view>
- </view>
- </template>
-
- </resume-status>
- </view>
- </view>
- </view>
- <view class="content-main">
- <!-- <view class="content-main-filter">
- <view class="content-main-filter-type">
- <text
- v-for="item in chooseItems"
- :key="item"
- class="content-main-filter-type-item"
- :class="{ active: item === chooseItem}"
- @tap="handleChoose(item)"
- >{{ item}}</text>
- </view>
- <view class="content-main-filter-filter">
- <text>筛选</text>
- <uni-icons type="icon-Filter" custom-prefix="iconfont" color="#999"/>
- </view>
-
- </view> -->
- <view class="content-main-list">
- <PositionList class="pb-10" :list="items" :noMore="items.length === total"></PositionList>
- <!-- template v-if="items.length === 0">
- <view class="nodata-img-parent">
- <image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" style="width: 100vw;height: 100vh;"></image>
- </view>
- </template>
- <view v-for="(item,index) in items" :key="item.id" class="content-main-list-box">
- <view class="top">
- <view class="title">{{ item.name }}</view>
- <text class="remuneration">
- {{ item.payFrom }}
- {{ item.payTo ? ' - ' : ''}}
- {{ item.payTo }}
- {{ item.payName }}
- </text>
- </view>
- <view class="main">
- <view class="tag blue">
- 赏
- <uni-icons
- type="icon-renminbi1688"
- size="10"
- custom-prefix="iconfont"
- color="royalblue"
- />
- {{ item.hirePrice }}
- </view>
- <view v-for="tag in item.tagList" :key="tag + index" class="tag">
- {{ tag }}
- </view>
- </view>
- <view class="bottom">
- <view class="origin">
- <text>{{ item.anotherName }}</text>
- <text class="interval">·</text>
- <text>{{ item.areaName }}</text>
- </view>
- </view>
- </view>
- <template v-if="items.length === total">
- <view class="noMore">
- 没有更多了
- </view>
- </template> -->
- </view>
- </view>
- <!-- <image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" style="width: 100vw;height: 100vh;"></image> -->
- </view>
- </scroll-view>
- </layout-page>
- </template>
- <script setup>
- import { ref, reactive } from 'vue'
- import SwiperAd from '@/components/SwiperAd'
- import { showAuthModal } from '@/hooks/useModal'
- import { swiperAdListTest } from '@/utils/testData'
- import { userStore } from '@/store/user'
- import layoutPage from '@/layout'
- import ResumeStatus from '@/components/ResumeStatus'
- import { getJobAdvertisedHire } from '@/api/position.js'
- import { getDict } from '@/hooks/useDictionaries.js'
- import { dealDictArrayData } from '@/utils/position.js'
- import PositionList from '@/components/PositionList'
- const swiperAdList = ref(swiperAdListTest)
- const useUserStore = userStore()
- const localtion = ref('全国')
- const chooseItem = ref('同城')
- const chooseItems = reactive(['同城','最新'])
- const items = reactive([])
- const unitDict = ref([])
- const areaDict = ref([])
- const pageInfo = ref({
- pageNo: 1,
- pageSize: 10
- })
- const total = ref(0)
- // 选择地区
- const handleMap = () => {
- // 检测是否登录
- // 未登录
- if (!useUserStore.isLogin) {
- console.log(111)
- showAuthModal()
- return
- }
- // 已登录
-
- }
- // 切换同城、最新
- const handleChoose = (item) => {
- chooseItem.value = item
- }
- const loadingMore = (e) => {
- console.log(total.value, items.length)
- if (total.value === items.length) {
- return
- }
- pageInfo.value.pageNo++
- getList()
- }
- async function getRatio () {}
- async function getDictionaries () {
- const { data } = await getDict('menduner_pay_unit')
- unitDict.value = data.data
-
- const { data: _data } = await getDict('menduner_area_type')
- areaDict.value = _data.data
- getList()
- }
- async function getList () {
- const { data } = await getJobAdvertisedHire({
- ...pageInfo.value
- })
- if (!data.list) {
- pageInfo.pageNo--
- return
- }
- const _items = dealDictArrayData([], data.list)
- items.push(..._items.map(e => {
- return {
- job: e,
- enterprise: {
- welfareList: e.tagList,
- logoUrl: e.logoUrl,
- anotherName: e.anotherName,
- industryName: e.industryName,
- scaleName: e.scaleName
- }
- }
- }))
- console.log(items)
- total.value = +data.total
- }
- getDictionaries()
- </script>
- <style scoped lang="scss">
- $defaultColor: #999;
- @mixin box {
- border-radius: 24rpx;
- width: 100%;
- height: 100%;
- background: #FFF;
- overflow: hidden;
- }
- .content {
- &-top {
- &-title {
- padding: 24rpx;
- box-sizing: border-box;
- width: 100%;
- display: flex;
- justify-content: space-between;
- align-items: flex-end;
- background-color: #FFF;
- &-label {
- display: flex;
- align-items: flex-end;
- &-l {
- font-size: 46rpx;
- margin-right: 16rpx;
- }
- &-s {
- font-size: 24rpx;
- color: $defaultColor;
- }
- }
- &-local {
- color: $defaultColor;
- display: flex;
- align-items: flex-end;
- }
- }
- &-carousel {
- padding: 24rpx;
- height: 300rpx;
- &-box {
- @include box;
- }
- }
- &-recommend {
- padding: 24rpx;
- &-box {
- @include box;
- &-title {
- display: flex;
- justify-content: space-between;
- align-items: flex-end;
- padding: 20rpx;
- font-size: 30rpx;
- .route {
- color: $defaultColor;
- font-size: .75em;
- }
- }
- }
- }
- }
- &-main {
- &-filter {
- padding: 24rpx;
- font-size: 30rpx;
- color: $defaultColor;
- display: flex;
- justify-content: space-between;
- &-type{
- &-item {
- padding: 20rpx;
- &.active {
- color: #000;
- }
- }
- }
- }
- &-list {
- width: 100%;
- padding: 0 24rpx 24rpx 24rpx;
- box-sizing: border-box;
- &-box {
- padding: 24rpx;
- margin-bottom: 24rpx;
- box-sizing: border-box;
- @include box;
- .top {
- width: 100%;
- display: flex;
- justify-content: space-between;
- .title {
- flex: 1;
- overflow: hidden; /* 隐藏超出部分 */
- white-space: nowrap; /* 不换行 */
- text-overflow: ellipsis; /* 超出部分显示省略号 */
- }
- .remuneration {
- color: aquamarine;
- }
- }
- .main {
- display: flex;
- font-size: 24rpx;
- margin: 28rpx 0;
- .tag {
- &.blue {
- background: aliceblue;
- color: royalblue;
- }
- font-size: 20rpx;
- border-radius: 8rpx;
- color: #666;
- background: #eee;
- padding: 6rpx 10rpx;
- margin-right: 20rpx;
- }
- }
- .bottom {
- color: #666;
- display: flex;
- justify-content: space-between;
- .origin {
- font-size: 0.8em;
- .interval {
- padding: 0 16rpx;
- }
- }
- .local {
- color: #aaa;
- font-size: 0.6em;
- }
- }
- }
- .noMore {
- font-size: 24rpx;
- color: $defaultColor;
- text-align: center;
- }
- }
- }
- }
- .scrollBox {
- height: 100vh;
- }
- </style>
|