businessDetails.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. <!-- 企业详情 -->
  2. <template>
  3. <view class="business-details">
  4. <!-- 导航栏 -->
  5. <u-navbar title="企业详情" :background="background" title-color="#fff" back-icon-color="#fff" />
  6. <!-- 背景 -->
  7. <view class="business-details-bg"></view>
  8. <!-- 内容 -->
  9. <view class="business-details-content">
  10. <view class="business-details-content-logo">
  11. <image :src="companyInfo.logoUrl" mode=""></image>
  12. </view>
  13. <view class="business-details-content-name">{{ companyInfo.companyName }}</view>
  14. <!-- <view class="business-details-content-evaluate">
  15. <view class="left">
  16. <view class="evaluate">优秀</view>
  17. <view class="describe">综合评分</view>
  18. <view class="star">
  19. <u-icon name="star-fill" color="#EF651F"></u-icon>
  20. <u-icon name="star-fill" color="#EF651F"></u-icon>
  21. <u-icon name="star-fill" color="#EF651F"></u-icon>
  22. <u-icon name="star-fill" color="#EF651F"></u-icon>
  23. <u-icon name="star-fill" color="#EF651F"></u-icon>
  24. </view>
  25. <view class="grade">4.8</view>
  26. </view>
  27. <view class="right">
  28. 详情
  29. <u-icon class="icon" name="arrow-right" color="#666666"></u-icon>
  30. </view>
  31. </view> -->
  32. <!-- 公司概况 -->
  33. <view class="business-details-content-survey">
  34. <view class="title">公司概况</view>
  35. <view class="item">
  36. <view>公司全称:{{ companyInfo.companyName }}</view>
  37. <view>公司简称:{{ companyInfo.nickName }}</view>
  38. <view>所属行业:{{ getCompanyTradeName(companyInfo.trade) }}</view>
  39. <view>公司规模:{{ getCompanyScopeName(companyInfo.scope) }}</view>
  40. <view>联系方式:{{ companyInfo.linkPhone }}</view>
  41. <view class="address">
  42. <view>公司地址:{{ companyInfo.companyAddress }}</view>
  43. <view>
  44. <!-- <image src="../../static/img/dingwei.png"/>
  45. 查看位置 -->
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. <!-- 公司介绍 -->
  51. <view class="business-details-content-introduce">
  52. <view class="title">公司介绍</view>
  53. <view class="content">
  54. <view class="content" v-if="companyInfo.detatil">
  55. <u-parse :html="companyInfo.detatil" />
  56. </view>
  57. <u-empty v-else text="暂无公司介绍" mode="data"></u-empty>
  58. </view>
  59. </view>
  60. <!-- 公司相册 -->
  61. <view class="business-details-content-album">
  62. <view class="title">公司相册</view>
  63. <scroll-view scroll-x="true" class="pic" style="width: 100%; overflow:hidden; white-space: nowrap;"
  64. v-if="companyInfo.environmentUrlList && companyInfo.environmentUrlList.length > 0">
  65. <view class="pic-list">
  66. <view class="pic-list-item" v-for="(item, index) in companyInfo.environmentUrlList"
  67. :key="index">
  68. <u-image :src="item" mode="" height="206" @tap="picClick(index)" />
  69. </view>
  70. </view>
  71. </scroll-view>
  72. <u-empty v-else text="该公司暂未发布公司相册" mode="data"></u-empty>
  73. </view>
  74. <!-- 公司职位 -->
  75. <view class="business-details-content-position">
  76. <view class="title">公司职位</view>
  77. <view class="position-list" v-if="positionList.length > 0">
  78. <view class="position-list-item" v-for="(item, index) in positionList" :key="index"
  79. @click="jumpPage('/pages/jobDetails/jobDetails', { id: item.id })">
  80. <view class="left">
  81. <view class="logo">
  82. <u-image :src="item.companyLogoUrl" mode="aspectFill" width="112" height="112"
  83. border-radius="10" />
  84. </view>
  85. <view class="info">
  86. <view>{{ item.postName }}</view>
  87. <view>
  88. {{ `${ item.areaName ? item.areaName + ' |' : '' } 经验${item.workYear ? item.workYear + '年' : '不限'} | ${ getEducationBg(item.educationBg) || '' }` }}
  89. </view>
  90. <view>{{ item.companyName }}</view>
  91. </view>
  92. </view>
  93. <view class="right">
  94. <view>{{ `${item.lowestSalary || ''} ~ ${item.highestSalary || ''}k` }}</view>
  95. <view>{{ item.createTime ? item.createTime.split(' ')[0] : '-' }}</view>
  96. </view>
  97. </view>
  98. </view>
  99. <u-empty v-else text="该公司暂未发布职位" mode="data"></u-empty>
  100. </view>
  101. </view>
  102. <u-toast ref="uToast" />
  103. </view>
  104. </template>
  105. <script>
  106. export default {
  107. data() {
  108. return {
  109. background: {
  110. backgroundColor: '#3D5D4C'
  111. },
  112. // 公司id
  113. companyId: '',
  114. // 公司详情
  115. companyInfo: '',
  116. companyScopeList: [],
  117. companyTradeList: [],
  118. // 公司职位
  119. positionList: [],
  120. degrEducList: []
  121. }
  122. },
  123. onLoad(page) {
  124. this.getDict('company_scope');
  125. this.getDict('company_trade');
  126. this.getDict('degr_educ');
  127. if (page.id) {
  128. this.companyId = page.id
  129. }
  130. },
  131. onShow() {
  132. if (this.companyId) {
  133. this.getDetails(this.companyId)
  134. this.getCompanyPost(this.companyId, 1, 1000)
  135. } else {
  136. this.$refs.uToast.show({
  137. title: '参数不全!',
  138. type: 'warning'
  139. })
  140. }
  141. },
  142. methods: {
  143. /**
  144. * 获取教育等级名称
  145. * @param {Object} value
  146. */
  147. getEducationBg(value) {
  148. let name;
  149. this.degrEducList.forEach(item => {
  150. if (item.text == value) {
  151. name = item.label
  152. }
  153. })
  154. return name;
  155. },
  156. /**
  157. * 获取详情
  158. * @param { String } id 获取详情企业id
  159. */
  160. getDetails(id) {
  161. this.$u.api.company.getCompanyDetails({
  162. id: id
  163. }).then(res => {
  164. if (res.code === 200) {
  165. this.companyInfo = res.data
  166. } else {
  167. this.$refs.uToast.show({
  168. title: res.msg,
  169. type: 'error'
  170. })
  171. }
  172. }).catch((err) => {
  173. this.$refs.uToast.show({
  174. title: '系统异常!',
  175. type: 'error'
  176. })
  177. })
  178. },
  179. /**
  180. * 获取字典
  181. * company_scope 公司规模
  182. * company_trade 公司类型
  183. */
  184. getDict(key) {
  185. this.$u.api.getDictdataUrl({
  186. key: key
  187. }).then(res => {
  188. if (res.code === 200) {
  189. if (key === 'company_scope') {
  190. this.companyScopeList = res.data
  191. } else if (key === 'company_trade') {
  192. this.companyTradeList = res.data;
  193. } else if (key === 'degr_educ') {
  194. this.degrEducList = res.data;
  195. }
  196. }
  197. })
  198. },
  199. /**
  200. * @param {Object} val
  201. */
  202. getCompanyScopeName(val) {
  203. let name;
  204. this.companyScopeList.forEach(item => {
  205. if (Number(item.text) === Number(val)) {
  206. name = item.label
  207. }
  208. })
  209. return name;
  210. },
  211. /**
  212. * @param {Object} val
  213. */
  214. getCompanyTradeName(val) {
  215. let name;
  216. this.companyTradeList.forEach(item => {
  217. if (Number(item.text) === Number(val)) {
  218. name = item.label
  219. }
  220. })
  221. return name;
  222. },
  223. /**
  224. * @param {Object} url
  225. */
  226. getCompanyPost(id, pageNum, pageSize) {
  227. this.$u.api.company.getCompanyPostList({
  228. id,
  229. pageNum,
  230. pageSize
  231. }).then(res => {
  232. if (res.code === 200) {
  233. this.positionList = res.rows
  234. } else {
  235. this.$refs.uToast.show({
  236. title: res.msg,
  237. type: 'error'
  238. })
  239. }
  240. }).catch((err) => {
  241. this.$refs.uToast.show({
  242. title: '系统异常!',
  243. type: 'error'
  244. })
  245. })
  246. },
  247. /**
  248. * 跳转到指定页面
  249. */
  250. jumpPage(url, params) {
  251. this.$u.route({
  252. url,
  253. params
  254. })
  255. },
  256. /**
  257. * 图片预览
  258. * @param { Number } index
  259. */
  260. picClick(index) {
  261. uni.previewImage({
  262. current: index,
  263. urls: this.companyInfo.environmentUrlList
  264. })
  265. }
  266. }
  267. }
  268. </script>
  269. <style lang="scss" scoped>
  270. @import './businessDetails.scss';
  271. </style>