joinCompany.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <view class="page-container">
  3. <cTop></cTop>
  4. <view class="content">
  5. <view class="title">Hi,欢迎加入亿职赞</view>
  6. <view class="desc">填写企业信息,开启高效招聘方式</view>
  7. <view class="sub-title">公司名称</view>
  8. <view class="select-bar flex align-center justify-between" @click="handleToSelectPage">
  9. <view class="name" v-if="companyName">{{ companyName }}</view>
  10. <view class="placeholder" v-else>请输入关键字搜索,选择已经认证的公司</view>
  11. <u-icon name="arrow-down" color="rgba(198, 197, 202, 1)"></u-icon>
  12. </view>
  13. <image src="/static/images/company.png" class="company-bg"></image>
  14. </view>
  15. <view class="fixed-section">
  16. <u-button type="primary" class="submit-btn" @click="handleNext">下一步</u-button>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. import cTop from '@/components/c-top.vue'
  22. export default {
  23. components: {
  24. cTop
  25. },
  26. data() {
  27. return {
  28. companyName: '',
  29. companyId: '',
  30. loading: false
  31. };
  32. },
  33. onLoad() {
  34. uni.$on('selectCompany', data => {
  35. this.companyId = data.companyId
  36. this.companyName = data.companyName
  37. })
  38. },
  39. onUnload() {
  40. uni.$off('selectCompany')
  41. },
  42. methods: {
  43. handleToSelectPage() {
  44. uni.navigateTo({
  45. url: '/pages/my/searchCompanys'
  46. })
  47. },
  48. handleNext() {
  49. if (this.companyId) {
  50. this.createCompany()
  51. } else {
  52. uni.showToast({
  53. title: '请选择公司',
  54. icon :"none",
  55. duration: 2000
  56. });
  57. }
  58. },
  59. // 创建公司
  60. createCompany() {
  61. if (this.loading) return
  62. this.loading = true
  63. uni.showLoading({
  64. title: '创建中'
  65. })
  66. this.$Request
  67. .postJson('/app/company/insertCompany', {
  68. companyId: this.companyId
  69. })
  70. .then(res => {
  71. if (res.code === 0) {
  72. // 跳转至招聘岗位页面
  73. uni.navigateTo({
  74. url: `/pages/my/jobPosting?companyName=${this.companyName}&companyId=${res.data.companyId}&isBack=${false}&status=${res.data.status}`
  75. })
  76. } else {
  77. uni.showToast({
  78. title: res.msg || '提交失败,请重试',
  79. icon: 'none'
  80. })
  81. }
  82. uni.hideLoading()
  83. this.loading = false
  84. })
  85. .catch(() => {
  86. uni.hideLoading()
  87. this.loading = false
  88. uni.showToast({
  89. title: '网络异常,请稍后重试',
  90. icon: 'none'
  91. })
  92. })
  93. }
  94. }
  95. }
  96. </script>
  97. <style lang="scss" scoped>
  98. @import '@/common.scss';
  99. .page-container {
  100. font-family: DM Sans;
  101. .content {
  102. padding: 60rpx 40rpx;
  103. .title {
  104. color: rgba(29, 33, 41, 1);
  105. font-size: 36rpx;
  106. font-weight: 500;
  107. line-height: 44rpx;
  108. margin-bottom: 20rpx;
  109. }
  110. .desc {
  111. color: rgba(102, 102, 102, 1);
  112. font-size: 24rpx;
  113. font-weight: 400;
  114. line-height: 32rpx;
  115. margin-bottom: 20rpx;
  116. }
  117. .sub-title {
  118. color: rgba(31, 44, 55, 1);
  119. font-size: 28rpx;
  120. font-weight: 500;
  121. line-height: 44rpx;
  122. margin-bottom: 16rpx;
  123. }
  124. .select-bar {
  125. padding: 32rpx 44rpx;
  126. border-radius: 6px;
  127. box-shadow: 0px 8px 150px 0px rgba(0, 0, 0, 0.06);
  128. background: rgba(255, 255, 255, 1);
  129. line-height: 40rpx;
  130. .placeholder {
  131. color: rgba(153, 153, 153, 1);
  132. }
  133. }
  134. .company-bg {
  135. display: block;
  136. width: 550rpx;
  137. height: 550rpx;
  138. margin: 200rpx auto 100rpx;
  139. }
  140. }
  141. }
  142. </style>