businessDetails.vue 5.7 KB

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