personal.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584
  1. <template>
  2. <view>
  3. <view class="personal">
  4. <u-navbar :border-bottom="false" :background="navbarBg" back-icon-color="#fff"></u-navbar>
  5. <view class="personalHead">
  6. <u-image width="100%" height="375px" :src="personalInfo.faceImage"></u-image>
  7. </view>
  8. <view class="personal-main">
  9. <view class="personal-name">
  10. <span>{{personalInfo.realName}}</span>
  11. <u-icon custom-prefix="custom-icon" name="men-line" color="#1677FF"></u-icon>
  12. </view>
  13. <view class="personal-space">
  14. <view class="personal-info">
  15. <span>{{baseInfo}}</span>
  16. </view>
  17. <view class="personal-address">
  18. <u-icon custom-prefix="custom-icon" name="map-pin-2-fill"></u-icon>
  19. <span>{{area}}</span>
  20. </view>
  21. </view>
  22. <view class="personal-att">
  23. <view class="personal-att-text">
  24. <h2>{{orgName}}</h2>
  25. <view class="u-flex" v-show="personalInfo.status == 1">
  26. <p>实名认证用户</p>
  27. <u-icon custom-prefix="custom-icon" name="check-line"></u-icon>
  28. </view>
  29. </view>
  30. <u-image width="60px" height="60px" src="/static/img/personal-att.png"></u-image>
  31. </view>
  32. <view class="personal-item">
  33. <view class="personal-tit">
  34. <u-icon custom-prefix="custom-icon" name="account-box-line" color="#FF5E5E" size="20px"></u-icon>
  35. <span>个人资料</span>
  36. </view>
  37. <view class="personal-con">
  38. <view class="personal-col">
  39. <p>会员号</p>
  40. <h4>N0.0001</h4>
  41. </view>
  42. <view class="personal-col">
  43. <p>学历</p>
  44. <h4>{{education}}</h4>
  45. </view>
  46. <view class="personal-col">
  47. <p>行业</p>
  48. <h4>{{profession}}</h4>
  49. </view>
  50. <view class="personal-col">
  51. <p>职业</p>
  52. <h4>{{work_post}}</h4>
  53. </view>
  54. <view class="personal-col">
  55. <p>月薪</p>
  56. <h4>{{salary_range}}</h4>
  57. </view>
  58. <view class="personal-col">
  59. <p>住房状况</p>
  60. <h4>{{house_status}}</h4>
  61. </view>
  62. <view class="personal-col">
  63. <p>婚姻状况</p>
  64. <h4>{{marriage_status}}</h4>
  65. </view>
  66. <view class="personal-col">
  67. <p>子女状况</p>
  68. <h4>{{children_status}}</h4>
  69. </view>
  70. <view class="personal-col">
  71. <p>出生地</p>
  72. <h4>{{address}}</h4>
  73. </view>
  74. <view class="personal-col">
  75. <p>现工作所在地</p>
  76. <h4>{{workAddress}}</h4>
  77. </view>
  78. <view class="personal-row">
  79. <p>兴趣爱好</p>
  80. <view class="personal-label" >
  81. <span v-for="(item,index) in interests" :key="index">
  82. {{item.name}}
  83. </span>
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. <view class="personal-item">
  89. <view class="personal-tit">
  90. <u-icon custom-prefix="custom-icon" name="file-list-3-line" color="#FF5E5E" size="20px"></u-icon>
  91. <span>自我评价</span>
  92. </view>
  93. <view class="personal-con">
  94. <view class="personal-text">
  95. {{personalInfo.selfEvaluation}}
  96. </view>
  97. </view>
  98. </view>
  99. <view class="personal-item">
  100. <view class="personal-tit">
  101. <u-icon custom-prefix="custom-icon" name="chat-heart-line" color="#FF5E5E" size="20px"></u-icon>
  102. <span>择偶标准</span>
  103. </view>
  104. <view class="personal-con">
  105. <view class="personal-col">
  106. <p>年龄范围</p>
  107. <h4>25~30</h4>
  108. </view>
  109. <view class="personal-col">
  110. <p>月薪</p>
  111. <h4>{{salary_range}}</h4>
  112. </view>
  113. <view class="personal-col">
  114. <p>学历</p>
  115. <h4>不限</h4>
  116. </view>
  117. <view class="personal-col">
  118. <p>职业</p>
  119. <h4>不限</h4>
  120. </view>
  121. <view class="personal-row">
  122. <p>现工作所在地</p>
  123. <h4>{{taWorkAddress}}</h4>
  124. </view>
  125. <view class="personal-row">
  126. <p>其他要求</p>
  127. <h4>{{personalInfo.taOther}}</h4>
  128. </view>
  129. </view>
  130. </view>
  131. <view class="personal-btn">
  132. <u-button type="error" shape="circle" :custom-style="customStyle" @click="edit">
  133. <span>编辑</span>
  134. <u-icon custom-prefix="custom-icon" name="edit-2-line"></u-icon>
  135. </u-button>
  136. </view>
  137. </view>
  138. </view>
  139. </view>
  140. </template>
  141. <script>
  142. let _self;
  143. import * as loginApi from '@/apis/login.js'
  144. import {provinceData,setCityData,getCityData,getAeraData} from '@/apis/city.js';
  145. export default {
  146. data() {
  147. return {
  148. navbarBg: {
  149. background: 'none'
  150. },
  151. customStyle: {
  152. background: '#FF5E5E'
  153. },
  154. personalInfo:{
  155. faceImage:'http://rccs.oss-cn-hangzhou.aliyuncs.com/jp-xqjy/user2.jpg'
  156. },
  157. orgName:'',
  158. baseInfo:'',
  159. address:'',
  160. registered_residence:'',
  161. workAddress:'',
  162. area:'',
  163. taWorkAddress:'',
  164. interests:[],
  165. education:'',
  166. work_post:'',
  167. profession:'',
  168. salary_range:'',
  169. house_status:'',
  170. marriage_status:'',
  171. children_status:'',
  172. user_id:''
  173. }
  174. },
  175. methods:{
  176. edit(){
  177. uni.navigateTo({
  178. url:'./edit'
  179. })
  180. }
  181. },
  182. onLoad(options){
  183. _self = this;
  184. if(options.id)
  185. this.user_id =JSON.parse(decodeURIComponent(options.user_id)) ;
  186. else if(options.user_id)
  187. this.user_id = decodeURIComponent(options.user_id);
  188. else
  189. this.user_id = 'oHjCawigqi8SEAwutwkQ-VEgdp3k';
  190. let personal_info1 = this.carhelp.getPersonInfo();
  191. let data ={openId: this.user_id};
  192. loginApi.findByOpenId(data).then(function(data){
  193. if(!data.result)
  194. return;
  195. if(!data.data)
  196. return;
  197. if(!data.data.memberInfo)
  198. return;
  199. _self.personalInfo = data.data.memberInfo;
  200. let personal_info = data.data.memberInfo;
  201. console.log('查找用户数据'+JSON.stringify(data.data.memberInfo))
  202. if(provinceData.length<=0){
  203. loginApi.getCityList().then(function(data){
  204. //console.log('获取城市成功'+JSON.stringify(data));
  205. if(data.result && data.data){
  206. setCityData(data.data);
  207. //_self.$refs.mpvuebirtydayCityPicker.setCityData(data.data);
  208. //console.log('province data '+JSON.stringify(provinceData))
  209. if(personal_info.birthplace != null)
  210. _self.address = getCityData(Number(personal_info.birthplace));
  211. if(personal_info.registeredResidence != null)
  212. _self.registered_residence = getCityData(Number(personal_info.registeredResidence));
  213. if(personal_info.workplace != null)
  214. {
  215. _self.workAddress = getCityData(Number(personal_info.workplace));
  216. _self.area = getAeraData(Number(personal_info.workplace));
  217. /*if(_self.workAddress!=null && _self.workAddress.length>0){
  218. }*/
  219. }
  220. if(personal_info.taWorkplace!= null){
  221. _self.taWorkAddress = getCityData(Number(personal_info.taWorkplace));
  222. }
  223. console.log('taWorkAddress'+personal_info.taWorkplace+_self.taWorkAddress)
  224. //console.log('个人信息'+JSON.stringify(personal_info))
  225. }
  226. },function(err){
  227. console.log('获取城市列表错误'+JSON.stringify(err))
  228. })
  229. }else
  230. {
  231. console.log('找到用户数据')
  232. if(personal_info.birthplace != null)
  233. {
  234. _self.address = getCityData(Number(personal_info.birthplace));
  235. }
  236. if(personal_info.registeredResidence != null)
  237. {
  238. _self.registered_residence = getCityData(Number(personal_info.registeredResidence));
  239. }
  240. if(personal_info.workplace != null)
  241. {
  242. _self.workAddress = getCityData(Number(personal_info.workplace));
  243. _self.area = getAeraData(Number(personal_info.workplace));
  244. }
  245. if(personal_info.taWorkplace!= null){
  246. _self.taWorkAddress = getCityData(Number(personal_info.taWorkplace));
  247. }
  248. console.log('address'+_self.address+_self.registered_residence+_self.registered_residence)
  249. }
  250. loginApi.orgList().then(function(data){
  251. // console.log('工会信息'+JSON.stringify(data));
  252. if(data.result)
  253. {
  254. let _data = data.data;
  255. if(_data){
  256. let data1 = _data.data;
  257. if(data1){
  258. for(let i = 0;i<data1.length;i++)
  259. {
  260. let orgName1 = personal_info.orgId;
  261. let orgName2 = data1[i].id;
  262. if(orgName1 === orgName2)
  263. {
  264. _self.orgName = data1[i].name;
  265. //console.log('找到工会 '+JSON.stringify(data1))
  266. }else{
  267. //console.log('工会'+JSON.stringify(orgName1)+JSON.stringify(orgName2))
  268. }
  269. }
  270. }
  271. }
  272. }
  273. },function(err){
  274. });
  275. ///
  276. let subject = {subject:''}
  277. loginApi.getBaseDictionary(subject).then(function(data){
  278. //console.log('基础字典'+JSON.stringify(data));
  279. if(data.data)
  280. {
  281. let zfqkList = data.data.zfqkList;
  282. let yxList = data.data.yxList;
  283. let znqkList = data.data.znqkList;
  284. let qyList = data.data.qyList;
  285. let xlList = data.data.xlList;
  286. let hyList = data.data.hyList;
  287. let nlfwList = data.data.nlfwList;
  288. let hyqkList = data.data.hyqkList;
  289. let hobbyInfoList = data.data.hobbyInfoList;
  290. if(hobbyInfoList && personal_info.hobbys && personal_info.hobbys.length>0){
  291. //console.log('兴趣列表'+JSON.stringify(hobbyInfoList));
  292. let interests = [];
  293. for(let i = 0;i< hobbyInfoList.length;i++)
  294. {
  295. let interest = hobbyInfoList[i];
  296. if(personal_info.hobbys.indexOf(interest.id)>=0)
  297. {
  298. let interest1 = {name:interest.name,checked:false,id:interest.id};
  299. _self.interests.push(interest1)
  300. }
  301. }
  302. //_self.interests = interests;
  303. }
  304. if(personal_info)
  305. {
  306. //console.log('xlList'+JSON.stringify(xlList))
  307. if(personal_info.education!=null){
  308. for(let i = 0;i< xlList.length;i++)
  309. {
  310. if(personal_info.education == xlList[i].value)
  311. {
  312. _self.education = xlList[i].name;
  313. }
  314. }
  315. }
  316. /*
  317. if(personal_info.workUnit!=null){
  318. _self.form.work_corporation = personal_info.workUnit;
  319. } */
  320. if(personal_info.post!=null){
  321. _self.work_post = personal_info.post;
  322. }
  323. if(personal_info.industry!=null){
  324. for(let i = 0;i< hyList.length;i++)
  325. {
  326. if(personal_info.industry == hyList[i].value)
  327. {
  328. _self.profession = hyList[i].name;
  329. }
  330. }
  331. }
  332. if(personal_info.salaryRange!=null){
  333. console.log('xlList'+JSON.stringify(yxList) +JSON.stringify(_self.salary_range))
  334. for(let i = 0;i< yxList.length;i++)
  335. {
  336. if(personal_info.salaryRange == yxList[i].value)
  337. {
  338. _self.salary_range = yxList[i].name;
  339. }
  340. }
  341. }
  342. if(personal_info.taIncomeRange!=null){
  343. for(let i = 0;i< yxList.length;i++)
  344. {
  345. if(personal_info.taIncomeRange == yxList[i].value)
  346. {
  347. _self.taSalary = yxList[i].name;
  348. }
  349. }
  350. }
  351. if(personal_info.housingSituation!=null){
  352. for(let i = 0;i< zfqkList.length;i++)
  353. {
  354. if(personal_info.housingSituation == zfqkList[i].value)
  355. {
  356. _self.house_status = zfqkList[i].name;
  357. }
  358. }
  359. }
  360. if(personal_info.maritalStatus!=null){
  361. for(let i = 0;i< hyqkList.length;i++)
  362. {
  363. if(personal_info.maritalStatus == hyqkList[i].value)
  364. {
  365. _self.marriage_status = hyqkList[i].name;
  366. }
  367. }
  368. }
  369. if(personal_info.childStatus!=null){
  370. for(let i = 0;i< znqkList.length;i++)
  371. {
  372. if(personal_info.childStatus == znqkList[i].value)
  373. {
  374. _self.children_status = znqkList[i].name;
  375. }
  376. }
  377. }
  378. }
  379. }
  380. },function(err){
  381. console.log('获取基础字典错误'+JSON.stringify(err))
  382. })
  383. },function(err){
  384. })
  385. },
  386. onReady(){
  387. // console.log('个人信息'+JSON.stringify(this.personalInfo))
  388. if(this.personalInfo.age !=null){
  389. this.baseInfo+= this.personalInfo.age.toString();
  390. if(this.personalInfo.height != null || this.personalInfo.weight != null)
  391. {
  392. this.baseInfo+= '岁 · '
  393. }else
  394. {
  395. this.baseInfo+='岁'
  396. }
  397. }
  398. if(this.personalInfo.height !=null){
  399. this.baseInfo+= this.personalInfo.height.toString();
  400. if(this.personalInfo.weight != null){
  401. this.baseInfo+='cm · '
  402. }else
  403. {
  404. this.baseInfo+='cm'
  405. }
  406. }
  407. if(this.personalInfo.weight != null){
  408. this.baseInfo+= this.personalInfo.weight.toString()+'kg';
  409. }
  410. }
  411. }
  412. </script>
  413. <style lang="scss" scoped>
  414. .personal{
  415. margin-top: -44px;
  416. }
  417. .personal-main{
  418. background-color: #fff;
  419. border-radius:12px 12px 0 0;
  420. margin-top: -12px;
  421. padding: 15px;
  422. position: relative;
  423. z-index: 99;
  424. }
  425. .personal-name{
  426. display: flex;
  427. align-items: center;
  428. span{
  429. font-size: 20px;
  430. margin-right: 5px;
  431. }
  432. }
  433. .personal-space{
  434. display: flex;
  435. justify-content: space-between;
  436. margin-top: 8px;
  437. .personal-info{
  438. span{color:#444953;}
  439. }
  440. .personal-address{
  441. background-color: #F1F3F4;
  442. padding: 4px 12px;
  443. border-radius: 4px;
  444. color:#444953;
  445. span{
  446. margin-left: 3px;
  447. }
  448. }
  449. }
  450. .personal-att{
  451. background-color: #F1F3F4;
  452. display: flex;
  453. align-items: center;
  454. justify-content: space-between;
  455. padding: 16px;
  456. margin: 20px 0;
  457. border-radius: 12px;
  458. .personal-att-text{
  459. h2{
  460. font-size: 20px;
  461. font-weight: normal;
  462. color:#555;
  463. margin-bottom: 4px;
  464. }
  465. .u-flex{
  466. color:#27B148;
  467. p{
  468. margin-right: 3px;
  469. }
  470. }
  471. }
  472. }
  473. .personal-item{
  474. margin-top: 24px;
  475. .personal-tit{
  476. display: flex;
  477. align-items: center;
  478. span{
  479. font-size: 16px;
  480. margin-left: 4px;
  481. }
  482. }
  483. .personal-con{
  484. display: flex;
  485. flex-wrap: wrap;
  486. justify-content: space-between;
  487. .personal-col{
  488. width: 48%;
  489. border-radius: 4px;
  490. background-color: #F1F3F4 ;
  491. padding: 12px 16px;
  492. margin-top: 10px;
  493. p{
  494. color:#999;
  495. font-size: 12px;
  496. }
  497. h4{
  498. font-size: 16px;
  499. font-weight: normal;
  500. margin-top: 4px;
  501. }
  502. }
  503. .personal-row{
  504. border-radius: 4px;
  505. background-color: #F1F3F4 ;
  506. padding: 12px 16px;
  507. margin-top: 10px;
  508. width: 100%;
  509. p{
  510. color:#999;
  511. font-size: 12px;
  512. }
  513. h4{
  514. font-size: 16px;
  515. font-weight: normal;
  516. margin-top: 4px;
  517. }
  518. .personal-label{
  519. display: flex;
  520. margin-top: 10px;
  521. flex-wrap: wrap;
  522. span{
  523. margin-right: 8px;
  524. background-color: #FFC1BC ;
  525. padding: 4px 10px;
  526. border-radius: 4px;
  527. font-size: 12px;
  528. margin-bottom: 10px;
  529. }
  530. }
  531. }
  532. .personal-text{
  533. border-radius: 4px;
  534. padding: 16px;
  535. background-color: #F1F3F4;
  536. margin-top: 10px;
  537. line-height: 24px;
  538. }
  539. }
  540. }
  541. .personal-btn{
  542. padding: 15px;
  543. span{
  544. margin-right: 5px;
  545. }
  546. }
  547. </style>