index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  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. },
  146. onShareAppMessage(res) {
  147. return {
  148. title: this.userInfo.name, // 标题
  149. path: "/cloud/businessCard/index?id=" + this.userid, // 分享路径
  150. imageUrl: ""// 分享图
  151. };
  152. },
  153. onLoad(options) {
  154. console.log("被邀请加入团队", options)
  155. const systemInitIsComplete = this.$Http.systemInitIsComplete;
  156. if (!systemInitIsComplete || typeof systemInitIsComplete == 'object') {
  157. this.$Http.HomePageStartRendering = render(this)
  158. } else {
  159. render(this)
  160. }
  161. function render(that) {
  162. if (options.q) {
  163. let params = that.getUrlParams(options.q);
  164. user.wechatBindUserid = params.wechatBindUserid;
  165. that.userid = params.wechatBindUserid
  166. } else {
  167. that.userid = uni.getStorageSync('userMsg').userid
  168. }
  169. that.getuserInfo(that.userid)
  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. i {
  286. font-size: 16px;
  287. }
  288. .text {
  289. margin-left: 10px;
  290. max-width: 211px;
  291. }
  292. }
  293. }
  294. .right {
  295. display: flex;
  296. flex-direction: column;
  297. align-items: center;
  298. align-content: center;
  299. text {
  300. font-weight: 400;
  301. font-size: 12px;
  302. color: #666666;
  303. }
  304. .code {
  305. width: 32px;
  306. height: 32px;
  307. margin-bottom: 4px;
  308. }
  309. }
  310. }
  311. }
  312. }
  313. .card-handle {
  314. padding: 50px 10px 20px 10px;
  315. background: #ffffff;
  316. margin-top: 25px;
  317. .top {
  318. display: flex;
  319. justify-content: space-between;
  320. align-items: center;
  321. align-content: center;
  322. font-family: Source Han Sans SC, Source Han Sans SC;
  323. font-size: 12px;
  324. color: #999999;
  325. .left {
  326. display: flex;
  327. flex-direction: column;
  328. .avatar {
  329. display: flex;
  330. align-items:flex-start;
  331. align-content: center;
  332. image {
  333. margin-right: 5px;
  334. width: 24px;
  335. height: 24px;
  336. }
  337. text {
  338. transform: scale(1.5);
  339. }
  340. }
  341. .readcount{
  342. margin-top: 5px;
  343. display: block;
  344. }
  345. }
  346. .right {
  347. display: flex;
  348. flex-direction: column;
  349. align-content: center;
  350. align-items: center;
  351. i {
  352. display: block;
  353. color: #666666;
  354. }
  355. text {
  356. margin-top: 5px;
  357. display: block;
  358. }
  359. }
  360. }
  361. .bottom {
  362. display: flex;
  363. justify-content: space-between;
  364. align-items: center;
  365. align-content: center;
  366. margin-top: 25px;
  367. .but {
  368. display: flex;
  369. align-items: center;
  370. justify-content: center;
  371. box-sizing: border-box;
  372. border-radius: 8px 8px 8px 8px;
  373. font-family: Source Han Sans SC, Source Han Sans SC;
  374. font-weight: 400;
  375. font-size: 16px;
  376. width: 173px;
  377. height: 50px;
  378. line-height: 50px;
  379. text-align: center;
  380. &:nth-child(1) {
  381. background: #FFFFFF;
  382. border: 1px solid #CCCCCC;
  383. color: #666666;
  384. }
  385. &:nth-child(2) {
  386. background: #C30D23;
  387. color: #FFFFFF;
  388. }
  389. view {
  390. margin-right: 10px;
  391. }
  392. }
  393. }
  394. }
  395. }
  396. .share-box {
  397. padding: 30px 0;
  398. display: flex;
  399. align-items: center;
  400. align-content: center;
  401. justify-content: space-evenly;
  402. .item {
  403. display: flex;
  404. flex-direction: column;
  405. align-items:center;
  406. align-content:center;
  407. image {
  408. width:50px;
  409. height:50px;
  410. }
  411. text {
  412. margin-top: 5px;
  413. font-family: Source Han Sans SC, Source Han Sans SC;
  414. font-weight: 400;
  415. font-size: 12px;
  416. color: #333333;
  417. }
  418. }
  419. }
  420. </style>