博客园添加打赏功能(转载)

@参考文章

简单几步为自己的博客园主页添加打赏功能:
1 准备工作:

准备支付宝和微信的二维码,后缀名需修改.bmp格式。如zfb.bmp,wx.bmp。


2 上传图片:

进入自己的博客园,然后进入 管理--->文件,在这里上传自己第1步中准备好的二维码图片。


3 复制并根据自己的博客修改如下代码:

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="keywords" content="打赏" />
<meta name="description" content="打赏" />
<title>打赏</title>
</head>
<script>
        window.tctipConfig = {
            staticPrefix: "http://static.tctip.com",
            buttonImageId: 5,
            buttonTip:  "zanzhu",
            list:{
                alipay: { qrimg: "http://files.cnblogs.com/files/unnamedprogramer/zfb.bmp"}, //修改1
                weixin: { qrimg: "http://files.cnblogs.com/files/unnamedprogramer/wx.bmp"}, //修改2
            }
        };
</script>
<script src="http://static.tctip.com/js/tctip.min.js"></script>
<body>
</body>
</html>
修改1:进入博客,“管理”-->“文件”-->“上传文件管理”-->“文件名”,点击对应的文件名,如博主自己的zfb.bmp这能预览图片,复制图片url,替换上述代码中alipay对应的qrimg参数。
修改2:同修改1.

4 将修改后的代码粘贴到指定位置:

进入博客,找到“管理”-->“设置”,下拉到“首页Html代码”,将上面修改后的代码粘贴进去,点击“保存”。

5 完成。刷新一下,查看自己的打赏功能吧!!

最后,感谢https://github.com/greedying/tctip!!
View Code

ps:从支付宝或微信保存的收钱码,把空白部分去除放大再上传,否则二维码部分太小扫不出来

原文地址:https://www.cnblogs.com/yanan7890/p/8313094.html