index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  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. <view class="item" hover-class="navigator-hover" @click="goCard">
  86. <image mode="widthFix" src="/static/workbench/名片海报.svg" />
  87. <text>名片海报</text>
  88. </view>
  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 () {
  106. let res = await this.$Http.basic({
  107. "id": 20240514161502,
  108. "content": {
  109. userid:this.userid
  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. goCard () {
  148. },
  149. getSheraDate() {
  150. }
  151. },
  152. onShareAppMessage(res) {
  153. return {
  154. title: this.userInfo.name, // 标题
  155. path: "/cloud/businessCard/index?id=" + this.userid, // 分享路径
  156. imageUrl: ""// 分享图
  157. };
  158. },
  159. onLoad(options) {
  160. console.log("被邀请加入团队", options)
  161. this.sys_enterpriseid = options.userid;
  162. const systemInitIsComplete = this.$Http.systemInitIsComplete;
  163. if (!systemInitIsComplete || typeof systemInitIsComplete == 'object') {
  164. this.$Http.HomePageStartRendering = render(this)
  165. } else {
  166. render(this)
  167. }
  168. function render(that) {
  169. that.getuserInfo()
  170. }
  171. },
  172. }
  173. </script>
  174. <style lang="scss">
  175. .self-card {
  176. .head {
  177. position: relative;
  178. width: 100vw;
  179. .bg-bottom {
  180. position: absolute;
  181. bottom: 0px;
  182. left: 0;
  183. width: 100vw;
  184. }
  185. .custom {
  186. position: absolute;
  187. width: 100vw;
  188. display: flex;
  189. justify-content: center;
  190. align-items: center;
  191. font-family: PingFang SC, PingFang SC;
  192. font-weight: 500;
  193. font-size: 17px;
  194. color: #FFFFFF;
  195. .back {
  196. position: absolute;
  197. padding: 0 10px;
  198. left: 0;
  199. color: #fff;
  200. font-size: 12px;
  201. transform: rotateY(180deg);
  202. }
  203. }
  204. .card {
  205. width: 355px;
  206. height: 220px;
  207. box-sizing: border-box;
  208. background: #FFFFFF;
  209. box-shadow: 0px 2px 10px 1px rgba(0,0,0,0.16);
  210. border-radius: 8px 8px 8px 8px;
  211. position: absolute;
  212. top: var(--height);
  213. left: 10px;
  214. padding: 20px;
  215. font-family: Source Han Sans SC, Source Han Sans SC;
  216. .header {
  217. display: flex;
  218. justify-content: space-between;
  219. align-content: center;
  220. align-items: center;
  221. .left {
  222. display: flex;
  223. flex-direction: column;
  224. justify-content: space-between;
  225. .title {
  226. display: flex;
  227. align-items: center;
  228. text {
  229. &:first-child {
  230. font-weight: 500;
  231. font-size: 18px;
  232. color: #333333;
  233. }
  234. &:last-child {
  235. font-weight: 400;
  236. font-size: 12px;
  237. color: #999999;
  238. margin-left: 10px;
  239. }
  240. }
  241. margin-bottom: 5px;
  242. }
  243. .phone {
  244. font-weight: 500;
  245. font-size: 16px;
  246. color: #333333;
  247. }
  248. .redline {
  249. width: 24px;
  250. height: 2px;
  251. background: #C30D23;
  252. margin-top: 15px;
  253. }
  254. }
  255. .right {
  256. width: 56px;
  257. height: 56px;
  258. background: #DCEBF8;
  259. box-shadow: 0px 3px 6px 1px #E0D6D7;
  260. border: 2px solid #FFFFFF;
  261. border-radius: 50%;
  262. image {
  263. width: 100%;
  264. height: 100%;
  265. border-radius: 50%;
  266. }
  267. }
  268. }
  269. .bottom {
  270. display: flex;
  271. justify-content: space-between;
  272. font-family: Source Han Sans SC, Source Han Sans SC;
  273. font-weight: 400;
  274. font-size: 12px;
  275. color: #666666;
  276. margin-top: 22px;
  277. .left {
  278. display: flex;
  279. flex-direction: column;
  280. >view {
  281. margin-bottom: 13px;
  282. display: flex;
  283. align-content: center;
  284. align-items: center;
  285. .text {
  286. margin-left: 10px;
  287. max-width: 211px;
  288. }
  289. }
  290. }
  291. .right {
  292. display: flex;
  293. flex-direction: column;
  294. align-items: center;
  295. align-content: center;
  296. text {
  297. font-weight: 400;
  298. font-size: 12px;
  299. color: #666666;
  300. }
  301. .code {
  302. width: 32px;
  303. height: 32px;
  304. margin-bottom: 4px;
  305. }
  306. }
  307. }
  308. }
  309. }
  310. .card-handle {
  311. padding: 50px 10px 20px 10px;
  312. background: #ffffff;
  313. margin-top: 25px;
  314. .top {
  315. display: flex;
  316. justify-content: space-between;
  317. align-items: center;
  318. align-content: center;
  319. font-family: Source Han Sans SC, Source Han Sans SC;
  320. font-size: 12px;
  321. color: #999999;
  322. .left {
  323. display: flex;
  324. flex-direction: column;
  325. .avatar {
  326. display: flex;
  327. align-items:flex-start;
  328. align-content: center;
  329. image {
  330. margin-right: 5px;
  331. width: 24px;
  332. height: 24px;
  333. }
  334. text {
  335. transform: scale(1.5);
  336. }
  337. }
  338. .readcount{
  339. margin-top: 5px;
  340. display: block;
  341. }
  342. }
  343. .right {
  344. display: flex;
  345. flex-direction: column;
  346. align-content: center;
  347. align-items: center;
  348. i {
  349. display: block;
  350. color: #666666;
  351. }
  352. text {
  353. margin-top: 5px;
  354. display: block;
  355. }
  356. }
  357. }
  358. .bottom {
  359. display: flex;
  360. justify-content: space-between;
  361. align-items: center;
  362. align-content: center;
  363. margin-top: 25px;
  364. .but {
  365. display: flex;
  366. align-items: center;
  367. justify-content: center;
  368. box-sizing: border-box;
  369. border-radius: 8px 8px 8px 8px;
  370. font-family: Source Han Sans SC, Source Han Sans SC;
  371. font-weight: 400;
  372. font-size: 16px;
  373. width: 173px;
  374. height: 50px;
  375. line-height: 50px;
  376. text-align: center;
  377. &:nth-child(1) {
  378. background: #FFFFFF;
  379. border: 1px solid #CCCCCC;
  380. color: #666666;
  381. }
  382. &:nth-child(2) {
  383. background: #C30D23;
  384. color: #FFFFFF;
  385. }
  386. view {
  387. margin-right: 10px;
  388. }
  389. }
  390. }
  391. }
  392. }
  393. .share-box {
  394. padding: 30px 0;
  395. display: flex;
  396. align-items: center;
  397. align-content: center;
  398. justify-content: space-evenly;
  399. .item {
  400. display: flex;
  401. flex-direction: column;
  402. align-items:center;
  403. align-content:center;
  404. image {
  405. width:50px;
  406. height:50px;
  407. }
  408. text {
  409. margin-top: 5px;
  410. font-family: Source Han Sans SC, Source Han Sans SC;
  411. font-weight: 400;
  412. font-size: 12px;
  413. color: #333333;
  414. }
  415. }
  416. }
  417. </style>