edit.vue 53 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579
  1. <template>
  2. <view>
  3. <u-navbar back-text="编辑资料"></u-navbar>
  4. <view class="edit-head">
  5. <u-avatar :src="personal_info.faceImage+'?x-oss-process=image/resize,m_fill,w_256,h_256'" size="160"
  6. :show-level="true" level-icon="edit-pen-fill" level-bg-color="#4E8DF6" @click="uploadPhoto"></u-avatar>
  7. </view>
  8. <view class="edit-form">
  9. <u-form :model="form" ref="uForm" label-width="160">
  10. <u-form-item label="姓名">
  11. <u-input :disabled='true' v-model="personal_info.realName" input-align="right" placeholder="" />
  12. </u-form-item>
  13. <u-form-item label="身份证号">
  14. <u-input :disabled='true' v-model="idCard" input-align="right" placeholder="" />
  15. </u-form-item>
  16. <u-form-item label="手机号">
  17. <u-input :disabled='true' v-model="personal_info.phone" input-align="right" placeholder="" />
  18. </u-form-item>
  19. <u-form-item label="性别">
  20. <u-input :disabled='true' v-model="form.sex" input-align="right" placeholder="男" />
  21. </u-form-item>
  22. <u-form-item label="年龄">
  23. <u-input :disabled='true' v-model="personal_info.age" input-align="right" placeholder="31岁" />
  24. </u-form-item>
  25. <u-form-item label="所属工会">
  26. <!-- <u-input v-model="personal_info.orgName" input-align="right" placeholder="荆州市总工会" type="select" @click="show_orgName = true" />
  27. <u-select v-model="show_orgName" :defaultValue="defaultData.orgId" mode="single-column" :list="orgNameList" @confirm="orgNameConfirm"></u-select> -->
  28. <u-input v-model="personal_info.orgName" input-align="right" type="select" placeholder="请选择所属工会"
  29. @click="getSearch" />
  30. </u-form-item>
  31. <u-form-item label="身高">
  32. <u-input v-model="form.height" input-align="right" placeholder="172cm" type="select"
  33. @click="show_height = true" />
  34. <u-select v-model="show_height" :defaultValue="defaultData.height" mode="single-column"
  35. :list="height_ranges" @confirm="heightConfirm"></u-select>
  36. </u-form-item>
  37. <u-form-item label="体重">
  38. <u-input v-model="form.weight" input-align="right" placeholder="75kg" type="select"
  39. @click="show_weight = true" />
  40. <u-select v-model="show_weight" :defaultValue="defaultData.weight" mode="single-column"
  41. :list="weight_ranges" @confirm="weightConfirm"></u-select>
  42. </u-form-item>
  43. <view class="edit-line"></view>
  44. <u-form-item label="出身地">
  45. <u-input v-model="personal_info.birthplaceN" input-align="right" placeholder="荆州市沙市区" type="select"
  46. @click='birthdayAddressChange' />
  47. <u-select v-model="show_birthday_address" mode="mutil-column-auto"
  48. :default-value='defaultData.address' :list="defaultColumns" @confirm="onBirthdayCityConfirm">
  49. </u-select>
  50. </u-form-item>
  51. <u-form-item label="户口所在地">
  52. <u-input v-model="personal_info.registeredResidenceN" input-align="right" placeholder="荆州市沙市区"
  53. type="select" @click='registeredResidenceAddressChange' />
  54. <u-select v-model="show_registered_residence" mode="mutil-column-auto"
  55. :default-value='defaultData.registered_residence' :list="defaultColumns"
  56. @confirm="onResidenceRegisteredCityConfirm"></u-select>
  57. </u-form-item>
  58. <u-form-item label="工作所在地">
  59. <u-input v-model="personal_info.workplaceN" input-align="right" placeholder="荆州市沙市区" type="select"
  60. @click='workAddressChange' />
  61. <u-select v-model="show_work_address" mode="mutil-column-auto"
  62. :default-value='defaultData.work_address' :list="defaultColumns" @confirm="onWorkCityConfirm">
  63. </u-select>
  64. </u-form-item>
  65. <view class="edit-line"></view>
  66. <u-form-item label="学历">
  67. <u-input v-model="personal_info.educationN" input-align="right" placeholder="大学本科" type="select"
  68. @click="show_education = true" />
  69. <u-select v-model="show_education" :defaultValue="defaultData.education" mode="single-column"
  70. :list="base_dictionary.xlList" @confirm="educationConfirm"></u-select>
  71. </u-form-item>
  72. <u-form-item label="行业">
  73. <u-input v-model="personal_info.industryN" input-align="right" placeholder="IT/互联网" type="select"
  74. @click="show_profession = true" />
  75. </u-form-item>
  76. <u-select v-model="show_profession" :defaultValue="defaultData.profession" mode="single-column"
  77. :list="base_dictionary.hyList" @confirm="professionConfirm"></u-select>
  78. <u-form-item label="工作单位">
  79. <u-input v-model="personal_info.workUnit" input-align="right" placeholder="湖北荆鹏软件开发有限公司" />
  80. </u-form-item>
  81. <u-form-item label="岗位">
  82. <u-input v-model="personal_info.post" input-align="right" placeholder="软件工程师" />
  83. </u-form-item>
  84. <view class="edit-line"></view>
  85. <u-form-item label="月薪">
  86. <u-input v-model="personal_info.salaryRangeN" input-align="right" placeholder="请选择" type="select"
  87. @click="show_salary = true" />
  88. <u-select v-model="show_salary" :defaultValue="defaultData.salary_range" mode="single-column"
  89. :list="base_dictionary.yxList" @confirm="salaryConfirm"></u-select>
  90. </u-form-item>
  91. <u-form-item label="住房状况">
  92. <u-input v-model="personal_info.housingSituationN" input-align="right" placeholder="请选择"
  93. type="select" @click="show_house = true" />
  94. <u-select v-model="show_house" :defaultValue="defaultData.house_status" mode="single-column"
  95. :list="base_dictionary.zfqkList" @confirm="houseConfirm"></u-select>
  96. </u-form-item>
  97. <u-form-item label="婚姻状况">
  98. <u-input v-model="personal_info.maritalStatusN" input-align="right" placeholder="未婚" type="select"
  99. @click="show_marriage = true" />
  100. <u-select v-model="show_marriage" :defaultValue="defaultData.marriage_status" mode="single-column"
  101. :list="base_dictionary.hyqkList" @confirm="marriageConfirm"></u-select>
  102. </u-form-item>
  103. <u-form-item label="子女状况">
  104. <u-input v-model="personal_info.childStatusN" input-align="right" placeholder="无" type="select"
  105. @click="show_children = true" />
  106. <u-select v-model="show_children" :defaultValue="defaultData.children_status" mode="single-column"
  107. :list="base_dictionary.znqkList" @confirm="childrenConfirm"></u-select>
  108. </u-form-item>
  109. <view class="edit-line"></view>
  110. <view class="edit-row">
  111. <p>兴趣爱好</p>
  112. <view class="edit-label">
  113. <span v-for="(item,index) in base_dictionary.hobbyInfoList" :key="index"
  114. :class="item.isMemberSelect ? 'active' : ''" @tap="selectInterest(index)">
  115. {{item.name}}
  116. </span>
  117. <!--
  118. <span class="active">摄影</span>
  119. <span>烹饪</span>
  120. <span>健身</span>
  121. <span>打游戏</span>
  122. <span>摄影</span>
  123. <span>烹饪</span>
  124. <span>健身</span>
  125. <span>打游戏</span>-->
  126. </view>
  127. </view>
  128. <view class="edit-line"></view>
  129. <view class="edit-row" @click="editSelfEvaluation">
  130. <view class="u-flex u-row-between ">
  131. <p>自我评价</p>
  132. <u-icon custom-prefix="custom-icon" name="youjiantou"></u-icon>
  133. </view>
  134. <view class="edit-text">
  135. {{personal_info.selfEvaluation}}
  136. </view>
  137. </view>
  138. <view class="edit-title">择偶标准</view>
  139. <u-form-item label="年龄范围">
  140. <u-input v-model="personal_info.taAgeRangeN" input-align="right" placeholder="20~35" type="select"
  141. @click="show_ta_age_ranges = true" />
  142. <u-select v-model="show_ta_age_ranges" :defaultValue="defaultData.ta_age_range" mode="single-column"
  143. :list="base_dictionary.nlfwList" @confirm="taAgeRangeConfirm"></u-select>
  144. </u-form-item>
  145. <u-form-item label="月薪">
  146. <u-input v-model="personal_info.taIncomeRangeN" input-align="right" placeholder="不限" type="select"
  147. @click="show_ta_salary = true" />
  148. <u-select v-model="show_ta_salary" :defaultValue="defaultData.ta_salary_range" mode="single-column"
  149. :list="base_dictionary.yxList" @confirm="taSalaryRangeConfirm"></u-select>
  150. </u-form-item>
  151. <u-form-item label="学历">
  152. <u-input v-model="personal_info.taEduN" input-align="right" placeholder="不限" type="select"
  153. @click="show_ta_education = true" />
  154. <u-select v-model="show_ta_education" :defaultValue="defaultData.ta_education" mode="single-column"
  155. :list="base_dictionary.xlList" @confirm="taEducationConfirm"></u-select>
  156. </u-form-item>
  157. <u-form-item label="职业">
  158. <u-input v-model="personal_info.taOccupation" input-align="right" placeholder="不限" />
  159. </u-form-item>
  160. <u-form-item label="所在地">
  161. <u-input v-model="personal_info.taWorkplaceN" :defaultValue="defaultData.ta_work_address"
  162. input-align="right" placeholder="请选择" type="select" @click='taWorkAddressChange' />
  163. <u-select v-model="show_ta_work_address" mode="mutil-column-auto"
  164. :default-value='defaultData.ta_work_address' :list="defaultColumns"
  165. @confirm="onTaWorkCityConfirm"></u-select>
  166. </u-form-item>
  167. <view class="edit-row" @click="editTaOther">
  168. <view class="u-flex u-row-between ">
  169. <p>其他要求</p>
  170. <u-icon custom-prefix="custom-icon" name="youjiantou"></u-icon>
  171. </view>
  172. <view class="edit-text">
  173. {{personal_info.taOther}}
  174. </view>
  175. </view>
  176. </u-form>
  177. </view>
  178. <view>
  179. <uni-popup ref="alertDialog" type="dialog">
  180. <!-- <uni-popup-dialog type="success" title="提示" :content="content" @confirm="confirm"
  181. @close="dialogClose"></uni-popup-dialog>-->
  182. </uni-popup>
  183. <u-modal v-model="submitShow" @confirm="confirm" show-cancel-button='true' ref="uModal" :asyncClose="true"
  184. :content="content"></u-modal>
  185. </view>
  186. <view class="personal-btn">
  187. <u-button type="error" shape="circle" :custom-style="customStyle" @click="formsubmit">
  188. <span>保存</span>
  189. </u-button>
  190. </view>
  191. <view>
  192. <u-popup border-radius="20" v-model="showSelfEvaluation" @close="close" mode="center" length="90%"
  193. height="600rpx">
  194. <view style="display: flex; flex-direction: column;">
  195. <view style="display:flex;flex-direction:row;margin-top: 50rpx;justify-content: space-between; ">
  196. <view
  197. style="margin-left: 50rpx;font-weight: bold!important; font-size:30rpx;margin-bottom: 20rpx;">
  198. 自我评价</view>
  199. <view style="font-color:#E5E7EA;margin-right: 50rpx;">{{selfEvaluation.length}}/200</view>
  200. </view>
  201. <view
  202. style="display: flex; uni-textarea; margin-bottom: 20rpx;justify-content: center;align-items:center;">
  203. <textarea
  204. style="width: 80%; padding-top: 10rpx;padding-bottom: 10rpx; border-radius:30rpx;padding-left: 20rpx;padding-right: 20rpx; background-color: #E5E7EA;overflow: auto;"
  205. :adjust-position="false" placeholder="请填写内容" maxlength="200" name="summary"
  206. v-model="selfEvaluation">
  207. </textarea>
  208. </view>
  209. <view>
  210. <button style="border-radius:100rpx;background-color: #FF5E5E;width:75%;color:#FFFFFF"
  211. @click="saveSelfEvaluation">保存</button>
  212. </view>
  213. </view>
  214. </u-popup>
  215. </view>
  216. <view>
  217. <u-popup border-radius="20" v-model="showTaOther" @close="closeTaOther" mode="center" length="90%"
  218. height="600rpx">
  219. <view style="display: flex; flex-direction: column;">
  220. <view style="display:flex;flex-direction:row;margin-top: 50rpx;justify-content: space-between; ">
  221. <view
  222. style="margin-left: 50rpx;font-weight: bold!important; font-size:30rpx;margin-bottom: 20rpx;">
  223. 其他要求</view>
  224. <view style="font-color:#E5E7EA;margin-right: 50rpx;">{{taOther.length}}/200</view>
  225. </view>
  226. <view
  227. style="display: flex; uni-textarea; margin-bottom: 20rpx;justify-content: center;align-items:center;">
  228. <textarea
  229. style="width: 80%; padding-top: 10rpx;padding-bottom: 10rpx; border-radius:30rpx;padding-left: 20rpx;padding-right: 20rpx; background-color: #E5E7EA;overflow: auto;"
  230. :adjust-position="false" placeholder="请填写内容" maxlength="200" name="summary"
  231. v-model="taOther">
  232. </textarea>
  233. </view>
  234. <view>
  235. <button style="border-radius:100rpx;background-color: #FF5E5E;width:75%;color:#FFFFFF"
  236. @click="saveTaOther">保存</button>
  237. </view>
  238. </view>
  239. </u-popup>
  240. </view>
  241. <!--
  242. <u-action-sheet
  243. :show="show_education"
  244. :actions="base_dictionary.xlList"
  245. title="请选择学历"
  246. description=""
  247. @close="show_education = false"
  248. @select="educationSelect"
  249. >
  250. </u-action-sheet>
  251. <u-action-sheet
  252. :show="show_salary"
  253. :actions="base_dictionary.yxList"
  254. title="请选择月薪"
  255. description=""
  256. @close="show_salary = false"
  257. @select="salarySelect"
  258. >
  259. </u-action-sheet>
  260. <u-action-sheet
  261. :show="show_profession"
  262. :actions="base_dictionary.hyList"
  263. title="请选择行业"
  264. description=""
  265. @close="show_profession = false"
  266. @select="professionSelect"
  267. >
  268. </u-action-sheet>
  269. <u-action-sheet
  270. :show="show_house"
  271. :actions="base_dictionary.zfqkList"
  272. title="请选择住房状况"
  273. description=""
  274. @close="show_house = false"
  275. @select="houseSelect"
  276. >
  277. </u-action-sheet>
  278. <u-action-sheet
  279. :show="show_marriage"
  280. :actions="base_dictionary.hyList"
  281. title="请选择婚姻状况"
  282. description=""
  283. @close="show_marriage = false"
  284. @select="marriageSelect"
  285. >
  286. </u-action-sheet>
  287. <u-action-sheet
  288. :show="show_children"
  289. :actions="base_dictionary.znqkList"
  290. title="请选择子女状况"
  291. description=""
  292. @close="show_children = false"
  293. @select="childrenSelect"
  294. >
  295. </u-action-sheet>
  296. <u-action-sheet
  297. :show="show_ta_age_ranges"
  298. :actions="base_dictionary.nlfwList"
  299. title="请选择年龄范围"
  300. description=""
  301. @close="show_ta_age_ranges = false"
  302. @select="taAgeRangeSelect"
  303. >
  304. </u-action-sheet>
  305. <u-action-sheet
  306. :show="show_ta_education"
  307. :actions="base_dictionary.xlList"
  308. title="请选择学历"
  309. description=""
  310. @close="show_ta_education = false"
  311. @select="taEducationSelect"
  312. >
  313. </u-action-sheet>
  314. <u-action-sheet
  315. :show="show_ta_salary"
  316. :actions="base_dictionary.nlfwList"
  317. title="请选择月薪"
  318. description="xxxxxxx"
  319. @close="show_ta_salary = false"
  320. @select="taSalarySelect"
  321. >
  322. </u-action-sheet>-->
  323. </view>
  324. </template>
  325. <script>
  326. import * as loginApi from '@/apis/login.js'
  327. // import mpvueCityPicker from "@/pagesB/components/mpvue-citypicker/mpvueCityPicker.vue";
  328. // import mpvueCityPicker from "../../pagesB/components/mpvue-citypicker/mpvueCityPicker.vue";
  329. import {
  330. provinceData,
  331. cityData,
  332. areaData,
  333. setCityData,
  334. getCityData,
  335. getCityPosition
  336. } from '@/apis/city.js';
  337. let _self;
  338. export default {
  339. /* components:{
  340. mpvueCityPicker
  341. },*/
  342. data() {
  343. return {
  344. personalInfoChange: {},
  345. change: false,
  346. submitShow: false,
  347. content: '个人资料信息已修改,提交后需后台重新审核资料,是否继续提交?',
  348. orgNameList: [],
  349. defaultColumns: [],
  350. cityPickerValueDefault: [16, 6, 0],
  351. customStyle: {
  352. background: '#FF5E5E'
  353. },
  354. defaultData: {
  355. orgid: [1],
  356. height: [45],
  357. weight: [45],
  358. address: [16, 6, 0],
  359. registered_residence: [16, 6, 0],
  360. work_address: [16, 6, 0],
  361. education: [1],
  362. profession: [1],
  363. salary_range: [1],
  364. house_status: [1],
  365. marriage_status: [1],
  366. children_status: [1],
  367. ta_age_range: [1],
  368. ta_salary_range: [1],
  369. ta_education: [1],
  370. ta_work_address: [16, 6, 0]
  371. },
  372. form: {
  373. orgName: '',
  374. name: '',
  375. sex: '',
  376. height: '',
  377. weight: '',
  378. address: '',
  379. registered_residence: '',
  380. work_address: '',
  381. work_corporation: '',
  382. work_post: '',
  383. education: '',
  384. profession: '',
  385. salary_range: '',
  386. house_status: '',
  387. marriage_status: '',
  388. children_status: '',
  389. self_assess: '',
  390. addressId: '',
  391. registered_residenceId: '',
  392. work_addressId: '',
  393. educationId: '',
  394. professionId: '',
  395. salary_rangeId: '',
  396. house_statusId: '',
  397. marriage_statusId: '',
  398. children_statusId: '',
  399. },
  400. selfEvaluation: '',
  401. taOther: '',
  402. personal_info: {
  403. faceImage: ' /static/img/sexMan.png'
  404. },
  405. height_ranges: [],
  406. weight_ranges: [],
  407. showSelfEvaluation: false,
  408. showTaOther: false,
  409. show_orgName: false,
  410. show_height: false,
  411. show_weight: false,
  412. show_birthday_address: false,
  413. show_registered_residence: false,
  414. show_work_address: false,
  415. show_salary: false,
  416. show_profession: false,
  417. show_education: false,
  418. show_house: false,
  419. show_marriage: false,
  420. show_children: false,
  421. show_ta_age_ranges: false,
  422. show_ta_education: false,
  423. show_ta_salary: false,
  424. show_ta_work_address: false,
  425. base_dictionary: {
  426. zfqkList: [],
  427. yxList: [],
  428. znqkList: [],
  429. qyList: [],
  430. xlList: [],
  431. hyList: [],
  432. nlfwList: [],
  433. hyqkList: [],
  434. hobbyInfoList: [],
  435. }
  436. }
  437. },
  438. computed: {
  439. idCard() {
  440. if (this.personal_info.idCard && this.personal_info.idCard.length >= 15) {
  441. let prefix = this.personal_info.idCard.substr(0, 5);
  442. let suffix = this.personal_info.idCard.substr(this.personal_info.idCard.length - 3, 3);
  443. return prefix + '********' + suffix;
  444. }
  445. return '42100********111'
  446. }
  447. },
  448. onLoad() {
  449. _self = this;
  450. _self.getOrgNameList(true);
  451. this.personal_info = this.carhelp.getPersonInfo();
  452. // //('个人信息'+JSON.stringify(this.personal_info))
  453. let subject = {
  454. subject: ''
  455. }
  456. uni.showLoading({
  457. title: "加载中",
  458. mask: true,
  459. })
  460. loginApi.getBaseDictionary(subject).then(function(data) {
  461. uni.hideLoading();
  462. ////('基础字典'+JSON.stringify(data));
  463. let personal_info = _self.carhelp.getPersonInfo();
  464. if (data.data) {
  465. _self.base_dictionary = data.data;
  466. if (_self.base_dictionary.zfqkList) {
  467. for (let i = 0; i < _self.base_dictionary.zfqkList.length; i++) {
  468. _self.base_dictionary.zfqkList[i].label = _self.base_dictionary.zfqkList[i].name;
  469. }
  470. if (_self.personal_info.housingSituation != null) {
  471. let index = _self.base_dictionary.zfqkList.findIndex(item => item.value ===
  472. personal_info.housingSituation);
  473. if (index >= 0) {
  474. _self.defaultData.house_status = [index]
  475. _self.personal_info.housingSituationN = _self.base_dictionary.zfqkList[index].name;
  476. _self.personal_info.housingSituation = _self.base_dictionary.zfqkList[index].value;
  477. }
  478. }
  479. /*
  480. if(_self.personal_info.housingSituation!=null && _self.personal_info.housingSituation<= _self.base_dictionary.zfqkList.length)
  481. {
  482. _self.personal_info.housingSituationN =_self.base_dictionary.zfqkList[_self.personal_info.housingSituation-1].label
  483. }*/
  484. }
  485. ////('住房情况'+JSON.stringify(_self.base_dictionary.zfqkList));
  486. if (_self.base_dictionary.yxList) {
  487. for (let i = 0; i < _self.base_dictionary.yxList.length; i++) {
  488. _self.base_dictionary.yxList[i].label = _self.base_dictionary.yxList[i].name;
  489. }
  490. if (_self.personal_info.salaryRange != null) {
  491. let index = _self.base_dictionary.yxList.findIndex(item => item.value === personal_info
  492. .salaryRange);
  493. if (index >= 0) {
  494. _self.defaultData.salary_range = [index]
  495. _self.personal_info.salaryRangeN = _self.base_dictionary.yxList[index].name;
  496. _self.personal_info.salaryRange = _self.base_dictionary.yxList[index].value;
  497. }
  498. }
  499. if (_self.personal_info.taIncomeRange != null) {
  500. let index = _self.base_dictionary.yxList.findIndex(item => item.value === personal_info
  501. .taIncomeRange);
  502. if (index >= 0) {
  503. _self.defaultData.ta_salary_range = [index]
  504. _self.personal_info.taIncomeRangeN = _self.base_dictionary.yxList[index].name;
  505. _self.personal_info.taIncomeRange = _self.base_dictionary.yxList[index].value;
  506. }
  507. }
  508. }
  509. if (_self.base_dictionary.znqkList) {
  510. for (let i = 0; i < _self.base_dictionary.znqkList.length; i++) {
  511. _self.base_dictionary.znqkList[i].label = _self.base_dictionary.znqkList[i].name;
  512. }
  513. if (_self.personal_info.childStatus != null) {
  514. let index = _self.base_dictionary.znqkList.findIndex(item => item.value ===
  515. personal_info.childStatus);
  516. if (index >= 0) {
  517. _self.defaultData.children_status = [index]
  518. _self.personal_info.childStatusN = _self.base_dictionary.znqkList[index].name;
  519. _self.personal_info.childStatus = _self.base_dictionary.znqkList[index].value;
  520. }
  521. }
  522. }
  523. if (_self.base_dictionary.xlList) {
  524. for (let i = 0; i < _self.base_dictionary.xlList.length; i++) {
  525. _self.base_dictionary.xlList[i].label = _self.base_dictionary.xlList[i].name;
  526. }
  527. if (_self.personal_info.education != null) {
  528. let index = _self.base_dictionary.xlList.findIndex(item => item.value === personal_info
  529. .education);
  530. if (index >= 0) {
  531. _self.defaultData.education = [index]
  532. _self.personal_info.educationN = _self.base_dictionary.xlList[index].name;
  533. _self.personal_info.education = _self.base_dictionary.xlList[index].value;
  534. }
  535. }
  536. if (_self.personal_info.taEdu != null) {
  537. let index = _self.base_dictionary.xlList.findIndex(item => item.value === personal_info
  538. .taEdu);
  539. if (index >= 0) {
  540. _self.defaultData.ta_education = [index]
  541. _self.personal_info.taEduN = _self.base_dictionary.xlList[index].name;
  542. _self.personal_info.taEdu = _self.base_dictionary.xlList[index].value;
  543. }
  544. }
  545. }
  546. if (_self.base_dictionary.hyList) {
  547. for (let i = 0; i < _self.base_dictionary.hyList.length; i++) {
  548. _self.base_dictionary.hyList[i].label = _self.base_dictionary.hyList[i].name;
  549. }
  550. if (_self.personal_info.industry != null) {
  551. let index = _self.base_dictionary.hyList.findIndex(item => item.value === personal_info
  552. .industry);
  553. if (index >= 0) {
  554. _self.defaultData.profession = [index]
  555. _self.personal_info.industryN = _self.base_dictionary.hyList[index].name;
  556. _self.personal_info.industry = _self.base_dictionary.hyList[index].value;
  557. }
  558. }
  559. /*
  560. if(_self.personal_info.industry!=null && _self.personal_info.industry<= _self.base_dictionary.hyList.length)
  561. {
  562. _self.personal_info.industryN =_self.base_dictionary.hyList[_self.personal_info.industry-1].label
  563. }*/
  564. }
  565. // //('行业情况'+JSON.stringify(_self.base_dictionary.hyList));
  566. if (_self.base_dictionary.nlfwList) {
  567. for (let i = 0; i < _self.base_dictionary.nlfwList.length; i++) {
  568. _self.base_dictionary.nlfwList[i].label = _self.base_dictionary.nlfwList[i].name;
  569. }
  570. if (_self.personal_info.taAgeRange != null) {
  571. let index = _self.base_dictionary.nlfwList.findIndex(item => item.value ===
  572. personal_info.taAgeRange);
  573. if (index >= 0) {
  574. _self.defaultData.ta_age_range = [index]
  575. _self.personal_info.taAgeRangeN = _self.base_dictionary.nlfwList[index].name;
  576. _self.personal_info.taAgeRange = _self.base_dictionary.nlfwList[index].value;
  577. }
  578. }
  579. /*
  580. if(_self.personal_info.taAgeRange!=null && _self.personal_info.taAgeRange<= _self.base_dictionary.nlfwList.length)
  581. {
  582. _self.personal_info.taAgeRangeN =_self.base_dictionary.nlfwList[_self.personal_info.taAgeRange-1].label
  583. }*/
  584. }
  585. ////('年龄范围'+JSON.stringify(_self.base_dictionary.nlfwList));
  586. if (_self.base_dictionary.hyqkList) {
  587. for (let i = 0; i < _self.base_dictionary.hyqkList.length; i++) {
  588. _self.base_dictionary.hyqkList[i].label = _self.base_dictionary.hyqkList[i].name;
  589. }
  590. if (_self.personal_info.maritalStatus != null) {
  591. let index = _self.base_dictionary.hyqkList.findIndex(item => item.value ===
  592. personal_info.maritalStatus);
  593. if (index >= 0) {
  594. _self.defaultData.ta_age_range = [index]
  595. _self.personal_info.maritalStatusN = _self.base_dictionary.hyqkList[index].name;
  596. _self.personal_info.maritalStatus = _self.base_dictionary.hyqkList[index].value;
  597. }
  598. }
  599. /*
  600. if(_self.personal_info.maritalStatus!=null && _self.personal_info.maritalStatus<= _self.base_dictionary.hyqkList.length)
  601. {
  602. _self.personal_info.maritalStatusN =_self.base_dictionary.hyqkList[_self.personal_info.maritalStatus-1].label
  603. }*/
  604. }
  605. ////('婚姻情况'+JSON.stringify(_self.base_dictionary.hyqkList));
  606. if (_self.base_dictionary.hobbyInfoList) {
  607. for (let i = 0; i < _self.base_dictionary.hobbyInfoList.length; i++) {
  608. _self.base_dictionary.hobbyInfoList[i].isMemberSelect = false;
  609. _self.base_dictionary.hobbyInfoList[i].label = _self.base_dictionary.hobbyInfoList[i]
  610. .name;
  611. if (_self.personal_info.hobby != null) {
  612. // //('hobby'+JSON.stringify(_self.personal_info.hobby))
  613. if (_self.personal_info.hobby.indexOf(_self.base_dictionary.hobbyInfoList[i].id) >=
  614. 0) {
  615. _self.base_dictionary.hobbyInfoList[i].isMemberSelect = true;
  616. // //('选中'+JSON.stringify(_self.base_dictionary.hobbyInfoList[i]))
  617. }
  618. }
  619. }
  620. }
  621. // //('兴趣爱好'+JSON.stringify(_self.base_dictionary.hobbyInfoList));
  622. if (_self.personal_info.birthplace != null) {
  623. _self.personal_info.birthplaceN = getCityData(Number(_self.personal_info.birthplace));
  624. // //('address'+JSON.stringify(_self.form.addressId))
  625. }
  626. if (_self.personal_info.registeredResidence != null) {
  627. _self.personal_info.registeredResidenceN = getCityData(Number(_self.personal_info
  628. .registeredResidence));
  629. }
  630. if (_self.personal_info.workplace != null) {
  631. _self.personal_info.workplaceN = getCityData(Number(_self.personal_info.workplace));
  632. }
  633. if (_self.personal_info.taWorkplace != null) {
  634. _self.personal_info.taWorkplaceN = getCityData(Number(_self.personal_info.taWorkplace));
  635. }
  636. }
  637. _self.personalInfoChange = Object.assign({}, _self.personal_info);
  638. //(_self.personalInfoChange)
  639. }, function(err) {
  640. //('获取基础字典错误' + JSON.stringify(err))
  641. uni.hideLoading();
  642. })
  643. for (let i = 130; i <= 220; i++) {
  644. let height_range = {
  645. value: i,
  646. label: i.toString() + "cm"
  647. };
  648. this.height_ranges.push(height_range);
  649. //this.height_ranges.push(i.toString());
  650. }
  651. for (let i = 20; i <= 120; i++) {
  652. // this.weight_ranges.push(i.toString());
  653. let weight_range = {
  654. value: i,
  655. label: i.toString() + "kg"
  656. };
  657. this.weight_ranges.push(weight_range);
  658. }
  659. if (this.personal_info) {
  660. this.form.sex = this.personal_info.gender ? '女' : '男'
  661. if (this.personal_info.height) {
  662. this.form.height = this.personal_info.height + 'cm'
  663. _self.defaultData.height = [_self.height_ranges.findIndex(item => item.value === _self.personal_info
  664. .height)]
  665. }
  666. if (this.personal_info.weight) {
  667. this.form.weight = this.personal_info.weight + 'kg'
  668. _self.defaultData.weight = [_self.weight_ranges.findIndex(item => item.value === _self.personal_info
  669. .weight)]
  670. }
  671. }
  672. if (provinceData.length <= 0) {
  673. uni.showLoading({
  674. title: "加载中",
  675. mask: true,
  676. })
  677. loginApi.getCityList().then(function(data) {
  678. uni.hideLoading();
  679. // //('获取城市成功'+JSON.stringify(data));
  680. if (data.result && data.data) {
  681. setCityData(data.data);
  682. _self.init_city_data();
  683. //_self.$refs.mpvuebirtydayCityPicker.setCityData(data.data);
  684. ////('province data '+JSON.stringify(provinceData))
  685. if (_self.personal_info.birthplace != null) {
  686. _self.personal_info.birthplaceN = getCityData(Number(_self.personal_info.birthplace));
  687. _self.defaultData.address = getCityPosition(Number(_self.personal_info.birthplace));
  688. //this.defaultData.registered_residence = this.defaultData.address;
  689. //this.defaultData.work_address = this.defaultData.address; //
  690. //('address' + JSON.stringify(_self.defaultData.address))
  691. }
  692. if (_self.personal_info.registeredResidence != null) {
  693. _self.personal_info.registeredResidenceN = getCityData(Number(_self.personal_info
  694. .registeredResidence));
  695. _self.defaultData.registered_residence = getCityPosition(Number(_self.personal_info
  696. .registeredResidence));
  697. }
  698. if (_self.personal_info.workplace != null) {
  699. _self.personal_info.workplaceN = getCityData(Number(_self.personal_info.workplace));
  700. _self.defaultData.work_address = getCityPosition(Number(_self.personal_info
  701. .workplace));
  702. }
  703. if (_self.personal_info.taWorkplace != null) {
  704. _self.personal_info.taWorkplaceN = getCityData(Number(_self.personal_info
  705. .taWorkplace));
  706. _self.defaultData.ta_work_address = getCityPosition(Number(_self.personal_info
  707. .taWorkplace));
  708. }
  709. }
  710. }, function(err) {
  711. //('获取城市列表错误' + JSON.stringify(err))
  712. uni.hideLoading();
  713. })
  714. } else {
  715. _self.init_city_data();
  716. if (_self.personal_info.birthplace != null) {
  717. _self.personal_info.birthplaceN = getCityData(Number(_self.personal_info.birthplace));
  718. _self.defaultData.address = getCityPosition(Number(_self.personal_info.birthplace));
  719. //this.defaultData.registered_residence = this.defaultData.address;
  720. //this.defaultData.work_address = this.defaultData.address; //
  721. //('address' + JSON.stringify(_self.defaultData.address))
  722. }
  723. if (_self.personal_info.registeredResidence != null) {
  724. _self.personal_info.registeredResidenceN = getCityData(Number(_self.personal_info
  725. .registeredResidence));
  726. _self.defaultData.registered_residence = getCityPosition(Number(_self.personal_info
  727. .registeredResidence));
  728. }
  729. if (_self.personal_info.workplace != null) {
  730. _self.personal_info.workplaceN = getCityData(Number(_self.personal_info.workplace));
  731. _self.defaultData.work_address = getCityPosition(Number(_self.personal_info.workplace));
  732. }
  733. if (_self.personal_info.taWorkplace != null) {
  734. _self.personal_info.taWorkplaceN = getCityData(Number(_self.personal_info.taWorkplace));
  735. _self.defaultData.ta_work_address = getCityPosition(Number(_self.personal_info.taWorkplace));
  736. }
  737. }
  738. // _self.personalInfoChange =new Object(_self.personal_info);
  739. _self.personalInfoChange = Object.assign({}, _self.personal_info);
  740. //(_self.personalInfoChange)
  741. // //('个人信息'+JSON.stringify(this.personal_info))
  742. },
  743. onShow() {
  744. var item = this.carhelp.get("searchOrgItem")
  745. if (item) {
  746. //(item)
  747. this.personal_info.orgName = item.name;
  748. this.personal_info.orgId = item.id;
  749. }
  750. },
  751. methods: {
  752. getSearch() {
  753. uni.navigateTo({
  754. url: '/pagesA/pages/login/search'
  755. })
  756. },
  757. getOrgNameList(bl) {
  758. _self = this;
  759. uni.showLoading({
  760. title: "加载中",
  761. mask: true,
  762. })
  763. if (bl) {
  764. _self.orgNameList = [];
  765. }
  766. loginApi.orgList().then((res) => {
  767. _self.orgNameList = res.data.data;
  768. if (_self.orgNameList) {
  769. for (let i = 0; i < _self.orgNameList.length; i++) {
  770. _self.orgNameList[i].label = _self.orgNameList[i].name;
  771. _self.orgNameList[i].value = _self.orgNameList[i].id;
  772. }
  773. if (_self.personal_info.orgId != null) {
  774. let index = _self.orgNameList.findIndex(item => item.value === personal_info.orgId);
  775. if (index >= 0) {
  776. _self.defaultData.orgId = [index]
  777. _self.personal_info.orgName = _self.orgNameList[index].name;
  778. _self.personal_info.orgId = _self.orgNameList[index].id;
  779. }
  780. }
  781. }
  782. uni.hideLoading();
  783. })
  784. .catch((error) => {
  785. uni.showToast({
  786. title: error,
  787. icon: "none"
  788. })
  789. })
  790. },
  791. init_city_data() {
  792. for (let i = 0; i < provinceData.length; i++) {
  793. let province = provinceData[i];
  794. if (cityData[i].length > 0) {
  795. province.children = [];
  796. for (let j = 0; j < cityData[i].length; j++) {
  797. let city = cityData[i][j];
  798. if (areaData[i][j].length > 0) {
  799. city.children = [];
  800. for (let k = 0; k < areaData[i][j].length; k++) {
  801. city.children.push(areaData[i][j][k])
  802. }
  803. }
  804. province.children.push(city);
  805. }
  806. }
  807. this.defaultColumns.push(province);
  808. }
  809. },
  810. saveSelfEvaluation() {
  811. this.showSelfEvaluation = false;
  812. this.personal_info.selfEvaluation = this.selfEvaluation;
  813. //('自我评价' + JSON.stringify(this.selfEvaluation))
  814. },
  815. saveTaOther() {
  816. this.showTaOther = false;
  817. this.personal_info.taOther = this.taOther;
  818. },
  819. editSelfEvaluation() {
  820. if (this.personal_info.selfEvaluation != null) {
  821. this.selfEvaluation = this.personal_info.selfEvaluation;
  822. } else {
  823. this.selfEvaluation = ''
  824. }
  825. this.showSelfEvaluation = true
  826. //('editSelfEvaluation')
  827. },
  828. editTaOther(){
  829. if(this.personal_info.taOther!=null)
  830. {
  831. this.taOther = this.personal_info.taOther;
  832. }else
  833. {
  834. this.taOther = ''
  835. }
  836. this.showTaOther = true
  837. //('editTaOther')
  838. },
  839. open() {
  840. //('open');
  841. },
  842. close() {
  843. this.showSelfEvaluation = false
  844. //('close');
  845. },
  846. closeTaOther() {
  847. this.showTaOther = false;
  848. },
  849. selectInterest(index) {
  850. // let interest = this.interests;
  851. this.base_dictionary.hobbyInfoList[index].isMemberSelect = !this.base_dictionary.hobbyInfoList[index]
  852. .isMemberSelect;
  853. //('item' + JSON.stringify(this.base_dictionary.hobbyInfoList[index]))
  854. },
  855. birthdayAddressChange() {
  856. _self.show_birthday_address = true;
  857. // //('birthdayAddress change')
  858. // this.$refs.mpvuebirtydayCityPicker.show()
  859. },
  860. registeredResidenceAddressChange() {
  861. _self.show_registered_residence = true;
  862. // this.$refs.mpvueRegisteredResidenceCityPicker.show()
  863. },
  864. workAddressChange() {
  865. _self.show_work_address = true;
  866. // this.$refs.mpvueWorkCityPicker.show()
  867. },
  868. taWorkAddressChange() {
  869. _self.show_ta_work_address = true;
  870. // this.$refs.mpvueTaWorkCityPicker.show()
  871. },
  872. onBirthdayCityConfirm(e) {
  873. // //('e'+JSON.stringify(e))
  874. //this.defaultData.address = [this.base_dictionary.znqkList.findIndex(item => item.value === e[0].value)]
  875. //this.defaultData.address = [17,1,1]
  876. let province = e[0];
  877. let city = e[1];
  878. let area = e[2];
  879. this.defaultData.address = getCityPosition(area.value);
  880. this.defaultData.registered_residence = this.defaultData.address;
  881. this.defaultData.work_address = this.defaultData.address;
  882. // //('address '+JSON.stringify(this.defaultData.address))
  883. this.personal_info.birthplaceN = '';
  884. e.map((val, index) => {
  885. // this.result += this.result == '' ? val.label : '-' + val.label;
  886. let result = val.label
  887. _self.personal_info.birthplace = val.value;
  888. let name = getCityData(Number(val.value));
  889. _self.personal_info.birthplaceN = name;
  890. //
  891. _self.personal_info.registeredResidenceN = _self.personal_info.birthplaceN;
  892. _self.personal_info.registeredResidence = _self.personal_info.birthplace;
  893. _self.personal_info.workplaceN = _self.personal_info.birthplaceN;
  894. _self.personal_info.workplace = _self.personal_info.birthplace;
  895. })
  896. // //('地址选择'+JSON.stringify(_self.form.addressId))
  897. },
  898. onResidenceRegisteredCityConfirm(e) {
  899. let province = e[0];
  900. let city = e[1];
  901. let area = e[2];
  902. this.defaultData.registered_residence = getCityPosition(area.value);
  903. // //('address '+JSON.stringify(this.defaultData.address))
  904. this.personal_info.registeredResidenceN = '';
  905. e.map((val, index) => {
  906. // this.result += this.result == '' ? val.label : '-' + val.label;
  907. let result = val.label
  908. let name = getCityData(Number(val.value));
  909. _self.personal_info.registeredResidenceN = name;
  910. _self.personal_info.registeredResidence = val.value;
  911. })
  912. },
  913. onWorkCityConfirm(e) {
  914. let province = e[0];
  915. let city = e[1];
  916. let area = e[2];
  917. this.defaultData.work_address = getCityPosition(area.value);
  918. // //('address '+JSON.stringify(this.defaultData.address))
  919. this.personal_info.workplaceN = '';
  920. e.map((val, index) => {
  921. // this.result += this.result == '' ? val.label : '-' + val.label;
  922. let result = val.label
  923. let name = getCityData(Number(val.value));
  924. _self.personal_info.workplaceN = name;
  925. _self.personal_info.workplace = val.value;
  926. })
  927. },
  928. onTaWorkCityConfirm(e) {
  929. let province = e[0];
  930. let city = e[1];
  931. let area = e[2];
  932. this.defaultData.ta_work_address = getCityPosition(area.value);
  933. // //('address '+JSON.stringify(this.defaultData.address))
  934. this.personal_info.taWorkplaceN = '';
  935. e.map((val, index) => {
  936. // this.result += this.result == '' ? val.label : '-' + val.label;
  937. let result = val.label
  938. let name = getCityData(Number(val.value));
  939. _self.personal_info.taWorkplaceN = name;
  940. _self.personal_info.taWorkplace = val.value;
  941. })
  942. },
  943. formsubmit() {
  944. this.personal_info.hobby = ''
  945. for (let i = 0; i < this.base_dictionary.hobbyInfoList.length; i++) {
  946. if (this.base_dictionary.hobbyInfoList[i].isMemberSelect) {
  947. if (this.personal_info.hobby.length > 0) {
  948. this.personal_info.hobby += ','
  949. }
  950. this.personal_info.hobby += this.base_dictionary.hobbyInfoList[i].id;
  951. }
  952. }
  953. // //(this.personalInfoChange)
  954. // //(this.personal_info)
  955. for (var item in this.personal_info) {
  956. if (this.personalInfoChange[item] != this.personal_info[item]) {
  957. this.change = true;
  958. // //(this.personalInfoChange[item])
  959. // //(this.personal_info[item])
  960. }
  961. }
  962. if (!this.change) {
  963. uni.switchTab({
  964. url: './index'
  965. })
  966. } else {
  967. this.submitShow = true;
  968. }
  969. },
  970. confirm() {
  971. //('确认保存')
  972. let personal_info = {
  973. type: 1,
  974. id: this.personal_info.id
  975. };
  976. let _personal_info = this.personal_info;
  977. if (_personal_info.faceImage) {
  978. personal_info.faceImage = _personal_info.faceImage;
  979. //('faceImage' + personal_info.faceImage)
  980. }
  981. personal_info.hobby = ''
  982. for (let i = 0; i < _self.base_dictionary.hobbyInfoList.length; i++) {
  983. if (_self.base_dictionary.hobbyInfoList[i].isMemberSelect) {
  984. if (personal_info.hobby.length > 0) {
  985. personal_info.hobby += ','
  986. }
  987. personal_info.hobby += _self.base_dictionary.hobbyInfoList[i].id;
  988. }
  989. }
  990. if (_personal_info.selfEvaluation) {
  991. personal_info.selfEvaluation = _personal_info.selfEvaluation;
  992. //('selfEvaluation' + personal_info.selfEvaluation);
  993. }
  994. if (_personal_info.orgId) {
  995. personal_info.orgId = _personal_info.orgId;
  996. //('orgId' + personal_info.orgId)
  997. }
  998. if (_personal_info.weight) {
  999. personal_info.weight = _personal_info.weight;
  1000. //('weight' + personal_info.weight)
  1001. }
  1002. if (_personal_info.height) {
  1003. personal_info.height = _personal_info.height;
  1004. //('height' + personal_info.height)
  1005. }
  1006. if (_personal_info.education) {
  1007. personal_info.education = _personal_info.education;
  1008. //('education' + personal_info.education)
  1009. }
  1010. /*
  1011. if(_personal_info.educationN)
  1012. {
  1013. personal_info.educationN = _personal_info.educationN;
  1014. //('education'+personal_info.educationN)
  1015. } */
  1016. if (_personal_info.workUnit) {
  1017. personal_info.workUnit = _personal_info.workUnit;
  1018. //('workUnit' + personal_info.workUnit)
  1019. }
  1020. if (_personal_info.post) {
  1021. personal_info.post = _personal_info.post;
  1022. //('post' + personal_info.post)
  1023. }
  1024. if (_personal_info.industry) {
  1025. personal_info.industry = _personal_info.industry;
  1026. //('industry' + personal_info.industry)
  1027. }
  1028. /*
  1029. if(_personal_info.industryN)
  1030. {
  1031. personal_info.industryN = _personal_info.industryN;
  1032. //('industryN'+personal_info.industryN)
  1033. } */
  1034. if (_personal_info.salaryRange) {
  1035. personal_info.salaryRange = _personal_info.salaryRange;
  1036. //('salaryRange' + personal_info.salaryRange)
  1037. }
  1038. /*
  1039. if(_personal_info.salaryRangeN)
  1040. {
  1041. personal_info.salaryRangeN = _personal_info.salaryRangeN;
  1042. //('salaryRangeN'+personal_info.salaryRangeN)
  1043. } */
  1044. if (_personal_info.housingSituation) {
  1045. personal_info.housingSituation = _personal_info.housingSituation;
  1046. //('housingSituation' + personal_info.housingSituation)
  1047. }
  1048. /*
  1049. if(_personal_info.housingSituationN)
  1050. {
  1051. personal_info.housingSituationN = _personal_info.housingSituationN;
  1052. //('housingSituationN'+personal_info.housingSituationN)
  1053. } */
  1054. if (_personal_info.maritalStatus) {
  1055. personal_info.maritalStatus = _personal_info.maritalStatus;
  1056. //('maritalStatus' + personal_info.maritalStatus)
  1057. }
  1058. /*
  1059. if(_personal_info.maritalStatusN)
  1060. {
  1061. personal_info.maritalStatusN = _personal_info.maritalStatusN;
  1062. //('maritalStatusN'+personal_info.maritalStatusN)
  1063. } */
  1064. if (_personal_info.childStatus) {
  1065. personal_info.childStatus = _personal_info.childStatus;
  1066. //('childStatus' + personal_info.childStatus)
  1067. }
  1068. /*
  1069. if(_personal_info.childStatusN)
  1070. {
  1071. personal_info.childStatusN = _personal_info.childStatusN;
  1072. //('childStatusN'+personal_info.childStatusN)
  1073. } */
  1074. if (_personal_info.taIncomeRange) {
  1075. personal_info.taIncomeRange = _personal_info.taIncomeRange;
  1076. //('taIncomeRange' + personal_info.taIncomeRange)
  1077. }
  1078. /*
  1079. if(_personal_info.taIncomeRangeN)
  1080. {
  1081. personal_info.taIncomeRangeN = _personal_info.taIncomeRangeN;
  1082. //('taIncomeRangeN'+personal_info.taIncomeRangeN)
  1083. } */
  1084. if (_personal_info.birthplace) {
  1085. personal_info.birthplace = _personal_info.birthplace;
  1086. //('birthplace' + personal_info.birthplace)
  1087. }
  1088. /*
  1089. if(_personal_info.birthplaceN)
  1090. {
  1091. personal_info.birthplaceN = _personal_info.birthplaceN;
  1092. //('birthplaceN'+personal_info.birthplaceN)
  1093. } */
  1094. if (_personal_info.registeredResidence) {
  1095. personal_info.registeredResidence = _personal_info.registeredResidence;
  1096. //('registeredResidence' + personal_info.registeredResidence)
  1097. }
  1098. /*
  1099. if(_personal_info.registeredResidenceN)
  1100. {
  1101. personal_info.registeredResidenceN = _personal_info.registeredResidenceN;
  1102. //('registeredResidenceN'+personal_info.registeredResidenceN)
  1103. } */
  1104. if (_personal_info.workplace) {
  1105. personal_info.workplace = _personal_info.workplace;
  1106. //('workplace' + personal_info.workplace)
  1107. }
  1108. /*
  1109. if(_personal_info.workplaceN)
  1110. {
  1111. personal_info.workplaceN = _personal_info.workplaceN;
  1112. //('workplaceN'+personal_info.workplaceN)
  1113. } */
  1114. if (_personal_info.taWorkplace) {
  1115. personal_info.taWorkplace = _personal_info.taWorkplace;
  1116. //('taWorkplace' + personal_info.taWorkplace)
  1117. }
  1118. /*
  1119. if(_personal_info.taWorkplaceN)
  1120. {
  1121. personal_info.taWorkplaceN = _personal_info.taWorkplaceN;
  1122. //('taWorkplaceN'+personal_info.taWorkplaceN)
  1123. } */
  1124. if (_personal_info.taAgeRange) {
  1125. personal_info.taAgeRange = _personal_info.taAgeRange;
  1126. //('taAgeRange' + personal_info.taAgeRange)
  1127. }
  1128. /*
  1129. if(_personal_info.taAgeRangeN)
  1130. {
  1131. personal_info.taAgeRangeN = _personal_info.taAgeRangeN;
  1132. //('taAgeRangeN'+personal_info.taAgeRangeN)
  1133. } */
  1134. if (_personal_info.taEdu) {
  1135. personal_info.taEdu = _personal_info.taEdu;
  1136. //('taEdu' + personal_info.taEdu)
  1137. }
  1138. /*
  1139. if(_personal_info.taEduN)
  1140. {
  1141. personal_info.taEduN = _personal_info.taEduN;
  1142. //('education'+personal_info.taEduN)
  1143. } */
  1144. if (_personal_info.taOccupation) {
  1145. personal_info.taOccupation = _personal_info.taOccupation;
  1146. //('taOccupation' + personal_info.taOccupation)
  1147. }
  1148. /*
  1149. if(_personal_info.taOccupationN)
  1150. {
  1151. personal_info.taOccupationN = _personal_info.taOccupationN;
  1152. //('education'+personal_info.taOccupationN)
  1153. } */
  1154. if (_personal_info.taOther) {
  1155. personal_info.taOther = _personal_info.taOther;
  1156. //('taOther' + personal_info.taOther)
  1157. }
  1158. /*
  1159. if(_personal_info.taOccupationN)
  1160. {
  1161. personal_info.taOccupationN = _personal_info.taOccupationN;
  1162. //('education'+personal_info.taOccupationN)
  1163. } */
  1164. //('xxxx')
  1165. loginApi.save_personal_info(personal_info).then((data) => {
  1166. //('保存成功' + JSON.stringify(data));
  1167. if (data.result) {
  1168. if (data.data) {
  1169. _self.submitShow = false;
  1170. _self.findByOpenId();
  1171. uni.switchTab({
  1172. url: './index'
  1173. })
  1174. }
  1175. }
  1176. //_self.findByOpenId();
  1177. /*uni.navigateTo({
  1178. url:'../user/index'
  1179. })*/
  1180. }).catch(error => {
  1181. _self.submitShow = false;
  1182. uni.showToast({
  1183. title: error,
  1184. icon: "none"
  1185. })
  1186. })
  1187. },
  1188. updatePersonInfo() {
  1189. },
  1190. updatePersonPlusInfo() {
  1191. },
  1192. childrenConfirm(e) {
  1193. //('e' + JSON.stringify(e))
  1194. this.defaultData.children_status = [this.base_dictionary.znqkList.findIndex(item => item.value === e[0]
  1195. .value)]
  1196. this.personal_info.childStatusN = '';
  1197. e.map((val, index) => {
  1198. // this.result += this.result == '' ? val.label : '-' + val.label;
  1199. let result = val.label
  1200. _self.personal_info.childStatus = val.value;
  1201. this.personal_info.childStatusN += result;
  1202. })
  1203. },
  1204. marriageConfirm(e) {
  1205. //('e' + JSON.stringify(e))
  1206. this.defaultData.marriage_status = [this.base_dictionary.hyqkList.findIndex(item => item.value === e[0]
  1207. .value)]
  1208. this.personal_info.maritalStatusN = '';
  1209. e.map((val, index) => {
  1210. // this.result += this.result == '' ? val.label : '-' + val.label;
  1211. let result = val.label
  1212. //('val' + JSON.stringify(val))
  1213. _self.personal_info.maritalStatus = val.value;
  1214. this.personal_info.maritalStatusN += result;
  1215. })
  1216. },
  1217. houseConfirm(e) {
  1218. //('e' + JSON.stringify(e))
  1219. this.defaultData.house_status = [this.base_dictionary.zfqkList.findIndex(item => item.value === e[0]
  1220. .value)]
  1221. this.personal_info.housingSituationN = '';
  1222. e.map((val, index) => {
  1223. // this.result += this.result == '' ? val.label : '-' + val.label;
  1224. let result = val.label
  1225. _self.personal_info.housingSituation = val.value;
  1226. _self.personal_info.housingSituationN += result;
  1227. })
  1228. },
  1229. orgNameConfirm(e) {
  1230. //('e' + JSON.stringify(e))
  1231. this.defaultData.orgId = [this.orgNameList.findIndex(item => item.value === e[0].value)]
  1232. this.personal_info.orgName = '';
  1233. e.map((val, index) => {
  1234. // this.result += this.result == '' ? val.label : '-' + val.label;
  1235. let result = val.label
  1236. _self.personal_info.orgId = val.value;
  1237. _self.personal_info.orgName += result;
  1238. })
  1239. },
  1240. educationConfirm(e) {
  1241. //('e' + JSON.stringify(e))
  1242. this.defaultData.education = [this.base_dictionary.xlList.findIndex(item => item.value === e[0].value)]
  1243. this.personal_info.educationN = '';
  1244. e.map((val, index) => {
  1245. // this.result += this.result == '' ? val.label : '-' + val.label;
  1246. let result = val.label
  1247. _self.personal_info.education = val.value;
  1248. _self.personal_info.educationN += result;
  1249. })
  1250. },
  1251. professionConfirm(e) {
  1252. //('e' + JSON.stringify(e))
  1253. this.defaultData.profession = [this.base_dictionary.hyList.findIndex(item => item.value === e[0].value)]
  1254. this.personal_info.industryN = '';
  1255. e.map((val, index) => {
  1256. // this.result += this.result == '' ? val.label : '-' + val.label;
  1257. let result = val.label
  1258. _self.personal_info.industry = val.value;
  1259. this.personal_info.industryN += result;
  1260. })
  1261. },
  1262. salaryConfirm(e) {
  1263. //('e' + JSON.stringify(e))
  1264. this.defaultData.salary_range = [this.base_dictionary.yxList.findIndex(item => item.value === e[0].value)]
  1265. this.personal_info.salaryRangeN = '';
  1266. e.map((val, index) => {
  1267. // this.result += this.result == '' ? val.label : '-' + val.label;
  1268. let result = val.label
  1269. _self.personal_info.salaryRange = val.value;
  1270. this.personal_info.salaryRangeN += result;
  1271. })
  1272. },
  1273. taSalaryRangeConfirm(e) {
  1274. //('e111' + JSON.stringify(e))
  1275. this.defaultData.ta_salary_range = [this.base_dictionary.yxList.findIndex(item => item.value === e[0]
  1276. .value)]
  1277. this.personal_info.taIncomeRangeN = '';
  1278. e.map((val, index) => {
  1279. // this.result += this.result == '' ? val.label : '-' + val.label;
  1280. //('val' + val + 'index ' + index)
  1281. let result = val.label
  1282. _self.personal_info.taIncomeRange = val.value;
  1283. _self.personal_info.taIncomeRangeN += result;
  1284. })
  1285. },
  1286. taAgeRangeConfirm(e) {
  1287. //('e' + JSON.stringify(e))
  1288. this.defaultData.ta_age_range = [this.base_dictionary.nlfwList.findIndex(item => item.value === e[0]
  1289. .value)]
  1290. this.personal_info.taAgeRangeN = '';
  1291. e.map((val, index) => {
  1292. //('val' + val + 'index ' + index)
  1293. // this.result += this.result == '' ? val.label : '-' + val.label;
  1294. let result = val.label
  1295. _self.personal_info.taAgeRange = val.value;
  1296. _self.personal_info.taAgeRangeN += result;
  1297. })
  1298. },
  1299. taEducationConfirm(e) {
  1300. //('e' + JSON.stringify(e))
  1301. this.defaultData.ta_education = [this.base_dictionary.xlList.findIndex(item => item.value === e[0].value)]
  1302. this.personal_info.taEduN = '';
  1303. e.map((val, index) => {
  1304. //('val' + val + 'index ' + index)
  1305. // this.result += this.result == '' ? val.label : '-' + val.label;
  1306. let result = val.label
  1307. _self.personal_info.taEdu = val.value;
  1308. _self.personal_info.taEduN += result;
  1309. })
  1310. },
  1311. heightConfirm(e) {
  1312. //('e' + JSON.stringify(e))
  1313. this.defaultData.height = [this.height_ranges.findIndex(item => item.value === e[0].value)]
  1314. this.form.height = '';
  1315. e.map((val, index) => {
  1316. // this.result += this.result == '' ? val.label : '-' + val.label;
  1317. let result = val.label
  1318. _self.personal_info.height = val.value
  1319. this.form.height += result;
  1320. })
  1321. },
  1322. weightConfirm(e) {
  1323. //('e' + JSON.stringify(e))
  1324. this.defaultData.weight = [this.weight_ranges.findIndex(item => item.value === e[0].value)]
  1325. this.form.weight = '';
  1326. e.map((val, index) => {
  1327. // this.result += this.result == '' ? val.label : '-' + val.label;
  1328. let result = val.label
  1329. _self.personal_info.weight = val.value;
  1330. this.form.weight += result;
  1331. })
  1332. },
  1333. uploadPhoto() {
  1334. // 上传图片
  1335. //const ctx = uni.createCanvasContext('myCanvas');
  1336. ////('url'+this.uploadUrl)
  1337. ////(this.carhelp.getToken())
  1338. let _this = this;
  1339. uni.chooseImage({
  1340. count: 1, //默认9
  1341. // sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  1342. sourceType: ['album', 'camera'], //从相册选择
  1343. success: (res) => {
  1344. let imgFile = res.tempFilePaths;
  1345. //(process.car.BASE_URL + "mobile/member/uploadBase64")
  1346. //(imgFile)
  1347. //(process.car.NODE_ENV)
  1348. //()
  1349. var token = this.carhelp.getToken()
  1350. for (let i = 0; i < imgFile.length; i++) {
  1351. wx.uploadFile({
  1352. url: process.car.BASE_URL + "uploadPicture",
  1353. // url:process.car.BASE_URL+"mobile/member/uploadBase64",
  1354. name: 'photoFile',
  1355. header: {
  1356. 'Authorization': token,
  1357. 'accept': 'application/json',
  1358. //#ifdef MP-WEIXIN
  1359. "Content-Type": "multipart/form-data", //记得设置
  1360. //#endif
  1361. },
  1362. filePath: imgFile[0],
  1363. success: function(result) {
  1364. let imgUrls = JSON.parse(result
  1365. .data) //百度支持 this.site_url +'/' +
  1366. //let image ={url: imgUrls.data};
  1367. //_self.fileList.push(image); //微信
  1368. _self.personal_info.faceImage = imgUrls.data;
  1369. }
  1370. })
  1371. }
  1372. },
  1373. });
  1374. },
  1375. findByOpenId() {
  1376. var openId = this.carhelp.getOpenId()
  1377. if (openId == "") {
  1378. //("------------------")
  1379. setTimeout(() => {
  1380. this.findByOpenId()
  1381. }, 1000)
  1382. return
  1383. }
  1384. uni.request({
  1385. method: 'get',
  1386. url: process.car.BASE_URL + "/mobile/regUser/findByOpenId",
  1387. data: {
  1388. openId: openId,
  1389. },
  1390. header: {
  1391. 'Content-Type': 'application/x-www-form-urlencoded',
  1392. 'X-Requested-With': 'XMLHttpRequest',
  1393. }
  1394. }).then((response) => {
  1395. // //('findByOpenId' +JSON.stringify(response))
  1396. let [error, res] = response;
  1397. if (res.data.code == 200 && res.data.result) {
  1398. var token = res ? res.data.data.token : '';
  1399. this.carhelp.setPersonInfo(res.data.data.memberInfo);
  1400. this.carhelp.setToken(token);
  1401. this.carhelp.setPersonInfoPlus(res.data.data);
  1402. }
  1403. }).catch(error => {
  1404. })
  1405. }
  1406. }
  1407. }
  1408. </script>
  1409. <style>
  1410. page {
  1411. background-color: #f4f0f0;
  1412. }
  1413. </style>
  1414. <style lang="scss" scoped>
  1415. .edit-text {
  1416. margin-top: 10px;
  1417. color: #999;
  1418. }
  1419. .edit-row {
  1420. padding: 12px 0;
  1421. .edit-label {
  1422. display: flex;
  1423. margin-top: 10px;
  1424. flex-wrap: wrap;
  1425. span {
  1426. margin-right: 8px;
  1427. background-color: #E5E7EA;
  1428. padding: 4px 10px;
  1429. border-radius: 4px;
  1430. font-size: 12px;
  1431. margin-bottom: 10px;
  1432. }
  1433. .active {
  1434. background-color: #FFC1BC;
  1435. }
  1436. }
  1437. }
  1438. .edit-line {
  1439. height: 12px;
  1440. background-color: #f4f0f0;
  1441. margin-left: -15px;
  1442. margin-right: -15px;
  1443. }
  1444. .edit-title {
  1445. padding: 12px 0;
  1446. padding-left: 15px;
  1447. background-color: #f4f0f0;
  1448. margin-left: -15px;
  1449. margin-right: -15px;
  1450. }
  1451. .edit-head {
  1452. display: flex;
  1453. padding: 20px 0;
  1454. justify-content: center;
  1455. }
  1456. .personal-btn {
  1457. padding: 15px 50px;
  1458. }
  1459. .edit-form {
  1460. padding: 0 15px;
  1461. background-color: #fff;
  1462. }
  1463. </style>