From 572f6074c5bedcdcbabcd42995c0a2890995c870 Mon Sep 17 00:00:00 2001
From: quanwei <419654421@qq.com>
Date: Thu, 13 Nov 2025 18:41:13 +0800
Subject: [PATCH] 修改名片列表样式
---
admin/app/common/service/qrcode/Base.php | 75 +++++++++++++++++++++++++++++++++++++
1 files changed, 75 insertions(+), 0 deletions(-)
diff --git a/admin/app/common/service/qrcode/Base.php b/admin/app/common/service/qrcode/Base.php
index 3abf855..e6a63b5 100644
--- a/admin/app/common/service/qrcode/Base.php
+++ b/admin/app/common/service/qrcode/Base.php
@@ -120,4 +120,79 @@
return true;
}
+ /**
+ * 保存小程序码到文件
+ */
+ protected function saveBranchQrcodeToDir($app_id, $page, $savePath, $branch_id)
+ {
+ // 小程序配置信息
+ $app = AppWx::getApp($app_id);
+ // 小程序码参数
+ $scene = "branch_id:{$branch_id}";
+ // 文件名称
+ $fileName = 'qrcode_' . md5($app_id . $scene . $page) . '.png';
+ // 请求api获取小程序码
+ $response = $app->app_code->getUnlimit($scene, [
+ 'page' => $page,
+ 'width' => 430
+ ]);
+ // 保存小程序码到文件
+ if ($response instanceof \EasyWeChat\Kernel\Http\StreamResponse) {
+ $response->saveAs($savePath, $fileName);
+ }
+ return true;
+ }
+
+ /**
+ * 保存二维码码到文件
+ */
+ protected function saveBranchMpQrcodeToDir($page, $savePath, $branch_id, $app_id)
+ {
+ $qrcode = new QrCode(base_url() . $page . '?app_id=' . $app_id . '&branch_id=' . $branch_id);
+ $scene = "branch_id:{$branch_id}";
+ // 文件名称
+ $fileName = 'qrcode_' . md5($app_id . $scene) . '.png';
+ // 保存二维码到文件
+ $path = "{$savePath}{$fileName}";
+ $qrcode->writeFile($path);
+ return true;
+ }
+
+ /**
+ * 保存二维码码到文件
+ */
+ protected function saveBranchActivityQrcodeToDir($app_id, $page, $savePath, $scene)
+ {
+ // 小程序配置信息
+ $app = AppWx::getApp($app_id);
+ // 文件名称
+ $fileName = 'qrcode_' . md5($app_id . $scene . $page) . '.png';
+ // 请求api获取小程序码
+ $response = $app->app_code->getUnlimit($scene, [
+ 'page' => $page,
+ 'width' => 430
+ ]);
+ // 保存小程序码到文件
+ if ($response instanceof \EasyWeChat\Kernel\Http\StreamResponse) {
+ $response->saveAs($savePath, $fileName);
+ }
+
+ return $fileName;
+ }
+
+ /**
+ * 保存二维码码到文件
+ */
+ protected function saveBranchActivityVerifyMpQrcodeToDir($page, $savePath, $activity_id, $app_id)
+ {
+ $qrcode = new QrCode(base_url() . $page . '?app_id=' . $app_id . '&activity_id=' . $activity_id. '&user_verify=1');
+ $scene = "activity_id:{$activity_id}";
+ // 文件名称
+ $fileName = 'qrcode_' . md5($app_id . $scene) . '.png';
+ // 保存二维码到文件
+ $path = "{$savePath}{$fileName}";
+ $qrcode->writeFile($path);
+ return $fileName;;
+ }
+
}
\ No newline at end of file
--
Gitblit v1.9.2