index.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  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 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" v-if="info?.industryName && info?.scaleName"> | </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. </view>
  66. </view>
  67. </view>
  68. <view v-else></view>
  69. </view>
  70. <!-- 地址 -->
  71. <view class="topLine"></view>
  72. <view>
  73. <h4>企业地址</h4>
  74. <view class="ss-m-t-20" v-if="info?.business?.address">
  75. <uni-icons type="map-pin-ellipse" color="#00897B" size="20"></uni-icons>
  76. <span class="color-666 font-size-15">{{ info?.business?.address }}</span>
  77. </view>
  78. <view v-else></view>
  79. </view>
  80. <view class="topLine"></view>
  81. <!-- 企业相册 -->
  82. <view>
  83. <h4>企业相册</h4>
  84. <view class="ss-m-t-20" v-if="info?.albumList">
  85. <swiper class="swiper-box" :indicator-dots="true" indicator-active-color="#fff">
  86. <swiper-item v-for="(item ,index) in info?.albumList" :key="index" style="overflow-x:hidden;overflow-y: auto;">
  87. <image class="ac-imgs" :src="item" @click="previewImage(index)"></image>
  88. </swiper-item>
  89. </swiper>
  90. </view>
  91. <view v-else></view>
  92. </view>
  93. </view>
  94. <!-- 招聘岗位 -->
  95. <view v-if="current == 1">
  96. <scroll-view class="scrollBox defaultBgc" scroll-y="true" @scrolltolower="loadingMore">
  97. <view v-if="positionList.length > 0">
  98. <PositionList class="pb-10" :list="positionList" :noMore="false"></PositionList>
  99. <uni-load-more :status="status" />
  100. </view>
  101. <view v-else class="nodata-img-parents">
  102. <image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" class="nodata-img-child"></image>
  103. </view>
  104. </scroll-view>
  105. </view>
  106. </view>
  107. </template>
  108. <script setup>
  109. import { ref, computed } from 'vue'
  110. import { onLoad } from '@dcloudio/uni-app'
  111. import { getEnterpriseDetails, enterpriseClick, getEnterpriseSubscribeCheck, getEnterpriseUnsubscribe, getEnterpriseSubscribe, getEnterpriseAuthDetails } from '@/api/user'
  112. import { dealDictObjData } from '@/utils/position'
  113. import { timesTampChange } from '@/utils/date'
  114. import { getJobAdvertisedSearch } from '@/api/position'
  115. import { getAccessToken } from '@/utils/request'
  116. import PositionList from '@/components/PositionList'
  117. const current = ref(0)
  118. const items = ['企业介绍', '招聘职位']
  119. const info = ref({})
  120. let id = ref(null)
  121. const business = [
  122. { name: '成立日期', value: 'establishmentTime' },
  123. { name: '注册资金', value: 'registeredCapital' },
  124. { name: '统一社会信用代码', value: 'code' },
  125. ]
  126. const status = ref('more')
  127. const queryParams = ref({
  128. pageNo: 1,
  129. pageSize: 10,
  130. enterpriseId: id.value
  131. })
  132. const positionList = ref([])
  133. // const authInfo = ref({})
  134. // const statusList = [
  135. // { label: '未认证', color: '#fb8c00', value: null, mdi: 'icon-dunpai1' },
  136. // { label: '审核中', color: '#fb8c00', value: '0', mdi: 'icon-dunpai' },
  137. // { label: '已认证', color: '#00897B', value: '1', mdi: 'icon-mn_dunpai_fill' },
  138. // { label: '已驳回', color: '#fe574a', value: '2', mdi: 'icon-hongsedunpai' }
  139. // ]
  140. // 预览
  141. const previewImage = (i) => {
  142. uni.previewImage({
  143. current: i,
  144. urls: info.value.albumList
  145. })
  146. }
  147. // const statusInfo = computed(() => {
  148. // const obj = (authInfo.value && Object.keys(authInfo.value).length) ? statusList.find(e => e.value === authInfo.value.status) : statusList[0]
  149. // return obj
  150. // })
  151. // 企业埋点
  152. const enterpriseClickFn = async () => {
  153. if (!id.value) return
  154. await enterpriseClick({ id: id.value })
  155. }
  156. enterpriseClickFn()
  157. // 效验求职者是否关注该企业
  158. const isCollection = ref(false)
  159. const getCollectionStatus = async () => {
  160. if (!getAccessToken()) return isCollection.value = false
  161. const data = await getEnterpriseSubscribeCheck({ enterpriseId: id.value })
  162. isCollection.value = data.data
  163. }
  164. // 关注&取消关注企业
  165. const handleFollow = async () => {
  166. if (!id.value) return
  167. const api = isCollection.value ? getEnterpriseUnsubscribe : getEnterpriseSubscribe
  168. await api(isCollection.value ? id.value : { enterpriseId: id.value })
  169. getCollectionStatus()
  170. }
  171. // 企业认证详情
  172. // const getEnterpriseAuthInfo = async () => {
  173. // const { data } = await getEnterpriseAuthDetails(id.value)
  174. // authInfo.value = data
  175. // }
  176. // 企业详情
  177. const getData = async () => {
  178. const { data } = await getEnterpriseDetails(id.value)
  179. info.value = data.enterprise ? { ...data, ...dealDictObjData({}, data.enterprise) } : data
  180. getCollectionStatus()
  181. // getEnterpriseAuthInfo()
  182. }
  183. // 招聘职位列表
  184. const getPositionList = async () => {
  185. queryParams.value.enterpriseId = id.value
  186. const { data } = await getJobAdvertisedSearch(queryParams.value)
  187. const list = data?.list || []
  188. if (list?.length) {
  189. list.forEach(e => {
  190. e.job = { ...e.job, ...dealDictObjData({}, e.job) }
  191. e.enterprise = { ...e.enterprise, ...dealDictObjData({}, e.enterprise)}
  192. })
  193. positionList.value = positionList.value.concat(list)
  194. }
  195. status.value = list?.length < queryParams.value.pageSize ? 'noMore' : 'more'
  196. }
  197. const loadingMore = () => {
  198. status.value = 'loading'
  199. queryParams.value.pageNo++
  200. getPositionList()
  201. }
  202. onLoad((options) => {
  203. id.value = options?.id || ''
  204. if (id.value) {
  205. getData()
  206. }
  207. })
  208. const changeControl = (e) =>{
  209. current.value = e.currentIndex
  210. if (current.value === 0) getData()
  211. else getPositionList()
  212. }
  213. </script>
  214. <style scoped lang="scss">
  215. .title-des {
  216. color: #37576c;
  217. font-size: 20px;
  218. margin-right: 30px;
  219. margin-top: 1px;
  220. vertical-align: middle;
  221. flex: 1;
  222. }
  223. .title-text{
  224. font-weight: 700;
  225. font-size: 18px;
  226. }
  227. .topLine {
  228. border-top: 1px solid #EDEDED;
  229. margin: 20px 0;
  230. }
  231. .swiper-box {
  232. height: 29vh;
  233. }
  234. .ac-imgs{
  235. width: 100%;
  236. height: 29vh;
  237. border-radius: 20px;
  238. }
  239. .collect-icon {
  240. position: absolute;
  241. top: 3px;
  242. right: 10px;
  243. }
  244. </style>