index.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. <template>
  2. <view class="ss-p-b-30">
  3. <view class="mar p-tb ss-m-x-30">
  4. <view class="f-horizon">
  5. <image class="r-avatar" style="width: 80px; height: 80px;" :src="info.logoUrl || 'https://minio.citupro.com/dev/menduner/company-avatar.png'"></image>
  6. <view class="f-straight ss-m-l-10" style="flex: 1;position: relative;">
  7. <view class="title-des font-weight-bold" style="max-width: 45vw;">{{ info.anotherName }}</view>
  8. <view class="color-999 ellipsis font-size-14" style="max-width: 60vw;">
  9. <span>{{ !!info.industryName? info.industryName : ''}}</span>
  10. <span class="ss-m-x-10" v-if="info?.industryName && info?.scaleName"> | </span>
  11. <span>{{ info.scaleName || '' }}</span>
  12. </view>
  13. <view class="collect-icon" @click="handleFollow">
  14. <uni-icons :type="isCollection ? 'heart-filled' : 'heart'" color="#fc6d5e" size="25"></uni-icons>
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. <view class="ss-m-t-30" style="background-color: #fff;">
  20. <uni-segmented-control :current="current" :values="items" @clickItem="changeControl" styleType="text" activeColor="#00897B"></uni-segmented-control>
  21. </view>
  22. <view v-if="current === 0" style="height: 20rpx; background-color: #f8f8fa;"></view>
  23. <!-- 企业信息 -->
  24. <view v-if="current === 0" class="ss-m-t-30 ss-m-x-30 ss-p-b-30">
  25. <uni-tag v-for="(tag, i) in info.tagList" :key="i" class="ss-m-r-10" :text="tag" inverted="false"
  26. size="default" custom-style="background-color: #eef1f7;color:#7f828b;border-color:#eef1f7;display: inline-block;"/>
  27. <!-- 简介 -->
  28. <view class="ss-m-t-30">
  29. <h4>企业简介</h4>
  30. <view v-if="info.introduce" class="ss-m-t-20" style="color: #606371;" v-html="info.introduce?.replace(/\n/g, '</br>')"></view>
  31. <view v-else></view>
  32. </view>
  33. <!-- 福利标签 -->
  34. <view class="topLine"></view>
  35. <view >
  36. <h4>企业福利标签</h4>
  37. <view class="ss-m-t-20" v-if="info?.welfareList?.length">
  38. <uni-tag v-for="(tag, i) in info.welfareList" :key="i" class="ss-m-r-10 ss-m-b-10" :text="tag" inverted="false"
  39. size="default" custom-style="background-color: #eef1f7;color:#7f828b;border-color:#eef1f7; display: inline-block;"/>
  40. </view>
  41. <view v-else></view>
  42. </view>
  43. <!-- 网址 -->
  44. <view class="topLine"></view>
  45. <view>
  46. <h4>企业网址</h4>
  47. <view class="ss-m-t-20">
  48. <uni-link v-if="info.website" :href="info.website" :text="info.website" color="#00897B"></uni-link>
  49. <view v-else></view>
  50. </view>
  51. </view>
  52. <view class="topLine"></view>
  53. <!-- 工商信息 -->
  54. <view>
  55. <h4>工商信息</h4>
  56. <view v-if="info.business && Object.keys(info.business).length">
  57. <view class="ss-m-y-15" v-for="k in business" :key="k.value">
  58. <view>{{ k.name }}</view>
  59. <view class="color-666 ss-m-t-5">
  60. {{ info.business[k.value] ? k.value === 'establishmentTime' ? timesTampChange(info.business[k.value], 'Y-M-D') : info.business[k.value] : '' }}
  61. </view>
  62. </view>
  63. </view>
  64. <view v-else></view>
  65. </view>
  66. <!-- 地址 -->
  67. <view class="topLine"></view>
  68. <view>
  69. <h4>企业地址</h4>
  70. <view class="ss-m-t-20" v-if="info?.business?.address">
  71. <uni-icons type="map-pin-ellipse" color="#00897B" size="20"></uni-icons>
  72. <span class="color-666 font-size-15">{{ info?.business?.address }}</span>
  73. </view>
  74. <view v-else></view>
  75. </view>
  76. <view class="topLine"></view>
  77. <!-- 企业相册 -->
  78. <view>
  79. <h4>企业相册</h4>
  80. <view class="ss-m-t-20" v-if="info?.albumList">
  81. <swiper class="swiper-box" :indicator-dots="true" indicator-active-color="#fff">
  82. <swiper-item v-for="(item ,index) in info?.albumList" :key="index" style="overflow-x:hidden;overflow-y: auto;">
  83. <image v-if="checkIsImage(item)" class="ac-imgs" :src="item" @click="previewImage(index)"></image>
  84. <video v-else :id="'albumListVideo'+index" class="ac-imgs" :src="item" @error="videoErrorCallback" controls></video>
  85. </swiper-item>
  86. </swiper>
  87. </view>
  88. <view v-else></view>
  89. </view>
  90. </view>
  91. <!-- 招聘岗位 -->
  92. <view v-if="current == 1">
  93. <scroll-view class="scrollBox defaultBgc" scroll-y="true" @scrolltolower="loadingMore">
  94. <view v-if="positionList.length > 0">
  95. <PositionList class="pb-10" :list="positionList" :noMore="false"></PositionList>
  96. <uni-load-more :status="status" />
  97. </view>
  98. <view v-else class="nodata-img-parents">
  99. <image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" class="nodata-img-child"></image>
  100. </view>
  101. </scroll-view>
  102. </view>
  103. </view>
  104. </template>
  105. <script setup>
  106. import { ref } from 'vue'
  107. import { onLoad } from '@dcloudio/uni-app'
  108. import { getEnterpriseDetails, enterpriseClick, getEnterpriseSubscribeCheck, getEnterpriseUnsubscribe, getEnterpriseSubscribe } from '@/api/user'
  109. import { dealDictObjData } from '@/utils/position'
  110. import { timesTampChange } from '@/utils/date'
  111. import { getJobAdvertisedSearch } from '@/api/position'
  112. import { getAccessToken } from '@/utils/request'
  113. import PositionList from '@/components/PositionList'
  114. import { checkIsImage } from '@/utils'
  115. const current = ref(0)
  116. const items = ['企业介绍', '招聘职位']
  117. const info = ref({})
  118. let id = ref(null)
  119. const business = [
  120. { name: '成立日期', value: 'establishmentTime' },
  121. { name: '注册资金', value: 'registeredCapital' },
  122. { name: '统一社会信用代码', value: 'code' },
  123. ]
  124. const status = ref('more')
  125. const queryParams = ref({
  126. pageNo: 1,
  127. pageSize: 10,
  128. enterpriseId: id.value
  129. })
  130. const positionList = ref([])
  131. // 预览
  132. const previewImage = (i) => {
  133. uni.previewImage({
  134. current: i,
  135. urls: info.value.albumList
  136. })
  137. }
  138. // 企业埋点
  139. const enterpriseClickFn = async () => {
  140. if (!id.value) return
  141. await enterpriseClick({ id: id.value })
  142. }
  143. enterpriseClickFn()
  144. // 效验求职者是否关注该企业
  145. const isCollection = ref(false)
  146. const getCollectionStatus = async () => {
  147. if (!getAccessToken()) return isCollection.value = false
  148. const data = await getEnterpriseSubscribeCheck({ enterpriseId: id.value })
  149. isCollection.value = data.data
  150. }
  151. // 关注&取消关注企业
  152. const handleFollow = async () => {
  153. if (!id.value) return
  154. const api = isCollection.value ? getEnterpriseUnsubscribe : getEnterpriseSubscribe
  155. await api(isCollection.value ? id.value : { enterpriseId: id.value })
  156. getCollectionStatus()
  157. }
  158. // 企业详情
  159. const getData = async () => {
  160. const { data } = await getEnterpriseDetails(id.value)
  161. info.value = data.enterprise ? { ...data, ...dealDictObjData({}, data.enterprise) } : data
  162. getCollectionStatus()
  163. }
  164. // 招聘职位列表
  165. const getPositionList = async () => {
  166. queryParams.value.enterpriseId = id.value
  167. const { data } = await getJobAdvertisedSearch(queryParams.value)
  168. const list = data?.list || []
  169. if (list?.length) {
  170. list.forEach(e => {
  171. e.job = { ...e.job, ...dealDictObjData({}, e.job) }
  172. e.enterprise = { ...e.enterprise, ...dealDictObjData({}, e.enterprise)}
  173. })
  174. positionList.value = positionList.value.concat(list)
  175. }
  176. status.value = list?.length < queryParams.value.pageSize ? 'noMore' : 'more'
  177. }
  178. const loadingMore = () => {
  179. status.value = 'loading'
  180. queryParams.value.pageNo++
  181. getPositionList()
  182. }
  183. onLoad((options) => {
  184. id.value = options?.id || ''
  185. if (id.value) {
  186. getData()
  187. }
  188. })
  189. const changeControl = (e) =>{
  190. current.value = e.currentIndex
  191. if (current.value === 0) getData()
  192. else getPositionList()
  193. }
  194. const videoErrorCallback = (e) =>{
  195. uni.showToast({
  196. title: e?.target?.errMsg || '播放错误',
  197. icon: 'none'
  198. })
  199. }
  200. </script>
  201. <style scoped lang="scss">
  202. .title-des {
  203. color: #37576c;
  204. font-size: 20px;
  205. margin-right: 30px;
  206. margin-top: 1px;
  207. vertical-align: middle;
  208. flex: 1;
  209. }
  210. .title-text{
  211. font-weight: 700;
  212. font-size: 18px;
  213. }
  214. .topLine {
  215. border-top: 1px solid #EDEDED;
  216. margin: 20px 0;
  217. }
  218. .swiper-box {
  219. height: 29vh;
  220. }
  221. .ac-imgs{
  222. width: 100%;
  223. height: 29vh;
  224. border-radius: 20px;
  225. }
  226. .collect-icon {
  227. position: absolute;
  228. top: 3px;
  229. right: 10px;
  230. }
  231. </style>