|
|
@@ -9,6 +9,7 @@ use bizHd\wx\services\WxOpenService;
|
|
|
use common\components\dict;
|
|
|
use common\components\imgUtil;
|
|
|
use common\components\miniUtil;
|
|
|
+use common\components\stringUtil;
|
|
|
use GatewayClient\Gateway;
|
|
|
use bizHd\ad\services\AdService;
|
|
|
use bizHd\goods\services\CategoryService;
|
|
|
@@ -28,21 +29,44 @@ class MainController extends BaseController
|
|
|
//商城海报 ssh 20210610
|
|
|
public function actionGetMallPoster()
|
|
|
{
|
|
|
+ $shop = $this->shop;
|
|
|
+ $pfShopId = $shop->pfShopId ?? 0;
|
|
|
+
|
|
|
$merchant = WxOpenClass::getMallWxInfo();
|
|
|
$goodsPage = 'pages/home/category';
|
|
|
$ptStyle = dict::getDict('ptStyle', 'mall');
|
|
|
$scene = 'a=' . $this->shopAdminId . '&s=' . $this->shopId;
|
|
|
$goodsImgUrl = miniUtil::generateUnlimitedMiniCode($merchant, $goodsPage, $scene, $ptStyle);
|
|
|
- $goodsUrl = imgUtil::groupImg($goodsImgUrl);
|
|
|
|
|
|
$flowerPage = 'pages/item/item';
|
|
|
$flowerImgUrl = miniUtil::generateUnlimitedMiniCode($merchant, $flowerPage, $scene, $ptStyle);
|
|
|
- $flowerUrl = imgUtil::groupImg($flowerImgUrl);
|
|
|
|
|
|
- $respond = [
|
|
|
- 'imgUrl' => $goodsUrl,
|
|
|
- 'flowerImgUrl' => $flowerUrl,
|
|
|
- ];
|
|
|
+ $prefix = imgUtil::getPrefix();
|
|
|
+ $titleBase64 = stringUtil::ossBase64('个人买花入口');
|
|
|
+
|
|
|
+ if ($pfShopId > 0) {
|
|
|
+ $goodsUrl = $prefix . 'shop/miniCodeBg.jpg?x-oss-process=image';
|
|
|
+ $goodsMiniCodeBase64 = stringUtil::ossBase64($goodsImgUrl);
|
|
|
+ $goodsUrl .= '/watermark,image_' . $goodsMiniCodeBase64 . ',g_north,x_0,y_40';
|
|
|
+ $goodsUrl .= '/watermark,text_' . $titleBase64 . ',g_north,x_0,y_530,size_50';
|
|
|
+
|
|
|
+ $flowerUrl = $prefix . 'shop/miniCodeBg.jpg?x-oss-process=image';
|
|
|
+ $flowerMiniCodeBase64 = stringUtil::ossBase64($flowerImgUrl);
|
|
|
+ $flowerUrl .= '/watermark,image_' . $flowerMiniCodeBase64 . ',g_north,x_0,y_40';
|
|
|
+ $flowerUrl .= '/watermark,text_' . $titleBase64 . ',g_north,x_0,y_530,size_50';
|
|
|
+
|
|
|
+ $respond = [
|
|
|
+ 'imgUrl' => $goodsUrl,
|
|
|
+ 'flowerImgUrl' => $flowerUrl,
|
|
|
+ ];
|
|
|
+ } else {
|
|
|
+ $goodsUrl = imgUtil::groupImg($goodsImgUrl);
|
|
|
+ $flowerUrl = imgUtil::groupImg($flowerImgUrl);
|
|
|
+ $respond = [
|
|
|
+ 'imgUrl' => $goodsUrl,
|
|
|
+ 'flowerImgUrl' => $flowerUrl,
|
|
|
+ ];
|
|
|
+ }
|
|
|
util::success($respond);
|
|
|
}
|
|
|
|