completeMsg.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  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.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. },
  64. methods: {
  65. goUploadImg() {
  66. uni.navigateTo({
  67. url: "/package/jobIntention/companyImg"
  68. });
  69. },
  70. goCompanyReview() {
  71. if (this.isok) {
  72. uni.navigateTo({
  73. url: "/package/jobIntention/companyReview",
  74. });
  75. }
  76. return uni.showToast({
  77. title: "请补全资料",
  78. icon: "none"
  79. });
  80. },
  81. // 选择头像
  82. chooseAvatar() {
  83. var that = this
  84. uni.chooseImage({
  85. count: 1,
  86. sizeType: ["compressed"],
  87. sourceType: ["album", "camera"],
  88. success: (res) => {
  89. that.$queue.uploadFile(res.tempFilePaths[0], function(path) {
  90. console.log("上传返回?:", path)
  91. if (path){
  92. that.avatar = path;
  93. }
  94. })
  95. },
  96. });
  97. },
  98. //提交hr 信息
  99. submithr() {
  100. // 验证必填项
  101. if (!this.avatar) {
  102. return uni.showToast({
  103. title: "请上传头像",
  104. icon: "none"
  105. });
  106. }
  107. if (!this.name) {
  108. return uni.showToast({
  109. title: "请输入职务",
  110. icon: "none"
  111. });
  112. }
  113. // 构造提交数据
  114. const data = {
  115. hrImg: this.avatar, //头像
  116. hrPosition: this.name, //职位
  117. };
  118. // 调用接口提交
  119. uni.showLoading({
  120. title: "提交中..."
  121. });
  122. this.$Request.postJson("/app/HrFirst/addHr", data)
  123. .then((res) => {
  124. uni.hideLoading();
  125. if (res.code === 0) {
  126. this.isok = true
  127. uni.showToast({
  128. title: "提交成功,请开始招聘吧。",
  129. icon: "success"
  130. });
  131. // uni.navigateTo({
  132. // url: "/package/jobIntention/companyReview",
  133. // });
  134. uni.switchTab({
  135. url:'/pages/index/index'
  136. })
  137. } else {
  138. uni.showToast({
  139. title: res.msg || "提交失败",
  140. icon: "none"
  141. });
  142. }
  143. })
  144. .catch((err) => {
  145. uni.hideLoading();
  146. console.error("提交失败:", err);
  147. uni.showToast({
  148. title: "网络异常",
  149. icon: "none"
  150. });
  151. });
  152. },
  153. //获取我发布的岗位列表
  154. getmypost() {
  155. this.$Request.get("/app/postPush/getMyPostPush",{status:""})
  156. .then((res) => {
  157. if (res.code != 0) {
  158. uni.showToast({
  159. title: res.msg || "查询失败",
  160. icon: "none"
  161. });
  162. return;
  163. }
  164. this.userpost = res.data.records || {};
  165. this.name=this.userpost[0].hr.hrPosition || ""
  166. this.avatar=this.userpost[0].hr.hrImg || ""
  167. console.log("查询我的岗位列表状态", res)
  168. })
  169. .catch((err) => {
  170. console.error("查询失败:", err);
  171. uni.showToast({
  172. title: "网络异常",
  173. icon: "none"
  174. });
  175. });
  176. }
  177. },
  178. };
  179. </script>
  180. <style scoped lang="scss">
  181. .company {
  182. position: absolute;
  183. left: 0;
  184. right: 0;
  185. top: 0;
  186. bottom: 0;
  187. display: flex;
  188. flex-direction: column;
  189. font-family: DM Sans;
  190. .company-content {
  191. flex: 1;
  192. padding: 40rpx;
  193. box-sizing: border-box;
  194. overflow: hidden;
  195. overflow-y: auto;
  196. .company-title {
  197. color: #333;
  198. font-size: 40rpx;
  199. font-weight: 600;
  200. margin-bottom: 20rpx;
  201. }
  202. .form-label {
  203. color: #1f2c37;
  204. font-family: DM Sans;
  205. font-size: 28rpx;
  206. font-weight: 500;
  207. line-height: 44rpx;
  208. padding-top: 30rpx;
  209. padding-bottom: 27rpx;
  210. box-sizing: border-box;
  211. }
  212. .avatar-section {
  213. display: flex;
  214. }
  215. .avatar-upload {
  216. display: flex;
  217. align-items: center;
  218. }
  219. .avatar-preview {
  220. width: 48rpx;
  221. height: 48rpx;
  222. border-radius: 50%;
  223. display: flex;
  224. align-items: center;
  225. justify-content: center;
  226. margin-right: 20rpx;
  227. }
  228. .avatar-image {
  229. width: 100%;
  230. height: 100%;
  231. border-radius: 50%;
  232. }
  233. .upload-view {
  234. color: #016bf6;
  235. font-family: DM Sans;
  236. font-size: 20rpx;
  237. font-weight: 500;
  238. line-height: 48rpx;
  239. }
  240. .form-item {
  241. padding-bottom: 24rpx;
  242. box-sizing: border-box;
  243. .job-txt {
  244. color: #016bf6;
  245. font-family: DM Sans;
  246. font-size: 20rpx;
  247. margin-left: 16rpx;
  248. }
  249. .form-border {
  250. box-sizing: border-box;
  251. border: 1rpx solid rgba(227, 231, 236, 1);
  252. border-radius: 12rpx;
  253. background: rgba(253, 253, 253, 1);
  254. padding: 36rpx;
  255. box-sizing: border-box;
  256. .form-border-top {
  257. display: flex;
  258. justify-content: space-between;
  259. align-items: center;
  260. .form-border-title {
  261. color: rgba(23, 23, 37, 1);
  262. font-family: DM Sans;
  263. font-size: 32rpx;
  264. font-weight: 700;
  265. line-height: 48rpx;
  266. }
  267. .form-border-money {
  268. color: #016bf6;
  269. font-family: DM Sans;
  270. font-size: 24rpx;
  271. font-weight: 700;
  272. line-height: 40rpx;
  273. }
  274. }
  275. .form-border-desc {
  276. color: rgba(156, 164, 171, 1);
  277. font-family: DM Sans;
  278. font-size: 24rpx;
  279. font-weight: 400;
  280. line-height: 40rpx;
  281. padding: 6rpx 0;
  282. box-sizing: border-box;
  283. }
  284. .form-border-img-name {
  285. display: flex;
  286. align-items: center;
  287. gap: 8rpx;
  288. .people-img {
  289. image {
  290. width: 40rpx;
  291. height: 40rpx;
  292. }
  293. }
  294. .people-name {
  295. color: rgba(156, 164, 171, 1);
  296. font-family: DM Sans;
  297. font-size: 16rpx;
  298. font-weight: 400;
  299. }
  300. }
  301. }
  302. }
  303. .form-item:last-child {
  304. border-bottom: none;
  305. }
  306. .form-label {
  307. color: #1f2c37;
  308. font-family: DM Sans;
  309. font-size: 28rpx;
  310. font-weight: 500;
  311. line-height: 44rpx;
  312. padding-top: 30rpx;
  313. padding-bottom: 27rpx;
  314. box-sizing: border-box;
  315. }
  316. .form-input {
  317. flex: 1;
  318. box-sizing: border-box;
  319. border: 2rpx solid #9ea1a8;
  320. border-radius: 100rpx;
  321. background: rgba(255, 255, 255, 1);
  322. padding: 0rpx 24rpx !important;
  323. }
  324. }
  325. .bottom-btn {
  326. border-radius: 999px;
  327. background: rgba(255, 102, 0, 1);
  328. display: flex;
  329. justify-content: center;
  330. align-items: center;
  331. color: rgba(255, 255, 255, 1);
  332. font-family: DM Sans;
  333. font-size: 32rpx;
  334. font-weight: 400;
  335. line-height: 48rpx;
  336. padding: 16rpx 32rpx;
  337. box-sizing: border-box;
  338. }
  339. }
  340. ::v-deep .u-input {
  341. text-align: left !important;
  342. }
  343. </style>