index.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  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="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 v-if="checkIsImage(item)" class="ac-imgs" :src="item" @click="previewImage(index)"></image>
  88. <video v-else :id="'albumListVideo'+index" class="ac-imgs" :src="item" @error="videoErrorCallback" controls></video>
  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. import { checkIsImage } from '@/utils'
  119. const current = ref(0)
  120. const items = ['企业介绍', '招聘职位']
  121. const info = ref({})
  122. let id = ref(null)
  123. const business = [
  124. { name: '成立日期', value: 'establishmentTime' },
  125. { name: '注册资金', value: 'registeredCapital' },
  126. { name: '统一社会信用代码', value: 'code' },
  127. ]
  128. const status = ref('more')
  129. const queryParams = ref({
  130. pageNo: 1,
  131. pageSize: 10,
  132. enterpriseId: id.value
  133. })
  134. const positionList = ref([])
  135. // const authInfo = ref({})
  136. // const statusList = [
  137. // { label: '未认证', color: '#fb8c00', value: null, mdi: 'icon-dunpai1' },
  138. // { label: '审核中', color: '#fb8c00', value: '0', mdi: 'icon-dunpai' },
  139. // { label: '已认证', color: '#00897B', value: '1', mdi: 'icon-mn_dunpai_fill' },
  140. // { label: '已驳回', color: '#fe574a', value: '2', mdi: 'icon-hongsedunpai' }
  141. // ]
  142. // 预览
  143. const previewImage = (i) => {
  144. uni.previewImage({
  145. current: i,
  146. urls: info.value.albumList
  147. })
  148. }
  149. // const statusInfo = computed(() => {
  150. // const obj = (authInfo.value && Object.keys(authInfo.value).length) ? statusList.find(e => e.value === authInfo.value.status) : statusList[0]
  151. // return obj
  152. // })
  153. // 企业埋点
  154. const enterpriseClickFn = async () => {
  155. if (!id.value) return
  156. await enterpriseClick({ id: id.value })
  157. }
  158. enterpriseClickFn()
  159. // 效验求职者是否关注该企业
  160. const isCollection = ref(false)
  161. const getCollectionStatus = async () => {
  162. if (!getAccessToken()) return isCollection.value = false
  163. const data = await getEnterpriseSubscribeCheck({ enterpriseId: id.value })
  164. isCollection.value = data.data
  165. }
  166. // 关注&取消关注企业
  167. const handleFollow = async () => {
  168. if (!id.value) return
  169. const api = isCollection.value ? getEnterpriseUnsubscribe : getEnterpriseSubscribe
  170. await api(isCollection.value ? id.value : { enterpriseId: id.value })
  171. getCollectionStatus()
  172. }
  173. // 企业认证详情
  174. // const getEnterpriseAuthInfo = async () => {
  175. // const { data } = await getEnterpriseAuthDetails(id.value)
  176. // authInfo.value = data
  177. // }
  178. // 企业详情
  179. const getData = async () => {
  180. const { data } = await getEnterpriseDetails(id.value)
  181. info.value = data.enterprise ? { ...data, ...dealDictObjData({}, data.enterprise) } : data
  182. getCollectionStatus()
  183. // getEnterpriseAuthInfo()
  184. }
  185. // 招聘职位列表
  186. const getPositionList = async () => {
  187. queryParams.value.enterpriseId = id.value
  188. const { data } = await getJobAdvertisedSearch(queryParams.value)
  189. const list = data?.list || []
  190. if (list?.length) {
  191. list.forEach(e => {
  192. e.job = { ...e.job, ...dealDictObjData({}, e.job) }
  193. e.enterprise = { ...e.enterprise, ...dealDictObjData({}, e.enterprise)}
  194. })
  195. positionList.value = positionList.value.concat(list)
  196. }
  197. status.value = list?.length < queryParams.value.pageSize ? 'noMore' : 'more'
  198. }
  199. const loadingMore = () => {
  200. status.value = 'loading'
  201. queryParams.value.pageNo++
  202. getPositionList()
  203. }
  204. onLoad((options) => {
  205. id.value = options?.id || ''
  206. if (id.value) {
  207. getData()
  208. }
  209. })
  210. const changeControl = (e) =>{
  211. current.value = e.currentIndex
  212. if (current.value === 0) getData()
  213. else getPositionList()
  214. }
  215. const videoErrorCallback = (e) =>{
  216. uni.showToast({
  217. title: e?.target?.errMsg || '播放错误',
  218. icon: 'none'
  219. })
  220. }
  221. </script>
  222. <style scoped lang="scss">
  223. .title-des {
  224. color: #37576c;
  225. font-size: 20px;
  226. margin-right: 30px;
  227. margin-top: 1px;
  228. vertical-align: middle;
  229. flex: 1;
  230. }
  231. .title-text{
  232. font-weight: 700;
  233. font-size: 18px;
  234. }
  235. .topLine {
  236. border-top: 1px solid #EDEDED;
  237. margin: 20px 0;
  238. }
  239. .swiper-box {
  240. height: 29vh;
  241. }
  242. .ac-imgs{
  243. width: 100%;
  244. height: 29vh;
  245. border-radius: 20px;
  246. }
  247. .collect-icon {
  248. position: absolute;
  249. top: 3px;
  250. right: 10px;
  251. }
  252. </style>