businessDetails.vue 7.5 KB

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