moonsflyer před 4 měsíci
rodič
revize
1893f4ce05
1 změnil soubory, kde provedl 8 přidání a 4 odebrání
  1. 8 4
      app/common/service/GiftCardQrCodeService.php

+ 8 - 4
app/common/service/GiftCardQrCodeService.php

@@ -41,12 +41,16 @@ class GiftCardQrCodeService
             $config = WeChatConfigService::getMnpConfig();
             $app = Factory::miniProgram($config);
             $accessToken = $app->access_token->getToken()['access_token'];
-            outFileLog($accessToken,'qr_code','$accessToken');
+            outFileLog($accessToken, 'qr_code', '$accessToken');
             // $url = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token={$accessToken}";
             $url = "https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token={$accessToken}";
             $data = [
-                'page' => $page.'?cardPass='. '?cardPass=' . urlencode($cardPass),
-                'width' => 430  // 方形尺寸
+                'path' => $page . '?cardPass=' . '?cardPass=' . urlencode($cardPass),
+                'width' => 430,  // 方形尺寸
+                'auto_color' => false,  // 不自动配色
+                'line_color' => ['r' => 0, 'g' => 0, 'b' => 0],  // 黑色线条
+                'is_hyaline' => true,   // 透明背景,去除logo区域
+                'env_version' => 'release'  // 添加版本参数
             ];
             // $data = [
             //     'scene' => $scene,
@@ -117,7 +121,7 @@ class GiftCardQrCodeService
                     'remotePath' => $remotePath,
                     'fullUrl' => $fullUrl
                 ]);
-                outFileLog($fullUrl,'qr_code','$fullUrl');
+                outFileLog($fullUrl, 'qr_code', '$fullUrl');
                 return $fullUrl;
             } else {
                 // 上传失败,删除临时文件