businessDetails.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  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" 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 slot="error">
  90. <u-image src="../../static/img/default-company.png" width="112" height="112" border-radius="10"/>
  91. </view>
  92. </u-image>
  93. </view>
  94. <view class="info">
  95. <view>{{ item.postName }}</view>
  96. <view>
  97. {{ `${ item.areaName ? item.areaName + ' |' : '' } 经验${item.workYear ? item.workYear + '年' : '不限'} | ${ getEducationBg(item.educationBg) || '' }` }}
  98. </view>
  99. <view>{{ item.companyName }}</view>
  100. </view>
  101. </view>
  102. <view class="right">
  103. <view>{{ `${item.lowestSalary || ''} ~ ${item.highestSalary || ''}k` }}</view>
  104. <view>{{ item.createTime ? item.createTime.split(' ')[0] : '-' }}</view>
  105. </view>
  106. </view>
  107. </view>
  108. <u-empty v-else text="该公司暂未发布职位" mode="data"></u-empty>
  109. </view>
  110. </view>
  111. <u-toast ref="uToast" />
  112. </view>
  113. </template>
  114. <script>
  115. export default {
  116. data() {
  117. return {
  118. background: {
  119. backgroundColor: '#3D5D4C'
  120. },
  121. // 公司id
  122. companyId: '',
  123. // 公司详情
  124. companyInfo: '',
  125. companyScopeList: [],
  126. companyTradeList: [],
  127. // 公司职位
  128. positionList: [],
  129. degrEducList: []
  130. }
  131. },
  132. onLoad(page) {
  133. this.getDict('company_scope');
  134. this.getDict('company_trade');
  135. this.getDict('degr_educ');
  136. if (page.id) {
  137. this.companyId = page.id
  138. }
  139. },
  140. onShow() {
  141. if (this.companyId) {
  142. this.getDetails(this.companyId)
  143. this.getCompanyPost(this.companyId, 1, 1000)
  144. } else {
  145. this.$refs.uToast.show({
  146. title: '参数不全!',
  147. type: 'warning'
  148. })
  149. }
  150. },
  151. methods: {
  152. /**
  153. * 获取教育等级名称
  154. * @param {Object} value
  155. */
  156. getEducationBg(value) {
  157. let name;
  158. this.degrEducList.forEach(item => {
  159. if (item.text == value) {
  160. name = item.label
  161. }
  162. })
  163. return name;
  164. },
  165. /**
  166. * 获取详情
  167. * @param { String } id 获取详情企业id
  168. */
  169. getDetails(id) {
  170. this.$u.api.company.getCompanyDetails({
  171. id: id
  172. }).then(res => {
  173. if (res.code === 200) {
  174. this.companyInfo = res.data
  175. } else {
  176. this.$refs.uToast.show({
  177. title: res.msg,
  178. type: 'error'
  179. })
  180. }
  181. }).catch((err) => {
  182. this.$refs.uToast.show({
  183. title: '系统异常!',
  184. type: 'error'
  185. })
  186. })
  187. },
  188. /**
  189. * 获取字典
  190. * company_scope 公司规模
  191. * company_trade 公司类型
  192. */
  193. getDict(key) {
  194. this.$u.api.getDictdataUrl({
  195. key: key
  196. }).then(res => {
  197. if (res.code === 200) {
  198. if (key === 'company_scope') {
  199. this.companyScopeList = res.data
  200. } else if (key === 'company_trade') {
  201. this.companyTradeList = res.data;
  202. } else if (key === 'degr_educ') {
  203. this.degrEducList = res.data;
  204. }
  205. }
  206. })
  207. },
  208. /**
  209. * @param {Object} val
  210. */
  211. getCompanyScopeName(val) {
  212. let name;
  213. this.companyScopeList.forEach(item => {
  214. if (Number(item.text) === Number(val)) {
  215. name = item.label
  216. }
  217. })
  218. return name;
  219. },
  220. /**
  221. * @param {Object} val
  222. */
  223. getCompanyTradeName(val) {
  224. let name;
  225. this.companyTradeList.forEach(item => {
  226. if (Number(item.text) === Number(val)) {
  227. name = item.label
  228. }
  229. })
  230. return name;
  231. },
  232. /**
  233. * @param {Object} url
  234. */
  235. getCompanyPost(id, pageNum, pageSize) {
  236. this.$u.api.company.getCompanyPostList({
  237. id,
  238. pageNum,
  239. pageSize
  240. }).then(res => {
  241. if (res.code === 200) {
  242. this.positionList = res.rows
  243. } else {
  244. this.$refs.uToast.show({
  245. title: res.msg,
  246. type: 'error'
  247. })
  248. }
  249. }).catch((err) => {
  250. this.$refs.uToast.show({
  251. title: '系统异常!',
  252. type: 'error'
  253. })
  254. })
  255. },
  256. /**
  257. * 跳转到指定页面
  258. */
  259. jumpPage(url, params) {
  260. this.$u.route({
  261. url,
  262. params
  263. })
  264. },
  265. /**
  266. * 图片预览
  267. * @param { Number } index
  268. */
  269. picClick(index) {
  270. uni.previewImage({
  271. current: index,
  272. urls: this.companyInfo.environmentUrlList
  273. })
  274. }
  275. }
  276. }
  277. </script>
  278. <style lang="scss" scoped>
  279. @import './businessDetails.scss';
  280. </style>