perfect.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807
  1. 1<template>
  2. <view class="content vflex jbetween">
  3. <view >
  4. <view class="box" v-show="index == '1'">
  5. <view class="hflex acenter jbetween cell">
  6. <view class="label">头像</view>
  7. <u-avatar :src="base_info.avatar" @click="uploadAvatar"></u-avatar>
  8. </view>
  9. <view class="cell">
  10. <view class="label">真实姓名</view>
  11. <u-input v-model="base_info.name" border="none" placeholder="请填写你的真实姓名"></u-input>
  12. </view>
  13. <view class="cell">
  14. <view class="label">性别</view>
  15. <view class="hflex">
  16. <view v-for="(item,index) in sexList" :key="index" style="padding-right: 52rpx;">
  17. <radio :value="item.value" :checked="base_info.sex == item.name?true:false" color="#506dff" @click="selectSex(item.value)" />{{item.name}}
  18. </view>
  19. </view>
  20. </view>
  21. <view class="cell">
  22. <view class="label">出生年月</view>
  23. <view @click="open('birthday')">
  24. <u-input v-model="base_info.date_birth" disabled disabledColor="#fff" border="none" placeholder="请选择你的出生年月" suffixIcon="arrow-right"></u-input>
  25. </view>
  26. <u-datetime-picker :minDate="minDate" :maxDate="maxDate" title="生日" :show="birthday_show" v-model="newDate" ref="datetimePicker" @confirm="confirmAge" @cancel="cancel" :formatter="formatter" mode="date"></u-datetime-picker>
  27. </view>
  28. <view class="cell">
  29. <view class="label">学历</view>
  30. <view @click="open('education')">
  31. <u-input v-model="base_info.edu" disabled disabledColor="#fff" border="none" placeholder="如:本科" suffixIcon="arrow-right"></u-input>
  32. </view>
  33. <u-picker title="学历" :show="education_show" :columns="educationList" ref="uPicker" @confirm="confirmEdu" @cancel="cancel" ></u-picker>
  34. </view>
  35. <view class="cell">
  36. <view class="label">参加工作时间</view>
  37. <view @click="open('work_date')">
  38. <u-input v-model="base_info.start_working_time" disabled disabledColor="#fff" border="none" placeholder="请选择参加工作的时间" suffixIcon="arrow-right"></u-input>
  39. </view>
  40. <u-datetime-picker :minDate="minDate" title="参加工作时间" :show="work_show" v-model="newDate" ref="datetimePicker" @confirm="confirmWork" @cancel="cancel" :formatter="formatter" mode="year-month"></u-datetime-picker>
  41. </view>
  42. <view class="cell">
  43. <view class="label">手机号码</view>
  44. <u-input v-model="base_info.phone" border="none" placeholder="请填写你的手机号码"></u-input>
  45. </view>
  46. <view class="cell">
  47. <view class="label">邮箱</view>
  48. <u-input v-model="base_info.email" border="none" placeholder="用于接收面试邮件"></u-input>
  49. </view>
  50. </view>
  51. <view class="box" v-if="index == '2'">
  52. <view class="cell">
  53. <view class="label">应聘岗位</view>
  54. <u-input v-model="job_inte.post" border="none" placeholder="请填写你应聘的岗位"></u-input>
  55. </view>
  56. <view class="cell">
  57. <view class="label">可工作地区范围</view>
  58. <u-input v-model="job_inte.work_address" border="none" placeholder="请填写工作地区范围"></u-input>
  59. </view>
  60. <view class="cell">
  61. <view class="label">期望薪资</view>
  62. <view @click="open('salary')">
  63. <u-input v-model="job_inte.salary" disabled disabledColor="#fff" border="none" placeholder="请选择期望薪资" suffixIcon="arrow-right"></u-input>
  64. </view>
  65. <u-picker :show="salary_show" title="期望薪资" ref="uPicker" :columns="salaryList" @confirm="confirmSalary" @cancel="cancel"></u-picker>
  66. </view>
  67. <view class="cell">
  68. <view class="label">可工作时间</view>
  69. <u-input v-model="job_inte.work_time" border="none" placeholder="请输入工作时间比如12小时/天"></u-input>
  70. </view>
  71. <view class="cell">
  72. <view class="label">工作性质</view>
  73. <view @click="open('work_nature')">
  74. <u-input v-model="job_inte.work_nature" disabled disabledColor="#fff" border="none" placeholder="请选择用工性质" suffixIcon="arrow-right"></u-input>
  75. </view>
  76. <u-picker :show="nature_show" title="工作性质" ref="uPicker" :columns="natureList" @confirm="confirmNature" @cancel="cancel"></u-picker>
  77. </view>
  78. </view>
  79. <view class="box" v-if="index == '3'">
  80. <view class="cell">
  81. <view class="label">公司名称</view>
  82. <u-input v-model="experience.content.company_name" border="none" placeholder="请输入"></u-input>
  83. </view>
  84. <view class="cell">
  85. <view class="label">职位名称</view>
  86. <u-input v-model="experience.content.position_name" border="none" placeholder="请输入"></u-input>
  87. </view>
  88. <view class="cell">
  89. <view class="label">在职时间</view>
  90. <view class="hflex acenter jbetween">
  91. <view @click="open('time1')">
  92. <u-input v-model="experience.content.on_job_start" disabled disabledColor="#fff" border="none" placeholder="入职时间"></u-input>
  93. </view>
  94. <u-datetime-picker :minDate="minDate" :maxDate="maxDate2" title="入职时间" :show="show_time1" v-model="newDate" ref="datetimePicker" @confirm="confirmTime1" @cancel="cancel" :formatter="formatter" mode="year-month"></u-datetime-picker>
  95. <view style="margin: 0 20rpx;">-</view>
  96. <view @click="open('time2')">
  97. <u-input v-model="experience.content.on_job_end" disabled disabledColor="#fff" border="none" placeholder="离职时间"></u-input>
  98. </view>
  99. <u-datetime-picker :maxDate="maxDate2" title="离职时间" :show="show_time2" v-model="newDate" ref="datetimePicker" @confirm="confirmTime2" @cancel="cancel" :formatter="formatter" mode="year-month"></u-datetime-picker>
  100. </view>
  101. </view>
  102. <view class="cell">
  103. <view class="label">工作内容</view>
  104. <u-input v-model="experience.content.job_description" border="none" placeholder="请详细描述你在公司的主要工作内容以及…"></u-input>
  105. </view>
  106. </view>
  107. <view class="box" v-if="index == '4'">
  108. <view class="cell">
  109. <view class="label">技能名称</view>
  110. <u-input v-model="skills.skill_name" border="none" placeholder="掌握的技能名称"></u-input>
  111. </view>
  112. <view class="cell">
  113. <view class="label">掌握程度</view>
  114. <view @click="open('degree')">
  115. <u-input v-model="skills.degree" disabled disabledColor="#fff" border="none" placeholder="如:精通" suffixIcon="arrow-right"></u-input>
  116. </view>
  117. <u-picker :show="degree_show" title="掌握程度" ref="uPicker" :columns="degreeList" @confirm="confirmSkill" @cancel="cancel"></u-picker>
  118. </view>
  119. </view>
  120. <view class="box" v-if="index == '5'">
  121. <view class="cell">
  122. <view class="label">证书名称</view>
  123. <u-input v-model="certificate.certificate_name" border="none" placeholder="获得的证书名称"></u-input>
  124. </view>
  125. <view class="cell">
  126. <view class="label">获得时间</view>
  127. <view @click="open('gain_time')">
  128. <u-input v-model="certificate.gain_time" disabled disabledColor="#fff" border="none" placeholder="年/月" suffixIcon="arrow-right"></u-input>
  129. </view>
  130. <u-datetime-picker :minDate="minDate" :maxDate="maxDate2" title="获得时间" :show="certificate_show" v-model="newDate" ref="datetimePicker" @confirm="confirmDate" @cancel="cancel" :formatter="formatter" mode="year-month"></u-datetime-picker>
  131. </view>
  132. <view class="cell">
  133. <view class="hflex acenter">
  134. <view class="label">上传图片</view>
  135. <view class="hflex acenter" style="padding-bottom: 20rpx;">
  136. <u-icon name="info-circle-fill" color="#FFA446" size="10"></u-icon>
  137. <view class="label2">只能上传一张</view>
  138. </view>
  139. </view>
  140. <u-upload :fileList="certificate.img" @afterRead="afterRead" @delete="deletePic" :maxCount="1" name="1" :previewFullImage="true" width="100" height="100">
  141. <!-- <image src="https://ship.shipcc.cn/common/upload.png" style="width: 200rpx;height: 200rpx;"></image> -->
  142. <view class="vflex acenter jcenter upload_bg" style="background: #F4F4F4;border-radius: 16rpx;width: 200rpx;height: 200rpx;">
  143. <u-icon name="plus" color="#ADADAD" size="32"></u-icon>
  144. <view class="" style="font-size: 26rpx;padding-top: 8px;color: #ADADAD;">
  145. 上传图片
  146. </view>
  147. </view>
  148. </u-upload>
  149. <!-- <view class="upload vflex acenter jcenter" @click="uploadImg" v-if="certificate.img == ''">
  150. <u-icon name="plus" color="#CACACA" size="25"></u-icon>
  151. <view class="text_style1">添加图片</view>
  152. </view>
  153. <view v-else>
  154. <image :src="certificate.img" mode="aspectFill" class="upload"></image>
  155. </view> -->
  156. </view>
  157. </view>
  158. </view>
  159. <view class="save" @click="save">保存</view>
  160. </view>
  161. </template>
  162. <script>
  163. import $api from '@/static/js/api.js'
  164. var that = ''
  165. export default {
  166. data() {
  167. return {
  168. index: '0',
  169. base_info: {
  170. avatar: '',
  171. name: '',
  172. sex: '',
  173. date_birth: '',
  174. start_working_time: '',
  175. phone: '',
  176. email: '',
  177. edu: '',
  178. },
  179. educationList: [
  180. ['初中及以下','中专/中技','高中','大专','本科','硕士','博士']
  181. ],
  182. sexList: [
  183. {
  184. value: '0',
  185. name: '男',
  186. },
  187. {
  188. value: '1',
  189. name: '女'
  190. }
  191. ],
  192. job_inte: {
  193. post: '',
  194. work_address: '',
  195. salary: '',
  196. work_time: '',
  197. work_nature: '',
  198. },
  199. salaryList: [],
  200. natureList: [
  201. ['兼职','全职']
  202. ],
  203. experience: {
  204. content: {
  205. company_name: '',
  206. position_name: '',
  207. on_job_start: '',
  208. on_job_end: '',
  209. job_description: '',
  210. }
  211. },
  212. certificate: {
  213. certificate_name: '',
  214. gain_time: '',
  215. img: [],
  216. },
  217. skills: {
  218. skill_name: '',
  219. degree:'',
  220. },
  221. degreeList: [
  222. ['熟悉','掌握','精通']
  223. ],
  224. salary_show: false,
  225. birthday_show: false,
  226. work_show: false,
  227. nature_show: false,
  228. show_time1: false,
  229. show_time2: false,
  230. degree_show: false,
  231. education_show: false,
  232. certificate_show: false,
  233. newDate: Number(new Date()),
  234. minDate: 0,
  235. maxDate: 0,
  236. maxDate2: 0,
  237. id: ''
  238. }
  239. },
  240. onLoad(options) {
  241. that = this
  242. if(options.id) {
  243. that.id = options.id
  244. }
  245. that.index = options.index
  246. let date = new Date().getTime()
  247. that.getTime()
  248. that.isInfo(options.index)
  249. that.getData()
  250. that.getsalary()
  251. },
  252. onReady() {
  253. // 微信小程序需要用此写法
  254. this.$refs.datetimePicker.setFormatter(this.formatter)
  255. },
  256. methods: {
  257. getsalary() {
  258. var list1 = []
  259. for(var i = 1;i<= 100 ;i++) {
  260. list1.push(i+'k')
  261. }
  262. that.salaryList.push(list1)
  263. that.salaryList.push(list1)
  264. },
  265. getTime() {
  266. let date = new Date()
  267. let year = date.getFullYear()
  268. let month = date.getMonth() + 1;
  269. let day = date.getDate();
  270. that.maxDate = (new Date((year-18) + '-' + month + '-' + day) ).getTime()
  271. that.minDate = (new Date((year-65) + '-' + month + '-' + day) ).getTime()
  272. that.maxDate2 = new Date().getTime()
  273. },
  274. // 判断要修改的信息
  275. isInfo(index) {
  276. var text = ''
  277. switch(index) {
  278. case '1' :
  279. text = '基本信息';
  280. break;
  281. case '2' :
  282. text = '求职意向';
  283. break;
  284. case '3' :
  285. text = '工作经历';
  286. break;
  287. case '4' :
  288. text = '专业技能';
  289. break;
  290. case '5' :
  291. text = '资质证书';
  292. break;
  293. }
  294. uni.setNavigationBarTitle({
  295. title: text
  296. })
  297. },
  298. getData() {
  299. var pages = getCurrentPages()
  300. var prePage = pages[pages.length - 2]
  301. that.base_info = prePage.$vm.base_info
  302. if(!that.base_info.sex) {
  303. that.base_info.sex = "女"
  304. }
  305. that.job_inte = prePage.$vm.job_inte
  306. var experienceList = prePage.$vm.experience
  307. for(var i=0;i<experienceList.length;i++) {
  308. if(that.id == experienceList[i].id) {
  309. that.experience =experienceList[i]
  310. console.log(that.experience);
  311. }
  312. }
  313. var skillsList = prePage.$vm.skills
  314. for(var i=0;i<skillsList.length;i++) {
  315. if(that.id == skillsList[i].id) {
  316. that.skills =skillsList[i].content
  317. console.log(that.skills);
  318. }
  319. }
  320. var img = ''
  321. var certificateList = prePage.$vm.certificate
  322. for(var i=0;i<certificateList.length;i++) {
  323. if(that.id == certificateList[i].id) {
  324. that.certificate = certificateList[i].content
  325. img = certificateList[i].content.img
  326. }
  327. }
  328. if(that.certificate.img) {
  329. that.certificate.img = []
  330. that.certificate.img.push({
  331. url: img
  332. })
  333. } else {
  334. that.certificate.img = []
  335. }
  336. },
  337. // 保存
  338. save() {
  339. uni.showLoading({
  340. title: '保存中',
  341. mask:true
  342. })
  343. if(that.index == '1') {
  344. if($api.formCheck(that.base_info.avatar,"required") && $api.formCheck(that.base_info.name,"truename") && $api.formCheck(that.base_info.date_birth,"required") && $api.formCheck(that.base_info.edu,"required")
  345. && $api.formCheck(that.base_info.start_working_time,"required") && $api.formCheck(that.base_info.phone,"mobile")&& $api.formCheck(that.base_info.email,"email")) {
  346. $api.req({
  347. url: '/data/api.auth.DemandLabor/applyjob',
  348. method: 'POST',
  349. data: {
  350. type: that.index,
  351. head_img: that.base_info.avatar,
  352. real_name: that.base_info.name,
  353. sex: that.base_info.sex,
  354. date_birth: that.base_info.date_birth,
  355. schooling: that.base_info.edu,
  356. start_working_time: that.base_info.start_working_time,
  357. phone: that.base_info.phone,
  358. email: that.base_info.email
  359. }
  360. }, function(res) {
  361. uni.hideLoading()
  362. if(res.code == 1) {
  363. $api.info(res.info)
  364. $api.jump(-1)
  365. }
  366. })
  367. }
  368. }
  369. if(that.index == '2') {
  370. if(!that.job_inte.post) {
  371. $api.info('请填写你应聘的岗位')
  372. return
  373. }
  374. if(!that.job_inte.work_address) {
  375. $api.info('请填写工作范围')
  376. return
  377. }
  378. if(!that.job_inte.salary) {
  379. $api.info('请选择期望薪资')
  380. return
  381. }
  382. if(!that.job_inte.work_time) {
  383. $api.info('请输入工作时间')
  384. return
  385. }
  386. if(!that.job_inte.work_nature) {
  387. $api.info('请选择用工性质')
  388. return
  389. }
  390. $api.req({
  391. url: '/data/api.auth.DemandLabor/applyjob',
  392. method: 'POST',
  393. data: {
  394. type: that.index,
  395. job_application: that.job_inte.post,
  396. scope_work_area: that.job_inte.work_address,
  397. monthly_salary: that.job_inte.salary,
  398. working_time: that.job_inte.work_time,
  399. work_nature: that.job_inte.work_nature,
  400. }
  401. }, function(res) {
  402. uni.hideLoading()
  403. if(res.code == 1) {
  404. $api.info(res.info)
  405. $api.jump(-1)
  406. }
  407. })
  408. /* if($api.formCheck(that.job_inte.post,"required") && $api.formCheck(that.job_inte.work_address,"required") && $api.formCheck(that.job_inte.salary,"required")
  409. && $api.formCheck(that.job_inte.work_time,"required") && $api.formCheck(that.job_inte.work_nature,"required")) {
  410. } */
  411. }
  412. if(that.index == '3') {
  413. if($api.formCheck(that.experience.content.company_name,"required") && $api.formCheck(that.experience.content.position_name,"required") && $api.formCheck(that.experience.content.on_job_start,"required")
  414. && $api.formCheck(that.experience.content.on_job_end,"required") && $api.formCheck(that.experience.content.job_description,"required")) {
  415. var work_experience = {
  416. company_name: that.experience.content.company_name,
  417. position_name: that.experience.content.position_name,
  418. on_job_start: that.experience.content.on_job_start,
  419. on_job_end: that.experience.content.on_job_end,
  420. job_description: that.experience.content.job_description
  421. }
  422. work_experience = JSON.stringify(work_experience)
  423. console.log(that.id);
  424. $api.req({
  425. url: '/data/api.auth.DemandLabor/applyjob',
  426. method: 'POST',
  427. data: {
  428. type: that.index,
  429. child_id: that.id,
  430. work_experience: work_experience
  431. }
  432. }, function(res) {
  433. uni.hideLoading()
  434. if(res.code == 1) {
  435. $api.info(res.info)
  436. $api.jump(-1)
  437. }
  438. })
  439. }
  440. }
  441. if(that.index == '4') {
  442. if($api.formCheck(that.skills.skill_name,"required") && $api.formCheck(that.skills.degree,"required")) {
  443. var professional_skills = {
  444. skill_name: that.skills.skill_name,
  445. degree: that.skills.degree
  446. }
  447. professional_skills = JSON.stringify(professional_skills)
  448. $api.req({
  449. url: '/data/api.auth.DemandLabor/applyjob',
  450. method: 'POST',
  451. data: {
  452. type: that.index,
  453. child_id: that.id,
  454. professional_skills: professional_skills
  455. }
  456. }, function(res) {
  457. uni.hideLoading()
  458. if(res.code == 1) {
  459. $api.info(res.info)
  460. $api.jump(-1)
  461. }
  462. })
  463. }
  464. }
  465. if(that.index == '5') {
  466. var certificate = {
  467. certificate_name: that.certificate.certificate_name,
  468. gain_time: that.certificate.gain_time,
  469. img: that.certificate.img.length>0 ? that.certificate.img[0].url : null
  470. }
  471. certificate = JSON.stringify(certificate)
  472. $api.req({
  473. url: '/data/api.auth.DemandLabor/applyjob',
  474. method: 'POST',
  475. data: {
  476. type: that.index,
  477. child_id: that.id,
  478. certificate: certificate
  479. }
  480. }, function(res) {
  481. uni.hideLoading()
  482. if(res.code == 1) {
  483. $api.info(res.info)
  484. $api.jump(-1)
  485. }
  486. })
  487. }
  488. // $api.jump(-1)
  489. },
  490. // 上传头像
  491. uploadAvatar() {
  492. uni.showLoading({
  493. title: '加载中'
  494. })
  495. uni.chooseImage({
  496. count: 1, //默认9
  497. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  498. sourceType: ['album'], //从相册选择
  499. success: function (res) {
  500. console.log(res.tempFilePaths);
  501. // that.base_info.avatar = res.tempFilePaths[0]
  502. const tempFilePaths = res.tempFilePaths
  503. uni.uploadFile({
  504. url: $api.config.baseUrl + '/data/api.auth.Center/upload',
  505. filePath: tempFilePaths[0],
  506. name: 'file',
  507. header: {
  508. 'content-type': 'application/x-www-form-urlencoded',
  509. 'api-token': uni.getStorageSync('token').token?uni.getStorageSync('token').token:'',
  510. 'api-name': 'wxapp'
  511. },
  512. formData: {
  513. 'user': 'test'
  514. },
  515. success: (res) => {
  516. const data = JSON.parse(res.data)
  517. if (data.code == 1) {
  518. that.$set(that.base_info,'avatar',data.data.url)
  519. // that.base_info.avatar = data.data.url
  520. uni.hideLoading()
  521. }
  522. }
  523. });
  524. }
  525. });
  526. },
  527. // 删除图片
  528. deletePic(event) {
  529. that.certificate.img.splice(event.index, 1)
  530. },
  531. // 新增图片
  532. async afterRead(event) {
  533. uni.showLoading({
  534. title: '上传中',
  535. mask: true
  536. })
  537. // 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
  538. let lists = [].concat(event.file)
  539. // that.certificate.img = []
  540. let imgListLen = that.certificate.img.length
  541. lists.map((item) => {
  542. that.certificate.img.push({
  543. ...item,
  544. status: 'uploading',
  545. message: '上传中'
  546. })
  547. })
  548. for (let i = 0; i < lists.length; i++) {
  549. const result = await that.uploadFilePromise(lists[i].url)
  550. let item = that.certificate.img[imgListLen]
  551. that.certificate.img.splice(imgListLen, 1, Object.assign(item, {
  552. status: 'success',
  553. message: '',
  554. url: result.url
  555. }))
  556. imgListLen++
  557. if(lists.length - 1 == i) {
  558. uni.hideLoading()
  559. }
  560. console.log(that.certificate.img);
  561. }
  562. },
  563. // 上传图片
  564. uploadFilePromise(url) {
  565. return new Promise((resolve, reject) => {
  566. let a = uni.uploadFile({
  567. url: $api.config.baseUrl + '/data/api.auth.Center/upload',
  568. filePath: url,
  569. name: 'file',
  570. header: {
  571. 'content-type': 'application/x-www-form-urlencoded',
  572. 'api-token': uni.getStorageSync('token').token?uni.getStorageSync('token').token:'',
  573. 'api-name': 'wxapp'
  574. },
  575. formData: {
  576. user: 'test'
  577. },
  578. success: (res) => {
  579. setTimeout(() => {
  580. var data = JSON.parse(res.data)
  581. resolve(data.data)
  582. }, 1000)
  583. }
  584. });
  585. })
  586. },
  587. /* // 上传图书照片
  588. uploadImg() {
  589. uni.chooseImage({
  590. count: 1, //默认9
  591. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  592. sourceType: ['album'], //从相册选择
  593. success: function (res) {
  594. console.log(res.tempFilePaths);
  595. that.certificate.img = res.tempFilePaths[0]
  596. },
  597. })
  598. }, */
  599. // 选择性别
  600. selectSex(value) {
  601. that.base_info.sex = that.sexList[value].name
  602. console.log(value);
  603. },
  604. // 打开
  605. open(e) {
  606. console.log(e);
  607. switch(e) {
  608. case 'birthday' :
  609. that.birthday_show = true;
  610. break;
  611. case 'work_date' :
  612. that.work_show = true;
  613. break;
  614. case 'salary' :
  615. that.salary_show = true;
  616. break;
  617. case 'work_nature' :
  618. that.nature_show = true;
  619. break;
  620. case 'time1' :
  621. that.show_time1 = true;
  622. break;
  623. case 'time2' :
  624. that.show_time2 = true;
  625. break;
  626. case 'degree' :
  627. that.degree_show = true;
  628. break;
  629. case 'gain_time' :
  630. that.certificate_show = true;
  631. break;
  632. case 'education' :
  633. that.education_show = true;
  634. break;
  635. }
  636. },
  637. // 格式化日期
  638. formatter(type, value) {
  639. if (type === 'year') {
  640. return `${value}年`
  641. }
  642. if (type === 'month') {
  643. return `${value}月`
  644. }
  645. if (type === 'day') {
  646. return `${value}日`
  647. }
  648. return value
  649. },
  650. // 确定选择生日
  651. confirmAge(e) {
  652. that.base_info.date_birth = $api.formatDate(e)
  653. that.cancel()
  654. },
  655. // 确定选择参加工作时间
  656. confirmWork(e) {
  657. that.base_info.start_working_time = $api.formatDate(e)
  658. that.cancel()
  659. },
  660. confirmSalary(e) {
  661. console.log(e);
  662. var index1 = e.indexs[0]
  663. var index2 = e.indexs[1]
  664. if (index1 > index2) {
  665. that.job_inte.salary = e.value[1] + '-' + e.value[0]
  666. that.cancel()
  667. } else {
  668. that.job_inte.salary = e.value[0] + '-' + e.value[1]
  669. that.cancel()
  670. }
  671. },
  672. // 选择工作性质
  673. confirmNature(e) {
  674. console.log(e);
  675. that.job_inte.work_nature = e.value[0]
  676. that.cancel()
  677. },
  678. // 选择在职时间1
  679. confirmTime1(e) {
  680. that.experience.content.on_job_start = $api.formatDate(e)
  681. that.cancel()
  682. },
  683. // 选择在职时间2
  684. confirmTime2(e) {
  685. that.experience.content.on_job_end = $api.formatDate(e)
  686. that.cancel()
  687. },
  688. // 选择技能掌握程度
  689. confirmSkill(e) {
  690. that.skills.degree = e.value[0]
  691. that.cancel()
  692. },
  693. // 选择证书获得时间
  694. confirmDate(e) {
  695. that.certificate.gain_time = $api.formatDate(e)
  696. that.cancel()
  697. },
  698. /* // 选择学历
  699. changeHandler(e) {
  700. const {
  701. columnIndex,
  702. value,
  703. values, // values为当前变化列的数组内容
  704. index,
  705. // 微信小程序无法将picker实例传出来,只能通过ref操作
  706. picker = this.$refs.uPicker
  707. } = e
  708. console.log(e);
  709. // 当第一列值发生变化时,变化第二列(后一列)对应的选项
  710. if (e.index == 3 || e.index == 4) {
  711. // picker为选择器this实例,变化第二列对应的选项
  712. console.log(this.educationList2);
  713. picker.setColumnValues(1, this.educationList2[0])
  714. }
  715. }, */
  716. // 选择学历
  717. confirmEdu(e) {
  718. console.log(e);
  719. if(e.indexs.length > 1) {
  720. that.base_info.edu = e.value[0]
  721. } else {
  722. that.base_info.edu = e.value[0]
  723. }
  724. that.cancel()
  725. },
  726. // 关闭选择器
  727. cancel() {
  728. that.birthday_show = false
  729. that.work_show = false
  730. that.salary_show = false
  731. that.nature_show = false
  732. that.show_time1 = false
  733. that.show_time2 = false
  734. that.degree_show = false
  735. that.certificate_show = false
  736. that.education_show = false
  737. },
  738. },
  739. }
  740. </script>
  741. <style lang="scss" scoped>
  742. .content {
  743. background: #F4F4F4;
  744. padding: 20rpx 30rpx 0;
  745. .box {
  746. width: 100%;
  747. background: #FFFFFF;
  748. border-radius: 20rpx;
  749. box-sizing: border-box;
  750. padding: 30rpx 20rpx;
  751. .cell {
  752. width: 100%;
  753. padding: 28rpx 0;
  754. border-bottom: 1rpx solid #F4F4F4;
  755. .label {
  756. font-size: 26rpx;
  757. font-weight: 400;
  758. color: #888888;
  759. padding-bottom: 28rpx;
  760. margin-right: 14rpx;
  761. }
  762. .label_img {
  763. width: 20rpx;
  764. height: 20rpx;
  765. margin: 0 4rpx 0 14rpx;
  766. }
  767. .label2 {
  768. font-size: 20rpx;
  769. font-weight: 400;
  770. color: #B1B1B1;
  771. }
  772. .upload {
  773. width: 200rpx;
  774. height: 200rpx;
  775. background: #F5F5F5;
  776. border-radius: 20rpx;
  777. .text_style1 {
  778. margin-top: 18rpx;
  779. font-size: 24rpx;
  780. font-weight: 400;
  781. color: #ADADAD;
  782. }
  783. }
  784. }
  785. .cell:nth-last-child(1) {
  786. border: none;
  787. }
  788. }
  789. .save {
  790. width: 100%;
  791. height: 84rpx;
  792. background: #506DFF;
  793. border-radius: 42rpx;
  794. font-size: 36rpx;
  795. text-align: center;
  796. margin: 56rpx auto;
  797. font-weight: 500;
  798. color: #FFFFFF;
  799. line-height: 84rpx;
  800. }
  801. }
  802. </style>