xiaoe_mp_npm 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (776) hide show
  1. package/.babelrc +10 -10
  2. package/.eslintrc.js +102 -102
  3. package/.gitlab-ci.yml +42 -42
  4. package/.prettierrc.js +8 -8
  5. package/LICENSE +21 -21
  6. package/README.md +134 -134
  7. package/gulpfile.js +26 -26
  8. package/miniprogram_dist/AliveInvite/LiveRoomVertical/components/friends/friends.js +144 -144
  9. package/miniprogram_dist/AliveInvite/LiveRoomVertical/components/friends/friends.json +3 -3
  10. package/miniprogram_dist/AliveInvite/LiveRoomVertical/components/friends/friends.wxml +22 -22
  11. package/miniprogram_dist/AliveInvite/LiveRoomVertical/components/invite-poster/invite-poster.js +227 -227
  12. package/miniprogram_dist/AliveInvite/LiveRoomVertical/components/invite-poster/invite-poster.json +3 -3
  13. package/miniprogram_dist/AliveInvite/LiveRoomVertical/components/invite-poster/invite-poster.wxml +64 -64
  14. package/miniprogram_dist/AliveInvite/LiveRoomVertical/components/rewards/rewards.js +116 -116
  15. package/miniprogram_dist/AliveInvite/LiveRoomVertical/components/rewards/rewards.json +3 -3
  16. package/miniprogram_dist/AliveInvite/LiveRoomVertical/components/rewards/rewards.wxml +35 -35
  17. package/miniprogram_dist/AliveInvite/LiveRoomVertical/components/rules/rules.js +89 -89
  18. package/miniprogram_dist/AliveInvite/LiveRoomVertical/components/rules/rules.json +3 -3
  19. package/miniprogram_dist/AliveInvite/LiveRoomVertical/components/rules/rules.wxml +15 -15
  20. package/miniprogram_dist/AliveInvite/LiveRoomVertical/index.js +232 -232
  21. package/miniprogram_dist/AliveInvite/LiveRoomVertical/index.json +9 -9
  22. package/miniprogram_dist/AliveInvite/LiveRoomVertical/index.less +270 -270
  23. package/miniprogram_dist/AliveInvite/LiveRoomVertical/index.wxml +122 -122
  24. package/miniprogram_dist/AliveInvite/LiveRoomVertical/libs/base64.js +234 -234
  25. package/miniprogram_dist/AliveInvite/images/invite_entrance/new_crown_blue_pure.svg +29 -29
  26. package/miniprogram_dist/AliveInvite/images/invite_entrance/new_crown_pink_pure.svg +29 -29
  27. package/miniprogram_dist/AliveInvite/images/invite_entrance/new_crown_yellow_pure.svg +27 -27
  28. package/miniprogram_dist/AliveInvite/images/new_emptypage.svg +59 -59
  29. package/miniprogram_dist/AliveInvite/images/new_invite_title.svg +23 -23
  30. package/miniprogram_dist/AliveInvite/images/rank_first.svg +11 -11
  31. package/miniprogram_dist/AliveInvite/images/rank_second.svg +11 -11
  32. package/miniprogram_dist/AliveInvite/images/rank_third.svg +11 -11
  33. package/miniprogram_dist/CollectionAddress/index.js +284 -284
  34. package/miniprogram_dist/CollectionAddress/index.json +13 -13
  35. package/miniprogram_dist/CollectionAddress/index.less +4 -4
  36. package/miniprogram_dist/CollectionAddress/index.wxml +91 -91
  37. package/miniprogram_dist/ConfirmOrder/README.md +11 -11
  38. package/miniprogram_dist/ConfirmOrder/components/AddressEdit/index.js +342 -342
  39. package/miniprogram_dist/ConfirmOrder/components/AddressEdit/index.json +10 -10
  40. package/miniprogram_dist/ConfirmOrder/components/AddressEdit/index.less +98 -98
  41. package/miniprogram_dist/ConfirmOrder/components/AddressEdit/index.wxml +38 -38
  42. package/miniprogram_dist/ConfirmOrder/components/AddressManage/index.js +159 -159
  43. package/miniprogram_dist/ConfirmOrder/components/AddressManage/index.json +7 -7
  44. package/miniprogram_dist/ConfirmOrder/components/AddressManage/index.less +95 -95
  45. package/miniprogram_dist/ConfirmOrder/components/AddressManage/index.wxml +36 -36
  46. package/miniprogram_dist/ConfirmOrder/components/AddressSelect/index.js +159 -159
  47. package/miniprogram_dist/ConfirmOrder/components/AddressSelect/index.json +3 -3
  48. package/miniprogram_dist/ConfirmOrder/components/AddressSelect/index.less +79 -79
  49. package/miniprogram_dist/ConfirmOrder/components/AddressSelect/index.wxml +33 -33
  50. package/miniprogram_dist/ConfirmOrder/components/ChoosePicker/index.js +109 -109
  51. package/miniprogram_dist/ConfirmOrder/components/ChoosePicker/index.json +5 -5
  52. package/miniprogram_dist/ConfirmOrder/components/ChoosePicker/index.less +20 -20
  53. package/miniprogram_dist/ConfirmOrder/components/ChoosePicker/index.wxml +9 -9
  54. package/miniprogram_dist/ConfirmOrder/components/ConfirmOrderContent/index.js +819 -819
  55. package/miniprogram_dist/ConfirmOrder/components/ConfirmOrderContent/index.json +22 -22
  56. package/miniprogram_dist/ConfirmOrder/components/ConfirmOrderContent/index.less +11 -11
  57. package/miniprogram_dist/ConfirmOrder/components/ConfirmOrderContent/index.wxml +171 -171
  58. package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/components/entityGiftList/index.js +71 -71
  59. package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/components/entityGiftList/index.json +5 -5
  60. package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/components/entityGiftList/index.less +44 -44
  61. package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/components/entityGiftList/index.wxml +17 -17
  62. package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/components/entityItem/filter.wxs +7 -7
  63. package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/components/entityItem/index.js +91 -91
  64. package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/components/entityItem/index.json +3 -3
  65. package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/components/entityItem/index.less +108 -108
  66. package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/components/entityItem/index.wxml +28 -28
  67. package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/index.js +77 -77
  68. package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/index.json +7 -7
  69. package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/index.less +51 -51
  70. package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/index.wxml +27 -27
  71. package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/components/ImageData/index.js +86 -86
  72. package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/components/ImageData/index.json +3 -3
  73. package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/components/ImageData/index.less +13 -13
  74. package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/components/ImageData/index.wxml +4 -4
  75. package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/filter.wxs +6 -6
  76. package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/index.js +427 -427
  77. package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/index.json +8 -8
  78. package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/index.less +181 -181
  79. package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/index.wxml +74 -74
  80. package/miniprogram_dist/ConfirmOrder/components/Header/index.js +49 -49
  81. package/miniprogram_dist/ConfirmOrder/components/Header/index.json +5 -5
  82. package/miniprogram_dist/ConfirmOrder/components/Header/index.less +30 -30
  83. package/miniprogram_dist/ConfirmOrder/components/Header/index.wxml +9 -9
  84. package/miniprogram_dist/ConfirmOrder/components/InfoCollect/index.js +107 -107
  85. package/miniprogram_dist/ConfirmOrder/components/InfoCollect/index.json +5 -5
  86. package/miniprogram_dist/ConfirmOrder/components/InfoCollect/index.wxml +13 -13
  87. package/miniprogram_dist/ConfirmOrder/components/IntegralSelect/componenets/integralTips/index.js +84 -84
  88. package/miniprogram_dist/ConfirmOrder/components/IntegralSelect/componenets/integralTips/index.json +3 -3
  89. package/miniprogram_dist/ConfirmOrder/components/IntegralSelect/componenets/integralTips/index.less +63 -63
  90. package/miniprogram_dist/ConfirmOrder/components/IntegralSelect/componenets/integralTips/index.wxml +30 -30
  91. package/miniprogram_dist/ConfirmOrder/components/IntegralSelect/filter.wxs +6 -6
  92. package/miniprogram_dist/ConfirmOrder/components/IntegralSelect/index.js +82 -82
  93. package/miniprogram_dist/ConfirmOrder/components/IntegralSelect/index.json +7 -7
  94. package/miniprogram_dist/ConfirmOrder/components/IntegralSelect/index.less +54 -54
  95. package/miniprogram_dist/ConfirmOrder/components/IntegralSelect/index.wxml +26 -26
  96. package/miniprogram_dist/ConfirmOrder/components/Invoice/components/InvoiceSelect/index.js +283 -283
  97. package/miniprogram_dist/ConfirmOrder/components/Invoice/components/InvoiceSelect/index.json +7 -7
  98. package/miniprogram_dist/ConfirmOrder/components/Invoice/components/InvoiceSelect/index.less +161 -161
  99. package/miniprogram_dist/ConfirmOrder/components/Invoice/components/InvoiceSelect/index.wxml +88 -88
  100. package/miniprogram_dist/ConfirmOrder/components/Invoice/components/InvoiceTip/index.js +32 -32
  101. package/miniprogram_dist/ConfirmOrder/components/Invoice/components/InvoiceTip/index.json +5 -5
  102. package/miniprogram_dist/ConfirmOrder/components/Invoice/components/InvoiceTip/index.less +48 -48
  103. package/miniprogram_dist/ConfirmOrder/components/Invoice/components/InvoiceTip/index.wxml +16 -16
  104. package/miniprogram_dist/ConfirmOrder/components/Invoice/index.js +154 -154
  105. package/miniprogram_dist/ConfirmOrder/components/Invoice/index.json +6 -6
  106. package/miniprogram_dist/ConfirmOrder/components/Invoice/index.less +28 -28
  107. package/miniprogram_dist/ConfirmOrder/components/Invoice/index.wxml +24 -24
  108. package/miniprogram_dist/ConfirmOrder/components/LeaveWord/index.js +60 -60
  109. package/miniprogram_dist/ConfirmOrder/components/LeaveWord/index.json +5 -5
  110. package/miniprogram_dist/ConfirmOrder/components/LeaveWord/index.less +5 -5
  111. package/miniprogram_dist/ConfirmOrder/components/LeaveWord/index.wxml +11 -11
  112. package/miniprogram_dist/ConfirmOrder/components/LimitDiscount/index.js +49 -49
  113. package/miniprogram_dist/ConfirmOrder/components/LimitDiscount/index.json +3 -3
  114. package/miniprogram_dist/ConfirmOrder/components/LimitDiscount/index.wxml +1 -1
  115. package/miniprogram_dist/ConfirmOrder/components/ModeSelect/index.js +41 -41
  116. package/miniprogram_dist/ConfirmOrder/components/ModeSelect/index.json +6 -6
  117. package/miniprogram_dist/ConfirmOrder/components/ModeSelect/index.less +34 -34
  118. package/miniprogram_dist/ConfirmOrder/components/ModeSelect/index.wxml +6 -6
  119. package/miniprogram_dist/ConfirmOrder/components/PayBar/index.js +233 -233
  120. package/miniprogram_dist/ConfirmOrder/components/PayBar/index.json +5 -5
  121. package/miniprogram_dist/ConfirmOrder/components/PayBar/index.less +31 -31
  122. package/miniprogram_dist/ConfirmOrder/components/PayBar/index.wxml +25 -25
  123. package/miniprogram_dist/ConfirmOrder/components/PayDetail/filter.wxs +15 -15
  124. package/miniprogram_dist/ConfirmOrder/components/PayDetail/index.js +67 -67
  125. package/miniprogram_dist/ConfirmOrder/components/PayDetail/index.json +3 -3
  126. package/miniprogram_dist/ConfirmOrder/components/PayDetail/index.less +15 -15
  127. package/miniprogram_dist/ConfirmOrder/components/PayDetail/index.wxml +17 -17
  128. package/miniprogram_dist/ConfirmOrder/components/PayGifts/index.js +23 -23
  129. package/miniprogram_dist/ConfirmOrder/components/PayGifts/index.json +3 -3
  130. package/miniprogram_dist/ConfirmOrder/components/PayGifts/index.wxml +2 -2
  131. package/miniprogram_dist/ConfirmOrder/components/PickupSelect/index.js +79 -79
  132. package/miniprogram_dist/ConfirmOrder/components/PickupSelect/index.json +7 -7
  133. package/miniprogram_dist/ConfirmOrder/components/PickupSelect/index.less +8 -8
  134. package/miniprogram_dist/ConfirmOrder/components/PickupSelect/index.wxml +11 -11
  135. package/miniprogram_dist/ConfirmOrder/components/SelectSite/index.js +146 -146
  136. package/miniprogram_dist/ConfirmOrder/components/SelectSite/index.json +6 -6
  137. package/miniprogram_dist/ConfirmOrder/components/SelectSite/index.less +95 -95
  138. package/miniprogram_dist/ConfirmOrder/components/SelectSite/index.wxml +46 -46
  139. package/miniprogram_dist/ConfirmOrder/components/Shipper/index.js +99 -99
  140. package/miniprogram_dist/ConfirmOrder/components/Shipper/index.json +5 -5
  141. package/miniprogram_dist/ConfirmOrder/components/Shipper/index.less +69 -69
  142. package/miniprogram_dist/ConfirmOrder/components/Shipper/index.wxml +15 -15
  143. package/miniprogram_dist/ConfirmOrder/components/ShipperEdit/index.js +217 -217
  144. package/miniprogram_dist/ConfirmOrder/components/ShipperEdit/index.json +7 -7
  145. package/miniprogram_dist/ConfirmOrder/components/ShipperEdit/index.less +76 -76
  146. package/miniprogram_dist/ConfirmOrder/components/ShipperEdit/index.wxml +19 -19
  147. package/miniprogram_dist/ConfirmOrder/components/WechatAddress/index.js +77 -77
  148. package/miniprogram_dist/ConfirmOrder/components/WechatAddress/index.json +3 -3
  149. package/miniprogram_dist/ConfirmOrder/components/WechatAddress/index.less +24 -24
  150. package/miniprogram_dist/ConfirmOrder/components/WechatAddress/index.wxml +8 -8
  151. package/miniprogram_dist/ConfirmOrder/index.js +71 -71
  152. package/miniprogram_dist/ConfirmOrder/index.json +8 -8
  153. package/miniprogram_dist/ConfirmOrder/index.less +4 -4
  154. package/miniprogram_dist/ConfirmOrder/index.wxml +24 -24
  155. package/miniprogram_dist/CouponList/README.md +5 -5
  156. package/miniprogram_dist/CouponList/components/CouponItem/index.js +239 -239
  157. package/miniprogram_dist/CouponList/components/CouponItem/index.json +4 -4
  158. package/miniprogram_dist/CouponList/components/CouponItem/index.less +288 -288
  159. package/miniprogram_dist/CouponList/components/CouponItem/index.wxml +190 -190
  160. package/miniprogram_dist/CouponList/couponColumn/index.js +65 -65
  161. package/miniprogram_dist/CouponList/couponColumn/index.json +5 -5
  162. package/miniprogram_dist/CouponList/couponColumn/index.less +31 -31
  163. package/miniprogram_dist/CouponList/couponColumn/index.wxml +23 -23
  164. package/miniprogram_dist/CouponList/couponMsg/index.js +27 -27
  165. package/miniprogram_dist/CouponList/couponMsg/index.json +5 -5
  166. package/miniprogram_dist/CouponList/couponMsg/index.less +2 -2
  167. package/miniprogram_dist/CouponList/couponMsg/index.wxml +9 -9
  168. package/miniprogram_dist/CurrentPay/index.js +56 -56
  169. package/miniprogram_dist/CurrentPay/index.json +8 -8
  170. package/miniprogram_dist/CurrentPay/index.wxml +11 -11
  171. package/miniprogram_dist/CurrentPayModule/index.js +256 -256
  172. package/miniprogram_dist/CurrentPayModule/index.json +8 -8
  173. package/miniprogram_dist/CurrentPayModule/index.less +12 -12
  174. package/miniprogram_dist/CurrentPayModule/index.wxml +3 -3
  175. package/miniprogram_dist/CustomPopup/index.js +56 -56
  176. package/miniprogram_dist/CustomPopup/index.json +5 -5
  177. package/miniprogram_dist/CustomPopup/index.less +14 -14
  178. package/miniprogram_dist/CustomPopup/index.wxml +18 -18
  179. package/miniprogram_dist/{LiveGoodsList/GoodsItem → GoodsItem}/index.js +554 -527
  180. package/miniprogram_dist/GoodsItem/index.json +6 -0
  181. package/miniprogram_dist/GoodsItem/index.less +249 -0
  182. package/{src/LiveGoodsList → miniprogram_dist}/GoodsItem/index.wxml +90 -79
  183. package/miniprogram_dist/{LiveGoodsList/GoodsItem → GoodsItem}/index.wxss +48 -27
  184. package/miniprogram_dist/LiveGoodsList/Header/index.js +36 -36
  185. package/miniprogram_dist/LiveGoodsList/Header/index.json +6 -6
  186. package/miniprogram_dist/LiveGoodsList/Header/index.less +45 -45
  187. package/miniprogram_dist/LiveGoodsList/Header/index.wxml +28 -28
  188. package/miniprogram_dist/LiveGoodsList/README.md +9 -9
  189. package/miniprogram_dist/LiveGoodsList/index.js +423 -418
  190. package/miniprogram_dist/LiveGoodsList/index.json +10 -10
  191. package/miniprogram_dist/LiveGoodsList/index.less +53 -59
  192. package/miniprogram_dist/LiveGoodsList/index.wxml +73 -74
  193. package/miniprogram_dist/LiveGoodsList/index.wxss +0 -6
  194. package/miniprogram_dist/Lottery/components/AddressCollection/index.js +70 -70
  195. package/miniprogram_dist/Lottery/components/AddressCollection/index.json +6 -6
  196. package/miniprogram_dist/Lottery/components/AddressCollection/index.less +38 -38
  197. package/miniprogram_dist/Lottery/components/AddressCollection/index.wxml +15 -15
  198. package/miniprogram_dist/Lottery/components/LotteryAnimation/lottie-miniprogram-sdk.js +8 -8
  199. package/miniprogram_dist/Lottery/countdown.js +88 -88
  200. package/miniprogram_dist/Lottery/store/effect.js +204 -204
  201. package/miniprogram_dist/PayComplete/Components/CouponItem/index.js +50 -50
  202. package/miniprogram_dist/PayComplete/Components/CouponItem/index.json +3 -3
  203. package/miniprogram_dist/PayComplete/Components/CouponItem/index.less +142 -142
  204. package/miniprogram_dist/PayComplete/Components/CouponItem/index.wxml +46 -46
  205. package/miniprogram_dist/PayComplete/Components/CouponItem/sub.wxs +72 -72
  206. package/miniprogram_dist/PayComplete/Components/LeadGroup/index.js +95 -95
  207. package/miniprogram_dist/PayComplete/Components/LeadGroup/index.json +6 -6
  208. package/miniprogram_dist/PayComplete/Components/LeadGroup/index.less +37 -37
  209. package/miniprogram_dist/PayComplete/Components/LeadGroup/index.wxml +5 -5
  210. package/miniprogram_dist/PayComplete/Components/PayGifts/index.js +129 -129
  211. package/miniprogram_dist/PayComplete/Components/PayGifts/index.json +5 -5
  212. package/miniprogram_dist/PayComplete/Components/PayGifts/index.less +177 -177
  213. package/miniprogram_dist/PayComplete/Components/PayGifts/index.wxml +57 -57
  214. package/miniprogram_dist/PayComplete/Components/PayState/earnIntegral/index.js +62 -62
  215. package/miniprogram_dist/PayComplete/Components/PayState/earnIntegral/index.json +5 -5
  216. package/miniprogram_dist/PayComplete/Components/PayState/earnIntegral/index.less +25 -25
  217. package/miniprogram_dist/PayComplete/Components/PayState/earnIntegral/index.wxml +4 -4
  218. package/miniprogram_dist/PayComplete/Components/PayState/index.js +38 -38
  219. package/miniprogram_dist/PayComplete/Components/PayState/index.json +6 -6
  220. package/miniprogram_dist/PayComplete/Components/PayState/index.less +22 -22
  221. package/miniprogram_dist/PayComplete/Components/PayState/index.wxml +11 -11
  222. package/miniprogram_dist/PayComplete/index.js +142 -142
  223. package/miniprogram_dist/PayComplete/index.json +10 -10
  224. package/miniprogram_dist/PayComplete/index.less +15 -15
  225. package/miniprogram_dist/PayComplete/index.wxml +31 -31
  226. package/miniprogram_dist/PayModule/button/index.js +44 -44
  227. package/miniprogram_dist/PayModule/button/index.json +6 -6
  228. package/miniprogram_dist/PayModule/button/index.less +16 -16
  229. package/miniprogram_dist/PayModule/button/index.wxml +7 -7
  230. package/miniprogram_dist/PayModule/index/index.js +253 -253
  231. package/miniprogram_dist/PayModule/index/index.json +7 -7
  232. package/miniprogram_dist/PayModule/index/index.wxml +12 -12
  233. package/miniprogram_dist/PayModule/wechatLoading/index.js +43 -43
  234. package/miniprogram_dist/PayModule/wechatLoading/index.json +4 -4
  235. package/miniprogram_dist/PayModule/wechatLoading/index.less +66 -66
  236. package/miniprogram_dist/PayModule/wechatLoading/index.wxml +11 -11
  237. package/miniprogram_dist/Recommend/index.js +58 -58
  238. package/miniprogram_dist/Recommend/index.json +3 -3
  239. package/miniprogram_dist/Recommend/index.less +115 -115
  240. package/miniprogram_dist/Recommend/index.wxml +29 -29
  241. package/miniprogram_dist/SharePoster/PosterDom/index.js +1862 -1862
  242. package/miniprogram_dist/SharePoster/PosterDom/index.json +4 -4
  243. package/miniprogram_dist/SharePoster/PosterDom/index.less +56 -56
  244. package/miniprogram_dist/SharePoster/PosterDom/index.wxml +12 -12
  245. package/miniprogram_dist/SharePoster/README.md +9 -9
  246. package/miniprogram_dist/SharePoster/ShareTextPopup/index.js +65 -65
  247. package/miniprogram_dist/SharePoster/ShareTextPopup/index.json +6 -6
  248. package/miniprogram_dist/SharePoster/ShareTextPopup/index.less +74 -74
  249. package/miniprogram_dist/SharePoster/ShareTextPopup/index.wxml +28 -28
  250. package/miniprogram_dist/SharePoster/createPoster/index.js +201 -201
  251. package/miniprogram_dist/SharePoster/createPoster/utils/drawImage.js +267 -267
  252. package/miniprogram_dist/SharePoster/createPoster/utils/util.js +40 -40
  253. package/miniprogram_dist/SharePoster/libs/constant.js +57 -57
  254. package/miniprogram_dist/SharePoster/libs/positionMap.js +255 -255
  255. package/miniprogram_dist/SharePoster/mockData/mockData.js +590 -590
  256. package/miniprogram_dist/SharePoster/sharePopup/index.js +336 -336
  257. package/miniprogram_dist/SharePoster/sharePopup/index.json +8 -8
  258. package/miniprogram_dist/SharePoster/sharePopup/index.less +180 -180
  259. package/miniprogram_dist/SharePoster/sharePopup/index.wxml +85 -85
  260. package/miniprogram_dist/Sku/commSelect/index.js +426 -426
  261. package/miniprogram_dist/Sku/commSelect/index.json +8 -8
  262. package/miniprogram_dist/Sku/commSelect/index.less +48 -48
  263. package/miniprogram_dist/Sku/commSelect/index.wxml +41 -41
  264. package/miniprogram_dist/Sku/goods-info/index.js +52 -52
  265. package/miniprogram_dist/Sku/goods-info/index.json +4 -4
  266. package/miniprogram_dist/Sku/goods-info/index.less +48 -48
  267. package/miniprogram_dist/Sku/goods-info/index.wxml +19 -19
  268. package/miniprogram_dist/Sku/index/index.js +280 -280
  269. package/miniprogram_dist/Sku/index/index.json +12 -12
  270. package/miniprogram_dist/Sku/index/index.less +78 -78
  271. package/miniprogram_dist/Sku/index/index.wxml +58 -58
  272. package/miniprogram_dist/Sku/row-item/index.js +61 -61
  273. package/miniprogram_dist/Sku/row-item/index.json +4 -4
  274. package/miniprogram_dist/Sku/row-item/index.less +48 -48
  275. package/miniprogram_dist/Sku/row-item/index.wxml +10 -10
  276. package/miniprogram_dist/Sku/step/index.js +95 -95
  277. package/miniprogram_dist/Sku/step/index.json +6 -6
  278. package/miniprogram_dist/Sku/step/index.less +11 -11
  279. package/miniprogram_dist/Sku/step/index.wxml +11 -11
  280. package/miniprogram_dist/TeacherGoodsList/Header/index.js +36 -0
  281. package/{src/LiveGoodsList/GoodsItem → miniprogram_dist/TeacherGoodsList/Header}/index.json +6 -6
  282. package/miniprogram_dist/TeacherGoodsList/Header/index.less +47 -0
  283. package/miniprogram_dist/TeacherGoodsList/Header/index.wxml +27 -0
  284. package/miniprogram_dist/TeacherGoodsList/Header/index.wxss +45 -0
  285. package/miniprogram_dist/TeacherGoodsList/README.md +10 -0
  286. package/miniprogram_dist/TeacherGoodsList/index.js +269 -0
  287. package/miniprogram_dist/TeacherGoodsList/index.json +8 -0
  288. package/miniprogram_dist/TeacherGoodsList/index.less +53 -0
  289. package/miniprogram_dist/TeacherGoodsList/index.wxml +49 -0
  290. package/miniprogram_dist/TeacherGoodsList/index.wxss +50 -0
  291. package/miniprogram_dist/common/api/confirmOrder.js +217 -217
  292. package/miniprogram_dist/common/api/coupon.js +19 -19
  293. package/miniprogram_dist/common/api/couponlist.js +105 -105
  294. package/miniprogram_dist/common/api/eLiveInvite.js +45 -45
  295. package/miniprogram_dist/common/api/liveGoodsList.js +51 -51
  296. package/miniprogram_dist/common/api/lottery.js +57 -57
  297. package/miniprogram_dist/common/api/pay.js +42 -42
  298. package/miniprogram_dist/common/api/payComplete.js +21 -21
  299. package/miniprogram_dist/common/api/sharePoster.js +67 -67
  300. package/miniprogram_dist/common/api/sku.js +58 -58
  301. package/miniprogram_dist/common/assets/images/coupon/coupon_style2.svg +29 -29
  302. package/miniprogram_dist/common/assets/images/coupon/coupons_style2.svg +29 -29
  303. package/miniprogram_dist/common/assets/images/coupon/down.svg +21 -21
  304. package/miniprogram_dist/common/assets/images/coupon/emptypage.svg +49 -49
  305. package/miniprogram_dist/common/assets/images/coupon/failed.svg +5 -5
  306. package/miniprogram_dist/common/assets/images/coupon/up.svg +21 -21
  307. package/miniprogram_dist/common/assets/images/lottery/is_not_winner.svg +19 -19
  308. package/miniprogram_dist/common/assets/images/lottery/lottery_v1_back.svg +19 -19
  309. package/miniprogram_dist/common/assets/images/lottery/lottery_v1_close.svg +19 -19
  310. package/miniprogram_dist/common/assets/images/lottery/reward_list_title.svg +19 -19
  311. package/miniprogram_dist/common/assets/images/lottery/white_right_arrow.png +0 -0
  312. package/miniprogram_dist/common/assets/images/lottery/winner_list_smile_icon.svg +56 -56
  313. package/miniprogram_dist/common/assets/images/lottery/winner_list_title.svg +19 -19
  314. package/miniprogram_dist/common/assets/images/pay/loading.svg +3 -3
  315. package/miniprogram_dist/common/assets/images/recommend.svg +6 -6
  316. package/miniprogram_dist/common/assets/images/refresh.svg +10 -10
  317. package/miniprogram_dist/common/assets/images/refresh_white.svg +3 -3
  318. package/miniprogram_dist/common/assets/images/wechat.svg +4 -4
  319. package/miniprogram_dist/common/css/index.less +2 -2
  320. package/miniprogram_dist/common/css/theme.less +19 -19
  321. package/miniprogram_dist/common/libs/dataUp/sensorUp.js +91 -91
  322. package/miniprogram_dist/common/libs/playerHttp.js +58 -58
  323. package/miniprogram_dist/common/libs/playerRequestUrl.js +39 -39
  324. package/miniprogram_dist/common/utils/constants.js +254 -254
  325. package/miniprogram_dist/common/utils/currency.js +52 -52
  326. package/miniprogram_dist/common/utils/helper.js +159 -159
  327. package/miniprogram_dist/common/utils/index.js +56 -56
  328. package/miniprogram_dist/common/utils/postCouponList.js +52 -52
  329. package/miniprogram_dist/common/utils/tool.js +65 -65
  330. package/miniprogram_dist/common/wxs/filter.wxs +29 -29
  331. package/miniprogram_dist/coupon/README.md +11 -11
  332. package/miniprogram_dist/coupon/components/CouponItem/index.js +175 -175
  333. package/miniprogram_dist/coupon/components/CouponItem/index.json +5 -5
  334. package/miniprogram_dist/coupon/components/CouponItem/index.less +207 -207
  335. package/miniprogram_dist/coupon/components/CouponItem/index.wxml +99 -99
  336. package/miniprogram_dist/coupon/components/CouponSelect/index.js +323 -323
  337. package/miniprogram_dist/coupon/components/CouponSelect/index.json +8 -8
  338. package/miniprogram_dist/coupon/components/CouponSelect/index.less +237 -237
  339. package/miniprogram_dist/coupon/components/CouponSelect/index.wxml +74 -74
  340. package/miniprogram_dist/coupon/index.css +50 -50
  341. package/miniprogram_dist/coupon/index.js +205 -205
  342. package/miniprogram_dist/coupon/index.json +7 -7
  343. package/miniprogram_dist/coupon/index.less +51 -51
  344. package/miniprogram_dist/coupon/index.wxml +24 -24
  345. package/miniprogram_dist/index.js +6 -6
  346. package/miniprogram_dist/index.js.map +1 -1
  347. package/miniprogram_dist/index.json +4 -4
  348. package/miniprogram_dist/index.wxml +2 -2
  349. package/miniprogram_dist/lib.js.map +1 -1
  350. package/package.json +77 -77
  351. package/project.config.json +79 -79
  352. package/src/AliveInvite/LiveRoomVertical/components/friends/friends.js +144 -144
  353. package/src/AliveInvite/LiveRoomVertical/components/friends/friends.json +3 -3
  354. package/src/AliveInvite/LiveRoomVertical/components/friends/friends.wxml +22 -22
  355. package/src/AliveInvite/LiveRoomVertical/components/friends/friends.wxss +90 -90
  356. package/src/AliveInvite/LiveRoomVertical/components/invite-poster/invite-poster.js +227 -227
  357. package/src/AliveInvite/LiveRoomVertical/components/invite-poster/invite-poster.json +3 -3
  358. package/src/AliveInvite/LiveRoomVertical/components/invite-poster/invite-poster.wxml +64 -64
  359. package/src/AliveInvite/LiveRoomVertical/components/invite-poster/invite-poster.wxss +167 -167
  360. package/src/AliveInvite/LiveRoomVertical/components/rewards/rewards.js +116 -116
  361. package/src/AliveInvite/LiveRoomVertical/components/rewards/rewards.json +3 -3
  362. package/src/AliveInvite/LiveRoomVertical/components/rewards/rewards.wxml +35 -35
  363. package/src/AliveInvite/LiveRoomVertical/components/rewards/rewards.wxss +92 -92
  364. package/src/AliveInvite/LiveRoomVertical/components/rules/rules.js +89 -89
  365. package/src/AliveInvite/LiveRoomVertical/components/rules/rules.json +3 -3
  366. package/src/AliveInvite/LiveRoomVertical/components/rules/rules.wxml +15 -15
  367. package/src/AliveInvite/LiveRoomVertical/components/rules/rules.wxss +48 -48
  368. package/src/AliveInvite/LiveRoomVertical/index.js +232 -232
  369. package/src/AliveInvite/LiveRoomVertical/index.json +9 -9
  370. package/src/AliveInvite/LiveRoomVertical/index.less +270 -270
  371. package/src/AliveInvite/LiveRoomVertical/index.wxml +122 -122
  372. package/src/AliveInvite/LiveRoomVertical/index.wxss +267 -267
  373. package/src/AliveInvite/LiveRoomVertical/libs/base64.js +234 -234
  374. package/src/AliveInvite/images/invite_entrance/new_crown_blue_pure.svg +29 -29
  375. package/src/AliveInvite/images/invite_entrance/new_crown_pink_pure.svg +29 -29
  376. package/src/AliveInvite/images/invite_entrance/new_crown_yellow_pure.svg +27 -27
  377. package/src/AliveInvite/images/new_emptypage.svg +59 -59
  378. package/src/AliveInvite/images/new_invite_title.svg +23 -23
  379. package/src/AliveInvite/images/rank_first.svg +11 -11
  380. package/src/AliveInvite/images/rank_second.svg +11 -11
  381. package/src/AliveInvite/images/rank_third.svg +11 -11
  382. package/src/CollectionAddress/index.js +284 -284
  383. package/src/CollectionAddress/index.json +13 -13
  384. package/src/CollectionAddress/index.less +4 -4
  385. package/src/CollectionAddress/index.wxml +91 -91
  386. package/src/CollectionAddress/index.wxss +5 -5
  387. package/src/ConfirmOrder/README.md +11 -11
  388. package/src/ConfirmOrder/components/AddressEdit/index.js +342 -342
  389. package/src/ConfirmOrder/components/AddressEdit/index.json +10 -10
  390. package/src/ConfirmOrder/components/AddressEdit/index.less +98 -98
  391. package/src/ConfirmOrder/components/AddressEdit/index.wxml +38 -38
  392. package/src/ConfirmOrder/components/AddressEdit/index.wxss +99 -99
  393. package/src/ConfirmOrder/components/AddressManage/index.js +159 -159
  394. package/src/ConfirmOrder/components/AddressManage/index.json +7 -7
  395. package/src/ConfirmOrder/components/AddressManage/index.less +95 -95
  396. package/src/ConfirmOrder/components/AddressManage/index.wxml +36 -36
  397. package/src/ConfirmOrder/components/AddressManage/index.wxss +98 -98
  398. package/src/ConfirmOrder/components/AddressSelect/index.js +159 -159
  399. package/src/ConfirmOrder/components/AddressSelect/index.json +3 -3
  400. package/src/ConfirmOrder/components/AddressSelect/index.less +79 -79
  401. package/src/ConfirmOrder/components/AddressSelect/index.wxml +33 -33
  402. package/src/ConfirmOrder/components/AddressSelect/index.wxss +67 -67
  403. package/src/ConfirmOrder/components/ChoosePicker/index.js +109 -109
  404. package/src/ConfirmOrder/components/ChoosePicker/index.json +5 -5
  405. package/src/ConfirmOrder/components/ChoosePicker/index.less +20 -20
  406. package/src/ConfirmOrder/components/ChoosePicker/index.wxml +9 -9
  407. package/src/ConfirmOrder/components/ChoosePicker/index.wxss +18 -18
  408. package/src/ConfirmOrder/components/ConfirmOrderContent/index.js +819 -819
  409. package/src/ConfirmOrder/components/ConfirmOrderContent/index.json +22 -22
  410. package/src/ConfirmOrder/components/ConfirmOrderContent/index.less +11 -11
  411. package/src/ConfirmOrder/components/ConfirmOrderContent/index.wxml +171 -171
  412. package/src/ConfirmOrder/components/ConfirmOrderContent/index.wxss +10 -10
  413. package/src/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/components/entityGiftList/index.js +71 -71
  414. package/src/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/components/entityGiftList/index.json +5 -5
  415. package/src/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/components/entityGiftList/index.less +44 -44
  416. package/src/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/components/entityGiftList/index.wxml +17 -17
  417. package/src/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/components/entityGiftList/index.wxss +39 -39
  418. package/src/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/components/entityItem/filter.wxs +7 -7
  419. package/src/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/components/entityItem/index.js +91 -91
  420. package/src/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/components/entityItem/index.json +3 -3
  421. package/src/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/components/entityItem/index.less +108 -108
  422. package/src/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/components/entityItem/index.wxml +28 -28
  423. package/src/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/components/entityItem/index.wxss +96 -96
  424. package/src/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/index.js +77 -77
  425. package/src/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/index.json +7 -7
  426. package/src/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/index.less +51 -51
  427. package/src/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/index.wxml +27 -27
  428. package/src/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/index.wxss +45 -45
  429. package/src/ConfirmOrder/components/GoodsInfo/components/ImageData/index.js +86 -86
  430. package/src/ConfirmOrder/components/GoodsInfo/components/ImageData/index.json +3 -3
  431. package/src/ConfirmOrder/components/GoodsInfo/components/ImageData/index.less +13 -13
  432. package/src/ConfirmOrder/components/GoodsInfo/components/ImageData/index.wxml +4 -4
  433. package/src/ConfirmOrder/components/GoodsInfo/components/ImageData/index.wxss +13 -13
  434. package/src/ConfirmOrder/components/GoodsInfo/filter.wxs +6 -6
  435. package/src/ConfirmOrder/components/GoodsInfo/index.js +427 -427
  436. package/src/ConfirmOrder/components/GoodsInfo/index.json +8 -8
  437. package/src/ConfirmOrder/components/GoodsInfo/index.less +181 -181
  438. package/src/ConfirmOrder/components/GoodsInfo/index.wxml +74 -74
  439. package/src/ConfirmOrder/components/GoodsInfo/index.wxss +153 -153
  440. package/src/ConfirmOrder/components/Header/index.js +49 -49
  441. package/src/ConfirmOrder/components/Header/index.json +5 -5
  442. package/src/ConfirmOrder/components/Header/index.less +30 -30
  443. package/src/ConfirmOrder/components/Header/index.wxml +9 -9
  444. package/src/ConfirmOrder/components/Header/index.wxss +27 -27
  445. package/src/ConfirmOrder/components/InfoCollect/index.js +107 -107
  446. package/src/ConfirmOrder/components/InfoCollect/index.json +5 -5
  447. package/src/ConfirmOrder/components/InfoCollect/index.wxml +13 -13
  448. package/src/ConfirmOrder/components/IntegralSelect/componenets/integralTips/index.js +84 -84
  449. package/src/ConfirmOrder/components/IntegralSelect/componenets/integralTips/index.json +3 -3
  450. package/src/ConfirmOrder/components/IntegralSelect/componenets/integralTips/index.less +63 -63
  451. package/src/ConfirmOrder/components/IntegralSelect/componenets/integralTips/index.wxml +30 -30
  452. package/src/ConfirmOrder/components/IntegralSelect/componenets/integralTips/index.wxss +57 -57
  453. package/src/ConfirmOrder/components/IntegralSelect/filter.wxs +6 -6
  454. package/src/ConfirmOrder/components/IntegralSelect/index.js +82 -82
  455. package/src/ConfirmOrder/components/IntegralSelect/index.json +7 -7
  456. package/src/ConfirmOrder/components/IntegralSelect/index.less +54 -54
  457. package/src/ConfirmOrder/components/IntegralSelect/index.wxml +26 -26
  458. package/src/ConfirmOrder/components/IntegralSelect/index.wxss +47 -47
  459. package/src/ConfirmOrder/components/Invoice/components/InvoiceSelect/index.js +283 -283
  460. package/src/ConfirmOrder/components/Invoice/components/InvoiceSelect/index.json +7 -7
  461. package/src/ConfirmOrder/components/Invoice/components/InvoiceSelect/index.less +161 -161
  462. package/src/ConfirmOrder/components/Invoice/components/InvoiceSelect/index.wxml +88 -88
  463. package/src/ConfirmOrder/components/Invoice/components/InvoiceSelect/index.wxss +152 -152
  464. package/src/ConfirmOrder/components/Invoice/components/InvoiceTip/index.js +32 -32
  465. package/src/ConfirmOrder/components/Invoice/components/InvoiceTip/index.json +5 -5
  466. package/src/ConfirmOrder/components/Invoice/components/InvoiceTip/index.less +48 -48
  467. package/src/ConfirmOrder/components/Invoice/components/InvoiceTip/index.wxml +16 -16
  468. package/src/ConfirmOrder/components/Invoice/components/InvoiceTip/index.wxss +58 -58
  469. package/src/ConfirmOrder/components/Invoice/index.js +154 -154
  470. package/src/ConfirmOrder/components/Invoice/index.json +6 -6
  471. package/src/ConfirmOrder/components/Invoice/index.less +28 -28
  472. package/src/ConfirmOrder/components/Invoice/index.wxml +24 -24
  473. package/src/ConfirmOrder/components/Invoice/index.wxss +23 -23
  474. package/src/ConfirmOrder/components/LeaveWord/index.js +60 -60
  475. package/src/ConfirmOrder/components/LeaveWord/index.json +5 -5
  476. package/src/ConfirmOrder/components/LeaveWord/index.less +5 -5
  477. package/src/ConfirmOrder/components/LeaveWord/index.wxml +11 -11
  478. package/src/ConfirmOrder/components/LeaveWord/index.wxss +6 -6
  479. package/src/ConfirmOrder/components/LimitDiscount/index.js +49 -49
  480. package/src/ConfirmOrder/components/LimitDiscount/index.json +3 -3
  481. package/src/ConfirmOrder/components/LimitDiscount/index.wxml +1 -1
  482. package/src/ConfirmOrder/components/ModeSelect/index.js +41 -41
  483. package/src/ConfirmOrder/components/ModeSelect/index.json +6 -6
  484. package/src/ConfirmOrder/components/ModeSelect/index.less +34 -34
  485. package/src/ConfirmOrder/components/ModeSelect/index.wxml +6 -6
  486. package/src/ConfirmOrder/components/ModeSelect/index.wxss +44 -44
  487. package/src/ConfirmOrder/components/PayBar/index.js +233 -233
  488. package/src/ConfirmOrder/components/PayBar/index.json +5 -5
  489. package/src/ConfirmOrder/components/PayBar/index.less +31 -31
  490. package/src/ConfirmOrder/components/PayBar/index.wxml +25 -25
  491. package/src/ConfirmOrder/components/PayBar/index.wxss +27 -27
  492. package/src/ConfirmOrder/components/PayDetail/filter.wxs +15 -15
  493. package/src/ConfirmOrder/components/PayDetail/index.js +67 -67
  494. package/src/ConfirmOrder/components/PayDetail/index.json +3 -3
  495. package/src/ConfirmOrder/components/PayDetail/index.less +15 -15
  496. package/src/ConfirmOrder/components/PayDetail/index.wxml +17 -17
  497. package/src/ConfirmOrder/components/PayDetail/index.wxss +14 -14
  498. package/src/ConfirmOrder/components/PayGifts/index.js +23 -23
  499. package/src/ConfirmOrder/components/PayGifts/index.json +3 -3
  500. package/src/ConfirmOrder/components/PayGifts/index.wxml +2 -2
  501. package/src/ConfirmOrder/components/PickupSelect/index.js +79 -79
  502. package/src/ConfirmOrder/components/PickupSelect/index.json +7 -7
  503. package/src/ConfirmOrder/components/PickupSelect/index.less +8 -8
  504. package/src/ConfirmOrder/components/PickupSelect/index.wxml +11 -11
  505. package/src/ConfirmOrder/components/PickupSelect/index.wxss +7 -7
  506. package/src/ConfirmOrder/components/SelectSite/index.js +146 -146
  507. package/src/ConfirmOrder/components/SelectSite/index.json +6 -6
  508. package/src/ConfirmOrder/components/SelectSite/index.less +95 -95
  509. package/src/ConfirmOrder/components/SelectSite/index.wxml +46 -46
  510. package/src/ConfirmOrder/components/SelectSite/index.wxss +82 -82
  511. package/src/ConfirmOrder/components/Shipper/index.js +99 -99
  512. package/src/ConfirmOrder/components/Shipper/index.json +5 -5
  513. package/src/ConfirmOrder/components/Shipper/index.less +69 -69
  514. package/src/ConfirmOrder/components/Shipper/index.wxml +15 -15
  515. package/src/ConfirmOrder/components/Shipper/index.wxss +76 -76
  516. package/src/ConfirmOrder/components/ShipperEdit/index.js +217 -217
  517. package/src/ConfirmOrder/components/ShipperEdit/index.json +7 -7
  518. package/src/ConfirmOrder/components/ShipperEdit/index.less +76 -76
  519. package/src/ConfirmOrder/components/ShipperEdit/index.wxml +19 -19
  520. package/src/ConfirmOrder/components/ShipperEdit/index.wxss +78 -78
  521. package/src/ConfirmOrder/components/WechatAddress/index.js +77 -77
  522. package/src/ConfirmOrder/components/WechatAddress/index.json +3 -3
  523. package/src/ConfirmOrder/components/WechatAddress/index.less +24 -24
  524. package/src/ConfirmOrder/components/WechatAddress/index.wxml +8 -8
  525. package/src/ConfirmOrder/components/WechatAddress/index.wxss +22 -22
  526. package/src/ConfirmOrder/index.js +71 -71
  527. package/src/ConfirmOrder/index.json +8 -8
  528. package/src/ConfirmOrder/index.less +4 -4
  529. package/src/ConfirmOrder/index.wxml +24 -24
  530. package/src/ConfirmOrder/index.wxss +5 -5
  531. package/src/CouponList/README.md +5 -5
  532. package/src/CouponList/components/CouponItem/index.js +239 -239
  533. package/src/CouponList/components/CouponItem/index.json +4 -4
  534. package/src/CouponList/components/CouponItem/index.less +288 -288
  535. package/src/CouponList/components/CouponItem/index.wxml +190 -190
  536. package/src/CouponList/components/CouponItem/index.wxss +276 -276
  537. package/src/CouponList/couponColumn/index.js +65 -65
  538. package/src/CouponList/couponColumn/index.json +5 -5
  539. package/src/CouponList/couponColumn/index.less +31 -31
  540. package/src/CouponList/couponColumn/index.wxml +23 -23
  541. package/src/CouponList/couponColumn/index.wxss +31 -31
  542. package/src/CouponList/couponMsg/index.js +27 -27
  543. package/src/CouponList/couponMsg/index.json +5 -5
  544. package/src/CouponList/couponMsg/index.less +2 -2
  545. package/src/CouponList/couponMsg/index.wxml +9 -9
  546. package/src/CouponList/couponMsg/index.wxss +3 -3
  547. package/src/CurrentPay/index.js +56 -56
  548. package/src/CurrentPay/index.json +8 -8
  549. package/src/CurrentPay/index.wxml +11 -11
  550. package/src/CurrentPayModule/index.js +256 -256
  551. package/src/CurrentPayModule/index.json +8 -8
  552. package/src/CurrentPayModule/index.less +12 -12
  553. package/src/CurrentPayModule/index.wxml +3 -3
  554. package/src/CurrentPayModule/index.wxss +13 -13
  555. package/src/CustomPopup/index.js +56 -56
  556. package/src/CustomPopup/index.json +5 -5
  557. package/src/CustomPopup/index.less +14 -14
  558. package/src/CustomPopup/index.wxml +18 -18
  559. package/src/CustomPopup/index.wxss +15 -15
  560. package/src/{LiveGoodsList/GoodsItem → GoodsItem}/index.js +554 -527
  561. package/src/GoodsItem/index.json +6 -0
  562. package/src/GoodsItem/index.less +249 -0
  563. package/{miniprogram_dist/LiveGoodsList → src}/GoodsItem/index.wxml +90 -79
  564. package/src/{LiveGoodsList/GoodsItem → GoodsItem}/index.wxss +261 -240
  565. package/src/LiveGoodsList/Header/index.js +36 -36
  566. package/src/LiveGoodsList/Header/index.json +6 -6
  567. package/src/LiveGoodsList/Header/index.less +45 -45
  568. package/src/LiveGoodsList/Header/index.wxml +28 -28
  569. package/src/LiveGoodsList/Header/index.wxss +44 -44
  570. package/src/LiveGoodsList/README.md +9 -9
  571. package/src/LiveGoodsList/index.js +423 -418
  572. package/src/LiveGoodsList/index.json +10 -10
  573. package/src/LiveGoodsList/index.less +53 -59
  574. package/src/LiveGoodsList/index.wxml +73 -74
  575. package/src/LiveGoodsList/index.wxss +50 -56
  576. package/src/Lottery/components/AddressCollection/index.js +70 -70
  577. package/src/Lottery/components/AddressCollection/index.json +6 -6
  578. package/src/Lottery/components/AddressCollection/index.less +38 -38
  579. package/src/Lottery/components/AddressCollection/index.wxml +15 -15
  580. package/src/Lottery/components/AddressCollection/index.wxss +39 -39
  581. package/src/Lottery/components/CommonPopup/index.wxss +61 -61
  582. package/src/Lottery/components/JoinRecords/RecordItem/index.wxss +36 -36
  583. package/src/Lottery/components/JoinRecords/index.wxss +40 -40
  584. package/src/Lottery/components/LotteryAnimation/index.wxss +12 -12
  585. package/src/Lottery/components/LotteryAnimation/lottie-miniprogram-sdk.js +8 -8
  586. package/src/Lottery/components/LotteryFAB/index.wxss +36 -36
  587. package/src/Lottery/components/LotteryInfo/Indicator/index.wxss +17 -17
  588. package/src/Lottery/components/LotteryInfo/LotteryCountdown/index.wxss +17 -17
  589. package/src/Lottery/components/LotteryInfo/index.wxss +104 -104
  590. package/src/Lottery/components/LotteryMsg/index.wxss +20 -20
  591. package/src/Lottery/components/LotteryResult/LosingLottery/index.wxss +44 -44
  592. package/src/Lottery/components/LotteryResult/WinLottery/index.wxss +73 -73
  593. package/src/Lottery/components/MerchantContactInfo/index.wxss +61 -61
  594. package/src/Lottery/components/NobodyAttend/index.wxss +33 -33
  595. package/src/Lottery/components/PrizeCard/index.wxss +42 -42
  596. package/src/Lottery/components/RewardList/RewardItem/index.wxss +77 -77
  597. package/src/Lottery/components/RewardList/index.wxss +62 -62
  598. package/src/Lottery/components/Winners/WinnerItem/index.wxss +50 -50
  599. package/src/Lottery/components/Winners/index.wxss +49 -49
  600. package/src/Lottery/countdown.js +88 -88
  601. package/src/Lottery/store/effect.js +204 -204
  602. package/src/PayComplete/Components/CouponItem/index.js +50 -50
  603. package/src/PayComplete/Components/CouponItem/index.json +3 -3
  604. package/src/PayComplete/Components/CouponItem/index.less +142 -142
  605. package/src/PayComplete/Components/CouponItem/index.wxml +46 -46
  606. package/src/PayComplete/Components/CouponItem/index.wxss +122 -122
  607. package/src/PayComplete/Components/CouponItem/sub.wxs +72 -72
  608. package/src/PayComplete/Components/LeadGroup/index.js +95 -95
  609. package/src/PayComplete/Components/LeadGroup/index.json +6 -6
  610. package/src/PayComplete/Components/LeadGroup/index.less +37 -37
  611. package/src/PayComplete/Components/LeadGroup/index.wxml +5 -5
  612. package/src/PayComplete/Components/LeadGroup/index.wxss +33 -33
  613. package/src/PayComplete/Components/PayGifts/index.js +129 -129
  614. package/src/PayComplete/Components/PayGifts/index.json +5 -5
  615. package/src/PayComplete/Components/PayGifts/index.less +177 -177
  616. package/src/PayComplete/Components/PayGifts/index.wxml +57 -57
  617. package/src/PayComplete/Components/PayGifts/index.wxss +157 -157
  618. package/src/PayComplete/Components/PayState/earnIntegral/index.js +62 -62
  619. package/src/PayComplete/Components/PayState/earnIntegral/index.json +5 -5
  620. package/src/PayComplete/Components/PayState/earnIntegral/index.less +25 -25
  621. package/src/PayComplete/Components/PayState/earnIntegral/index.wxml +4 -4
  622. package/src/PayComplete/Components/PayState/earnIntegral/index.wxss +23 -23
  623. package/src/PayComplete/Components/PayState/index.js +38 -38
  624. package/src/PayComplete/Components/PayState/index.json +6 -6
  625. package/src/PayComplete/Components/PayState/index.less +22 -22
  626. package/src/PayComplete/Components/PayState/index.wxml +11 -11
  627. package/src/PayComplete/Components/PayState/index.wxss +20 -20
  628. package/src/PayComplete/index.js +142 -142
  629. package/src/PayComplete/index.json +10 -10
  630. package/src/PayComplete/index.less +15 -15
  631. package/src/PayComplete/index.wxml +31 -31
  632. package/src/PayComplete/index.wxss +16 -16
  633. package/src/PayModule/button/index.js +44 -44
  634. package/src/PayModule/button/index.json +6 -6
  635. package/src/PayModule/button/index.less +16 -16
  636. package/src/PayModule/button/index.wxml +7 -7
  637. package/src/PayModule/button/index.wxss +28 -28
  638. package/src/PayModule/index/index.js +253 -253
  639. package/src/PayModule/index/index.json +7 -7
  640. package/src/PayModule/index/index.wxml +12 -12
  641. package/src/PayModule/wechatLoading/index.js +43 -43
  642. package/src/PayModule/wechatLoading/index.json +4 -4
  643. package/src/PayModule/wechatLoading/index.less +66 -66
  644. package/src/PayModule/wechatLoading/index.wxml +11 -11
  645. package/src/PayModule/wechatLoading/index.wxss +57 -57
  646. package/src/Recommend/index.js +58 -58
  647. package/src/Recommend/index.json +3 -3
  648. package/src/Recommend/index.less +115 -115
  649. package/src/Recommend/index.wxml +29 -29
  650. package/src/Recommend/index.wxss +110 -110
  651. package/src/SharePoster/PosterDom/index.js +1862 -1862
  652. package/src/SharePoster/PosterDom/index.json +4 -4
  653. package/src/SharePoster/PosterDom/index.less +56 -56
  654. package/src/SharePoster/PosterDom/index.wxml +12 -12
  655. package/src/SharePoster/PosterDom/index.wxss +57 -57
  656. package/src/SharePoster/README.md +9 -9
  657. package/src/SharePoster/ShareTextPopup/index.js +65 -65
  658. package/src/SharePoster/ShareTextPopup/index.json +6 -6
  659. package/src/SharePoster/ShareTextPopup/index.less +74 -74
  660. package/src/SharePoster/ShareTextPopup/index.wxml +28 -28
  661. package/src/SharePoster/ShareTextPopup/index.wxss +75 -75
  662. package/src/SharePoster/createPoster/index.js +201 -201
  663. package/src/SharePoster/createPoster/utils/drawImage.js +267 -267
  664. package/src/SharePoster/createPoster/utils/util.js +40 -40
  665. package/src/SharePoster/libs/constant.js +57 -57
  666. package/src/SharePoster/libs/positionMap.js +255 -255
  667. package/src/SharePoster/mockData/mockData.js +590 -590
  668. package/src/SharePoster/sharePopup/index.js +336 -336
  669. package/src/SharePoster/sharePopup/index.json +8 -8
  670. package/src/SharePoster/sharePopup/index.less +180 -180
  671. package/src/SharePoster/sharePopup/index.wxml +85 -85
  672. package/src/SharePoster/sharePopup/index.wxss +179 -179
  673. package/src/Sku/commSelect/index.js +426 -426
  674. package/src/Sku/commSelect/index.json +8 -8
  675. package/src/Sku/commSelect/index.less +48 -48
  676. package/src/Sku/commSelect/index.wxml +41 -41
  677. package/src/Sku/commSelect/index.wxss +45 -45
  678. package/src/Sku/goods-info/index.js +52 -52
  679. package/src/Sku/goods-info/index.json +4 -4
  680. package/src/Sku/goods-info/index.less +48 -48
  681. package/src/Sku/goods-info/index.wxml +19 -19
  682. package/src/Sku/goods-info/index.wxss +48 -48
  683. package/src/Sku/index/index.js +280 -280
  684. package/src/Sku/index/index.json +12 -12
  685. package/src/Sku/index/index.less +78 -78
  686. package/src/Sku/index/index.wxml +58 -58
  687. package/src/Sku/index/index.wxss +50 -50
  688. package/src/Sku/row-item/index.js +61 -61
  689. package/src/Sku/row-item/index.json +4 -4
  690. package/src/Sku/row-item/index.less +48 -48
  691. package/src/Sku/row-item/index.wxml +10 -10
  692. package/src/Sku/row-item/index.wxss +42 -42
  693. package/src/Sku/step/index.js +95 -95
  694. package/src/Sku/step/index.json +6 -6
  695. package/src/Sku/step/index.less +11 -11
  696. package/src/Sku/step/index.wxml +11 -11
  697. package/src/Sku/step/index.wxss +10 -10
  698. package/src/TeacherGoodsList/Header/index.js +36 -0
  699. package/{miniprogram_dist/LiveGoodsList/GoodsItem → src/TeacherGoodsList/Header}/index.json +6 -6
  700. package/src/TeacherGoodsList/Header/index.less +47 -0
  701. package/src/TeacherGoodsList/Header/index.wxml +27 -0
  702. package/src/TeacherGoodsList/Header/index.wxss +45 -0
  703. package/src/TeacherGoodsList/README.md +10 -0
  704. package/src/TeacherGoodsList/index.js +269 -0
  705. package/src/TeacherGoodsList/index.json +8 -0
  706. package/src/TeacherGoodsList/index.less +53 -0
  707. package/src/TeacherGoodsList/index.wxml +49 -0
  708. package/src/TeacherGoodsList/index.wxss +50 -0
  709. package/src/common/api/confirmOrder.js +217 -217
  710. package/src/common/api/coupon.js +19 -19
  711. package/src/common/api/couponlist.js +105 -105
  712. package/src/common/api/eLiveInvite.js +45 -45
  713. package/src/common/api/liveGoodsList.js +51 -51
  714. package/src/common/api/lottery.js +57 -57
  715. package/src/common/api/pay.js +42 -42
  716. package/src/common/api/payComplete.js +21 -21
  717. package/src/common/api/sharePoster.js +67 -67
  718. package/src/common/api/sku.js +58 -58
  719. package/src/common/assets/copy.wxss +3 -3
  720. package/src/common/assets/images/coupon/coupon_style2.svg +29 -29
  721. package/src/common/assets/images/coupon/coupons_style2.svg +29 -29
  722. package/src/common/assets/images/coupon/down.svg +21 -21
  723. package/src/common/assets/images/coupon/emptypage.svg +49 -49
  724. package/src/common/assets/images/coupon/failed.svg +5 -5
  725. package/src/common/assets/images/coupon/up.svg +21 -21
  726. package/src/common/assets/images/lottery/is_not_winner.svg +19 -19
  727. package/src/common/assets/images/lottery/lottery_v1_back.svg +19 -19
  728. package/src/common/assets/images/lottery/lottery_v1_close.svg +19 -19
  729. package/src/common/assets/images/lottery/reward_list_title.svg +19 -19
  730. package/src/common/assets/images/lottery/white_right_arrow.png +0 -0
  731. package/src/common/assets/images/lottery/winner_list_smile_icon.svg +56 -56
  732. package/src/common/assets/images/lottery/winner_list_title.svg +19 -19
  733. package/src/common/assets/images/pay/loading.svg +3 -3
  734. package/src/common/assets/images/recommend.svg +6 -6
  735. package/src/common/assets/images/refresh.svg +10 -10
  736. package/src/common/assets/images/refresh_white.svg +3 -3
  737. package/src/common/assets/images/wechat.svg +4 -4
  738. package/src/common/css/index.less +2 -2
  739. package/src/common/css/theme.less +19 -19
  740. package/src/common/css/theme.wxss +16 -16
  741. package/src/common/libs/dataUp/sensorUp.js +91 -91
  742. package/src/common/libs/playerHttp.js +58 -58
  743. package/src/common/libs/playerRequestUrl.js +39 -39
  744. package/src/common/utils/constants.js +254 -254
  745. package/src/common/utils/currency.js +52 -52
  746. package/src/common/utils/helper.js +159 -159
  747. package/src/common/utils/index.js +56 -56
  748. package/src/common/utils/postCouponList.js +52 -52
  749. package/src/common/utils/tool.js +65 -65
  750. package/src/common/wxs/filter.wxs +29 -29
  751. package/src/coupon/README.md +11 -11
  752. package/src/coupon/components/CouponItem/index.js +175 -175
  753. package/src/coupon/components/CouponItem/index.json +5 -5
  754. package/src/coupon/components/CouponItem/index.less +207 -207
  755. package/src/coupon/components/CouponItem/index.wxml +99 -99
  756. package/src/coupon/components/CouponItem/index.wxss +195 -195
  757. package/src/coupon/components/CouponSelect/index.js +323 -323
  758. package/src/coupon/components/CouponSelect/index.json +8 -8
  759. package/src/coupon/components/CouponSelect/index.less +237 -237
  760. package/src/coupon/components/CouponSelect/index.wxml +74 -74
  761. package/src/coupon/components/CouponSelect/index.wxss +249 -249
  762. package/src/coupon/index.css +50 -50
  763. package/src/coupon/index.js +205 -205
  764. package/src/coupon/index.json +7 -7
  765. package/src/coupon/index.less +51 -51
  766. package/src/coupon/index.wxml +24 -24
  767. package/src/coupon/index.wxss +50 -50
  768. package/src/index.js +23 -23
  769. package/src/index.json +4 -4
  770. package/src/index.wxml +2 -2
  771. package/src/lib.ts +5 -5
  772. package/src/project.config.json +68 -68
  773. package/src/utils.js +5 -5
  774. package/tsconfig.json +25 -25
  775. package/miniprogram_dist/LiveGoodsList/GoodsItem/index.less +0 -228
  776. package/src/LiveGoodsList/GoodsItem/index.less +0 -228
