user.js 1.1 KB

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