businessLicense.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. <template>
  2. <view class="switch-roles">
  3. <view class="roles-content">
  4. <view class="content">
  5. <view class="title">Hi,欢迎加入亿职赞</view>
  6. <view class="desc">填写企业信息,开启高效招聘方式</view>
  7. <view class="title-second">公司营业执照名称</view>
  8. <view class="input-box">
  9. <u-input
  10. placeholder="请输入您所属公司营业执照上的公司名称"
  11. v-model="companyName"
  12. clearable
  13. class="custom-input"
  14. maxlength="46"
  15. @input="handleInput"
  16. >
  17. <template #prefix>
  18. <u-icon name="phone" size="36rpx" color="#999" marginRight="20rpx"></u-icon>
  19. </template>
  20. </u-input>
  21. <view class="word-count" style="margin-right: 20rpx; color: #999; font-size: 22rpx;">
  22. {{ currentLength }} / 46
  23. </view>
  24. </view>
  25. <view class="join-btn" @click="handleJoinCompany">加入已认证的公司</view>
  26. <view class="desc-txt">
  27. <view class="desc-txt-item">注意事项:</view>
  28. <view class="desc-txt-item">1.请输入您所述公司营业执照上的公司名称</view>
  29. <view class="desc-txt-item"
  30. >2.公司名称将用于后续企业认证环节,请确保准确性</view
  31. >
  32. </view>
  33. <image src="@/static/images/my/join-yzz.svg" mode="scaleToFill" />
  34. </view>
  35. </view>
  36. <view class="fixed-section">
  37. <u-button type="primary" class="submit-btn" @click="goPeopleNumber">下一步</u-button>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. import navBar from "@/components/nav-bar/index.vue";
  43. export default {
  44. data() {
  45. return {
  46. companyName: '',
  47. currentLength: 0,
  48. loading: false,
  49. };
  50. },
  51. components: {
  52. navBar,
  53. },
  54. watch: {
  55. companyName: {
  56. immediate: true,
  57. handler(val) {
  58. this.currentLength = val.length;
  59. }
  60. }
  61. },
  62. methods: {
  63. goPeopleNumber(){
  64. console.log(this.companyName)
  65. if(this.companyName&& this.currentLength>6){
  66. // uni.navigateTo({ url: '/pages/my/peopleNumber?companyName='+this.companyName})
  67. this.createCompany()
  68. }else{
  69. uni.showToast({
  70. title: '请完整输入营业执照名称',
  71. icon :"none",
  72. duration: 2000
  73. });
  74. }
  75. },
  76. // 处理输入事件,更新字数统计
  77. handleInput(value) {
  78. this.currentLength = value.length;
  79. },
  80. // 创建公司
  81. createCompany() {
  82. if (this.loading) return
  83. this.loading = true
  84. uni.showLoading({
  85. title: '创建中'
  86. })
  87. this.$Request
  88. .postJson('/app/company/insertCompany', {
  89. companyAllName: this.companyName,
  90. companyPeople: '',
  91. })
  92. .then(res => {
  93. if (res.code === 0) {
  94. // 跳转至招聘岗位页面
  95. uni.navigateTo({
  96. url: `/pages/my/jobPosting?companyName=${this.companyName}&companyId=${res.data.companyId}&isBack=${false}&status=${res.data.status}`
  97. })
  98. } else {
  99. uni.showToast({
  100. title: res.msg || '提交失败,请重试',
  101. icon: 'none'
  102. })
  103. }
  104. uni.hideLoading()
  105. this.loading = false
  106. })
  107. .catch(() => {
  108. uni.hideLoading()
  109. this.loading = false
  110. uni.showToast({
  111. title: '网络异常,请稍后重试',
  112. icon: 'none'
  113. })
  114. })
  115. },
  116. // 加入公司
  117. handleJoinCompany() {
  118. uni.navigateTo({
  119. url: '/pages/my/joinCompany'
  120. })
  121. }
  122. },
  123. };
  124. </script>
  125. <style lang="scss" scoped>
  126. @import '@/common.scss';
  127. .input-box{
  128. width: 100%;
  129. padding: 16rpx 0 32rpx 0;
  130. box-sizing: border-box;
  131. position: relative;
  132. }
  133. ::v-deep .u-input {
  134. text-align: left !important;
  135. }
  136. ::v-deep .u-input__suffix {
  137. /* 确保插槽区域不被压缩 */
  138. display: flex;
  139. align-items: center;
  140. }
  141. .custom-input {
  142. width: 100%;
  143. box-sizing: border-box;
  144. border: 2rpx solid rgba(158, 161, 168, 1);
  145. border-radius: 100rpx;
  146. background: rgba(255, 255, 255, 1);
  147. padding: 0rpx 24rpx !important;
  148. }
  149. /* 字数统计样式 */
  150. .word-count {
  151. position: absolute;
  152. right: 0;
  153. color: #999;
  154. font-size: 22rpx;
  155. font-family: DM Sans;
  156. top: 30%;
  157. }
  158. ::v-deep .u-input {
  159. text-align: left !important;
  160. }
  161. .custom-input {
  162. width: 100%;
  163. box-sizing: border-box;
  164. border: 2rpx solid rgba(158, 161, 168, 1);
  165. border-radius: 100rpx;
  166. background: rgba(255, 255, 255, 1);
  167. padding: 0rpx 24rpx !important;
  168. padding-right: 80rpx !important; /* 右侧留空避免文字被字数统计覆盖 */
  169. }
  170. .switch-roles {
  171. position: absolute;
  172. left: 0;
  173. right: 0;
  174. top: 0;
  175. bottom: 0;
  176. padding: 60rpx;
  177. padding-top: 80rpx;
  178. display: flex;
  179. flex-direction: column;
  180. .roles-content {
  181. width: 100%;
  182. flex: 1;
  183. overflow: hidden;
  184. overflow-y: auto;
  185. box-sizing: border-box;
  186. .content {
  187. padding-top: 60rpx;
  188. box-sizing: border-box;
  189. display: flex;
  190. flex-direction: column;
  191. align-items: center;
  192. justify-content: center;
  193. .title {
  194. width: 100%;
  195. color: rgba(29, 33, 41, 1);
  196. font-family: DM Sans;
  197. font-size: 36rpx;
  198. font-weight: 800;
  199. line-height: 44rpx;
  200. text-align: left;
  201. }
  202. .desc {
  203. width: 100%;
  204. color: rgba(102, 102, 102, 1);
  205. font-family: DM Sans;
  206. font-size: 28rpx;
  207. font-weight: 400;
  208. line-height: 32rpx;
  209. text-align: left;
  210. padding: 22rpx 0;
  211. box-sizing: border-box;
  212. }
  213. .title-second {
  214. width: 100%;
  215. color: #1f2c37;
  216. font-family: DM Sans;
  217. font-size: 30rpx;
  218. font-weight: 600;
  219. line-height: 44rpx;
  220. text-align: left;
  221. }
  222. .desc-txt {
  223. width: 100%;
  224. color: rgba(102, 102, 102, 1);
  225. font-family: DM Sans;
  226. font-size: 28rpx;
  227. font-weight: 400;
  228. line-height: 32rpx;
  229. text-align: left;
  230. .desc-txt-item {
  231. margin-top: 8rpx;
  232. }
  233. }
  234. image {
  235. margin-top: 106rpx;
  236. width: 550rpx;
  237. height: 550rpx;
  238. }
  239. }
  240. }
  241. .next-btn {
  242. border-radius: 999px;
  243. background: rgba(255, 102, 0, 1);
  244. padding: 16rpx 32rpx;
  245. box-sizing: border-box;
  246. color: rgba(255, 255, 255, 1);
  247. font-family: DM Sans;
  248. font-size: 32rpx;
  249. font-weight: 400;
  250. line-height: 48rpx;
  251. display: flex;
  252. justify-content: center;
  253. align-items: center;
  254. }
  255. }
  256. .join-btn {
  257. width: 100%;
  258. color: rgba(1, 107, 246, 1);
  259. font-size: 32rpx;
  260. line-height: 1;
  261. margin-bottom: 32rpx;
  262. }
  263. </style>