groupon.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. "use strict";
  2. const sheep_index = require("../../../../index.js");
  3. const sheep_components_sShareModal_canvasPoster_poster_index = require("./index.js");
  4. const groupon = (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.groupon_bg)),
  9. list: [
  10. {
  11. name: "nickname",
  12. type: "text",
  13. val: userInfo.nickname,
  14. x: width * 0.22,
  15. y: width * 0.06,
  16. paintbrushProps: {
  17. fillStyle: "#333",
  18. font: {
  19. fontSize: 16,
  20. fontFamily: "sans-serif"
  21. }
  22. }
  23. },
  24. {
  25. name: "avatar",
  26. type: "image",
  27. val: sheep_components_sShareModal_canvasPoster_poster_index.formatImageUrlProtocol(sheep_index.sheep.$url.cdn(userInfo.avatar)),
  28. x: width * 0.04,
  29. y: width * 0.04,
  30. width: width * 0.14,
  31. height: width * 0.14,
  32. d: width * 0.14
  33. },
  34. {
  35. name: "goodsImage",
  36. type: "image",
  37. val: sheep_components_sShareModal_canvasPoster_poster_index.formatImageUrlProtocol(poster.shareInfo.poster.image),
  38. x: width * 0.03,
  39. y: width * 0.21,
  40. width: width * 0.94,
  41. height: width * 0.94,
  42. r: 10
  43. },
  44. {
  45. name: "goodsTitle",
  46. type: "text",
  47. val: poster.shareInfo.poster.title,
  48. x: width * 0.04,
  49. y: width * 1.18,
  50. maxWidth: width * 0.91,
  51. line: 2,
  52. lineHeight: 5,
  53. paintbrushProps: {
  54. fillStyle: "#333",
  55. font: {
  56. fontSize: 14
  57. }
  58. }
  59. },
  60. {
  61. name: "goodsPrice",
  62. type: "text",
  63. val: "¥" + poster.shareInfo.poster.price,
  64. x: width * 0.04,
  65. y: width * 1.3,
  66. paintbrushProps: {
  67. fillStyle: "#ff0000",
  68. font: {
  69. fontSize: 20,
  70. fontFamily: "OPPOSANS"
  71. }
  72. }
  73. },
  74. {
  75. name: "grouponNum",
  76. type: "text",
  77. val: "2人团",
  78. x: width * 0.3,
  79. y: width * 1.32,
  80. paintbrushProps: {
  81. fillStyle: "#ff0000",
  82. font: {
  83. fontSize: 10,
  84. fontFamily: "OPPOSANS"
  85. }
  86. }
  87. },
  88. {
  89. name: "wxacode",
  90. type: "image",
  91. val: sheep_index.sheep.$api.third.wechat.getWxacode(poster.shareInfo.path),
  92. x: width * 0.75,
  93. y: width * 1.3,
  94. width: width * 0.2,
  95. height: width * 0.2
  96. }
  97. ]
  98. };
  99. };
  100. exports.groupon = groupon;