user.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import sheep from '@/sheep';
  2. const user = (poster) => {
  3. const width = poster.width;
  4. const userInfo = sheep.$store('user').userInfo;
  5. return {
  6. background: sheep.$url.cdn(sheep.$store('app').platform.share.posterInfo.user_bg),
  7. list: [
  8. {
  9. name: 'nickname',
  10. type: 'text',
  11. val: userInfo.nickname,
  12. x: width / 2,
  13. y: width * 0.4,
  14. paintbrushProps: {
  15. textAlign: 'center',
  16. fillStyle: '#333',
  17. font: {
  18. fontSize: 14,
  19. fontFamily: 'sans-serif',
  20. },
  21. },
  22. },
  23. {
  24. name: 'avatar',
  25. type: 'image',
  26. val: sheep.$url.cdn(userInfo.avatar),
  27. x: width * 0.4,
  28. y: width * 0.16,
  29. width: width * 0.2,
  30. height: width * 0.2,
  31. d: width * 0.2,
  32. },
  33. // #ifndef MP-WEIXIN
  34. {
  35. name: 'qrcode',
  36. type: 'qrcode',
  37. val: poster.shareInfo.link,
  38. x: width * 0.35,
  39. y: width * 0.84,
  40. size: width * 0.3,
  41. },
  42. // #endif
  43. // #ifdef MP-WEIXIN
  44. {
  45. name: 'wxacode',
  46. type: 'image',
  47. val: sheep.$api.third.wechat.getWxacode(poster.shareInfo.path),
  48. x: width * 0.35,
  49. y: width * 0.84,
  50. width: width * 0.3,
  51. height: width * 0.3,
  52. },
  53. // #endif
  54. ],
  55. };
  56. };
  57. export default user;