user.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. "use strict";
  2. const sheep_index = require("../../../../index.js");
  3. const sheep_components_sShareModal_canvasPoster_poster_index = require("./index.js");
  4. const user = (poster) => {
  5. const width = poster.width;
  6. const userInfo = sheep_index.sheep.$store("user").userInfo;
  7. return {
  8. background: sheep_components_sShareModal_canvasPoster_poster_index.formatImageUrlProtocol(sheep_index.sheep.$url.cdn(sheep_index.sheep.$store("app").platform.share.posterInfo.user_bg)),
  9. list: [
  10. {
  11. name: "nickname",
  12. type: "text",
  13. val: userInfo.nickname,
  14. x: width / 2,
  15. y: width * 0.4,
  16. paintbrushProps: {
  17. textAlign: "center",
  18. fillStyle: "#333",
  19. font: {
  20. fontSize: 14,
  21. fontFamily: "sans-serif"
  22. }
  23. }
  24. },
  25. {
  26. name: "avatar",
  27. type: "image",
  28. val: sheep_components_sShareModal_canvasPoster_poster_index.formatImageUrlProtocol(sheep_index.sheep.$url.cdn(userInfo.avatar)),
  29. x: width * 0.4,
  30. y: width * 0.16,
  31. width: width * 0.2,
  32. height: width * 0.2,
  33. d: width * 0.2
  34. },
  35. {
  36. name: "wxacode",
  37. type: "image",
  38. val: sheep_index.sheep.$api.third.wechat.getWxacode(poster.shareInfo.path),
  39. x: width * 0.35,
  40. y: width * 0.84,
  41. width: width * 0.3,
  42. height: width * 0.3
  43. }
  44. ]
  45. };
  46. };
  47. exports.user = user;