personal.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535
  1. <template>
  2. <view>
  3. <view class="personal">
  4. <u-modal v-model="show" :showConfirmButton="false" :mask-close-able="true" >
  5. <view class="praiseMain">
  6. <view class="praiseMain-item">
  7. <view class="praiseMain-tit">恭喜配对成功!</view>
  8. <view class="praiseMain-pic">
  9. <view class="praiseMain-pic-item">
  10. <u-image class="newsList-img" :src="info.faceImage+'?x-oss-process=image/resize,m_fill,w_256,h_256'" height="260" width="260" border-radius="10"></u-image>
  11. </view>
  12. <view class="praiseMain-heart">
  13. <u-icon custom-prefix="custom-icon" name="heart-2-fill" size="36px" color="#fff"></u-icon>
  14. </view>
  15. <view class="praiseMain-pic-item">
  16. <u-image class="newsList-img" :src="detail.faceImage+'?x-oss-process=image/resize,m_fill,w_256,h_256'" height="260" width="260" border-radius="10"></u-image>
  17. </view>
  18. </view>
  19. <view class="praiseMain-pic-text">恭喜!您与「{{detail.realName}}」相互点赞!</view>
  20. <view class="praiseMain-btn">
  21. <u-button type="error" @click="gotoUrl('pages/user/message?id='+detail.id)" shape="circle" :custom-style="customStyle2">联系Ta</u-button>
  22. </view>
  23. </view>
  24. </view>
  25. </u-modal>
  26. <view class="personalHead personalHead-friend" :style="'height: '+(detail.faceImage?'375':'120')+'px;background-size : cover;background-image: url('+detail.faceImage+') ;background-repeat:no-repeat;background-position:center; '">
  27. <u-navbar :is-back="false"
  28. :border-bottom="false" :backTextStyle="backTextStyle" :backIconColor="backIconColor" :background="navbarBg" >
  29. <view class="slot-wrap" @tap="goBack" >
  30. <u-icon class="navbar-back" style="border: 1px solid #fff;border-radius:100%" custom-prefix="custom-icon" name="icon-back2" ></u-icon>
  31. </view>
  32. </u-navbar>
  33. </view>
  34. <view class="personal-main" v-if="detail.id">
  35. <view class="personal-name">
  36. <span v-text="showName(detail.realName)"></span>
  37. <u-icon custom-prefix="custom-icon" :name="detail.gender?'women-line':'men-line'" :color="detail.gender?'#FF695B':'#1677FF'"></u-icon>
  38. </view>
  39. <view class="personal-space">
  40. <view class="personal-info">
  41. <span>{{detail.age}}岁 · {{detail.height}}cm {{detail.weight?'· '+detail.weight+'kg':''}}</span>
  42. </view>
  43. <view class="personal-address">
  44. <u-icon custom-prefix="custom-icon" name="map-pin-2-fill"></u-icon>
  45. <span>{{detail.orgAreaName}}</span>
  46. </view>
  47. </view>
  48. <view class="personal-att">
  49. <view class="personal-att-text">
  50. <h2 v-if="islogin">{{detail.orgName}}</h2>
  51. <view class="u-flex">
  52. <p>实名认证用户</p>
  53. <u-icon custom-prefix="custom-icon" name="check-line"></u-icon>
  54. </view>
  55. </view>
  56. <u-image width="60px" height="60px" src="/static/img/personal-att.png"></u-image>
  57. </view>
  58. <view class="personal-item">
  59. <view class="personal-tit">
  60. <u-icon custom-prefix="custom-icon" name="account-box-line" color="#FF5E5E" size="20px"></u-icon>
  61. <span>个人资料</span>
  62. </view>
  63. <view class="personal-con">
  64. <view class="personal-col">
  65. <p>会员号</p>
  66. <h4>N0.{{detail.number}}</h4>
  67. </view>
  68. <view class="personal-col">
  69. <p>学历</p>
  70. <h4>{{detail.educationN}}</h4>
  71. </view>
  72. <view class="personal-col">
  73. <p>行业</p>
  74. <h4>{{detail.industryN}}</h4>
  75. </view>
  76. <view class="personal-col">
  77. <p>职业</p>
  78. <h4>{{detail.post}}</h4>
  79. </view>
  80. <view class="personal-col">
  81. <p>月薪</p>
  82. <h4>{{detail.salaryRangeN}}</h4>
  83. </view>
  84. <view class="personal-col">
  85. <p>住房状况</p>
  86. <h4>{{detail.housingSituationN}}</h4>
  87. </view>
  88. <view class="personal-col">
  89. <p>婚姻状况</p>
  90. <h4>{{detail.maritalStatusN}}</h4>
  91. </view>
  92. <view class="personal-col">
  93. <p>子女状况</p>
  94. <h4>{{detail.childStatusN}}</h4>
  95. </view>
  96. <view class="personal-col">
  97. <p>出生地</p>
  98. <h4>{{detail.birthplaceN}}</h4>
  99. </view>
  100. <view class="personal-col">
  101. <p>现工作所在地</p>
  102. <h4>{{detail.workplaceN}}</h4>
  103. </view>
  104. <view class="personal-row">
  105. <p>兴趣爱好</p>
  106. <view class="personal-label">
  107. <view v-if="!islogin">游客不可见</view>
  108. <span v-for="(item,index) in hobbyList"
  109. :key="index"
  110. >{{item.hobbyName}}</span>
  111. <view v-if="islogin&&hobbyList.length==0">暂未填写</view>
  112. </view>
  113. </view>
  114. </view>
  115. </view>
  116. <view class="personal-item">
  117. <view class="personal-tit">
  118. <u-icon custom-prefix="custom-icon" name="file-list-3-line" color="#FF5E5E" size="20px"></u-icon>
  119. <span>自我评价</span>
  120. </view>
  121. <view class="personal-con">
  122. <view class="personal-text">
  123. {{detail.selfEvaluation?detail.selfEvaluation:'暂未填写'}}
  124. </view>
  125. </view>
  126. </view>
  127. <view class="personal-item" style=" padding-bottom: 60px;">
  128. <view class="personal-tit">
  129. <u-icon custom-prefix="custom-icon" name="chat-heart-line" color="#FF5E5E" size="20px"></u-icon>
  130. <span>择偶标准</span>
  131. </view>
  132. <view class="personal-con">
  133. <view class="personal-col">
  134. <p>年龄范围</p>
  135. <h4>{{detail.taAgeRangeN}}</h4>
  136. </view>
  137. <view class="personal-col">
  138. <p>月薪</p>
  139. <h4>{{detail.taIncomeRangeN}}</h4>
  140. </view>
  141. <view class="personal-col">
  142. <p>学历</p>
  143. <h4>{{detail.taEduN}}</h4>
  144. </view>
  145. <view class="personal-col">
  146. <p>职业</p>
  147. <h4>{{detail.taOccupation}}</h4>
  148. </view>
  149. <view class="personal-row">
  150. <p>现工作所在地</p>
  151. <h4>{{detail.taWorkplaceN}}</h4>
  152. </view>
  153. <view class="personal-row">
  154. <p>其他要求</p>
  155. <h4>{{detail.taOther}}</h4>
  156. </view>
  157. </view>
  158. </view>
  159. </view>
  160. <template v-if="detail.id">
  161. <view class="personal-btn" v-if="!islogin">
  162. <u-button type="error" @click="gotoUrl('pagesA/pages/login/index')" shape="circle" :custom-style="customStyle">
  163. <span>注册 / 登录</span>
  164. </u-button>
  165. </view>
  166. <view class="personal-btn" v-if="islogin">
  167. <u-button type="error" v-if="isedit" @click="gotoUrl('pages/user/edit')" shape="circle" :custom-style="customStyle">
  168. <span>编辑</span>
  169. <u-icon custom-prefix="custom-icon" name="edit-2-line"></u-icon>
  170. </u-button>
  171. <u-button type="error" v-if="!isedit" @click="likeBtn" shape="circle" :custom-style="customStyle">
  172. <span>{{isLike?'已赞':'赞Ta'}}</span>
  173. <u-icon custom-prefix="custom-icon" name="thumb-up-line"></u-icon>
  174. </u-button>
  175. </view>
  176. </template>
  177. </view>
  178. </view>
  179. </template>
  180. <script>
  181. import * as friendApi from '@/apis/friend.js'
  182. export default {
  183. data() {
  184. return {
  185. info:{},
  186. show:false,
  187. islogin:false,
  188. isedit:false,
  189. id:"",
  190. readStatus:0,
  191. isLike:false,
  192. detail:{},
  193. hobbyList:[],
  194. backIconColor:'#FFFFFF',
  195. backTextStyle:{
  196. background: '#FF5E5E'
  197. },
  198. navbarBg: {
  199. background: 'none'
  200. },
  201. customStyle: {
  202. background: '#FF5E5E'
  203. },
  204. customStyle2: {
  205. background: '#FF5E5E'
  206. },
  207. }
  208. },methods: {
  209. goBack() {
  210. uni.navigateBack();
  211. },
  212. likeBtn(){
  213. if(this.isLike){
  214. return
  215. }
  216. uni.showLoading({
  217. title: "加载中",
  218. mask: true,
  219. })
  220. friendApi.beLike({
  221. beMemberId:this.id,
  222. }).then(response => {
  223. this.isLike=true
  224. if(this.isLike){
  225. this.customStyle.background ="#a59f9f"
  226. }
  227. uni.hideLoading()
  228. if(response.data=="1"){
  229. this.show=true
  230. }
  231. }).catch(error => {
  232. uni.showToast({
  233. title: error,icon: "none"
  234. })
  235. })
  236. },
  237. getDetail() {
  238. var memberId=undefined;
  239. var info =this.carhelp.getPersonInfo();
  240. this.info=info
  241. if(info){
  242. if(!this.id||this.id==""){
  243. this.id=info.id
  244. }
  245. memberId=info.id
  246. this.islogin=true;
  247. if(this.id==info.id){
  248. this.isedit=true;
  249. }
  250. }
  251. uni.showLoading({
  252. title: "加载中",
  253. mask: true,
  254. })
  255. friendApi.detail({
  256. id:this.id,
  257. memberId:memberId,
  258. readStatus:this.readStatus
  259. }).then(response => {
  260. this.isLoading = false;
  261. this.detail = Object.assign(response.data.memberInfo)
  262. this.$forceUpdate()
  263. if(this.islogin){
  264. this.hobbyList = response.data.hobbyList;
  265. this.isLike = response.data.isLike;
  266. if(this.isLike){
  267. this.customStyle.background ="#a59f9f"
  268. }
  269. }else{
  270. var tempdetail = response.data.memberInfo;
  271. var sz=["number",'realName',"faceImage","gender","age",'height','weight','orgAreaName','orgName']
  272. for(var i in this.detail ){
  273. if(sz.indexOf(i)==-1){
  274. this.detail[i]="游客不可见"
  275. }
  276. }
  277. }
  278. for(var i in this.detail ){
  279. if(this.detail[i]==null){
  280. this.detail[i]=""
  281. }
  282. }
  283. uni.hideLoading()
  284. }).catch(error => {
  285. uni.showToast({
  286. title: error,icon: "none"
  287. })
  288. })
  289. }
  290. },
  291. onLoad(op) {
  292. if(op.id){
  293. this.id =op.id;
  294. }
  295. if(op.readStatus==1){
  296. this.readStatus=1;
  297. }
  298. },
  299. onReady() {
  300. this.getDetail();
  301. }
  302. }
  303. </script>
  304. <style >
  305. .personalHead-friend .u-icon-wrap{
  306. background: rgba(0, 0, 0, 0.5);
  307. padding: 4px;
  308. border-radius: 12px;
  309. }
  310. </style>
  311. <style lang="scss" scoped>
  312. .personalHead-friend {
  313. //background-size: 100% !important;
  314. }
  315. .slot-wrap{
  316. padding-left:20px;
  317. .navbar-back{
  318. color: #333;
  319. font-size: 20px;
  320. opacity: 0.5;
  321. }
  322. }
  323. .personal{
  324. margin-top: -44px;
  325. }
  326. .personal-main{
  327. padding-bottom: 80px;
  328. background-color: #fff;
  329. border-radius:12px 12px 0 0;
  330. margin-top: -12px;
  331. padding: 15px;
  332. position: relative;
  333. z-index: 99;
  334. }
  335. .personal-name{
  336. display: flex;
  337. align-items: center;
  338. span{
  339. font-size: 20px;
  340. margin-right: 5px;
  341. }
  342. }
  343. .personal-space{
  344. display: flex;
  345. justify-content: space-between;
  346. margin-top: 8px;
  347. .personal-info{
  348. span{color:#444953;}
  349. }
  350. .personal-address{
  351. background-color: #F1F3F4;
  352. padding: 4px 12px;
  353. border-radius: 4px;
  354. color:#444953;
  355. span{
  356. margin-left: 3px;
  357. }
  358. }
  359. }
  360. .personal-att{
  361. background-color: #F1F3F4;
  362. display: flex;
  363. align-items: center;
  364. justify-content: space-between;
  365. padding: 16px;
  366. margin: 20px 0;
  367. border-radius: 12px;
  368. .personal-att-text{
  369. h2{
  370. font-size: 20px;
  371. font-weight: normal;
  372. color:#555;
  373. margin-bottom: 4px;
  374. }
  375. .u-flex{
  376. color:#27B148;
  377. p{
  378. margin-right: 3px;
  379. }
  380. }
  381. }
  382. }
  383. .personal-item{
  384. margin-top: 24px;
  385. .personal-tit{
  386. display: flex;
  387. align-items: center;
  388. span{
  389. font-size: 16px;
  390. margin-left: 4px;
  391. }
  392. }
  393. .personal-con{
  394. display: flex;
  395. flex-wrap: wrap;
  396. justify-content: space-between;
  397. .personal-col{
  398. width: 48%;
  399. border-radius: 4px;
  400. background-color: #F1F3F4 ;
  401. padding: 12px 16px;
  402. margin-top: 10px;
  403. p{
  404. color:#999;
  405. font-size: 12px;
  406. }
  407. h4{
  408. font-size: 16px;
  409. font-weight: normal;
  410. margin-top: 4px;
  411. }
  412. }
  413. .personal-row{
  414. border-radius: 4px;
  415. background-color: #F1F3F4 ;
  416. padding: 12px 16px;
  417. margin-top: 10px;
  418. width: 100%;
  419. p{
  420. color:#999;
  421. font-size: 12px;
  422. }
  423. h4{
  424. font-size: 16px;
  425. font-weight: normal;
  426. margin-top: 4px;
  427. }
  428. .personal-label{
  429. display: flex;
  430. margin-top: 10px;
  431. flex-wrap: wrap;
  432. span{
  433. margin-right: 8px;
  434. background-color: #FFC1BC ;
  435. padding: 4px 10px;
  436. border-radius: 4px;
  437. font-size: 12px;
  438. margin-bottom: 10px;
  439. }
  440. }
  441. }
  442. .personal-text{
  443. border-radius: 4px;
  444. padding: 16px;
  445. background-color: #F1F3F4;
  446. margin-top: 10px;
  447. line-height: 24px;
  448. }
  449. }
  450. }
  451. .personal-btn{
  452. z-index: 100;
  453. position: fixed;
  454. bottom: 0;
  455. width: 100%;
  456. padding: 15px;
  457. span{
  458. margin-right: 5px;
  459. }
  460. }
  461. .praiseMain{
  462. .praiseMain-item{
  463. margin: 15px;
  464. background-color: #fff;
  465. border-radius: 12px;
  466. //padding: 20px;
  467. position: relative;
  468. }
  469. .praiseMain-heart{
  470. height: 60px;
  471. width: 60px;
  472. background-color: #FF5E5E;
  473. position: absolute;
  474. border-radius: 50%;
  475. top: 95px;
  476. left: 50%;
  477. margin-left: -30px;
  478. z-index: 9;
  479. line-height: 60px;
  480. text-align: center;
  481. }
  482. .praiseMain-tit{
  483. font-size: 24px;
  484. color:#FF5E5E;
  485. margin-bottom: 10px;
  486. text-align: center;
  487. }
  488. .praiseMain-pic{
  489. display: flex;
  490. justify-content: space-between;
  491. //padding: 0 15px;
  492. }
  493. .praiseMain-pic-text{
  494. font-size: 16px;
  495. text-align: center;
  496. margin: 15px 0;
  497. }
  498. .praiseMain-btn{
  499. padding: 0 15px;
  500. }
  501. }
  502. </style>