index.vue 19 KB

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