myinfo.vue 28 KB

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