index.vue 19 KB

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