xiaoe_mp_npm 0.1.13 → 0.1.14

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