This commit is contained in:
laodaming 2023-06-16 10:27:42 +08:00
parent 9769698f22
commit 74474f6f16
3 changed files with 3 additions and 2 deletions

View File

@ -34,7 +34,7 @@ const MAIN_INVOICE_HTML = `<!DOCTYPE html>
<tr height="15px"></tr>
<tr>
<td align="left" style="width: 50%;">
<span style="color: #666666;font-weight: 400;font-size: 22px; display: block;">' . $sn . '</span>
<span style="color: #666666;font-weight: 400;font-size: 22px; display: block;">{{order_sn}}</span>
</td>
</tr>
<tr height="30px"></tr>

View File

@ -172,6 +172,7 @@ func (l *GetOrderInvoiceLogic) GetOrderInvoice(req *types.GetOrderInvoiceReq, us
mainHtml = strings.ReplaceAll(mainHtml, "{{first_style1}}", firstStyle1)
mainHtml = strings.ReplaceAll(mainHtml, "{{first_style2}}", firstStyle2)
mainHtml = strings.ReplaceAll(mainHtml, "{{h5Url}}", constants.H5_URL)
mainHtml = strings.ReplaceAll(mainHtml, "{{order_sn}}", *orderInfo.Sn)
mainHtml = strings.ReplaceAll(mainHtml, "{{order_expire_time}}", time.Unix(*orderInfo.Ctime, req.TimeZone*60).Format("02 Jan,2006"))
//html内容页面转pdf的base64
prfBase64, err := pdf.HtmlToPdfBase64(mainHtml, 2)

View File

@ -12,7 +12,7 @@ import (
"os"
)
// 带logo的二维码图片生成 content-二维码内容 size-像素单位 outPath 保存路径(传空则不保存) logoPath-logo文件路径(传空就不带) xx轴整体偏移 y:y轴整体偏移
// 带logo的二维码图片生成 content-二维码内容 size-像素单位 outPath 保存路径(传空则不保存) disableBorder是否不启用边框 logoPath-logo文件路径(传空就不带) xx轴整体偏移 y:y轴整体偏移
func CreateQrCodeBs64WithLogo(content, outPath string, logoPath string, size, x, y int, disableBorder bool) (data string, err error) {
code, err := qrcode.New(content, qrcode.High)
if err != nil {