businessDetails.vue 8.2 KB

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