personal.vue 13 KB

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