completeMsg.vue 9.5 KB

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