enterprises.vue 6.7 KB

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