enterprises.vue 6.6 KB

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