PosterUtil.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  1. <?php
  2. namespace common\components;
  3. /**
  4. * 散客分享海报(OSS:poster/blank.png 动态画布 + 水印合成,布局参考快团团)
  5. */
  6. class PosterUtil
  7. {
  8. const BLANK_CANVAS = 'poster/blank.png';
  9. const FONT = 'd3F5LW1pY3JvaGVp';
  10. const POSTER_W = 750;
  11. const CANVAS_PAD_X = 20;
  12. const CANVAS_PAD_Y = 20;
  13. /** 文案每行最多字数(商品名、注意事项) */
  14. const TEXT_CHARS_PER_LINE = 13;
  15. const SLOT_W = 710;
  16. const FOOTER_H = 300;
  17. const IMG_H_MIN = 240;
  18. const IMG_H_MAX = 880;
  19. const TOTAL_H_MAX = 2000;
  20. const CANVAS_COLOR = 'FFFFFF';
  21. const SHOP_LOGO_SIZE = 72;
  22. const SHOP_LOGO_GAP = 12;
  23. const SHOP_TITLE_SIZE = 36;
  24. const SHOP_TITLE_MAX_LEN = 18;
  25. const HEADER_BOTTOM_GAP = 16;
  26. const MID_AFTER_COVER_GAP = 16;
  27. const MID_BLOCK_GAP = 10;
  28. const MID_LINE_GAP = 6;
  29. const MID_NAME_SIZE = 38;
  30. const MID_REMARK_SIZE = 26;
  31. const REMARK_PREFIX = '注意:';
  32. const QR_SIZE = 220;
  33. const QR_PAD_RIGHT = 36;
  34. const QR_PAD_BOTTOM = 32;
  35. /** 价格下方:灰色圆角条 + 文案(布局参考快团团) */
  36. const FOOTER_BUY_HINT = '长按识别小程序购买';
  37. const FOOTER_BUY_HINT_SIZE = 26;
  38. const FOOTER_BUY_HINT_BAR_W = 430;
  39. const FOOTER_BUY_HINT_BAR_H = 56;
  40. const FOOTER_BUY_HINT_BAR_COLOR = 'F2F2F2';
  41. const FOOTER_BUY_HINT_TEXT_PAD_X = 28;
  42. const FOOTER_TEXT_GAP = 12;
  43. const FOOTER_PRICE_SIZE = 56;
  44. /**
  45. * 与 admin/home/me 一致:门店展示名、Logo 对象路径、itemRemark
  46. */
  47. public static function withShopAndRemark(array $options, $shop, $sj, $itemOrRemark = null)
  48. {
  49. $meta = self::resolveShopPosterMeta($shop, $sj);
  50. $options['shopTitle'] = $meta['shopTitle'];
  51. $options['shopLogo'] = $meta['shopLogo'];
  52. if (is_string($itemOrRemark)) {
  53. $options['itemRemark'] = self::filterPosterUtf8Text($itemOrRemark);
  54. } elseif ($itemOrRemark !== null) {
  55. $options['itemRemark'] = self::filterPosterUtf8Text($itemOrRemark->itemRemark ?? '');
  56. } else {
  57. $options['itemRemark'] = self::filterPosterUtf8Text($options['itemRemark'] ?? '');
  58. }
  59. return $options;
  60. }
  61. /**
  62. * hdApp/ghsApp me 页门店标题:sjName·shopName(首店仅 sjName)
  63. */
  64. public static function buildShopDisplayTitle($sjName, $shopName)
  65. {
  66. $sjName = trim((string)$sjName);
  67. $shopName = trim((string)$shopName);
  68. if ($shopName === '' || $shopName === '首店') {
  69. return $sjName;
  70. }
  71. return $sjName . '·' . $shopName;
  72. }
  73. public static function resolveShopPosterMeta($shop, $sj = null)
  74. {
  75. $sjName = '';
  76. if ($shop) {
  77. $sjName = trim((string)($shop->merchantName ?? ''));
  78. }
  79. if ($sj !== null) {
  80. if (is_array($sj)) {
  81. $sjName = trim((string)($sj['name'] ?? $sjName));
  82. } elseif (is_object($sj) && isset($sj->name)) {
  83. $sjName = trim((string)$sj->name);
  84. }
  85. }
  86. $shopName = $shop ? trim((string)($shop->shopName ?? '')) : '';
  87. $title = self::filterPosterUtf8Text(self::buildShopDisplayTitle($sjName, $shopName));
  88. if (mb_strlen($title, 'UTF-8') > self::SHOP_TITLE_MAX_LEN) {
  89. $title = mb_substr($title, 0, self::SHOP_TITLE_MAX_LEN, 'UTF-8') . '…';
  90. }
  91. return [
  92. 'shopTitle' => $title,
  93. 'shopLogo' => self::resolveShopLogoObjectPath($shop),
  94. ];
  95. }
  96. public static function resolveShopLogoObjectPath($shop)
  97. {
  98. $avatar = '';
  99. if ($shop && !empty($shop->avatar)) {
  100. $avatar = $shop->avatar;
  101. }
  102. return imgUtil::normalizeOssObjectPath($avatar);
  103. }
  104. /**
  105. * 海报文案 UTF-8 清洗:剔除非法字节、替换符及常见乱码字符
  106. */
  107. public static function filterPosterUtf8Text($text)
  108. {
  109. $text = trim((string)$text);
  110. if ($text === '') {
  111. return '';
  112. }
  113. if (function_exists('iconv')) {
  114. $fixed = @iconv('UTF-8', 'UTF-8//IGNORE', $text);
  115. if ($fixed !== false) {
  116. $text = $fixed;
  117. }
  118. }
  119. if (function_exists('mb_convert_encoding')) {
  120. $converted = @mb_convert_encoding($text, 'UTF-8', 'UTF-8');
  121. if (is_string($converted) && $converted !== '') {
  122. $text = $converted;
  123. }
  124. }
  125. $text = preg_replace('/[\x{FFFD}\x{FFF0}-\x{FFFF}]/u', '', $text);
  126. $text = preg_replace('/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/u', '', $text);
  127. $text = preg_replace(
  128. '/[^\x{4e00}-\x{9fff}a-zA-Z0-9\s,。、!?:;…·~%()【】\[\]\/\-_+|《》「」\'\"\.#&@\x{3000}-\x{303F}\x{FF01}-\x{FF5E}]/u',
  129. '',
  130. $text
  131. );
  132. $text = trim(preg_replace('/\s+/u', ' ', $text));
  133. return $text;
  134. }
  135. public static function truncateText($text, $maxLen = 14)
  136. {
  137. $text = self::filterPosterUtf8Text($text);
  138. if ($text === '') {
  139. return '';
  140. }
  141. if (mb_strlen($text, 'UTF-8') > $maxLen) {
  142. return mb_substr($text, 0, $maxLen, 'UTF-8') . '…';
  143. }
  144. return $text;
  145. }
  146. /**
  147. * @return array{0:string,1:string}
  148. */
  149. public static function splitPosterTextLines($text, $maxPerLine = self::TEXT_CHARS_PER_LINE)
  150. {
  151. $text = self::filterPosterUtf8Text($text);
  152. if ($text === '') {
  153. return ['', ''];
  154. }
  155. $maxPerLine = (int)$maxPerLine;
  156. if ($maxPerLine < 1) {
  157. $maxPerLine = self::TEXT_CHARS_PER_LINE;
  158. }
  159. $len = mb_strlen($text, 'UTF-8');
  160. if ($len <= $maxPerLine) {
  161. return [$text, ''];
  162. }
  163. $line1 = mb_substr($text, 0, $maxPerLine, 'UTF-8');
  164. $rest = mb_substr($text, $maxPerLine, null, 'UTF-8');
  165. if (mb_strlen($rest, 'UTF-8') <= $maxPerLine) {
  166. return [$line1, $rest];
  167. }
  168. $line2 = mb_substr($rest, 0, $maxPerLine, 'UTF-8') . '…';
  169. return [$line1, $line2];
  170. }
  171. /** @deprecated 兼容旧调用 */
  172. public static function splitPosterNameLines($name, $maxPerLine = self::TEXT_CHARS_PER_LINE)
  173. {
  174. return self::splitPosterTextLines($name, $maxPerLine);
  175. }
  176. public static function buildPosterTwoLineText($text, $maxPerLine = self::TEXT_CHARS_PER_LINE)
  177. {
  178. list($line1, $line2) = self::splitPosterTextLines($text, $maxPerLine);
  179. if ($line2 === '') {
  180. return $line1;
  181. }
  182. return $line1 . "\n" . $line2;
  183. }
  184. /**
  185. * 商品名(图下,最多两行)
  186. */
  187. public static function buildPosterNameText($name, $flowerNum = 0, $subtitle = '')
  188. {
  189. $name = self::filterPosterUtf8Text($name);
  190. $subtitle = self::filterPosterUtf8Text($subtitle);
  191. list($line1, $line2) = self::splitPosterTextLines($name);
  192. $suffix = '';
  193. if ($flowerNum > 0) {
  194. $suffix = ' · ' . (int)$flowerNum . '支';
  195. } elseif (trim((string)$subtitle) !== '') {
  196. $suffix = ' · ' . trim((string)$subtitle);
  197. }
  198. if ($suffix !== '') {
  199. if ($line2 === '') {
  200. $merged = $line1 . $suffix;
  201. if (mb_strlen($merged, 'UTF-8') <= self::TEXT_CHARS_PER_LINE) {
  202. $line1 = $merged;
  203. } else {
  204. $line2 = self::truncateText($suffix, self::TEXT_CHARS_PER_LINE);
  205. }
  206. } else {
  207. $merged = $line2 . $suffix;
  208. $line2 = mb_strlen($merged, 'UTF-8') <= self::TEXT_CHARS_PER_LINE
  209. ? $merged
  210. : self::truncateText($merged, self::TEXT_CHARS_PER_LINE);
  211. }
  212. }
  213. if ($line2 === '') {
  214. return $line1;
  215. }
  216. return $line1 . "\n" . $line2;
  217. }
  218. /**
  219. * 注意事项(图下、名称下,无内容返回空串)
  220. */
  221. public static function buildPosterRemarkText($itemRemark)
  222. {
  223. $itemRemark = self::filterPosterUtf8Text($itemRemark);
  224. if ($itemRemark === '') {
  225. return '';
  226. }
  227. return self::buildPosterTwoLineText(self::REMARK_PREFIX . $itemRemark);
  228. }
  229. private static function countTextLines($text)
  230. {
  231. $text = trim((string)$text);
  232. if ($text === '') {
  233. return 0;
  234. }
  235. return substr_count($text, "\n") + 1;
  236. }
  237. private static function textBlockHeight($lineCount, $fontSize)
  238. {
  239. if ($lineCount <= 0) {
  240. return 0;
  241. }
  242. $lineH = (int)ceil($fontSize * 1.2);
  243. return $lineCount * $lineH + max(0, $lineCount - 1) * self::MID_LINE_GAP;
  244. }
  245. private static function calcMidSectionHeight($nameText, $remarkText)
  246. {
  247. $h = 0;
  248. $nameLines = self::countTextLines($nameText);
  249. if ($nameLines > 0) {
  250. $h += self::MID_AFTER_COVER_GAP + self::textBlockHeight($nameLines, self::MID_NAME_SIZE);
  251. }
  252. $remarkLines = self::countTextLines($remarkText);
  253. if ($remarkLines > 0) {
  254. $h += ($nameLines > 0 ? self::MID_BLOCK_GAP : self::MID_AFTER_COVER_GAP);
  255. $h += self::textBlockHeight($remarkLines, self::MID_REMARK_SIZE);
  256. }
  257. return $h;
  258. }
  259. private static function coverStartY()
  260. {
  261. return self::CANVAS_PAD_Y + self::SHOP_LOGO_SIZE + self::HEADER_BOTTOM_GAP;
  262. }
  263. /**
  264. * 底部左侧(价格+灰条)与右侧太阳码垂直居中对齐
  265. *
  266. * @return array{buyHintBarY:int,buyHintTextY:int,buyHintTextX:int,priceY:int,qrY:int}
  267. */
  268. private static function calcFooterLayout()
  269. {
  270. $qrCenterFromBottom = self::QR_PAD_BOTTOM + (int)(self::QR_SIZE / 2);
  271. $hintBarH = self::FOOTER_BUY_HINT_BAR_H;
  272. $priceH = (int)ceil(self::FOOTER_PRICE_SIZE * 1.3);
  273. $gap = self::FOOTER_TEXT_GAP;
  274. $blockH = $priceH + $gap + $hintBarH;
  275. $buyHintBarY = max(16, $qrCenterFromBottom - (int)($blockH / 2));
  276. $priceY = $buyHintBarY + $hintBarH + $gap;
  277. $textLineH = (int)ceil(self::FOOTER_BUY_HINT_SIZE * 1.2);
  278. $buyHintTextY = $buyHintBarY + (int)(($hintBarH - $textLineH) / 2);
  279. $qrY = max(16, $qrCenterFromBottom - (int)(self::QR_SIZE / 2));
  280. return [
  281. 'buyHintBarY' => $buyHintBarY,
  282. 'buyHintTextY' => $buyHintTextY,
  283. 'buyHintTextX' => self::CANVAS_PAD_X + self::FOOTER_BUY_HINT_TEXT_PAD_X,
  284. 'priceY' => $priceY,
  285. 'qrY' => $qrY,
  286. ];
  287. }
  288. /** OSS 生成灰色圆角底条(无需单独上传底图) */
  289. private static function buildBuyHintBarWatermarkPath()
  290. {
  291. $w = self::FOOTER_BUY_HINT_BAR_W;
  292. $h = self::FOOTER_BUY_HINT_BAR_H;
  293. $r = (int)($h / 2);
  294. return self::BLANK_CANVAS . '?x-oss-process=image/resize,m_pad,w_' . $w . ',h_' . $h
  295. . ',color_' . self::FOOTER_BUY_HINT_BAR_COLOR . '/rounded-corners,r_' . $r;
  296. }
  297. /**
  298. * @return array{imgH:int,totalH:int,scaledH:int,posterW:int,coverY:int,nameY:int,remarkY:int}
  299. */
  300. public static function calcPosterLayout($coverWidth, $coverHeight, array $textOptions = [])
  301. {
  302. $coverWidth = (int)$coverWidth;
  303. $coverHeight = (int)$coverHeight;
  304. $scaledH = 0;
  305. if ($coverWidth > 0 && $coverHeight > 0) {
  306. $scaledH = (int)round($coverHeight * (self::SLOT_W / $coverWidth));
  307. $imgH = max(self::IMG_H_MIN, min(self::IMG_H_MAX, $scaledH));
  308. } else {
  309. $scaledH = self::IMG_H_MIN;
  310. $imgH = self::IMG_H_MIN;
  311. }
  312. $nameText = self::buildPosterNameText(
  313. $textOptions['name'] ?? '',
  314. (int)($textOptions['flowerNum'] ?? 0),
  315. $textOptions['subtitle'] ?? ''
  316. );
  317. $remarkText = self::buildPosterRemarkText($textOptions['itemRemark'] ?? '');
  318. $coverY = self::coverStartY();
  319. $midH = self::calcMidSectionHeight($nameText, $remarkText);
  320. $totalH = $coverY + $imgH + $midH + self::FOOTER_H;
  321. $absoluteMin = self::coverStartY() + self::IMG_H_MIN + self::FOOTER_H;
  322. $totalH = max($absoluteMin, min(self::TOTAL_H_MAX, $totalH));
  323. $nameY = $coverY + $imgH + ($nameText !== '' ? self::MID_AFTER_COVER_GAP : 0);
  324. $remarkY = 0;
  325. if ($remarkText !== '') {
  326. $remarkY = $nameY;
  327. if ($nameText !== '') {
  328. $remarkY += self::textBlockHeight(self::countTextLines($nameText), self::MID_NAME_SIZE);
  329. $remarkY += self::MID_BLOCK_GAP;
  330. } else {
  331. $remarkY = $coverY + $imgH + self::MID_AFTER_COVER_GAP;
  332. }
  333. }
  334. return [
  335. 'imgH' => $imgH,
  336. 'totalH' => $totalH,
  337. 'scaledH' => $scaledH,
  338. 'posterW' => self::POSTER_W,
  339. 'coverY' => $coverY,
  340. 'nameY' => $nameY,
  341. 'remarkY' => $remarkY,
  342. ];
  343. }
  344. private static function buildCoverWatermarkPath($cover, $scaledH)
  345. {
  346. $scaledH = (int)$scaledH;
  347. if ($scaledH > self::IMG_H_MAX) {
  348. return $cover . '?x-oss-process=image/resize,m_fill,w_' . self::SLOT_W . ',h_' . self::IMG_H_MAX . ',limit_0';
  349. }
  350. return $cover . '?x-oss-process=image/resize,m_lfit,w_' . self::SLOT_W . ',limit_0';
  351. }
  352. private static function buildShopLogoWatermarkPath($logoObject)
  353. {
  354. $logoObject = imgUtil::normalizeOssObjectPath($logoObject);
  355. return $logoObject . '?x-oss-process=image/resize,m_fill,h_' . self::SHOP_LOGO_SIZE
  356. . ',w_' . self::SHOP_LOGO_SIZE . ',limit_0';
  357. }
  358. private static function shopTitleY()
  359. {
  360. return self::CANVAS_PAD_Y + (int)((self::SHOP_LOGO_SIZE - self::SHOP_TITLE_SIZE) / 2);
  361. }
  362. public static function buildCanvasBaseUrl($prefix, $totalH)
  363. {
  364. $absoluteMin = self::coverStartY() + self::IMG_H_MIN + self::FOOTER_H;
  365. $totalH = max($absoluteMin, min(self::TOTAL_H_MAX, (int)$totalH));
  366. $process = '?x-oss-process=image/resize,m_pad,w_' . self::POSTER_W . ',h_' . $totalH
  367. . ',color_' . self::CANVAS_COLOR;
  368. return $prefix . self::BLANK_CANVAS . $process;
  369. }
  370. public static function buildHyxhLogoWatermark($mainId)
  371. {
  372. if (!in_array((int)$mainId, [52, 1459, 13495], true)) {
  373. return '';
  374. }
  375. $logo = 'poster/hyxh_ncd_logo.png?x-oss-process=image/resize,m_fill,h_72,w_72';
  376. if ($mainId == 1459) {
  377. $logo = 'poster/hyxh_gcd_logo.png?x-oss-process=image/resize,m_fill,h_72,w_72';
  378. }
  379. if ($mainId == 13495) {
  380. $logo = 'poster/hyxh_hzd_logo.png?x-oss-process=image/resize,m_fill,h_72,w_72';
  381. }
  382. return stringUtil::ossBase64($logo);
  383. }
  384. public static function buildMallGoodsPosterUrl($prefix, array $options)
  385. {
  386. return self::buildMallSharePosterUrl($prefix, $options);
  387. }
  388. public static function buildMallItemPosterUrl($prefix, array $options)
  389. {
  390. return self::buildMallSharePosterUrl($prefix, $options);
  391. }
  392. public static function buildGhsHdItemPosterUrl($prefix, array $options)
  393. {
  394. return self::buildMallSharePosterUrl($prefix, $options);
  395. }
  396. private static function buildMallSharePosterUrl($prefix, array $options)
  397. {
  398. $cover = $options['cover'] ?? '';
  399. $miniCode = $options['miniCode'] ?? '';
  400. $priceText = $options['priceText'] ?? '';
  401. $name = self::filterPosterUtf8Text($options['name'] ?? '');
  402. $mainId = (int)($options['mainId'] ?? 0);
  403. $flowerNum = (int)($options['flowerNum'] ?? 0);
  404. $subtitle = self::filterPosterUtf8Text($options['subtitle'] ?? '');
  405. $itemRemark = self::filterPosterUtf8Text($options['itemRemark'] ?? '');
  406. $shopTitle = self::filterPosterUtf8Text($options['shopTitle'] ?? '');
  407. $shopLogo = trim((string)($options['shopLogo'] ?? ''));
  408. $coverW = (int)($options['coverWidth'] ?? 0);
  409. $coverH = (int)($options['coverHeight'] ?? 0);
  410. if ($coverW <= 0 || $coverH <= 0) {
  411. list($coverW, $coverH) = imgUtil::getOssImageSize($cover, $prefix);
  412. }
  413. $layout = self::calcPosterLayout($coverW, $coverH, [
  414. 'name' => $name,
  415. 'flowerNum' => $flowerNum,
  416. 'subtitle' => $subtitle,
  417. 'itemRemark' => $itemRemark,
  418. ]);
  419. $displayName = self::buildPosterNameText($name, $flowerNum, $subtitle);
  420. $displayRemark = self::buildPosterRemarkText($itemRemark);
  421. $footer = self::calcFooterLayout();
  422. $coverWatermark = self::buildCoverWatermarkPath($cover, $layout['scaledH']);
  423. $qrWatermark = $miniCode . '?x-oss-process=image/resize,m_fill,h_' . self::QR_SIZE . ',w_' . self::QR_SIZE;
  424. $url = self::buildCanvasBaseUrl($prefix, $layout['totalH']);
  425. if ($shopLogo !== '') {
  426. $url .= '/watermark,image_' . stringUtil::ossBase64(self::buildShopLogoWatermarkPath($shopLogo))
  427. . ',g_nw,x_' . self::CANVAS_PAD_X . ',y_' . self::CANVAS_PAD_Y;
  428. }
  429. if ($shopTitle !== '') {
  430. $titleX = self::CANVAS_PAD_X + self::SHOP_LOGO_SIZE + self::SHOP_LOGO_GAP;
  431. $url .= '/watermark,text_' . stringUtil::ossBase64($shopTitle)
  432. . ',g_nw,x_' . $titleX . ',y_' . self::shopTitleY()
  433. . ',color_333333,type_' . self::FONT . ',size_' . self::SHOP_TITLE_SIZE;
  434. }
  435. $url .= '/watermark,image_' . stringUtil::ossBase64($coverWatermark)
  436. . ',g_nw,x_' . self::CANVAS_PAD_X . ',y_' . $layout['coverY'];
  437. if ($displayName !== '') {
  438. $url .= '/watermark,text_' . stringUtil::ossBase64($displayName)
  439. . ',g_nw,x_' . self::CANVAS_PAD_X . ',y_' . $layout['nameY']
  440. . ',color_333333,type_' . self::FONT . ',size_' . self::MID_NAME_SIZE;
  441. }
  442. if ($displayRemark !== '') {
  443. $url .= '/watermark,text_' . stringUtil::ossBase64($displayRemark)
  444. . ',g_nw,x_' . self::CANVAS_PAD_X . ',y_' . $layout['remarkY']
  445. . ',color_888888,type_' . self::FONT . ',size_' . self::MID_REMARK_SIZE;
  446. }
  447. $url .= '/watermark,image_' . stringUtil::ossBase64($qrWatermark)
  448. . ',g_se,x_' . self::QR_PAD_RIGHT . ',y_' . $footer['qrY'];
  449. $logoB64 = self::buildHyxhLogoWatermark($mainId);
  450. if ($logoB64 !== '') {
  451. $url .= '/watermark,image_' . $logoB64 . ',g_se,x_210,y_48';
  452. }
  453. $url .= '/watermark,image_' . stringUtil::ossBase64(self::buildBuyHintBarWatermarkPath())
  454. . ',g_sw,x_' . self::CANVAS_PAD_X . ',y_' . $footer['buyHintBarY'];
  455. $url .= '/watermark,text_' . stringUtil::ossBase64(self::FOOTER_BUY_HINT)
  456. . ',g_sw,x_' . $footer['buyHintTextX'] . ',y_' . $footer['buyHintTextY']
  457. . ',color_666666,type_' . self::FONT . ',size_' . self::FOOTER_BUY_HINT_SIZE;
  458. $url .= '/watermark,text_' . stringUtil::ossBase64($priceText)
  459. . ',g_sw,x_' . self::CANVAS_PAD_X . ',y_' . $footer['priceY']
  460. . ',color_EE2C2C,type_' . self::FONT . ',size_' . self::FOOTER_PRICE_SIZE;
  461. return $url;
  462. }
  463. }