index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592
  1. <template>
  2. <view class="self-card" :style="{'--height': tovw(+CustomBar+10)}">
  3. <view class="footer" :style="{ height: (tovw(CustomBar).replace('vw',''))*375 / 100+'px'}" style="background: linear-gradient( 225deg, #F43A50 0%, #C30D23 100%);top: 0;">
  4. <view class="custom" :style="{ height: (tovw(Custom.height).replace('vw',''))*375 / 100+'px', top:(tovw(Custom.top).replace('vw',''))*375 / 100+'px' }">
  5. <view v-if="userInfo.name">{{userInfo.name}}的名片</view>
  6. <view v-else>暂无信息</view>
  7. <view class="back" :style="{ lineHeight: (tovw(Custom.height).replace('vw',''))*375 / 100+'px' }" @click="onBack">
  8. <text class=" iconfont icon-a-wodetiaozhuan" />
  9. </view>
  10. </view>
  11. </view>
  12. <view class="head" :style="[{ height: tovw(+CustomBar+184) }]" style="background: linear-gradient( 225deg, #F43A50 0%, #C30D23 100%)">
  13. <view class="custom" :style="{ height: tovw(Custom.height), top: tovw(Custom.top - 3) }">
  14. <view v-if="userInfo.name">{{userInfo.name}}的名片</view>
  15. <view v-else>暂无信息</view>
  16. <view class="back" :style="{ lineHeight: tovw(Custom.height) }" @click="onBack">
  17. <text class=" iconfont icon-a-wodetiaozhuan" />
  18. </view>
  19. </view>
  20. <image class="bg-bottom" mode="widthFix" src="/static/workbench/减去.svg">
  21. </image>
  22. <view class="card">
  23. <view class="header">
  24. <view class="left">
  25. <view class="title">
  26. <text>{{ userInfo.name||'暂无' }}</text>
  27. <text>{{ userInfo.rolenames||'暂无' }}</text>
  28. </view>
  29. <text class="phone">{{ userInfo.phonebumber||'暂无' }}</text>
  30. <view class="redline"></view>
  31. </view>
  32. <navigator class="right">
  33. <image :src="userInfo.headpic || 'https://yossys06593.obs.cn-east-3.myhuaweicloud.com:443/202404231713854678447B26b4363.svg'" mode="aspectFill">
  34. </image>
  35. </navigator>
  36. </view>
  37. <view class="bottom">
  38. <view class="left">
  39. <view>
  40. <i class="iconfont icon-qiye-hui"></i>
  41. <view class="text">{{ userInfo.enterprisename||'暂无' }}</view>
  42. </view>
  43. <view>
  44. <i class="iconfont icon-youxiang"></i>
  45. <view class="text">{{ userInfo.email ||'暂无' }}</view>
  46. </view>
  47. <view style="margin-bottom: 0 !important;">
  48. <i class="iconfont icon-dizhi_xian"></i>
  49. <view class="text u-line-2">{{ userInfo.address ||'暂无' }}</view>
  50. </view>
  51. </view>
  52. <navigator class="right" :url="'/cloud/businessCard/share?id='+userid">
  53. <image class="code" src="/static/workbench/二维码.svg" />
  54. <text>名片码</text>
  55. </navigator>
  56. </view>
  57. </view>
  58. </view>
  59. <view class="card-handle">
  60. <view class="top">
  61. <view class="left">
  62. <view class="avatar">
  63. <block v-for="item in userInfo.readusers">
  64. <image :src="item.headpic||'https://yossys06593.obs.cn-east-3.myhuaweicloud.com:443/202404231713854678447B26b4363.svg'" v-if="item.rowindex<4" :key="item.rowindex"/>
  65. </block>
  66. <text style="color:#BBBBBB">...</text>
  67. </view>
  68. <view class="readcount">浏览了{{ userInfo.count_read }}</view>
  69. </view>
  70. <navigator url="#" class="right" @click="goodClick">
  71. <i :class="['iconfont',userInfo.islike==1?' icon-yidianzan':' icon-weidianzan']" :style="{color:userInfo.islike?'#C30D23':'#666666'}"></i>
  72. <text>点赞{{ userInfo.count_like}}</text>
  73. </navigator>
  74. </view>
  75. <view class="bottom">
  76. <view class="but" hover-class="navigator-hover" @click="copy">
  77. <i class="iconfont icon-fuzhi" style="color: #C30D23;"></i>
  78. 复制电话
  79. </view>
  80. <view class="but" hover-class="navigator-hover" @click="shareClick">
  81. <i class="iconfont icon-zhuanfa"></i>
  82. 转发名片
  83. </view>
  84. </view>
  85. </view>
  86. <view class="user-info">
  87. <text class="title-max">简介</text>
  88. <view class="tag-box">
  89. <text class="title-min">印象标签</text>
  90. <view class="tag-list" v-if="userInfo.tag.length">
  91. <view class="tag" v-for="(item,index) in userInfo.tag" :key="index">{{ item }}</view>
  92. </view>
  93. <text v-else style="font-weight: 500;font-size: 14px;color: #666666;">暂无</text>
  94. </view>
  95. <view class="descript-box">
  96. <text class="title-min">自我介绍</text>
  97. <text class="descript">{{ userInfo.remarks || '暂无' }}</text>
  98. </view>
  99. <view class="image-box">
  100. <text class="title-min">照片墙</text>
  101. <block v-if="userInfo.images.length">
  102. <view class="image" v-for="item in userInfo.images" :key="item.attachmentid" @click="preview(item.url)">
  103. <u--image width="100%" :lazy-load="true" :src="item.url" radius="5"></u--image>
  104. </view>
  105. </block>
  106. <text v-else style="font-weight: 500;font-size: 14px;color: #666666;">暂无</text>
  107. </view>
  108. </view>
  109. <view class="footer">
  110. <navigator class="but" :url="'/cloud/businessCard/edit?id='+userid" @click="goEditPage">
  111. <text>修改名片</text>
  112. </navigator>
  113. </view>
  114. <u-popup :show="shareShow" mode="bottom" @close="shareShow=false">
  115. <view class="share-box">
  116. <contact openType="share">
  117. <view class="item" hover-class="navigator-hover" @click="shareWx">
  118. <image mode="widthFix" src="/static/workbench/微信好友.svg" />
  119. <text>微信好友</text>
  120. </view>
  121. </contact>
  122. <navigator class="item" :url="'/cloud/businessCard/share?id='+userid">
  123. <image mode="widthFix" src="/static/workbench/名片海报.svg" />
  124. <text>名片海报</text>
  125. </navigator>
  126. </view>
  127. </u-popup>
  128. </view>
  129. </template>
  130. <script>
  131. import contact from "../../components/contact"
  132. import { viewImage } from "../../utils/settleFiles.js"
  133. export default {
  134. components:{contact},
  135. data () {
  136. return {
  137. userInfo:{tag:[],images:[]},
  138. userid:uni.getStorageSync('userMsg').userid,
  139. shareShow:false
  140. }
  141. },
  142. computed: {
  143. },
  144. methods: {
  145. preview (url) {
  146. viewImage(url)
  147. },
  148. goEditPage () {
  149. this.$Http.editUser = function (id){
  150. this.getuserInfo (id)
  151. delete this.$Http.editUser
  152. }.bind(this)
  153. },
  154. async getuserInfo (id) {
  155. let res = await this.$Http.basic({
  156. "id": 20240514161502,
  157. "content": {
  158. userid:id
  159. },
  160. })
  161. this.userInfo = res.data
  162. this.userInfo.headpic = this.userInfo.attinfos.find(v => v.usetype == "headportrait") && this.userInfo.attinfos.find(v => v.usetype == "headportrait").url || '';
  163. this.userInfo.images = this.userInfo.attinfos.filter(v => v.usetype != "headportrait")
  164. console.log(this.userInfo,'用户信息');
  165. },
  166. shareClick () {
  167. this.shareShow = true
  168. },
  169. onBack() {
  170. uni.navigateBack()
  171. },
  172. async goodClick () {
  173. let res = await this.$Http.basic({
  174. "id": 20240416133702,
  175. "content": {
  176. "ownertable": "sys_users",
  177. "ownerid": this.userid,
  178. "type":2//1:收藏,2:点赞
  179. },
  180. })
  181. if (this.cutoff(res.msg)) return;
  182. this.getuserInfo(this.userid)
  183. },
  184. copy() {
  185. uni.setClipboardData({
  186. data:this.userInfo.phonenumber,
  187. success: (result) => {
  188. uni.showToast({
  189. title: "已复制",
  190. icon: "none",
  191. duration: 1500,
  192. })
  193. }
  194. });
  195. }
  196. },
  197. onShareAppMessage(res) {
  198. return {
  199. title: this.userInfo.name, // 标题
  200. path: "/cloud/businessCard/index?id=" + this.userid, // 分享路径
  201. imageUrl: ""// 分享图
  202. };
  203. },
  204. onLoad(options) {
  205. console.log("被邀请加入团队", options)
  206. const systemInitIsComplete = this.$Http.systemInitIsComplete;
  207. if (!systemInitIsComplete || typeof systemInitIsComplete == 'object') {
  208. this.$Http.HomePageStartRendering = render(this)
  209. } else {
  210. render(this)
  211. }
  212. function render(that) {
  213. if (options.q) {
  214. let params = that.getUrlParams(options.q);
  215. user.wechatBindUserid = params.wechatBindUserid;
  216. that.userid = params.wechatBindUserid
  217. }
  218. that.getuserInfo(that.userid)
  219. }
  220. },
  221. }
  222. </script>
  223. <style lang="scss">
  224. .self-card {
  225. .head {
  226. position: relative;
  227. width: 100vw;
  228. .bg-bottom {
  229. position: absolute;
  230. bottom: 0px;
  231. left: 0;
  232. width: 100vw;
  233. }
  234. .custom {
  235. position: absolute;
  236. width: 100vw;
  237. display: flex;
  238. justify-content: center;
  239. align-items: center;
  240. font-family: PingFang SC, PingFang SC;
  241. font-weight: 500;
  242. font-size: 17px;
  243. color: #FFFFFF;
  244. .back {
  245. position: absolute;
  246. padding: 0 10px;
  247. left: 0;
  248. color: #fff;
  249. font-size: 12px;
  250. transform: rotateY(180deg);
  251. }
  252. }
  253. .card {
  254. width: 355px;
  255. height: 220px;
  256. box-sizing: border-box;
  257. background: #FFFFFF;
  258. box-shadow: 0px 2px 10px 1px rgba(0,0,0,0.16);
  259. border-radius: 8px 8px 8px 8px;
  260. position: absolute;
  261. top: var(--height);
  262. left: 10px;
  263. padding: 20px;
  264. font-family: Source Han Sans SC, Source Han Sans SC;
  265. .header {
  266. display: flex;
  267. justify-content: space-between;
  268. align-content: center;
  269. align-items: center;
  270. .left {
  271. display: flex;
  272. flex-direction: column;
  273. justify-content: space-between;
  274. .title {
  275. display: flex;
  276. align-items: center;
  277. text {
  278. &:first-child {
  279. font-weight: 500;
  280. font-size: 18px;
  281. color: #333333;
  282. }
  283. &:last-child {
  284. font-weight: 400;
  285. font-size: 12px;
  286. color: #999999;
  287. margin-left: 10px;
  288. }
  289. }
  290. margin-bottom: 5px;
  291. }
  292. .phone {
  293. font-weight: 500;
  294. font-size: 16px;
  295. color: #333333;
  296. }
  297. .redline {
  298. width: 24px;
  299. height: 2px;
  300. background: #C30D23;
  301. margin-top: 15px;
  302. }
  303. }
  304. .right {
  305. width: 56px;
  306. height: 56px;
  307. background: #DCEBF8;
  308. box-shadow: 0px 3px 6px 1px #E0D6D7;
  309. border: 2px solid #FFFFFF;
  310. border-radius: 50%;
  311. image {
  312. width: 100%;
  313. height: 100%;
  314. border-radius: 50%;
  315. }
  316. }
  317. }
  318. .bottom {
  319. display: flex;
  320. justify-content: space-between;
  321. font-family: Source Han Sans SC, Source Han Sans SC;
  322. font-weight: 400;
  323. font-size: 12px;
  324. color: #666666;
  325. margin-top: 22px;
  326. .left {
  327. display: flex;
  328. flex-direction: column;
  329. >view {
  330. margin-bottom: 13px;
  331. display: flex;
  332. align-content: center;
  333. align-items: center;
  334. i {
  335. font-size: 16px;
  336. }
  337. .text {
  338. margin-left: 10px;
  339. max-width: 211px;
  340. }
  341. }
  342. }
  343. .right {
  344. display: flex;
  345. flex-direction: column;
  346. align-items: center;
  347. align-content: center;
  348. text {
  349. font-weight: 400;
  350. font-size: 12px;
  351. color: #666666;
  352. }
  353. .code {
  354. width: 32px;
  355. height: 32px;
  356. margin-bottom: 4px;
  357. }
  358. }
  359. }
  360. }
  361. }
  362. .card-handle {
  363. padding: 50px 10px 20px 10px;
  364. background: #ffffff;
  365. margin-top: 15px;
  366. .top {
  367. display: flex;
  368. justify-content: space-between;
  369. align-items: center;
  370. align-content: center;
  371. font-family: Source Han Sans SC, Source Han Sans SC;
  372. font-size: 12px;
  373. color: #999999;
  374. .left {
  375. display: flex;
  376. flex-direction: column;
  377. .avatar {
  378. display: flex;
  379. align-items:flex-start;
  380. align-content: center;
  381. image {
  382. margin-right: 5px;
  383. width: 24px;
  384. height: 24px;
  385. }
  386. text {
  387. transform: scale(1.5);
  388. }
  389. }
  390. .readcount{
  391. margin-top: 5px;
  392. display: block;
  393. }
  394. }
  395. .right {
  396. display: flex;
  397. flex-direction: column;
  398. align-content: center;
  399. align-items: center;
  400. i {
  401. display: block;
  402. color: #666666;
  403. }
  404. text {
  405. margin-top: 5px;
  406. display: block;
  407. }
  408. }
  409. }
  410. .bottom {
  411. display: flex;
  412. justify-content: space-between;
  413. align-items: center;
  414. align-content: center;
  415. margin-top: 25px;
  416. .but {
  417. display: flex;
  418. align-items: center;
  419. justify-content: center;
  420. box-sizing: border-box;
  421. border-radius: 8px 8px 8px 8px;
  422. font-family: Source Han Sans SC, Source Han Sans SC;
  423. font-weight: 400;
  424. font-size: 16px;
  425. width: 173px;
  426. height: 50px;
  427. line-height: 50px;
  428. text-align: center;
  429. &:nth-child(1) {
  430. background: #FFFFFF;
  431. border: 1px solid #CCCCCC;
  432. color: #666666;
  433. }
  434. &:nth-child(2) {
  435. background: #C30D23;
  436. color: #FFFFFF;
  437. }
  438. view {
  439. margin-right: 10px;
  440. }
  441. }
  442. }
  443. }
  444. .user-info {
  445. padding: 12px 10px 70px 10px;
  446. font-family: PingFang SC, PingFang SC;
  447. background: #ffffff;
  448. margin-top: 10px;
  449. .title-min{
  450. margin-bottom: 10px;
  451. font-weight: 500;
  452. font-size: 14px;
  453. color: #666666;
  454. display: block;
  455. }
  456. .title-max {
  457. margin-bottom: 21px;
  458. font-weight: 500;
  459. font-size: 16px;
  460. color: #333333;
  461. display: block;
  462. }
  463. .tag-box {
  464. display: flex;
  465. flex-direction: column;
  466. margin-bottom: 20px;
  467. .title-min{}
  468. .tag-list{
  469. display: flex;
  470. align-content: center;
  471. align-items: center;
  472. flex-wrap: wrap;
  473. .tag {
  474. margin-right: 10px;
  475. padding: 6px 10px;
  476. background: #F2F2F2;
  477. border-radius: 5px 5px 5px 5px;
  478. margin-right: 10px;
  479. font-weight: 400;
  480. font-size: 14px;
  481. color: #333333;
  482. &:last-child {
  483. margin-right: 0;
  484. }
  485. }
  486. }
  487. }
  488. .descript-box {
  489. margin-bottom: 20px;
  490. display: flex;
  491. flex-direction: column;
  492. .descript {
  493. font-weight: 400;
  494. font-size: 14px;
  495. color: #666666;
  496. }
  497. }
  498. .image-box {
  499. display: flex;
  500. flex-direction: column;
  501. .image {
  502. width: 100%;
  503. height: 240px;
  504. margin-bottom: 10px;
  505. }
  506. }
  507. }
  508. .footer {
  509. display: flex;
  510. position: fixed;
  511. bottom: 0;
  512. left: 0;
  513. width: 375px;
  514. height: 64px;
  515. background: #FFFFFF;
  516. box-shadow: 0px -2px 6px 1px rgba(0, 0, 0, 0.16);
  517. box-sizing: border-box;
  518. z-index: 9;
  519. padding: 5px 10px;
  520. .custom {
  521. position: absolute;
  522. width: 100vw;
  523. display: flex;
  524. justify-content: center;
  525. align-items: center;
  526. font-family: PingFang SC, PingFang SC;
  527. font-weight: 500;
  528. font-size: 17px;
  529. color: #FFFFFF;
  530. .back {
  531. position: absolute;
  532. padding: 0 10px;
  533. left: 0;
  534. color: #fff;
  535. font-size: 12px;
  536. transform: rotateY(180deg);
  537. }
  538. }
  539. .but {
  540. width: 355px;
  541. height: 45px;
  542. font-family: PingFang SC, PingFang SC;
  543. font-weight: 500;
  544. font-size: 14px;
  545. color: #FFFFFF;
  546. background: #C30D23;
  547. border-radius: 5px 5px 5px 5px;
  548. border: 1px solid #FFFFFF;
  549. display: flex;
  550. align-items: center;
  551. align-content: center;
  552. justify-content: space-evenly;
  553. }
  554. }
  555. }
  556. .share-box {
  557. padding: 30px 0;
  558. display: flex;
  559. align-items: center;
  560. align-content: center;
  561. justify-content: space-evenly;
  562. .item {
  563. display: flex;
  564. flex-direction: column;
  565. align-items:center;
  566. align-content:center;
  567. image {
  568. width:50px;
  569. height:50px;
  570. }
  571. text {
  572. margin-top: 5px;
  573. font-family: Source Han Sans SC, Source Han Sans SC;
  574. font-weight: 400;
  575. font-size: 12px;
  576. color: #333333;
  577. }
  578. }
  579. }
  580. </style>