index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  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. <u-popup :show="shareShow" mode="bottom" @close="shareShow=false">
  78. <view class="share-box">
  79. <contact openType="share">
  80. <view class="item" hover-class="navigator-hover" @click="shareWx">
  81. <image mode="widthFix" src="/static/workbench/微信好友.svg" />
  82. <text>微信好友</text>
  83. </view>
  84. </contact>
  85. <navigator class="item" :url="'/cloud/businessCard/share?id='+userid">
  86. <image mode="widthFix" src="/static/workbench/名片海报.svg" />
  87. <text>名片海报</text>
  88. </navigator>
  89. </view>
  90. </u-popup>
  91. </view>
  92. </template>
  93. <script>
  94. import contact from "../../components/contact"
  95. export default {
  96. components:{contact},
  97. data () {
  98. return {
  99. userInfo:{},
  100. userid:uni.getStorageSync('userMsg').userid,
  101. shareShow:false
  102. }
  103. },
  104. methods: {
  105. async getuserInfo (id) {
  106. let res = await this.$Http.basic({
  107. "id": 20240514161502,
  108. "content": {
  109. userid:id
  110. },
  111. })
  112. this.userInfo = res.data
  113. console.log(this.userInfo,'用户信息');
  114. },
  115. shareClick () {
  116. this.shareShow = true
  117. },
  118. onBack() {
  119. uni.navigateBack()
  120. },
  121. async goodClick () {
  122. let res = await this.$Http.basic({
  123. "id": 20240416133702,
  124. "content": {
  125. "ownertable": "sys_users",
  126. "ownerid": this.userid,
  127. "type":2//1:收藏,2:点赞
  128. },
  129. })
  130. if (this.cutoff(res.msg)) return;
  131. this.getuserInfo()
  132. },
  133. copy() {
  134. uni.setClipboardData({
  135. data:this.userInfo.phonebumber,
  136. success: (result) => {
  137. uni.showToast({
  138. title: "已复制",
  139. icon: "none",
  140. duration: 1500,
  141. })
  142. }
  143. });
  144. },
  145. shareWx () {
  146. }
  147. },
  148. onShareAppMessage(res) {
  149. return {
  150. title: this.userInfo.name, // 标题
  151. path: "/cloud/businessCard/index?id=" + this.userid, // 分享路径
  152. imageUrl: ""// 分享图
  153. };
  154. },
  155. onLoad(options) {
  156. console.log("被邀请加入团队", options)
  157. const systemInitIsComplete = this.$Http.systemInitIsComplete;
  158. if (!systemInitIsComplete || typeof systemInitIsComplete == 'object') {
  159. this.$Http.HomePageStartRendering = render(this)
  160. } else {
  161. render(this)
  162. }
  163. function render(that) {
  164. if (options.q) {
  165. let params = that.getUrlParams(options.q);
  166. user.wechatBindUserid = params.wechatBindUserid;
  167. that.userid = params.wechatBindUserid
  168. } else {
  169. that.userid = uni.getStorageSync('userMsg').userid
  170. }
  171. that.getuserInfo(that.userid)
  172. }
  173. },
  174. }
  175. </script>
  176. <style lang="scss">
  177. .self-card {
  178. .head {
  179. position: relative;
  180. width: 100vw;
  181. .bg-bottom {
  182. position: absolute;
  183. bottom: 0px;
  184. left: 0;
  185. width: 100vw;
  186. }
  187. .custom {
  188. position: absolute;
  189. width: 100vw;
  190. display: flex;
  191. justify-content: center;
  192. align-items: center;
  193. font-family: PingFang SC, PingFang SC;
  194. font-weight: 500;
  195. font-size: 17px;
  196. color: #FFFFFF;
  197. .back {
  198. position: absolute;
  199. padding: 0 10px;
  200. left: 0;
  201. color: #fff;
  202. font-size: 12px;
  203. transform: rotateY(180deg);
  204. }
  205. }
  206. .card {
  207. width: 355px;
  208. height: 220px;
  209. box-sizing: border-box;
  210. background: #FFFFFF;
  211. box-shadow: 0px 2px 10px 1px rgba(0,0,0,0.16);
  212. border-radius: 8px 8px 8px 8px;
  213. position: absolute;
  214. top: var(--height);
  215. left: 10px;
  216. padding: 20px;
  217. font-family: Source Han Sans SC, Source Han Sans SC;
  218. .header {
  219. display: flex;
  220. justify-content: space-between;
  221. align-content: center;
  222. align-items: center;
  223. .left {
  224. display: flex;
  225. flex-direction: column;
  226. justify-content: space-between;
  227. .title {
  228. display: flex;
  229. align-items: center;
  230. text {
  231. &:first-child {
  232. font-weight: 500;
  233. font-size: 18px;
  234. color: #333333;
  235. }
  236. &:last-child {
  237. font-weight: 400;
  238. font-size: 12px;
  239. color: #999999;
  240. margin-left: 10px;
  241. }
  242. }
  243. margin-bottom: 5px;
  244. }
  245. .phone {
  246. font-weight: 500;
  247. font-size: 16px;
  248. color: #333333;
  249. }
  250. .redline {
  251. width: 24px;
  252. height: 2px;
  253. background: #C30D23;
  254. margin-top: 15px;
  255. }
  256. }
  257. .right {
  258. width: 56px;
  259. height: 56px;
  260. background: #DCEBF8;
  261. box-shadow: 0px 3px 6px 1px #E0D6D7;
  262. border: 2px solid #FFFFFF;
  263. border-radius: 50%;
  264. image {
  265. width: 100%;
  266. height: 100%;
  267. border-radius: 50%;
  268. }
  269. }
  270. }
  271. .bottom {
  272. display: flex;
  273. justify-content: space-between;
  274. font-family: Source Han Sans SC, Source Han Sans SC;
  275. font-weight: 400;
  276. font-size: 12px;
  277. color: #666666;
  278. margin-top: 22px;
  279. .left {
  280. display: flex;
  281. flex-direction: column;
  282. >view {
  283. margin-bottom: 13px;
  284. display: flex;
  285. align-content: center;
  286. align-items: center;
  287. i {
  288. font-size: 16px;
  289. }
  290. .text {
  291. margin-left: 10px;
  292. max-width: 211px;
  293. }
  294. }
  295. }
  296. .right {
  297. display: flex;
  298. flex-direction: column;
  299. align-items: center;
  300. align-content: center;
  301. text {
  302. font-weight: 400;
  303. font-size: 12px;
  304. color: #666666;
  305. }
  306. .code {
  307. width: 32px;
  308. height: 32px;
  309. margin-bottom: 4px;
  310. }
  311. }
  312. }
  313. }
  314. }
  315. .card-handle {
  316. padding: 50px 10px 20px 10px;
  317. background: #ffffff;
  318. margin-top: 25px;
  319. .top {
  320. display: flex;
  321. justify-content: space-between;
  322. align-items: center;
  323. align-content: center;
  324. font-family: Source Han Sans SC, Source Han Sans SC;
  325. font-size: 12px;
  326. color: #999999;
  327. .left {
  328. display: flex;
  329. flex-direction: column;
  330. .avatar {
  331. display: flex;
  332. align-items:flex-start;
  333. align-content: center;
  334. image {
  335. margin-right: 5px;
  336. width: 24px;
  337. height: 24px;
  338. }
  339. text {
  340. transform: scale(1.5);
  341. }
  342. }
  343. .readcount{
  344. margin-top: 5px;
  345. display: block;
  346. }
  347. }
  348. .right {
  349. display: flex;
  350. flex-direction: column;
  351. align-content: center;
  352. align-items: center;
  353. i {
  354. display: block;
  355. color: #666666;
  356. }
  357. text {
  358. margin-top: 5px;
  359. display: block;
  360. }
  361. }
  362. }
  363. .bottom {
  364. display: flex;
  365. justify-content: space-between;
  366. align-items: center;
  367. align-content: center;
  368. margin-top: 25px;
  369. .but {
  370. display: flex;
  371. align-items: center;
  372. justify-content: center;
  373. box-sizing: border-box;
  374. border-radius: 8px 8px 8px 8px;
  375. font-family: Source Han Sans SC, Source Han Sans SC;
  376. font-weight: 400;
  377. font-size: 16px;
  378. width: 173px;
  379. height: 50px;
  380. line-height: 50px;
  381. text-align: center;
  382. &:nth-child(1) {
  383. background: #FFFFFF;
  384. border: 1px solid #CCCCCC;
  385. color: #666666;
  386. }
  387. &:nth-child(2) {
  388. background: #C30D23;
  389. color: #FFFFFF;
  390. }
  391. view {
  392. margin-right: 10px;
  393. }
  394. }
  395. }
  396. }
  397. }
  398. .share-box {
  399. padding: 30px 0;
  400. display: flex;
  401. align-items: center;
  402. align-content: center;
  403. justify-content: space-evenly;
  404. .item {
  405. display: flex;
  406. flex-direction: column;
  407. align-items:center;
  408. align-content:center;
  409. image {
  410. width:50px;
  411. height:50px;
  412. }
  413. text {
  414. margin-top: 5px;
  415. font-family: Source Han Sans SC, Source Han Sans SC;
  416. font-weight: 400;
  417. font-size: 12px;
  418. color: #333333;
  419. }
  420. }
  421. }
  422. </style>