getPosterObj.js 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. export function getDrawImg(url, height = 0) {
  2. return {
  3. obj: [
  4. {
  5. "type": "image",
  6. "url": url, // 确保路径正确
  7. "css": {
  8. "top": "0",
  9. "width": 750 + "rpx",
  10. "height": height + 713 + "rpx",
  11. "display": "block",
  12. "borderRadius": "15rpx 15rpx 0 0"
  13. }
  14. }],
  15. height: height + 713
  16. }
  17. }
  18. export function getCheckInInfo(talk,hotelname ="", roomname="",rscore_value= 0,dateStr='',height = 0) {
  19. let mr=48
  20. return {
  21. obj: [
  22. {
  23. "type": "image",
  24. "url": "../../subpages/images/painter/bg-1.png",
  25. "css": {
  26. "top": height+"rpx",
  27. width: "750rpx",
  28. height: "453rpx",
  29. "borderRadius": "0 0 15rpx 15rpx"
  30. }
  31. },
  32. {
  33. "type": "text",
  34. "text": hotelname || "银弘辰悦酒店",
  35. "css": {
  36. "top":height+48+"rpx",
  37. "left": mr+"rpx",
  38. fontWeight: "800",
  39. fontSize: "43rpx",
  40. color: "#333333",
  41. lineHeight: "47rpx",
  42. textAlign: "center",
  43. fontStyle: "normal",
  44. textTransform: "none"
  45. }
  46. },
  47. {
  48. "type": "image",
  49. "url": "../../subpages/images/painter/icon-2.png", // 确保路径正确
  50. "css": {
  51. "top": height+124+"rpx",
  52. "left": mr+"rpx",
  53. "width": 34 + "rpx",
  54. "height": 34+ "rpx",
  55. "display": "block",
  56. }
  57. },
  58. {
  59. "type": "text",
  60. "text": dateStr,
  61. "css": {
  62. "top":height+119+"rpx",
  63. "left": 100+"rpx",
  64. fontWeight: "500",
  65. fontSize: "31rpx",
  66. color: "#666666",
  67. lineHeight: "43rpx",
  68. textAlign: "center",
  69. fontStyle: "normal",
  70. textTransform: "none"
  71. }
  72. },
  73. {
  74. "type": "image",
  75. "url": "../../subpages/images/painter/icon-1.png", // 确保路径正确
  76. "css": {
  77. "top": height+122+"rpx",
  78. "left": 376+"rpx",
  79. "width": 34 + "rpx",
  80. "height": 34+ "rpx",
  81. "display": "block",
  82. }
  83. },
  84. {
  85. "type": "text",
  86. "text": roomname,
  87. "css": {
  88. "top":height+119+"rpx",
  89. "left": 426+"rpx",
  90. fontWeight: "500",
  91. fontSize: "31rpx",
  92. color: "#666666",
  93. lineHeight: "43rpx",
  94. textAlign: "center",
  95. fontStyle: "normal",
  96. textTransform: "none"
  97. }
  98. },
  99. {
  100. "type": "rect",
  101. "css": {
  102. "top":height+119+"rpx",
  103. "left": 347+"rpx",
  104. width: "2rpx",
  105. height: "35rpx",
  106. color: "#D8D8D8",
  107. // shadow: "20rpx 20rpx 8rpx rgba(219,225,231,0.2)",
  108. // borderRadius: '24rpx',
  109. }
  110. },
  111. {
  112. "type": "text",
  113. "text": rscore_value,
  114. "css": {
  115. "top":height+40+"rpx",
  116. "left": 595+"rpx",
  117. fontWeight: "500",
  118. fontSize: "76rpx",
  119. color: "#333333",
  120. lineHeight: "71rpx",
  121. textAlign: "center",
  122. fontStyle: "normal",
  123. textTransform: "none"
  124. }
  125. },
  126. {
  127. "type": "text",
  128. "text": "分",
  129. "css": {
  130. "top":height+83+"rpx",
  131. "left": 685+"rpx",
  132. fontWeight: "500",
  133. fontSize: "28rpx",
  134. color: "#666666",
  135. lineHeight: "71rpx",
  136. textAlign: "center",
  137. fontStyle: "normal",
  138. textTransform: "none"
  139. }
  140. },
  141. {
  142. "type": "rect",
  143. "css": {
  144. "top":height+195+"rpx",
  145. "left": mr+"rpx",
  146. width: "655rpx",
  147. height: "0rpx",
  148. borderColor: "#CCCCCC",
  149. borderWidth:"2rpx",
  150. borderStyle: "dashed",
  151. }
  152. },
  153. {
  154. "type": "text",
  155. "text": "\u3000\u3000"+ talk,
  156. "css": {
  157. "top":height+231+"rpx",
  158. "left": mr+"rpx",
  159. "width": "457rpx",
  160. "height": "216rpx",
  161. fontWeight: "500",
  162. fontSize: "28rpx",
  163. color: "#666666",
  164. lineHeight: "38rpx",
  165. fontStyle: "normal",
  166. textTransform: "none"
  167. }
  168. },
  169. {
  170. "type": "image",
  171. "url": '../../subpages/images/painter/qr-code.png', // 默认显示“匿名用户”
  172. "css": {
  173. "top": height+230+"rpx",
  174. "left": "530rpx",
  175. "width": "171rpx",
  176. "height": "171rpx",
  177. }
  178. },
  179. ],
  180. height: height + 453
  181. }
  182. }