personal.vue 12 KB

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