myJobInformation.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  1. <template>
  2. <view>
  3. <u-navbar back-text="求职信息" back-icon-size="28" back-icon-color="#ffffff"
  4. :background="{backgroundColor: '#2795FD',}" :back-text-style="{color: '#ffffff'}"></u-navbar>
  5. <view class="main">
  6. <!-- 个人信息 -->
  7. <view class="person-infos">
  8. <view class="infos">
  9. <view class="name">
  10. 许慕
  11. </view>
  12. <view class="gender-age">
  13. <text class="text">女</text>|
  14. <text class="text">28</text>
  15. </view>
  16. </view>
  17. <view class="photo" @click="uploadPhoto">
  18. <u-avatar :src="src" size="120" mode="circle"></u-avatar>
  19. <img class="camera" src="@/assets/img/riFill-camera-fill Copy@1x.png" alt="">
  20. </view>
  21. </view>
  22. <u-select v-model="show" value-name="value" label-name="name"
  23. :list="list" @confirm="confirm"></u-select>
  24. <!-- 信息填写 -->
  25. <view class="information-group">
  26. <!-- 联系电话 -->
  27. <view class="item">
  28. <view class="title">
  29. 联系电话
  30. </view>
  31. <view class="input">
  32. {{tel}}
  33. </view>
  34. </view>
  35. <!-- 意向行业 -->
  36. <view class="item">
  37. <view class="title">
  38. 意向行业
  39. </view>
  40. <view class="input">
  41. <u-input type="select" v-model="intendedIndustries" @click="showselect(0)" placeholder="请选择意向行业"></u-input>
  42. </view>
  43. </view>
  44. <!--意向岗位 -->
  45. <view class="item">
  46. <view class="title">
  47. 意向岗位
  48. </view>
  49. <view class="input">
  50. <u-input type="text" v-model="formData.intendedPosition"
  51. placeholder="请填写想找的工作岗位"></u-input>
  52. </view>
  53. </view>
  54. <!-- 期望薪资 -->
  55. <view class="item">
  56. <view class="title">
  57. 期望薪资
  58. </view>
  59. <view class="input2">
  60. <u-input type="number" v-model="formData.hopeSalary"
  61. placeholder="请填写期望薪资"></u-input>
  62. </view>
  63. <view class="unit">
  64. 元/天
  65. </view>
  66. </view>
  67. <!-- 结算方式 -->
  68. <view class="item">
  69. <view class="title">
  70. 结算方式
  71. </view>
  72. <view class="input">
  73. <u-input type="select" v-model="method"
  74. @click="showselect(1)" placeholder="请选择结算方式"></u-input>
  75. </view>
  76. </view>
  77. <!-- 工作经验 -->
  78. <view class="item">
  79. <view class="title">
  80. 工作经验
  81. </view>
  82. <view class="input">
  83. <u-input type="select" v-model="workExperience"
  84. @click="showselect(2)" placeholder="请选择工作经验"></u-input>
  85. </view>
  86. </view>
  87. <!-- 学历 -->
  88. <view class="item">
  89. <view class="title">
  90. 学历
  91. </view>
  92. <view class="input">
  93. <u-input type="select" v-model="education"
  94. @click="showselect(3)" placeholder="请选择学历"></u-input>
  95. </view>
  96. </view>
  97. </view>
  98. </view>
  99. <view class="service-description">
  100. <view class="title">
  101. <text>*</text>服务描述
  102. </view>
  103. <textarea class="textarea" v-model="formData.serviceDesc"
  104. placeholder="请描述您能提供哪些服务,或者是您擅长的,有助于您更快、更准确的找到工作。"></textarea>
  105. </view>
  106. <button class="save" @click="submit"
  107. type="default">保存</button>
  108. </view>
  109. </template>
  110. <script>
  111. import * as API_weixin from '@/apis/weixin.js'
  112. import * as API from '@/apis/pagejs/packages.js'
  113. export default {
  114. data() {
  115. return {
  116. src: '',
  117. tel: '15011110000',
  118. show: false,
  119. list: [],
  120. formData:{
  121. id:"",
  122. intendedIndustries:"",
  123. intendedPosition:"",
  124. hopeSalary:"",
  125. method:"",
  126. workExperience:"",
  127. education:"",
  128. serviceDesc:"",
  129. photo:"",
  130. },
  131. intendedIndustries:"",
  132. method:"",
  133. workExperience:"",
  134. education:"",
  135. sqlList:[[],[],[],[],[],[],[]],
  136. valueList:[-1,-1,-1,-1,-1,-1],
  137. selectIndex:0,
  138. form: {},
  139. userInfo:{}
  140. }
  141. },
  142. onLoad(){
  143. this.userInfo=this.carhelp.getPersonInfo()
  144. this.tel=this.userInfo.phone
  145. this.myJobHunt()
  146. },
  147. methods: {
  148. myJobHunt(){
  149. uni.showLoading({
  150. title: "加载中",
  151. mask: true,
  152. })
  153. API.myJobHunt().then((res) => {
  154. uni.hideLoading()
  155. if(res.data.jobInformationInfo){
  156. this.formData = res.data.jobInformationInfo;
  157. var name=["intendedIndustries","method",
  158. "workExperience","education",]
  159. for(var i in name){
  160. console.log(name[i]+'N')
  161. this[name[i]]=this.formData[(name[i]+'N')]
  162. }
  163. this.src= this.formData.photo
  164. }
  165. }).catch(error => {
  166. uni.showToast({
  167. title: error,
  168. icon: "none"
  169. })
  170. })
  171. },
  172. submit(){
  173. uni.showLoading({
  174. title: "加载中",
  175. mask: true,
  176. })
  177. this.formData.photo=this.src
  178. API.createJobHunt(this.formData).then((res) => {
  179. uni.hideLoading();
  180. uni.showModal({
  181. title: '提示',
  182. content: '操作成功',
  183. showCancel:false,
  184. success: function (res) {
  185. if (res.confirm) {
  186. uni.navigateBack()
  187. } else if (res.cancel) {
  188. console.log('用户点击取消');
  189. }
  190. }
  191. });
  192. }).catch(error => {
  193. uni.showToast({
  194. title: error
  195. })
  196. //this.getPhone()
  197. })
  198. },
  199. showselect(k){
  200. this.selectIndex=k;
  201. if(this.sqlList[k].length==0){
  202. var name=['意向行业','结算方式','工作经验','学历']
  203. uni.showLoading({
  204. title: "加载中",
  205. mask: true,
  206. })
  207. API_weixin.findListByCatalogName({
  208. name:name[k],
  209. }).then((res) => {
  210. uni.hideLoading();
  211. this.sqlList[k]=res.data.dictionaryList
  212. this.list=this.sqlList[k];
  213. this.show= true
  214. }).catch(error => {
  215. uni.showToast({
  216. title: error
  217. })
  218. //this.getPhone()
  219. })
  220. }else{
  221. this.list=this.sqlList[k];
  222. this.show= true
  223. }
  224. },
  225. saveRecordConfirmMethod(fileData) {
  226. var token = this.carhelp.getToken()
  227. uni.uploadFile({
  228. url: process.car.BASE_URL + "uploadPicture", //仅为示例,非真实的接口地址
  229. filePath:fileData,
  230. header: {
  231. 'Authorization': token,
  232. //'Content-Type': 'multipart/form-data',
  233. 'X-Requested-With': 'XMLHttpRequest',
  234. // 'content-type': 'multipart/form-data'
  235. },
  236. name: 'photoFile',
  237. formData: {
  238. subFolder: "headimg"
  239. },
  240. success: (uploadFileRes) => {
  241. var obj = JSON.parse(uploadFileRes.data)
  242. console.log(obj);
  243. this.src = obj.data;
  244. // uni.hideLoading();
  245. }
  246. });
  247. },
  248. confirm(e) {
  249. this.show = false;
  250. var name=["intendedIndustries","method",
  251. "workExperience","education",]
  252. this[name[this.selectIndex]]=e[0].label
  253. this.formData[name[this.selectIndex]]=e[0].value
  254. console.log(e)
  255. },
  256. uploadPhoto() {
  257. let _self = this;
  258. const crop = {
  259. quality: 100,
  260. width: 600,
  261. height: 600,
  262. resize: true
  263. };
  264. // 上传图片
  265. uni.chooseImage({
  266. count: 1,
  267. crop,
  268. success: async (res) => {
  269. //(res);
  270. let tempFile = res.tempFiles[0];
  271. var filePath = res.tempFilePaths[0]
  272. let fileData = await new Promise((callback) => {
  273. uni.navigateTo({
  274. url: './cropImage?path=' + filePath +
  275. `&options=${JSON.stringify(crop)}`,
  276. animationType: "fade-in",
  277. events: {
  278. success: url => {
  279. callback(url)
  280. }
  281. }
  282. });
  283. })
  284. this.saveRecordConfirmMethod(fileData);
  285. }
  286. });
  287. },
  288. }
  289. }
  290. </script>
  291. <style>
  292. page {
  293. background: #F0F0F2;
  294. padding-bottom: 150px;
  295. }
  296. </style>
  297. <style lang="scss" scoped>
  298. .main {
  299. margin: 24rpx 32rpx;
  300. background-color: #fff;
  301. padding: 40rpx 32rpx 0;
  302. border-radius: 12px;
  303. .person-infos {
  304. display: flex;
  305. justify-content: space-between;
  306. .infos {
  307. .name {
  308. color: rgba(51, 51, 51, 1);
  309. font-size: 20px;
  310. font-family: 'PingFangSC-medium';
  311. }
  312. .gender-age {
  313. color: rgba(119, 119, 119, 1);
  314. margin-top: 8rpx;
  315. .text {
  316. margin: 0 8rpx;
  317. }
  318. .text:nth-of-type(1) {
  319. margin-left: 0;
  320. }
  321. }
  322. }
  323. .photo {
  324. position: relative;
  325. img {
  326. width: 60px;
  327. height: 60px;
  328. }
  329. .camera {
  330. width: 48rpx;
  331. height: 48rpx;
  332. position: absolute;
  333. top: 36rpx;
  334. left: 36rpx;
  335. z-index: 999;
  336. }
  337. }
  338. }
  339. .information-group {
  340. .item {
  341. display: flex;
  342. align-items: center;
  343. padding: 12rpx 0;
  344. border-bottom: 1px solid #f1f1f1;
  345. .title {
  346. color: rgba(51, 51, 51, 1);
  347. font-size: 32rpx;
  348. width: 140rpx;
  349. }
  350. .input2 {
  351. width: 360rpx;
  352. margin-left: 24rpx;
  353. /deep/.uni-input-input {
  354. color: rgba(51, 51, 51, 1);
  355. }
  356. }
  357. .input {
  358. width: 460rpx;
  359. margin-left: 24rpx;
  360. /deep/.uni-input-input {
  361. color: rgba(51, 51, 51, 1);
  362. }
  363. }
  364. .icon {
  365. margin-left: auto;
  366. }
  367. .unit {
  368. margin-left: auto;
  369. color: #333333;
  370. font-size: 24rpx;
  371. }
  372. }
  373. }
  374. }
  375. // 服务描述
  376. .service-description {
  377. margin: 24rpx 32rpx;
  378. background-color: #fff;
  379. border-radius: 12px;
  380. padding: 24rpx 32rpx;
  381. .title {
  382. color: #333333;
  383. font-size: 18px;
  384. font-family: 'PingFangSC-medium';
  385. }
  386. text {
  387. color: #FF0000;
  388. }
  389. .textarea {
  390. margin-top: 24rpx;
  391. line-height: 40rpx;
  392. width: 100%;
  393. height: 240rpx;
  394. }
  395. }
  396. .save {
  397. background-color: rgba(34, 149, 255, 1);
  398. color: rgba(241, 241, 241, 1);
  399. font-size: 18px;
  400. height: 96rpx;
  401. line-height: 96rpx;
  402. border-radius: 50px;
  403. position: fixed;
  404. left: 32rpx;
  405. right: 32rpx;
  406. bottom: 20rpx;
  407. z-index: 999;
  408. }
  409. </style>