index.vue 9.1 KB

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