@@ -1,1863 +1,1863 @@
1
- import objToPoster from '../createPoster/index'
2
- import { posterInfo } from '../libs/positionMap';
3
- import { TYPES,POSTER_CLS, } from '../libs/constant';
4
- const computedBehavior = require('miniprogram-computed').behavior;
5
- const POSTER_WIDTH = 750;
6
- const POSTER_HEIGHT = 1344;
7
-
8
- let ID = 0
9
-
10
- Component({
11
- behaviors: [computedBehavior],
12
- /**
13
- * 组件的属性列表
14
- */
15
- /**
16
- * 组件的属性列表
17
- */
18
- properties: {
19
- isSinglePoster: {
20
- type: Boolean,
21
- value: false
22
- },
23
- motiveInfo: {
24
- type: Array,
25
- value: () => {
26
- return [];
27
- }
28
- },
29
- posterItem: {
30
- type: Object,
31
- value: () => {},
32
- },
33
- promotionInfo:{
34
- type: Object,
35
- value: () => {
36
- return {};
37
- }
38
- },
39
- showPopup:{
40
- type: Boolean,
41
- value: false
42
- }
43
- },
44
- observers: {
45
- posterItem(newData) {
46
- if(Object.getOwnPropertyNames(newData).length){
47
- this.setData({
48
- isVisible :true,
49
- posterItemData:newData,
50
- posterStyle:newData.default_poster_mark
51
- })
52
- }
53
- if(Object.getOwnPropertyNames(newData).length && Object.getOwnPropertyNames(this.properties.promotionInfo).length && this.properties.promotionInfo.resource_info.qr_code.includes("myqcloud")){
54
- if(this.properties.showPopup){
55
- this.generatePoster(15);
56
- }
57
- }
58
- },
59
- promotionInfo(newData){
60
- if(Object.getOwnPropertyNames(newData).length && newData.resource_info.qr_code.includes("myqcloud") && Object.getOwnPropertyNames(this.properties.posterItem).length){
61
- if(this.properties.showPopup){
62
- this.generatePoster(15);
63
- }
64
- }
65
- },
66
- },
67
- lifetimes: {
68
- attached(){
69
- var app = getApp()
70
- app.globalData[`poster${ID++}`] = this
71
- },
72
- ready(){
73
- this.cleanUpWxFileSystemMemory(2);
74
- }
75
- },
76
- /**
77
- * 组件的初始数据
78
- */
79
- data: {
80
- imgSrc:'',
81
- imageUrl:'',
82
- isVisible:true,
83
- posterMapInfo: posterInfo,
84
- motiveInfoData:{"text":"世上没有任何伟业的成就能够离得开激情。","auther":"黑格尔"},
85
- shareAddInfo:{},
86
- posterObj:{},
87
- isSwitchBtnShow:false,
88
- posterItemData:{},
89
- posterStyle:"",
90
- defaultAvatarUrl: 'https://wechatavator-1252524126.cos.ap-shanghai.myqcloud.com/dasda.jpg',
91
- },
92
- computed:{
93
- posterData(data) {
94
- let temInfo = data.posterItemData;
95
- let defaultPoster = data.posterMapInfo[data.posterItemData.default_poster_mark];
96
- temInfo = {...data.posterItemData, ...defaultPoster};
97
- console.log(temInfo,'teninfo');
98
- return temInfo;
99
- },
100
- // 根据不同商品类型展示不同邀请文案
101
- shareHint(data) {
102
- let resType = data.promotionInfo && data.promotionInfo.resource_info && data.promotionInfo.resource_info.resource_type;
103
- let shareTxt = '';
104
- if (data.posterData.is_default === 1) {
105
- switch (resType) {
106
- case 2:
107
- shareTxt = '邀请你一起收听';
108
- break;
109
- case 4:
110
- shareTxt = '邀请你一起观看';
111
- break;
112
- case 20:
113
- shareTxt = '邀请你一起阅读';
114
- break;
115
- case 21:
116
- shareTxt = '邀请你一起购买';
117
- break;
118
- case 31:
119
- case 29:
120
- case 25:
121
- case 35:
122
- shareTxt = '邀请你一起参加';
123
- break;
124
- default:
125
- shareTxt = '邀请你一起学习';
126
- break;
127
- }
128
- }
129
-
130
- return shareTxt;
131
- },
132
- userInfo(data) {
133
- return data.promotionInfo.user_info || { wx_avatar: '', wx_nickname: '' };
134
- },
135
- // posterStyle(data) {
136
- // return data.posterData && data.posterData.default_poster_mark || "";
137
- // },
138
- showGoods(data) {
139
- let showGood = data.posterData.is_show_goods;
140
- if (data.posterStyle !== POSTER_CLS.USER_CUSTOM) {
141
- showGood = data.posterData.goods_position;
142
- }
143
- return showGood;
144
- },
145
- showGoodsImg(data) {
146
- let showImg = true;
147
- if (data.posterData.is_default === 1) {
148
- showImg = data.posterData.show_goods_img;
149
- }
150
- return showImg;
151
- },
152
- showFinger(data) {
153
- return data.posterData.qr_code_type === 1 && data.posterData.is_default === 0;
154
- },
155
- resource_info(data) {
156
- return data.promotionInfo && data.promotionInfo.resource_info;
157
- },
158
- isShowPrice(data) {
159
- let showPrcie = true;
160
- let payment_type = data.resource_info && data.resource_info.payment_type || 2; //仅关联不展示价格
161
- if (data.posterStyle !== POSTER_CLS.USER_CUSTOM) {
162
- showPrcie = data.posterData.has_price_info;
163
- } else {
164
- showPrcie = data.posterData.is_show_price && payment_type != 3;
165
- }
166
- return showPrcie;
167
- },
168
- activityLable(data) {
169
- return data.resource_info && data.resource_info.activity_label || '';
170
- },
171
- zbStartAt(data) {
172
- return data.resource_info && data.resource_info.zb_start_at && data.resource_info.zb_start_at.split(' ');
173
- },
174
- resourceLinePrice(data) {
175
- return data.resource_info && data.resource_info.line_price ? String((data.resource_info.line_price / 100).toFixed(2)) : '';
176
- }
177
- },
178
-
179
- /**
180
- * 组件的方法列表
181
- */
182
- methods: {
183
- getPosterData() {
184
- let temInfo = this.data.posterItemData;
185
- let defaultPoster = this.data.posterMapInfo[this.data.posterItemData.default_poster_mark];
186
- temInfo = {...this.data.posterItemData, ...defaultPoster};
187
- return temInfo;
188
- },
189
- // 价格的 单位、整数、小数部分字体大小不同,需分别绘制再拼接
190
- // x,y 表示起始位置
191
- getResourcePrice(x, y, color,poster) {
192
- const { price } = this.data.resource_info;
193
- if (price === 0) {
194
- return [
195
- {
196
- label: 'free',
197
- type: "font",
198
- x,
199
- y,
200
- value: '免费',
201
- size: 40,
202
- color
203
- }
204
- ];
205
- }
206
- const [priceInt, priceFloat] = String((price / 100).toFixed(2)).split('.');
207
- const unitProps = {
208
- label: 'priceUnit',
209
- type: "font",
210
- x,
211
- y,
212
- value: '¥',
213
- size: 40,
214
- fontWeight: 'normal',
215
- color
216
- };
217
- const MARGIN_RIGHT = 8;
218
- const priceIntProps = {
219
- label: 'priceInt',
220
- type: "font",
221
- x: x + poster.getTextRect(unitProps).width + MARGIN_RIGHT,
222
- y: y - 10,
223
- value: priceInt,
224
- size: 60,
225
- fontWeight: 'normal',
226
- color
227
- };
228
- const priceFloatProps = {
229
- label: 'priceFloat',
230
- type: "font",
231
- x:
232
- x +
233
- poster.getTextRect(priceIntProps).width +
234
- poster.getTextRect(unitProps).width +
235
- MARGIN_RIGHT,
236
- y,
237
- value: `.${priceFloat}`,
238
- size: 40,
239
- fontWeight: 'normal',
240
- color
241
- };
242
- return [unitProps, priceIntProps, priceFloatProps];
243
- },
244
- // 实际渲染的价格包含三个部分:整数、小数点、小数点后两位
245
- getResourcePriceRect(poster) {
246
- const [unitProps, priceIntProps, priceFloatProps] = this.getResourcePrice(0, 0, 'black',poster);
247
- const unitTextRect = poster.getTextRect(unitProps);
248
- const priceIntTextRect = poster.getTextRect(priceIntProps);
249
- const priceFloatTextRect = poster.getTextRect(priceFloatProps);
250
- return {
251
- width: unitTextRect.width + priceIntTextRect.width + priceFloatTextRect.width,
252
- height: Math.max(unitTextRect.height, priceIntTextRect.height, priceFloatTextRect.height)
253
- };
254
- },
255
- generatePoster(random){
256
- const that = this
257
- this.triggerEvent('drawPosterBegin');
258
- new objToPoster(POSTER_WIDTH,POSTER_HEIGHT,1,this).initCanvas(this,1).then(res=>{
259
- this.posterObj = this.getPosterConfig(res);
260
- return this.posterObj && res.convertToImg(this.posterObj)
261
- }).then(response=>{
262
- if(response){
263
- this.cleanUpWxFileSystemMemory(43);
264
- this.getWxFilesListAndWriteFile(response,random);
265
- }
266
- })
267
- },
268
- getImageSrc(response) {
269
- console.log('getImageSrc: ', response)
270
- this.setData({
271
- imgSrc: response,
272
- imageUrl: response,
273
- isVisible: false
274
- },()=>{
275
-
276
- console.log('imageUrl', this.data.imageUrl)
277
- })
278
- },
279
- getWxFilesListAndWriteFile(response,random){
280
- let that = this;
281
- const fs = wx.getFileSystemManager();
282
- fs.readdir({
283
- dirPath: wx.env.USER_DATA_PATH,
284
- success(res) {
285
- //res.files为存入的列表路径
286
- let filesList = res.files;
287
- let isOtherPosterExist = false;
288
- let isStudyPosterExist = false;
289
- if(filesList.length>2){
290
- isStudyPosterExist = that.data.posterStyle === POSTER_CLS.STUDY && filesList.some(item=>{
291
- let num = +(item.replace(/[^0-9]/ig,""))
292
- return num === random && item.includes(that.data.posterStyle)
293
- })
294
- isOtherPosterExist = that.data.posterStyle !== POSTER_CLS.STUDY && filesList.some(item=>{
295
- return item.includes(that.data.posterStyle)
296
- })
297
- if(!(isStudyPosterExist || isOtherPosterExist)){
298
- that.wxWriteFile(response,random)
299
- }else{
300
- if(isStudyPosterExist){
301
- that.setData({
302
- imageUrl:wx.env.USER_DATA_PATH + '/'+ that.data.posterStyle + random +'.png'
303
- })
304
- }else if(isOtherPosterExist){
305
- that.setData({
306
- imageUrl:wx.env.USER_DATA_PATH + '/'+ that.data.posterData.id +'.png'
307
- })
308
- }
309
- let isShow = that.data.posterData && that.data.posterData.default_poster_mark === POSTER_CLS.STUDY;
310
- that.setData({
311
- isSwitchBtnShow: isShow,
312
- isVisible: false
313
- })
314
- that.triggerEvent('drawPosterFulfilled');
315
- }
316
- }else{
317
- that.wxWriteFile(response,random)
318
- }
319
- }
320
- })
321
- },
322
- cleanUpWxFileSystemMemory(n){
323
- const fs = wx.getFileSystemManager();
324
- fs.readdir({
325
- dirPath: wx.env.USER_DATA_PATH,
326
- success(res) {
327
- //res.files为存入的列表路径
328
- let indexVal = res.files.length;
329
- //由于微信本地存储超过10M时,写入文件失败,10M大概是43张海报的内存,所以大于42时,清除垃圾文件,再写入
330
- if(indexVal>n){
331
- res.files.forEach((el) => {
332
- let name = (wx.env.USER_DATA_PATH+el).replace(/usr/g, "usr/");
333
- fs.unlink({
334
- filePath:name,
335
- fail(e) {
336
- console.log('文件删除失败:', e)
337
- },
338
- success(succ){
339
- console.log('文件删除成功:', succ);
340
- }
341
- })
342
- })
343
- }
344
- }
345
- })
346
- },
347
- wxWriteFile(response,random){
348
- const fs = wx.getFileSystemManager();
349
- //随机定义路径名称
350
- let codeimg =this.data.posterStyle === POSTER_CLS.STUDY ? wx.env.USER_DATA_PATH + '/' + this.data.posterStyle + random + '.png': wx.env.USER_DATA_PATH + '/' + this.data.posterData.id + '.png';
351
- //将base64图片写入
352
- fs.writeFile({
353
- filePath: codeimg,
354
- data: response.slice(22),
355
- encoding: 'base64',
356
- success: (res) => {
357
- //写入成功了的话,新的图片路径就能用了
358
- console.log(res)
359
- console.log("codeimg: ",codeimg)
360
- // this.imgSrc=codeimg;
361
- this.setData({
362
- imageUrl:codeimg
363
- })
364
- let isShow = this.data.posterData && this.data.posterData.default_poster_mark === POSTER_CLS.STUDY;
365
- this.setData({
366
- isSwitchBtnShow:isShow
367
- })
368
- this.triggerEvent('drawPosterFulfilled');
369
- },
370
- fail:(error)=>{
371
- console.log(error);
372
- }
373
- })
374
- },
375
- getPosterConfig(poster){
376
- const drawPosterFnMaps = {
377
- [POSTER_CLS.USER_CUSTOM]: this.drawUserCustomPoster,
378
- [POSTER_CLS.STUDY]: this.drawStudyPoster,
379
- [POSTER_CLS.PRICE_ONE]: this.drawPriceOnePoster,
380
- [POSTER_CLS.INTERACT_ONE]: this.drawInteractOnePoster,
381
- [POSTER_CLS.INTERACT_TWO]: this.drawInteractTwoPoster,
382
- [POSTER_CLS.PRICE_TWO]: this.drawPriceTwoPoster,
383
- [POSTER_CLS.INTERACT_THREE]: this.drawInteractThreePoster,
384
- [POSTER_CLS.ENTITY]: this.drawEntityPoster,
385
- [POSTER_CLS.ALIVE]: this.drawAlivePoster,
386
- [POSTER_CLS.ALIVE_GENERAL]: this.drawAliveGeneralPoster,
387
- [POSTER_CLS.ALIVE_SPECIFIC]: this.drawAliveSpecificPoster
388
- };
389
- console.log(this.data.posterStyle,'this.data.posterStyle')
390
- if(!this.data.posterStyle){
391
- return
392
- }
393
- const drawFn = drawPosterFnMaps[this.data.posterStyle].bind(this);
394
- if (!drawFn) {
395
- console.warn('未知的海报类型', this.data.posterStyle);
396
- return;
397
- }
398
- let posterConfigObj = drawFn(poster);
399
- return posterConfigObj;
400
- },
401
- // 绘制自定义海报
402
- // 自定义海报的 头像、昵称、二维码,是否展示、位置、宽高都是取的接口数据。
403
- // 其中 二维码类型需要单独区分 并计算位置和宽高
404
- // 条件渲染约定的值比较混乱
405
- drawUserCustomPoster(poster) {
406
- const isShowAvatar = [1, 2].includes(this.data.posterData.is_show_avatar); // 1和2 展示
407
- const isShowNickname = [1, 2].includes(this.data.posterData.is_show_nickname); // 1和2 展示
408
- const isShowGoods = this.data.posterData.is_show_goods === 1;
409
- const isShowPrice = this.data.posterData.is_show_price === 1;
410
- const isHideQrcode = this.data.posterData.qr_code_type === 2; // 0和1 展示
411
- const isShowFingerprints = this.data.posterData.is_show_fingerprints === 1; // 0和2 不展示
412
-
413
-
414
- const LINE_PRICE_MARGIN_RIGHT = 80;
415
- const linePriceProps = {
416
- label: 'resourceLinePrice',
417
- type: TYPES.TEXT,
418
- value: this.data.resourceLinePrice,
419
- size: 32,
420
- fontWeight: 'bold',
421
- color: '#777',
422
- textStyle: 'stroke'
423
- };
424
-
425
- // 部分公共数据提取出来,包含:背景图、价格、划线价、资源图、标题
426
- const commonWidgets = [
427
- {
428
- label: 'posterBg',
429
- type: TYPES.BG_IMG,
430
- src: this.data.posterData.poster_url,
431
- x:0,
432
- y:0,
433
- width:POSTER_WIDTH,
434
- height:POSTER_HEIGHT
435
- },
436
- isShowGoods && isShowPrice &&
437
- this.data.resourceLinePrice && {
438
- ...linePriceProps,
439
- x: POSTER_WIDTH - poster.getTextRect(linePriceProps).width - LINE_PRICE_MARGIN_RIGHT,
440
- y: 830
441
- },
442
- ...(isShowGoods && isShowPrice ? this.getResourcePrice(88, 830, '#FE8946',poster) : []),
443
- isShowGoods && {
444
- label: 'goodsName',
445
- type: TYPES.TEXT,
446
- x: 88,
447
- y: !isShowPrice ? 826 : 890,
448
- value: this.data.resource_info.title,
449
- size: 32,
450
- fontWeight: 'normal',
451
- color: 'black',
452
- maxWidth: 550,
453
- textOverflow: 'ellipsis'
454
- },
455
- isShowGoods && {
456
- label: 'goodsImg',
457
- type: TYPES.IMG,
458
- imgRoundType:'halfRoundRect',
459
- src: this.data.resource_info && this.data.resource_info.img_url,
460
- x: POSTER_WIDTH / 2 - 640 / 2,
461
- y: 310,
462
- width: 640,
463
- height: 640 * 0.75,
464
- },
465
- isShowGoods && {
466
- label: 'resourceAdditionalBackground',
467
- type: TYPES.SHAPE,
468
- width: 640,
469
- height: !isShowPrice ? 100 : 180,
470
- x: POSTER_WIDTH / 2 - 640 / 2,
471
- y: 790,
472
- r:20,
473
- color: 'white',
474
- shape:'bottomRoundRect',
475
- }
476
- ];
477
-
478
- // 新老数据逻辑上分开渲染,方便后续维护
479
- const isNewDataSource = Boolean(
480
- this.data.posterData.qrcode_size && this.data.posterData.avatar_size && this.data.posterData.nickname_size
481
- );
482
-
483
- console.log('isNewDataSource: ', isNewDataSource);
484
- if (isNewDataSource) {
485
- // 昵称最长不超出海报边界
486
- // 省略号...约等于一个字的宽度
487
- const NICKNAME_MARGIN_RIGHT = this.data.posterData.nickname_size.size;
488
- let nicknameMaxWidth = 400;
489
- if (this.data.posterData.is_show_avatar === 1) {
490
- const centralPoint = this.data.posterData.avatar_position.x + this.data.posterData.avatar_size.w / 2;
491
- nicknameMaxWidth = 2 * Math.min(POSTER_WIDTH - centralPoint, centralPoint) - NICKNAME_MARGIN_RIGHT*2;
492
- }
493
- if (this.data.posterData.is_show_avatar === 2) {
494
- nicknameMaxWidth = POSTER_WIDTH - this.data.posterData.nickname_position.x - NICKNAME_MARGIN_RIGHT;
495
- }
496
- const nicknameProps = {
497
- label: 'nickname',
498
- type: TYPES.TEXT,
499
- value: this.data.userInfo.wx_nickname,
500
- size: this.data.posterData.nickname_size.size,
501
- fontWeight: 'normal',
502
- color: this.data.posterData.nickname_color === 1 ? 'black' : 'white', // 0 | 1 | 2
503
- maxWidth: nicknameMaxWidth,
504
- textOverflow: 'ellipsis'
505
- };
506
- const nicknameRect = poster.getTextRect(nicknameProps);
507
- let nicknameX = this.data.posterData.nickname_position.x;
508
- // is_show_avatar === 1 时,昵称相对于头像 居中展示
509
- if (this.data.posterData.is_show_avatar === 1) {
510
- nicknameX =
511
- this.data.posterData.avatar_position.x + this.data.posterData.avatar_size.w / 2 - nicknameRect.width / 2;
512
- }
513
- return [
514
- ...commonWidgets,
515
- isShowNickname && {
516
- ...nicknameProps,
517
- x: nicknameX,
518
- y: this.data.posterData.nickname_position.y,
519
- },
520
- isShowAvatar && {
521
- label: 'avatar',
522
- type: TYPES.IMG,
523
- src: this.data.userInfo.wx_avatar,
524
- x: this.data.posterData.avatar_position.x,
525
- y: this.data.posterData.avatar_position.y,
526
- width: this.data.posterData.avatar_size.w,
527
- height: this.data.posterData.avatar_size.h,
528
- border:this.data.posterData.avatar_size.w
529
- },
530
- // 二维码和指纹宽高 需单独计算
531
- // 已知:二维码 和 指纹宽高一致,且能拿到整体宽高 qrcode_size.x qrcode_size.y
532
- // 间隙需动态调整
533
- isHideQrcode || {
534
- label: 'qrcode',
535
- type: TYPES.IMG,
536
- imgRoundType : 'fullRoundRect',
537
- src: this.data.resource_info && this.data.resource_info.qr_code,
538
- x: this.data.posterData && this.data.posterData.qrcode_position && this.data.posterData.qrcode_position.x,
539
- y: this.data.posterData && this.data.posterData.qrcode_position && this.data.posterData.qrcode_position.y,
540
- width: this.data.posterData.qrcode_size.h,
541
- height: this.data.posterData.qrcode_size.h,
542
- },
543
- isShowFingerprints && {
544
- label: 'fingerprint',
545
- type: TYPES.IMG,
546
- // 新数据 fingerprint_position 废弃不用
547
- x:
548
- this.data.posterData.qrcode_position.x +
549
- this.data.posterData.qrcode_size.w -
550
- this.data.posterData.qrcode_size.h,
551
- // 注意:顶部和二维码对齐,这里是之前已有的逻辑(由于fingerprint_position和qrcode_position数据y不一致,直接采用二维码的y值定位)
552
- y: this.data.posterData.qrcode_position.y,
553
- width: this.data.posterData.qrcode_size.h,
554
- height: this.data.posterData.qrcode_size.h,
555
- src: 'http://wechatapppro-1252524126.file.myqcloud.com/appAKLWLitn7978/image/859093d21aee5d46f4a58d3842f81d0d.png'
556
- }
557
- ];
558
- } else {
559
- // 注意:以下代码为兼容海报旧数据(已废弃)的特殊逻辑。
560
- // 由于旧数据及其不准确,之前是前端对错误的数据进行兜底特殊处理,几乎无法维护。
561
- // 以下逻辑完全照搬旧代码,非必要勿动。
562
- const NICKNAME_MARGIN_RIGHT = 36;
563
- const nicknameProps = {
564
- label: 'nickname',
565
- type: TYPES.TEXT,
566
- x: this.data.posterData.nickname_position.x,
567
- y: this.data.posterData.nickname_position.y,
568
- value: this.data.userInfo.wx_nickname,
569
- size: 32,
570
- fontWeight: 'normal',
571
- color: this.data.posterData.nickname_color === 1 ? 'black' : 'white', // 0 | 1 | 2
572
- textOverflow: 'ellipsis'
573
- };
574
- const nicknameRect = poster.getTextRect(nicknameProps);
575
- let nicknameX = this.data.posterData.nickname_position.x;
576
- let nicknameY = this.data.posterData.nickname_position.y;
577
- let align = this.data.posterData.nickname_position.align || 'left';
578
- if (align === 'center') {
579
- nicknameX = nicknameX - nicknameRect.width / 2;
580
- }
581
- // 由于b端自定义海报时,昵称距离海报边框有距离,所以如果left小于/等于18,则left取值为18
582
- nicknameX = Math.max(18, nicknameX);
583
- nicknameY = nicknameY - nicknameRect.height / 4;
584
- return [
585
- ...commonWidgets,
586
- isShowNickname && {
587
- ...nicknameProps,
588
- x: nicknameX,
589
- y: nicknameY,
590
- maxWidth: POSTER_WIDTH - nicknameX - NICKNAME_MARGIN_RIGHT
591
- },
592
- isShowAvatar && {
593
- label: 'avatar',
594
- type: TYPES.IMG,
595
- x: this.data.posterData.avatar_position.x,
596
- y: this.data.posterData.avatar_position.y-10,
597
- width: 90,
598
- height: 90,
599
- src: this.data.userInfo.wx_avatar,
600
- border:90
601
- },
602
- isHideQrcode || {
603
- label: 'qrcode',
604
- type: TYPES.IMG,
605
- imgRoundType : 'fullRoundRect',
606
- x: this.data.posterData && this.data.posterData.qrcode_position && this.data.posterData.qrcode_position.x,
607
- y: this.data.posterData && this.data.posterData.qrcode_position && this.data.posterData.qrcode_position.y,
608
- width: 150,
609
- height: 150,
610
- src: this.data.resource_info && this.data.resource_info.qr_code,
611
- },
612
- isShowFingerprints && {
613
- label: 'fingerprint',
614
- type: TYPES.IMG,
615
- x: this.data.posterData.fingerprint_position.x,
616
- y: this.data.posterData.fingerprint_position.y,
617
- width: 140,
618
- height: 140,
619
- src: 'http://wechatapppro-1252524126.file.myqcloud.com/appAKLWLitn7978/image/859093d21aee5d46f4a58d3842f81d0d.png'
620
- }
621
- ];
622
- }
623
- },
624
- //实物商品只有一张海报的场景
625
- drawEntityPoster(poster) {
626
- const LABEL_PADDING = 16;
627
- const LINE_PRICE_MARGIN_LEFT = 120;
628
- const shopNameProps = {
629
- label: 'shopName',
630
- type: TYPES.TEXT,
631
- y: 196,
632
- value: this.data.posterData.shop_name,
633
- size: 30,
634
- fontWeight: 'normal',
635
- color: 'white',
636
- maxWidth: 500
637
- };
638
- const shopNameRect = poster.getTextRect(shopNameProps);
639
- const linePriceProps = {
640
- label: 'resourceLinePrice',
641
- type: TYPES.TEXT,
642
- value: this.data.resourceLinePrice,
643
- size: 32,
644
- fontWeight: 'bold',
645
- color: '#777',
646
- textStyle: 'stroke'
647
- };
648
- return [{
649
- label: 'posterBg',
650
- type: TYPES.BG_IMG,
651
- src: this.data.posterData.poster_url,
652
- x:0,
653
- y:0,
654
- width:POSTER_WIDTH,
655
- height:POSTER_HEIGHT
656
- },
657
- {
658
- label: 'avatar',
659
- type: TYPES.IMG,
660
- x: 48,
661
- y: 32,
662
- width: 100,
663
- height: 100,
664
- src: this.data.userInfo.wx_avatar,
665
- border: 50
666
- },
667
- {
668
- label: 'nickname',
669
- type: TYPES.TEXT,
670
- x: 170,
671
- y: 48,
672
- value: this.data.userInfo.wx_nickname,
673
- size: 36,
674
- fontWeight: 'bold',
675
- color: 'black',
676
- maxWidth: 500,
677
- textOverflow: 'ellipsis'
678
- },
679
- {
680
- label: 'sharePrompt',
681
- type: TYPES.TEXT,
682
- x: 170,
683
- y: 96,
684
- value: this.data.shareHint,
685
- size: 28,
686
- color: '#444'
687
- },
688
- {
689
- label: 'goodsImg',
690
- type: TYPES.IMG,
691
- imgRoundType : 'fullRoundRect',
692
- src: this.data.resource_info.img_url,
693
- x: POSTER_WIDTH / 2 - 620 / 2,
694
- y: 180,
695
- width: 620,
696
- height: 620
697
- },
698
- {
699
- label: 'goodsName',
700
- type: TYPES.TEXT,
701
- x: 80,
702
- y: 950,
703
- value: this.data.resource_info.title,
704
- size: 32,
705
- fontWeight: 'normal',
706
- color: 'black',
707
- maxWidth: 600,
708
- textOverflow: 'wrap',
709
- lineHeight:48
710
- },
711
- {
712
- label: 'shopNameLabel',
713
- type: TYPES.SHAPE,
714
- x: POSTER_WIDTH - shopNameRect.width - 82 - LABEL_PADDING*2,
715
- y: shopNameProps.y - LABEL_PADDING/2-4,
716
- r: 4,
717
- width: shopNameRect.width + 2 * LABEL_PADDING,
718
- height: shopNameProps.size + LABEL_PADDING/2,
719
- shape:'diagonalRoundRect',
720
- color: '#FD822B'
721
- },
722
- {
723
- ...shopNameProps,
724
- x: POSTER_WIDTH - shopNameRect.width - 80
725
- },
726
- this.data.resourceLinePrice && {
727
- ...linePriceProps,
728
- x: this.getResourcePriceRect(poster).width + LINE_PRICE_MARGIN_LEFT,
729
- y: 884
730
-
731
- },
732
- ...this.getResourcePrice(80, 880, '#FD822B',poster),
733
- {
734
- label: 'qrcode',
735
- type: TYPES.IMG,
736
- src: this.data.resource_info.qr_code,
737
- x: 80,
738
- y: 1080,
739
- width: 160,
740
- height: 160,
741
- }
742
- ];
743
- },
744
- // drawStudyPoster(poster) {
745
- // const motiveTextProps = {
746
- // label: 'motiveText',
747
- // type: TYPES.TEXT,
748
- // x: 80,
749
- // y: 510,
750
- // value: this.data.motiveInfoData.text,
751
- // size: 32,
752
- // color: 'black',
753
- // lineHeight: 48,
754
- // maxWidth: 590,
755
- // textOverflow: 'wrap' // wrap ellipsis
756
- // };
757
- // const motiveTextAuthorProps = {
758
- // label: 'motiveTextAuthor',
759
- // type: TYPES.TEXT,
760
- // value: `—— ${this.data.motiveInfoData.auther}`,
761
- // size: 32,
762
- // color: 'black',
763
- // maxWidth: 600
764
- // };
765
- // const motiveTextAuthorRect = poster.getTextRect(motiveTextAuthorProps);
766
- // const motiveTextRect = poster.getTextRect(motiveTextProps);
767
- // return [{
768
- // label: 'posterBg',
769
- // type: TYPES.BG_IMG,
770
- // src: this.data.posterData.poster_url,
771
- // x:0,
772
- // y:0,
773
- // width:POSTER_WIDTH,
774
- // height:POSTER_HEIGHT
775
- // },
776
- // {
777
- // label: 'avatar',
778
- // type: TYPES.IMG,
779
- // x: 122,
780
- // y: 256,
781
- // width: 160,
782
- // height: 160,
783
- // src: this.data.userInfo.wx_avatar,
784
- // border: 80
785
- // },
786
- // {
787
- // label: 'nickname',
788
- // type: TYPES.TEXT,
789
- // x: 320,
790
- // y: 280,
791
- // value: this.data.userInfo.wx_nickname,
792
- // size: 44,
793
- // fontWeight: 'bold',
794
- // color: 'black',
795
- // maxWidth: 280,
796
- // textOverflow: 'ellipsis'
797
- // },
798
- // {
799
- // label: 'sharePrompt',
800
- // type: TYPES.TEXT,
801
- // x: 320,
802
- // y: 340,
803
- // value: this.data.shareHint,
804
- // size: 40,
805
- // color: 'black'
806
- // },
807
- // motiveTextProps,
808
- // {
809
- // label: 'resourceTitle',
810
- // type: TYPES.TEXT,
811
- // x: 80,
812
- // y: 800,
813
- // value: this.data.resource_info.title,
814
- // size: 36,
815
- // fontWeight: 'normal',
816
- // color: 'black',
817
- // maxWidth: 590,
818
- // textOverflow: 'ellipsis'
819
- // },
820
- // // {
821
- // // label: 'qrcode',
822
- // // type: TYPES.IMG,
823
- // // x: POSTER_WIDTH / 2 - 168 / 2,
824
- // // y: 928,
825
- // // width: 168,
826
- // // height: 168,
827
- // // src: this.data.resource_info.qr_code
828
- // // },
829
- // {
830
- // label: 'scanPrompt',
831
- // type: TYPES.TEXT,
832
- // x: 0,
833
- // y: 1110,
834
- // value: '长按扫码查看详情',
835
- // size: 24,
836
- // fontWeight: 'bold',
837
- // color: 'black',
838
- // textAlign: "center"
839
- // },
840
- // {
841
- // label: 'shopName',
842
- // type: TYPES.TEXT,
843
- // y: 898,
844
- // value: this.data.posterData.shop_name,
845
- // size: 32,
846
- // fontWeight: 'bold',
847
- // color: 'black',
848
- // maxWidth: 590,
849
- // textAlign: "center"
850
- // },
851
- // {
852
- // ...motiveTextAuthorProps,
853
- // x: POSTER_WIDTH - motiveTextAuthorRect.width - 80,
854
- // y: 500 + motiveTextRect.height
855
- // }
856
- // ];
857
- // },
858
- drawPriceOnePoster(poster) {
859
- const shopNameProps = {
860
- label: 'shopName',
861
- type: TYPES.TEXT,
862
- y: 346,
863
- value: this.data.posterData.shop_name,
864
- size: 32,
865
- fontWeight: 'bold',
866
- color: 'white',
867
- maxWidth: 500
868
- };
869
- const shopNameRect = poster.getTextRect(shopNameProps);
870
- const LABEL_PADDING = 4;
871
- const LINE_PRICE_MARGIN_RIGHT = 56;
872
- const linePriceProps = {
873
- label: 'resourceLinePrice',
874
- type: TYPES.TEXT,
875
- value: this.data.resourceLinePrice,
876
- size: 32,
877
- fontWeight: 'bold',
878
- color: '#777',
879
- textStyle: 'stroke'
880
- };
881
- let posterConfigArr = [
882
- {
883
- label: 'posterBg',
884
- type: TYPES.BG_IMG,
885
- src: this.data.posterData.poster_url,
886
- x:0,
887
- y:0,
888
- width:POSTER_WIDTH,
889
- height:POSTER_HEIGHT
890
- },
891
- {
892
- label: 'avatar',
893
- type: TYPES.IMG,
894
- x: POSTER_WIDTH / 2 - 160 / 2,
895
- y: 25,
896
- width: 160,
897
- height: 160,
898
- src: this.data.userInfo.wx_avatar,
899
- border: 80
900
- },
901
- {
902
- label: 'nickname',
903
- type: TYPES.TEXT,
904
- y: 200,
905
- value: this.data.userInfo.wx_nickname,
906
- size: 44,
907
- fontWeight: 'bold',
908
- color: 'white',
909
- maxWidth: 600,
910
- textOverflow: 'ellipsis',
911
- textAlign: "center"
912
- },
913
- {
914
- label: 'sharePrompt',
915
- type: TYPES.TEXT,
916
- y: 260,
917
- value: this.data.shareHint,
918
- size:40,
919
- color: 'white',
920
- textAlign:"center"
921
- },
922
- {
923
- label: 'resourceAdditionalBackground',
924
- type: TYPES.IMG,
925
- x: 34,
926
- y: 804,
927
- width: 684,
928
- height: 184,
929
- src: this.data.posterData.goods_add_bg
930
- },
931
- {
932
- label: 'resourcePic',
933
- type: TYPES.IMG,
934
- x: POSTER_WIDTH / 2 - 640 / 2,
935
- y: 324,
936
- width: 640,
937
- height: 640 * 0.75,
938
- src: this.data.resource_info.img_url,
939
- imgRoundType:'halfRoundRect'
940
- },
941
- {
942
- label: 'resourceTitle',
943
- type: TYPES.TEXT,
944
- x: 66,
945
- y: 840,
946
- value: this.data.resource_info.title,
947
- size: 32,
948
- fontWeight: 'bold',
949
- color: 'black',
950
- maxWidth: 600,
951
- textOverflow: 'ellipsis'
952
- },
953
- this.data.resourceLinePrice && {
954
- ...linePriceProps,
955
- x: POSTER_WIDTH - poster.getTextRect(linePriceProps).width - LINE_PRICE_MARGIN_RIGHT,
956
- y: 900
957
- },
958
- ...this.getResourcePrice(66, 900, '#fd0300',poster),
959
- {
960
- label: 'qrcode',
961
- type: TYPES.IMG,
962
- x: POSTER_WIDTH / 2 - 144 / 2,
963
- y: 1026,
964
- width: 144,
965
- height: 144,
966
- src: this.data.resource_info.qr_code
967
- },
968
- {
969
- label: 'shopNameLabel',
970
- type: TYPES.SHAPE,
971
- x: POSTER_WIDTH - shopNameRect.width - 77 - LABEL_PADDING,
972
- y: shopNameProps.y - LABEL_PADDING,
973
- r: 8,
974
- width: shopNameRect.width + 2 * LABEL_PADDING,
975
- height: 40,
976
- shape: 'diagonalRoundRect',
977
- color: '#FA6A4A'
978
- },
979
- {
980
- ...shopNameProps,
981
- x: POSTER_WIDTH - shopNameRect.width - 77
982
- }
983
- ];
984
- if (this.data.resource_info.activityLabel) {
985
- const activityTitleProps = {
986
- label: 'activityTitle',
987
- type: TYPES.TEXT,
988
- x: 240,
989
- y: 890,
990
- value: this.data.resource_info.activityLabel,
991
- fontSize: 32,
992
- fontWeight: 'bold',
993
- color: 'white',
994
- maxWidth: 500,
995
- textOverflow: 'ellipsis'
996
- };
997
- const activityTitleRect = poster.getTextRect(activityTitleProps);
998
-
999
- posterConfigArr.concat([activityTitleProps,{
1000
- label: 'activityLabel',
1001
- type: TYPES.SHAPE,
1002
- x: 240 - LABEL_PADDING,
1003
- y: activityTitleProps.y - LABEL_PADDING,
1004
- r: 12,
1005
- width: activityTitleRect.width + 2 * LABEL_PADDING,
1006
- height: 40,
1007
- shape: 'fullRoundRect',
1008
- color: '#FA6A48'
1009
- }]);
1010
- }
1011
- return posterConfigArr;
1012
- },
1013
- drawInteractOnePoster(poster) {
1014
- const shopNameProps = {
1015
- label: 'shopName',
1016
- type: TYPES.TEXT,
1017
- y: 414,
1018
- value: this.data.posterData.shop_name,
1019
- size: 32,
1020
- fontWeight: 'bold',
1021
- color: 'white',
1022
- maxWidth: 500
1023
- };
1024
- const shopNameRect = poster.getTextRect(shopNameProps);
1025
- const LABEL_PADDING = 4;
1026
- return [
1027
- {
1028
- label: 'posterBg',
1029
- type: TYPES.BG_IMG,
1030
- src: this.data.posterData.poster_url,
1031
- x:0,
1032
- y:0,
1033
- width:POSTER_WIDTH,
1034
- height:POSTER_HEIGHT
1035
- },
1036
- {
1037
- label: 'avatar',
1038
- type: TYPES.IMG,
1039
- x: POSTER_WIDTH / 2 - 160 / 2,
1040
- y: 35,
1041
- width: 160,
1042
- height: 160,
1043
- src: this.data.userInfo.wx_avatar,
1044
- border: 80
1045
- },
1046
- {
1047
- label: 'nickname',
1048
- type: TYPES.TEXT,
1049
- y: 220,
1050
- value: this.data.userInfo.wx_nickname,
1051
- size: 44,
1052
- fontWeight: 'bold',
1053
- color: 'white',
1054
- maxWidth: 600,
1055
- textOverflow: 'ellipsis',
1056
- textAlign: "center"
1057
- },
1058
- {
1059
- label: 'sharePrompt',
1060
- type: TYPES.TEXT,
1061
- y: 280,
1062
- value: this.data.shareHint,
1063
- size: 40,
1064
- color: 'white',
1065
- textAlign: "center"
1066
- },
1067
- {
1068
- label: 'resourceTitle',
1069
- type: TYPES.TEXT,
1070
- x: 66,
1071
- y: 908,
1072
- value: this.data.resource_info.title,
1073
- size: 32,
1074
- fontWeight: 'normal',
1075
- color: 'black',
1076
- maxWidth: 620,
1077
- textAlign: "center",
1078
- textOverflow: 'wrap',
1079
- lineHeight: 48
1080
- },
1081
- {
1082
- label: 'resourcePic',
1083
- type: TYPES.IMG,
1084
- x: POSTER_WIDTH / 2 - 640 / 2,
1085
- y: 392,
1086
- width: 640,
1087
- height: 640 * 0.75,
1088
- src: this.data.resource_info.img_url,
1089
- imgRoundType:'fullRoundRect',
1090
- },
1091
- {
1092
- label: 'qrcode',
1093
- type: TYPES.IMG,
1094
- x: POSTER_WIDTH / 2 - 180 / 2,
1095
- y: 1016,
1096
- width: 180,
1097
- height: 180,
1098
- src: this.data.resource_info.qr_code
1099
- },
1100
- {
1101
- label: 'scanPrompt',
1102
- type: TYPES.TEXT,
1103
- x: POSTER_WIDTH / 2 - 144 / 2,
1104
- y: 1208,
1105
- value: '长按扫码查看详情',
1106
- size: 22,
1107
- fontWeight: 'normal',
1108
- color: 'black',
1109
- textAlign: "center"
1110
- },
1111
- {
1112
- label: 'shopNameLabel',
1113
- type: TYPES.SHAPE,
1114
- x: POSTER_WIDTH - shopNameRect.width - 74 - LABEL_PADDING,
1115
- y: shopNameProps.y - LABEL_PADDING,
1116
- r: 8,
1117
- width: shopNameRect.width + 2 * LABEL_PADDING,
1118
- height: 40,
1119
- shape: 'diagonalRoundRect',
1120
- color: '#308EF9'
1121
- },
1122
- {
1123
- ...shopNameProps,
1124
- x: POSTER_WIDTH - shopNameRect.width - 74
1125
- }
1126
- ];
1127
- },
1128
- drawInteractTwoPoster(poster) {
1129
- return [
1130
- {
1131
- label: 'posterBg',
1132
- type: TYPES.BG_IMG,
1133
- src: this.data.posterData.poster_url,
1134
- x:0,
1135
- y:0,
1136
- width:POSTER_WIDTH,
1137
- height:POSTER_HEIGHT
1138
- },
1139
- {
1140
- label: 'avatar',
1141
- type: TYPES.IMG,
1142
- x: 60,
1143
- y: 40,
1144
- width: 160,
1145
- height: 160,
1146
- src: this.data.userInfo.wx_avatar,
1147
- border: 80
1148
- },
1149
- {
1150
- label: 'nickname',
1151
- type: TYPES.TEXT,
1152
- x: 80,
1153
- y: 240,
1154
- value: this.data.userInfo.wx_nickname,
1155
- size: 44,
1156
- fontWeight: 'bold',
1157
- color: 'white',
1158
- maxWidth: 600,
1159
- textOverflow: 'ellipsis'
1160
- },
1161
- {
1162
- label: 'sharePrompt',
1163
- type: TYPES.TEXT,
1164
- x: 80,
1165
- y: 300,
1166
- value: this.data.shareHint,
1167
- size: 40,
1168
- color: 'white'
1169
- },
1170
- {
1171
- label: 'resourceTitle',
1172
- type: TYPES.TEXT,
1173
- x: 80,
1174
- y: 860,
1175
- value: this.data.resource_info.title,
1176
- size: 32,
1177
- fontWeight: 'normal',
1178
- color: 'white',
1179
- maxWidth: 600,
1180
- textOverflow: 'wrap',
1181
- lineHeight:48
1182
- },
1183
- {
1184
- label: 'resourcePic',
1185
- type: TYPES.IMG,
1186
- x: POSTER_WIDTH / 2 - 640 / 2,
1187
- y: 350,
1188
- width: 640,
1189
- height: 640 * 0.75,
1190
- src: this.data.resource_info.img_url,
1191
- imgRoundType:'halfRoundRect',
1192
- },
1193
- {
1194
- label: 'resourceAdditionalBackground',
1195
- type: TYPES.IMG,
1196
- x: POSTER_WIDTH / 2 - 640 / 2,
1197
- y: 830,
1198
- width: 640,
1199
- height: 180,
1200
- src: this.data.posterData.goods_add_bg,
1201
- },
1202
- {
1203
- label: 'shopName',
1204
- type: TYPES.TEXT,
1205
- x: 56,
1206
- y: 1100,
1207
- value: this.data.posterData.shop_name,
1208
- size: 32,
1209
- fontWeight: 'bold',
1210
- color: 'white',
1211
- maxWidth: 440
1212
- },
1213
- {
1214
- label:"whiteLine",
1215
- type:TYPES.SHAPE,
1216
- width:84,
1217
- height:6,
1218
- x:56,
1219
- y:1155,
1220
- r:3,
1221
- color:'white',
1222
- shape:'fullRoundRect'
1223
- },
1224
- {
1225
- label: 'scanPrompt',
1226
- type: TYPES.TEXT,
1227
- x: 56,
1228
- y: 1190,
1229
- value: '长按扫码查看详情',
1230
- size: 32,
1231
- fontWeight: 'bold',
1232
- color: 'white'
1233
- },
1234
- {
1235
- label: 'qrcode',
1236
- type: TYPES.IMG,
1237
- x: 540,
1238
- y: 1070,
1239
- width: 160,
1240
- height: 160,
1241
- src: this.data.resource_info.qr_code
1242
- }
1243
- ];
1244
- },
1245
- drawPriceTwoPoster(poster) {
1246
- const LINE_PRICE_MARGIN_RIGHT = 56;
1247
- const linePriceProps = {
1248
- label: 'resourceLinePrice',
1249
- type: TYPES.TEXT,
1250
- value: this.data.resourceLinePrice,
1251
- size: 32,
1252
- fontWeight: 'bold',
1253
- color: '#777',
1254
- textStyle: 'stroke'
1255
- };
1256
- return[
1257
- {
1258
- label: 'posterBg',
1259
- type: TYPES.BG_IMG,
1260
- src: this.data.posterData.poster_url,
1261
- x:0,
1262
- y:0,
1263
- width:POSTER_WIDTH,
1264
- height:POSTER_HEIGHT
1265
- },
1266
- {
1267
- label: 'avatar',
1268
- type: TYPES.IMG,
1269
- x: 60,
1270
- y: 40,
1271
- width: 160,
1272
- height: 160,
1273
- src: this.data.userInfo.wx_avatar,
1274
- border: 80
1275
- },
1276
- {
1277
- label: 'nickname',
1278
- type: TYPES.TEXT,
1279
- x: 80,
1280
- y: 240,
1281
- value: this.data.userInfo.wx_nickname,
1282
- size: 44,
1283
- fontWeight: 'bold',
1284
- color: 'white',
1285
- maxWidth: 600,
1286
- textOverflow: 'ellipsis'
1287
- },
1288
- {
1289
- label: 'sharePrompt',
1290
- type: TYPES.TEXT,
1291
- x: 80,
1292
- y: 300,
1293
- value: this.data.shareHint,
1294
- size: 40,
1295
- color: 'white'
1296
- },
1297
- {
1298
- label: 'resourceTitle',
1299
- type: TYPES.TEXT,
1300
- x: 80,
1301
- y: 860,
1302
- value: this.data.resource_info.title,
1303
- size: 32,
1304
- fontWeight: 'normal',
1305
- color: 'white',
1306
- maxWidth: 550,
1307
- textOverflow: 'ellipsis'
1308
- },
1309
- {
1310
- label: 'resourcePic',
1311
- type: TYPES.IMG,
1312
- x: POSTER_WIDTH / 2 - 640 / 2,
1313
- y: 350,
1314
- width: 640,
1315
- height: 640 * 0.75,
1316
- src: this.data.resource_info.img_url,
1317
- imgRoundType:'halfRoundRect',
1318
- },
1319
- {
1320
- label: 'resourceAdditionalBackground',
1321
- type: TYPES.IMG,
1322
- x: POSTER_WIDTH / 2 - 640 / 2,
1323
- y: 830,
1324
- width: 640,
1325
- height: 88,
1326
- src: this.data.posterData.goods_add_bg,
1327
- },
1328
- this.data.resourceLinePrice && {
1329
- ...linePriceProps,
1330
- x: POSTER_WIDTH - poster.getTextRect(linePriceProps).width - LINE_PRICE_MARGIN_RIGHT,
1331
- y: 980
1332
- },
1333
- ...this.getResourcePrice(60, 980, '#FA5988',poster),
1334
- {
1335
- label: 'shopName',
1336
- type: TYPES.TEXT,
1337
- x: 56,
1338
- y: 1132,
1339
- value: this.data.posterData.shop_name,
1340
- size: 32,
1341
- fontWeight: 'bold',
1342
- color: 'black',
1343
- maxWidth: 440
1344
- },
1345
- {
1346
- label: 'qrcode',
1347
- type: TYPES.IMG,
1348
- x: 540,
1349
- y: 1100,
1350
- width: 160,
1351
- height: 160,
1352
- src: this.data.resource_info.qr_code
1353
- }
1354
- ];
1355
- },
1356
- drawInteractThreePoster(poster) {
1357
- return [
1358
- {
1359
- label: 'posterBg',
1360
- type: TYPES.BG_IMG,
1361
- src: this.data.posterData.poster_url,
1362
- x:0,
1363
- y:0,
1364
- width:POSTER_WIDTH,
1365
- height:POSTER_HEIGHT
1366
- },
1367
- {
1368
- label: 'avatar',
1369
- type: TYPES.IMG,
1370
- x: 54,
1371
- y: 120,
1372
- width: 160,
1373
- height: 160,
1374
- src: this.data.userInfo.wx_avatar
1375
- },
1376
- {
1377
- label: 'avatarBorder',
1378
- type: TYPES.IMG,
1379
- x: 54,
1380
- y: 120,
1381
- width: 160,
1382
- height: 160,
1383
- src: 'http://wechatapppro-1252524126.file.myqcloud.com/appAKLWLitn7978/image/eafb3f4d43f8101dd2eaff99a149c021.png'
1384
- },
1385
- {
1386
- label: 'nickname',
1387
- type: TYPES.TEXT,
1388
- x: 60,
1389
- y: 320,
1390
- value: this.data.userInfo.wx_nickname,
1391
- size: 44,
1392
- fontWeight: 'bold',
1393
- color: '#FCCD9B',
1394
- maxWidth: 600,
1395
- textOverflow: 'ellipsis'
1396
- },
1397
- {
1398
- label: 'sharePrompt',
1399
- type: TYPES.TEXT,
1400
- x: 60,
1401
- y: 380,
1402
- value: this.data.shareHint,
1403
- size: 40,
1404
- color: '#FCCD9B'
1405
- },
1406
- {
1407
- label: 'resourceTitle',
1408
- type: TYPES.TEXT,
1409
- y: 520,
1410
- value: this.data.resource_info.title,
1411
- size: 32,
1412
- fontWeight: 'normal',
1413
- color: 'black',
1414
- maxWidth: 550,
1415
- textOverflow: 'wrap',
1416
- textAlign: "center",
1417
- lineHeight:48
1418
- },
1419
- {
1420
- label: 'shopName',
1421
- type: TYPES.TEXT,
1422
- y: 800,
1423
- value: this.data.posterData.shop_name,
1424
- size: 32,
1425
- fontWeight: 'bold',
1426
- color: 'black',
1427
- maxWidth: 500,
1428
- textAlign: "center"
1429
- },
1430
- {
1431
- label: 'qrcode',
1432
- type: TYPES.IMG,
1433
- x: POSTER_WIDTH / 2 - 240 / 2,
1434
- y: 850,
1435
- width: 240,
1436
- height: 240,
1437
- src: this.data.resource_info.qr_code
1438
- }
1439
- ];
1440
- },
1441
- drawAlivePoster(poster) {
1442
- const shopNameProps = {
1443
- label: 'shopName',
1444
- type: TYPES.TEXT,
1445
- y: 760,
1446
- value: `来自「${this.data.posterData.shop_name}」`,
1447
- size: 24,
1448
- fontWeight: 'bold',
1449
- color: '#1560F4',
1450
- maxWidth: 340
1451
- };
1452
- return [
1453
- {
1454
- label: 'posterBg',
1455
- type: TYPES.BG_IMG,
1456
- src: this.data.posterData.poster_url,
1457
- x:0,
1458
- y:0,
1459
- width:POSTER_WIDTH,
1460
- height:POSTER_HEIGHT
1461
- },
1462
- {
1463
- label: 'avatar',
1464
- type: TYPES.IMG,
1465
- x: 40,
1466
- y: 40,
1467
- width: 140,
1468
- height: 140,
1469
- src: this.data.userInfo.wx_avatar,
1470
- border: 70
1471
- },
1472
- {
1473
- label: 'nickname',
1474
- type: TYPES.TEXT,
1475
- x: 210,
1476
- y: 70,
1477
- value: this.data.userInfo.wx_nickname,
1478
- size: 48,
1479
- fontWeight: 'bold',
1480
- color: 'black',
1481
- maxWidth: 470,
1482
- textOverflow: 'ellipsis'
1483
- },
1484
- {
1485
- label: 'sharePrompt',
1486
- type: TYPES.TEXT,
1487
- x: 210,
1488
- y: 130,
1489
- value: this.data.shareHint,
1490
- size: 36,
1491
- color: 'black'
1492
- },
1493
- {
1494
- label: 'resourcePic',
1495
- type: TYPES.IMG,
1496
- x: POSTER_WIDTH / 2 - 700 / 2,
1497
- y: 200,
1498
- width: 700,
1499
- height: 700 * 0.75,
1500
- src: this.data.resource_info.img_url,
1501
- imgRoundType:'fullRoundRect',
1502
- },
1503
- {
1504
- label: 'resourceTitle',
1505
- type: TYPES.TEXT,
1506
- x: 40,
1507
- y: 840,
1508
- value: this.data.resource_info.title,
1509
- size: 40,
1510
- fontWeight: 'bold',
1511
- color: 'black',
1512
- maxWidth: 664,
1513
- textOverflow: 'wrap',
1514
- lineHeight: 48
1515
- },
1516
- {
1517
- ...shopNameProps,
1518
- x: POSTER_WIDTH - poster.getTextRect(shopNameProps).width - 20
1519
- },
1520
- {
1521
- label: 'aliveStartTime',
1522
- type: TYPES.TEXT,
1523
- x: 88,
1524
- y: 1148,
1525
- value: this.data.resource_info.zb_start_at,
1526
- size: 30,
1527
- fontWeight: 'bold',
1528
- color: '#3B4C6E'
1529
- },
1530
- {
1531
- label: 'scanPrompt',
1532
- type: TYPES.TEXT,
1533
- x: 512,
1534
- y: 1240,
1535
- value: '长按扫码查看详情',
1536
- size: 24,
1537
- fontWeight: 'bold',
1538
- color: 'black'
1539
- },
1540
- {
1541
- label: 'qrcode',
1542
- type: TYPES.IMG,
1543
- x: 510,
1544
- y: 1020,
1545
- width: 200,
1546
- height: 200,
1547
- imgRoundType:'fullRoundRect',
1548
- src: this.data.resource_info.qr_code
1549
- }
1550
- ];
1551
- },
1552
- drawAliveGeneralPoster(poster) {
1553
- console.log(this,'this??????????');
1554
- const nicknameProps = {
1555
- label: 'nickname',
1556
- type: TYPES.TEXT,
1557
- x: 140,
1558
- y: 712,
1559
- value: this.data.userInfo.wx_nickname,
1560
- size: 32,
1561
- fontWeight: 'normal',
1562
- color: '#777',
1563
- maxWidth: 300,
1564
- textOverflow: 'ellipsis'
1565
- };
1566
- return [
1567
- {
1568
- label: 'posterBg',
1569
- type: TYPES.BG_IMG,
1570
- src: this.data.posterData.poster_url,
1571
- x:0,
1572
- y:0,
1573
- width:POSTER_WIDTH,
1574
- height:POSTER_HEIGHT
1575
- },
1576
- {
1577
- label: 'avatar',
1578
- type: TYPES.IMG,
1579
- x: 40,
1580
- y: 680,
1581
- width: 80,
1582
- height: 80,
1583
- src: this.data.userInfo.wx_avatar,
1584
- border: 40
1585
- },
1586
- nicknameProps,
1587
- {
1588
- label: 'sharePrompt',
1589
- type: TYPES.TEXT,
1590
- x: 160 + poster.getTextRect(nicknameProps).width,
1591
- y: 712,
1592
- value: this.data.shareHint,
1593
- size: 32,
1594
- color: '#777'
1595
- },
1596
- {
1597
- label: 'resourcePic',
1598
- type: TYPES.IMG,
1599
- x: POSTER_WIDTH / 2 - 750 / 2,
1600
- y: 0,
1601
- width: 750,
1602
- height: 750 * 0.75,
1603
- src: this.data.resource_info.img_url,
1604
- imgRoundType: 'top'
1605
- },
1606
- {
1607
- label: 'resourceTitle',
1608
- type: TYPES.TEXT,
1609
- x: 40,
1610
- y: 860,
1611
- value: this.data.resource_info.title,
1612
- size: 36,
1613
- fontWeight: 'bold',
1614
- color: 'black',
1615
- maxWidth: 680,
1616
- textOverflow: 'wrap',
1617
- lineHeight: 48
1618
- },
1619
- {
1620
- label: 'shopName',
1621
- type: TYPES.TEXT,
1622
- x: 40,
1623
- y: 1000,
1624
- value: `- ${this.data.posterData.shop_name}`,
1625
- size: 30,
1626
- fontWeight: 'normal',
1627
- color: '#777',
1628
- maxWidth: 500
1629
- },
1630
- {
1631
- label: 'scanPrompt',
1632
- type: TYPES.TEXT,
1633
- y: 1230,
1634
- value: '长按扫码查看详情',
1635
- size: 20,
1636
- fontWeight: 'normal',
1637
- color: '#777',
1638
- textAlign: "center"
1639
- },
1640
- {
1641
- label: 'qrcode',
1642
- type: TYPES.IMG,
1643
- x: 750 / 2 - 140 / 2,
1644
- y: 1070,
1645
- width: 140,
1646
- height: 140,
1647
- imgRoundType:'fullRoundRect',
1648
- src: this.data.resource_info.qr_code
1649
- }
1650
- ];
1651
- },
1652
- drawAliveSpecificPoster() {
1653
- return [
1654
- {
1655
- label: 'posterBg',
1656
- type: TYPES.BG_IMG,
1657
- src: this.data.posterData.poster_url,
1658
- x:0,
1659
- y:0,
1660
- width:POSTER_WIDTH,
1661
- height:POSTER_HEIGHT
1662
- },
1663
- {
1664
- label: 'avatar',
1665
- type: TYPES.IMG,
1666
- x: 40,
1667
- y: 730,
1668
- width: 80,
1669
- height: 80,
1670
- src: this.data.userInfo.wx_avatar,
1671
- border: 40
1672
- },
1673
- {
1674
- label: 'nickname',
1675
- type: TYPES.TEXT,
1676
- x: 140,
1677
- y: 748,
1678
- value: this.data.userInfo.wx_nickname,
1679
- size: 28,
1680
- fontWeight: 'bold',
1681
- color: '#3B4C6E',
1682
- maxWidth: 400,
1683
- textOverflow: 'ellipsis'
1684
- },
1685
- {
1686
- label: 'sharePrompt',
1687
- type: TYPES.TEXT,
1688
- x: 140,
1689
- y: 782,
1690
- value: this.data.shareHint,
1691
- size: 24,
1692
- color: '#3B4C6E'
1693
- },
1694
- {
1695
- label: 'resourcePic',
1696
- type: TYPES.IMG,
1697
- x: POSTER_WIDTH / 2 - 720 / 2,
1698
- y: 134,
1699
- width: 720,
1700
- height: 720 * 0.75,
1701
- src: this.data.resource_info.img_url,
1702
- imgRoundType:'fullRoundRect',
1703
- },
1704
- {
1705
- label: 'aliveStartTime',
1706
- type: TYPES.TEXT,
1707
- x: 56,
1708
- y: 1048,
1709
- value: this.data.resource_info.zb_start_at,
1710
- size: 28,
1711
- fontWeight: 'bold',
1712
- color: '#3B4C6E'
1713
- },
1714
- {
1715
- label: 'scanPrompt',
1716
- type: TYPES.TEXT,
1717
- x: 510,
1718
- y: 1160,
1719
- value: '长按扫码查看详情',
1720
- size: 24,
1721
- fontWeight: 'bold',
1722
- color: '#3B4C6E'
1723
- },
1724
- {
1725
- label: 'qrcode',
1726
- type: TYPES.IMG,
1727
- x: 500,
1728
- y: 930,
1729
- width: 220,
1730
- height: 220,
1731
- roundRectType: 'full',
1732
- borderRadius: 12,
1733
- src: this.data.resource_info.qr_code
1734
- }
1735
- ];
1736
- },
1737
- drawStudyPoster(poster) {
1738
- const motiveTextProps = {
1739
- label: 'motiveText',
1740
- type: TYPES.TEXT,
1741
- x: 80,
1742
- y: 510,
1743
- value: this.data.motiveInfoData.text,
1744
- size: 32,
1745
- color: 'black',
1746
- lineHeight: 48,
1747
- maxWidth: 590,
1748
- textOverflow: 'wrap' // wrap ellipsis
1749
- };
1750
- const motiveTextAuthorProps = {
1751
- label: 'motiveTextAuthor',
1752
- type: TYPES.TEXT,
1753
- value: `—— ${this.data.motiveInfoData.auther}`,
1754
- size: 32,
1755
- color: 'black',
1756
- maxWidth: 600
1757
- };
1758
- const motiveTextAuthorRect = poster.getTextRect(motiveTextAuthorProps);
1759
- const motiveTextRect = poster.getTextRect(motiveTextProps);
1760
- return [{
1761
- label: 'posterBg',
1762
- type: TYPES.BG_IMG,
1763
- src: this.data.posterData.poster_url,
1764
- x:0,
1765
- y:0,
1766
- width:POSTER_WIDTH,
1767
- height:POSTER_HEIGHT
1768
- },
1769
- {
1770
- label: 'avatar',
1771
- type: TYPES.IMG,
1772
- x: 122,
1773
- y: 256,
1774
- width: 160,
1775
- height: 160,
1776
- src: this.data.userInfo.wx_avatar,
1777
- border: 80
1778
- },
1779
- {
1780
- label: 'nickname',
1781
- type: TYPES.TEXT,
1782
- x: 320,
1783
- y: 280,
1784
- value: this.data.userInfo.wx_nickname,
1785
- size: 44,
1786
- fontWeight: 'bold',
1787
- color: 'black',
1788
- maxWidth: 280,
1789
- textOverflow: 'ellipsis'
1790
- },
1791
- {
1792
- label: 'sharePrompt',
1793
- type: TYPES.TEXT,
1794
- x: 320,
1795
- y: 340,
1796
- value: this.data.shareHint,
1797
- size: 40,
1798
- color: 'black'
1799
- },
1800
- motiveTextProps,
1801
- {
1802
- label: 'resourceTitle',
1803
- type: TYPES.TEXT,
1804
- x: 80,
1805
- y: 800,
1806
- value: this.data.resource_info.title,
1807
- size: 36,
1808
- fontWeight: 'normal',
1809
- color: 'black',
1810
- maxWidth: 590,
1811
- textOverflow: 'ellipsis'
1812
- },
1813
- {
1814
- label: 'qrcode',
1815
- type: TYPES.IMG,
1816
- x: POSTER_WIDTH / 2 - 168 / 2,
1817
- y: 928,
1818
- width: 168,
1819
- height: 168,
1820
- src: this.data.resource_info.qr_code
1821
- },
1822
- {
1823
- label: 'scanPrompt',
1824
- type: TYPES.TEXT,
1825
- x: 0,
1826
- y: 1110,
1827
- value: '长按扫码查看详情',
1828
- size: 24,
1829
- fontWeight: 'bold',
1830
- color: 'black',
1831
- textAlign: "center"
1832
- },
1833
- {
1834
- label: 'shopName',
1835
- type: TYPES.TEXT,
1836
- y: 898,
1837
- value: this.data.posterData.shop_name,
1838
- size: 32,
1839
- fontWeight: 'bold',
1840
- color: 'black',
1841
- maxWidth: 590,
1842
- textAlign: "center"
1843
- },
1844
- {
1845
- ...motiveTextAuthorProps,
1846
- x: POSTER_WIDTH - motiveTextAuthorRect.width - 80,
1847
- y: 500 + motiveTextRect.height
1848
- }
1849
- ];
1850
- },
1851
- // 换一条励志语
1852
- changeRecTxt() {
1853
- let temInfo = this.data.motiveInfo || [];
1854
- let random = Math.floor(Math.random() * temInfo.length);
1855
- this.data.motiveInfoData = temInfo[random] || {};
1856
- this.data.motiveInfoData.id = `study_${random}`;
1857
- this.setData({
1858
- isVisible : true
1859
- })
1860
- this.generatePoster(random);
1861
- },
1862
- }
1
+ import objToPoster from '../createPoster/index'
2
+ import { posterInfo } from '../libs/positionMap';
3
+ import { TYPES,POSTER_CLS, } from '../libs/constant';
4
+ const computedBehavior = require('miniprogram-computed').behavior;
5
+ const POSTER_WIDTH = 750;
6
+ const POSTER_HEIGHT = 1344;
7
+
8
+ let ID = 0
9
+
10
+ Component({
11
+ behaviors: [computedBehavior],
12
+ /**
13
+ * 组件的属性列表
14
+ */
15
+ /**
16
+ * 组件的属性列表
17
+ */
18
+ properties: {
19
+ isSinglePoster: {
20
+ type: Boolean,
21
+ value: false
22
+ },
23
+ motiveInfo: {
24
+ type: Array,
25
+ value: () => {
26
+ return [];
27
+ }
28
+ },
29
+ posterItem: {
30
+ type: Object,
31
+ value: () => {},
32
+ },
33
+ promotionInfo:{
34
+ type: Object,
35
+ value: () => {
36
+ return {};
37
+ }
38
+ },
39
+ showPopup:{
40
+ type: Boolean,
41
+ value: false
42
+ }
43
+ },
44
+ observers: {
45
+ posterItem(newData) {
46
+ if(Object.getOwnPropertyNames(newData).length){
47
+ this.setData({
48
+ isVisible :true,
49
+ posterItemData:newData,
50
+ posterStyle:newData.default_poster_mark
51
+ })
52
+ }
53
+ if(Object.getOwnPropertyNames(newData).length && Object.getOwnPropertyNames(this.properties.promotionInfo).length && this.properties.promotionInfo.resource_info.qr_code.includes("myqcloud")){
54
+ if(this.properties.showPopup){
55
+ this.generatePoster(15);
56
+ }
57
+ }
58
+ },
59
+ promotionInfo(newData){
60
+ if(Object.getOwnPropertyNames(newData).length && newData.resource_info.qr_code.includes("myqcloud") && Object.getOwnPropertyNames(this.properties.posterItem).length){
61
+ if(this.properties.showPopup){
62
+ this.generatePoster(15);
63
+ }
64
+ }
65
+ },
66
+ },
67
+ lifetimes: {
68
+ attached(){
69
+ var app = getApp()
70
+ app.globalData[`poster${ID++}`] = this
71
+ },
72
+ ready(){
73
+ this.cleanUpWxFileSystemMemory(2);
74
+ }
75
+ },
76
+ /**
77
+ * 组件的初始数据
78
+ */
79
+ data: {
80
+ imgSrc:'',
81
+ imageUrl:'',
82
+ isVisible:true,
83
+ posterMapInfo: posterInfo,
84
+ motiveInfoData:{"text":"世上没有任何伟业的成就能够离得开激情。","auther":"黑格尔"},
85
+ shareAddInfo:{},
86
+ posterObj:{},
87
+ isSwitchBtnShow:false,
88
+ posterItemData:{},
89
+ posterStyle:"",
90
+ defaultAvatarUrl: 'https://wechatavator-1252524126.cos.ap-shanghai.myqcloud.com/dasda.jpg',
91
+ },
92
+ computed:{
93
+ posterData(data) {
94
+ let temInfo = data.posterItemData;
95
+ let defaultPoster = data.posterMapInfo[data.posterItemData.default_poster_mark];
96
+ temInfo = {...data.posterItemData, ...defaultPoster};
97
+ console.log(temInfo,'teninfo');
98
+ return temInfo;
99
+ },
100
+ // 根据不同商品类型展示不同邀请文案
101
+ shareHint(data) {
102
+ let resType = data.promotionInfo && data.promotionInfo.resource_info && data.promotionInfo.resource_info.resource_type;
103
+ let shareTxt = '';
104
+ if (data.posterData.is_default === 1) {
105
+ switch (resType) {
106
+ case 2:
107
+ shareTxt = '邀请你一起收听';
108
+ break;
109
+ case 4:
110
+ shareTxt = '邀请你一起观看';
111
+ break;
112
+ case 20:
113
+ shareTxt = '邀请你一起阅读';
114
+ break;
115
+ case 21:
116
+ shareTxt = '邀请你一起购买';
117
+ break;
118
+ case 31:
119
+ case 29:
120
+ case 25:
121
+ case 35:
122
+ shareTxt = '邀请你一起参加';
123
+ break;
124
+ default:
125
+ shareTxt = '邀请你一起学习';
126
+ break;
127
+ }
128
+ }
129
+
130
+ return shareTxt;
131
+ },
132
+ userInfo(data) {
133
+ return data.promotionInfo.user_info || { wx_avatar: '', wx_nickname: '' };
134
+ },
135
+ // posterStyle(data) {
136
+ // return data.posterData && data.posterData.default_poster_mark || "";
137
+ // },
138
+ showGoods(data) {
139
+ let showGood = data.posterData.is_show_goods;
140
+ if (data.posterStyle !== POSTER_CLS.USER_CUSTOM) {
141
+ showGood = data.posterData.goods_position;
142
+ }
143
+ return showGood;
144
+ },
145
+ showGoodsImg(data) {
146
+ let showImg = true;
147
+ if (data.posterData.is_default === 1) {
148
+ showImg = data.posterData.show_goods_img;
149
+ }
150
+ return showImg;
151
+ },
152
+ showFinger(data) {
153
+ return data.posterData.qr_code_type === 1 && data.posterData.is_default === 0;
154
+ },
155
+ resource_info(data) {
156
+ return data.promotionInfo && data.promotionInfo.resource_info;
157
+ },
158
+ isShowPrice(data) {
159
+ let showPrcie = true;
160
+ let payment_type = data.resource_info && data.resource_info.payment_type || 2; //仅关联不展示价格
161
+ if (data.posterStyle !== POSTER_CLS.USER_CUSTOM) {
162
+ showPrcie = data.posterData.has_price_info;
163
+ } else {
164
+ showPrcie = data.posterData.is_show_price && payment_type != 3;
165
+ }
166
+ return showPrcie;
167
+ },
168
+ activityLable(data) {
169
+ return data.resource_info && data.resource_info.activity_label || '';
170
+ },
171
+ zbStartAt(data) {
172
+ return data.resource_info && data.resource_info.zb_start_at && data.resource_info.zb_start_at.split(' ');
173
+ },
174
+ resourceLinePrice(data) {
175
+ return data.resource_info && data.resource_info.line_price ? String((data.resource_info.line_price / 100).toFixed(2)) : '';
176
+ }
177
+ },
178
+
179
+ /**
180
+ * 组件的方法列表
181
+ */
182
+ methods: {
183
+ getPosterData() {
184
+ let temInfo = this.data.posterItemData;
185
+ let defaultPoster = this.data.posterMapInfo[this.data.posterItemData.default_poster_mark];
186
+ temInfo = {...this.data.posterItemData, ...defaultPoster};
187
+ return temInfo;
188
+ },
189
+ // 价格的 单位、整数、小数部分字体大小不同,需分别绘制再拼接
190
+ // x,y 表示起始位置
191
+ getResourcePrice(x, y, color,poster) {
192
+ const { price } = this.data.resource_info;
193
+ if (price === 0) {
194
+ return [
195
+ {
196
+ label: 'free',
197
+ type: "font",
198
+ x,
199
+ y,
200
+ value: '免费',
201
+ size: 40,
202
+ color
203
+ }
204
+ ];
205
+ }
206
+ const [priceInt, priceFloat] = String((price / 100).toFixed(2)).split('.');
207
+ const unitProps = {
208
+ label: 'priceUnit',
209
+ type: "font",
210
+ x,
211
+ y,
212
+ value: '¥',
213
+ size: 40,
214
+ fontWeight: 'normal',
215
+ color
216
+ };
217
+ const MARGIN_RIGHT = 8;
218
+ const priceIntProps = {
219
+ label: 'priceInt',
220
+ type: "font",
221
+ x: x + poster.getTextRect(unitProps).width + MARGIN_RIGHT,
222
+ y: y - 10,
223
+ value: priceInt,
224
+ size: 60,
225
+ fontWeight: 'normal',
226
+ color
227
+ };
228
+ const priceFloatProps = {
229
+ label: 'priceFloat',
230
+ type: "font",
231
+ x:
232
+ x +
233
+ poster.getTextRect(priceIntProps).width +
234
+ poster.getTextRect(unitProps).width +
235
+ MARGIN_RIGHT,
236
+ y,
237
+ value: `.${priceFloat}`,
238
+ size: 40,
239
+ fontWeight: 'normal',
240
+ color
241
+ };
242
+ return [unitProps, priceIntProps, priceFloatProps];
243
+ },
244
+ // 实际渲染的价格包含三个部分:整数、小数点、小数点后两位
245
+ getResourcePriceRect(poster) {
246
+ const [unitProps, priceIntProps, priceFloatProps] = this.getResourcePrice(0, 0, 'black',poster);
247
+ const unitTextRect = poster.getTextRect(unitProps);
248
+ const priceIntTextRect = poster.getTextRect(priceIntProps);
249
+ const priceFloatTextRect = poster.getTextRect(priceFloatProps);
250
+ return {
251
+ width: unitTextRect.width + priceIntTextRect.width + priceFloatTextRect.width,
252
+ height: Math.max(unitTextRect.height, priceIntTextRect.height, priceFloatTextRect.height)
253
+ };
254
+ },
255
+ generatePoster(random){
256
+ const that = this
257
+ this.triggerEvent('drawPosterBegin');
258
+ new objToPoster(POSTER_WIDTH,POSTER_HEIGHT,1,this).initCanvas(this,1).then(res=>{
259
+ this.posterObj = this.getPosterConfig(res);
260
+ return this.posterObj && res.convertToImg(this.posterObj)
261
+ }).then(response=>{
262
+ if(response){
263
+ this.cleanUpWxFileSystemMemory(43);
264
+ this.getWxFilesListAndWriteFile(response,random);
265
+ }
266
+ })
267
+ },
268
+ getImageSrc(response) {
269
+ console.log('getImageSrc: ', response)
270
+ this.setData({
271
+ imgSrc: response,
272
+ imageUrl: response,
273
+ isVisible: false
274
+ },()=>{
275
+
276
+ console.log('imageUrl', this.data.imageUrl)
277
+ })
278
+ },
279
+ getWxFilesListAndWriteFile(response,random){
280
+ let that = this;
281
+ const fs = wx.getFileSystemManager();
282
+ fs.readdir({
283
+ dirPath: wx.env.USER_DATA_PATH,
284
+ success(res) {
285
+ //res.files为存入的列表路径
286
+ let filesList = res.files;
287
+ let isOtherPosterExist = false;
288
+ let isStudyPosterExist = false;
289
+ if(filesList.length>2){
290
+ isStudyPosterExist = that.data.posterStyle === POSTER_CLS.STUDY && filesList.some(item=>{
291
+ let num = +(item.replace(/[^0-9]/ig,""))
292
+ return num === random && item.includes(that.data.posterStyle)
293
+ })
294
+ isOtherPosterExist = that.data.posterStyle !== POSTER_CLS.STUDY && filesList.some(item=>{
295
+ return item.includes(that.data.posterStyle)
296
+ })
297
+ if(!(isStudyPosterExist || isOtherPosterExist)){
298
+ that.wxWriteFile(response,random)
299
+ }else{
300
+ if(isStudyPosterExist){
301
+ that.setData({
302
+ imageUrl:wx.env.USER_DATA_PATH + '/'+ that.data.posterStyle + random +'.png'
303
+ })
304
+ }else if(isOtherPosterExist){
305
+ that.setData({
306
+ imageUrl:wx.env.USER_DATA_PATH + '/'+ that.data.posterData.id +'.png'
307
+ })
308
+ }
309
+ let isShow = that.data.posterData && that.data.posterData.default_poster_mark === POSTER_CLS.STUDY;
310
+ that.setData({
311
+ isSwitchBtnShow: isShow,
312
+ isVisible: false
313
+ })
314
+ that.triggerEvent('drawPosterFulfilled');
315
+ }
316
+ }else{
317
+ that.wxWriteFile(response,random)
318
+ }
319
+ }
320
+ })
321
+ },
322
+ cleanUpWxFileSystemMemory(n){
323
+ const fs = wx.getFileSystemManager();
324
+ fs.readdir({
325
+ dirPath: wx.env.USER_DATA_PATH,
326
+ success(res) {
327
+ //res.files为存入的列表路径
328
+ let indexVal = res.files.length;
329
+ //由于微信本地存储超过10M时,写入文件失败,10M大概是43张海报的内存,所以大于42时,清除垃圾文件,再写入
330
+ if(indexVal>n){
331
+ res.files.forEach((el) => {
332
+ let name = (wx.env.USER_DATA_PATH+el).replace(/usr/g, "usr/");
333
+ fs.unlink({
334
+ filePath:name,
335
+ fail(e) {
336
+ console.log('文件删除失败:', e)
337
+ },
338
+ success(succ){
339
+ console.log('文件删除成功:', succ);
340
+ }
341
+ })
342
+ })
343
+ }
344
+ }
345
+ })
346
+ },
347
+ wxWriteFile(response,random){
348
+ const fs = wx.getFileSystemManager();
349
+ //随机定义路径名称
350
+ let codeimg =this.data.posterStyle === POSTER_CLS.STUDY ? wx.env.USER_DATA_PATH + '/' + this.data.posterStyle + random + '.png': wx.env.USER_DATA_PATH + '/' + this.data.posterData.id + '.png';
351
+ //将base64图片写入
352
+ fs.writeFile({
353
+ filePath: codeimg,
354
+ data: response.slice(22),
355
+ encoding: 'base64',
356
+ success: (res) => {
357
+ //写入成功了的话,新的图片路径就能用了
358
+ console.log(res)
359
+ console.log("codeimg: ",codeimg)
360
+ // this.imgSrc=codeimg;
361
+ this.setData({
362
+ imageUrl:codeimg
363
+ })
364
+ let isShow = this.data.posterData && this.data.posterData.default_poster_mark === POSTER_CLS.STUDY;
365
+ this.setData({
366
+ isSwitchBtnShow:isShow
367
+ })
368
+ this.triggerEvent('drawPosterFulfilled');
369
+ },
370
+ fail:(error)=>{
371
+ console.log(error);
372
+ }
373
+ })
374
+ },
375
+ getPosterConfig(poster){
376
+ const drawPosterFnMaps = {
377
+ [POSTER_CLS.USER_CUSTOM]: this.drawUserCustomPoster,
378
+ [POSTER_CLS.STUDY]: this.drawStudyPoster,
379
+ [POSTER_CLS.PRICE_ONE]: this.drawPriceOnePoster,
380
+ [POSTER_CLS.INTERACT_ONE]: this.drawInteractOnePoster,
381
+ [POSTER_CLS.INTERACT_TWO]: this.drawInteractTwoPoster,
382
+ [POSTER_CLS.PRICE_TWO]: this.drawPriceTwoPoster,
383
+ [POSTER_CLS.INTERACT_THREE]: this.drawInteractThreePoster,
384
+ [POSTER_CLS.ENTITY]: this.drawEntityPoster,
385
+ [POSTER_CLS.ALIVE]: this.drawAlivePoster,
386
+ [POSTER_CLS.ALIVE_GENERAL]: this.drawAliveGeneralPoster,
387
+ [POSTER_CLS.ALIVE_SPECIFIC]: this.drawAliveSpecificPoster
388
+ };
389
+ console.log(this.data.posterStyle,'this.data.posterStyle')
390
+ if(!this.data.posterStyle){
391
+ return
392
+ }
393
+ const drawFn = drawPosterFnMaps[this.data.posterStyle].bind(this);
394
+ if (!drawFn) {
395
+ console.warn('未知的海报类型', this.data.posterStyle);
396
+ return;
397
+ }
398
+ let posterConfigObj = drawFn(poster);
399
+ return posterConfigObj;
400
+ },
401
+ // 绘制自定义海报
402
+ // 自定义海报的 头像、昵称、二维码,是否展示、位置、宽高都是取的接口数据。
403
+ // 其中 二维码类型需要单独区分 并计算位置和宽高
404
+ // 条件渲染约定的值比较混乱
405
+ drawUserCustomPoster(poster) {
406
+ const isShowAvatar = [1, 2].includes(this.data.posterData.is_show_avatar); // 1和2 展示
407
+ const isShowNickname = [1, 2].includes(this.data.posterData.is_show_nickname); // 1和2 展示
408
+ const isShowGoods = this.data.posterData.is_show_goods === 1;
409
+ const isShowPrice = this.data.posterData.is_show_price === 1;
410
+ const isHideQrcode = this.data.posterData.qr_code_type === 2; // 0和1 展示
411
+ const isShowFingerprints = this.data.posterData.is_show_fingerprints === 1; // 0和2 不展示
412
+
413
+
414
+ const LINE_PRICE_MARGIN_RIGHT = 80;
415
+ const linePriceProps = {
416
+ label: 'resourceLinePrice',
417
+ type: TYPES.TEXT,
418
+ value: this.data.resourceLinePrice,
419
+ size: 32,
420
+ fontWeight: 'bold',
421
+ color: '#777',
422
+ textStyle: 'stroke'
423
+ };
424
+
425
+ // 部分公共数据提取出来,包含:背景图、价格、划线价、资源图、标题
426
+ const commonWidgets = [
427
+ {
428
+ label: 'posterBg',
429
+ type: TYPES.BG_IMG,
430
+ src: this.data.posterData.poster_url,
431
+ x:0,
432
+ y:0,
433
+ width:POSTER_WIDTH,
434
+ height:POSTER_HEIGHT
435
+ },
436
+ isShowGoods && isShowPrice &&
437
+ this.data.resourceLinePrice && {
438
+ ...linePriceProps,
439
+ x: POSTER_WIDTH - poster.getTextRect(linePriceProps).width - LINE_PRICE_MARGIN_RIGHT,
440
+ y: 830
441
+ },
442
+ ...(isShowGoods && isShowPrice ? this.getResourcePrice(88, 830, '#FE8946',poster) : []),
443
+ isShowGoods && {
444
+ label: 'goodsName',
445
+ type: TYPES.TEXT,
446
+ x: 88,
447
+ y: !isShowPrice ? 826 : 890,
448
+ value: this.data.resource_info.title,
449
+ size: 32,
450
+ fontWeight: 'normal',
451
+ color: 'black',
452
+ maxWidth: 550,
453
+ textOverflow: 'ellipsis'
454
+ },
455
+ isShowGoods && {
456
+ label: 'goodsImg',
457
+ type: TYPES.IMG,
458
+ imgRoundType:'halfRoundRect',
459
+ src: this.data.resource_info && this.data.resource_info.img_url,
460
+ x: POSTER_WIDTH / 2 - 640 / 2,
461
+ y: 310,
462
+ width: 640,
463
+ height: 640 * 0.75,
464
+ },
465
+ isShowGoods && {
466
+ label: 'resourceAdditionalBackground',
467
+ type: TYPES.SHAPE,
468
+ width: 640,
469
+ height: !isShowPrice ? 100 : 180,
470
+ x: POSTER_WIDTH / 2 - 640 / 2,
471
+ y: 790,
472
+ r:20,
473
+ color: 'white',
474
+ shape:'bottomRoundRect',
475
+ }
476
+ ];
477
+
478
+ // 新老数据逻辑上分开渲染,方便后续维护
479
+ const isNewDataSource = Boolean(
480
+ this.data.posterData.qrcode_size && this.data.posterData.avatar_size && this.data.posterData.nickname_size
481
+ );
482
+
483
+ console.log('isNewDataSource: ', isNewDataSource);
484
+ if (isNewDataSource) {
485
+ // 昵称最长不超出海报边界
486
+ // 省略号...约等于一个字的宽度
487
+ const NICKNAME_MARGIN_RIGHT = this.data.posterData.nickname_size.size;
488
+ let nicknameMaxWidth = 400;
489
+ if (this.data.posterData.is_show_avatar === 1) {
490
+ const centralPoint = this.data.posterData.avatar_position.x + this.data.posterData.avatar_size.w / 2;
491
+ nicknameMaxWidth = 2 * Math.min(POSTER_WIDTH - centralPoint, centralPoint) - NICKNAME_MARGIN_RIGHT*2;
492
+ }
493
+ if (this.data.posterData.is_show_avatar === 2) {
494
+ nicknameMaxWidth = POSTER_WIDTH - this.data.posterData.nickname_position.x - NICKNAME_MARGIN_RIGHT;
495
+ }
496
+ const nicknameProps = {
497
+ label: 'nickname',
498
+ type: TYPES.TEXT,
499
+ value: this.data.userInfo.wx_nickname,
500
+ size: this.data.posterData.nickname_size.size,
501
+ fontWeight: 'normal',
502
+ color: this.data.posterData.nickname_color === 1 ? 'black' : 'white', // 0 | 1 | 2
503
+ maxWidth: nicknameMaxWidth,
504
+ textOverflow: 'ellipsis'
505
+ };
506
+ const nicknameRect = poster.getTextRect(nicknameProps);
507
+ let nicknameX = this.data.posterData.nickname_position.x;
508
+ // is_show_avatar === 1 时,昵称相对于头像 居中展示
509
+ if (this.data.posterData.is_show_avatar === 1) {
510
+ nicknameX =
511
+ this.data.posterData.avatar_position.x + this.data.posterData.avatar_size.w / 2 - nicknameRect.width / 2;
512
+ }
513
+ return [
514
+ ...commonWidgets,
515
+ isShowNickname && {
516
+ ...nicknameProps,
517
+ x: nicknameX,
518
+ y: this.data.posterData.nickname_position.y,
519
+ },
520
+ isShowAvatar && {
521
+ label: 'avatar',
522
+ type: TYPES.IMG,
523
+ src: this.data.userInfo.wx_avatar,
524
+ x: this.data.posterData.avatar_position.x,
525
+ y: this.data.posterData.avatar_position.y,
526
+ width: this.data.posterData.avatar_size.w,
527
+ height: this.data.posterData.avatar_size.h,
528
+ border:this.data.posterData.avatar_size.w
529
+ },
530
+ // 二维码和指纹宽高 需单独计算
531
+ // 已知:二维码 和 指纹宽高一致,且能拿到整体宽高 qrcode_size.x qrcode_size.y
532
+ // 间隙需动态调整
533
+ isHideQrcode || {
534
+ label: 'qrcode',
535
+ type: TYPES.IMG,
536
+ imgRoundType : 'fullRoundRect',
537
+ src: this.data.resource_info && this.data.resource_info.qr_code,
538
+ x: this.data.posterData && this.data.posterData.qrcode_position && this.data.posterData.qrcode_position.x,
539
+ y: this.data.posterData && this.data.posterData.qrcode_position && this.data.posterData.qrcode_position.y,
540
+ width: this.data.posterData.qrcode_size.h,
541
+ height: this.data.posterData.qrcode_size.h,
542
+ },
543
+ isShowFingerprints && {
544
+ label: 'fingerprint',
545
+ type: TYPES.IMG,
546
+ // 新数据 fingerprint_position 废弃不用
547
+ x:
548
+ this.data.posterData.qrcode_position.x +
549
+ this.data.posterData.qrcode_size.w -
550
+ this.data.posterData.qrcode_size.h,
551
+ // 注意:顶部和二维码对齐,这里是之前已有的逻辑(由于fingerprint_position和qrcode_position数据y不一致,直接采用二维码的y值定位)
552
+ y: this.data.posterData.qrcode_position.y,
553
+ width: this.data.posterData.qrcode_size.h,
554
+ height: this.data.posterData.qrcode_size.h,
555
+ src: 'http://wechatapppro-1252524126.file.myqcloud.com/appAKLWLitn7978/image/859093d21aee5d46f4a58d3842f81d0d.png'
556
+ }
557
+ ];
558
+ } else {
559
+ // 注意:以下代码为兼容海报旧数据(已废弃)的特殊逻辑。
560
+ // 由于旧数据及其不准确,之前是前端对错误的数据进行兜底特殊处理,几乎无法维护。
561
+ // 以下逻辑完全照搬旧代码,非必要勿动。
562
+ const NICKNAME_MARGIN_RIGHT = 36;
563
+ const nicknameProps = {
564
+ label: 'nickname',
565
+ type: TYPES.TEXT,
566
+ x: this.data.posterData.nickname_position.x,
567
+ y: this.data.posterData.nickname_position.y,
568
+ value: this.data.userInfo.wx_nickname,
569
+ size: 32,
570
+ fontWeight: 'normal',
571
+ color: this.data.posterData.nickname_color === 1 ? 'black' : 'white', // 0 | 1 | 2
572
+ textOverflow: 'ellipsis'
573
+ };
574
+ const nicknameRect = poster.getTextRect(nicknameProps);
575
+ let nicknameX = this.data.posterData.nickname_position.x;
576
+ let nicknameY = this.data.posterData.nickname_position.y;
577
+ let align = this.data.posterData.nickname_position.align || 'left';
578
+ if (align === 'center') {
579
+ nicknameX = nicknameX - nicknameRect.width / 2;
580
+ }
581
+ // 由于b端自定义海报时,昵称距离海报边框有距离,所以如果left小于/等于18,则left取值为18
582
+ nicknameX = Math.max(18, nicknameX);
583
+ nicknameY = nicknameY - nicknameRect.height / 4;
584
+ return [
585
+ ...commonWidgets,
586
+ isShowNickname && {
587
+ ...nicknameProps,
588
+ x: nicknameX,
589
+ y: nicknameY,
590
+ maxWidth: POSTER_WIDTH - nicknameX - NICKNAME_MARGIN_RIGHT
591
+ },
592
+ isShowAvatar && {
593
+ label: 'avatar',
594
+ type: TYPES.IMG,
595
+ x: this.data.posterData.avatar_position.x,
596
+ y: this.data.posterData.avatar_position.y-10,
597
+ width: 90,
598
+ height: 90,
599
+ src: this.data.userInfo.wx_avatar,
600
+ border:90
601
+ },
602
+ isHideQrcode || {
603
+ label: 'qrcode',
604
+ type: TYPES.IMG,
605
+ imgRoundType : 'fullRoundRect',
606
+ x: this.data.posterData && this.data.posterData.qrcode_position && this.data.posterData.qrcode_position.x,
607
+ y: this.data.posterData && this.data.posterData.qrcode_position && this.data.posterData.qrcode_position.y,
608
+ width: 150,
609
+ height: 150,
610
+ src: this.data.resource_info && this.data.resource_info.qr_code,
611
+ },
612
+ isShowFingerprints && {
613
+ label: 'fingerprint',
614
+ type: TYPES.IMG,
615
+ x: this.data.posterData.fingerprint_position.x,
616
+ y: this.data.posterData.fingerprint_position.y,
617
+ width: 140,
618
+ height: 140,
619
+ src: 'http://wechatapppro-1252524126.file.myqcloud.com/appAKLWLitn7978/image/859093d21aee5d46f4a58d3842f81d0d.png'
620
+ }
621
+ ];
622
+ }
623
+ },
624
+ //实物商品只有一张海报的场景
625
+ drawEntityPoster(poster) {
626
+ const LABEL_PADDING = 16;
627
+ const LINE_PRICE_MARGIN_LEFT = 120;
628
+ const shopNameProps = {
629
+ label: 'shopName',
630
+ type: TYPES.TEXT,
631
+ y: 196,
632
+ value: this.data.posterData.shop_name,
633
+ size: 30,
634
+ fontWeight: 'normal',
635
+ color: 'white',
636
+ maxWidth: 500
637
+ };
638
+ const shopNameRect = poster.getTextRect(shopNameProps);
639
+ const linePriceProps = {
640
+ label: 'resourceLinePrice',
641
+ type: TYPES.TEXT,
642
+ value: this.data.resourceLinePrice,
643
+ size: 32,
644
+ fontWeight: 'bold',
645
+ color: '#777',
646
+ textStyle: 'stroke'
647
+ };
648
+ return [{
649
+ label: 'posterBg',
650
+ type: TYPES.BG_IMG,
651
+ src: this.data.posterData.poster_url,
652
+ x:0,
653
+ y:0,
654
+ width:POSTER_WIDTH,
655
+ height:POSTER_HEIGHT
656
+ },
657
+ {
658
+ label: 'avatar',
659
+ type: TYPES.IMG,
660
+ x: 48,
661
+ y: 32,
662
+ width: 100,
663
+ height: 100,
664
+ src: this.data.userInfo.wx_avatar,
665
+ border: 50
666
+ },
667
+ {
668
+ label: 'nickname',
669
+ type: TYPES.TEXT,
670
+ x: 170,
671
+ y: 48,
672
+ value: this.data.userInfo.wx_nickname,
673
+ size: 36,
674
+ fontWeight: 'bold',
675
+ color: 'black',
676
+ maxWidth: 500,
677
+ textOverflow: 'ellipsis'
678
+ },
679
+ {
680
+ label: 'sharePrompt',
681
+ type: TYPES.TEXT,
682
+ x: 170,
683
+ y: 96,
684
+ value: this.data.shareHint,
685
+ size: 28,
686
+ color: '#444'
687
+ },
688
+ {
689
+ label: 'goodsImg',
690
+ type: TYPES.IMG,
691
+ imgRoundType : 'fullRoundRect',
692
+ src: this.data.resource_info.img_url,
693
+ x: POSTER_WIDTH / 2 - 620 / 2,
694
+ y: 180,
695
+ width: 620,
696
+ height: 620
697
+ },
698
+ {
699
+ label: 'goodsName',
700
+ type: TYPES.TEXT,
701
+ x: 80,
702
+ y: 950,
703
+ value: this.data.resource_info.title,
704
+ size: 32,
705
+ fontWeight: 'normal',
706
+ color: 'black',
707
+ maxWidth: 600,
708
+ textOverflow: 'wrap',
709
+ lineHeight:48
710
+ },
711
+ {
712
+ label: 'shopNameLabel',
713
+ type: TYPES.SHAPE,
714
+ x: POSTER_WIDTH - shopNameRect.width - 82 - LABEL_PADDING*2,
715
+ y: shopNameProps.y - LABEL_PADDING/2-4,
716
+ r: 4,
717
+ width: shopNameRect.width + 2 * LABEL_PADDING,
718
+ height: shopNameProps.size + LABEL_PADDING/2,
719
+ shape:'diagonalRoundRect',
720
+ color: '#FD822B'
721
+ },
722
+ {
723
+ ...shopNameProps,
724
+ x: POSTER_WIDTH - shopNameRect.width - 80
725
+ },
726
+ this.data.resourceLinePrice && {
727
+ ...linePriceProps,
728
+ x: this.getResourcePriceRect(poster).width + LINE_PRICE_MARGIN_LEFT,
729
+ y: 884
730
+
731
+ },
732
+ ...this.getResourcePrice(80, 880, '#FD822B',poster),
733
+ {
734
+ label: 'qrcode',
735
+ type: TYPES.IMG,
736
+ src: this.data.resource_info.qr_code,
737
+ x: 80,
738
+ y: 1080,
739
+ width: 160,
740
+ height: 160,
741
+ }
742
+ ];
743
+ },
744
+ // drawStudyPoster(poster) {
745
+ // const motiveTextProps = {
746
+ // label: 'motiveText',
747
+ // type: TYPES.TEXT,
748
+ // x: 80,
749
+ // y: 510,
750
+ // value: this.data.motiveInfoData.text,
751
+ // size: 32,
752
+ // color: 'black',
753
+ // lineHeight: 48,
754
+ // maxWidth: 590,
755
+ // textOverflow: 'wrap' // wrap ellipsis
756
+ // };
757
+ // const motiveTextAuthorProps = {
758
+ // label: 'motiveTextAuthor',
759
+ // type: TYPES.TEXT,
760
+ // value: `—— ${this.data.motiveInfoData.auther}`,
761
+ // size: 32,
762
+ // color: 'black',
763
+ // maxWidth: 600
764
+ // };
765
+ // const motiveTextAuthorRect = poster.getTextRect(motiveTextAuthorProps);
766
+ // const motiveTextRect = poster.getTextRect(motiveTextProps);
767
+ // return [{
768
+ // label: 'posterBg',
769
+ // type: TYPES.BG_IMG,
770
+ // src: this.data.posterData.poster_url,
771
+ // x:0,
772
+ // y:0,
773
+ // width:POSTER_WIDTH,
774
+ // height:POSTER_HEIGHT
775
+ // },
776
+ // {
777
+ // label: 'avatar',
778
+ // type: TYPES.IMG,
779
+ // x: 122,
780
+ // y: 256,
781
+ // width: 160,
782
+ // height: 160,
783
+ // src: this.data.userInfo.wx_avatar,
784
+ // border: 80
785
+ // },
786
+ // {
787
+ // label: 'nickname',
788
+ // type: TYPES.TEXT,
789
+ // x: 320,
790
+ // y: 280,
791
+ // value: this.data.userInfo.wx_nickname,
792
+ // size: 44,
793
+ // fontWeight: 'bold',
794
+ // color: 'black',
795
+ // maxWidth: 280,
796
+ // textOverflow: 'ellipsis'
797
+ // },
798
+ // {
799
+ // label: 'sharePrompt',
800
+ // type: TYPES.TEXT,
801
+ // x: 320,
802
+ // y: 340,
803
+ // value: this.data.shareHint,
804
+ // size: 40,
805
+ // color: 'black'
806
+ // },
807
+ // motiveTextProps,
808
+ // {
809
+ // label: 'resourceTitle',
810
+ // type: TYPES.TEXT,
811
+ // x: 80,
812
+ // y: 800,
813
+ // value: this.data.resource_info.title,
814
+ // size: 36,
815
+ // fontWeight: 'normal',
816
+ // color: 'black',
817
+ // maxWidth: 590,
818
+ // textOverflow: 'ellipsis'
819
+ // },
820
+ // // {
821
+ // // label: 'qrcode',
822
+ // // type: TYPES.IMG,
823
+ // // x: POSTER_WIDTH / 2 - 168 / 2,
824
+ // // y: 928,
825
+ // // width: 168,
826
+ // // height: 168,
827
+ // // src: this.data.resource_info.qr_code
828
+ // // },
829
+ // {
830
+ // label: 'scanPrompt',
831
+ // type: TYPES.TEXT,
832
+ // x: 0,
833
+ // y: 1110,
834
+ // value: '长按扫码查看详情',
835
+ // size: 24,
836
+ // fontWeight: 'bold',
837
+ // color: 'black',
838
+ // textAlign: "center"
839
+ // },
840
+ // {
841
+ // label: 'shopName',
842
+ // type: TYPES.TEXT,
843
+ // y: 898,
844
+ // value: this.data.posterData.shop_name,
845
+ // size: 32,
846
+ // fontWeight: 'bold',
847
+ // color: 'black',
848
+ // maxWidth: 590,
849
+ // textAlign: "center"
850
+ // },
851
+ // {
852
+ // ...motiveTextAuthorProps,
853
+ // x: POSTER_WIDTH - motiveTextAuthorRect.width - 80,
854
+ // y: 500 + motiveTextRect.height
855
+ // }
856
+ // ];
857
+ // },
858
+ drawPriceOnePoster(poster) {
859
+ const shopNameProps = {
860
+ label: 'shopName',
861
+ type: TYPES.TEXT,
862
+ y: 346,
863
+ value: this.data.posterData.shop_name,
864
+ size: 32,
865
+ fontWeight: 'bold',
866
+ color: 'white',
867
+ maxWidth: 500
868
+ };
869
+ const shopNameRect = poster.getTextRect(shopNameProps);
870
+ const LABEL_PADDING = 4;
871
+ const LINE_PRICE_MARGIN_RIGHT = 56;
872
+ const linePriceProps = {
873
+ label: 'resourceLinePrice',
874
+ type: TYPES.TEXT,
875
+ value: this.data.resourceLinePrice,
876
+ size: 32,
877
+ fontWeight: 'bold',
878
+ color: '#777',
879
+ textStyle: 'stroke'
880
+ };
881
+ let posterConfigArr = [
882
+ {
883
+ label: 'posterBg',
884
+ type: TYPES.BG_IMG,
885
+ src: this.data.posterData.poster_url,
886
+ x:0,
887
+ y:0,
888
+ width:POSTER_WIDTH,
889
+ height:POSTER_HEIGHT
890
+ },
891
+ {
892
+ label: 'avatar',
893
+ type: TYPES.IMG,
894
+ x: POSTER_WIDTH / 2 - 160 / 2,
895
+ y: 25,
896
+ width: 160,
897
+ height: 160,
898
+ src: this.data.userInfo.wx_avatar,
899
+ border: 80
900
+ },
901
+ {
902
+ label: 'nickname',
903
+ type: TYPES.TEXT,
904
+ y: 200,
905
+ value: this.data.userInfo.wx_nickname,
906
+ size: 44,
907
+ fontWeight: 'bold',
908
+ color: 'white',
909
+ maxWidth: 600,
910
+ textOverflow: 'ellipsis',
911
+ textAlign: "center"
912
+ },
913
+ {
914
+ label: 'sharePrompt',
915
+ type: TYPES.TEXT,
916
+ y: 260,
917
+ value: this.data.shareHint,
918
+ size:40,
919
+ color: 'white',
920
+ textAlign:"center"
921
+ },
922
+ {
923
+ label: 'resourceAdditionalBackground',
924
+ type: TYPES.IMG,
925
+ x: 34,
926
+ y: 804,
927
+ width: 684,
928
+ height: 184,
929
+ src: this.data.posterData.goods_add_bg
930
+ },
931
+ {
932
+ label: 'resourcePic',
933
+ type: TYPES.IMG,
934
+ x: POSTER_WIDTH / 2 - 640 / 2,
935
+ y: 324,
936
+ width: 640,
937
+ height: 640 * 0.75,
938
+ src: this.data.resource_info.img_url,
939
+ imgRoundType:'halfRoundRect'
940
+ },
941
+ {
942
+ label: 'resourceTitle',
943
+ type: TYPES.TEXT,
944
+ x: 66,
945
+ y: 840,
946
+ value: this.data.resource_info.title,
947
+ size: 32,
948
+ fontWeight: 'bold',
949
+ color: 'black',
950
+ maxWidth: 600,
951
+ textOverflow: 'ellipsis'
952
+ },
953
+ this.data.resourceLinePrice && {
954
+ ...linePriceProps,
955
+ x: POSTER_WIDTH - poster.getTextRect(linePriceProps).width - LINE_PRICE_MARGIN_RIGHT,
956
+ y: 900
957
+ },
958
+ ...this.getResourcePrice(66, 900, '#fd0300',poster),
959
+ {
960
+ label: 'qrcode',
961
+ type: TYPES.IMG,
962
+ x: POSTER_WIDTH / 2 - 144 / 2,
963
+ y: 1026,
964
+ width: 144,
965
+ height: 144,
966
+ src: this.data.resource_info.qr_code
967
+ },
968
+ {
969
+ label: 'shopNameLabel',
970
+ type: TYPES.SHAPE,
971
+ x: POSTER_WIDTH - shopNameRect.width - 77 - LABEL_PADDING,
972
+ y: shopNameProps.y - LABEL_PADDING,
973
+ r: 8,
974
+ width: shopNameRect.width + 2 * LABEL_PADDING,
975
+ height: 40,
976
+ shape: 'diagonalRoundRect',
977
+ color: '#FA6A4A'
978
+ },
979
+ {
980
+ ...shopNameProps,
981
+ x: POSTER_WIDTH - shopNameRect.width - 77
982
+ }
983
+ ];
984
+ if (this.data.resource_info.activityLabel) {
985
+ const activityTitleProps = {
986
+ label: 'activityTitle',
987
+ type: TYPES.TEXT,
988
+ x: 240,
989
+ y: 890,
990
+ value: this.data.resource_info.activityLabel,
991
+ fontSize: 32,
992
+ fontWeight: 'bold',
993
+ color: 'white',
994
+ maxWidth: 500,
995
+ textOverflow: 'ellipsis'
996
+ };
997
+ const activityTitleRect = poster.getTextRect(activityTitleProps);
998
+
999
+ posterConfigArr.concat([activityTitleProps,{
1000
+ label: 'activityLabel',
1001
+ type: TYPES.SHAPE,
1002
+ x: 240 - LABEL_PADDING,
1003
+ y: activityTitleProps.y - LABEL_PADDING,
1004
+ r: 12,
1005
+ width: activityTitleRect.width + 2 * LABEL_PADDING,
1006
+ height: 40,
1007
+ shape: 'fullRoundRect',
1008
+ color: '#FA6A48'
1009
+ }]);
1010
+ }
1011
+ return posterConfigArr;
1012
+ },
1013
+ drawInteractOnePoster(poster) {
1014
+ const shopNameProps = {
1015
+ label: 'shopName',
1016
+ type: TYPES.TEXT,
1017
+ y: 414,
1018
+ value: this.data.posterData.shop_name,
1019
+ size: 32,
1020
+ fontWeight: 'bold',
1021
+ color: 'white',
1022
+ maxWidth: 500
1023
+ };
1024
+ const shopNameRect = poster.getTextRect(shopNameProps);
1025
+ const LABEL_PADDING = 4;
1026
+ return [
1027
+ {
1028
+ label: 'posterBg',
1029
+ type: TYPES.BG_IMG,
1030
+ src: this.data.posterData.poster_url,
1031
+ x:0,
1032
+ y:0,
1033
+ width:POSTER_WIDTH,
1034
+ height:POSTER_HEIGHT
1035
+ },
1036
+ {
1037
+ label: 'avatar',
1038
+ type: TYPES.IMG,
1039
+ x: POSTER_WIDTH / 2 - 160 / 2,
1040
+ y: 35,
1041
+ width: 160,
1042
+ height: 160,
1043
+ src: this.data.userInfo.wx_avatar,
1044
+ border: 80
1045
+ },
1046
+ {
1047
+ label: 'nickname',
1048
+ type: TYPES.TEXT,
1049
+ y: 220,
1050
+ value: this.data.userInfo.wx_nickname,
1051
+ size: 44,
1052
+ fontWeight: 'bold',
1053
+ color: 'white',
1054
+ maxWidth: 600,
1055
+ textOverflow: 'ellipsis',
1056
+ textAlign: "center"
1057
+ },
1058
+ {
1059
+ label: 'sharePrompt',
1060
+ type: TYPES.TEXT,
1061
+ y: 280,
1062
+ value: this.data.shareHint,
1063
+ size: 40,
1064
+ color: 'white',
1065
+ textAlign: "center"
1066
+ },
1067
+ {
1068
+ label: 'resourceTitle',
1069
+ type: TYPES.TEXT,
1070
+ x: 66,
1071
+ y: 908,
1072
+ value: this.data.resource_info.title,
1073
+ size: 32,
1074
+ fontWeight: 'normal',
1075
+ color: 'black',
1076
+ maxWidth: 620,
1077
+ textAlign: "center",
1078
+ textOverflow: 'wrap',
1079
+ lineHeight: 48
1080
+ },
1081
+ {
1082
+ label: 'resourcePic',
1083
+ type: TYPES.IMG,
1084
+ x: POSTER_WIDTH / 2 - 640 / 2,
1085
+ y: 392,
1086
+ width: 640,
1087
+ height: 640 * 0.75,
1088
+ src: this.data.resource_info.img_url,
1089
+ imgRoundType:'fullRoundRect',
1090
+ },
1091
+ {
1092
+ label: 'qrcode',
1093
+ type: TYPES.IMG,
1094
+ x: POSTER_WIDTH / 2 - 180 / 2,
1095
+ y: 1016,
1096
+ width: 180,
1097
+ height: 180,
1098
+ src: this.data.resource_info.qr_code
1099
+ },
1100
+ {
1101
+ label: 'scanPrompt',
1102
+ type: TYPES.TEXT,
1103
+ x: POSTER_WIDTH / 2 - 144 / 2,
1104
+ y: 1208,
1105
+ value: '长按扫码查看详情',
1106
+ size: 22,
1107
+ fontWeight: 'normal',
1108
+ color: 'black',
1109
+ textAlign: "center"
1110
+ },
1111
+ {
1112
+ label: 'shopNameLabel',
1113
+ type: TYPES.SHAPE,
1114
+ x: POSTER_WIDTH - shopNameRect.width - 74 - LABEL_PADDING,
1115
+ y: shopNameProps.y - LABEL_PADDING,
1116
+ r: 8,
1117
+ width: shopNameRect.width + 2 * LABEL_PADDING,
1118
+ height: 40,
1119
+ shape: 'diagonalRoundRect',
1120
+ color: '#308EF9'
1121
+ },
1122
+ {
1123
+ ...shopNameProps,
1124
+ x: POSTER_WIDTH - shopNameRect.width - 74
1125
+ }
1126
+ ];
1127
+ },
1128
+ drawInteractTwoPoster(poster) {
1129
+ return [
1130
+ {
1131
+ label: 'posterBg',
1132
+ type: TYPES.BG_IMG,
1133
+ src: this.data.posterData.poster_url,
1134
+ x:0,
1135
+ y:0,
1136
+ width:POSTER_WIDTH,
1137
+ height:POSTER_HEIGHT
1138
+ },
1139
+ {
1140
+ label: 'avatar',
1141
+ type: TYPES.IMG,
1142
+ x: 60,
1143
+ y: 40,
1144
+ width: 160,
1145
+ height: 160,
1146
+ src: this.data.userInfo.wx_avatar,
1147
+ border: 80
1148
+ },
1149
+ {
1150
+ label: 'nickname',
1151
+ type: TYPES.TEXT,
1152
+ x: 80,
1153
+ y: 240,
1154
+ value: this.data.userInfo.wx_nickname,
1155
+ size: 44,
1156
+ fontWeight: 'bold',
1157
+ color: 'white',
1158
+ maxWidth: 600,
1159
+ textOverflow: 'ellipsis'
1160
+ },
1161
+ {
1162
+ label: 'sharePrompt',
1163
+ type: TYPES.TEXT,
1164
+ x: 80,
1165
+ y: 300,
1166
+ value: this.data.shareHint,
1167
+ size: 40,
1168
+ color: 'white'
1169
+ },
1170
+ {
1171
+ label: 'resourceTitle',
1172
+ type: TYPES.TEXT,
1173
+ x: 80,
1174
+ y: 860,
1175
+ value: this.data.resource_info.title,
1176
+ size: 32,
1177
+ fontWeight: 'normal',
1178
+ color: 'white',
1179
+ maxWidth: 600,
1180
+ textOverflow: 'wrap',
1181
+ lineHeight:48
1182
+ },
1183
+ {
1184
+ label: 'resourcePic',
1185
+ type: TYPES.IMG,
1186
+ x: POSTER_WIDTH / 2 - 640 / 2,
1187
+ y: 350,
1188
+ width: 640,
1189
+ height: 640 * 0.75,
1190
+ src: this.data.resource_info.img_url,
1191
+ imgRoundType:'halfRoundRect',
1192
+ },
1193
+ {
1194
+ label: 'resourceAdditionalBackground',
1195
+ type: TYPES.IMG,
1196
+ x: POSTER_WIDTH / 2 - 640 / 2,
1197
+ y: 830,
1198
+ width: 640,
1199
+ height: 180,
1200
+ src: this.data.posterData.goods_add_bg,
1201
+ },
1202
+ {
1203
+ label: 'shopName',
1204
+ type: TYPES.TEXT,
1205
+ x: 56,
1206
+ y: 1100,
1207
+ value: this.data.posterData.shop_name,
1208
+ size: 32,
1209
+ fontWeight: 'bold',
1210
+ color: 'white',
1211
+ maxWidth: 440
1212
+ },
1213
+ {
1214
+ label:"whiteLine",
1215
+ type:TYPES.SHAPE,
1216
+ width:84,
1217
+ height:6,
1218
+ x:56,
1219
+ y:1155,
1220
+ r:3,
1221
+ color:'white',
1222
+ shape:'fullRoundRect'
1223
+ },
1224
+ {
1225
+ label: 'scanPrompt',
1226
+ type: TYPES.TEXT,
1227
+ x: 56,
1228
+ y: 1190,
1229
+ value: '长按扫码查看详情',
1230
+ size: 32,
1231
+ fontWeight: 'bold',
1232
+ color: 'white'
1233
+ },
1234
+ {
1235
+ label: 'qrcode',
1236
+ type: TYPES.IMG,
1237
+ x: 540,
1238
+ y: 1070,
1239
+ width: 160,
1240
+ height: 160,
1241
+ src: this.data.resource_info.qr_code
1242
+ }
1243
+ ];
1244
+ },
1245
+ drawPriceTwoPoster(poster) {
1246
+ const LINE_PRICE_MARGIN_RIGHT = 56;
1247
+ const linePriceProps = {
1248
+ label: 'resourceLinePrice',
1249
+ type: TYPES.TEXT,
1250
+ value: this.data.resourceLinePrice,
1251
+ size: 32,
1252
+ fontWeight: 'bold',
1253
+ color: '#777',
1254
+ textStyle: 'stroke'
1255
+ };
1256
+ return[
1257
+ {
1258
+ label: 'posterBg',
1259
+ type: TYPES.BG_IMG,
1260
+ src: this.data.posterData.poster_url,
1261
+ x:0,
1262
+ y:0,
1263
+ width:POSTER_WIDTH,
1264
+ height:POSTER_HEIGHT
1265
+ },
1266
+ {
1267
+ label: 'avatar',
1268
+ type: TYPES.IMG,
1269
+ x: 60,
1270
+ y: 40,
1271
+ width: 160,
1272
+ height: 160,
1273
+ src: this.data.userInfo.wx_avatar,
1274
+ border: 80
1275
+ },
1276
+ {
1277
+ label: 'nickname',
1278
+ type: TYPES.TEXT,
1279
+ x: 80,
1280
+ y: 240,
1281
+ value: this.data.userInfo.wx_nickname,
1282
+ size: 44,
1283
+ fontWeight: 'bold',
1284
+ color: 'white',
1285
+ maxWidth: 600,
1286
+ textOverflow: 'ellipsis'
1287
+ },
1288
+ {
1289
+ label: 'sharePrompt',
1290
+ type: TYPES.TEXT,
1291
+ x: 80,
1292
+ y: 300,
1293
+ value: this.data.shareHint,
1294
+ size: 40,
1295
+ color: 'white'
1296
+ },
1297
+ {
1298
+ label: 'resourceTitle',
1299
+ type: TYPES.TEXT,
1300
+ x: 80,
1301
+ y: 860,
1302
+ value: this.data.resource_info.title,
1303
+ size: 32,
1304
+ fontWeight: 'normal',
1305
+ color: 'white',
1306
+ maxWidth: 550,
1307
+ textOverflow: 'ellipsis'
1308
+ },
1309
+ {
1310
+ label: 'resourcePic',
1311
+ type: TYPES.IMG,
1312
+ x: POSTER_WIDTH / 2 - 640 / 2,
1313
+ y: 350,
1314
+ width: 640,
1315
+ height: 640 * 0.75,
1316
+ src: this.data.resource_info.img_url,
1317
+ imgRoundType:'halfRoundRect',
1318
+ },
1319
+ {
1320
+ label: 'resourceAdditionalBackground',
1321
+ type: TYPES.IMG,
1322
+ x: POSTER_WIDTH / 2 - 640 / 2,
1323
+ y: 830,
1324
+ width: 640,
1325
+ height: 88,
1326
+ src: this.data.posterData.goods_add_bg,
1327
+ },
1328
+ this.data.resourceLinePrice && {
1329
+ ...linePriceProps,
1330
+ x: POSTER_WIDTH - poster.getTextRect(linePriceProps).width - LINE_PRICE_MARGIN_RIGHT,
1331
+ y: 980
1332
+ },
1333
+ ...this.getResourcePrice(60, 980, '#FA5988',poster),
1334
+ {
1335
+ label: 'shopName',
1336
+ type: TYPES.TEXT,
1337
+ x: 56,
1338
+ y: 1132,
1339
+ value: this.data.posterData.shop_name,
1340
+ size: 32,
1341
+ fontWeight: 'bold',
1342
+ color: 'black',
1343
+ maxWidth: 440
1344
+ },
1345
+ {
1346
+ label: 'qrcode',
1347
+ type: TYPES.IMG,
1348
+ x: 540,
1349
+ y: 1100,
1350
+ width: 160,
1351
+ height: 160,
1352
+ src: this.data.resource_info.qr_code
1353
+ }
1354
+ ];
1355
+ },
1356
+ drawInteractThreePoster(poster) {
1357
+ return [
1358
+ {
1359
+ label: 'posterBg',
1360
+ type: TYPES.BG_IMG,
1361
+ src: this.data.posterData.poster_url,
1362
+ x:0,
1363
+ y:0,
1364
+ width:POSTER_WIDTH,
1365
+ height:POSTER_HEIGHT
1366
+ },
1367
+ {
1368
+ label: 'avatar',
1369
+ type: TYPES.IMG,
1370
+ x: 54,
1371
+ y: 120,
1372
+ width: 160,
1373
+ height: 160,
1374
+ src: this.data.userInfo.wx_avatar
1375
+ },
1376
+ {
1377
+ label: 'avatarBorder',
1378
+ type: TYPES.IMG,
1379
+ x: 54,
1380
+ y: 120,
1381
+ width: 160,
1382
+ height: 160,
1383
+ src: 'http://wechatapppro-1252524126.file.myqcloud.com/appAKLWLitn7978/image/eafb3f4d43f8101dd2eaff99a149c021.png'
1384
+ },
1385
+ {
1386
+ label: 'nickname',
1387
+ type: TYPES.TEXT,
1388
+ x: 60,
1389
+ y: 320,
1390
+ value: this.data.userInfo.wx_nickname,
1391
+ size: 44,
1392
+ fontWeight: 'bold',
1393
+ color: '#FCCD9B',
1394
+ maxWidth: 600,
1395
+ textOverflow: 'ellipsis'
1396
+ },
1397
+ {
1398
+ label: 'sharePrompt',
1399
+ type: TYPES.TEXT,
1400
+ x: 60,
1401
+ y: 380,
1402
+ value: this.data.shareHint,
1403
+ size: 40,
1404
+ color: '#FCCD9B'
1405
+ },
1406
+ {
1407
+ label: 'resourceTitle',
1408
+ type: TYPES.TEXT,
1409
+ y: 520,
1410
+ value: this.data.resource_info.title,
1411
+ size: 32,
1412
+ fontWeight: 'normal',
1413
+ color: 'black',
1414
+ maxWidth: 550,
1415
+ textOverflow: 'wrap',
1416
+ textAlign: "center",
1417
+ lineHeight:48
1418
+ },
1419
+ {
1420
+ label: 'shopName',
1421
+ type: TYPES.TEXT,
1422
+ y: 800,
1423
+ value: this.data.posterData.shop_name,
1424
+ size: 32,
1425
+ fontWeight: 'bold',
1426
+ color: 'black',
1427
+ maxWidth: 500,
1428
+ textAlign: "center"
1429
+ },
1430
+ {
1431
+ label: 'qrcode',
1432
+ type: TYPES.IMG,
1433
+ x: POSTER_WIDTH / 2 - 240 / 2,
1434
+ y: 850,
1435
+ width: 240,
1436
+ height: 240,
1437
+ src: this.data.resource_info.qr_code
1438
+ }
1439
+ ];
1440
+ },
1441
+ drawAlivePoster(poster) {
1442
+ const shopNameProps = {
1443
+ label: 'shopName',
1444
+ type: TYPES.TEXT,
1445
+ y: 760,
1446
+ value: `来自「${this.data.posterData.shop_name}」`,
1447
+ size: 24,
1448
+ fontWeight: 'bold',
1449
+ color: '#1560F4',
1450
+ maxWidth: 340
1451
+ };
1452
+ return [
1453
+ {
1454
+ label: 'posterBg',
1455
+ type: TYPES.BG_IMG,
1456
+ src: this.data.posterData.poster_url,
1457
+ x:0,
1458
+ y:0,
1459
+ width:POSTER_WIDTH,
1460
+ height:POSTER_HEIGHT
1461
+ },
1462
+ {
1463
+ label: 'avatar',
1464
+ type: TYPES.IMG,
1465
+ x: 40,
1466
+ y: 40,
1467
+ width: 140,
1468
+ height: 140,
1469
+ src: this.data.userInfo.wx_avatar,
1470
+ border: 70
1471
+ },
1472
+ {
1473
+ label: 'nickname',
1474
+ type: TYPES.TEXT,
1475
+ x: 210,
1476
+ y: 70,
1477
+ value: this.data.userInfo.wx_nickname,
1478
+ size: 48,
1479
+ fontWeight: 'bold',
1480
+ color: 'black',
1481
+ maxWidth: 470,
1482
+ textOverflow: 'ellipsis'
1483
+ },
1484
+ {
1485
+ label: 'sharePrompt',
1486
+ type: TYPES.TEXT,
1487
+ x: 210,
1488
+ y: 130,
1489
+ value: this.data.shareHint,
1490
+ size: 36,
1491
+ color: 'black'
1492
+ },
1493
+ {
1494
+ label: 'resourcePic',
1495
+ type: TYPES.IMG,
1496
+ x: POSTER_WIDTH / 2 - 700 / 2,
1497
+ y: 200,
1498
+ width: 700,
1499
+ height: 700 * 0.75,
1500
+ src: this.data.resource_info.img_url,
1501
+ imgRoundType:'fullRoundRect',
1502
+ },
1503
+ {
1504
+ label: 'resourceTitle',
1505
+ type: TYPES.TEXT,
1506
+ x: 40,
1507
+ y: 840,
1508
+ value: this.data.resource_info.title,
1509
+ size: 40,
1510
+ fontWeight: 'bold',
1511
+ color: 'black',
1512
+ maxWidth: 664,
1513
+ textOverflow: 'wrap',
1514
+ lineHeight: 48
1515
+ },
1516
+ {
1517
+ ...shopNameProps,
1518
+ x: POSTER_WIDTH - poster.getTextRect(shopNameProps).width - 20
1519
+ },
1520
+ {
1521
+ label: 'aliveStartTime',
1522
+ type: TYPES.TEXT,
1523
+ x: 88,
1524
+ y: 1148,
1525
+ value: this.data.resource_info.zb_start_at,
1526
+ size: 30,
1527
+ fontWeight: 'bold',
1528
+ color: '#3B4C6E'
1529
+ },
1530
+ {
1531
+ label: 'scanPrompt',
1532
+ type: TYPES.TEXT,
1533
+ x: 512,
1534
+ y: 1240,
1535
+ value: '长按扫码查看详情',
1536
+ size: 24,
1537
+ fontWeight: 'bold',
1538
+ color: 'black'
1539
+ },
1540
+ {
1541
+ label: 'qrcode',
1542
+ type: TYPES.IMG,
1543
+ x: 510,
1544
+ y: 1020,
1545
+ width: 200,
1546
+ height: 200,
1547
+ imgRoundType:'fullRoundRect',
1548
+ src: this.data.resource_info.qr_code
1549
+ }
1550
+ ];
1551
+ },
1552
+ drawAliveGeneralPoster(poster) {
1553
+ console.log(this,'this??????????');
1554
+ const nicknameProps = {
1555
+ label: 'nickname',
1556
+ type: TYPES.TEXT,
1557
+ x: 140,
1558
+ y: 712,
1559
+ value: this.data.userInfo.wx_nickname,
1560
+ size: 32,
1561
+ fontWeight: 'normal',
1562
+ color: '#777',
1563
+ maxWidth: 300,
1564
+ textOverflow: 'ellipsis'
1565
+ };
1566
+ return [
1567
+ {
1568
+ label: 'posterBg',
1569
+ type: TYPES.BG_IMG,
1570
+ src: this.data.posterData.poster_url,
1571
+ x:0,
1572
+ y:0,
1573
+ width:POSTER_WIDTH,
1574
+ height:POSTER_HEIGHT
1575
+ },
1576
+ {
1577
+ label: 'avatar',
1578
+ type: TYPES.IMG,
1579
+ x: 40,
1580
+ y: 680,
1581
+ width: 80,
1582
+ height: 80,
1583
+ src: this.data.userInfo.wx_avatar,
1584
+ border: 40
1585
+ },
1586
+ nicknameProps,
1587
+ {
1588
+ label: 'sharePrompt',
1589
+ type: TYPES.TEXT,
1590
+ x: 160 + poster.getTextRect(nicknameProps).width,
1591
+ y: 712,
1592
+ value: this.data.shareHint,
1593
+ size: 32,
1594
+ color: '#777'
1595
+ },
1596
+ {
1597
+ label: 'resourcePic',
1598
+ type: TYPES.IMG,
1599
+ x: POSTER_WIDTH / 2 - 750 / 2,
1600
+ y: 0,
1601
+ width: 750,
1602
+ height: 750 * 0.75,
1603
+ src: this.data.resource_info.img_url,
1604
+ imgRoundType: 'top'
1605
+ },
1606
+ {
1607
+ label: 'resourceTitle',
1608
+ type: TYPES.TEXT,
1609
+ x: 40,
1610
+ y: 860,
1611
+ value: this.data.resource_info.title,
1612
+ size: 36,
1613
+ fontWeight: 'bold',
1614
+ color: 'black',
1615
+ maxWidth: 680,
1616
+ textOverflow: 'wrap',
1617
+ lineHeight: 48
1618
+ },
1619
+ {
1620
+ label: 'shopName',
1621
+ type: TYPES.TEXT,
1622
+ x: 40,
1623
+ y: 1000,
1624
+ value: `- ${this.data.posterData.shop_name}`,
1625
+ size: 30,
1626
+ fontWeight: 'normal',
1627
+ color: '#777',
1628
+ maxWidth: 500
1629
+ },
1630
+ {
1631
+ label: 'scanPrompt',
1632
+ type: TYPES.TEXT,
1633
+ y: 1230,
1634
+ value: '长按扫码查看详情',
1635
+ size: 20,
1636
+ fontWeight: 'normal',
1637
+ color: '#777',
1638
+ textAlign: "center"
1639
+ },
1640
+ {
1641
+ label: 'qrcode',
1642
+ type: TYPES.IMG,
1643
+ x: 750 / 2 - 140 / 2,
1644
+ y: 1070,
1645
+ width: 140,
1646
+ height: 140,
1647
+ imgRoundType:'fullRoundRect',
1648
+ src: this.data.resource_info.qr_code
1649
+ }
1650
+ ];
1651
+ },
1652
+ drawAliveSpecificPoster() {
1653
+ return [
1654
+ {
1655
+ label: 'posterBg',
1656
+ type: TYPES.BG_IMG,
1657
+ src: this.data.posterData.poster_url,
1658
+ x:0,
1659
+ y:0,
1660
+ width:POSTER_WIDTH,
1661
+ height:POSTER_HEIGHT
1662
+ },
1663
+ {
1664
+ label: 'avatar',
1665
+ type: TYPES.IMG,
1666
+ x: 40,
1667
+ y: 730,
1668
+ width: 80,
1669
+ height: 80,
1670
+ src: this.data.userInfo.wx_avatar,
1671
+ border: 40
1672
+ },
1673
+ {
1674
+ label: 'nickname',
1675
+ type: TYPES.TEXT,
1676
+ x: 140,
1677
+ y: 748,
1678
+ value: this.data.userInfo.wx_nickname,
1679
+ size: 28,
1680
+ fontWeight: 'bold',
1681
+ color: '#3B4C6E',
1682
+ maxWidth: 400,
1683
+ textOverflow: 'ellipsis'
1684
+ },
1685
+ {
1686
+ label: 'sharePrompt',
1687
+ type: TYPES.TEXT,
1688
+ x: 140,
1689
+ y: 782,
1690
+ value: this.data.shareHint,
1691
+ size: 24,
1692
+ color: '#3B4C6E'
1693
+ },
1694
+ {
1695
+ label: 'resourcePic',
1696
+ type: TYPES.IMG,
1697
+ x: POSTER_WIDTH / 2 - 720 / 2,
1698
+ y: 134,
1699
+ width: 720,
1700
+ height: 720 * 0.75,
1701
+ src: this.data.resource_info.img_url,
1702
+ imgRoundType:'fullRoundRect',
1703
+ },
1704
+ {
1705
+ label: 'aliveStartTime',
1706
+ type: TYPES.TEXT,
1707
+ x: 56,
1708
+ y: 1048,
1709
+ value: this.data.resource_info.zb_start_at,
1710
+ size: 28,
1711
+ fontWeight: 'bold',
1712
+ color: '#3B4C6E'
1713
+ },
1714
+ {
1715
+ label: 'scanPrompt',
1716
+ type: TYPES.TEXT,
1717
+ x: 510,
1718
+ y: 1160,
1719
+ value: '长按扫码查看详情',
1720
+ size: 24,
1721
+ fontWeight: 'bold',
1722
+ color: '#3B4C6E'
1723
+ },
1724
+ {
1725
+ label: 'qrcode',
1726
+ type: TYPES.IMG,
1727
+ x: 500,
1728
+ y: 930,
1729
+ width: 220,
1730
+ height: 220,
1731
+ roundRectType: 'full',
1732
+ borderRadius: 12,
1733
+ src: this.data.resource_info.qr_code
1734
+ }
1735
+ ];
1736
+ },
1737
+ drawStudyPoster(poster) {
1738
+ const motiveTextProps = {
1739
+ label: 'motiveText',
1740
+ type: TYPES.TEXT,
1741
+ x: 80,
1742
+ y: 510,
1743
+ value: this.data.motiveInfoData.text,
1744
+ size: 32,
1745
+ color: 'black',
1746
+ lineHeight: 48,
1747
+ maxWidth: 590,
1748
+ textOverflow: 'wrap' // wrap ellipsis
1749
+ };
1750
+ const motiveTextAuthorProps = {
1751
+ label: 'motiveTextAuthor',
1752
+ type: TYPES.TEXT,
1753
+ value: `—— ${this.data.motiveInfoData.auther}`,
1754
+ size: 32,
1755
+ color: 'black',
1756
+ maxWidth: 600
1757
+ };
1758
+ const motiveTextAuthorRect = poster.getTextRect(motiveTextAuthorProps);
1759
+ const motiveTextRect = poster.getTextRect(motiveTextProps);
1760
+ return [{
1761
+ label: 'posterBg',
1762
+ type: TYPES.BG_IMG,
1763
+ src: this.data.posterData.poster_url,
1764
+ x:0,
1765
+ y:0,
1766
+ width:POSTER_WIDTH,
1767
+ height:POSTER_HEIGHT
1768
+ },
1769
+ {
1770
+ label: 'avatar',
1771
+ type: TYPES.IMG,
1772
+ x: 122,
1773
+ y: 256,
1774
+ width: 160,
1775
+ height: 160,
1776
+ src: this.data.userInfo.wx_avatar,
1777
+ border: 80
1778
+ },
1779
+ {
1780
+ label: 'nickname',
1781
+ type: TYPES.TEXT,
1782
+ x: 320,
1783
+ y: 280,
1784
+ value: this.data.userInfo.wx_nickname,
1785
+ size: 44,
1786
+ fontWeight: 'bold',
1787
+ color: 'black',
1788
+ maxWidth: 280,
1789
+ textOverflow: 'ellipsis'
1790
+ },
1791
+ {
1792
+ label: 'sharePrompt',
1793
+ type: TYPES.TEXT,
1794
+ x: 320,
1795
+ y: 340,
1796
+ value: this.data.shareHint,
1797
+ size: 40,
1798
+ color: 'black'
1799
+ },
1800
+ motiveTextProps,
1801
+ {
1802
+ label: 'resourceTitle',
1803
+ type: TYPES.TEXT,
1804
+ x: 80,
1805
+ y: 800,
1806
+ value: this.data.resource_info.title,
1807
+ size: 36,
1808
+ fontWeight: 'normal',
1809
+ color: 'black',
1810
+ maxWidth: 590,
1811
+ textOverflow: 'ellipsis'
1812
+ },
1813
+ {
1814
+ label: 'qrcode',
1815
+ type: TYPES.IMG,
1816
+ x: POSTER_WIDTH / 2 - 168 / 2,
1817
+ y: 928,
1818
+ width: 168,
1819
+ height: 168,
1820
+ src: this.data.resource_info.qr_code
1821
+ },
1822
+ {
1823
+ label: 'scanPrompt',
1824
+ type: TYPES.TEXT,
1825
+ x: 0,
1826
+ y: 1110,
1827
+ value: '长按扫码查看详情',
1828
+ size: 24,
1829
+ fontWeight: 'bold',
1830
+ color: 'black',
1831
+ textAlign: "center"
1832
+ },
1833
+ {
1834
+ label: 'shopName',
1835
+ type: TYPES.TEXT,
1836
+ y: 898,
1837
+ value: this.data.posterData.shop_name,
1838
+ size: 32,
1839
+ fontWeight: 'bold',
1840
+ color: 'black',
1841
+ maxWidth: 590,
1842
+ textAlign: "center"
1843
+ },
1844
+ {
1845
+ ...motiveTextAuthorProps,
1846
+ x: POSTER_WIDTH - motiveTextAuthorRect.width - 80,
1847
+ y: 500 + motiveTextRect.height
1848
+ }
1849
+ ];
1850
+ },
1851
+ // 换一条励志语
1852
+ changeRecTxt() {
1853
+ let temInfo = this.data.motiveInfo || [];
1854
+ let random = Math.floor(Math.random() * temInfo.length);
1855
+ this.data.motiveInfoData = temInfo[random] || {};
1856
+ this.data.motiveInfoData.id = `study_${random}`;
1857
+ this.setData({
1858
+ isVisible : true
1859
+ })
1860
+ this.generatePoster(random);
1861
+ },
1862
+ }
1863
1863
  })