completeMsg.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. <template>
  2. <view class="company">
  3. <nav-bar title="完善信息" color="#000"></nav-bar>
  4. <view class="company-content">
  5. <view class="company-title">完善你的招聘名片</view>
  6. <view class="company-desc">求职者更愿意主动联系名片信息完整的HR</view>
  7. <!-- 头像上传区域 -->
  8. <view class="form-label">头像</view>
  9. <view class="avatar-section">
  10. <view class="avatar-upload" @click="chooseAvatar">
  11. <view class="avatar-preview">
  12. <image v-if="avatar" :src="avatar" class="avatar-image" mode="aspectFill"></image>
  13. <image v-else src="@/static/images/jobApplicant/touxiang.svg" mode="scaleToFill"
  14. class="user-img" />
  15. </view>
  16. <view class="upload-view">上传头像</view>
  17. </view>
  18. </view>
  19. <!-- 姓名 -->
  20. <view class="form-item">
  21. <view class="form-label">填写职务</view>
  22. <u-input placeholder="真实的职务,更能赢得牛人的信任" v-model="name" :border="false" class="form-input"></u-input>
  23. </view>
  24. <view class="form-item">
  25. <view class="form-label">求职者视角中的效果</view>
  26. <view class="form-border" v-for="(item, inx) in userpost" :key="inx">
  27. <view class="form-border-top">
  28. <view class="form-border-title">{{item.ruleClassifyName}}</view>
  29. <view class="form-border-money">{{item.salaryRange}}</view>
  30. </view>
  31. <view class="form-border-desc">{{item.companyName}}{{item.companyPeople}}人</view>
  32. <view class="form-border-img-name">
  33. <view class="people-img">
  34. <image v-if="item.hr!=null && item.hr.hrImg" :src="item.hr.hrImg" class="avatar-image"
  35. mode="aspectFill"></image>
  36. <image v-else src="@/static/images/jobApplicant/touxiang.svg" mode="scaleToFill"
  37. class="user-img" />
  38. </view>
  39. <view class="people-name">{{item.hr?item.hr.hrPosition:"无"}} 招聘者</view>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="bottom-btn" @click="submithr">开始招聘</view>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. import navBar from "@/components/nav-bar/index.vue";
  49. export default {
  50. data() {
  51. return {
  52. avatar: "",
  53. name: "",
  54. isok: false,
  55. userpost: {}
  56. };
  57. },
  58. components: {
  59. navBar,
  60. },
  61. onShow() {
  62. this.getmypost()
  63. this.HrFirst()
  64. },
  65. methods: {
  66. goUploadImg() {
  67. uni.navigateTo({
  68. url: "/package/jobIntention/companyImg"
  69. });
  70. },
  71. goCompanyReview() {
  72. if (this.isok) {
  73. uni.navigateTo({
  74. url: "/package/jobIntention/companyReview",
  75. });
  76. }
  77. return uni.showToast({
  78. title: "请补全资料",
  79. icon: "none"
  80. });
  81. },
  82. // 选择头像
  83. chooseAvatar() {
  84. var that = this
  85. uni.chooseImage({
  86. count: 1,
  87. sizeType: ["compressed"],
  88. sourceType: ["album", "camera"],
  89. success: (res) => {
  90. that.$queue.uploadFile(res.tempFilePaths[0], function(path) {
  91. console.log("上传返回?:", path)
  92. if (path){
  93. that.avatar = path;
  94. }
  95. })
  96. },
  97. });
  98. },
  99. //提交hr 信息
  100. submithr() {
  101. // 验证必填项
  102. if (!this.avatar) {
  103. return uni.showToast({
  104. title: "请上传头像",
  105. icon: "none"
  106. });
  107. }
  108. if (!this.name) {
  109. return uni.showToast({
  110. title: "请输入职务",
  111. icon: "none"
  112. });
  113. }
  114. // 构造提交数据
  115. const data = {
  116. hrImg: this.avatar, //头像
  117. hrPosition: this.name, //职位
  118. };
  119. // 调用接口提交
  120. uni.showLoading({
  121. title: "提交中..."
  122. });
  123. this.$Request.postJson("/app/HrFirst/addHr", data)
  124. .then((res) => {
  125. uni.hideLoading();
  126. if (res.code === 0) {
  127. this.isok = true
  128. uni.showToast({
  129. title: "提交成功,请开始招聘吧。",
  130. icon: "success"
  131. });
  132. // uni.navigateTo({
  133. // url: "/package/jobIntention/companyReview",
  134. // });
  135. uni.switchTab({
  136. url:'/pages/index/index'
  137. })
  138. } else {
  139. uni.showToast({
  140. title: res.msg || "提交失败",
  141. icon: "none"
  142. });
  143. }
  144. })
  145. .catch((err) => {
  146. uni.hideLoading();
  147. console.error("提交失败:", err);
  148. uni.showToast({
  149. title: "网络异常",
  150. icon: "none"
  151. });
  152. });
  153. },
  154. //获取我发布的岗位列表
  155. getmypost() {
  156. this.$Request.get("/app/postPush/getMyPostPush",{status:""})
  157. .then((res) => {
  158. if (res.code != 0) {
  159. uni.showToast({
  160. title: res.msg || "查询失败",
  161. icon: "none"
  162. });
  163. return;
  164. }
  165. this.userpost = res.data.records || {};
  166. if(this.userpost[0].hr){
  167. this.name=this.userpost[0].hr.hrPosition || ""
  168. this.avatar=this.userpost[0].hr.hrImg || ""
  169. }
  170. console.log("查询我的岗位列表状态", res)
  171. })
  172. .catch((err) => {
  173. console.error("查询失败:", err);
  174. uni.showToast({
  175. title: "网络异常",
  176. icon: "none"
  177. });
  178. });
  179. },
  180. //Hr 名片
  181. HrFirst() {
  182. this.$Request.get("/app/HrFirst","")
  183. .then((res) => {
  184. if (res.code != 0) {
  185. uni.showToast({
  186. title: res.msg || "查询失败",
  187. icon: "none"
  188. });
  189. return;
  190. }
  191. console.log("Hr 名片", res)
  192. })
  193. .catch((err) => {
  194. console.error("查询失败:", err);
  195. uni.showToast({
  196. title: "网络异常",
  197. icon: "none"
  198. });
  199. });
  200. },
  201. },
  202. };
  203. </script>
  204. <style scoped lang="scss">
  205. .company {
  206. position: absolute;
  207. left: 0;
  208. right: 0;
  209. top: 0;
  210. bottom: 0;
  211. display: flex;
  212. flex-direction: column;
  213. font-family: DM Sans;
  214. .company-content {
  215. flex: 1;
  216. padding: 40rpx;
  217. box-sizing: border-box;
  218. overflow: hidden;
  219. overflow-y: auto;
  220. .company-title {
  221. color: #333;
  222. font-size: 40rpx;
  223. font-weight: 600;
  224. margin-bottom: 20rpx;
  225. }
  226. .form-label {
  227. color: #1f2c37;
  228. font-family: DM Sans;
  229. font-size: 28rpx;
  230. font-weight: 500;
  231. line-height: 44rpx;
  232. padding-top: 30rpx;
  233. padding-bottom: 27rpx;
  234. box-sizing: border-box;
  235. }
  236. .avatar-section {
  237. display: flex;
  238. }
  239. .avatar-upload {
  240. display: flex;
  241. align-items: center;
  242. }
  243. .avatar-preview {
  244. width: 48rpx;
  245. height: 48rpx;
  246. border-radius: 50%;
  247. display: flex;
  248. align-items: center;
  249. justify-content: center;
  250. margin-right: 20rpx;
  251. }
  252. .avatar-image {
  253. width: 100%;
  254. height: 100%;
  255. border-radius: 50%;
  256. }
  257. .upload-view {
  258. color: #016bf6;
  259. font-family: DM Sans;
  260. font-size: 20rpx;
  261. font-weight: 500;
  262. line-height: 48rpx;
  263. }
  264. .form-item {
  265. padding-bottom: 24rpx;
  266. box-sizing: border-box;
  267. .job-txt {
  268. color: #016bf6;
  269. font-family: DM Sans;
  270. font-size: 20rpx;
  271. margin-left: 16rpx;
  272. }
  273. .form-border {
  274. box-sizing: border-box;
  275. border: 1rpx solid rgba(227, 231, 236, 1);
  276. border-radius: 12rpx;
  277. background: rgba(253, 253, 253, 1);
  278. padding: 36rpx;
  279. box-sizing: border-box;
  280. .form-border-top {
  281. display: flex;
  282. justify-content: space-between;
  283. align-items: center;
  284. .form-border-title {
  285. color: rgba(23, 23, 37, 1);
  286. font-family: DM Sans;
  287. font-size: 32rpx;
  288. font-weight: 700;
  289. line-height: 48rpx;
  290. }
  291. .form-border-money {
  292. color: #016bf6;
  293. font-family: DM Sans;
  294. font-size: 24rpx;
  295. font-weight: 700;
  296. line-height: 40rpx;
  297. }
  298. }
  299. .form-border-desc {
  300. color: rgba(156, 164, 171, 1);
  301. font-family: DM Sans;
  302. font-size: 24rpx;
  303. font-weight: 400;
  304. line-height: 40rpx;
  305. padding: 6rpx 0;
  306. box-sizing: border-box;
  307. }
  308. .form-border-img-name {
  309. display: flex;
  310. align-items: center;
  311. gap: 8rpx;
  312. .people-img {
  313. image {
  314. width: 40rpx;
  315. height: 40rpx;
  316. }
  317. }
  318. .people-name {
  319. color: rgba(156, 164, 171, 1);
  320. font-family: DM Sans;
  321. font-size: 16rpx;
  322. font-weight: 400;
  323. }
  324. }
  325. }
  326. }
  327. .form-item:last-child {
  328. border-bottom: none;
  329. }
  330. .form-label {
  331. color: #1f2c37;
  332. font-family: DM Sans;
  333. font-size: 28rpx;
  334. font-weight: 500;
  335. line-height: 44rpx;
  336. padding-top: 30rpx;
  337. padding-bottom: 27rpx;
  338. box-sizing: border-box;
  339. }
  340. .form-input {
  341. flex: 1;
  342. box-sizing: border-box;
  343. border: 2rpx solid #9ea1a8;
  344. border-radius: 100rpx;
  345. background: rgba(255, 255, 255, 1);
  346. padding: 0rpx 24rpx !important;
  347. }
  348. }
  349. .bottom-btn {
  350. border-radius: 999px;
  351. background: rgba(255, 102, 0, 1);
  352. display: flex;
  353. justify-content: center;
  354. align-items: center;
  355. color: rgba(255, 255, 255, 1);
  356. font-family: DM Sans;
  357. font-size: 32rpx;
  358. font-weight: 400;
  359. line-height: 48rpx;
  360. padding: 16rpx 32rpx;
  361. box-sizing: border-box;
  362. }
  363. }
  364. ::v-deep .u-input {
  365. text-align: left !important;
  366. }
  367. </style>