businessDetails.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  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;" v-if="companyInfo.environmentUrlList && companyInfo.environmentUrlList.length > 0">
  64. <view class="pic-list">
  65. <view class="pic-list-item" v-for="(item, index) in companyInfo.environmentUrlList" :key="index">
  66. <u-image :src="item" mode="" height="206" @tap="picClick(index)"/>
  67. </view>
  68. </view>
  69. </scroll-view>
  70. <u-empty v-else text="该公司暂未发布公司相册" mode="data"></u-empty>
  71. </view>
  72. <!-- 公司职位 -->
  73. <view class="business-details-content-position">
  74. <view class="title">公司职位</view>
  75. <view class="position-list" v-if="positionList.length > 0">
  76. <view
  77. class="position-list-item"
  78. v-for="(item, index) in positionList"
  79. :key="index"
  80. @click="jumpPage('/pages/jobDetails/jobDetails', { id: item.id })"
  81. >
  82. <view class="left">
  83. <view class="logo">
  84. <image :src="item.companyLogoUrl" mode=""></image>
  85. </view>
  86. <view class="info">
  87. <view>{{ item.postName }}</view>
  88. <view>{{ `${item.workPlace} | 经验${item.workYear ? item.workYear + '年' : '不限'} | ${item.educationBg}` }}</view>
  89. <view>{{ item.workPlace }}</view>
  90. </view>
  91. </view>
  92. <view class="right">
  93. <view>{{ `${item.lowestSalary || ''} ~ ${item.highestSalary || ''}k` }}</view>
  94. <view>{{ item.createTime ? item.createTime.split(' ')[0] : '-' }}</view>
  95. </view>
  96. </view>
  97. </view>
  98. <u-empty v-else text="该公司暂未发布职位" mode="data"></u-empty>
  99. </view>
  100. </view>
  101. <u-toast ref="uToast" />
  102. </view>
  103. </template>
  104. <script>
  105. export default {
  106. data() {
  107. return {
  108. background: {
  109. backgroundColor: 'transparent'
  110. },
  111. // 公司id
  112. companyId: '',
  113. // 公司详情
  114. companyInfo: '',
  115. companyScopeList: [],
  116. companyTradeList: [],
  117. // 公司职位
  118. positionList: []
  119. }
  120. },
  121. onLoad(page) {
  122. this.getDict('company_scope');
  123. this.getDict('company_trade');
  124. if (page.id) {
  125. this.companyId = page.id
  126. }
  127. },
  128. onShow() {
  129. if (this.companyId) {
  130. this.getDetails(this.companyId)
  131. this.getCompanyPost(this.companyId, 1, 1000)
  132. } else {
  133. this.$refs.uToast.show({
  134. title: '参数不全!',
  135. type: 'warning'
  136. })
  137. }
  138. },
  139. methods: {
  140. /**
  141. * 获取详情
  142. * @param { String } id 获取详情企业id
  143. */
  144. getDetails(id) {
  145. this.$u.api.company.getCompanyDetails({
  146. id: id
  147. }).then(res => {
  148. if (res.code === 200) {
  149. this.companyInfo = res.data
  150. } else {
  151. this.$refs.uToast.show({
  152. title: res.msg,
  153. type: 'error'
  154. })
  155. }
  156. }).catch((err) => {
  157. this.$refs.uToast.show({
  158. title: '系统异常!',
  159. type: 'error'
  160. })
  161. })
  162. },
  163. /**
  164. * 获取字典
  165. * company_scope 公司规模
  166. * company_trade 公司类型
  167. */
  168. getDict(key) {
  169. this.$u.api.getDictdataUrl({
  170. key: key
  171. }).then(res => {
  172. if (res.code === 200) {
  173. if (key === 'company_scope') {
  174. this.companyScopeList = res.data
  175. } else if (key === 'company_trade') {
  176. this.companyTradeList = res.data;
  177. }
  178. }
  179. })
  180. },
  181. /**
  182. * @param {Object} val
  183. */
  184. getCompanyScopeName(val) {
  185. let name;
  186. this.companyScopeList.forEach(item => {
  187. if (Number(item.text) === Number(val)) {
  188. name = item.label
  189. }
  190. })
  191. return name;
  192. },
  193. /**
  194. * @param {Object} val
  195. */
  196. getCompanyTradeName(val) {
  197. let name;
  198. this.companyTradeList.forEach(item => {
  199. if (Number(item.text) === Number(val)) {
  200. name = item.label
  201. }
  202. })
  203. return name;
  204. },
  205. /**
  206. * @param {Object} url
  207. */
  208. getCompanyPost(id, pageNum, pageSize) {
  209. this.$u.api.company.getCompanyPostList({ id, pageNum, pageSize}).then(res => {
  210. if (res.code === 200) {
  211. this.positionList = res.rows
  212. } else {
  213. this.$refs.uToast.show({
  214. title: res.msg,
  215. type: 'error'
  216. })
  217. }
  218. }).catch((err) => {
  219. this.$refs.uToast.show({
  220. title: '系统异常!',
  221. type: 'error'
  222. })
  223. })
  224. },
  225. /**
  226. * 跳转到指定页面
  227. */
  228. jumpPage(url, params) {
  229. this.$u.route({
  230. url,
  231. params
  232. })
  233. },
  234. /**
  235. * 图片预览
  236. * @param { Number } index
  237. */
  238. picClick(index) {
  239. uni.previewImage({
  240. current: index,
  241. urls: this.companyInfo.environmentUrlList
  242. })
  243. }
  244. }
  245. }
  246. </script>
  247. <style lang="scss" scoped>
  248. @import './businessDetails.scss';
  249. </style>