myinfo.vue 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033
  1. <template>
  2. <view>
  3. <form>
  4. <button class="cu-form-group" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
  5. <view class="title">头像</view>
  6. <view class="cu-avatar radius bg-gray">
  7. <avatar selWidth="640rpx" selHeight="640rpx" :avatarSrc="userinfo.avatar" noTab="true"
  8. avatarStyle="top:16rpx;width: 75rpx; height: 75rpx; border-radius: 5%;"></avatar>
  9. </view>
  10. </button>
  11. <!-- <view class="cu-form-group">
  12. <view class="title">头像</view>
  13. <view class="cu-avatar radius bg-gray">
  14. <avatar selWidth="640rpx" selHeight="640rpx" @upload="setAvatar" :avatarSrc="userinfo.avatar" noTab="true" avatarStyle="width: 75rpx; height: 75rpx; border-radius: 5%;"></avatar>
  15. </view>
  16. </view> -->
  17. <view class="cu-list menu margin-top">
  18. <view class="cu-item arrow" data-title="昵称" data-infobox="input" data-field="nickname"
  19. :data-value="userinfo.nickname" @click="showModalNickname">
  20. <view class="content">
  21. <text>昵称</text>
  22. </view>
  23. <view class="action">
  24. <text class="text-grey">{{userinfo.nickname}}</text>
  25. </view>
  26. </view>
  27. <view class="cu-item">
  28. <view class="content">
  29. <text>手机号</text>
  30. </view>
  31. <view class="action">
  32. <text class="text-grey">{{userinfo.mobile}}</text>
  33. </view>
  34. </view>
  35. <view class="cu-item arrow" data-title="公开电话">
  36. <view class="content">
  37. <text>公开电话</text>
  38. </view>
  39. <view class="action">
  40. <picker mode="selector" @change="isPublicPickerChange" :value="isPublicIndex"
  41. :range="isPublicPickerList" :range-key="`text`">
  42. <view class="picker padding-tb text-right text-grey"
  43. style="width: 280rpx;line-height: 40rpx;">
  44. {{isPublicIndex>-1 ? isPublicPickerList[isPublicIndex].text : ("请选择...")}}</view>
  45. </picker>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="cu-list menu margin-top" v-if="userinfo.authstatus==3">
  50. <view class="cu-item">
  51. <view class="content">
  52. <text>身份证号</text>
  53. </view>
  54. <view class="action">
  55. <text class="text-grey">{{userinfo.idcard}}</text>
  56. </view>
  57. </view>
  58. <view class="cu-item">
  59. <view class="content">
  60. <text>姓名</text>
  61. </view>
  62. <view class="action">
  63. <text class="text-grey">{{userinfo.realname}}</text>
  64. </view>
  65. </view>
  66. <view class="cu-item">
  67. <view class="content">
  68. <text>性别</text>
  69. </view>
  70. <view class="action">
  71. <text class="text-grey">{{userinfo.gender==1 ? "男" : "女"}}</text>
  72. </view>
  73. </view>
  74. <view class="cu-item">
  75. <view class="content">
  76. <text>出生日期</text>
  77. </view>
  78. <view class="action">
  79. <text class="text-grey">{{userinfo.birthday}}</text>
  80. </view>
  81. </view>
  82. </view>
  83. <view class="cu-list menu margin-top">
  84. <view class="cu-item arrow" data-title="岗位设置方式">
  85. <view class="content">
  86. <text>岗位设置方式</text>
  87. </view>
  88. <view class="action">
  89. <picker mode="selector" @change="comCateTypePickerChange" :value="comCateTypeIndex"
  90. :range="comCateTypePickerList" :range-key="`text`">
  91. <view class="picker padding-tb text-right text-grey"
  92. style="width: 280rpx;line-height: 40rpx;">
  93. {{comCateTypeIndex>-1 ? comCateTypePickerList[comCateTypeIndex].text : ("请选择...")}}
  94. </view>
  95. </picker>
  96. </view>
  97. </view>
  98. <view class="cu-item arrow" @click="toggleComCate(true)" v-if="userinfo.com_cate_type == 1">
  99. <view class="content">
  100. <text>岗位类型</text>
  101. </view>
  102. <view class="action">
  103. <view class="picker padding-tb text-right text-grey" style="width: 280rpx;line-height: 40rpx;">
  104. {{userinfo.com_cate.length > 0 ? userinfo.com_cate : "请选择..."}}</view>
  105. </view>
  106. </view>
  107. <view class="cu-item arrow" data-title="岗位类型" data-infobox="input" data-field="com_cate_other"
  108. :data-value="userinfo.com_cate_other" @click="showModal" v-if="userinfo.com_cate_type == 2">
  109. <view class="content">
  110. <text>岗位类型</text>
  111. </view>
  112. <view class="action">
  113. <text class="text-grey text-cut">{{userinfo.com_cate_other}}</text>
  114. </view>
  115. </view>
  116. </view>
  117. <view class="cu-list menu margin-top solid-bottom">
  118. <view class="cu-item arrow" data-title="求职意向">
  119. <view class="content">
  120. <text class="text-red">*</text>
  121. <text>求职意向</text>
  122. </view>
  123. <view class="action">
  124. <picker mode="selector" @change="jobintentiontypePickerChange"
  125. :value="jobintentiontypePickIndex" :range="jobintentiontypePickerList" :range-key="`title`">
  126. <view class="picker padding-tb text-right text-grey"
  127. style="width: 280rpx;line-height: 40rpx;">
  128. {{jobintentiontypePickIndex>-1 ? jobintentiontypePickerList[jobintentiontypePickIndex].title : ("请选择...")}}
  129. </view>
  130. </picker>
  131. </view>
  132. </view>
  133. <view class="cu-item arrow" @click="toggleFilter(true)"
  134. :style="userinfo.jobintention == 3 ? '' : 'display:none;'">
  135. <view class="content">
  136. <text>用工时间</text>
  137. </view>
  138. <view class="action">
  139. <view class="picker padding-tb text-right text-grey" style="width: 280rpx;line-height: 40rpx;">
  140. {{userinfo.emp_time.length > 0 ? userinfo.emp_time : "请选择..."}}</view>
  141. </view>
  142. </view>
  143. <view class="cu-item arrow" data-title="现居住地" data-infobox="input" data-field="address"
  144. :data-value="userinfo.address" @click="showModal">
  145. <view class="content">
  146. <text class="text-red">*</text>
  147. <text>现居住地</text>
  148. </view>
  149. <view class="action">
  150. <text class="text-grey text-cut">{{userinfo.address}}</text>
  151. </view>
  152. </view>
  153. <view class="cu-item arrow" @click="toggleCommunity(true)">
  154. <view class="content">
  155. <text>上班地点</text>
  156. </view>
  157. <view class="action">
  158. <view class="picker padding-tb text-right text-grey" style="width: 280rpx;line-height: 40rpx;">
  159. {{userinfo.work_place.length > 0 ? userinfo.work_place : "请选择..."}}</view>
  160. </view>
  161. </view>
  162. </view>
  163. <view class="cu-list menu margin-top solid-bottom">
  164. <!-- <view class="cu-item arrow" data-title="健康状况">
  165. <view class="content">
  166. <text>健康状况</text>
  167. </view>
  168. <view class="action">
  169. <picker mode="selector" @change="healthPickerChange" :value="healthPickIndex" :range="healthPickerList" :range-key="`text`">
  170. <view class="picker padding-tb text-right text-grey" style="width: 280rpx;line-height: 40rpx;">{{healthPickIndex>-1 ? healthPickerList[healthPickIndex].text : ("请选择...")}}</view>
  171. </picker>
  172. </view>
  173. </view> -->
  174. <view class="cu-item arrow" data-title="工作经验">
  175. <view class="content">
  176. <text class="text-red">*</text>
  177. <text>工作经验</text>
  178. </view>
  179. <view class="action">
  180. <picker mode="selector" @change="workexperiencePickerChange" :value="workexperiencePickIndex"
  181. :range="workexperiencePickerList" :range-key="`text`">
  182. <view class="picker padding-tb text-right text-grey"
  183. style="width: 280rpx;line-height: 40rpx;">
  184. {{workexperiencePickIndex>-1 ? workexperiencePickerList[workexperiencePickIndex].text : ("请选择...")}}
  185. </view>
  186. </picker>
  187. </view>
  188. </view>
  189. <view class="cu-item arrow" data-title="学历">
  190. <view class="content">
  191. <text class="text-red">*</text>
  192. <text>学历</text>
  193. </view>
  194. <view class="action">
  195. <picker mode="selector" @change="educationPickerChange" :value="educationPickIndex"
  196. :range="educationPickerList" :range-key="`text`">
  197. <view class="picker padding-tb text-right text-grey"
  198. style="width: 280rpx;line-height: 40rpx;">
  199. {{educationPickIndex>-1 ? educationPickerList[educationPickIndex].text : ("请选择...")}}
  200. </view>
  201. </picker>
  202. </view>
  203. </view>
  204. <view class="padding-tb padding-lr-xs bg-white solids-top">
  205. <view class="title padding-bottom-sm text-lg">技能证书</view>
  206. <view class="grid col-4 grid-square flex-sub">
  207. <block v-for="(picitem,picindex) in userinfo.skill_cert" :key="picindex">
  208. <view class="bg-img" @tap="viewImage" :data-url="picitem">
  209. <image :src="picitem" mode="aspectFill"></image>
  210. <view class="cu-tag bg-red" @tap.stop="delImg" :data-index="index">
  211. <text class='cuIcon-close'></text>
  212. </view>
  213. </view>
  214. </block>
  215. <view class="solids" @tap="chooseImage" v-if="userinfo.skill_cert.length <= 12">
  216. <text class='cuIcon-cameraadd'></text>
  217. </view>
  218. </view>
  219. </view>
  220. <view class="cu-item arrow" data-title="个人描述" data-infobox="textarea" data-field="eduexperience"
  221. :data-value="userinfo.eduexperience" @click="showModal">
  222. <view class="content">
  223. <text>个人描述</text>
  224. </view>
  225. </view>
  226. </view>
  227. <view class="padding bg-white">
  228. <text>{{userinfo.eduexperience}}</text>
  229. </view>
  230. <view class="bottomEmpty"></view>
  231. <view class="bottomArea">
  232. <view class="bottomButton" @tap="goCDetail()">已确认完善信息,返回!</view>
  233. </view>
  234. <view class="padding text-center" v-if="false">
  235. <button class="cu-btn bg-orange margin-tb-sm lg" @tap="goCDetail()">已确认完善信息,返回!</button>
  236. </view>
  237. <!-- <view class="padding text-center" v-if="userinfo.authstatus == 1">
  238. <button class="cu-btn bg-orange margin-tb-sm lg" @tap="goLPage('/pages/my/myauth')">您还未进行实名认证,请实名认证!</button>
  239. </view>
  240. <view class="padding text-center" v-else="userinfo.authstatus == 2">
  241. <button class="cu-btn bg-orange margin-tb-sm lg" @tap="goLPage('/pages/my/myauth')">您的实名认证已提交,正在等待审核!</button>
  242. </view> -->
  243. </form>
  244. <view class="cu-modal show" v-show="forminfo.isshow == 'show'">
  245. <view class="cu-dialog">
  246. <view class="cu-bar bg-white justify-end">
  247. <view class="content">修改 {{forminfo.title}}</view>
  248. <view class="action" @tap="hideModal">
  249. <text class="cuIcon-close text-grey"></text>
  250. </view>
  251. </view>
  252. <view class="padding-xl bg-white text-left solid-top solid-bottom">
  253. <input v-if="forminfo.infobox=='input'" type="text" :placeholder="'请输入'+forminfo.title+'...'" @input="bindInput"
  254. :value="forminfo.value"></input>
  255. <textarea v-if="forminfo.infobox=='textarea'" type="textarea" :placeholder="'请输入'+forminfo.title+'...'"
  256. @input="bindInput" maxlength="-1" :value="forminfo.value"></textarea>
  257. </view>
  258. <view class="cu-bar bg-white justify-end">
  259. <view class="action">
  260. <button class="cu-btn line-grey text-grey" @tap="hideModal">取消</button>
  261. <button class="cu-btn bg-green margin-left" @tap="subModal">确定</button>
  262. </view>
  263. </view>
  264. </view>
  265. </view>
  266. <view class="cu-modal show" v-show="formavatar == 'show'">
  267. <view class="cu-dialog">
  268. <view class="cu-bar bg-white justify-end">
  269. <view class="content">修改 昵称</view>
  270. <view class="action" @tap="hideModal">
  271. <text class="cuIcon-close text-grey"></text>
  272. </view>
  273. </view>
  274. <view class="padding-xl bg-white text-left solid-top solid-bottom">
  275. <input :placeholder="'请输入昵称...'" type="nickname" @input="bindInput" :value="forminfo.value"></input>
  276. </view>
  277. <view class="cu-bar bg-white justify-end">
  278. <view class="action">
  279. <button class="cu-btn line-grey text-grey" @tap="hideModal">取消</button>
  280. <button class="cu-btn bg-green margin-left" @tap="subModal">确定</button>
  281. </view>
  282. </view>
  283. </view>
  284. </view>
  285. <view class="filteremp" v-if="empTimeModal">
  286. <view class="padding bg-white emp-box">
  287. <block v-for="(item,index) in empTime" :key="index">
  288. <button class="cu-btn margin-lr-xs margin-tb-xs" v-if="!userinfo.emp_time.includes(item.name)"
  289. @click="selectEmpTime(item.name,'add')">
  290. {{item.name}}
  291. </button>
  292. <button class="cu-btn margin-lr-xs margin-tb-xs bg-red" v-else
  293. @click="selectEmpTime(item.name,'del')">
  294. {{item.name}}
  295. </button>
  296. </block>
  297. <view class="padding flex flex-wrap justify-between align-center">
  298. <button class="cu-btn bg-red lg" @click="subFilter()">确定</button>
  299. <button class="cu-btn bg-gray lg" @click="toggleFilter(false)">取消</button>
  300. </view>
  301. </view>
  302. </view>
  303. <view class="filteremp" v-if="communityModal">
  304. <view class="padding bg-white emp-box">
  305. <block v-for="(item,index) in community" :key="index">
  306. <button class="cu-btn margin-lr-xs margin-tb-xs" v-if="!userinfo.work_place.includes(item.name)"
  307. @click="selectCommunity(item.name,'add')">
  308. {{item.name}}
  309. </button>
  310. <button class="cu-btn margin-lr-xs margin-tb-xs bg-red" v-else
  311. @click="selectCommunity(item.name,'del')">
  312. {{item.name}}
  313. </button>
  314. </block>
  315. <view class="padding flex flex-wrap justify-between align-center">
  316. <button class="cu-btn bg-red lg" @click="subCommunity()">确定</button>
  317. <button class="cu-btn bg-gray lg" @click="toggleCommunity(false)">取消</button>
  318. </view>
  319. </view>
  320. </view>
  321. <view class="filteremp" v-if="comCateModal">
  322. <view class="padding bg-white emp-box">
  323. <block v-for="(item,index) in comCate" :key="index">
  324. <button class="cu-btn margin-lr-xs margin-tb-xs" v-if="!userinfo.com_cate.includes(item.title)"
  325. @click="selectComCate(item.title,'add')">
  326. {{item.title}}
  327. </button>
  328. <button class="cu-btn margin-lr-xs margin-tb-xs bg-red" v-else
  329. @click="selectComCate(item.title,'del')">
  330. {{item.title}}
  331. </button>
  332. </block>
  333. <view class="padding flex flex-wrap justify-between align-center">
  334. <button class="cu-btn bg-red lg" @click="subComCate()">确定</button>
  335. <button class="cu-btn bg-gray lg" @click="toggleComCate(false)">取消</button>
  336. </view>
  337. </view>
  338. </view>
  339. </view>
  340. </template>
  341. <script>
  342. var _this;
  343. import avatar from "@/components/yq-avatar/yq-avatar.vue";
  344. var sexPickerList = [{
  345. id: 0,
  346. text: '保密'
  347. },
  348. {
  349. id: 1,
  350. text: '男'
  351. },
  352. {
  353. id: 2,
  354. text: '女'
  355. },
  356. ];
  357. var educationPickerList = [{
  358. id: 1,
  359. text: '初中及以下'
  360. },
  361. {
  362. id: 2,
  363. text: '高中'
  364. },
  365. {
  366. id: 3,
  367. text: '中技'
  368. },
  369. {
  370. id: 4,
  371. text: '中专'
  372. },
  373. {
  374. id: 5,
  375. text: '大专'
  376. },
  377. {
  378. id: 6,
  379. text: '本科'
  380. },
  381. {
  382. id: 7,
  383. text: '硕士'
  384. },
  385. {
  386. id: 8,
  387. text: '博士'
  388. },
  389. ];
  390. var workexperiencePickerList = [{
  391. id: 1,
  392. text: '无经验'
  393. },
  394. {
  395. id: 2,
  396. text: '一年以下'
  397. },
  398. {
  399. id: 3,
  400. text: '1-3年'
  401. },
  402. {
  403. id: 4,
  404. text: '3-5年'
  405. },
  406. {
  407. id: 5,
  408. text: '5-10年'
  409. },
  410. {
  411. id: 6,
  412. text: '10年以上'
  413. }
  414. ];
  415. var healthPickerList = [{
  416. id: 1,
  417. text: '健康或良好'
  418. },
  419. {
  420. id: 2,
  421. text: '一般或较弱'
  422. },
  423. {
  424. id: 3,
  425. text: '有慢性病'
  426. },
  427. {
  428. id: 4,
  429. text: '残疾'
  430. }
  431. ];
  432. var healthPickerList = [{
  433. id: 1,
  434. text: '健康或良好'
  435. },
  436. {
  437. id: 2,
  438. text: '一般或较弱'
  439. },
  440. {
  441. id: 3,
  442. text: '有慢性病'
  443. },
  444. {
  445. id: 4,
  446. text: '残疾'
  447. }
  448. ];
  449. var comCateTypePickerList = [{
  450. id: 1,
  451. text: '选择项方式'
  452. },
  453. {
  454. id: 2,
  455. text: '手工填写方式'
  456. },
  457. ];
  458. var comCateTypePickerList = [{
  459. id: 1,
  460. text: '选择项方式'
  461. },
  462. {
  463. id: 2,
  464. text: '手工填写方式'
  465. },
  466. ];
  467. var isPublicPickerList = [{
  468. id: 1,
  469. text: '是'
  470. },
  471. {
  472. id: 2,
  473. text: '否'
  474. },
  475. ];
  476. export default {
  477. components: {
  478. avatar
  479. },
  480. data() {
  481. return {
  482. userinfo: {},
  483. formavatar: false,
  484. forminfo: {
  485. isshow: "",
  486. infobox: "input",
  487. title: "",
  488. field: "",
  489. value: ""
  490. },
  491. jobintentiontypePickIndex: -1,
  492. jobintentiontypePickerList: [],
  493. jobintentiontypeValue: {
  494. id: false,
  495. title: false
  496. },
  497. workexperiencePickIndex: -1,
  498. workexperiencePickerList: [],
  499. workexperienceValue: {
  500. id: false,
  501. text: false
  502. },
  503. educationPickIndex: -1,
  504. educationPickerList: [],
  505. educationValue: {
  506. id: false,
  507. text: false
  508. },
  509. healthPickIndex: -1,
  510. healthPickerList: [],
  511. healthValue: {
  512. id: false,
  513. text: false
  514. },
  515. comCateTypeIndex: -1,
  516. comCateTypePickerList: [],
  517. comCateTypeValue: {
  518. id: false,
  519. text: false,
  520. },
  521. isPublicIndex: -1,
  522. isPublicPickerList: [],
  523. isPublicValue: {
  524. id: false,
  525. text: false,
  526. },
  527. empTimeOrigin: [],
  528. empTime: [],
  529. empTimeModal: false,
  530. communityOrigin: [],
  531. community: [],
  532. communityModal: false,
  533. comCateOrigin: [],
  534. comCate: [],
  535. comCateModal: false,
  536. }
  537. },
  538. onLoad: function(option) {
  539. _this = this;
  540. _this.userinfo = _this.checkLogin("/pages/my/myinfo");
  541. _this.getJobintentiontype();
  542. _this.getEmpTime();
  543. _this.getCommunity();
  544. _this.getComCate();
  545. _this.healthPickerList = healthPickerList;
  546. if (_this.userinfo.health >= 1) {
  547. _this.healthPickIndex = _this.userinfo.health - 1;
  548. _this.healthValue.text = _this.healthPickerList[_this.healthPickIndex].text;
  549. _this.healthValue.id = _this.healthPickerList[_this.healthPickIndex].id;
  550. }
  551. _this.educationPickerList = educationPickerList;
  552. if (_this.userinfo.education >= 1) {
  553. _this.educationPickIndex = _this.userinfo.education - 1;
  554. _this.educationValue.text = _this.educationPickerList[_this.educationPickIndex].text;
  555. _this.educationValue.id = _this.educationPickerList[_this.educationPickIndex].id;
  556. }
  557. _this.workexperiencePickerList = workexperiencePickerList;
  558. if (_this.userinfo.workexperience >= 1) {
  559. _this.workexperiencePickIndex = _this.userinfo.workexperience - 1;
  560. _this.workexperienceValue.text = _this.workexperiencePickerList[_this.workexperiencePickIndex].text;
  561. _this.workexperienceValue.id = _this.workexperiencePickerList[_this.workexperiencePickIndex].id;
  562. }
  563. _this.comCateTypePickerList = comCateTypePickerList;
  564. if (_this.userinfo.com_cate_type >= 1) {
  565. _this.comCateTypeIndex = _this.userinfo.com_cate_type - 1;
  566. _this.comCateTypeValue.text = _this.comCateTypePickerList[_this.comCateTypeIndex].text;
  567. _this.comCateTypeValue.id = _this.comCateTypePickerList[_this.comCateTypeIndex].id;
  568. }
  569. _this.isPublicPickerList = isPublicPickerList;
  570. if (_this.userinfo.is_public >= 1) {
  571. _this.isPublicIndex = _this.userinfo.is_public - 1;
  572. _this.isPublicValue.text = _this.isPublicPickerList[_this.isPublicIndex].text;
  573. _this.isPublicValue.id = _this.isPublicPickerList[_this.isPublicIndex].id;
  574. }
  575. //数组删除值
  576. Array.prototype.remove = function(val) {
  577. var index = this.indexOf(val);
  578. if (index > -1) {
  579. this.splice(index, 1);
  580. }
  581. };
  582. },
  583. methods: {
  584. onChooseAvatar: function(e) {
  585. _this.$req.ajaxFile({
  586. path: "attachment/tplfieldimage",
  587. title: '正在上传',
  588. filePath: e.detail.avatarUrl,
  589. fileName: 'file',
  590. }).then((filedata) => {
  591. var data = JSON.parse(filedata.data);
  592. if (data.code == 1) {
  593. uni.showModal({
  594. title: '信息提示',
  595. content: data.msg,
  596. showCancel: false
  597. });
  598. }
  599. return false;
  600. _this.editFiled('avatar', data.data.src);
  601. }).catch((err) => {
  602. uni.showModal({
  603. title: '信息提示',
  604. content: err,
  605. showCancel: false
  606. });
  607. });
  608. },
  609. // 获取求职意向
  610. getJobintentiontype: function() {
  611. _this.$req.ajax({
  612. path: "my/jobintention_lst",
  613. data: {}
  614. }).then((data) => {
  615. _this.jobintentiontypePickerList = data.plist;
  616. if (_this.userinfo.jobintention > 0) {
  617. _this.jobintentiontypePickerList.forEach((item, index) => {
  618. if (item.id == _this.userinfo.jobintention) {
  619. _this.jobintentiontypePickIndex = index;
  620. _this.jobintentiontypeValue.title = _this.jobintentiontypePickerList[
  621. _this.jobintentiontypePickIndex].title;
  622. _this.jobintentiontypeValue.id = _this.jobintentiontypePickerList[_this
  623. .jobintentiontypePickIndex].id;
  624. }
  625. });
  626. }
  627. }).catch((err) => {
  628. uni.showModal({
  629. title: '信息提示',
  630. content: err,
  631. showCancel: false
  632. });
  633. });
  634. },
  635. // 获取用工时间
  636. getEmpTime: function() {
  637. _this.$req.ajax({
  638. path: "index/getRensheCode",
  639. data: {
  640. type: "emp_time"
  641. }
  642. }).then((data) => {
  643. _this.empTime = data;
  644. }).catch((err) => {
  645. uni.showModal({
  646. title: '信息提示',
  647. content: err,
  648. showCancel: false
  649. });
  650. });
  651. },
  652. // 获取镇街
  653. getCommunity: function() {
  654. _this.$req.ajax({
  655. path: "index/getRensheCode",
  656. data: {
  657. type: "community"
  658. }
  659. }).then((data) => {
  660. data.push({
  661. code: 0,
  662. id: 0,
  663. name: "不限"
  664. });
  665. _this.community = data;
  666. }).catch((err) => {
  667. uni.showModal({
  668. title: '信息提示',
  669. content: err,
  670. showCancel: false
  671. });
  672. });
  673. },
  674. // 获取岗位类型
  675. getComCate: function() {
  676. _this.$req.ajax({
  677. path: "index/getComCate",
  678. data: {}
  679. }).then((data) => {
  680. _this.comCate = data;
  681. }).catch((err) => {
  682. uni.showModal({
  683. title: '信息提示',
  684. content: err,
  685. showCancel: false
  686. });
  687. });
  688. },
  689. // 求职意向岗位修改
  690. jobintentiontypePickerChange: function(e) {
  691. _this.jobintentiontypePickIndex = e.detail.value;
  692. _this.jobintentiontypeValue.title = _this.jobintentiontypePickerList[_this.jobintentiontypePickIndex]
  693. .title;
  694. _this.jobintentiontypeValue.id = _this.jobintentiontypePickerList[_this.jobintentiontypePickIndex].id;
  695. _this.editFiled("jobintention", _this.jobintentiontypeValue.id);
  696. },
  697. // 工作经验修改
  698. workexperiencePickerChange: function(e) {
  699. _this.workexperiencePickIndex = e.detail.value;
  700. _this.workexperienceValue.text = _this.workexperiencePickerList[_this.workexperiencePickIndex].text;
  701. _this.workexperienceValue.id = _this.workexperiencePickerList[_this.workexperiencePickIndex].id;
  702. _this.editFiled("workexperience", _this.workexperienceValue.id);
  703. },
  704. // 学历修改
  705. educationPickerChange: function(e) {
  706. _this.educationPickIndex = e.detail.value;
  707. _this.educationValue.text = _this.educationPickerList[_this.educationPickIndex].text;
  708. _this.educationValue.id = _this.educationPickerList[_this.educationPickIndex].id;
  709. _this.editFiled("education", _this.educationValue.id);
  710. },
  711. // 健康状况修改
  712. healthPickerChange: function(e) {
  713. _this.healthPickIndex = e.detail.value;
  714. _this.healthValue.text = _this.healthPickerList[_this.healthPickIndex].text;
  715. _this.healthValue.id = _this.healthPickerList[_this.healthPickIndex].id;
  716. _this.editFiled("health", _this.healthValue.id);
  717. },
  718. // 岗位类型设置
  719. comCateTypePickerChange: function(e) {
  720. _this.comCateTypeIndex = e.detail.value;
  721. _this.comCateTypeValue.text = _this.comCateTypePickerList[_this.comCateTypeIndex].text;
  722. _this.comCateTypeValue.id = _this.comCateTypePickerList[_this.comCateTypeIndex].id;
  723. _this.editFiled("com_cate_type", _this.comCateTypeValue.id);
  724. },
  725. //公开电话
  726. isPublicPickerChange: function(e) {
  727. _this.isPublicIndex = e.detail.value;
  728. _this.isPublicValue.text = _this.isPublicPickerList[_this.isPublicIndex].text;
  729. _this.isPublicValue.id = _this.isPublicPickerList[_this.isPublicIndex].id;
  730. _this.editFiled("is_public", _this.isPublicValue.id);
  731. },
  732. // 填写字段
  733. hideModal: function() {
  734. _this.forminfo = {
  735. isshow: "",
  736. title: "",
  737. field: "",
  738. value: ""
  739. };
  740. _this.formavatar = "";
  741. },
  742. showModal: function(e) {
  743. _this.forminfo.title = e.currentTarget.dataset.title;
  744. _this.forminfo.infobox = e.currentTarget.dataset.infobox;
  745. _this.forminfo.field = e.currentTarget.dataset.field;
  746. _this.forminfo.value = e.currentTarget.dataset.value;
  747. _this.forminfo.isshow = "show";
  748. },
  749. showModalNickname: function(e) {
  750. _this.forminfo.title = e.currentTarget.dataset.title;
  751. _this.forminfo.infobox = e.currentTarget.dataset.infobox;
  752. _this.forminfo.field = e.currentTarget.dataset.field;
  753. _this.forminfo.value = e.currentTarget.dataset.value;
  754. _this.formavatar = 'show';
  755. },
  756. bindInput: function(e) {
  757. _this.forminfo.value = e.detail.value;
  758. },
  759. subModal: function() {
  760. _this.editFiled(_this.forminfo.field, _this.forminfo.value);
  761. },
  762. // 修改头像
  763. setAvatar: function(rsp) {
  764. _this.$req.ajaxFile({
  765. path: "attachment/tplfieldimage",
  766. title: '正在上传',
  767. filePath: rsp.path,
  768. fileName: 'file',
  769. }).then((filedata) => {
  770. var data = JSON.parse(filedata.data);
  771. _this.editFiled('avatar', data.data.src);
  772. }).catch((err) => {
  773. uni.showModal({
  774. title: '信息提示',
  775. content: err,
  776. showCancel: false
  777. });
  778. });
  779. },
  780. //返回招聘详情
  781. goCDetail: function() {
  782. _this.checkLogin("/pages/my/my");
  783. if (_this.userinfo === false) {
  784. return false;
  785. }
  786. if (_this.userinfo.address == "") {
  787. uni.showToast({
  788. title: '请完善您的现居住地',
  789. icon: 'none',
  790. duration: 2000
  791. });
  792. return false;
  793. }
  794. if (_this.userinfo.jobintention == "") {
  795. uni.showToast({
  796. title: '请选择您的求职意向',
  797. icon: 'none',
  798. duration: 2000
  799. });
  800. return false;
  801. }
  802. if (_this.userinfo.workexperience == "") {
  803. uni.showToast({
  804. title: '请选择您的工作经验',
  805. icon: 'none',
  806. duration: 2000
  807. });
  808. return false;
  809. }
  810. if (_this.userinfo.education == "") {
  811. uni.showToast({
  812. title: '请选择您的学历',
  813. icon: 'none',
  814. duration: 2000
  815. });
  816. return false;
  817. }
  818. _this.$req.ajax({
  819. path: "my/perfectUserInfo",
  820. data: {
  821. userid: _this.userinfo.id,
  822. skill_cert: _this.userinfo.skill_cert ? _this.userinfo.skill_cert.join(",") : _this
  823. .userinfo.skill_cert,
  824. }
  825. })
  826. uni.showToast({
  827. title: '修改成功',
  828. icon: 'none',
  829. duration: 2000
  830. });
  831. setTimeout(function() {
  832. uni.navigateBack();
  833. }, 1500);
  834. },
  835. //跳转
  836. goLPage: function(pageurl) {
  837. _this.userinfo = _this.checkLogin("/pages/my/my");
  838. if (_this.userinfo === false) {
  839. return false;
  840. }
  841. uni.navigateTo({
  842. url: pageurl,
  843. fail: function() {
  844. uni.switchTab({
  845. url: pageurl
  846. });
  847. }
  848. });
  849. },
  850. // 更新用户字段
  851. editFiled: function(field, value) {
  852. _this.$req.ajax({
  853. path: "my/edituserinfo",
  854. data: {
  855. userid: _this.userinfo.id,
  856. field: field,
  857. value: value
  858. }
  859. }).then((data) => {
  860. _this.userinfo = data;
  861. uni.setStorageSync('userinfo', data);
  862. _this.hideModal();
  863. }).catch((err) => {
  864. uni.showModal({
  865. title: '信息提示',
  866. content: err,
  867. showCancel: false
  868. });
  869. });
  870. },
  871. selectEmpTime: function(name, option) {
  872. if (option == 'add') {
  873. _this.userinfo.emp_time.push(name);
  874. } else if (option == 'del') {
  875. _this.userinfo.emp_time.remove(name);
  876. }
  877. },
  878. selectCommunity: function(name, option) {
  879. if (option == 'add') {
  880. _this.userinfo.work_place.push(name);
  881. } else if (option == 'del') {
  882. _this.userinfo.work_place.remove(name);
  883. }
  884. },
  885. toggleFilter: function(value) {
  886. if (value) {
  887. _this.empTimeOrigin = [..._this.userinfo.emp_time];
  888. } else {
  889. _this.userinfo.emp_time = [..._this.empTimeOrigin];
  890. }
  891. _this.empTimeModal = value;
  892. },
  893. selectComCate: function(name, option) {
  894. if (option == 'add') {
  895. _this.userinfo.com_cate.push(name);
  896. } else if (option == 'del') {
  897. _this.userinfo.com_cate.remove(name);
  898. }
  899. },
  900. toggleComCate: function(value) {
  901. if (value) {
  902. _this.comCateOrigin = [..._this.userinfo.com_cate];
  903. } else {
  904. _this.userinfo.com_cate = [..._this.comCateOrigin];
  905. }
  906. _this.comCateModal = value;
  907. },
  908. toggleCommunity: function(value) {
  909. if (value) {
  910. _this.communityOrigin = [..._this.userinfo.work_place];
  911. } else {
  912. _this.userinfo.work_place = [..._this.communityOrigin];
  913. }
  914. _this.communityModal = value;
  915. },
  916. subFilter: function() {
  917. _this.editFiled('emp_time', _this.userinfo.emp_time);
  918. _this.empTimeModal = false;
  919. },
  920. subCommunity: function() {
  921. _this.editFiled('work_place', _this.userinfo.work_place);
  922. _this.communityModal = false;
  923. },
  924. subComCate: function() {
  925. _this.editFiled('com_cate', _this.userinfo.com_cate);
  926. _this.comCateModal = false;
  927. },
  928. // 图片上传
  929. chooseImage: function(e) {
  930. uni.chooseImage({
  931. count: 12,
  932. sizeType: ['original', 'compressed'],
  933. sourceType: ['album'],
  934. success: (res) => {
  935. _this.$req.ajaxFile({
  936. path: "attachment/tplfieldimage",
  937. title: '正在上传',
  938. filePath: res.tempFilePaths[0],
  939. fileName: 'file',
  940. }).then((filedata) => {
  941. var data = JSON.parse(filedata.data);
  942. _this.userinfo.skill_cert.push(data.data.src);
  943. }).catch((err) => {
  944. uni.showModal({
  945. title: '信息提示',
  946. content: err,
  947. showCancel: false
  948. });
  949. });
  950. }
  951. });
  952. },
  953. viewImage: function(e) {
  954. uni.previewImage({
  955. urls: _this.userinfo.skill_cert,
  956. current: e.currentTarget.dataset.url
  957. });
  958. },
  959. delImg: function(e) {
  960. _this.userinfo.skill_cert.splice(e.currentTarget.dataset.index, 1);
  961. },
  962. }
  963. }
  964. </script>
  965. <style lang="scss">
  966. .filteremp {
  967. width: 750rpx;
  968. position: fixed;
  969. top: 0;
  970. z-index: 999;
  971. height: 100vh;
  972. background-color: #000;
  973. background: rgba(0, 0, 0, 0.5);
  974. }
  975. .filteremp .emp-box {
  976. width: 750rpx;
  977. position: absolute;
  978. bottom: 0;
  979. }
  980. .bottomEmpty {
  981. margin-top: 80rpx;
  982. height: 130rpx;
  983. }
  984. .bottomArea {
  985. position: fixed;
  986. bottom: 0;
  987. z-index: 100;
  988. width: 100%;
  989. height: 130rpx;
  990. display: flex;
  991. align-items: center;
  992. justify-content: center;
  993. background-color: #FFFFFF;
  994. box-shadow: -10rpx -12rpx 12rpx 2rpx rgba(52, 85, 73, 0.16);
  995. .bottomButton {
  996. margin: 0 28rpx;
  997. width: 696rpx;
  998. height: 90rpx;
  999. line-height: 90rpx;
  1000. background: #CA151C;
  1001. font-size: 33rpx;
  1002. text-align: center;
  1003. color: #FFFFFF;
  1004. border-radius: 10rpx;
  1005. }
  1006. }
  1007. </style>