businessDetails.vue 6.6 KB

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