personal.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528
  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. console.log('op'+JSON.stringify(op))
  291. if(op.id){
  292. this.id =op.id;
  293. }
  294. if(op.readStatus==1){
  295. this.readStatus=1;
  296. }
  297. },
  298. onReady() {
  299. this.getDetail();
  300. }
  301. }
  302. </script>
  303. <style>
  304. .personalHead-friend .u-icon-wrap{
  305. background: rgba(0, 0, 0, 0.5);
  306. padding: 4px;
  307. border-radius: 12px;
  308. }
  309. </style>
  310. <style lang="scss" scoped>
  311. .slot-wrap{
  312. padding-left:20px;
  313. .navbar-back{
  314. font-size: 20px;
  315. opacity: 0.5;
  316. }
  317. }
  318. .personal{
  319. margin-top: -44px;
  320. }
  321. .personal-main{
  322. padding-bottom: 80px;
  323. background-color: #fff;
  324. border-radius:12px 12px 0 0;
  325. margin-top: -12px;
  326. padding: 15px;
  327. position: relative;
  328. z-index: 99;
  329. }
  330. .personal-name{
  331. display: flex;
  332. align-items: center;
  333. span{
  334. font-size: 20px;
  335. margin-right: 5px;
  336. }
  337. }
  338. .personal-space{
  339. display: flex;
  340. justify-content: space-between;
  341. margin-top: 8px;
  342. .personal-info{
  343. span{color:#444953;}
  344. }
  345. .personal-address{
  346. background-color: #F1F3F4;
  347. padding: 4px 12px;
  348. border-radius: 4px;
  349. color:#444953;
  350. span{
  351. margin-left: 3px;
  352. }
  353. }
  354. }
  355. .personal-att{
  356. background-color: #F1F3F4;
  357. display: flex;
  358. align-items: center;
  359. justify-content: space-between;
  360. padding: 16px;
  361. margin: 20px 0;
  362. border-radius: 12px;
  363. .personal-att-text{
  364. h2{
  365. font-size: 20px;
  366. font-weight: normal;
  367. color:#555;
  368. margin-bottom: 4px;
  369. }
  370. .u-flex{
  371. color:#27B148;
  372. p{
  373. margin-right: 3px;
  374. }
  375. }
  376. }
  377. }
  378. .personal-item{
  379. margin-top: 24px;
  380. .personal-tit{
  381. display: flex;
  382. align-items: center;
  383. span{
  384. font-size: 16px;
  385. margin-left: 4px;
  386. }
  387. }
  388. .personal-con{
  389. display: flex;
  390. flex-wrap: wrap;
  391. justify-content: space-between;
  392. .personal-col{
  393. width: 48%;
  394. border-radius: 4px;
  395. background-color: #F1F3F4 ;
  396. padding: 12px 16px;
  397. margin-top: 10px;
  398. p{
  399. color:#999;
  400. font-size: 12px;
  401. }
  402. h4{
  403. font-size: 16px;
  404. font-weight: normal;
  405. margin-top: 4px;
  406. }
  407. }
  408. .personal-row{
  409. border-radius: 4px;
  410. background-color: #F1F3F4 ;
  411. padding: 12px 16px;
  412. margin-top: 10px;
  413. width: 100%;
  414. p{
  415. color:#999;
  416. font-size: 12px;
  417. }
  418. h4{
  419. font-size: 16px;
  420. font-weight: normal;
  421. margin-top: 4px;
  422. }
  423. .personal-label{
  424. display: flex;
  425. margin-top: 10px;
  426. flex-wrap: wrap;
  427. span{
  428. margin-right: 8px;
  429. background-color: #FFC1BC ;
  430. padding: 4px 10px;
  431. border-radius: 4px;
  432. font-size: 12px;
  433. margin-bottom: 10px;
  434. }
  435. }
  436. }
  437. .personal-text{
  438. border-radius: 4px;
  439. padding: 16px;
  440. background-color: #F1F3F4;
  441. margin-top: 10px;
  442. line-height: 24px;
  443. }
  444. }
  445. }
  446. .personal-btn{
  447. z-index: 100;
  448. position: fixed;
  449. bottom: 0;
  450. width: 100%;
  451. padding: 15px;
  452. span{
  453. margin-right: 5px;
  454. }
  455. }
  456. .praiseMain{
  457. .praiseMain-item{
  458. margin: 15px;
  459. background-color: #fff;
  460. border-radius: 12px;
  461. //padding: 20px;
  462. position: relative;
  463. }
  464. .praiseMain-heart{
  465. height: 60px;
  466. width: 60px;
  467. background-color: #FF5E5E;
  468. position: absolute;
  469. border-radius: 50%;
  470. top: 95px;
  471. left: 50%;
  472. margin-left: -30px;
  473. z-index: 9;
  474. line-height: 60px;
  475. text-align: center;
  476. }
  477. .praiseMain-tit{
  478. font-size: 24px;
  479. color:#FF5E5E;
  480. margin-bottom: 10px;
  481. text-align: center;
  482. }
  483. .praiseMain-pic{
  484. display: flex;
  485. justify-content: space-between;
  486. //padding: 0 15px;
  487. }
  488. .praiseMain-pic-text{
  489. font-size: 16px;
  490. text-align: center;
  491. margin: 15px 0;
  492. }
  493. .praiseMain-btn{
  494. padding: 0 15px;
  495. }
  496. }
  497. </style>