edit.vue 55 KB

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