index.vue 15 KB

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