edit.vue 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104
  1. <template>
  2. <view>
  3. <u-navbar back-text="编辑资料"></u-navbar>
  4. <view class="edit-head">
  5. <u-avatar :src="personal_info.faceImage" 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="form.name" 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="form.height" input-align="right" placeholder="172cm" type="select" @click="show_height = true" />
  16. <u-select v-model="show_height" mode="single-column" :list="height_ranges" @confirm="heightConfirm"></u-select>
  17. </u-form-item>
  18. <u-form-item label="体重">
  19. <u-input v-model="form.weight" input-align="right" placeholder="75kg" type="select" @click="show_weight = true"/>
  20. <u-select v-model="show_weight" mode="single-column" :list="weight_ranges" @confirm="weightConfirm"></u-select>
  21. </u-form-item>
  22. <view class="edit-line"></view>
  23. <u-form-item label="出身地"><u-input v-model="personal_info.birthplaceN" input-align="right" placeholder="荆州市沙市区" type="select" @click='birthdayAddressChange'/></u-form-item>
  24. <u-form-item label="户口所在地"><u-input v-model="personal_info.registeredResidenceN" input-align="right" placeholder="荆州市沙市区" type="select" @click='registeredResidenceAddressChange'/></u-form-item>
  25. <u-form-item label="工作所在地"><u-input v-model="personal_info.workplaceN" input-align="right" placeholder="荆州市沙市区" type="select" @click='workAddressChange'/></u-form-item>
  26. <view class="edit-line"></view>
  27. <u-form-item label="学历" >
  28. <u-input v-model="personal_info.educationN" input-align="right" placeholder="大学本科" type="select" @click="show_education = true"/>
  29. <u-select v-model="show_education" mode="single-column" :list="base_dictionary.xlList" @confirm="educationConfirm"></u-select>
  30. </u-form-item>
  31. <u-form-item label="行业" >
  32. <u-input v-model="personal_info.industryN" input-align="right" placeholder="IT/互联网" type="select" @click="show_profession = true"/></u-form-item>
  33. <u-select v-model="show_profession" mode="single-column" :list="base_dictionary.hyList" @confirm="professionConfirm"></u-select>
  34. <u-form-item label="工作单位">
  35. <u-input v-model="personal_info.workUnit" input-align="right" placeholder="湖北荆鹏软件开发有限公司" /></u-form-item>
  36. <u-form-item label="岗位">
  37. <u-input v-model="personal_info.post" input-align="right" placeholder="软件工程师" /></u-form-item>
  38. <view class="edit-line"></view>
  39. <u-form-item label="月薪" >
  40. <u-input v-model="personal_info.salaryRangeN" input-align="right" placeholder="请选择" type="select" @click="show_salary = true" />
  41. <u-select v-model="show_salary" mode="single-column" :list="base_dictionary.yxList" @confirm="salaryConfirm"></u-select>
  42. </u-form-item>
  43. <u-form-item label="住房状况">
  44. <u-input v-model="personal_info.housingSituationN" input-align="right" placeholder="请选择" type="select" @click="show_house = true"/>
  45. <u-select v-model="show_house" mode="single-column" :list="base_dictionary.zfqkList" @confirm="houseConfirm"></u-select>
  46. </u-form-item>
  47. <u-form-item label="婚姻状况">
  48. <u-input v-model="personal_info.maritalStatusN" input-align="right" placeholder="未婚" type="select" @click="show_marriage = true"/>
  49. <u-select v-model="show_marriage" mode="single-column" :list="base_dictionary.hyqkList" @confirm="marriageConfirm"></u-select>
  50. </u-form-item>
  51. <u-form-item label="子女状况" >
  52. <u-input v-model="personal_info.childStatusN" input-align="right" placeholder="无" type="select" @click="show_children = true"/>
  53. <u-select v-model="show_children" mode="single-column" :list="base_dictionary.znqkList" @confirm="childrenConfirm"></u-select>
  54. </u-form-item>
  55. <view class="edit-line"></view>
  56. <view class="edit-row">
  57. <p>兴趣爱好</p>
  58. <view class="edit-label">
  59. <span v-for="(item,index) in base_dictionary.hobbyInfoList" :key="index" :class="item.isMemberSelect ? 'active' : ''" @tap="selectInterest(index)">
  60. {{item.name}}
  61. </span>
  62. <!--
  63. <span class="active">摄影</span>
  64. <span>烹饪</span>
  65. <span>健身</span>
  66. <span>打游戏</span>
  67. <span>摄影</span>
  68. <span>烹饪</span>
  69. <span>健身</span>
  70. <span>打游戏</span>-->
  71. </view>
  72. </view>
  73. <view class="edit-line"></view>
  74. <view class="edit-row">
  75. <view class="u-flex u-row-between ">
  76. <p>自我评价</p>
  77. <u-icon custom-prefix="custom-icon" name="youjiantou"></u-icon>
  78. </view>
  79. <view class="edit-text">
  80. {{personal_info.selfEvaluation}}
  81. </view>
  82. </view>
  83. <view class="edit-title">择偶标准</view>
  84. <u-form-item label="年龄范围" >
  85. <u-input v-model="personal_info.taAgeRangeN" input-align="right" placeholder="20~35" type="select" @click="show_ta_age_ranges = true"/>
  86. <u-select v-model="show_ta_age_ranges" mode="single-column" :list="base_dictionary.nlfwList" @confirm="taAgeRangeConfirm"></u-select>
  87. </u-form-item>
  88. <u-form-item label="月薪" >
  89. <u-input v-model="personal_info.taIncomeRangeN" input-align="right" placeholder="不限" type="select" @click="show_ta_salary = true"/>
  90. <u-select v-model="show_ta_salary" mode="single-column" :list="base_dictionary.yxList" @confirm="taSalaryRangeConfirm"></u-select>
  91. </u-form-item>
  92. <u-form-item label="学历" >
  93. <u-input v-model="personal_info.taEduN" input-align="right" placeholder="不限" type="select" @click="show_ta_education = true"/>
  94. <u-select v-model="show_ta_education" mode="single-column" :list="base_dictionary.xlList" @confirm="taEducationConfirm"></u-select>
  95. </u-form-item>
  96. <u-form-item label="职业">
  97. <u-input v-model="personal_info.taOccupation" input-align="right" placeholder="不限" /></u-form-item>
  98. <u-form-item label="所在地">
  99. <u-input v-model="personal_info.taWorkplaceN" input-align="right" placeholder="请选择" type="select" @click='taWorkAddressChange'/></u-form-item>
  100. <u-form-item label="其他要求">
  101. <u-input v-model="personal_info.taOther" input-align="right" placeholder="请选择" /></u-form-item>
  102. </u-form>
  103. </view>
  104. <view class="personal-btn">
  105. <u-button type="error" shape="circle" :custom-style="customStyle" @click="formsubmit">
  106. <span>保存</span>
  107. </u-button>
  108. </view>
  109. <mpvue-city-picker themeColor="#007AFF" ref="mpvuebirtydayCityPicker" :pickerValueDefault="cityPickerValueDefault" @onConfirm="onBirthdayCityConfirm"></mpvue-city-picker>
  110. <mpvue-city-picker themeColor="#007AFF" ref="mpvueRegisteredResidenceCityPicker" :pickerValueDefault="cityPickerValueDefault" @onConfirm="onResidenceRegisteredCityConfirm"></mpvue-city-picker>
  111. <mpvue-city-picker themeColor="#007AFF" ref="mpvueWorkCityPicker" :pickerValueDefault="cityPickerValueDefault" @onConfirm="onWorkCityConfirm"></mpvue-city-picker>
  112. <mpvue-city-picker themeColor="#007AFF" ref="mpvueTaWorkCityPicker" :pickerValueDefault="cityPickerValueDefault" @onConfirm="onTaWorkCityConfirm"></mpvue-city-picker>
  113. <!--
  114. <u-action-sheet
  115. :show="show_education"
  116. :actions="base_dictionary.xlList"
  117. title="请选择学历"
  118. description=""
  119. @close="show_education = false"
  120. @select="educationSelect"
  121. >
  122. </u-action-sheet>
  123. <u-action-sheet
  124. :show="show_salary"
  125. :actions="base_dictionary.yxList"
  126. title="请选择月薪"
  127. description=""
  128. @close="show_salary = false"
  129. @select="salarySelect"
  130. >
  131. </u-action-sheet>
  132. <u-action-sheet
  133. :show="show_profession"
  134. :actions="base_dictionary.hyList"
  135. title="请选择行业"
  136. description=""
  137. @close="show_profession = false"
  138. @select="professionSelect"
  139. >
  140. </u-action-sheet>
  141. <u-action-sheet
  142. :show="show_house"
  143. :actions="base_dictionary.zfqkList"
  144. title="请选择住房状况"
  145. description=""
  146. @close="show_house = false"
  147. @select="houseSelect"
  148. >
  149. </u-action-sheet>
  150. <u-action-sheet
  151. :show="show_marriage"
  152. :actions="base_dictionary.hyList"
  153. title="请选择婚姻状况"
  154. description=""
  155. @close="show_marriage = false"
  156. @select="marriageSelect"
  157. >
  158. </u-action-sheet>
  159. <u-action-sheet
  160. :show="show_children"
  161. :actions="base_dictionary.znqkList"
  162. title="请选择子女状况"
  163. description=""
  164. @close="show_children = false"
  165. @select="childrenSelect"
  166. >
  167. </u-action-sheet>
  168. <u-action-sheet
  169. :show="show_ta_age_ranges"
  170. :actions="base_dictionary.nlfwList"
  171. title="请选择年龄范围"
  172. description=""
  173. @close="show_ta_age_ranges = false"
  174. @select="taAgeRangeSelect"
  175. >
  176. </u-action-sheet>
  177. <u-action-sheet
  178. :show="show_ta_education"
  179. :actions="base_dictionary.xlList"
  180. title="请选择学历"
  181. description=""
  182. @close="show_ta_education = false"
  183. @select="taEducationSelect"
  184. >
  185. </u-action-sheet>
  186. <u-action-sheet
  187. :show="show_ta_salary"
  188. :actions="base_dictionary.nlfwList"
  189. title="请选择月薪"
  190. description="xxxxxxx"
  191. @close="show_ta_salary = false"
  192. @select="taSalarySelect"
  193. >
  194. </u-action-sheet>-->
  195. </view>
  196. </template>
  197. <script>
  198. import * as loginApi from '@/apis/login.js'
  199. import mpvueCityPicker from "../../pagesB/components/mpvue-citypicker/mpvueCityPicker.vue";
  200. import {provinceData,setCityData,getCityData} from '../../pagesB/components/mpvue-citypicker/city-data/province.js';
  201. let _self;
  202. export default {
  203. components:{
  204. mpvueCityPicker
  205. },
  206. data() {
  207. return {
  208. cityPickerValueDefault:[16,6,0],
  209. customStyle: {
  210. background: '#FF5E5E'
  211. },
  212. form: {
  213. name: '',
  214. sex: '',
  215. height:'',
  216. weight:'',
  217. address:'',
  218. registered_residence:'',
  219. work_address:'',
  220. work_corporation:'',
  221. work_post:'',
  222. education:'',
  223. profession:'',
  224. salary_range:'',
  225. house_status:'',
  226. marriage_status:'',
  227. children_status:'',
  228. self_assess:'',
  229. addressId:'',
  230. registered_residenceId:'',
  231. work_addressId:'',
  232. educationId:'',
  233. professionId:'',
  234. salary_rangeId:'',
  235. house_statusId:'',
  236. marriage_statusId:'',
  237. children_statusId:'',
  238. },
  239. personal_info:{
  240. faceImage:' /static/img/sexMan.png'
  241. },
  242. height_ranges:[],
  243. weight_ranges:[],
  244. show_height:false,
  245. show_weight:false,
  246. show_birthday_address:false,
  247. show_registered_residence:false,
  248. show_work_address:false,
  249. show_salary:false,
  250. show_profession:false,
  251. show_education:false,
  252. show_house:false,
  253. show_marriage:false,
  254. show_children:false,
  255. show_ta_age_ranges:false,
  256. show_ta_education:false,
  257. show_ta_salary:false,
  258. show_ta_work_address:false,
  259. base_dictionary:{
  260. zfqkList:[],
  261. yxList:[],
  262. znqkList:[],
  263. qyList:[],
  264. xlList:[],
  265. hyList:[],
  266. nlfwList:[],
  267. hyqkList:[],
  268. hobbyInfoList:[],
  269. }
  270. }
  271. methods: {
  272. }
  273. },
  274. onLoad(){
  275. _self = this;
  276. //let personalInfoPlus = this.carhelp.getPersonInfoPlus();
  277. //console.log('personalInfoPlus'+JSON.stringify(personalInfoPlus))
  278. this.personal_info = this.carhelp.getPersonInfo();
  279. console.log('个人信息'+JSON.stringify(this.personal_info))
  280. let subject = {subject:''}
  281. loginApi.getBaseDictionary(subject).then(function(data){
  282. //console.log('基础字典'+JSON.stringify(data));
  283. let personal_info = _self.carhelp.getPersonInfo();
  284. if(data.data)
  285. {
  286. _self.base_dictionary = data.data;
  287. if(_self.base_dictionary.zfqkList){
  288. for(let i = 0;i< _self.base_dictionary.zfqkList.length;i++)
  289. {
  290. _self.base_dictionary.zfqkList[i].label = _self.base_dictionary.zfqkList[i].name;
  291. }
  292. if(_self.personal_info.housingSituation!=null && _self.personal_info.housingSituation<= _self.base_dictionary.zfqkList.length)
  293. {
  294. _self.personal_info.housingSituationN =_self.base_dictionary.zfqkList[_self.personal_info.housingSituation-1].label
  295. }
  296. }
  297. //console.log('住房情况'+JSON.stringify(_self.base_dictionary.zfqkList));
  298. if(_self.base_dictionary.yxList){
  299. for(let i = 0;i< _self.base_dictionary.yxList.length;i++)
  300. {
  301. _self.base_dictionary.yxList[i].label = _self.base_dictionary.yxList[i].name;
  302. }
  303. if(_self.personal_info.salaryRange!=null && _self.personal_info.salaryRange<= _self.base_dictionary.yxList.length)
  304. {
  305. _self.personal_info.salaryRangeN =_self.base_dictionary.yxList[_self.personal_info.salaryRange-1].label
  306. }
  307. if(_self.personal_info.taIncomeRange!=null && _self.personal_info.taIncomeRange<= _self.base_dictionary.yxList.length)
  308. {
  309. _self.personal_info.taIncomeRangeN =_self.base_dictionary.yxList[_self.personal_info.taIncomeRange-1].label
  310. }
  311. }
  312. //console.log('月薪情况'+JSON.stringify(_self.base_dictionary.yxList));
  313. if(_self.base_dictionary.znqkList){
  314. for(let i = 0;i< _self.base_dictionary.znqkList.length;i++)
  315. {
  316. _self.base_dictionary.znqkList[i].label = _self.base_dictionary.znqkList[i].name;
  317. }
  318. if(_self.personal_info.childStatus!=null && _self.personal_info.childStatus<= _self.base_dictionary.znqkList.length)
  319. {
  320. _self.personal_info.childStatusN =_self.base_dictionary.znqkList[_self.personal_info.childStatus-1].label
  321. }
  322. }
  323. //console.log('子女情况'+JSON.stringify(_self.base_dictionary.znqkList));
  324. /*
  325. if(_self.base_dictionary.qyList){
  326. for(let i = 0;i< _self.base_dictionary.qyList.length;i++)
  327. {
  328. _self.base_dictionary.qyList[i].label = _self.base_dictionary.qyList[i].name;
  329. }
  330. }
  331. console.log('区域'+JSON.stringify(_self.base_dictionary.qyList));
  332. */
  333. if(_self.base_dictionary.xlList){
  334. for(let i = 0;i< _self.base_dictionary.xlList.length;i++)
  335. {
  336. _self.base_dictionary.xlList[i].label = _self.base_dictionary.xlList[i].name;
  337. }
  338. //console.log('学历'+JSON.stringify(_self.base_dictionary.xlList.length))
  339. if(_self.personal_info.education!=null && _self.personal_info.education <= _self.base_dictionary.xlList.length)
  340. {
  341. //console.log('学历'+JSON.stringify(_self.personal_info.education))
  342. _self.personal_info.educationN =_self.base_dictionary.xlList[Number(_self.personal_info.education)-1].label
  343. }
  344. if(_self.personal_info.taEdu!=null && _self.personal_info.taEdu<= _self.base_dictionary.xlList.length)
  345. {
  346. _self.personal_info.taEduN =_self.base_dictionary.xlList[_self.personal_info.taEdu-1].label
  347. }
  348. }
  349. //console.log('学历情况'+JSON.stringify(_self.base_dictionary.xlList));
  350. if(_self.base_dictionary.hyList){
  351. for(let i = 0;i< _self.base_dictionary.hyList.length;i++)
  352. {
  353. _self.base_dictionary.hyList[i].label = _self.base_dictionary.hyList[i].name;
  354. }
  355. if(_self.personal_info.industry!=null && _self.personal_info.industry<= _self.base_dictionary.hyList.length)
  356. {
  357. _self.personal_info.industryN =_self.base_dictionary.hyList[_self.personal_info.industry-1].label
  358. }
  359. }
  360. // console.log('行业情况'+JSON.stringify(_self.base_dictionary.hyList));
  361. if(_self.base_dictionary.nlfwList){
  362. for(let i = 0;i< _self.base_dictionary.nlfwList.length;i++)
  363. {
  364. _self.base_dictionary.nlfwList[i].label = _self.base_dictionary.nlfwList[i].name;
  365. }
  366. if(_self.personal_info.taAgeRange!=null && _self.personal_info.taAgeRange<= _self.base_dictionary.nlfwList.length)
  367. {
  368. _self.personal_info.taAgeRangeN =_self.base_dictionary.nlfwList[_self.personal_info.taAgeRange-1].label
  369. }
  370. }
  371. //console.log('年龄范围'+JSON.stringify(_self.base_dictionary.nlfwList));
  372. if(_self.base_dictionary.hyqkList){
  373. for(let i = 0;i< _self.base_dictionary.hyqkList.length;i++)
  374. {
  375. _self.base_dictionary.hyqkList[i].label = _self.base_dictionary.hyqkList[i].name;
  376. }
  377. if(_self.personal_info.maritalStatus!=null && _self.personal_info.maritalStatus<= _self.base_dictionary.hyqkList.length)
  378. {
  379. _self.personal_info.maritalStatusN =_self.base_dictionary.hyqkList[_self.personal_info.maritalStatus-1].label
  380. }
  381. }
  382. //console.log('婚姻情况'+JSON.stringify(_self.base_dictionary.hyqkList));
  383. if(_self.base_dictionary.hobbyInfoList){
  384. for(let i = 0;i< _self.base_dictionary.hobbyInfoList.length;i++)
  385. {
  386. _self.base_dictionary.hobbyInfoList[i].isMemberSelect = false;
  387. _self.base_dictionary.hobbyInfoList[i].label = _self.base_dictionary.hobbyInfoList[i].name;
  388. if(_self.personal_info.hobby!=null){
  389. // console.log('hobby'+JSON.stringify(_self.personal_info.hobby))
  390. if(_self.personal_info.hobby.indexOf(_self.base_dictionary.hobbyInfoList[i].id)>=0)
  391. {
  392. _self.base_dictionary.hobbyInfoList[i].isMemberSelect = true;
  393. console.log('选中'+JSON.stringify(_self.base_dictionary.hobbyInfoList[i]))
  394. }
  395. }
  396. }
  397. }
  398. // console.log('兴趣爱好'+JSON.stringify(_self.base_dictionary.hobbyInfoList));
  399. if(_self.personal_info.birthplace!=null){
  400. _self.personal_info.birthplaceN = getCityData(Number(_self.personal_info.birthplace));
  401. // console.log('address'+JSON.stringify(_self.form.addressId))
  402. }
  403. if(_self.personal_info.registeredResidence!=null){
  404. _self.personal_info.registeredResidenceN = getCityData(Number(_self.personal_info.registeredResidence));
  405. }
  406. if(_self.personal_info.workplace!=null){
  407. _self.personal_info.workplaceN = getCityData(Number(_self.personal_info.workplace));
  408. }
  409. if(_self.personal_info.taWorkplace!=null){
  410. _self.personal_info.taWorkplaceN = getCityData(Number(_self.personal_info.taWorkplace));
  411. }
  412. }
  413. },function(err){
  414. console.log('获取基础字典错误'+JSON.stringify(err))
  415. })
  416. for(let i = 130;i<=220;i++)
  417. {
  418. let height_range = {value: i, label: i.toString()+"cm"};
  419. this.height_ranges.push(height_range);
  420. //this.height_ranges.push(i.toString());
  421. }
  422. for(let i = 20;i<=120;i++)
  423. {
  424. // this.weight_ranges.push(i.toString());
  425. let weight_range = {value:i, label:i.toString()+"kg"};
  426. this.weight_ranges.push(weight_range);
  427. }
  428. if(this.personal_info){
  429. this.form.sex = this.personal_info.gender?'男':'女'
  430. if(this.personal_info.height)
  431. {
  432. this.form.height = this.personal_info.height+'cm'
  433. }
  434. if(this.personal_info.weight)
  435. {
  436. this.form.weight = this.personal_info.weight+'kg'
  437. }
  438. }
  439. if(provinceData.length<=0){
  440. loginApi.getCityList().then(function(data){
  441. // console.log('获取城市成功'+JSON.stringify(data));
  442. if(data.result && data.data){
  443. setCityData(data.data);
  444. //_self.$refs.mpvuebirtydayCityPicker.setCityData(data.data);
  445. //console.log('province data '+JSON.stringify(provinceData))
  446. if(_self.personal_info.birthplace!=null){
  447. _self.personal_info.birthplaceN = getCityData(Number(_self.personal_info.birthplace));
  448. // console.log('address'+JSON.stringify(_self.form.addressId))
  449. }
  450. if(_self.personal_info.registeredResidence!=null){
  451. _self.personal_info.registeredResidenceN = getCityData(Number(_self.personal_info.registeredResidence));
  452. }
  453. if(_self.personal_info.workplace!=null){
  454. _self.personal_info.workplaceN = getCityData(Number(_self.personal_info.workplace));
  455. }
  456. if(_self.personal_info.taWorkplace!=null){
  457. _self.personal_info.taWorkplaceN = getCityData(Number(_self.personal_info.taWorkplace));
  458. }
  459. }
  460. },function(err){
  461. console.log('获取城市列表错误'+JSON.stringify(err))
  462. })
  463. }
  464. // console.log('个人信息'+JSON.stringify(this.personal_info))
  465. },
  466. methods:{
  467. selectInterest(index){
  468. // let interest = this.interests;
  469. this.base_dictionary.hobbyInfoList[index].isMemberSelect = !this.base_dictionary.hobbyInfoList[index].isMemberSelect;
  470. console.log('item'+JSON.stringify(this.base_dictionary.hobbyInfoList[index]))
  471. },
  472. birthdayAddressChange(){
  473. this.$refs.mpvuebirtydayCityPicker.show()
  474. },
  475. registeredResidenceAddressChange(){
  476. this.$refs.mpvueRegisteredResidenceCityPicker.show()
  477. },
  478. workAddressChange(){
  479. this.$refs.mpvueWorkCityPicker.show()
  480. },
  481. taWorkAddressChange(){
  482. this.$refs.mpvueTaWorkCityPicker.show()
  483. },
  484. onBirthdayCityConfirm(e) {
  485. _self.personal_info.birthplaceN = e.label;
  486. _self.personal_info.birthplace = e.cityCode.toString();
  487. console.log('地址选择'+JSON.stringify(_self.form.addressId))
  488. },
  489. onResidenceRegisteredCityConfirm(e) {
  490. _self.personal_info.registeredResidenceN= e.label;
  491. _self.personal_info.registeredResidence = e.cityCode.toString();
  492. console.log('地址选择'+JSON.stringify(_self.form.registered_residenceId))
  493. },
  494. onWorkCityConfirm(e) {
  495. _self.personal_info.workplaceN = e.label;
  496. _self.personal_info.workplace = e.cityCode.toString();
  497. console.log('地址选择'+JSON.stringify(_self.form.work_addressId))
  498. },
  499. onTaWorkCityConfirm(e) {
  500. _self.personal_info.taWorkplaceN = e.label;
  501. _self.personal_info.taWorkplace = e.cityCode.toString();
  502. console.log('地址选择'+JSON.stringify(_self.form.work_addressId))
  503. },
  504. formsubmit(){
  505. let personal_info = {type:1,id:this.personal_info.id};
  506. let _personal_info = this.personal_info;
  507. if(_personal_info.faceImage)
  508. {
  509. personal_info.faceImage = _personal_info.faceImage;
  510. console.log('faceImage'+personal_info.faceImage)
  511. }
  512. personal_info.hobby = ''
  513. for(let i=0;i<_self.base_dictionary.hobbyInfoList.length;i++)
  514. {
  515. if(_self.base_dictionary.hobbyInfoList[i].isMemberSelect)
  516. {
  517. if(personal_info.hobby.length>0)
  518. {
  519. personal_info.hobby+=','
  520. }
  521. personal_info.hobby += _self.base_dictionary.hobbyInfoList[i].id;
  522. }
  523. }
  524. if(_personal_info.weight)
  525. {
  526. personal_info.weight = _personal_info.weight;
  527. console.log('weight'+personal_info.weight)
  528. }
  529. if(_personal_info.height)
  530. {
  531. personal_info.height = _personal_info.height;
  532. console.log('height'+personal_info.height)
  533. }
  534. if(_personal_info.education)
  535. {
  536. personal_info.education = _personal_info.education;
  537. console.log('education'+personal_info.education)
  538. }
  539. /*
  540. if(_personal_info.educationN)
  541. {
  542. personal_info.educationN = _personal_info.educationN;
  543. console.log('education'+personal_info.educationN)
  544. } */
  545. if(_personal_info.workUnit)
  546. {
  547. personal_info.workUnit = _personal_info.workUnit;
  548. console.log('workUnit'+personal_info.workUnit)
  549. }
  550. if(_personal_info.post)
  551. {
  552. personal_info.post = _personal_info.post;
  553. console.log('post'+personal_info.post)
  554. }
  555. if(_personal_info.industry)
  556. {
  557. personal_info.industry = _personal_info.industry;
  558. console.log('industry'+personal_info.industry)
  559. }
  560. /*
  561. if(_personal_info.industryN)
  562. {
  563. personal_info.industryN = _personal_info.industryN;
  564. console.log('industryN'+personal_info.industryN)
  565. } */
  566. if(_personal_info.salaryRange)
  567. {
  568. personal_info.salaryRange = _personal_info.salaryRange;
  569. console.log('salaryRange'+personal_info.salaryRange)
  570. }
  571. /*
  572. if(_personal_info.salaryRangeN)
  573. {
  574. personal_info.salaryRangeN = _personal_info.salaryRangeN;
  575. console.log('salaryRangeN'+personal_info.salaryRangeN)
  576. } */
  577. if(_personal_info.housingSituation)
  578. {
  579. personal_info.housingSituation = _personal_info.housingSituation;
  580. console.log('housingSituation'+personal_info.housingSituation)
  581. }
  582. /*
  583. if(_personal_info.housingSituationN)
  584. {
  585. personal_info.housingSituationN = _personal_info.housingSituationN;
  586. console.log('housingSituationN'+personal_info.housingSituationN)
  587. } */
  588. if(_personal_info.maritalStatus)
  589. {
  590. personal_info.maritalStatus = _personal_info.maritalStatus;
  591. console.log('maritalStatus'+personal_info.maritalStatus)
  592. }
  593. /*
  594. if(_personal_info.maritalStatusN)
  595. {
  596. personal_info.maritalStatusN = _personal_info.maritalStatusN;
  597. console.log('maritalStatusN'+personal_info.maritalStatusN)
  598. } */
  599. if(_personal_info.childStatus)
  600. {
  601. personal_info.childStatus = _personal_info.childStatus;
  602. console.log('childStatus'+personal_info.childStatus)
  603. }
  604. /*
  605. if(_personal_info.childStatusN)
  606. {
  607. personal_info.childStatusN = _personal_info.childStatusN;
  608. console.log('childStatusN'+personal_info.childStatusN)
  609. } */
  610. if(_personal_info.taIncomeRange)
  611. {
  612. personal_info.taIncomeRange = _personal_info.taIncomeRange;
  613. console.log('taIncomeRange'+personal_info.taIncomeRange)
  614. }
  615. /*
  616. if(_personal_info.taIncomeRangeN)
  617. {
  618. personal_info.taIncomeRangeN = _personal_info.taIncomeRangeN;
  619. console.log('taIncomeRangeN'+personal_info.taIncomeRangeN)
  620. } */
  621. if(_personal_info.birthplace)
  622. {
  623. personal_info.birthplace = _personal_info.birthplace;
  624. console.log('birthplace'+personal_info.birthplace)
  625. }
  626. /*
  627. if(_personal_info.birthplaceN)
  628. {
  629. personal_info.birthplaceN = _personal_info.birthplaceN;
  630. console.log('birthplaceN'+personal_info.birthplaceN)
  631. } */
  632. if(_personal_info.registeredResidence)
  633. {
  634. personal_info.registeredResidence = _personal_info.registeredResidence;
  635. console.log('registeredResidence'+personal_info.registeredResidence)
  636. }
  637. /*
  638. if(_personal_info.registeredResidenceN)
  639. {
  640. personal_info.registeredResidenceN = _personal_info.registeredResidenceN;
  641. console.log('registeredResidenceN'+personal_info.registeredResidenceN)
  642. } */
  643. if(_personal_info.workplace)
  644. {
  645. personal_info.workplace = _personal_info.workplace;
  646. console.log('workplace'+personal_info.workplace)
  647. }
  648. /*
  649. if(_personal_info.workplaceN)
  650. {
  651. personal_info.workplaceN = _personal_info.workplaceN;
  652. console.log('workplaceN'+personal_info.workplaceN)
  653. } */
  654. if(_personal_info.taWorkplace)
  655. {
  656. personal_info.taWorkplace = _personal_info.taWorkplace;
  657. console.log('taWorkplace'+personal_info.taWorkplace)
  658. }
  659. /*
  660. if(_personal_info.taWorkplaceN)
  661. {
  662. personal_info.taWorkplaceN = _personal_info.taWorkplaceN;
  663. console.log('taWorkplaceN'+personal_info.taWorkplaceN)
  664. } */
  665. if(_personal_info.taAgeRange)
  666. {
  667. personal_info.taAgeRange = _personal_info.taAgeRange;
  668. console.log('taAgeRange'+personal_info.taAgeRange)
  669. }
  670. /*
  671. if(_personal_info.taAgeRangeN)
  672. {
  673. personal_info.taAgeRangeN = _personal_info.taAgeRangeN;
  674. console.log('taAgeRangeN'+personal_info.taAgeRangeN)
  675. } */
  676. if(_personal_info.taEdu)
  677. {
  678. personal_info.taEdu = _personal_info.taEdu;
  679. console.log('taEdu'+personal_info.taEdu)
  680. }
  681. /*
  682. if(_personal_info.taEduN)
  683. {
  684. personal_info.taEduN = _personal_info.taEduN;
  685. console.log('education'+personal_info.taEduN)
  686. } */
  687. if(_personal_info.taOccupation)
  688. {
  689. personal_info.taOccupation = _personal_info.taOccupation;
  690. console.log('taOccupation'+personal_info.taOccupation)
  691. }
  692. /*
  693. if(_personal_info.taOccupationN)
  694. {
  695. personal_info.taOccupationN = _personal_info.taOccupationN;
  696. console.log('education'+personal_info.taOccupationN)
  697. } */
  698. if(_personal_info.taOther)
  699. {
  700. personal_info.taOther = _personal_info.taOther;
  701. console.log('taOther'+personal_info.taOther)
  702. }
  703. /*
  704. if(_personal_info.taOccupationN)
  705. {
  706. personal_info.taOccupationN = _personal_info.taOccupationN;
  707. console.log('education'+personal_info.taOccupationN)
  708. } */
  709. console.log('xxxx')
  710. loginApi.save_personal_info(personal_info).then(function(data){
  711. console.log('保存成功'+JSON.stringify(data));
  712. if(data.result){
  713. if(data.data){
  714. _self.findByOpenId();
  715. uni.switchTab({
  716. url:'./index'
  717. })
  718. }
  719. }
  720. //_self.findByOpenId();
  721. /*uni.navigateTo({
  722. url:'../user/index'
  723. })*/
  724. },function(err){
  725. console.log('保存失败'+JSON.stringify(personal_info)+ JSON.stringify(err));
  726. });
  727. },
  728. updatePersonInfo(){
  729. },
  730. updatePersonPlusInfo(){
  731. },
  732. childrenConfirm(e){
  733. console.log('e'+JSON.stringify(e))
  734. this.personal_info.childStatusN = '';
  735. e.map((val, index) => {
  736. // this.result += this.result == '' ? val.label : '-' + val.label;
  737. let result = val.label
  738. _self.personal_info.childStatus = val.value;
  739. this.personal_info.childStatusN += result;
  740. })
  741. },
  742. marriageConfirm(e){
  743. console.log('e'+JSON.stringify(e))
  744. this.personal_info.maritalStatusN = '';
  745. e.map((val, index) => {
  746. // this.result += this.result == '' ? val.label : '-' + val.label;
  747. let result = val.label
  748. console.log('val'+JSON.stringify(val))
  749. _self.personal_info.maritalStatus =val.value;
  750. this.personal_info.maritalStatusN += result;
  751. })
  752. },
  753. houseConfirm(e){
  754. console.log('e'+JSON.stringify(e))
  755. this.personal_info.housingSituationN = '';
  756. e.map((val, index) => {
  757. // this.result += this.result == '' ? val.label : '-' + val.label;
  758. let result = val.label
  759. _self.personal_info.housingSituation = val.value;
  760. _self.personal_info.housingSituationN += result;
  761. })
  762. },
  763. educationConfirm(e){
  764. console.log('e'+JSON.stringify(e))
  765. this.personal_info.educationN = '';
  766. e.map((val, index) => {
  767. // this.result += this.result == '' ? val.label : '-' + val.label;
  768. let result = val.label
  769. _self.personal_info.education = val.value;
  770. _self.personal_info.educationN += result;
  771. })
  772. },
  773. professionConfirm(e){
  774. console.log('e'+JSON.stringify(e))
  775. this.personal_info.industryN = '';
  776. e.map((val, index) => {
  777. // this.result += this.result == '' ? val.label : '-' + val.label;
  778. let result = val.label
  779. _self.personal_info.industry = val.value;
  780. this.personal_info.industryN += result;
  781. })
  782. },
  783. salaryConfirm(e){
  784. console.log('e'+JSON.stringify(e))
  785. this.personal_info.salaryRangeN = '';
  786. e.map((val, index) => {
  787. // this.result += this.result == '' ? val.label : '-' + val.label;
  788. let result = val.label
  789. _self.personal_info.salaryRange = val.value;
  790. this.personal_info.salaryRangeN += result;
  791. })
  792. },
  793. taSalaryRangeConfirm(e){
  794. console.log('e111'+JSON.stringify(e))
  795. this.personal_info.taIncomeRangeN = '';
  796. e.map((val, index) => {
  797. // this.result += this.result == '' ? val.label : '-' + val.label;
  798. console.log('val'+val + 'index '+index)
  799. let result = val.label
  800. _self.personal_info.taIncomeRange = val.value;
  801. _self.personal_info.taIncomeRangeN += result;
  802. })
  803. },
  804. taAgeRangeConfirm(e){
  805. console.log('e'+JSON.stringify(e))
  806. this.personal_info.taAgeRangeN = '';
  807. e.map((val, index) => {
  808. console.log('val'+val + 'index '+index)
  809. // this.result += this.result == '' ? val.label : '-' + val.label;
  810. let result = val.label
  811. _self.personal_info.taAgeRange = val.value;
  812. _self.personal_info.taAgeRangeN += result;
  813. })
  814. },
  815. taEducationConfirm(e){
  816. console.log('e'+JSON.stringify(e))
  817. this.personal_info.taEduN = '';
  818. e.map((val, index) => {
  819. console.log('val'+val + 'index '+index)
  820. // this.result += this.result == '' ? val.label : '-' + val.label;
  821. let result = val.label
  822. _self.personal_info.taEdu = val.value;
  823. _self.personal_info.taEduN += result;
  824. })
  825. },
  826. /*
  827. educationSelect(e) {
  828. this.personal_info.education = e.value;
  829. this.personal_info.educationN = e.name;
  830. //this.$refs.uForm.validateField('personal_info.education')
  831. },
  832. salarySelect(e) {
  833. this.personal_info.salaryRange = e.value;
  834. this.personal_info.salaryRangeN = e.name;
  835. //this.$refs.uForm.validateField('personal_info.salaryRange')
  836. },
  837. professionSelect(e) {
  838. this.personal_info.industry = e.value;
  839. this.personal_info.industryN = e.name;
  840. //this.$refs.uForm.validateField('personal_info.industry')
  841. },
  842. houseSelect(e) {
  843. this.personal_info.housingSituation = e.value;
  844. this.personal_info.housingSituationN = e.name;
  845. //this.$refs.uForm.validateField('personal_info.housingSituation')
  846. },
  847. childrenSelect(e) {
  848. this.personal_info.childStatus = e.value;
  849. this.personal_info.childStatusN = e.name;
  850. //this.$refs.uForm.validateField('personal_info.childStatus')
  851. },
  852. marriageSelect(e) {
  853. this.personal_info.maritalStatus = e.value;
  854. this.personal_info.maritalStatusN = e.name;
  855. //this.$refs.uForm.validateField('personal_info.maritalStatus')
  856. },
  857. taAgeRangeSelect(e) {
  858. this.personal_info.taAgeRange = e.value;
  859. this.personal_info.taAgeRangeN = e.name;
  860. //this.$refs.uForm.validateField('personal_info.taAgeRange')
  861. },
  862. taEducationSelect(e) {
  863. this.personal_info.taEdu = e.value;
  864. this.personal_info.taEduN = e.name;
  865. //this.$refs.uForm.validateField('personal_info.taEdu')
  866. },
  867. taSalarySelect(e) {
  868. this.personal_info.taIncomeRange = e.value;
  869. this.personal_info.taIncomeRangeN = e.name;
  870. //this.$refs.uForm.validateField('personal_info.taIncomeRange')
  871. },*/
  872. heightConfirm(e){
  873. console.log('e'+JSON.stringify(e))
  874. this.form.height = '';
  875. e.map((val, index) => {
  876. // this.result += this.result == '' ? val.label : '-' + val.label;
  877. let result = val.label
  878. _self.personal_info.height = val.value
  879. this.form.height += result;
  880. })
  881. },
  882. weightConfirm(e){
  883. console.log('e'+JSON.stringify(e))
  884. this.form.weight = '';
  885. e.map((val, index) => {
  886. // this.result += this.result == '' ? val.label : '-' + val.label;
  887. let result = val.label
  888. _self.personal_info.weight = val.value;
  889. this.form.weight += result;
  890. })
  891. },
  892. uploadPhoto(){
  893. // 上传图片
  894. //const ctx = uni.createCanvasContext('myCanvas');
  895. //console.log('url'+this.uploadUrl)
  896. //console.log(this.carhelp.getToken())
  897. let _this = this;
  898. uni.chooseImage({
  899. count: 1, //默认9
  900. // sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  901. sourceType: ['album','camera'], //从相册选择
  902. success:(res)=> {
  903. let imgFile = res.tempFilePaths;
  904. console.log(process.car.BASE_URL+"mobile/member/uploadBase64")
  905. console.log(imgFile)
  906. console.log(process.car.NODE_ENV)
  907. console.log()
  908. var token=this.carhelp.getToken()
  909. for(let i = 0;i < imgFile.length;i++)
  910. {
  911. wx.uploadFile({
  912. url:process.car.BASE_URL+"uploadPicture",
  913. // url:process.car.BASE_URL+"mobile/member/uploadBase64",
  914. name: 'photoFile',
  915. header: {
  916. // 'appId': process.car.VUE_APP_WXAPPID ,
  917. 'Authorization':token ,
  918. // 'openId': "wxa8954f417fa7c32f" ,
  919. 'accept': 'application/json',
  920. //#ifdef MP-WEIXIN
  921. "Content-Type": "multipart/form-data",//记得设置
  922. //#endif
  923. },
  924. filePath: imgFile[0],
  925. success: function(result) {
  926. let imgUrls = JSON.parse(result.data) //百度支持 this.site_url +'/' +
  927. //let image ={url: imgUrls.data};
  928. //_self.fileList.push(image); //微信
  929. _self.personal_info.faceImage = imgUrls.data;
  930. }
  931. })
  932. }
  933. },
  934. });
  935. },
  936. findByOpenId(){
  937. var openId=this.carhelp.getOpenId()
  938. if(openId==""){
  939. console.log("------------------")
  940. setTimeout(()=>{
  941. this.findByOpenId()
  942. },1000)
  943. return
  944. }
  945. uni.request({
  946. method:'get',
  947. url: process.car.BASE_URL + "/mobile/regUser/findByOpenId",
  948. data: {
  949. openId:openId,
  950. },
  951. header: {
  952. 'Content-Type': 'application/x-www-form-urlencoded',
  953. 'X-Requested-With': 'XMLHttpRequest',
  954. }
  955. }).then((response) => {
  956. console.log('findByOpenId')
  957. let [error, res] = response;
  958. if (res.data.code == 200&&res.data.result) {
  959. var token = res ? res.data.data.token : '';
  960. this.carhelp.setPersonInfo(res.data.data.memberInfo );
  961. this.carhelp.setToken(token);
  962. this.carhelp.setPersonInfoPlus(res.data.data);
  963. }
  964. }).catch(error => {
  965. })
  966. }
  967. }
  968. }
  969. </script>
  970. <style>
  971. page{
  972. background-color: #f4f0f0;
  973. }
  974. </style>
  975. <style lang="scss" scoped>
  976. .edit-text{
  977. margin-top: 10px;
  978. color:#999;
  979. }
  980. .edit-row{
  981. padding: 12px 0;
  982. .edit-label{
  983. display: flex;
  984. margin-top: 10px;
  985. flex-wrap: wrap;
  986. span{
  987. margin-right: 8px;
  988. background-color: #E5E7EA ;
  989. padding: 4px 10px;
  990. border-radius: 4px;
  991. font-size: 12px;
  992. margin-bottom: 10px;
  993. }
  994. .active{
  995. background-color: #FFC1BC;
  996. }
  997. }
  998. }
  999. .edit-line{
  1000. height: 12px;
  1001. background-color:#f4f0f0 ;
  1002. margin-left: -15px;
  1003. margin-right: -15px;
  1004. }
  1005. .edit-title{
  1006. padding:12px 0;
  1007. padding-left: 15px;
  1008. background-color:#f4f0f0 ;
  1009. margin-left: -15px;
  1010. margin-right: -15px;
  1011. }
  1012. .edit-head{
  1013. display: flex;
  1014. padding: 20px 0;
  1015. justify-content: center;
  1016. }
  1017. .personal-btn{
  1018. padding: 15px 50px;
  1019. }
  1020. .edit-form{
  1021. padding: 0 15px;
  1022. background-color: #fff;
  1023. }
  1024. </style>