enterprises.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <!-- 招聘会/企业 -->
  2. <template>
  3. <view class="box defaultBgc">
  4. <scroll-view class="scrollBox" :scroll-y="true" :scroll-top="scrollTop" @scrolltolower="loadingMore" @scroll="onScroll" style="position:relative;">
  5. <view>
  6. <!-- 顶部 -->
  7. <view class="white-bgc stick ss-p-t-10 ss-p-b-10">
  8. <view class="titleBox">
  9. <view class="jobFairName">{{ jobFairName }}</view>
  10. </view>
  11. <!-- 搜索条 -->
  12. <view style="position: relative;">
  13. <uni-search-bar
  14. v-model="query.keyword"
  15. placeholder="输入公司关键字"
  16. cancelButton="none"
  17. :focus="false"
  18. bgColor="#fff"
  19. @confirm="onSearch($event.value)"
  20. @clear="query.keyword = ''; onSearch()"
  21. >
  22. </uni-search-bar>
  23. <button class="search-btn" @tap.stop="onSearch">搜索</button>
  24. </view>
  25. </view>
  26. <view v-if="listData?.length" class="listDataBox">
  27. <uni-card v-for="val in listData" :key="val.id" @click="toDetail(val)" :is-shadow="true" :border='false' shadow="0px 0px 3px 1px rgba(0,0,0,0.1)">
  28. <view class="d-flex align-center ss-m-30" @click="null">
  29. <image class="enterAvatar" :src="val.logoUrl ? val.logoUrl : 'https://minio.citupro.com/dev/menduner/company-avatar.png'"></image>
  30. <view class="ss-m-l-20" style="flex: 1;">
  31. <view class="font-size-16 enterpriseName">{{ formatName(val.anotherName || val.name) }}</view>
  32. <view class="ss-m-t-5">
  33. <span class="color-999">{{ val?.industryName || '' }}</span>
  34. <span class="divider tag-gap1" v-if="val?.industryName && val?.scaleName"> | </span>
  35. <span class="color-999">{{ val?.scaleName || '' }}</span>
  36. </view>
  37. <view class="ss-m-t-10" style="overflow: hidden;height: 48px;">
  38. <uni-tag
  39. v-for="(tag,i) in val?.welfareList || []"
  40. :key="i"
  41. class="ss-m-r-5"
  42. :text="tag"
  43. inverted="false"
  44. size="mini"
  45. custom-style="background-color: #ececec; color: #666; border-color: #ececec; display: inline-block;"
  46. />
  47. </view>
  48. </view>
  49. </view>
  50. <view class="jobCount">{{ val.jobCount }}个在线职位招聘中</view>
  51. </uni-card>
  52. <uni-load-more :status="more" />
  53. </view>
  54. <view v-else class="nodata-img-parent">
  55. <image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" style="width: 100vw;height: 100vh;"></image>
  56. </view>
  57. </view>
  58. </scroll-view>
  59. </view>
  60. </template>
  61. <script setup>
  62. import { ref, reactive } from 'vue'
  63. import { dealDictArrayData } from '@/utils/position'
  64. import { getJobFairEnterprisePage } from '@/api/jobFair'
  65. import { formatName } from '@/utils/getText'
  66. import { onLoad } from '@dcloudio/uni-app'
  67. const more = ref('more')
  68. const listData = ref([])
  69. const query = reactive({
  70. pageSize: 20,
  71. pageNo: 1,
  72. keyword: '',
  73. jobFairId: undefined,
  74. })
  75. const jobFairName = ref('')
  76. onLoad(async (options) => {
  77. jobFairName.value = options.jobFairName
  78. if (options?.jobFairId) {
  79. query.jobFairId = options.jobFairId
  80. getData()
  81. }
  82. })
  83. const getData = async () => {
  84. if (!query.jobFairId) {
  85. uni.showToast({ title: '进去招聘会失败!', icon: 'none', duration: 2000 })
  86. return
  87. }
  88. try {
  89. const res = await getJobFairEnterprisePage(query)
  90. const list = res?.data?.list || []
  91. // const list = [...res?.data?.list, ...res?.data?.list, ...res?.data?.list, ...res?.data?.list, ...res?.data?.list, ...res?.data?.list, ...res?.data?.list, ...res?.data?.list, ...res?.data?.list, ...res?.data?.list, ...res?.data?.list, ...res?.data?.list, ...res?.data?.list, ...res?.data?.list, ...res?.data?.list, ...res?.data?.list, ...res?.data?.list, ...res?.data?.list, ...res?.data?.list, ...res?.data?.list, ...res?.data?.list, ...res?.data?.list, ...res?.data?.list, ...res?.data?.list, ...res?.data?.list, ...res?.data?.list, ...res?.data?.list] || []
  92. listData.value = listData.value.concat(dealDictArrayData([], list))
  93. if (listData.value?.length === +res?.data?.total) {
  94. more.value = 'noMore'
  95. return
  96. }
  97. } catch (error) {
  98. query.pageNo--
  99. more.value = 'more'
  100. }
  101. }
  102. const scrollTop = ref(0)
  103. const old = ref({
  104. scrollTop: 0
  105. })
  106. const onScroll = (e) =>{
  107. old.value.scrollTop = e.detail.scrollTop
  108. }
  109. const onSearch = () => {
  110. query.pageNo = 1
  111. listData.value = []
  112. getData()
  113. }
  114. // 加载更多
  115. const loadingMore = () => {
  116. more.value = 'loading'
  117. query.pageNo++
  118. getData()
  119. }
  120. // const goBack = () => {
  121. // uni.navigateTo({
  122. // url: '/pagesB/jobFair/index'
  123. // })
  124. // }
  125. const toDetail = (item) =>{
  126. if (!item?.id || !(item?.jobFairId ?? query.jobFairId)) return
  127. const url = `/pagesB/jobFair/positions?jobFairId=${query.jobFairId || item.jobFairId}&enterpriseId=${item.id}&entName=${item.anotherName}`
  128. uni.navigateTo({ url })
  129. }
  130. </script>
  131. <style scoped lang="scss">
  132. .stick {
  133. z-index: 1;
  134. position: sticky;
  135. top: 0;
  136. }
  137. .stickFilter {
  138. z-index: 1;
  139. position: sticky;
  140. box-shadow: 0px 10rpx 12rpx 0px rgba(195, 195, 195, .25);
  141. top: 120rpx;
  142. }
  143. .px-0 { padding-left: 0 !important; padding-right: 0 !important; }
  144. .pb-10 {
  145. padding-bottom: 10px;
  146. }
  147. .pb-20 { padding-bottom: 20px; }
  148. .px-5 { padding-left: 5px; padding-right: 5px; }
  149. .px-10 { padding-left: 10px; padding-right: 10px; }
  150. .mx-10 { margin-left: 10px; margin-right: 10px }
  151. .mx-20 { margin-left: 20px; margin-right: 20px; }
  152. .mb-10 { margin-bottom: 10px; }
  153. .box {
  154. height: 100vh;
  155. overflow: hidden;
  156. // padding-bottom: 120rpx;
  157. box-sizing: border-box;
  158. display: flex;
  159. flex-direction: column;
  160. }
  161. .listDataBox {
  162. padding-bottom: 120rpx;
  163. }
  164. .scrollBox{
  165. flex: 1;
  166. height: 0 !important;
  167. padding-bottom: 24rpx;
  168. box-sizing: border-box;
  169. }
  170. :deep(.uni-searchbar__box) {
  171. width: calc(100% - 105px);
  172. height: 40px !important;
  173. border: 1px solid #00897B;
  174. padding-right: 20px;
  175. flex: none;
  176. }
  177. .search-btn {
  178. position: absolute;
  179. right: 11px;
  180. top: 10px;
  181. width: 110px;
  182. height: 40px;
  183. font-size: 16px;
  184. background-color: #00897B;
  185. color: #fff;
  186. border-radius: 0 5px 5px 0;
  187. z-index: 9;
  188. }
  189. .goBack {
  190. width: 110px;
  191. height: 32px;
  192. font-size: 13px;
  193. background-color: #00897B;
  194. color: #fff;
  195. // border-radius: 0 5px 5px 0;
  196. z-index: 9;
  197. }
  198. :deep(.picker-view) {
  199. padding-bottom: 80px !important;
  200. }
  201. .jobCount {
  202. height: 40px;
  203. line-height: 40px;
  204. color: #fff;
  205. text-align: center;
  206. font-size: 15px;
  207. background: linear-gradient(to right, #12ebb0, #427daa);
  208. }
  209. :deep(.uni-card) {
  210. padding: 0 !important;
  211. .uni-card__content {
  212. padding: 0 !important;
  213. }
  214. }
  215. .enterpriseName {
  216. color: #404040;
  217. font-weight: 700;
  218. }
  219. .enterAvatar {
  220. width: 60px;
  221. height: 60px;
  222. // border-radius: 50%;
  223. margin: auto;
  224. }
  225. .titleBox {
  226. text-align: left;
  227. padding: 15px 20rpx;
  228. .title {
  229. font-size: 20px;
  230. font-weight: 600;
  231. margin-bottom: 12px;
  232. }
  233. .jobFairName {
  234. color: #00897b;
  235. }
  236. }
  237. </style>