├── LICENSE ├── README.md └── index.html /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 mengkun 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OneQRCode 2 | 3 | 微信、支付宝、QQ 三合一收款二维码,单文件版 4 | 5 | ![](https://img.shields.io/github/issues/mengkunsoft/OneQRCode.svg?style=flat-square) ![](https://img.shields.io/github/forks/mengkunsoft/OneQRCode.svg?style=flat-square) ![](https://img.shields.io/github/stars/mengkunsoft/OneQRCode.svg?style=flat-square) ![](https://img.shields.io/github/license/mengkunsoft/OneQRCode.svg?style=flat-square) 6 | 7 | ## 特点 8 | 9 | - 纯前端实现,无需安装,无需数据库; 10 | - 免维护,无任何多余的配置,只需修改收款链接,即可永久使用。 11 | 12 | ## 使用方法 13 | 14 | 1. [点击下载](https://github.com/mengkunsoft/OneQRCode/archive/master.zip) 本项目代码到本地; 15 | 2. 打开 `index.html`,将里面的收款码链接修改成你自己的; 16 | 3. 将 `index.html` 上传至你的网站空间,即可开始使用! 17 | 18 | ## 注意事项 19 | 20 | - 请用专门的 HTML 编辑器(如 VS Code)编辑代码,切勿直接用记事本编辑,否则可能出现中文乱码! 21 | - 本作品禁止任何形式的倒卖,转载请注明出处。 22 | 23 | ## 原理 24 | 在 微信、支付宝、QQ 中扫描到一个网址二维码后,一般会通过内置的浏览器打开这个网址。通过判断内置浏览器的 UA,即可得出当前扫码的具体支付平台。 25 | 26 | ```` 27 | if(navigator.userAgent.match(/Alipay/i)) { 28 | // 支付宝 29 | } else if(navigator.userAgent.match(/MicroMessenger\//i)) { 30 | // 微信 31 | } else if(navigator.userAgent.match(/QQ\//i)) { 32 | // QQ 33 | } else { 34 | // 其它 35 | } 36 | ```` 37 | 38 | 其中,支付宝可以通过直接跳转收款链接唤起付款功能,而 QQ、微信 则需展示出对应的收款码,由用户自行长按识别真正的收款二维码实现唤起付款。 39 | 40 | 详细请阅读: 41 | 42 | [多合一收款二维码原理及实现](https://mkblog.cn/922/) 43 | 44 | [更多使用说明请查阅项目wiki](https://github.com/mengkunsoft/OneQRCode/wiki) 45 | 46 | 在线演示: 47 | 48 | http://lab.mkblog.cn/oneqrcode/ 49 | 50 | # License 51 | 52 | ```` 53 | MIT License 54 | 55 | Copyright (c) 2018 mengkun 56 | 57 | Permission is hereby granted, free of charge, to any person obtaining a copy 58 | of this software and associated documentation files (the "Software"), to deal 59 | in the Software without restriction, including without limitation the rights 60 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 61 | copies of the Software, and to permit persons to whom the Software is 62 | furnished to do so, subject to the following conditions: 63 | 64 | The above copyright notice and this permission notice shall be included in all 65 | copies or substantial portions of the Software. 66 | 67 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 68 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 69 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 70 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 71 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 72 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 73 | SOFTWARE. 74 | ```` -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 万能收款码 11 | 12 | 30 | 31 | 93 | 94 | 95 | 96 |
97 |
98 |
99 | 100 |
101 | 102 |
103 | 104 | 105 |
106 |
107 |
108 | 109 |
110 | 111 |
112 | 113 | 114 |
115 |
116 |
117 | 118 |
119 | 120 |
121 | 122 | 149 | 150 | 151 | 152 | --------------------------------------------------------------------------------