├── .gitignore ├── LICENSE ├── README.md ├── cloudfunctions ├── checkeText │ ├── config.json │ ├── index.js │ └── package.json ├── decode │ ├── config.json │ ├── index.js │ ├── package.json │ └── yarn.lock ├── deleteUserQR │ ├── config.json │ ├── index.js │ ├── package-lock.json │ └── package.json ├── getQRElementList │ ├── config.json │ ├── index.js │ ├── package-lock.json │ └── package.json ├── login │ ├── config.json │ ├── index.js │ ├── package.json │ └── yarn.lock ├── publishQR │ ├── config.json │ ├── index.js │ ├── package-lock.json │ └── package.json ├── reportQRLike │ ├── config.json │ ├── index.js │ ├── package-lock.json │ └── package.json ├── uploadImg │ ├── config.json │ ├── index.js │ ├── package-lock.json │ ├── package.json │ └── yarn.lock └── uploadQRElement │ ├── config.json │ ├── index.js │ ├── package-lock.json │ └── package.json ├── miniprogram ├── app.js ├── app.json ├── app.wxss ├── components │ ├── avatar │ │ ├── avatar.js │ │ ├── avatar.json │ │ ├── avatar.wxml │ │ └── avatar.wxss │ ├── btn │ │ ├── btn.js │ │ ├── btn.json │ │ ├── btn.wxml │ │ └── btn.wxss │ ├── cell │ │ ├── cell.js │ │ ├── cell.json │ │ ├── cell.wxml │ │ └── cell.wxss │ ├── contain │ │ ├── contain.js │ │ ├── contain.json │ │ ├── contain.wxml │ │ └── contain.wxss │ ├── icon │ │ ├── icon.js │ │ ├── icon.json │ │ ├── icon.wxml │ │ └── icon.wxss │ ├── missbox │ │ ├── missbox.js │ │ ├── missbox.json │ │ ├── missbox.wxml │ │ └── missbox.wxss │ ├── navbar │ │ ├── navbar.js │ │ ├── navbar.json │ │ ├── navbar.wxml │ │ └── navbar.wxss │ ├── page │ │ ├── page.js │ │ ├── page.json │ │ ├── page.wxml │ │ └── page.wxss │ ├── popbox │ │ ├── popbox.js │ │ ├── popbox.json │ │ ├── popbox.wxml │ │ └── popbox.wxss │ └── styleitem │ │ ├── styleitem.js │ │ ├── styleitem.json │ │ ├── styleitem.wxml │ │ └── styleitem.wxss ├── images │ ├── demo.png │ ├── img │ │ ├── bg.png │ │ ├── col2.png │ │ ├── col3.png │ │ ├── col4.png │ │ ├── eye.png │ │ ├── one.png │ │ ├── po7.png │ │ ├── re7.png │ │ ├── row2.png │ │ ├── row3.png │ │ ├── row4.png │ │ └── tian.png │ ├── logo.png │ └── upload │ │ ├── col2.png │ │ ├── col3.png │ │ ├── col4.png │ │ ├── demo.png │ │ ├── demo1.png │ │ ├── demo2.png │ │ ├── eye.png │ │ ├── grid.png │ │ ├── one.png │ │ ├── po7.png │ │ ├── re7.png │ │ ├── row2.png │ │ ├── row3.png │ │ ├── row4.png │ │ ├── rule-1.png │ │ ├── rule-2.png │ │ ├── rule-3.png │ │ ├── rule.png │ │ ├── rules.png │ │ └── tian.png ├── js │ ├── artqrcoed.js │ ├── common.js │ └── getqrcode.js ├── pages │ ├── checkqr │ │ ├── checkqr.js │ │ ├── checkqr.json │ │ ├── checkqr.wxml │ │ └── checkqr.wxss │ ├── designrule │ │ ├── designrule.js │ │ ├── designrule.json │ │ ├── designrule.wxml │ │ └── designrule.wxss │ ├── imgmade │ │ ├── imgmade.js │ │ ├── imgmade.json │ │ ├── imgmade.wxml │ │ └── imgmade.wxss │ ├── index │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── myqrlist │ │ ├── myqrlist.js │ │ ├── myqrlist.json │ │ ├── myqrlist.wxml │ │ └── myqrlist.wxss │ ├── qrcode │ │ ├── qrcode.js │ │ ├── qrcode.json │ │ ├── qrcode.wxml │ │ └── qrcode.wxss │ ├── qrlist │ │ ├── qrlist.js │ │ ├── qrlist.json │ │ ├── qrlist.wxml │ │ └── qrlist.wxss │ ├── txtmade │ │ ├── txtmade.js │ │ ├── txtmade.json │ │ ├── txtmade.wxml │ │ └── txtmade.wxss │ └── upload │ │ ├── upload.js │ │ ├── upload.json │ │ ├── upload.wxml │ │ └── upload.wxss └── sitemap.json ├── package-lock.json ├── package.json ├── project.config.json ├── project.private.config.json └── readme ├── cover.png ├── toolcode.jpg ├── 上传.gif ├── 上传指引.gif ├── 图片生成.gif ├── 我的生成.gif ├── 我的素材.gif ├── 文字生成.gif ├── 流程.mp4 ├── 社区.gif ├── 艺术例子.png ├── 首页.gif └── 黑白例子.png /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows 2 | [Dd]esktop.ini 3 | Thumbs.db 4 | $RECYCLE.BIN/ 5 | 6 | # macOS 7 | .DS_Store 8 | .fseventsd 9 | .Spotlight-V100 10 | .TemporaryItems 11 | .Trashes 12 | 13 | # Node.js 14 | node_modules/ 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 【云开发应用】-【艺术二维码生成器小程序】 2 | ## 体验二维码 3 | ![image.png](./readme/toolcode.jpg) 4 | 5 | - 队伍名称:喜儿战队 6 | - 队伍成员:[Chenyating](https://github.com/Chenyating),[bigbinhe](https://github.com/xbin0316) 7 | 8 | ## 作品简介: 9 | 当我们在日常生活中总会出现各种各样的二维码,但黑白的颜色放置在绚丽的海报上,就会显得奇奇怪怪。也会降低人们扫码的欲望。 10 | 11 | 12 | 13 | 但如果是这样的二维码呢,是否在你眼前一亮呢,你是否很想去试一下,会扫出个什么样的内容呢。 14 | 15 | 16 | 17 | 现在就用一款这样的工具,能够帮你将无聊乏味的黑白二维码转化成艺术二维码。不管是文字,还是网址,几秒美化。同时还可以自己上传设置素材,生成专属的艺术二维码。 18 | 19 | ### 封面图 20 | 21 | 22 | ## 作品类型: 23 | - 小程序 24 | - 工具类 25 | 26 | ## 云开发能力应用情况: 27 | - 使用云函数 28 | - 云数据库 29 | 30 | ## 功能模块介绍 31 | 32 | ### 首页 33 | 34 | 35 | - 二维码生成:用户可直接s输入文字生成艺术二维码 36 | - 二维码美化:用户可以用现有的黑白二维码转为艺术二维码 37 | - 社区:用户可以看到所有用户上传的艺术二维码风格模版; 38 | - 我的:用户可创建自定义定艺术二维码风格素材包。 39 | 40 | ### 二维码生成 41 | 42 | 43 | - 填写内容:文字、网址均可 44 | - 选择风格:跳转页生成艺术二维码的风格 45 | - 生成二维码 46 | 47 | ### 美化二维码 48 | 49 | 50 | - 上传图片:上传黑白二维码 51 | - 选择风格:跳转页生成艺术二维码的风格 52 | - 生成二维码 53 | 54 | ### 社区 55 | 56 | 57 | - 用户进入页面,展示所有用户上传的艺术二维码风格模板列表。 58 | - 用户点击其中一个模板,可以进行自定义定制艺术二维码。 59 | 60 | ### 我的 61 | 62 | 63 | - 当用户进入到我的页面,拉取用户所创建的素材包列表。 64 | - 用户可以对素材包进行管理:删除,上传素材包 65 | 66 | ### 上传 67 | 68 | 69 | - 用户根据示意图,上传对应的图片素材,至少上传3张基础元素图。 70 | - 点击“上传”,用户最后确认上次素材包,并取名提交。 71 | - 当用户点击“问号”icon时,用户可以了解上传规则。 72 | 73 | ### 上传规则 74 | 75 | 76 | - 当用户在上传页点击“问号”icon时,用户可以了解上传以及设计规则。 77 | - 阅读完毕可跳转回上传页面 78 | 79 | ### 模板生成艺术二维码 80 | 81 | 82 | - 用户选取艺术二维码模板后,跳转到创建二维码页。 83 | - “文字生成”点击后,弹出弹框,输入:文字,网址点击生成即可获得艺术二维码。 84 | - “二维码美化”点击后,弹出弹框,用户上传黑白二维码后,点击生成即可获得艺术二维码。 85 | 86 | ## 整体流程 87 | 90 | 91 | ## 源码链接 92 | https://github.com/Chenyating/qrcode.git 93 | 喜欢的朋友可以给这个项目个start~谢谢撒~٩(๑❛ᴗ❛๑)۶ 94 | 95 | ## 学习与参考 96 | - [小程序开发文档](https://developers.weixin.qq.com/miniprogram/dev/framework/) 97 | - [艺术二维码生成原理](https://blog.csdn.net/lemisi/article/details/88831289?spm=1001.2014.3001.5502) 98 | - [artqrcode源码](https://github.com/Chenyating/qrcode) 99 | -------------------------------------------------------------------------------- /cloudfunctions/checkeText/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "permissions": { 3 | "openapi": [ 4 | "subscribeMessage.send" 5 | ] 6 | } 7 | } -------------------------------------------------------------------------------- /cloudfunctions/checkeText/index.js: -------------------------------------------------------------------------------- 1 | // 云函数入// 云函数入口文件 2 | const cloud = require('wx-server-sdk'); 3 | const request = require('request'); 4 | 5 | cloud.init({ 6 | env: 'xier-8gptzwg769125208' 7 | }); 8 | 9 | // 云函数入口函数 10 | exports.main = async (event, context) => { 11 | let text = event.txt; 12 | const wxContext = cloud.getWXContext(); 13 | const open_id = wxContext.OPENID; 14 | const result = await cloud.openapi.security.msgSecCheck({ 15 | "openid": open_id, 16 | "scene": 1, 17 | "version": 2, 18 | "content": text 19 | }) 20 | return result.result.suggest; 21 | } -------------------------------------------------------------------------------- /cloudfunctions/checkeText/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "checkeText", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "wx-server-sdk": "~2.6.3" 13 | } 14 | } -------------------------------------------------------------------------------- /cloudfunctions/decode/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "permissions": { 3 | "openapi": [ 4 | ] 5 | } 6 | } -------------------------------------------------------------------------------- /cloudfunctions/decode/index.js: -------------------------------------------------------------------------------- 1 | // 云函数入// 云函数入口文件 2 | const cloud = require('wx-server-sdk'); 3 | const request = require('request'); 4 | 5 | cloud.init({ 6 | env: 'xier-8gptzwg769125208' 7 | }); 8 | 9 | // 云函数入口函数 10 | exports.main = async (event, context) => { 11 | let token = await getWechatAccessToken(); 12 | const fileid = event.fileid; 13 | let img = await getimg(token.access_token, fileid); 14 | let qrtext=await scanqrcode(img,token); 15 | return qrtext.code_results; 16 | } 17 | 18 | // 获取公众号access_token 19 | async function getWechatAccessToken() { 20 | let appid = 'wxdb5a9d708acf35ee'; //微信公众号开发者id 21 | let secret = '731ce47411ac051989925ed55854c528'; //微信公众号开发者secret_key 22 | let token_url = `https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=${appid}&secret=${secret}`; 23 | let rp = options => 24 | new Promise((resolve, reject) => { 25 | request(options, (error, response, body) => { 26 | if (error) { 27 | reject(error); 28 | } 29 | resolve(response); 30 | }); 31 | }); 32 | let result = await rp({ 33 | url: token_url, 34 | method: 'GET' 35 | }); 36 | return (typeof result.body === 'object') ? result.body : JSON.parse(result.body); 37 | } 38 | 39 | async function scanqrcode(imgurl, token) { 40 | let token_url = `https://api.weixin.qq.com/cv/img/qrcode?img_url=${imgurl}&access_token=${token.access_token}`; 41 | let rp1 = options => 42 | new Promise((resolve, reject) => { 43 | request(options, (error, response, body) => { 44 | if (error) { 45 | reject(error); 46 | } 47 | resolve(response); 48 | }); 49 | }); 50 | let result = await rp1({ 51 | url: token_url, 52 | method: 'POST' 53 | }); 54 | var res=JSON.parse(result.body) 55 | return res 56 | } 57 | 58 | async function getimg(token, fileid) { 59 | var fileid=fileid; 60 | let token_url = `https://api.weixin.qq.com/tcb/batchdownloadfile?access_token=${token}`; 61 | var data={ 62 | "env": "xier-8gptzwg769125208", 63 | "file_list": [{ 64 | "fileid": fileid, 65 | "max_age": 7200 66 | }] 67 | }; 68 | let rp2 = options => 69 | new Promise((resolve, reject) => { 70 | request(options, (error, response, body) => { 71 | if (error) { 72 | reject(error); 73 | } 74 | resolve(response); 75 | }); 76 | }); 77 | let result2 = await rp2({ 78 | url: token_url, 79 | body:JSON.stringify(data), 80 | method: 'POST' 81 | }); 82 | var res=JSON.parse(result2.body) 83 | return res.file_list[0].download_url; 84 | } -------------------------------------------------------------------------------- /cloudfunctions/decode/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "decode", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "wx-server-sdk": "~2.5.1" 13 | } 14 | } -------------------------------------------------------------------------------- /cloudfunctions/deleteUserQR/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "permissions": { 3 | "openapi": [ 4 | ] 5 | } 6 | } -------------------------------------------------------------------------------- /cloudfunctions/deleteUserQR/index.js: -------------------------------------------------------------------------------- 1 | // 云函数入口文件 2 | const cloud = require('wx-server-sdk') 3 | cloud.init({ 4 | env: 'xier-8gptzwg769125208' 5 | }); 6 | 7 | //获取数据库引用 8 | const db = cloud.database({ 9 | throwOnNotFound: false 10 | }); 11 | const collection_qr_element_list = db.collection('QR_Element_LIST'); 12 | const _ = db.command; 13 | 14 | // 云函数入口函数 15 | exports.main = async (event, context) => { 16 | const wxContext = cloud.getWXContext(); 17 | const open_id = wxContext.OPENID; 18 | const qr_id = event.qr_id_array; 19 | const rs = { 20 | code: 0, 21 | msg: '' 22 | }; 23 | if (!qr_id || !qr_id.length) { 24 | rs.code = -1; 25 | rs.msg = "未指定qr_id"; 26 | return rs; 27 | } 28 | const db_process = await collection_qr_element_list.where({ 29 | _id:_.in(qr_id), 30 | _open_id:open_id 31 | }); 32 | const qr_record = await db_process.get(); 33 | if (!qr_record.data || !qr_record.data.length) { 34 | rs.code = -2; 35 | rs.msg = "未找到_id对应素材包,有可能已经被删除"; 36 | return rs; 37 | } 38 | return db_process.remove().then(() => { 39 | rs.code = 0; 40 | rs.msg = "删除成功"; 41 | return rs; 42 | }).catch(err => { 43 | rs.code = -3; 44 | rs.msg = JSON.stringify(err); 45 | return rs; 46 | }); 47 | } -------------------------------------------------------------------------------- /cloudfunctions/deleteUserQR/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "deleteUserQR", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "wx-server-sdk": "~2.4.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /cloudfunctions/getQRElementList/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "permissions": { 3 | "openapi": [ 4 | ] 5 | } 6 | } -------------------------------------------------------------------------------- /cloudfunctions/getQRElementList/index.js: -------------------------------------------------------------------------------- 1 | // 云函数入口文件 2 | const cloud = require('wx-server-sdk') 3 | 4 | cloud.init({ 5 | env: 'xier-8gptzwg769125208' 6 | }); 7 | 8 | //获取数据库引用 9 | const db = cloud.database({ 10 | throwOnNotFound: false 11 | }); 12 | const collection_qr_element_list = db.collection('QR_Element_LIST'); 13 | 14 | // 云函数入口函数 15 | exports.main = async (event, context) => { 16 | const rs = { 17 | code: 0, 18 | msg: null 19 | }; 20 | let { 21 | limit, 22 | page_index, 23 | self, 24 | order, 25 | datatype 26 | } = event; 27 | let open_id; 28 | limit += 0; 29 | page_index += 0; 30 | if (isNaN(limit) || isNaN(page_index)) { 31 | rs.code = -1; 32 | rs.msg = 'limit和page_index参数不正确'; 33 | return rs; 34 | } 35 | limit > 20 && (limit = 20); 36 | let db_process; 37 | //获取此用户的 38 | if (self) { 39 | const wxContext = cloud.getWXContext() 40 | open_id = wxContext.OPENID; 41 | db_process = await collection_qr_element_list.where({ 42 | _open_id: open_id 43 | }); 44 | } 45 | //获取全部列表 46 | else { 47 | if (datatype==0||datatype==undefined) { 48 | db_process = await collection_qr_element_list; 49 | } 50 | if (datatype==1) { 51 | db_process = await collection_qr_element_list.where({ 52 | publish: true 53 | }); 54 | } 55 | if (datatype==2) { 56 | db_process = await collection_qr_element_list.where({ 57 | publish: false 58 | }); 59 | } 60 | } 61 | 62 | //排序 63 | // if (order != 'like') { 64 | // db_process = await db_process.orderBy('_like', 'desc'); 65 | // } else { 66 | db_process = await db_process.orderBy('_upload_time', 'asc'); 67 | // } 68 | 69 | // 先取出集合记录总数 70 | const countResult = await db_process.count(); 71 | const total = countResult.total; 72 | const start = page_index * limit; 73 | return db_process.skip(start).limit(limit).get().then(list => { 74 | rs.code = 0; 75 | rs.msg = "success"; 76 | list.data.forEach(item => { 77 | delete item._open_id; 78 | }); 79 | rs.data = { 80 | total: total, 81 | page_index: page_index, 82 | limit: limit, 83 | list: list.data 84 | }; 85 | return rs; 86 | }).catch(err => { 87 | rs.code = -2; 88 | rs.msg = JSON.stringify(err); 89 | return rs; 90 | }); 91 | } -------------------------------------------------------------------------------- /cloudfunctions/getQRElementList/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "getQRElementList", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "wx-server-sdk": "~2.4.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /cloudfunctions/login/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "permissions": { 3 | "openapi": [ 4 | ] 5 | } 6 | } -------------------------------------------------------------------------------- /cloudfunctions/login/index.js: -------------------------------------------------------------------------------- 1 | // 云函数入口文件 2 | const cloud = require('wx-server-sdk') 3 | 4 | cloud.init() 5 | 6 | // 云函数入口函数 7 | exports.main = async (event, context) => { 8 | const wxContext = cloud.getWXContext() 9 | 10 | return { 11 | openid: wxContext.OPENID 12 | } 13 | } -------------------------------------------------------------------------------- /cloudfunctions/login/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "login", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "wx-server-sdk": "~2.5.1" 13 | } 14 | } -------------------------------------------------------------------------------- /cloudfunctions/publishQR/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "permissions": { 3 | "openapi": [ 4 | ] 5 | } 6 | } -------------------------------------------------------------------------------- /cloudfunctions/publishQR/index.js: -------------------------------------------------------------------------------- 1 | // 云函数入口文件 2 | const cloud = require('wx-server-sdk'); 3 | cloud.init({ 4 | env: 'xier-8gptzwg769125208' 5 | }); 6 | //获取数据库引用 7 | const db = cloud.database({ 8 | throwOnNotFound: false 9 | }); 10 | const collection_qr_element_list = db.collection('QR_Element_LIST'); 11 | 12 | // 云函数入口函数 13 | exports.main = async (event, context) => { 14 | const wxContext = cloud.getWXContext(); 15 | const open_id = wxContext.OPENID; 16 | const qr_id = event.qr_id; 17 | const publish=event.publish; 18 | var ifadmin = false; 19 | if (open_id == "oTeIY4x2XbUh-zDPgz11RdynsOTs") { 20 | ifadmin = true; 21 | } 22 | if (ifadmin) { 23 | collection_qr_element_list .doc(qr_id).update({ 24 | // data 传入需要局部更新的数据 25 | data: { 26 | // 表示将 done 字段置为 true 27 | publish: publish 28 | }, 29 | success: function(res) { 30 | return "yyds" 31 | } 32 | }) 33 | } 34 | } -------------------------------------------------------------------------------- /cloudfunctions/publishQR/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "publishQR", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "wx-server-sdk": "~2.4.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /cloudfunctions/reportQRLike/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "permissions": { 3 | "openapi": [ 4 | ] 5 | } 6 | } -------------------------------------------------------------------------------- /cloudfunctions/reportQRLike/index.js: -------------------------------------------------------------------------------- 1 | // 云函数入口文件 2 | const cloud = require('wx-server-sdk'); 3 | cloud.init({ 4 | env: 'xier-8gptzwg769125208' 5 | }); 6 | //获取数据库引用 7 | const db = cloud.database({ 8 | throwOnNotFound: false 9 | }); 10 | const collection_qr_element_list = db.collection('QR_Element_LIST'); 11 | const collection_like_record = db.collection('QRLikeRecord'); 12 | 13 | // 云函数入口函数 14 | exports.main = async (event, context) => { 15 | const wxContext = cloud.getWXContext(); 16 | const open_id = wxContext.OPENID; 17 | const qr_id = event.qr_id; 18 | const rs = { 19 | code: 0, 20 | msg: '' 21 | }; 22 | if (!qr_id) { 23 | rs.code = -1; 24 | rs.msg = "未指定qr_id"; 25 | return rs; 26 | }; 27 | if (!open_id) { 28 | rs.code = -1; 29 | rs.msg = "未获取到用户信息"; 30 | return rs; 31 | } 32 | const stage_time = Date.now() / 60000 >> 0; 33 | 34 | //查询数据库此用户该时间段已上传次数 35 | let like_db_process = await collection_like_record.where({ 36 | open_id: open_id 37 | }); 38 | let _id; 39 | let user_record = await like_db_process.get(); 40 | user_record = user_record.data[0]; 41 | if (user_record) { 42 | _id = user_record._id; 43 | } else { 44 | _id = await collection_like_record.add({ 45 | data: { 46 | stage_time: stage_time, 47 | stage_sum: 0, 48 | open_id 49 | } 50 | }).then(rs => rs._id).catch(err => null); 51 | user_record = await like_db_process.get(); 52 | user_record = user_record.data[0]; 53 | } 54 | let stage_sum; 55 | if (user_record.stage_time === stage_time) { 56 | stage_sum = user_record.stage_sum; 57 | } else { 58 | user_record.stage_time = stage_time; 59 | stage_sum = 0; 60 | } 61 | if (stage_sum > 30) { 62 | rs.code = -2; 63 | rs.msg = "已超出点赞次数,请稍后再试"; 64 | return rs; 65 | } 66 | ++stage_sum; 67 | collection_like_record.doc(_id).update({ 68 | data: { 69 | stage_sum, 70 | stage_time 71 | } 72 | }); 73 | 74 | const qr_db_process = await collection_qr_element_list.doc(qr_id); 75 | const qr_record = await qr_db_process.get(); 76 | if (!qr_record.data) { 77 | rs.code = -3; 78 | rs.msg = "未找到此素材包,有可能已经被删除"; 79 | return rs; 80 | } 81 | qr_like_sum = qr_record.data._like; 82 | ++qr_like_sum; 83 | return qr_db_process.update({data:{ 84 | _like:qr_like_sum 85 | }}).then(()=>{ 86 | rs.code = 0; 87 | rs.msg = '点赞成功'; 88 | rs._id = _id; 89 | rs.like = qr_like_sum; 90 | return rs; 91 | }).catch(err=>{ 92 | rs.code = -4; 93 | rs.msg = JSON.stringify(err); 94 | return rs; 95 | }); 96 | } -------------------------------------------------------------------------------- /cloudfunctions/reportQRLike/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "reportQRLike", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "wx-server-sdk": "~2.4.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /cloudfunctions/uploadImg/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "permissions": { 3 | "openapi": [ 4 | ] 5 | } 6 | } -------------------------------------------------------------------------------- /cloudfunctions/uploadImg/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 每位用户每分钟只能上传30张照片 3 | */ 4 | 5 | // 云函数入口文件 6 | const cloud = require('wx-server-sdk'); 7 | 8 | cloud.init({ 9 | env: 'xier-8gptzwg769125208' 10 | }); 11 | const db = cloud.database({ 12 | throwOnNotFound: false 13 | }); 14 | const collection_img_record = db.collection('ImgUploadRecord'); 15 | 16 | // 云函数入口函数 17 | exports.main = async (event, context) => { 18 | const rs = { 19 | code: 0, 20 | msg: '' 21 | }; 22 | const file_data = event.file_data; 23 | if (!file_data) { 24 | rs.code = -1; 25 | rs.msg = "未传入base64图片" 26 | return rs; 27 | } 28 | const wxContext = cloud.getWXContext(); 29 | const open_id = wxContext.OPENID; 30 | if (!open_id) { 31 | rs.code = -2; 32 | rs.msg = "未获取到用户信息" 33 | return rs; 34 | } 35 | 36 | //查询数据库此用户该时间段已上传次数 37 | const stage_time = Date.now() / 60000 >> 0; 38 | let db_process = await collection_img_record.where({ 39 | open_id:open_id 40 | }); 41 | let _id; 42 | let user_record = await db_process.get(); 43 | user_record = user_record.data[0]; 44 | if(user_record){ 45 | _id = user_record._id; 46 | }else{ 47 | _id = await collection_img_record.add({ 48 | data:{ 49 | stage_time:stage_time, 50 | stage_sum:0, 51 | open_id 52 | } 53 | }).then(rs=>rs._id).catch(err=>null); 54 | user_record = await db_process.get(); 55 | user_record = user_record.data[0]; 56 | } 57 | let stage_sum; 58 | if(user_record.stage_time === stage_time){ 59 | stage_sum = user_record.stage_sum; 60 | }else{ 61 | user_record.stage_time = stage_time; 62 | stage_sum = 0; 63 | } 64 | if(stage_sum > 30){ 65 | rs.code = -3; 66 | rs.msg = "已超出上传张数,请稍后再试"; 67 | return rs; 68 | } 69 | ++stage_sum; 70 | const file_path = `user_upload_qr_element/${open_id}_${stage_time}_${stage_sum}_${Math.random() * 10000000 >> 0}`; 71 | return await cloud.uploadFile({ 72 | cloudPath: file_path, 73 | fileContent: new Buffer(file_data, 'base64') 74 | }).then(up_rs=>{ 75 | return collection_img_record.doc(_id).update({data:{ 76 | stage_sum, 77 | stage_time 78 | }}).then(()=>{ 79 | rs.code = 0; 80 | rs.msg = "上传成功"; 81 | rs.fileID = up_rs.fileID; 82 | return rs; 83 | }); 84 | }).catch(err=>{ 85 | rs.code = -4; 86 | rs.msg = JSON.stringify(err) 87 | return rs; 88 | }); 89 | } -------------------------------------------------------------------------------- /cloudfunctions/uploadImg/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "uploadImg", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "wx-server-sdk": "~2.4.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /cloudfunctions/uploadQRElement/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "permissions": { 3 | "openapi": [ 4 | ] 5 | } 6 | } -------------------------------------------------------------------------------- /cloudfunctions/uploadQRElement/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 每位用户每分钟只能上传10套素材 3 | */ 4 | 5 | // 云函数入口文件 6 | const cloud = require('wx-server-sdk'); 7 | const env = 'xier-8gptzwg769125208'; 8 | cloud.init({ 9 | env 10 | }); 11 | const db = cloud.database({ 12 | throwOnNotFound: false 13 | }); 14 | const collection_qr_element_list = db.collection('QR_Element_LIST'); 15 | const collection_qr_upload_record = db.collection('QRUploadRecord'); 16 | 17 | const url_root = `cloud://${env}`; 18 | const checkPicUrl = function (pic_url) { 19 | if (typeof pic_url !== 'string') return ''; 20 | if (pic_url.indexOf(url_root) === 0) { 21 | return pic_url; 22 | } else { 23 | return ''; 24 | }; 25 | }; 26 | const htmlspecialchars = function (str) { 27 | str = str.replace(/&/g, '&'); 28 | str = str.replace(//g, '>'); 30 | str = str.replace(/"/g, '"'); 31 | str = str.replace(/'/g, '''); 32 | return str; 33 | }; 34 | 35 | // 云函数入口函数 36 | exports.main = async (event, context) => { 37 | const wxContext = cloud.getWXContext(); 38 | const open_id = wxContext.OPENID; 39 | const rs = { 40 | code: 0, 41 | msg: '' 42 | }; 43 | if (!open_id) { 44 | rs.code = -1; 45 | rs.msg = "未获取到用户信息"; 46 | return rs; 47 | } 48 | let { 49 | col2, 50 | col3, 51 | col4, 52 | cover, 53 | element_name, 54 | eye, 55 | one, 56 | po7, 57 | re7, 58 | row2, 59 | row3, 60 | row4, 61 | tian, 62 | _author_avatar, 63 | _author_name, 64 | publish 65 | } = event; 66 | if (!element_name) { 67 | rs.code = -2; 68 | rs.msg = "未填名称"; 69 | return rs; 70 | }; 71 | if (!_author_name) { 72 | rs.code = -2; 73 | rs.msg = "未填用户名称"; 74 | return rs; 75 | }; 76 | element_name = htmlspecialchars(element_name); 77 | _author_name = htmlspecialchars(_author_name); 78 | 79 | if (!checkPicUrl(eye) || !checkPicUrl(one)) { 80 | rs.code = -2; 81 | rs.msg = "eye和one格式错误"; 82 | return rs; 83 | }; 84 | //查询数据库此用户该时间段已上传次数 85 | const stage_time = Date.now() / 60000 >> 0; 86 | let qr_upload_db_process = await collection_qr_upload_record.where({ 87 | open_id: open_id 88 | }); 89 | let _id; 90 | let user_record = await qr_upload_db_process.get(); 91 | user_record = user_record.data[0]; 92 | if (user_record) { 93 | _id = user_record._id; 94 | } else { 95 | _id = await collection_qr_upload_record.add({ 96 | data: { 97 | stage_time: stage_time, 98 | stage_sum: 0, 99 | open_id 100 | } 101 | }).then(rs => rs._id).catch(err => null); 102 | user_record = await qr_upload_db_process.get(); 103 | user_record = user_record.data[0]; 104 | } 105 | let stage_sum; 106 | if (user_record.stage_time === stage_time) { 107 | stage_sum = user_record.stage_sum; 108 | } else { 109 | user_record.stage_time = stage_time; 110 | stage_sum = 0; 111 | } 112 | if (stage_sum > 10) { 113 | rs.code = -2; 114 | rs.msg = "上传过于频繁,请稍后再试"; 115 | return rs; 116 | } 117 | ++stage_sum; 118 | collection_qr_upload_record.doc(_id).update({ 119 | data: { 120 | stage_sum, 121 | stage_time 122 | } 123 | }); 124 | 125 | //素材包存入数据库 126 | return collection_qr_element_list.add({ 127 | data: { 128 | _open_id: open_id, 129 | _like: 0, 130 | col2:checkPicUrl(col2), 131 | col3:checkPicUrl(col3), 132 | col4:checkPicUrl(col4), 133 | cover:checkPicUrl(cover), 134 | element_name, 135 | eye:checkPicUrl(eye), 136 | one:checkPicUrl(one), 137 | po7:checkPicUrl(po7), 138 | re7:checkPicUrl(re7), 139 | row2:checkPicUrl(row2), 140 | row3:checkPicUrl(row3), 141 | row4:checkPicUrl(row4), 142 | tian:checkPicUrl(tian), 143 | _author_avatar, 144 | _author_name, 145 | publish:false 146 | } 147 | }).then(add_rs => { 148 | console.log(add_rs); 149 | rs.code = 0; 150 | rs.msg = "上传成功"; 151 | return rs; 152 | }).catch(add_err => { 153 | rs.code = -3; 154 | rs.msg = JSON.stringify(add_err); 155 | console.error(add_err); 156 | return rs; 157 | }); 158 | } -------------------------------------------------------------------------------- /cloudfunctions/uploadQRElement/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "uploadQRElement", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "wx-server-sdk": "~2.4.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /miniprogram/app.js: -------------------------------------------------------------------------------- 1 | //app.js 2 | App({ 3 | globalData: {}, 4 | onLaunch: function () { 5 | if (!wx.cloud) { 6 | console.error('请使用 2.2.3 或以上的基础库以使用云能力') 7 | } else { 8 | wx.cloud.init({ 9 | // env 参数说明: 10 | // env 参数决定接下来小程序发起的云开发调用(wx.cloud.xxx)会默认请求到哪个云环境的资源 11 | // 此处请填入环境 ID, 环境 ID 可打开云控制台查看 12 | // 如不填则使用默认环境(第一个创建的环境) 13 | // env: 'my-env-id', 14 | traceUser: true, 15 | }) 16 | } 17 | } 18 | }) -------------------------------------------------------------------------------- /miniprogram/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "pages": [ 3 | "pages/index/index", 4 | "pages/txtmade/txtmade", 5 | "pages/imgmade/imgmade", 6 | "pages/qrlist/qrlist", 7 | "pages/myqrlist/myqrlist", 8 | "pages/qrcode/qrcode", 9 | "pages/upload/upload", 10 | "pages/designrule/designrule", 11 | "pages/checkqr/checkqr" 12 | ], 13 | "window": { 14 | "backgroundColor": "#F6F6F6", 15 | "backgroundTextStyle": "light", 16 | "navigationBarBackgroundColor": "#F6F6F6", 17 | "navigationBarTitleText": "二维艺术码", 18 | "navigationBarTextStyle": "black", 19 | "navigationStyle": "custom" 20 | }, 21 | "sitemapLocation": "sitemap.json", 22 | "style": "v2" 23 | } -------------------------------------------------------------------------------- /miniprogram/app.wxss: -------------------------------------------------------------------------------- 1 | page{ 2 | background: url('https://7869-xier-8gptzwg769125208-1258411243.tcb.qcloud.la/assets/bg.png?sign=5aa09eff50836205f5eb23728c3e91ce&t=1623425293'),#8EC590; 3 | background-size: cover; 4 | background-position: bottom; 5 | /* 以下是颜色token */ 6 | /* 主题色 */ 7 | /* 主色 */ 8 | --brand-1: #FFE142; 9 | --brand-2: #D098FF; 10 | --box-shadow:4rpx 4rpx 0rpx #419646; 11 | --tip-1:#286432; 12 | 13 | --size-txt-base:32rpx; 14 | --size-txt-1:25rpx; 15 | --size-txt-2:20rpx; 16 | } 17 | -------------------------------------------------------------------------------- /miniprogram/components/avatar/avatar.js: -------------------------------------------------------------------------------- 1 | // components/avatar/avatar.js 2 | Component({ 3 | /** 4 | * 组件的属性列表 5 | */ 6 | properties: { 7 | size: { 8 | type: String, 9 | value: '120' 10 | }, 11 | borderWidth: { 12 | type: String, 13 | value: '4' 14 | }, 15 | src: { 16 | type: String, 17 | value: '' 18 | }, 19 | }, 20 | 21 | /** 22 | * 组件的初始数据 23 | */ 24 | data: { 25 | 26 | }, 27 | 28 | /** 29 | * 组件的方法列表 30 | */ 31 | methods: { 32 | 33 | } 34 | }) -------------------------------------------------------------------------------- /miniprogram/components/avatar/avatar.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /miniprogram/components/avatar/avatar.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /miniprogram/components/avatar/avatar.wxss: -------------------------------------------------------------------------------- 1 | /* components/avatar/avatar.wxss */ 2 | /* components/avatar/avatar.wxss */ 3 | .avatar { 4 | display: inline-block; 5 | width: 100%; 6 | height: 100%; 7 | border-radius: 100%; 8 | overflow: hidden; 9 | border: 4rpx solid #000000; 10 | box-sizing: border-box; 11 | box-shadow: var(--box-shadow); 12 | background: #fff; 13 | } 14 | 15 | .avatar image { 16 | width: 100%; 17 | height: 100%; 18 | border-radius: 100%; 19 | } -------------------------------------------------------------------------------- /miniprogram/components/btn/btn.js: -------------------------------------------------------------------------------- 1 | // components/btn/btn.js 2 | Component({ 3 | /** 4 | * 组件的属性列表 5 | */ 6 | properties: { 7 | block: { 8 | type: Boolean, 9 | value: false 10 | }, 11 | primary: { 12 | type: Boolean, 13 | value: false 14 | } 15 | }, 16 | 17 | /** 18 | * 组件的初始数据 19 | */ 20 | data: { 21 | 22 | }, 23 | 24 | /** 25 | * 组件的方法列表 26 | */ 27 | methods: { 28 | 29 | } 30 | }) -------------------------------------------------------------------------------- /miniprogram/components/btn/btn.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /miniprogram/components/btn/btn.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /miniprogram/components/btn/btn.wxss: -------------------------------------------------------------------------------- 1 | /* components/btn/btn.wxss */ 2 | .btn { 3 | display: inline-block; 4 | border: 4rpx solid #000000; 5 | box-shadow: var(--box-shadow); 6 | border-radius: 40rpx; 7 | font-size: 36rpx; 8 | text-align: center; 9 | padding: 0 30rpx; 10 | line-height: 80rpx; 11 | box-sizing: border-box; 12 | margin: 15rpx; 13 | } 14 | .btn--block{ 15 | display: block; 16 | margin: 15rpx auto; 17 | width: 250rpx; 18 | } 19 | .btn-default{ 20 | background: #FFFFFF; 21 | } 22 | .btn--primary{ 23 | background: #FFE142; 24 | } -------------------------------------------------------------------------------- /miniprogram/components/cell/cell.js: -------------------------------------------------------------------------------- 1 | // components/cell/cell.js 2 | Component({ 3 | /** 4 | * 组件的属性列表 5 | */ 6 | properties: { 7 | 8 | }, 9 | 10 | /** 11 | * 组件的初始数据 12 | */ 13 | data: { 14 | 15 | }, 16 | 17 | /** 18 | * 组件的方法列表 19 | */ 20 | methods: { 21 | 22 | } 23 | }) 24 | -------------------------------------------------------------------------------- /miniprogram/components/cell/cell.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /miniprogram/components/cell/cell.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /miniprogram/components/cell/cell.wxss: -------------------------------------------------------------------------------- 1 | /* components/cell/cell.wxss */ 2 | .cell{ 3 | width: 100%; 4 | background: #FFFFFF; 5 | border: 4rpx solid #000000; 6 | box-shadow: 0rpx 4rpx 0rpx #000; 7 | border-radius: 32rpx; 8 | box-sizing: border-box; 9 | } -------------------------------------------------------------------------------- /miniprogram/components/contain/contain.js: -------------------------------------------------------------------------------- 1 | // components/navigationbar/navigationbar.js 2 | Component({ 3 | options: { 4 | multipleSlots: true // 在组件定义时的选项中启用多slot支持 5 | }, 6 | /** 7 | * 组件的初始数据 8 | */ 9 | data: { 10 | height: 0, 11 | }, 12 | // 胶囊按钮高度获取 13 | ready() { 14 | wx.getSystemInfo({ 15 | success: (e) => { 16 | let info = wx.getMenuButtonBoundingClientRect(); 17 | this.setData({ 18 | height: (1.5*info.top)+info.height, // 返回按钮与文本的位置 19 | }); 20 | }, 21 | }); 22 | } 23 | }) -------------------------------------------------------------------------------- /miniprogram/components/contain/contain.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /miniprogram/components/contain/contain.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /miniprogram/components/contain/contain.wxss: -------------------------------------------------------------------------------- 1 | /* components/contain/contain.wxss */ 2 | .contain{ 3 | height: 100%; 4 | overflow: scroll; 5 | box-sizing: border-box; 6 | } -------------------------------------------------------------------------------- /miniprogram/components/icon/icon.js: -------------------------------------------------------------------------------- 1 | // components/activity/activity.js 2 | Component({ 3 | /** 4 | * 组件的属性列表 5 | */ 6 | properties: { 7 | type:{ 8 | type:String, 9 | value:'arrow' 10 | }, 11 | size:{ 12 | type:String, 13 | value:'80' 14 | }, 15 | round:{ 16 | type:Boolean, 17 | value:false 18 | }, 19 | border:{ 20 | type:Boolean, 21 | value:true 22 | }, 23 | }, 24 | 25 | /** 26 | * 组件的初始数据 27 | */ 28 | data: { 29 | 30 | }, 31 | 32 | /** 33 | * 组件的方法列表 34 | */ 35 | methods: { 36 | 37 | } 38 | }) 39 | -------------------------------------------------------------------------------- /miniprogram/components/icon/icon.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /miniprogram/components/icon/icon.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /miniprogram/components/missbox/missbox.js: -------------------------------------------------------------------------------- 1 | // components/activity/activity.js 2 | Component({ 3 | /** 4 | * 组件的属性列表 5 | */ 6 | properties: { 7 | type:{ 8 | type:String, 9 | value:'arrow' 10 | }, 11 | size:{ 12 | type:String, 13 | value:'300' 14 | }, 15 | tit:{ 16 | type:String, 17 | value:'暂无数据哦' 18 | }, 19 | dark:{ 20 | type:Boolean, 21 | value:false 22 | }, 23 | }, 24 | 25 | /** 26 | * 组件的初始数据 27 | */ 28 | data: { 29 | 30 | }, 31 | 32 | /** 33 | * 组件的方法列表 34 | */ 35 | methods: { 36 | 37 | } 38 | }) 39 | -------------------------------------------------------------------------------- /miniprogram/components/missbox/missbox.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /miniprogram/components/missbox/missbox.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{tit}} 7 | -------------------------------------------------------------------------------- /miniprogram/components/missbox/missbox.wxss: -------------------------------------------------------------------------------- 1 | /* components/missbox/missbox.wxss */ 2 | 3 | .miss-box{ 4 | text-align: center; 5 | color: #fff; 6 | } 7 | 8 | .miss { 9 | width: 100%; 10 | height: 350rpx; 11 | box-sizing: border-box; 12 | margin: 50rpx auto; 13 | display: inline-flex; 14 | align-items: center; 15 | justify-content: center; 16 | } 17 | .tit{ 18 | font-size: 36rpx; 19 | font-weight: bold; 20 | margin-bottom: 100rpx; 21 | } 22 | .miss-nodata{ 23 | width: 100%; 24 | height: 100%; 25 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVUAAAFVCAYAAABfDHwuAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABp7SURBVHgB7d3veRPHFsfxY577Pr4VsFQQUkGWCkIqiKgAqABRQUwFNhUAFXhTAaYCbSqAVHDuHO8oCF1JlrRndmd2v5/n2cgBY8tr6bez8+eMCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGbnQgqhqpfh4TL+7+bHAKbrWzzuP764uPgmmcsmVGNoVuF4Go+f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0K1IHH0+7WkUQkAzJH6LOv8PwIAc6W+ZQsJVcAJk/8Lpd28Ult15LapX+he4PUA9ESfaqE2qugPtmQWwMMI1YJZsIbjF8l7axgAKI92VbPoUwUAL9qzkr4A6I2BiQkK+fg8PNjxWH6cf2r9sNYH+052LCKgChQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADG9T+5TyRGkOMBmAAAAABJRU5ErkJggg=="); 26 | background-size: contain; 27 | background-position: center center; 28 | background-repeat: no-repeat; 29 | } 30 | .miss-err{ 31 | width: 100%; 32 | height: 100%; 33 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABcHSURBVHgB7Z3veds4EsYn99z39VVw3AqSrWDpCtZbQZQK1qnAcgVJKpC2AjsViFuBnQrIq8BJBe9hDDCiaf4BSIAEyfk9DyLHJimKwgtgBoMBkSAIgiAIgiAIgiAIgiDEzhsSNg2ARL28U+VClcS8/mL+nDSc8t2UH+a1MOX7mzdvHmlliEA2ghICV/x3prxVJaVmAYyFRVKo8k2VjP+vhPOdFooIZMUoUbAYUlX+oHMvMQcsmn9UuVdiyWhBiEBWhhJFql5+V2VHYXqIsXBvcq/KVyWWe4ocEcgKMMOnHemeIqXlUJAeht0qsRQUISKQBWOE8Zcq1zTf8MkXR1X+jm0IJgJZICsTRp1MlQ+x9ihC5Chx7FR5wvo5QLugZ0V6kIVgKsuBlmVjjKUgbZ8caSb+RUL0KHHwcOqBtiUOJlHlMGdvIj1IxEDbGjekbY2tU6jy59Sz9SKQSDEtJs8TvCWhyk6J5G+aCBliRYgRx4lEHE0c1fO5oYmQHiQyKuJISOhir3qSWwqMCCQiRBzOBB9uiUAiQgmExZGSYAvHdV2GNNzFBokEM65OSXCBvXx3xtsXBBFIBEBH4O5JGEJC2hUeBBliRYASSE5id4zlMkSg42w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27sGDm3KjTltJxkFp+thTDe809Cf7ANEJhTgg40YeXm9nwkGRu0XRuvtryGcYIg9mTJWKkO4KwxnwdXpPwlV/HeJFsgB7qJXT2MpU/+6Q09J/3SCe95VlhezJ0z8LPPqXhfHDxKopABmK+LPaYTGXklWLJpvS4mFa9dMkm5vW/5s9Jwymlh+sHvdzXsBhy3+b9d6Td2ikNp1DlT3UPjyRMB8LNzHdxgjZgU1ohOA8DeQjoI4qAJwwTEuYD45fZjqEMUFxUzFUVnKMFDvC7ZfXnMfclQ6wAQPvWeQJvDh97QXp8X47zH0PbL0OAHjqlpvxO/u2dgrS9kdEIRCABge7Wd6TFktB8lCEkHD5SmJ+/TzEeN0Io7ZhqmElC4bhV5bOPhkEEMhE4x1C9p7iohpDwa2lcl4XM79soBcAkdA41qRr2U5FRT5yWKyKQiTG9SkrTxVBtgYx0nFZGnhGBzEhEQ7ClklEgYZSIQCLBeKB2pP39CQldZBRYGCUikAgxYmEPGItlsa5bz7A99IU8Gd+2iEAip2KzlDPJQWK0IoWFcK/K31P0Fk2IQBaG8YZxr1L2LmsTDIvib9LCmH0ORwSycCqCKSfbEloWLICM9MTmfWwr+0QgKwPn4MJSLDwxV/5ubqoTls7RvHMgAtkQxp7hUo/MTcwhFzR8cq86uVjQec06/8xiKOYeLg1BBCJ0UgkVaUSSHQiCIAiCIAiCIAiCIAjC3Pwfpc6Mmcn982EAAAAASUVORK5CYII="); 34 | background-size: contain; 35 | background-position: center center; 36 | background-repeat: no-repeat; 37 | } 38 | 39 | .miss-loading { 40 | margin: 0 auto; 41 | width: 40rpx !important; 42 | height: 40rpx !important; 43 | border-radius: 40rpx; 44 | background-color: #FFE142; 45 | position: relative; 46 | animation: dot 1s linear infinite forwards; 47 | animation-delay: .2s; 48 | } 49 | 50 | .miss-loading::after { 51 | position: absolute; 52 | content: ''; 53 | width: 40rpx; 54 | height: 40rpx; 55 | border-radius: 40rpx; 56 | background-color: #FFE142; 57 | left: 100rpx; 58 | animation: dot 1s linear infinite; 59 | 60 | } 61 | 62 | .miss-loading::before { 63 | position: absolute; 64 | content: ''; 65 | width: 40rpx; 66 | height: 40rpx; 67 | border-radius: 40rpx; 68 | background-color: #FFE142; 69 | right: 100rpx; 70 | animation: dot 1s linear infinite forwards; 71 | animation-delay: .4s; 72 | 73 | } 74 | 75 | @keyframes dot { 76 | from { 77 | background-color: transparent; 78 | } 79 | 80 | to { 81 | background-color: #FFE142; 82 | } 83 | } -------------------------------------------------------------------------------- /miniprogram/components/navbar/navbar.js: -------------------------------------------------------------------------------- 1 | // components/navigationbar/navigationbar.js 2 | Component({ 3 | options: { 4 | multipleSlots: true // 在组件定义时的选项中启用多slot支持 5 | }, 6 | /** 7 | * 组件的属性列表 8 | */ 9 | properties: { 10 | title: { 11 | type: String, 12 | value: '' 13 | }, 14 | color: { 15 | type: String, 16 | value: '#fff' 17 | }, 18 | bgColor: { 19 | type: String, 20 | value: 'transparent' 21 | }, 22 | delta:{ 23 | type: Number, 24 | value: 2 25 | } 26 | }, 27 | 28 | /** 29 | * 组件的初始数据 30 | */ 31 | data: { 32 | navPadding: 0, // 返回按钮与文本的位置 33 | navHeight: 0, 34 | 35 | }, 36 | // 胶囊按钮高度获取 37 | ready() { 38 | wx.getSystemInfo({ 39 | success: (e) => { 40 | let info = wx.getMenuButtonBoundingClientRect(); 41 | this.setData({ 42 | navPadding: info.top, // 返回按钮与文本的位置 43 | navHeight: info.height, 44 | }); 45 | }, 46 | }); 47 | }, 48 | /** 49 | * 组件的方法列表 50 | */ 51 | methods: { 52 | goBack() { 53 | wx.navigateBack({ 54 | delta: this.data.delta 55 | }) 56 | } 57 | }, 58 | }) -------------------------------------------------------------------------------- /miniprogram/components/navbar/navbar.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "icon":"../icon/icon" 5 | } 6 | } -------------------------------------------------------------------------------- /miniprogram/components/navbar/navbar.wxml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | {{title}} 10 | 11 | 12 | -------------------------------------------------------------------------------- /miniprogram/components/navbar/navbar.wxss: -------------------------------------------------------------------------------- 1 | /* components/navbar/navbar.wxss */ 2 | /* components/navigationbar/navigationbar.wxss */ 3 | .nav-box { 4 | display: flex; 5 | align-items: center; 6 | justify-content: center; 7 | box-sizing: content-box; 8 | position: fixed; 9 | top: 0; 10 | left: 0; 11 | width: 100%; 12 | text-align: center; 13 | z-index: 2; 14 | } 15 | 16 | .nav-box .nav-icon { 17 | width: 70rpx; 18 | height: 70rpx; 19 | position: absolute; 20 | left: 32rpx; 21 | background: #fff; 22 | border: 4rpx solid #18191F; 23 | box-sizing: border-box; 24 | border-radius: 70rpx; 25 | box-shadow: var(--box-shadow); 26 | } 27 | 28 | .nav-box .nav-icon::after { 29 | content: ''; 30 | position: absolute; 31 | top: 0; 32 | bottom: -1rpx; 33 | right: 0; 34 | left: 3px; 35 | margin: auto; 36 | width: 20rpx; 37 | height: 20rpx; 38 | border-top: 5rpx solid #18191F; 39 | border-right: 5rpx solid #18191F; 40 | transform: rotate(-135deg); 41 | border-radius: 5rpx; 42 | } 43 | 44 | .nav-box .nav-tit { 45 | font-weight: normal; 46 | font-size: 36rpx; 47 | color: #fff; 48 | font-weight: bold; 49 | text-align: center; 50 | } -------------------------------------------------------------------------------- /miniprogram/components/page/page.js: -------------------------------------------------------------------------------- 1 | // components/page/page.js 2 | Component({ 3 | /** 4 | * 组件的属性列表 5 | */ 6 | properties: { 7 | pageid: { 8 | type: Number, 9 | value: 0 10 | }, 11 | pagenum: { 12 | type: Number, 13 | value: 0 14 | } 15 | }, 16 | 17 | /** 18 | * 组件的初始数据 19 | */ 20 | data: { 21 | 22 | }, 23 | 24 | /** 25 | * 组件的方法列表 26 | */ 27 | methods: { 28 | prepage() { 29 | this.triggerEvent('prepage', false); 30 | }, 31 | nextpage() { 32 | this.triggerEvent('nextpage', false); 33 | }, 34 | } 35 | }) -------------------------------------------------------------------------------- /miniprogram/components/page/page.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "icon":"../icon/icon", 5 | "btn":"../btn/btn" 6 | } 7 | } -------------------------------------------------------------------------------- /miniprogram/components/page/page.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{pageid}}/{{pagenum}} 5 | 6 | -------------------------------------------------------------------------------- /miniprogram/components/page/page.wxss: -------------------------------------------------------------------------------- 1 | /* components/page/page.wxss */ 2 | .page { 3 | display: flex; 4 | align-items: center; 5 | width: 490rpx; 6 | justify-content: space-between; 7 | margin: 20rpx auto; 8 | } -------------------------------------------------------------------------------- /miniprogram/components/popbox/popbox.js: -------------------------------------------------------------------------------- 1 | // components/popbox/popbox.js 2 | Component({ 3 | // 启用插槽 4 | options: { 5 | multipleSlots: true 6 | }, 7 | /** 8 | * 组件的属性列表 9 | */ 10 | properties: { 11 | }, 12 | 13 | /** 14 | * 组件的初始数据 15 | */ 16 | data: { 17 | }, 18 | 19 | /** 20 | * 组件的方法列表 21 | */ 22 | methods: { 23 | close() { 24 | this.triggerEvent('close', false); 25 | }, 26 | }, 27 | }) -------------------------------------------------------------------------------- /miniprogram/components/popbox/popbox.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "cell":"../cell/cell", 5 | "icon":"../icon/icon" 6 | } 7 | } -------------------------------------------------------------------------------- /miniprogram/components/popbox/popbox.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /miniprogram/components/popbox/popbox.wxss: -------------------------------------------------------------------------------- 1 | /* components/popbox/popbox.wxss */ 2 | /* components/popbox/popbox.wxss */ 3 | .popbox-box { 4 | position: relative; 5 | position: fixed; 6 | top: 0; 7 | left: 0; 8 | z-index: 99; 9 | display: flex; 10 | justify-content: center; 11 | width: 100%; 12 | height: 100%; 13 | background: rgba(0, 0, 0, 0.7); 14 | align-items: center; 15 | overflow: hidden; 16 | } 17 | 18 | .popbox { 19 | width: 600rpx; 20 | margin: 0 auto; 21 | box-sizing: border-box; 22 | position: relative; 23 | } 24 | 25 | .content { 26 | padding: 50rpx 30rpx; 27 | background: #fff; 28 | border: 4rpx solid #000000; 29 | box-sizing: border-box; 30 | box-shadow: var(--box-shadow); 31 | background: #fff; 32 | border-radius: 32rpx; 33 | } 34 | 35 | /* 按钮 */ 36 | .popbox-box .popbox-close { 37 | position: absolute; 38 | right: -40rpx; 39 | top: -40rpx; 40 | } -------------------------------------------------------------------------------- /miniprogram/components/styleitem/styleitem.js: -------------------------------------------------------------------------------- 1 | // pages/styleitem/styleitem.js 2 | Component({ 3 | /** 4 | * 组件的属性列表 5 | */ 6 | properties: { 7 | cover: { 8 | type: String, 9 | value: '' 10 | }, 11 | tit: { 12 | type: String, 13 | value: '标题名称' 14 | }, 15 | avatar: { 16 | type: String, 17 | value: '' 18 | }, 19 | username: { 20 | type: String, 21 | value: 'xierchen' 22 | }, 23 | num: { 24 | type: Number, 25 | value: 0 26 | } 27 | }, 28 | 29 | /** 30 | * 组件的初始数据 31 | */ 32 | data: { 33 | 34 | }, 35 | 36 | /** 37 | * 组件的方法列表 38 | */ 39 | methods: { 40 | 41 | } 42 | }) -------------------------------------------------------------------------------- /miniprogram/components/styleitem/styleitem.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "cell":"../cell/cell", 5 | "avatar":"../avatar/avatar" 6 | } 7 | } -------------------------------------------------------------------------------- /miniprogram/components/styleitem/styleitem.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | {{tit}} 9 | 10 | 14 | 15 | {{num}} 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /miniprogram/components/styleitem/styleitem.wxss: -------------------------------------------------------------------------------- 1 | /* pages/styleitem/styleitem.wxss */ 2 | .item { 3 | width: 330rpx; 4 | box-sizing: border-box; 5 | display: inline-block; 6 | } 7 | 8 | .img { 9 | margin: 20rpx; 10 | margin-right: 30rpx; 11 | width:280rpx; 12 | height: 280rpx; 13 | } 14 | 15 | .img image { 16 | width: 100%; 17 | height: 100%; 18 | border: 4rpx solid #FFFFFF; 19 | border-radius: 25rpx; 20 | box-sizing: border-box; 21 | } 22 | 23 | /* 内容 */ 24 | .content { 25 | margin: 15rpx; 26 | } 27 | 28 | .tit { 29 | font-size: 36rpx; 30 | font-weight: bold; 31 | margin-bottom: 10rpx; 32 | text-align: left; 33 | } 34 | 35 | .user { 36 | display: flex; 37 | align-items: center; 38 | justify-content: space-between; 39 | } 40 | 41 | .user-info { 42 | display: flex; 43 | align-items: center; 44 | } 45 | 46 | .user-name { 47 | margin-left: 15rpx; 48 | font-size: 24rpx; 49 | } 50 | 51 | .user-num { 52 | position: relative; 53 | display: flex; 54 | align-items: center; 55 | font-size: 24rpx; 56 | } 57 | 58 | .user-num::before { 59 | content: ''; 60 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAcCAYAAACQ0cTtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACaSURBVHgB7ZZJDYAwEEU/KEACEpCABCQgAQfUARKwgAQcgBNAQRmSORBIWbrAZV7yU2ibeemhCyD8REaZuH1FjPckuwSXWSMykYnMSE1pbua0lAoeZAsXai9EJSxOFBOKorlwzt85/2se94riwiO3QyjRUahDi45ChY9IIeyIDP3ble+6b/onkzaR9pDTG8W0sgJuK5spHYQQrFRqLIYCpZXEAAAAAElFTkSuQmCC'); 61 | width: 27rpx; 62 | height: 27rpx; 63 | background-size: contain; 64 | } -------------------------------------------------------------------------------- /miniprogram/images/demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/demo.png -------------------------------------------------------------------------------- /miniprogram/images/img/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/img/bg.png -------------------------------------------------------------------------------- /miniprogram/images/img/col2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/img/col2.png -------------------------------------------------------------------------------- /miniprogram/images/img/col3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/img/col3.png -------------------------------------------------------------------------------- /miniprogram/images/img/col4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/img/col4.png -------------------------------------------------------------------------------- /miniprogram/images/img/eye.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/img/eye.png -------------------------------------------------------------------------------- /miniprogram/images/img/one.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/img/one.png -------------------------------------------------------------------------------- /miniprogram/images/img/po7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/img/po7.png -------------------------------------------------------------------------------- /miniprogram/images/img/re7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/img/re7.png -------------------------------------------------------------------------------- /miniprogram/images/img/row2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/img/row2.png -------------------------------------------------------------------------------- /miniprogram/images/img/row3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/img/row3.png -------------------------------------------------------------------------------- /miniprogram/images/img/row4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/img/row4.png -------------------------------------------------------------------------------- /miniprogram/images/img/tian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/img/tian.png -------------------------------------------------------------------------------- /miniprogram/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/logo.png -------------------------------------------------------------------------------- /miniprogram/images/upload/col2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/upload/col2.png -------------------------------------------------------------------------------- /miniprogram/images/upload/col3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/upload/col3.png -------------------------------------------------------------------------------- /miniprogram/images/upload/col4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/upload/col4.png -------------------------------------------------------------------------------- /miniprogram/images/upload/demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/upload/demo.png -------------------------------------------------------------------------------- /miniprogram/images/upload/demo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/upload/demo1.png -------------------------------------------------------------------------------- /miniprogram/images/upload/demo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/upload/demo2.png -------------------------------------------------------------------------------- /miniprogram/images/upload/eye.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/upload/eye.png -------------------------------------------------------------------------------- /miniprogram/images/upload/grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/upload/grid.png -------------------------------------------------------------------------------- /miniprogram/images/upload/one.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/upload/one.png -------------------------------------------------------------------------------- /miniprogram/images/upload/po7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/upload/po7.png -------------------------------------------------------------------------------- /miniprogram/images/upload/re7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/upload/re7.png -------------------------------------------------------------------------------- /miniprogram/images/upload/row2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/upload/row2.png -------------------------------------------------------------------------------- /miniprogram/images/upload/row3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/upload/row3.png -------------------------------------------------------------------------------- /miniprogram/images/upload/row4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/upload/row4.png -------------------------------------------------------------------------------- /miniprogram/images/upload/rule-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/upload/rule-1.png -------------------------------------------------------------------------------- /miniprogram/images/upload/rule-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/upload/rule-2.png -------------------------------------------------------------------------------- /miniprogram/images/upload/rule-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/upload/rule-3.png -------------------------------------------------------------------------------- /miniprogram/images/upload/rule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/upload/rule.png -------------------------------------------------------------------------------- /miniprogram/images/upload/rules.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/upload/rules.png -------------------------------------------------------------------------------- /miniprogram/images/upload/tian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/miniprogram/images/upload/tian.png -------------------------------------------------------------------------------- /miniprogram/js/artqrcoed.js: -------------------------------------------------------------------------------- 1 | // import drawQrcode from './weapp.qrcode.min.js'; 2 | import QRCode from './getqrcode.js'; 3 | 4 | var datalist = []; 5 | var datacol = null; 6 | var unit = null; 7 | 8 | function getqrcode(qrinfo, imginfo) { 9 | return new Promise((resolve, reject) => { 10 | var qrcodedata = new QRCode({ 11 | width: qrinfo.size, 12 | height: qrinfo.size, 13 | text: qrinfo.text, 14 | colorDark: "black", 15 | colorLight: "transparent", 16 | }); 17 | var qrcode = qrcodedata._oQRCode.modules; 18 | var array = []; 19 | var n = 0; 20 | for (let i = 0; i < qrcode.length; i++) { 21 | array[i] = []; 22 | // 首先遍历tr数组 23 | for (let j = 0; j < qrcode[i].length; j++) { 24 | array[i][j] = []; //第一个是上色情况,第二个是记录情况 25 | // 遍历每个tr里的td,记录每个td的上色情况; 26 | if (qrcode[i][j] == true) { 27 | array[i][j][0] = 1; 28 | array[i][j][1] = 0; 29 | } else { 30 | array[i][j][0] = 0; 31 | array[i][j][1] = 1; 32 | } 33 | n++; 34 | // 首先把3个大框框保存下来; 35 | if ((i < 7 && j < 7) || (i > qrcode.length - 8 && j < 8) || (i < 8 && j > qrcode.length - 8)) { 36 | array[i][j][1] = 1; 37 | } 38 | } 39 | } 40 | // 重新赋值 41 | datalist = array; 42 | datacol = qrcode.length; 43 | unit = (qrinfo.size / datacol).toFixed(2); 44 | var cyt = wx.createCanvasContext(qrinfo.canvasid); 45 | cyt.clearRect(0, 0, qrinfo.size, qrinfo.size); 46 | beginDraw(imginfo, cyt); 47 | resolve() 48 | }) 49 | } 50 | 51 | function getdataimg(qrinfo) { 52 | return new Promise((resolve, reject) => { 53 | var getdata = getimgdata(qrinfo); 54 | getdata.then((res) => { 55 | var getcodetext = new QRDecode(); 56 | var text = getcodetext.decodeImageData(res, qrinfo.size, qrinfo.size); 57 | qrinfo.text = text; 58 | resolve(text); 59 | }) 60 | }) 61 | } 62 | //获取图片像素点 63 | function getimgdata(qrinfo) { 64 | return new Promise((reslove, reject) => { 65 | setTimeout(() => { 66 | wx.canvasGetImageData({ 67 | canvasId: qrinfo.canvasid, 68 | x: 0, 69 | y: 0, 70 | width: qrinfo.size, 71 | height: qrinfo.size, 72 | success(res) { 73 | reslove(res) 74 | }, 75 | }) 76 | }, 1000) 77 | }) 78 | } 79 | 80 | function beginDraw(imginfo, cyt) { 81 | countType(cyt, "array4", 4, imginfo); 82 | countTian(cyt, imginfo.tian); 83 | countType(cyt, "array3", 3, imginfo); 84 | count7(cyt, imginfo); 85 | countType(cyt, "array2", 2, imginfo); 86 | count1(cyt, imginfo.one); 87 | painEye(cyt, imginfo.eye, datacol, unit); 88 | } 89 | // 绘制艺术二维码 90 | function pain(cyt, arrayName, width, height, img) { 91 | //以Canvas画布上的坐标(10,10)为起始点,绘制图像 //图像的宽度和高度分别缩放到350px和100px 92 | if (arrayName.length != 0) { 93 | for (let i = 0; i < arrayName.length; i++) { 94 | cyt.drawImage(img, arrayName[i][0] * unit, arrayName[i][1] * unit, width * unit, height * unit); 95 | } 96 | } else { 97 | return; 98 | } 99 | } 100 | // 绘制艺术二维码 101 | // 对象,图片,长度,单元尺寸 102 | function painEye(cyt, eyeImguUrl, datalistlength, unit) { 103 | cyt.drawImage(eyeImguUrl, 0, 0, 7 * unit, 7 * unit); 104 | cyt.drawImage(eyeImguUrl, (datalistlength - 7) * unit, 0 * unit, 7 * unit, 7 * unit); 105 | cyt.drawImage(eyeImguUrl, 0 * unit, (datalistlength - 7) * unit, 7 * unit, 7 * unit); 106 | cyt.draw(); 107 | } 108 | /* 109 | * 返回判断条件;当数量为4、3、2个方块的; 110 | * 类型有:col和row; 111 | * i,j此时遍历的条件; 112 | */ 113 | function condition(arraylist, num, type, i, j) { 114 | if (num == 4 && type == "row") { 115 | return (arraylist[i][j][0] == 1 && 116 | arraylist[i][j][1] == 0 && 117 | arraylist[i][j + 1][0] == 1 && 118 | arraylist[i][j + 1][1] == 0 && 119 | arraylist[i][j + 2][0] == 1 && 120 | arraylist[i][j + 2][1] == 0 && 121 | arraylist[i][j + 3][0] == 1 && 122 | arraylist[i][j + 3][1] == 0) 123 | } 124 | if (num == 4 && type == "col") { 125 | return (arraylist[i][j][0] == 1 && 126 | arraylist[i][j][1] == 0 && 127 | arraylist[i + 1][j][0] == 1 && 128 | arraylist[i + 1][j][1] == 0 && 129 | arraylist[i + 2][j][0] == 1 && 130 | arraylist[i + 2][j][1] == 0 && 131 | arraylist[i + 3][j][0] == 1 && 132 | arraylist[i + 3][j][1] == 0) 133 | } 134 | if (num == 3 && type == "row") { 135 | return (arraylist[i][j][0] == 1 && 136 | arraylist[i][j][1] == 0 && 137 | arraylist[i][j + 1][0] == 1 && 138 | arraylist[i][j + 1][1] == 0 && 139 | arraylist[i][j + 2][0] == 1 && 140 | arraylist[i][j + 2][1] == 0) 141 | } 142 | if (num == 3 && type == "col") { 143 | return (arraylist[i][j][0] == 1 && 144 | arraylist[i][j][1] == 0 && 145 | arraylist[i + 1][j][0] == 1 && 146 | arraylist[i + 1][j][1] == 0 && 147 | arraylist[i + 2][j][0] == 1 && 148 | arraylist[i + 2][j][1] == 0) 149 | } 150 | if (num == 2 && type == "row") { 151 | return (arraylist[i][j][0] == 1 && 152 | arraylist[i][j][1] == 0 && 153 | arraylist[i][j + 1][0] == 1 && 154 | arraylist[i][j + 1][1] == 0) 155 | } 156 | if (num == 2 && type == "col") { 157 | return (arraylist[i][j][0] == 1 && 158 | arraylist[i][j][1] == 0 && 159 | arraylist[i + 1][j][0] == 1 && 160 | arraylist[i + 1][j][1] == 0) 161 | } 162 | } 163 | /* 164 | *返回判断条件;当数量为4、3、2个方块的; 165 | * 类型有:col和row; 166 | * i,j此时遍历的条件; 167 | */ 168 | function countType(cyt, arrayType, num, imginfo) { 169 | var obj = { 170 | array4: { 171 | row: null, 172 | col: null 173 | }, 174 | array3: { 175 | row: null, 176 | col: null 177 | }, 178 | array2: { 179 | row: null, 180 | col: null 181 | }, 182 | } 183 | var col = 0; 184 | obj[arrayType].col = []; 185 | var row = 0; 186 | obj[arrayType].row = []; 187 | if (imginfo[`row${num}`] || imginfo[`col${num}`]) { 188 | for (let i = 0; i < datacol; i++) { 189 | // 遍历每一个数组里的值 190 | for (let j = 0; j < datacol; j++) { 191 | // 如果这个小方块没有上色或者这个小方块被记录过了,那么我们就不用管它了! 192 | if (datalist[i][j][1] == 1) { 193 | continue; 194 | } else { 195 | // 随机记录行竖4 196 | if (parseInt(Math.random() * 2) == 1) { 197 | if (imginfo[`col${num}`]) { 198 | // 判断是否超出; 199 | if (i >= datacol - num) { 200 | continue; 201 | } else { 202 | // 否则判断他是否是竖4。 203 | if (condition(datalist, num, "col", i, j)) { 204 | // 现在col4已经被记录了; 205 | for (let k = 0; k < num; k++) { 206 | datalist[i + k][j][1] = 1 207 | } 208 | // 把竖4的i,j记录进去; 209 | // 开始收收集4行的小方块数据; 210 | obj[arrayType].col[col] = []; 211 | obj[arrayType].col[col][0] = j; 212 | obj[arrayType].col[col][1] = i 213 | col = col + 1; 214 | } else { 215 | continue; 216 | } 217 | } 218 | } else { 219 | continue; 220 | } 221 | } else { 222 | if (imginfo[`row${num}`]) { 223 | if (j >= datacol - num) { 224 | continue; 225 | } else { 226 | 227 | if (condition(datalist, num, "row", i, j)) { 228 | // 现在row4已经被记录了; 229 | for (let k = 0; k < num; k++) { 230 | datalist[i][j + k][1] = 1 231 | } 232 | // 把横4的i,j记录进去; 233 | obj[arrayType].row[row] = []; 234 | obj[arrayType].row[row][0] = j; 235 | obj[arrayType].row[row][1] = i 236 | row = row + 1; 237 | } else { 238 | continue; 239 | } 240 | } 241 | } else { 242 | continue 243 | } 244 | } 245 | } 246 | } 247 | } 248 | if (imginfo[`col${num}`]) { 249 | pain(cyt, obj[arrayType].col, 1, num, imginfo[`col${num}`]); 250 | } 251 | if (imginfo[`row${num}`]) { 252 | pain(cyt, obj[arrayType].row, num, 1, imginfo[`row${num}`]); 253 | } 254 | } else { 255 | return 256 | } 257 | } 258 | // 统计田 259 | function countTian(cyt, img) { 260 | if (img) { 261 | var tian = 0; 262 | var arrayTian = []; 263 | for (let i = 0; i < datacol - 2; i++) { 264 | // 遍历每一个数组里的值 265 | for (let j = 0; j < datacol - 2; j++) { 266 | // 如果这个小方块没有上色或者这个小方块被记录过了,那么我们就不用管它了! 267 | if (datalist[i][j][1] == 1) { 268 | continue; 269 | } else { 270 | if ( 271 | datalist[i][j][0] == 1 && 272 | datalist[i][j][1] == 0 && 273 | datalist[i + 1][j][0] == 1 && 274 | datalist[i + 1][j][1] == 0 && 275 | datalist[i][j + 1][0] == 1 && 276 | datalist[i][j + 1][1] == 0 && 277 | datalist[i + 1][j + 1][0] == 1 && 278 | datalist[i + 1][j + 1][1] == 0) { 279 | // 现在positive7已经被记录了; 280 | datalist[i][j][1] = 1 281 | datalist[i + 1][j][1] = 1 282 | datalist[i][j + 1][1] = 1 283 | datalist[i + 1][j + 1][1] = 1 284 | // 把竖7的i,j记录进去; 285 | // 开始收收集7行的小方块数据; 286 | arrayTian[tian] = []; 287 | arrayTian[tian][0] = j; 288 | arrayTian[tian][1] = i 289 | tian = tian + 1; 290 | } else { 291 | continue; 292 | } 293 | } 294 | } 295 | } 296 | pain(cyt, arrayTian, 2, 2, img); 297 | } else { 298 | return 299 | } 300 | 301 | } 302 | // 统计方块反7正7的个数 303 | function count7(cyt, imginfo) { 304 | var positive7 = 0; 305 | var reverse7 = 0; 306 | var arrayPositive7 = []; 307 | var arrayRever7 = []; 308 | if (imginfo.re7 || imginfo.po7) { 309 | for (let i = 0; i < datacol - 2; i++) { 310 | // 遍历每一个数组里的值 311 | for (let j = 0; j < datacol - 2; j++) { 312 | // 如果这个小方块没有上色或者这个小方块被记录过了,那么我们就不用管它了! 313 | if (datalist[i][j][1] == 1) { 314 | continue; 315 | } else { 316 | // 随机记录正反7 317 | if (parseInt(Math.random() * 2) == 1) { 318 | if (imginfo.po7) { 319 | // 判断是否超出; 320 | // 否则判断他是否是正7。 321 | if (datalist[i][j][0] == 1 && 322 | datalist[i][j][1] == 0 && 323 | datalist[i + 1][j][0] == 0 && 324 | datalist[i][j + 1][0] == 1 && 325 | datalist[i][j + 1][1] == 0 && 326 | datalist[i + 1][j + 1][0] == 1 && 327 | datalist[i + 1][j + 1][1] == 0) { 328 | // 现在positive7已经被记录了; 329 | datalist[i][j][1] = 1 330 | datalist[i][j + 1][1] = 1 331 | datalist[i + 1][j + 1][1] = 1 332 | // 把竖7的i,j记录进去; 333 | // 开始收收集7行的小方块数据; 334 | arrayPositive7[positive7] = []; 335 | arrayPositive7[positive7][0] = j; 336 | arrayPositive7[positive7][1] = i 337 | positive7 = positive7 + 1; 338 | } else { 339 | continue; 340 | } 341 | } else { 342 | continue 343 | } 344 | } else { 345 | if (imginfo.re7) { 346 | // 反7 347 | if (datalist[i][j][0] == 1 && 348 | datalist[i][j][1] == 0 && 349 | datalist[i + 1][j + 1][0] == 0 && 350 | datalist[i][j + 1][0] == 1 && 351 | datalist[i][j + 1][1] == 0 && 352 | datalist[i + 1][j][0] == 1 && 353 | datalist[i + 1][j][1] == 0) { 354 | // 现在positive7已经被记录了; 355 | datalist[i][j][1] = 1 356 | datalist[i][j + 1][1] = 1 357 | datalist[i + 1][j][1] = 1 358 | // 把竖7的i,j记录进去; 359 | // 开始收收集7行的小方块数据; 360 | arrayRever7[reverse7] = []; 361 | arrayRever7[reverse7][0] = j; 362 | arrayRever7[reverse7][1] = i 363 | reverse7 = reverse7 + 1; 364 | } else { 365 | continue; 366 | } 367 | } else { 368 | continue 369 | } 370 | // 开始收收集7行的小方块数据; 371 | // 否则判断他是否是横7。 372 | } 373 | } 374 | } 375 | } 376 | if (imginfo.re7) { 377 | pain(cyt, arrayRever7, 2, 2, imginfo.re7) 378 | } 379 | if (imginfo.po7) { 380 | pain(cyt, arrayPositive7, 2, 2, imginfo.po7) 381 | } 382 | } else { 383 | return 384 | } 385 | } 386 | // 统计剩余1单个方块 387 | function count1(cyt, img) { 388 | if (img) { 389 | var col1 = 0; 390 | var array1 = []; 391 | for (let i = 0; i < datacol; i++) { 392 | // 遍历每一个数组里的值 393 | for (let j = 0; j < datacol; j++) { 394 | // 如果这个小方块没有上色或者这个小方块被记录过了,那么我们就不用管它了! 395 | if (datalist[i][j][1] == 1) { 396 | continue; 397 | } else { 398 | datalist[i][j][1] = 1 399 | // 剩下的按单个记录保存; 400 | array1[col1] = []; 401 | array1[col1][0] = j; 402 | array1[col1][1] = i 403 | col1 = col1 + 1; 404 | } 405 | } 406 | } 407 | pain(cyt, array1, 1, 1, img); 408 | } else { 409 | return 410 | } 411 | } 412 | export default { 413 | getqrcode 414 | }; -------------------------------------------------------------------------------- /miniprogram/js/common.js: -------------------------------------------------------------------------------- 1 | // 图片转base64 2 | function urlTobase64(imgPath) { 3 | return new Promise((resolve, reject) => { 4 | //读取图片的base64文件内容 5 | wx.getFileSystemManager().readFile({ 6 | filePath: imgPath, //选择图片返回的相对路径 7 | encoding: 'base64', //编码格式 8 | success: (res) => { 9 | var data = res.data; 10 | resolve(data) 11 | }, //成功的回调 12 | fail: (err) => { 13 | reject(err) 14 | } 15 | }) 16 | }) 17 | } 18 | // 上传单张图片 19 | function uploadSingleImg(base64) { 20 | return new Promise((resolve, reject) => { 21 | wx.cloud.callFunction({ 22 | // 需调用的云函数名 23 | name: 'uploadImg', 24 | // 传给云函数的参数 25 | data: { 26 | file_data: base64 27 | }, 28 | // 成功回调 29 | complete: (res) => { 30 | resolve(res.result.fileID) 31 | } 32 | }) 33 | }) 34 | } 35 | 36 | async function checkText(text) { 37 | return new Promise((resolve, reject) => { 38 | // 先鉴黄 39 | wx.cloud.callFunction({ 40 | // 需调用的云函数名 41 | name: 'checkeText', 42 | // 传给云函数的参数 43 | data: { 44 | txt: text 45 | }, 46 | // 成功回调 47 | complete: (res) => { 48 | resolve(res.result); // 将结果传递给 resolve 方法 49 | }, 50 | // 失败回调 51 | fail: (error) => { 52 | reject(error); // 如果有错误,传递给 reject 方法 53 | } 54 | }); 55 | }); 56 | } 57 | 58 | export default { 59 | urlTobase64, 60 | uploadSingleImg, 61 | checkText 62 | } -------------------------------------------------------------------------------- /miniprogram/js/getqrcode.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileoverview 3 | * - Using the 'QRCode for Javascript library' 4 | * - Fixed dataset of 'QRCode for Javascript library' for support full-spec. 5 | * - this library has no dependencies. 6 | * 7 | * @author davidshimjs 8 | * @see http://www.d-project.com/ 9 | * @see http://jeromeetienne.github.com/jquery-qrcode/ 10 | */ 11 | var QRCode; 12 | 13 | //--------------------------------------------------------------------- 14 | // QRCode for JavaScript 15 | // 16 | // Copyright (c) 2009 Kazuhiko Arase 17 | // 18 | // URL: http://www.d-project.com/ 19 | // 20 | // Licensed under the MIT license: 21 | // http://www.opensource.org/licenses/mit-license.php 22 | // 23 | // The word "QR Code" is registered trademark of 24 | // DENSO WAVE INCORPORATED 25 | // http://www.denso-wave.com/qrcode/faqpatent-e.html 26 | // 27 | //--------------------------------------------------------------------- 28 | function QR8bitByte(data) { 29 | this.mode = QRMode.MODE_8BIT_BYTE; 30 | this.data = data; 31 | this.parsedData = []; 32 | 33 | // Added to support UTF-8 Characters 34 | for (var i = 0, l = this.data.length; i < l; i++) { 35 | var byteArray = []; 36 | var code = this.data.charCodeAt(i); 37 | 38 | if (code > 0x10000) { 39 | byteArray[0] = 0xF0 | ((code & 0x1C0000) >>> 18); 40 | byteArray[1] = 0x80 | ((code & 0x3F000) >>> 12); 41 | byteArray[2] = 0x80 | ((code & 0xFC0) >>> 6); 42 | byteArray[3] = 0x80 | (code & 0x3F); 43 | } else if (code > 0x800) { 44 | byteArray[0] = 0xE0 | ((code & 0xF000) >>> 12); 45 | byteArray[1] = 0x80 | ((code & 0xFC0) >>> 6); 46 | byteArray[2] = 0x80 | (code & 0x3F); 47 | } else if (code > 0x80) { 48 | byteArray[0] = 0xC0 | ((code & 0x7C0) >>> 6); 49 | byteArray[1] = 0x80 | (code & 0x3F); 50 | } else { 51 | byteArray[0] = code; 52 | } 53 | 54 | this.parsedData.push(byteArray); 55 | } 56 | 57 | this.parsedData = Array.prototype.concat.apply([], this.parsedData); 58 | 59 | if (this.parsedData.length != this.data.length) { 60 | this.parsedData.unshift(191); 61 | this.parsedData.unshift(187); 62 | this.parsedData.unshift(239); 63 | } 64 | } 65 | 66 | QR8bitByte.prototype = { 67 | getLength: function (buffer) { 68 | return this.parsedData.length; 69 | }, 70 | write: function (buffer) { 71 | for (var i = 0, l = this.parsedData.length; i < l; i++) { 72 | buffer.put(this.parsedData[i], 8); 73 | } 74 | } 75 | }; 76 | 77 | function QRCodeModel(typeNumber, errorCorrectLevel) { 78 | this.typeNumber = typeNumber; 79 | this.errorCorrectLevel = errorCorrectLevel; 80 | this.modules = null; 81 | this.moduleCount = 0; 82 | this.dataCache = null; 83 | this.dataList = []; 84 | } 85 | 86 | QRCodeModel.prototype={addData:function(data){var newData=new QR8bitByte(data);this.dataList.push(newData);this.dataCache=null;},isDark:function(row,col){if(row<0||this.moduleCount<=row||col<0||this.moduleCount<=col){throw new Error(row+","+col);} 87 | return this.modules[row][col];},getModuleCount:function(){return this.moduleCount;},make:function(){this.makeImpl(false,this.getBestMaskPattern());},makeImpl:function(test,maskPattern){this.moduleCount=this.typeNumber*4+17;this.modules=new Array(this.moduleCount);for(var row=0;row=7){this.setupTypeNumber(test);} 89 | if(this.dataCache==null){this.dataCache=QRCodeModel.createData(this.typeNumber,this.errorCorrectLevel,this.dataList);} 90 | this.mapData(this.dataCache,maskPattern);},setupPositionProbePattern:function(row,col){for(var r=-1;r<=7;r++){if(row+r<=-1||this.moduleCount<=row+r)continue;for(var c=-1;c<=7;c++){if(col+c<=-1||this.moduleCount<=col+c)continue;if((0<=r&&r<=6&&(c==0||c==6))||(0<=c&&c<=6&&(r==0||r==6))||(2<=r&&r<=4&&2<=c&&c<=4)){this.modules[row+r][col+c]=true;}else{this.modules[row+r][col+c]=false;}}}},getBestMaskPattern:function(){var minLostPoint=0;var pattern=0;for(var i=0;i<8;i++){this.makeImpl(true,i);var lostPoint=QRUtil.getLostPoint(this);if(i==0||minLostPoint>lostPoint){minLostPoint=lostPoint;pattern=i;}} 91 | return pattern;},createMovieClip:function(target_mc,instance_name,depth){var qr_mc=target_mc.createEmptyMovieClip(instance_name,depth);var cs=1;this.make();for(var row=0;row>i)&1)==1);this.modules[Math.floor(i/3)][i%3+this.moduleCount-8-3]=mod;} 97 | for(var i=0;i<18;i++){var mod=(!test&&((bits>>i)&1)==1);this.modules[i%3+this.moduleCount-8-3][Math.floor(i/3)]=mod;}},setupTypeInfo:function(test,maskPattern){var data=(this.errorCorrectLevel<<3)|maskPattern;var bits=QRUtil.getBCHTypeInfo(data);for(var i=0;i<15;i++){var mod=(!test&&((bits>>i)&1)==1);if(i<6){this.modules[i][8]=mod;}else if(i<8){this.modules[i+1][8]=mod;}else{this.modules[this.moduleCount-15+i][8]=mod;}} 98 | for(var i=0;i<15;i++){var mod=(!test&&((bits>>i)&1)==1);if(i<8){this.modules[8][this.moduleCount-i-1]=mod;}else if(i<9){this.modules[8][15-i-1+1]=mod;}else{this.modules[8][15-i-1]=mod;}} 99 | this.modules[this.moduleCount-8][8]=(!test);},mapData:function(data,maskPattern){var inc=-1;var row=this.moduleCount-1;var bitIndex=7;var byteIndex=0;for(var col=this.moduleCount-1;col>0;col-=2){if(col==6)col--;while(true){for(var c=0;c<2;c++){if(this.modules[row][col-c]==null){var dark=false;if(byteIndex>>bitIndex)&1)==1);} 100 | var mask=QRUtil.getMask(maskPattern,row,col-c);if(mask){dark=!dark;} 101 | this.modules[row][col-c]=dark;bitIndex--;if(bitIndex==-1){byteIndex++;bitIndex=7;}}} 102 | row+=inc;if(row<0||this.moduleCount<=row){row-=inc;inc=-inc;break;}}}}};QRCodeModel.PAD0=0xEC;QRCodeModel.PAD1=0x11;QRCodeModel.createData=function(typeNumber,errorCorrectLevel,dataList){var rsBlocks=QRRSBlock.getRSBlocks(typeNumber,errorCorrectLevel);var buffer=new QRBitBuffer();for(var i=0;itotalDataCount*8){throw new Error("code length overflow. (" 105 | +buffer.getLengthInBits() 106 | +">" 107 | +totalDataCount*8 108 | +")");} 109 | if(buffer.getLengthInBits()+4<=totalDataCount*8){buffer.put(0,4);} 110 | while(buffer.getLengthInBits()%8!=0){buffer.putBit(false);} 111 | while(true){if(buffer.getLengthInBits()>=totalDataCount*8){break;} 112 | buffer.put(QRCodeModel.PAD0,8);if(buffer.getLengthInBits()>=totalDataCount*8){break;} 113 | buffer.put(QRCodeModel.PAD1,8);} 114 | return QRCodeModel.createBytes(buffer,rsBlocks);};QRCodeModel.createBytes=function(buffer,rsBlocks){var offset=0;var maxDcCount=0;var maxEcCount=0;var dcdata=new Array(rsBlocks.length);var ecdata=new Array(rsBlocks.length);for(var r=0;r=0)?modPoly.get(modIndex):0;}} 116 | var totalCodeCount=0;for(var i=0;i=0){d^=(QRUtil.G15<<(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G15)));} 120 | return((data<<10)|d)^QRUtil.G15_MASK;},getBCHTypeNumber:function(data){var d=data<<12;while(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G18)>=0){d^=(QRUtil.G18<<(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G18)));} 121 | return(data<<12)|d;},getBCHDigit:function(data){var digit=0;while(data!=0){digit++;data>>>=1;} 122 | return digit;},getPatternPosition:function(typeNumber){return QRUtil.PATTERN_POSITION_TABLE[typeNumber-1];},getMask:function(maskPattern,i,j){switch(maskPattern){case QRMaskPattern.PATTERN000:return(i+j)%2==0;case QRMaskPattern.PATTERN001:return i%2==0;case QRMaskPattern.PATTERN010:return j%3==0;case QRMaskPattern.PATTERN011:return(i+j)%3==0;case QRMaskPattern.PATTERN100:return(Math.floor(i/2)+Math.floor(j/3))%2==0;case QRMaskPattern.PATTERN101:return(i*j)%2+(i*j)%3==0;case QRMaskPattern.PATTERN110:return((i*j)%2+(i*j)%3)%2==0;case QRMaskPattern.PATTERN111:return((i*j)%3+(i+j)%2)%2==0;default:throw new Error("bad maskPattern:"+maskPattern);}},getErrorCorrectPolynomial:function(errorCorrectLength){var a=new QRPolynomial([1],0);for(var i=0;i5){lostPoint+=(3+sameCount-5);}}} 128 | for(var row=0;row=256){n-=255;} 135 | return QRMath.EXP_TABLE[n];},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var i=0;i<8;i++){QRMath.EXP_TABLE[i]=1<>>(7-index%8))&1)==1;},put:function(num,length){for(var i=0;i>>(length-i-1))&1)==1);}},getLengthInBits:function(){return this.length;},putBit:function(bit){var bufIndex=Math.floor(this.length/8);if(this.buffer.length<=bufIndex){this.buffer.push(0);} 150 | if(bit){this.buffer[bufIndex]|=(0x80>>>(this.length%8));} 151 | this.length++;}};var QRCodeLimitLength=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]]; 152 | 153 | function _isSupportCanvas() { 154 | return typeof CanvasRenderingContext2D != "undefined"; 155 | } 156 | 157 | // android 2.x doesn't support Data-URI spec 158 | // function _getAndroid() { 159 | // var android = false; 160 | // // var sAgent = navigator.userAgent; 161 | 162 | // if (/android/i.test(sAgent)) { // android 163 | // android = true; 164 | // var aMat = sAgent.toString().match(/android ([0-9]\.[0-9])/i); 165 | 166 | // if (aMat && aMat[1]) { 167 | // android = parseFloat(aMat[1]); 168 | // } 169 | // } 170 | 171 | // return android; 172 | // } 173 | 174 | var svgDrawer = (function() { 175 | 176 | var Drawing = function (el, htOption ,callback) { 177 | this._el = el; 178 | this._htOption = htOption; 179 | this._callback = callback; 180 | }; 181 | 182 | Drawing.prototype.draw = function (oQRCode) { 183 | var _htOption = this._htOption; 184 | var _el = this._el; 185 | var nCount = oQRCode.getModuleCount(); 186 | var nWidth = Math.floor(_htOption.width / nCount); 187 | var nHeight = Math.floor(_htOption.height / nCount); 188 | 189 | this.clear(); 190 | 191 | function makeSVG(tag, attrs) { 192 | var el = document.createElementNS('http://www.w3.org/2000/svg', tag); 193 | for (var k in attrs) 194 | if (attrs.hasOwnProperty(k)) el.setAttribute(k, attrs[k]); 195 | return el; 196 | } 197 | 198 | var svg = makeSVG("svg" , {'viewBox': '0 0 ' + String(nCount) + " " + String(nCount), 'width': '100%', 'height': '100%', 'fill': _htOption.colorLight}); 199 | svg.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xlink", "http://www.w3.org/1999/xlink"); 200 | _el.appendChild(svg); 201 | 202 | svg.appendChild(makeSVG("rect", {"fill": _htOption.colorLight, "width": "100%", "height": "100%"})); 203 | svg.appendChild(makeSVG("rect", {"fill": _htOption.colorDark, "width": "1", "height": "1", "id": "template"})); 204 | 205 | for (var row = 0; row < nCount; row++) { 206 | for (var col = 0; col < nCount; col++) { 207 | if (oQRCode.isDark(row, col)) { 208 | var child = makeSVG("use", {"x": String(col), "y": String(row)}); 209 | child.setAttributeNS("http://www.w3.org/1999/xlink", "href", "#template") 210 | svg.appendChild(child); 211 | } 212 | } 213 | } 214 | }; 215 | Drawing.prototype.clear = function () { 216 | while (this._el.hasChildNodes()) 217 | this._el.removeChild(this._el.lastChild); 218 | }; 219 | return Drawing; 220 | })(); 221 | 222 | /** 223 | * Get the type by string length 224 | * 225 | * @private 226 | * @param {String} sText 227 | * @param {Number} nCorrectLevel 228 | * @return {Number} type 229 | */ 230 | function _getTypeNumber(sText, nCorrectLevel) { 231 | var nType = 1; 232 | var length = _getUTF8Length(sText); 233 | 234 | for (var i = 0, len = QRCodeLimitLength.length; i <= len; i++) { 235 | var nLimit = 0; 236 | 237 | switch (nCorrectLevel) { 238 | case QRErrorCorrectLevel.L : 239 | nLimit = QRCodeLimitLength[i][0]; 240 | break; 241 | case QRErrorCorrectLevel.M : 242 | nLimit = QRCodeLimitLength[i][1]; 243 | break; 244 | case QRErrorCorrectLevel.Q : 245 | nLimit = QRCodeLimitLength[i][2]; 246 | break; 247 | case QRErrorCorrectLevel.H : 248 | nLimit = QRCodeLimitLength[i][3]; 249 | break; 250 | } 251 | 252 | if (length <= nLimit) { 253 | break; 254 | } else { 255 | nType++; 256 | } 257 | } 258 | 259 | if (nType > QRCodeLimitLength.length) { 260 | throw new Error("Too long data"); 261 | } 262 | 263 | return nType; 264 | } 265 | 266 | function _getUTF8Length(sText) { 267 | var replacedText = encodeURI(sText).toString().replace(/\%[0-9a-fA-F]{2}/g, 'a'); 268 | return replacedText.length + (replacedText.length != sText ? 3 : 0); 269 | } 270 | 271 | /** 272 | * @class QRCode 273 | * @constructor 274 | * @example 275 | * new QRCode(document.getElementById("test"), "http://jindo.dev.naver.com/collie"); 276 | * 277 | * @example 278 | * var oQRCode = new QRCode("test", { 279 | * text : "http://naver.com", 280 | * width : 128, 281 | * height : 128 282 | * }); 283 | * 284 | * oQRCode.clear(); // Clear the QRCode. 285 | * oQRCode.makeCode("http://map.naver.com"); // Re-create the QRCode. 286 | * 287 | * @param {HTMLElement|String} el target element or 'id' attribute of element. 288 | * @param {Object|String} vOption 289 | * @param {String} vOption.text QRCode link data 290 | * @param {Number} [vOption.width=256] 291 | * @param {Number} [vOption.height=256] 292 | * @param {String} [vOption.colorDark="#000000"] 293 | * @param {String} [vOption.colorLight="#ffffff"] 294 | * @param {QRCode.CorrectLevel} [vOption.correctLevel=QRCode.CorrectLevel.H] [L|M|Q|H] 295 | */ 296 | QRCode = function (vOption,fn ) { 297 | this._htOption = { 298 | width : 256, 299 | height : 256, 300 | typeNumber : 4, 301 | colorDark : "#000000", 302 | colorLight : "#ffffff", 303 | correctLevel : QRErrorCorrectLevel.H 304 | }; 305 | 306 | if (typeof vOption === 'string') { 307 | vOption = { 308 | text : vOption 309 | }; 310 | } 311 | 312 | // Overwrites options 313 | if (vOption) { 314 | for (var i in vOption) { 315 | this._htOption[i] = vOption[i]; 316 | } 317 | } 318 | 319 | this._oQRCode = null; 320 | if (this._htOption.text) { 321 | this.makeCode(this._htOption.text); 322 | } 323 | }; 324 | 325 | /** 326 | * Make the QRCode 327 | * 328 | * @param {String} sText link data 329 | */ 330 | QRCode.prototype.makeCode = function (sText) { 331 | this._oQRCode = new QRCodeModel(_getTypeNumber(sText, this._htOption.correctLevel), this._htOption.correctLevel); 332 | this._oQRCode.addData(sText); 333 | this._oQRCode.make(); 334 | }; 335 | 336 | /** 337 | * Make the Image from Canvas element 338 | * - It occurs automatically 339 | * - Android below 3 doesn't support Data-URI spec. 340 | * 341 | * @private 342 | */ 343 | QRCode.prototype.makeImage = function () { 344 | if (typeof this._oDrawing.makeImage == "function" && (!this._android || this._android >= 3)) { 345 | this._oDrawing.makeImage(); 346 | } 347 | }; 348 | 349 | /** 350 | * Clear the QRCode 351 | */ 352 | QRCode.prototype.clear = function () { 353 | this._oDrawing.clear(); 354 | }; 355 | 356 | /** 357 | * @name QRCode.CorrectLevel 358 | */ 359 | QRCode.CorrectLevel = QRErrorCorrectLevel; 360 | 361 | 362 | export default QRCode; -------------------------------------------------------------------------------- /miniprogram/pages/checkqr/checkqr.js: -------------------------------------------------------------------------------- 1 | // miniprogram/pages/qrlist/qrlist.js 2 | Page({ 3 | 4 | /** 5 | * 页面的初始数据 6 | */ 7 | data: { 8 | list: [], 9 | total: null, 10 | limit: 10, //每页数量 11 | pageid: 1, 12 | datatype: 0, 13 | ifloading: false 14 | }, 15 | getall() { 16 | this.setData({ 17 | datatype: 0 18 | }) 19 | this.firstgetdatalist(); 20 | }, 21 | getpublish() { 22 | this.setData({ 23 | datatype: 1 24 | }) 25 | this.firstgetdatalist(); 26 | }, 27 | getwait() { 28 | this.setData({ 29 | datatype: 2 30 | }) 31 | this.firstgetdatalist(); 32 | }, 33 | qrpublish(e) { 34 | var id = e.currentTarget.dataset.qrid; 35 | var qrpublish = !e.currentTarget.dataset.publish; 36 | wx.cloud.callFunction({ 37 | // 需调用的云函数名 38 | name: 'publishQR', 39 | // 传给云函数的参数 40 | data: { 41 | qr_id: id, 42 | publish: qrpublish 43 | }, 44 | // 成功回调 45 | complete: (res) => { 46 | for (let i = 0; i < this.data.list.length; i++) { 47 | if (this.data.list[i]._id == id) { 48 | var publish = `list[${i}].publish`; 49 | this.setData({ 50 | [publish]: qrpublish 51 | }) 52 | break; 53 | } 54 | } 55 | } 56 | }) 57 | 58 | }, 59 | firstgetdatalist() { 60 | this.setData({ 61 | ifloading: true 62 | }) 63 | wx.cloud.callFunction({ 64 | // 需调用的云函数名 65 | name: 'getQRElementList', 66 | // 传给云函数的参数 67 | data: { 68 | limit: this.data.limit, 69 | page_index: 0, 70 | datatype: this.data.datatype, 71 | self: false 72 | }, 73 | // 成功回调 74 | complete: (res) => { 75 | var list = res.result.data.list; 76 | for (let i = 0; i < list.length; i++) { 77 | list[i].select = false; 78 | } 79 | var total = Math.ceil(res.result.data.total / this.data.limit); 80 | this.setData({ 81 | total: total, 82 | list: list, 83 | ifloading: false 84 | }) 85 | } 86 | }) 87 | }, 88 | getdatalist(pageid) { 89 | this.setData({ 90 | ifloading: true 91 | }) 92 | wx.cloud.callFunction({ 93 | // 需调用的云函数名 94 | name: 'getQRElementList', 95 | // 传给云函数的参数 96 | data: { 97 | limit: this.data.limit, 98 | page_index: pageid - 1, 99 | datatype: this.data.datatype, 100 | self: false 101 | }, 102 | // 成功回调 103 | complete: (res) => { 104 | var list = res.result.data.list; 105 | for (let i = 0; i < list.length; i++) { 106 | list[i].select = false; 107 | } 108 | var total = Math.ceil(res.result.data.total / this.data.limit); 109 | this.setData({ 110 | total: total, 111 | list: list, 112 | ifloading: false 113 | }) 114 | } 115 | }) 116 | }, 117 | prepage() { 118 | if (this.data.pageid <= this.data.total && this.data.pageid > 1) { 119 | this.setData({ 120 | pageid: this.data.pageid - 1 121 | }) 122 | this.getdatalist(this.data.pageid) 123 | } 124 | }, 125 | nextpage() { 126 | if (this.data.pageid < this.data.total) { 127 | this.setData({ 128 | pageid: this.data.pageid + 1 129 | }) 130 | this.getdatalist(this.data.pageid) 131 | } 132 | } 133 | }) -------------------------------------------------------------------------------- /miniprogram/pages/checkqr/checkqr.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "navbar":"../../components/navbar/navbar", 4 | "styleitem":"../../components/styleitem/styleitem", 5 | "page":"../../components/page/page", 6 | "icon":"../../components/icon/icon", 7 | "btn":"../../components/btn/btn", 8 | "cell":"../../components/cell/cell", 9 | "popbox":"../../components/popbox/popbox", 10 | "avatar":"../../components/avatar/avatar", 11 | "missbox":"../../components/missbox/missbox", 12 | "contain":"../../components/contain/contain" 13 | }, 14 | "navigationStyle": "custom" 15 | } -------------------------------------------------------------------------------- /miniprogram/pages/checkqr/checkqr.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 全部 6 | 已上架 7 | 未上架 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | {{item.element_name}} 16 | 17 | 18 | {{item._author_name}} 19 | 20 | 21 | {{item.publish?"下架":"上架"}} 22 | 23 | 24 | 25 | 26 | cover 27 | 28 | 29 | 30 | one 31 | 32 | 33 | 34 | eye 35 | 36 | 37 | 38 | col2 39 | 40 | 41 | 42 | col3 43 | 44 | 45 | 46 | col4 47 | 48 | 49 | 50 | row2 51 | 52 | 53 | 54 | row3 55 | 56 | 57 | 58 | row4 59 | 60 | 61 | 62 | tian 63 | 64 | 65 | 66 | po7 67 | 68 | 69 | 70 | re7 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /miniprogram/pages/checkqr/checkqr.wxss: -------------------------------------------------------------------------------- 1 | /* miniprogram/pages/qrlist/qrlist.wxss */ 2 | .opt{ 3 | display: flex; 4 | align-items: center; 5 | justify-content: center; 6 | } 7 | 8 | .list { 9 | padding: 0 32rpx; 10 | } 11 | 12 | .item { 13 | position: relative; 14 | width: 100%; 15 | display: inline-block; 16 | overflow: hidden; 17 | box-sizing: border-box; 18 | border-radius: 32rpx; 19 | margin: 16rpx 0; 20 | } 21 | 22 | .item-hd { 23 | padding: 20rpx 32rpx; 24 | border-bottom: solid 4rpx #000; 25 | display: flex; 26 | justify-content: space-between; 27 | align-items: center; 28 | } 29 | 30 | .item-hd-tit { 31 | font-weight: bold; 32 | font-size: 48rpx; 33 | } 34 | 35 | .item-hd-user { 36 | display: flex; 37 | align-items: center; 38 | } 39 | 40 | .user-name { 41 | margin-left: 20rpx; 42 | } 43 | 44 | .item-bd { 45 | padding: 32rpx; 46 | display: flex; 47 | flex-wrap: wrap; 48 | } 49 | 50 | .img-item { 51 | width: 100rpx; 52 | text-align: center; 53 | margin: 10rpx; 54 | } 55 | 56 | .img-item image { 57 | width: 100rpx; 58 | height: 100rpx; 59 | } -------------------------------------------------------------------------------- /miniprogram/pages/designrule/designrule.js: -------------------------------------------------------------------------------- 1 | // miniprogram/pages/index/index.js 2 | Page({ 3 | 4 | /** 5 | * 页面的初始数据 6 | */ 7 | data: { 8 | 9 | }, 10 | goupload() { 11 | wx.navigateTo({ 12 | url: '/pages/upload/upload' 13 | }) 14 | } 15 | }) -------------------------------------------------------------------------------- /miniprogram/pages/designrule/designrule.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "navbar":"../../components/navbar/navbar", 4 | "styleitem":"../../components/styleitem/styleitem", 5 | "page":"../../components/page/page", 6 | "icon":"../../components/icon/icon", 7 | "btn":"../../components/btn/btn", 8 | "popbox":"../../components/popbox/popbox", 9 | "cell":"../../components/cell/cell", 10 | "contain":"../../components/contain/contain" 11 | }, 12 | "navigationStyle": "custom" 13 | } -------------------------------------------------------------------------------- /miniprogram/pages/designrule/designrule.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 设计指引 6 | 亲爱的用户: 7 | ٩(๑❛ᴗ❛๑)۶,欢迎使用艺术二维码生成器。现在让我来告诉你如何设计对应的素材吧~ 8 | 我们常见认知的二维码是黑白两色的,但其实它是可以彩色的。 9 | 10 | 11 | ヾ(◍°∇°◍)ノ゙上面两个二维码是同一个哦~ 12 | 我们可以将黑白二维码拆分成以下11个基础元素: 13 | 14 | ヾ(✿゚▽゚)ノ提取基础的元素 15 | 将它们都放在网格中,我们发现它之间是有比例的。 16 | 17 | 18 | 关于二维码的原理,在这里便不再多说。有兴趣可以去查阅相关资料。回到这里,现在我们在黑色区域进行设计。 19 | 20 | 21 | (▼へ▼メ)一定要按照比例设计导出图片哦~ 22 | 23 | 24 | 建议最小码点尺寸为:50 * 50px,分辨率:300 25 | 26 | 注意:设计时要保证设计面覆盖在码点中心即9分之一圆心上。 27 | 28 | 29 | 30 | 两个码点也是这样的道理。 31 | 32 | 33 | 34 | 最后导出小图片: 35 | 36 | 37 | o(▼皿▼メ;)o按比例导出素材,命名随意 38 | 将图片上传对对应的示例图中,最后取个名字上传就可以成功啦~ 39 | 40 | (╬◣д◢)必须上传封面图、码眼、单元素图片哦 41 | 是不是很简单,快去尝试一下吧,制作自己的专属艺术二维码。最后在我的界面中,选中你刚才上传的素材包,就可以生成漂亮的艺术二维码啦~ 42 | 合作与建议:可以添加微信“mengmeng-na”与我联系哦~ 43 | 现在去制作 44 | 45 | -------------------------------------------------------------------------------- /miniprogram/pages/designrule/designrule.wxss: -------------------------------------------------------------------------------- 1 | /* miniprogram/pages/designrule/designrule.wxss */ 2 | .rule-box { 3 | background: #fff; 4 | border: 4rpx solid #000000; 5 | box-shadow: var(--box-shadow); 6 | border-radius: 40rpx; 7 | font-size: 24rpx; 8 | margin: 32rpx; 9 | padding: 32rpx; 10 | text-align: center; 11 | height: 70%; 12 | box-sizing: border-box; 13 | overflow: scroll; 14 | } 15 | .h1{ 16 | font-size: 40rpx; 17 | font-weight: bold; 18 | margin-bottom: 32rpx; 19 | } 20 | .tit { 21 | font-size: 30rpx; 22 | margin-bottom: 30rpx; 23 | text-align: left; 24 | } 25 | 26 | .txt { 27 | line-height: 40rpx; 28 | margin-bottom: 10rpx; 29 | text-indent: 2em; 30 | text-align: left; 31 | } 32 | 33 | .tip { 34 | font-size: 20rpx; 35 | color: var(--tip-1); 36 | line-height: 40rpx; 37 | text-align: center; 38 | } 39 | 40 | .img-short { 41 | width: 200rpx; 42 | height: 200rpx; 43 | } 44 | 45 | .img-long { 46 | width: 400rpx; 47 | } -------------------------------------------------------------------------------- /miniprogram/pages/imgmade/imgmade.js: -------------------------------------------------------------------------------- 1 | // miniprogram/pages/qrlist/qrlist.js 2 | import qrcode from '../../js/artqrcoed.js'; 3 | import common from '../../js/common.js'; 4 | 5 | Page({ 6 | 7 | /** 8 | * 页面的初始数据 9 | */ 10 | data: { 11 | styleInfo: null, 12 | imginfo: null, 13 | qrinfo: { 14 | canvasid: 'qrcode', 15 | size: '', 16 | text: '', 17 | img: '' 18 | }, 19 | ifmadeqr: false, 20 | pbqr: false, 21 | pbtip: false, 22 | tip: "", 23 | checkqrimg: false 24 | }, 25 | addlikenum(id) { 26 | wx.cloud.callFunction({ 27 | // 需调用的云函数名 28 | name: 'reportQRLike', 29 | // 传给云函数的参数 30 | data: { 31 | qr_id: id 32 | }, 33 | // 成功回调 34 | complete: (res) => { 35 | console.log("add 1") 36 | } 37 | }) 38 | }, 39 | saveimg() { 40 | var that = this; 41 | wx.canvasToTempFilePath({ 42 | x: 0, 43 | y: 0, 44 | width: that.data.qrinfo.size, 45 | height: that.data.qrinfo.size, 46 | canvasId: that.data.qrinfo.canvasid, 47 | success: function (data) { 48 | wx.saveImageToPhotosAlbum({ 49 | filePath: data.tempFilePath, 50 | success: (res) => { 51 | console.log("保存成功") 52 | }, 53 | fail: (err) => {} 54 | }) 55 | } 56 | }) 57 | }, 58 | getsize() { 59 | return new Promise((resolve, reject) => { 60 | var that = this; 61 | var query = wx.createSelectorQuery(); 62 | query.select('.qrcode').boundingClientRect(function (rect) { 63 | var qrsize = 'qrinfo.size' 64 | that.setData({ 65 | [qrsize]: rect.height 66 | }) 67 | resolve(); 68 | }).exec(); 69 | }) 70 | }, 71 | async madeImg() { 72 | var that = this; 73 | if (this.data.qrinfo.img == '') { 74 | this.setData({ 75 | tip: '(▼へ▼メ)请上传黑白二维码吖~', 76 | pbtip: true 77 | }) 78 | return 79 | } 80 | if (this.data.styleInfo == null) { 81 | this.setData({ 82 | tip: 'o(▼皿▼メ;)o请选择二维码风格吖~', 83 | pbtip: true 84 | }) 85 | return 86 | } 87 | 88 | this.setData({ 89 | pbimg: false, 90 | pbqr: true 91 | }) 92 | await this.manageimgs(); 93 | this.getsize().then(() => { 94 | this.addlikenum(this.data.styleInfo._id); 95 | qrcode.getqrcode(this.data.qrinfo, this.data.imginfo).then(() => { 96 | that.setData({ 97 | ifmadeqr: true 98 | }) 99 | }); 100 | }); 101 | }, 102 | uploadimg() { 103 | var that = this; 104 | wx.chooseImage({ 105 | count: 1, 106 | sizeType: ['compressed'], 107 | sourceType: ['album', 'camera'], 108 | success: function (res) { 109 | that.setData({ 110 | pbtip: true, 111 | checkqrimg: true, 112 | tip: "正在检验二维码中٩(๑❛ᴗ❛๑)۶" 113 | }) 114 | var imgurl = res.tempFilePaths[0]; 115 | // 图片转base64 116 | common.urlTobase64(imgurl).then(data => { 117 | // 上传单个图片 118 | common.uploadSingleImg(data).then(imgfileId => { 119 | // 扫码识别 s 120 | wx.cloud.callFunction({ 121 | // 需调用的云函数名 122 | name: 'decode', 123 | // 传给云函数的参数 124 | data: { 125 | fileid: imgfileId 126 | }, 127 | // 成功回调 128 | complete: (res) => { 129 | var qrdata = res.result; 130 | if (qrdata.length > 0) { 131 | var qrimg = `qrinfo.img` 132 | var qrtext = `qrinfo.text` 133 | var text = qrdata[0].data; 134 | that.setData({ 135 | [qrimg]: imgurl, 136 | [qrtext]: text 137 | }) 138 | wx.setStorage({ 139 | key: "qrimg", 140 | data: imgurl 141 | }) 142 | wx.setStorage({ 143 | key: "qrtxt", 144 | data: text 145 | }) 146 | that.setData({ 147 | pbtip: false, 148 | checkqrimg: false, 149 | tip: "٩(๑❛ᴗ❛๑)۶" 150 | }) 151 | } else { 152 | var qrimg = `qrinfo.img` 153 | 154 | that.setData({ 155 | pbtip: true, 156 | checkqrimg: false, 157 | tip: "我怀疑你上传的是假的二维码(╥╯^╰╥),请重新上传一个真的好不?", 158 | [qrimg]:'' 159 | }) 160 | } 161 | } 162 | }) 163 | // 扫码识别 e 164 | }); 165 | }) 166 | } 167 | }) 168 | }, 169 | goqrlist() { 170 | wx.navigateTo({ 171 | url: '/pages/qrlist/qrlist?pagefrom=imgmade' 172 | }) 173 | }, 174 | close() { 175 | this.setData({ 176 | pbqr: false, 177 | pbtip: false, 178 | ifmadeqr: false 179 | }) 180 | }, 181 | async manageimgs() { 182 | var info = this.data.styleInfo; 183 | var imgs = { 184 | eye: info.eye, 185 | one: info.one, 186 | tian: info.tian, 187 | col2: info.col2, 188 | col3: info.col3, 189 | col4: info.col4, 190 | row2: info.row2, 191 | row3: info.row3, 192 | row4: info.row4, 193 | re7: info.re7, 194 | po7: info.po7, 195 | } 196 | for (const key in imgs) { 197 | if (imgs.hasOwnProperty(key)) { 198 | const element = imgs[key]; 199 | if (element) { 200 | await wx.cloud.downloadFile({ 201 | fileID: element 202 | }).then(res => { 203 | imgs[key] = res.tempFilePath; 204 | }).catch(error => {}) 205 | } 206 | 207 | } 208 | } 209 | this.setData({ 210 | imginfo: imgs 211 | }) 212 | }, 213 | /** 214 | * 生命周期函数--监听页面加载 215 | */ 216 | onLoad: function (options) { 217 | var that = this; 218 | if (options.info) { 219 | var info = JSON.parse(options.info) 220 | this.setData({ 221 | styleInfo: info 222 | }) 223 | wx.getStorage({ 224 | key: 'qrimg', 225 | success(res) { 226 | var img = `qrinfo.img` 227 | that.setData({ 228 | [img]: res.data 229 | }) 230 | } 231 | }) 232 | wx.getStorage({ 233 | key: 'qrtxt', 234 | success(res) { 235 | var text = `qrinfo.text` 236 | that.setData({ 237 | [text]: res.data 238 | }) 239 | } 240 | }) 241 | } 242 | } 243 | }) -------------------------------------------------------------------------------- /miniprogram/pages/imgmade/imgmade.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "navbar":"../../components/navbar/navbar", 4 | "styleitem":"../../components/styleitem/styleitem", 5 | "page":"../../components/page/page", 6 | "cell":"../../components/cell/cell", 7 | "icon":"../../components/icon/icon", 8 | "btn":"../../components/btn/btn", 9 | "missbox":"../../components/missbox/missbox", 10 | "popbox":"../../components/popbox/popbox", 11 | "contain":"../../components/contain/contain" 12 | }, 13 | "navigationStyle": "custom" 14 | } -------------------------------------------------------------------------------- /miniprogram/pages/imgmade/imgmade.wxml: -------------------------------------------------------------------------------- 1 | 美化二维码 2 | 3 | 一、上传二维码: 4 | 5 | 6 | 7 | 8 | 二、选择风格: 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 生成以后请用手机扫描验证是否能识别 23 | 生成 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 保存 33 | 34 | 35 | 36 | 37 | 38 | {{tip}} 39 | -------------------------------------------------------------------------------- /miniprogram/pages/imgmade/imgmade.wxss: -------------------------------------------------------------------------------- 1 | /* miniprogram/pages/txtmade/txtmad.wxss */ 2 | .tit { 3 | font-size: 36rpx; 4 | font-weight: bold; 5 | color: #fff; 6 | margin: 32rpx; 7 | display: flex; 8 | justify-content: space-between; 9 | } 10 | 11 | .input { 12 | border-radius: 10rpx; 13 | border: 4rpx solid #000000; 14 | box-sizing: border-box; 15 | box-shadow: var(--box-shadow); 16 | background: #fff; 17 | font-size: 32rpx; 18 | font-weight: bold; 19 | border-radius: 32rpx; 20 | margin-bottom: 50rpx; 21 | height: 200rpx; 22 | margin: 0 32rpx; 23 | box-sizing: border-box; 24 | text-align: left; 25 | padding: 20rpx; 26 | } 27 | 28 | content { 29 | text-align: center; 30 | } 31 | 32 | .item-qr { 33 | width: 330rpx; 34 | box-sizing: border-box; 35 | text-align: center; 36 | margin: 0 auto; 37 | margin-bottom: 30rpx; 38 | } 39 | 40 | .item { 41 | width: 330rpx; 42 | box-sizing: border-box; 43 | text-align: center; 44 | margin: 0 auto; 45 | margin-bottom: 30rpx; 46 | } 47 | 48 | .icon-add { 49 | margin: 150rpx 0; 50 | } 51 | 52 | .upload-img { 53 | width: 200rpx; 54 | height: 200rpx; 55 | margin: 0 auto; 56 | display: flex; 57 | justify-content: center; 58 | align-items: center; 59 | } 60 | 61 | .upload-img image { 62 | width: 100%; 63 | height: 100%; 64 | } 65 | 66 | 67 | 68 | .qrcode { 69 | margin: 30rpx auto; 70 | display: block; 71 | } 72 | 73 | .opt { 74 | text-align: center; 75 | } 76 | 77 | .missbox { 78 | position: absolute; 79 | width: 70%; 80 | left: 0; 81 | right: 0; 82 | top: 0; 83 | bottom: 0; 84 | height: 90%; 85 | background: #fff; 86 | z-index: 9; 87 | margin: auto; 88 | } 89 | .tip{ 90 | margin:0 32rpx; 91 | color:var(--tip-1); 92 | font-size: var(--size-tip-1); 93 | } 94 | .tip-key{ 95 | color: black; 96 | } -------------------------------------------------------------------------------- /miniprogram/pages/index/index.js: -------------------------------------------------------------------------------- 1 | // miniprogram/pages/index/index.js 2 | Page({ 3 | 4 | /** 5 | * 页面的初始数据 6 | */ 7 | data: { 8 | openid:null 9 | }, 10 | gotxtmade() { 11 | wx.navigateTo({ 12 | url: '/pages/txtmade/txtmade' 13 | }) 14 | }, 15 | goimgmade() { 16 | wx.navigateTo({ 17 | url: '/pages/imgmade/imgmade' 18 | }) 19 | }, 20 | goqrlist() { 21 | wx.navigateTo({ 22 | url: '/pages/qrlist/qrlist' 23 | }) 24 | }, 25 | gomylist() { 26 | wx.navigateTo({ 27 | url: '/pages/myqrlist/myqrlist' 28 | }) 29 | }, 30 | gocheck() { 31 | wx.navigateTo({ 32 | url: '/pages/checkqr/checkqr' 33 | }) 34 | }, 35 | /** 36 | * 生命周期函数--监听页面加载 37 | */ 38 | onLoad: function (options) { 39 | var that=this; 40 | wx.removeStorage({ 41 | key: 'qrimg', 42 | success(res) {} 43 | }) 44 | wx.removeStorage({ 45 | key: 'qrtxt', 46 | success(res) {} 47 | }) 48 | 49 | wx.cloud.callFunction({ 50 | // 需调用的云函数名 51 | name: 'login', 52 | // 成功回调 53 | complete: (res) => { 54 | this.setData({ 55 | openid:res.result.openid 56 | }) 57 | } 58 | }) 59 | } 60 | }) -------------------------------------------------------------------------------- /miniprogram/pages/index/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "btn":"../../components/btn/btn", 4 | "icon":"../../components/icon/icon" 5 | }, 6 | "navigationStyle": "custom" 7 | } -------------------------------------------------------------------------------- /miniprogram/pages/index/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 二维码生成 9 | 10 | 11 | 12 | 13 | 14 | 二维码美化 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 社区 23 | 24 | 25 | 26 | 27 | 28 | 我的 29 | 30 | 31 | 32 | 33 | 34 | 审核 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /miniprogram/pages/index/index.wxss: -------------------------------------------------------------------------------- 1 | /* miniprogram/pages/index/index.wxss */ 2 | /* 标题 */ 3 | .tit{ 4 | font-weight: 900; 5 | font-size: 40rpx; 6 | color: #fff; 7 | } 8 | .content { 9 | position: fixed; 10 | height: 100%; 11 | width: 100%; 12 | top: 0; 13 | bottom: 0; 14 | margin: auto; 15 | text-align: center; 16 | } 17 | 18 | .content image { 19 | margin-top: 200rpx; 20 | width: 450rpx; 21 | height: 340rpx; 22 | } 23 | 24 | .method { 25 | display: flex; 26 | justify-content: center; 27 | } 28 | .method-default { 29 | margin-top: 20rpx; 30 | display: flex; 31 | justify-content: center; 32 | color: #fff; 33 | } 34 | 35 | .method-item { 36 | font-weight: bold; 37 | height: 180rpx; 38 | padding-top: 30rpx; 39 | width: 150rpx; 40 | } 41 | .method-item-txt{ 42 | font-size: 30rpx; 43 | line-height: 30rpx; 44 | font-weight: bold; 45 | } -------------------------------------------------------------------------------- /miniprogram/pages/myqrlist/myqrlist.js: -------------------------------------------------------------------------------- 1 | // miniprogram/pages/qrlist/qrlist.js 2 | Page({ 3 | 4 | /** 5 | * 页面的初始数据 6 | */ 7 | data: { 8 | ifsetting: false, 9 | list: [], 10 | total: null, 11 | limit: 4, //每页数量 12 | pageid: 1, 13 | deletelist: [], 14 | misstxt: "数据加载中", 15 | misstype: 'loading', 16 | ifgetinfo: false, 17 | userInfo: { 18 | avatarUrl: '', 19 | nickName: '点击获取信息' 20 | }, 21 | pbtip: false, 22 | tip: 'ヾ(✿゚▽゚)ノ' 23 | }, 24 | close() { 25 | this.setData({ 26 | pbtip: false, 27 | tip: 'ヾ(✿゚▽゚)ノ' 28 | }) 29 | }, 30 | goqrcode(e) { 31 | var data = JSON.stringify(e.currentTarget.dataset.info) 32 | wx.navigateTo({ 33 | url: `/pages/qrcode/qrcode?info=${data}&pagefrom=myqrlist` 34 | }) 35 | }, 36 | delete() { 37 | wx.cloud.callFunction({ 38 | // 需调用的云函数名 39 | name: 'deleteUserQR', 40 | // 传给云函数的参数 41 | data: { 42 | qr_id_array: this.data.deletelist 43 | }, 44 | // 成功回调 45 | complete: (res) => { 46 | this.setData({ 47 | ifsetting: false 48 | }) 49 | this.firstgetdatalist(); 50 | } 51 | }) 52 | }, 53 | firstgetdatalist() { 54 | wx.cloud.callFunction({ 55 | // 需调用的云函数名 56 | name: 'getQRElementList', 57 | // 传给云函数的参数 58 | data: { 59 | limit: this.data.limit, 60 | page_index: 0, 61 | self: true 62 | }, 63 | // 成功回调 64 | complete: (res) => { 65 | var list = res.result.data.list; 66 | for (let i = 0; i < list.length; i++) { 67 | list[i].select = false; 68 | } 69 | var total = Math.ceil(res.result.data.total / this.data.limit); 70 | this.setData({ 71 | total: total, 72 | list: list, 73 | misstxt: list.length == 0 ? '暂无数据' : '数据加载中', 74 | misstype: list.length == 0 ? 'nodata' : 'loading', 75 | }) 76 | } 77 | }) 78 | }, 79 | getdatalist(pageid) { 80 | wx.cloud.callFunction({ 81 | // 需调用的云函数名 82 | name: 'getQRElementList', 83 | // 传给云函数的参数 84 | data: { 85 | limit: this.data.limit, 86 | page_index: pageid - 1, 87 | self: true 88 | }, 89 | // 成功回调 90 | complete: (res) => { 91 | var list = res.result.data.list; 92 | for (let i = 0; i < list.length; i++) { 93 | list[i].select = false; 94 | } 95 | var total = Math.ceil(res.result.data.total / this.data.limit); 96 | this.setData({ 97 | total: total, 98 | list: list, 99 | }) 100 | } 101 | }) 102 | }, 103 | prepage() { 104 | if (this.data.pageid <= this.data.total && this.data.pageid > 1) { 105 | this.setData({ 106 | pageid: this.data.pageid - 1 107 | }) 108 | this.getdatalist(this.data.pageid) 109 | } 110 | }, 111 | nextpage() { 112 | if (this.data.pageid < this.data.total) { 113 | this.setData({ 114 | pageid: this.data.pageid + 1 115 | }) 116 | this.getdatalist(this.data.pageid) 117 | } 118 | }, 119 | goupload() { 120 | if (!this.data.ifgetinfo) { 121 | this.getUserProfile().then(() => { 122 | wx.navigateTo({ 123 | url: '/pages/upload/upload' 124 | }) 125 | }); 126 | } else { 127 | wx.navigateTo({ 128 | url: '/pages/upload/upload' 129 | }) 130 | } 131 | }, 132 | cancleSetting() { 133 | this.setData({ 134 | ifsetting: false 135 | }) 136 | }, 137 | doSetting() { 138 | this.setData({ 139 | ifsetting: true 140 | }) 141 | }, 142 | select(e) { 143 | var id = e.currentTarget.dataset.id; 144 | for (let i = 0; i < this.data.list.length; i++) { 145 | if (this.data.list[i]._id == id) { 146 | var selectid = `list[${i}].select`; 147 | this.setData({ 148 | [selectid]: !this.data.list[i].select 149 | }) 150 | break; 151 | } 152 | } 153 | for (let i = 0; i < this.data.deletelist.length; i++) { 154 | if (this.data.deletelist[i] == id) { 155 | this.data.deletelist.splice(i, 1); 156 | this.setData({ 157 | deletelist: this.data.deletelist 158 | }) 159 | } 160 | break; 161 | } 162 | this.data.deletelist.push(id); 163 | this.setData({ 164 | deletelist: this.data.deletelist 165 | }) 166 | }, 167 | /** 168 | * 生命周期函数--监听页面加载 169 | */ 170 | onLoad: function (options) { 171 | var that = this; 172 | wx.getStorage({ 173 | key: 'userInfo', 174 | success: (e) => { 175 | var info = JSON.parse(e.data); 176 | that.setData({ 177 | ifgetinfo: true, 178 | userInfo: info 179 | }) 180 | }, 181 | fail: (e) => { 182 | that.setData({ 183 | ifgetinfo: false 184 | }) 185 | } 186 | }) 187 | this.firstgetdatalist(); 188 | }, 189 | getUserProfile(e) { 190 | var that = this; 191 | return new Promise((resolve, reject) => { 192 | // 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认,开发者妥善保管用户快速填写的头像昵称,避免重复弹窗 193 | wx.getUserProfile({ 194 | desc: '展示用户信息', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 195 | success: (res) => { 196 | this.setData({ 197 | userInfo: res.userInfo, 198 | ifgetinfo: true, 199 | }) 200 | var info = JSON.stringify(res.userInfo); 201 | wx.setStorage({ 202 | key: "userInfo", 203 | data: info 204 | }), 205 | resolve(); 206 | }, 207 | fail: (e) => { 208 | that.setData({ 209 | pbtip: true, 210 | tip: "(╬◣д◢)不授权无法上传素材哦!" 211 | }) 212 | reject(e); 213 | } 214 | }) 215 | }) 216 | } 217 | }) -------------------------------------------------------------------------------- /miniprogram/pages/myqrlist/myqrlist.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "navbar":"../../components/navbar/navbar", 4 | "styleitem":"../../components/styleitem/styleitem", 5 | "page":"../../components/page/page", 6 | "icon":"../../components/icon/icon", 7 | "btn":"../../components/btn/btn", 8 | "popbox":"../../components/popbox/popbox", 9 | "avatar":"../../components/avatar/avatar", 10 | "missbox":"../../components/missbox/missbox", 11 | "contain":"../../components/contain/contain" 12 | }, 13 | "navigationStyle": "custom" 14 | } -------------------------------------------------------------------------------- /miniprogram/pages/myqrlist/myqrlist.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {{userInfo.nickName}} 8 | 9 | 10 | 11 | 12 | 13 | 14 | 取消 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 29 | 30 | 31 | 32 | 33 | 34 | {{tip}} 35 | -------------------------------------------------------------------------------- /miniprogram/pages/myqrlist/myqrlist.wxss: -------------------------------------------------------------------------------- 1 | /* miniprogram/pages/qrlist/qrlist.wxss */ 2 | button{ 3 | background: transparent; 4 | display: block; 5 | width:80rpx; 6 | height: 150rpx; 7 | display: flex; 8 | align-items: center; 9 | } 10 | button:not([size='mini']){ 11 | width:100rpx !important; 12 | padding: 0 !important; 13 | } 14 | .opt{ 15 | display: flex; 16 | justify-content: space-between; 17 | align-items: center; 18 | padding: 0 32rpx; 19 | } 20 | .user{ 21 | text-align: center; 22 | margin-right: 40rpx; 23 | } 24 | .user-name{ 25 | font-weight: bold; 26 | color: #fff; 27 | line-height: 50rpx; 28 | font-size: 36rpx; 29 | } 30 | 31 | .setting { 32 | display: flex; 33 | align-items: center; 34 | } 35 | 36 | .tit { 37 | font-weight: bold; 38 | font-size: 36rpx; 39 | color: #fff; 40 | } 41 | 42 | .list { 43 | padding: 15rpx; 44 | } 45 | 46 | .item { 47 | position: relative; 48 | width: 330rpx; 49 | display: inline-block; 50 | overflow: hidden; 51 | margin: 15rpx; 52 | border-radius: 32rpx; 53 | } 54 | 55 | .select { 56 | position: absolute; 57 | width: 100%; 58 | height: 100%; 59 | z-index: 1; 60 | } 61 | 62 | .select-icon { 63 | position: absolute; 64 | top: 20rpx; 65 | bottom: 20rpx; 66 | } 67 | 68 | .mask { 69 | position: absolute; 70 | width: 100%; 71 | height: 100%; 72 | background: rgba(0, 0, 0, .5); 73 | left: 0; 74 | top: 0; 75 | } -------------------------------------------------------------------------------- /miniprogram/pages/qrcode/qrcode.js: -------------------------------------------------------------------------------- 1 | // miniprogram/pages/qrcode/qrcode.js 2 | import qrcode from '../../js/artqrcoed.js'; 3 | import common from '../../js/common.js'; 4 | Page({ 5 | 6 | /** 7 | * 页面的初始数据 8 | */ 9 | data: { 10 | styleInfo: null, 11 | imginfo: null, 12 | qrinfo: { 13 | canvasid: 'qrcode', 14 | size: '', 15 | text: '', 16 | img: '' 17 | }, 18 | pbtxt: false, 19 | pbimg: false, 20 | pbqr: false, 21 | ifmadeqr: false, 22 | checkqrimg: false, 23 | pbtip: false 24 | }, 25 | saveimg() { 26 | var that = this; 27 | wx.canvasToTempFilePath({ 28 | x: 0, 29 | y: 0, 30 | width: that.data.qrinfo.size, 31 | height: that.data.qrinfo.size, 32 | canvasId: that.data.qrinfo.canvasid, 33 | success: function (data) { 34 | wx.saveImageToPhotosAlbum({ 35 | filePath: data.tempFilePath, 36 | success: (res) => { 37 | console.log("保存成功") 38 | }, 39 | fail: (err) => {} 40 | }) 41 | } 42 | }) 43 | }, 44 | uploadimg() { 45 | var that = this; 46 | wx.chooseImage({ 47 | count: 1, 48 | sizeType: ['compressed'], 49 | sourceType: ['album', 'camera'], 50 | success: function (res) { 51 | that.setData({ 52 | pbtip: true, 53 | checkqrimg: true, 54 | tip: "正在检验二维码中٩(๑❛ᴗ❛๑)۶" 55 | }) 56 | var imgurl = res.tempFilePaths[0]; 57 | // 图片转base64 58 | common.urlTobase64(imgurl).then(data => { 59 | // 上传单个图片 60 | common.uploadSingleImg(data).then(imgfileId => { 61 | // 扫码识别 s 62 | wx.cloud.callFunction({ 63 | // 需调用的云函数名 64 | name: 'decode', 65 | // 传给云函数的参数 66 | data: { 67 | fileid: imgfileId 68 | }, 69 | // 成功回调 70 | complete: (res) => { 71 | var qrdata = res.result; 72 | if (qrdata.length > 0) { 73 | var qrimg = `qrinfo.img` 74 | var qrtext = `qrinfo.text` 75 | var text = qrdata[0].data; 76 | that.setData({ 77 | [qrimg]: imgurl, 78 | [qrtext]: text 79 | }) 80 | wx.setStorage({ 81 | key: "qrimg", 82 | data: imgurl 83 | }) 84 | wx.setStorage({ 85 | key: "qrtxt", 86 | data: text 87 | }) 88 | that.setData({ 89 | pbtip: false, 90 | checkqrimg: false, 91 | tip: "٩(๑❛ᴗ❛๑)۶" 92 | }) 93 | } else { 94 | that.setData({ 95 | pbimg: false, 96 | pbtip: true, 97 | checkqrimg: false, 98 | tip: "我怀疑你上传的是假的二维码(╥╯^╰╥),请重新上传一个真的好不?" 99 | }) 100 | } 101 | } 102 | }) 103 | // 扫码识别 e 104 | }); 105 | }) 106 | } 107 | }) 108 | }, 109 | gettxt(e) { 110 | var txt = `qrinfo.text`; 111 | this.setData({ 112 | [txt]: e.detail.value 113 | }) 114 | }, 115 | showpbtxt() { 116 | var qrtext = `qrinfo.text` 117 | this.setData({ 118 | [qrtext]: '', 119 | pbtxt: true 120 | }) 121 | }, 122 | showpbqr() { 123 | this.setData({ 124 | pbqr: true 125 | }) 126 | }, 127 | showpbimg() { 128 | var qrimg = `qrinfo.img` 129 | this.setData({ 130 | [qrimg]: '', 131 | pbimg: true, 132 | }) 133 | 134 | }, 135 | madeTxt() { 136 | var that = this; 137 | this.setData({ 138 | pbtxt: false, 139 | pbqr: true, 140 | }) 141 | this.getsize().then(() => { 142 | this.addlikenum(this.data.styleInfo._id); 143 | qrcode.getqrcode(this.data.qrinfo, this.data.imginfo).then(() => { 144 | that.setData({ 145 | ifmadeqr: true 146 | }) 147 | }); 148 | }); 149 | }, 150 | madeImg() { 151 | var that = this; 152 | // 先鉴黄 153 | wx.cloud.callFunction({ 154 | // 需调用的云函数名 155 | name: 'checkeText', 156 | // 传给云函数的参数 157 | data: { 158 | txt:that.qrinfo.text 159 | }, 160 | // 成功回调 161 | complete: (res) => { 162 | 163 | } 164 | }) 165 | console.log("输入文字") 166 | return ; 167 | this.setData({ 168 | pbimg: false, 169 | pbqr: true 170 | }) 171 | this.getsize().then(() => { 172 | this.addlikenum(this.data.styleInfo._id); 173 | qrcode.getqrcode(this.data.qrinfo, this.data.imginfo).then(() => { 174 | that.setData({ 175 | ifmadeqr: true 176 | }) 177 | }); 178 | }); 179 | }, 180 | addlikenum(id) { 181 | wx.cloud.callFunction({ 182 | // 需调用的云函数名 183 | name: 'reportQRLike', 184 | // 传给云函数的参数 185 | data: { 186 | qr_id: id 187 | }, 188 | // 成功回调 189 | complete: (res) => { 190 | console.log("add 1") 191 | } 192 | }) 193 | }, 194 | close() { 195 | this.setData({ 196 | pbqr: false, 197 | pbimg: false, 198 | pbtxt: false, 199 | ifmadeqr: false, 200 | pbtip: false 201 | }) 202 | }, 203 | getsize() { 204 | return new Promise((resolve, reject) => { 205 | var that = this; 206 | var query = wx.createSelectorQuery(); 207 | query.select('.qrcode').boundingClientRect(function (rect) { 208 | var qrsize = 'qrinfo.size' 209 | that.setData({ 210 | [qrsize]: rect.height 211 | }) 212 | resolve(); 213 | }).exec(); 214 | }) 215 | }, 216 | /** 217 | * 生命周期函数--监听页面加载 218 | */ 219 | onLoad: function (options) { 220 | var info = JSON.parse(options.info); 221 | var imgs = { 222 | eye: info.eye, 223 | one: info.one, 224 | tian: info.tian, 225 | col2: info.col2, 226 | col3: info.col3, 227 | col4: info.col4, 228 | row2: info.row2, 229 | row3: info.row3, 230 | row4: info.row4, 231 | re7: info.re7, 232 | po7: info.po7, 233 | } 234 | for (const key in imgs) { 235 | if (imgs.hasOwnProperty(key)) { 236 | const element = imgs[key]; 237 | if (element) { 238 | wx.cloud.downloadFile({ 239 | fileID: element 240 | }).then(res => { 241 | imgs[key] = res.tempFilePath; 242 | }).catch(error => {}) 243 | } 244 | } 245 | } 246 | this.setData({ 247 | styleInfo: info, 248 | imginfo: imgs, 249 | }) 250 | } 251 | }) -------------------------------------------------------------------------------- /miniprogram/pages/qrcode/qrcode.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "navbar":"../../components/navbar/navbar", 4 | "styleitem":"../../components/styleitem/styleitem", 5 | "page":"../../components/page/page", 6 | "icon":"../../components/icon/icon", 7 | "btn":"../../components/btn/btn", 8 | "missbox":"../../components/missbox/missbox", 9 | "popbox":"../../components/popbox/popbox", 10 | "contain":"../../components/contain/contain" 11 | }, 12 | "navigationStyle": "custom" 13 | } -------------------------------------------------------------------------------- /miniprogram/pages/qrcode/qrcode.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 二维码生成 12 | 13 | 14 | 15 | 16 | 17 | 二维码美化 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 保存 31 | 32 | 33 | 34 | 35 | 36 | 请输入文字内容:文明使用语句,已经做了敏感词处理 37 | 38 | 39 | 生成二维码 40 | 41 | 42 | 43 | 44 | 45 | 请上传黑白二维码: 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 美化二维码 54 | 55 | 56 | 57 | 58 | 59 | {{tip}} 60 | -------------------------------------------------------------------------------- /miniprogram/pages/qrcode/qrcode.wxss: -------------------------------------------------------------------------------- 1 | /* miniprogram/pages/qrcode/qrcode.wxss */ 2 | .qrcode { 3 | margin: 30rpx auto; 4 | display: block; 5 | } 6 | 7 | .item { 8 | margin: 70rpx auto; 9 | text-align: center; 10 | } 11 | 12 | .popbox { 13 | text-align: center; 14 | } 15 | 16 | .tit { 17 | font-size: 36rpx; 18 | font-weight: bold; 19 | text-align: left; 20 | margin-bottom: 40rpx; 21 | } 22 | 23 | .opt { 24 | text-align: center; 25 | } 26 | 27 | .add-box { 28 | margin: 20rpx; 29 | } 30 | 31 | .img { 32 | width: 250rpx; 33 | height: 250rpx; 34 | margin: 0 auto; 35 | } 36 | 37 | .img image { 38 | width: 100%; 39 | height: 100%; 40 | } 41 | 42 | .input { 43 | border-radius: 10rpx; 44 | border: 4rpx solid #000000; 45 | box-sizing: border-box; 46 | box-shadow: var(--box-shadow); 47 | background: #fff; 48 | font-size: 32rpx; 49 | font-weight: bold; 50 | border-radius: 32rpx; 51 | margin-bottom: 50rpx; 52 | height: 200rpx; 53 | width: 100%; 54 | box-sizing: border-box; 55 | text-align: left; 56 | padding: 20rpx; 57 | } 58 | 59 | .missbox { 60 | position: absolute; 61 | width: 70%; 62 | left: 0; 63 | right: 0; 64 | top: 0; 65 | bottom: 0; 66 | height: 90%; 67 | background: #fff; 68 | z-index: 9; 69 | margin: auto; 70 | } 71 | 72 | .method { 73 | margin-top: 20rpx; 74 | display: flex; 75 | justify-content: center; 76 | } 77 | 78 | .method-item { 79 | font-weight: bold; 80 | height: 180rpx; 81 | padding-top: 30rpx; 82 | width: 150rpx; 83 | } 84 | 85 | .method-item-txt { 86 | font-size: 30rpx; 87 | line-height: 23rpx; 88 | font-weight: bold; 89 | } -------------------------------------------------------------------------------- /miniprogram/pages/qrlist/qrlist.js: -------------------------------------------------------------------------------- 1 | // miniprogram/pages/qrlist/qrlist.js 2 | Page({ 3 | 4 | /** 5 | * 页面的初始数据 6 | */ 7 | data: { 8 | list: [], 9 | total: null, 10 | limit: 6, //每页数量 11 | pageid: 1, 12 | misstype:'loading', 13 | misstxt:'数据加载中٩(๑❛ᴗ❛๑)۶~', 14 | pagefrom:'index', 15 | }, 16 | gomylist() { 17 | wx.navigateTo({ 18 | url: '/pages/myqrlist/myqrlist' 19 | }) 20 | }, 21 | goqrcode(e) { 22 | var data = JSON.stringify(e.currentTarget.dataset.info) 23 | if(this.data.pagefrom=='index'){ 24 | wx.navigateTo({ 25 | url: `/pages/qrcode/qrcode?info=${data}` 26 | }) 27 | }else{ 28 | wx.navigateTo({ 29 | url: `/pages/${this.data.pagefrom}/${this.data.pagefrom}?info=${data}` 30 | }) 31 | } 32 | }, 33 | firstgetdatalist() { 34 | wx.cloud.callFunction({ 35 | // 需调用的云函数名 36 | name: 'getQRElementList', 37 | // 传给云函数的参数 38 | data: { 39 | limit: this.data.limit, 40 | page_index: this.data.pageid - 1, 41 | self: false, 42 | datatype:1 43 | }, 44 | // 成功回调 45 | complete: (res) => { 46 | var list = res.result.data.list; 47 | var total = Math.ceil(res.result.data.total / this.data.limit); 48 | this.setData({ 49 | total: total, 50 | list: list, 51 | misstype:list.length>0?'loading':'nodata', 52 | misstxt:list.length>0?'好看的模板在路上٩(๑❛ᴗ❛๑)۶':'数据跑哪里了呢?(╥╯^╰╥)', 53 | }) 54 | } 55 | }) 56 | }, 57 | getdatalist(pageid) { 58 | wx.cloud.callFunction({ 59 | // 需调用的云函数名 60 | name: 'getQRElementList', 61 | // 传给云函数的参数 62 | data: { 63 | limit: this.data.limit, 64 | page_index: pageid - 1, 65 | self: false, 66 | datatype:1 67 | }, 68 | // 成功回调 69 | complete: (res) => { 70 | var list = res.result.data.list; 71 | var total = Math.ceil(res.result.data.total / this.data.limit); 72 | this.setData({ 73 | total: total, 74 | list: list, 75 | misstype:list.length>0?'loading':'nodata', 76 | misstxt:list.length>0?'好看的模板在路上٩(๑❛ᴗ❛๑)۶':'数据跑哪里了呢?(╥╯^╰╥)', 77 | }) 78 | } 79 | }) 80 | }, 81 | prepage() { 82 | if (this.data.pageid <= this.data.total&&this.data.pageid>1) { 83 | this.setData({ 84 | pageid: this.data.pageid - 1 85 | }) 86 | this.getdatalist(this.data.pageid) 87 | } 88 | }, 89 | nextpage(){ 90 | if(this.data.pageid 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /miniprogram/pages/qrlist/qrlist.wxss: -------------------------------------------------------------------------------- 1 | /* miniprogram/pages/qrlist/qrlist.wxss */ 2 | .opt { 3 | display: flex; 4 | justify-content: flex-start; 5 | align-items: center; 6 | width: 100%; 7 | padding-left: 30rpx; 8 | box-sizing: border-box; 9 | } 10 | .list{ 11 | padding: 15rpx; 12 | } 13 | .item{ 14 | margin: 15rpx; 15 | display: inline-block; 16 | } -------------------------------------------------------------------------------- /miniprogram/pages/txtmade/txtmade.js: -------------------------------------------------------------------------------- 1 | // miniprogram/pages/qrlist/qrlist.js 2 | import qrcode from '../../js/artqrcoed.js' 3 | import common from '../../js/common.js'; 4 | 5 | Page({ 6 | 7 | /** 8 | * 页面的初始数据 9 | */ 10 | data: { 11 | styleInfo: null, 12 | imginfo: null, 13 | qrinfo: { 14 | canvasid: 'qrcode', 15 | size: '', 16 | text: '', 17 | img: '' 18 | }, 19 | ifmadeqr: false, 20 | pbtip: false, 21 | tip: "", 22 | pbqr:false, 23 | }, 24 | addlikenum(id) { 25 | wx.cloud.callFunction({ 26 | // 需调用的云函数名 27 | name: 'reportQRLike', 28 | // 传给云函数的参数 29 | data: { 30 | qr_id: id 31 | }, 32 | // 成功回调 33 | complete: (res) => { 34 | console.log("add 1") 35 | } 36 | }) 37 | }, 38 | saveimg() { 39 | var that = this; 40 | wx.canvasToTempFilePath({ 41 | x: 0, 42 | y: 0, 43 | width: that.data.qrinfo.size, 44 | height: that.data.qrinfo.size, 45 | canvasId: that.data.qrinfo.canvasid, 46 | success: function (data) { 47 | wx.saveImageToPhotosAlbum({ 48 | filePath: data.tempFilePath, 49 | success: (res) => { 50 | console.log("保存成功") 51 | }, 52 | fail: (err) => {} 53 | }) 54 | } 55 | }) 56 | }, 57 | getsize() { 58 | return new Promise((resolve, reject) => { 59 | var that = this; 60 | var query = wx.createSelectorQuery(); 61 | query.select('.qrcode').boundingClientRect(function (rect) { 62 | var qrsize = 'qrinfo.size' 63 | that.setData({ 64 | [qrsize]: rect.height 65 | }) 66 | resolve(); 67 | }).exec(); 68 | }) 69 | }, 70 | async madeTxt() { 71 | if (this.data.qrinfo.text == '') { 72 | this.setData({ 73 | tip: '(▼へ▼メ)请输入文字吖~', 74 | pbtip: true 75 | }); 76 | return; 77 | } 78 | 79 | if (this.data.styleInfo == null) { 80 | this.setData({ 81 | tip: 'o(▼皿▼メ;)o选择二维码风格吖~', 82 | pbtip: true 83 | }); 84 | return; 85 | } 86 | 87 | try { 88 | const res = await common.checkText(this.data.qrinfo.text); 89 | if (res === 'pass') { 90 | this.setData({ 91 | pbimg: false, 92 | pbqr: true 93 | }); 94 | 95 | await this.manageimgs(); 96 | await this.getsize(); 97 | this.addlikenum(this.data.styleInfo._id); 98 | await qrcode.getqrcode(this.data.qrinfo, this.data.imginfo); 99 | 100 | this.setData({ 101 | ifmadeqr: true 102 | }); 103 | } else { 104 | this.setData({ 105 | tip: '(▼へ▼メ)文明有礼貌,不要乱发敏感词!~', 106 | pbtip: true 107 | }); 108 | } 109 | } catch (error) { 110 | console.error(error); 111 | } 112 | } 113 | , 114 | gettxt(e) { 115 | var txt = `qrinfo.text`; 116 | this.setData({ 117 | [txt]: e.detail.value 118 | }) 119 | wx.setStorage({ 120 | key: "qrtxt", 121 | data: e.detail.value 122 | }) 123 | }, 124 | close() { 125 | this.setData({ 126 | pbqr:false, 127 | pbtip: false, 128 | ifmadeqr: false 129 | }) 130 | }, 131 | async manageimgs() { 132 | var info = this.data.styleInfo; 133 | var imgs = { 134 | eye: info.eye, 135 | one: info.one, 136 | tian: info.tian, 137 | col2: info.col2, 138 | col3: info.col3, 139 | col4: info.col4, 140 | row2: info.row2, 141 | row3: info.row3, 142 | row4: info.row4, 143 | re7: info.re7, 144 | po7: info.po7, 145 | } 146 | for (const key in imgs) { 147 | if (imgs.hasOwnProperty(key)) { 148 | const element = imgs[key]; 149 | if (element) { 150 | await wx.cloud.downloadFile({ 151 | fileID: element 152 | }).then(res => { 153 | imgs[key] = res.tempFilePath; 154 | }).catch(error => {}) 155 | } 156 | 157 | } 158 | } 159 | this.setData({ 160 | imginfo: imgs 161 | }) 162 | }, 163 | goqrlist() { 164 | wx.navigateTo({ 165 | url: '/pages/qrlist/qrlist?pagefrom=txtmade' 166 | }) 167 | }, 168 | /** 169 | * 生命周期函数--监听页面加载 170 | */ 171 | onLoad: function (options) { 172 | var that = this; 173 | if (options.info) { 174 | var info = JSON.parse(options.info) 175 | this.setData({ 176 | styleInfo: info 177 | }) 178 | wx.getStorage({ 179 | key: 'qrtxt', 180 | success(res) { 181 | var txt = `qrinfo.text` 182 | var data=res.data; 183 | that.setData({ 184 | [txt]:data 185 | }) 186 | } 187 | }) 188 | } 189 | } 190 | }) -------------------------------------------------------------------------------- /miniprogram/pages/txtmade/txtmade.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "navbar":"../../components/navbar/navbar", 4 | "styleitem":"../../components/styleitem/styleitem", 5 | "page":"../../components/page/page", 6 | "cell":"../../components/cell/cell", 7 | "icon":"../../components/icon/icon", 8 | "btn":"../../components/btn/btn", 9 | "missbox":"../../components/missbox/missbox", 10 | "popbox":"../../components/popbox/popbox", 11 | "contain":"../../components/contain/contain" 12 | }, 13 | "navigationStyle": "custom" 14 | } -------------------------------------------------------------------------------- /miniprogram/pages/txtmade/txtmade.wxml: -------------------------------------------------------------------------------- 1 | 生成二维码 2 | 3 | 一、输入文明用语内容: 4 | 5 | 二、选择风格: 6 | 7 | 8 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 生成以后请用手机扫描验证是否能识别 20 | 生成 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 保存 30 | 31 | 32 | 33 | 34 | {{tip}} 35 | -------------------------------------------------------------------------------- /miniprogram/pages/txtmade/txtmade.wxss: -------------------------------------------------------------------------------- 1 | /* miniprogram/pages/txtmade/txtmad.wxss */ 2 | .tit { 3 | font-size: 36rpx; 4 | font-weight: bold; 5 | color: #fff; 6 | margin: 32rpx; 7 | display: flex; 8 | justify-content: space-between; 9 | } 10 | 11 | .input { 12 | border-radius: 10rpx; 13 | border: 4rpx solid #000000; 14 | box-sizing: border-box; 15 | box-shadow: var(--box-shadow); 16 | background: #fff; 17 | font-size: 32rpx; 18 | font-weight: bold; 19 | border-radius: 32rpx; 20 | margin-bottom: 50rpx; 21 | height: 200rpx; 22 | margin: 0 32rpx; 23 | box-sizing: border-box; 24 | text-align: left; 25 | padding: 20rpx; 26 | } 27 | 28 | content { 29 | text-align: center; 30 | } 31 | 32 | .item-qr { 33 | width: 330rpx; 34 | box-sizing: border-box; 35 | text-align: center; 36 | margin: 0 auto; 37 | margin-bottom: 30rpx; 38 | } 39 | 40 | .item { 41 | width: 330rpx; 42 | box-sizing: border-box; 43 | text-align: center; 44 | margin: 0 auto; 45 | margin-bottom: 30rpx; 46 | } 47 | 48 | .icon-add { 49 | margin: 150rpx 0; 50 | } 51 | .qrcode { 52 | margin: 30rpx auto; 53 | display: block; 54 | } 55 | 56 | .opt { 57 | text-align: center; 58 | } 59 | 60 | .missbox { 61 | position: absolute; 62 | width: 70%; 63 | left: 0; 64 | right: 0; 65 | top: 0; 66 | bottom: 0; 67 | height: 90%; 68 | background: #fff; 69 | z-index: 9; 70 | margin: auto; 71 | } 72 | .tip{ 73 | margin:0 32rpx; 74 | color:var(--tip-1); 75 | font-size: var(--size-tip-1); 76 | } -------------------------------------------------------------------------------- /miniprogram/pages/upload/upload.js: -------------------------------------------------------------------------------- 1 | // miniprogram/pages/upload/upload.js 2 | import common from '../../js/common.js'; 3 | 4 | Page({ 5 | 6 | /** 7 | * 页面的初始数据 8 | */ 9 | data: { 10 | list: [{ 11 | name: "cover", 12 | temporary: "", 13 | fileId: "", 14 | url: '../../images/demo.png', 15 | }, { 16 | name: "eye", 17 | temporary: "", 18 | fileId: "", 19 | url: '../../images/upload/eye.png', 20 | }, { 21 | name: "one", 22 | temporary: "", 23 | fileId: "", 24 | url: '../../images/upload/one.png', 25 | }, { 26 | name: "col2", 27 | temporary: "", 28 | fileId: "", 29 | url: '../../images/upload/col2.png', 30 | }, { 31 | name: "col3", 32 | temporary: "", 33 | fileId: "", 34 | url: '../../images/upload/col3.png', 35 | }, { 36 | name: "col4", 37 | temporary: "", 38 | fileId: "", 39 | url: '../../images/upload/col4.png', 40 | }, { 41 | name: "po7", 42 | temporary: "", 43 | fileId: "", 44 | url: '../../images/upload/po7.png', 45 | }, { 46 | name: "re7", 47 | temporary: "", 48 | fileId: "", 49 | url: '../../images/upload/re7.png', 50 | }, { 51 | name: "row2", 52 | temporary: "", 53 | fileId: "", 54 | url: '../../images/upload/row2.png', 55 | }, { 56 | name: "row3", 57 | temporary: "", 58 | fileId: "", 59 | url: '../../images/upload/row3.png', 60 | }, { 61 | name: "row4", 62 | temporary: "", 63 | fileId: "", 64 | url: '../../images/upload/row4.png', 65 | }, { 66 | name: "tian", 67 | temporary: "", 68 | fileId: "", 69 | url: '../../images/upload/tian.png', 70 | }], 71 | pbupload: false, 72 | stylename: null, 73 | pbtip: false, 74 | tip: "", 75 | isuploaded: false, 76 | ifgetinfo: false, 77 | userInfo: { 78 | avatarUrl: '', 79 | nickName: '点击获取信息' 80 | }, 81 | }, 82 | gettxt(e) { 83 | this.setData({ 84 | stylename: e.detail.value 85 | }) 86 | }, 87 | close(e) { 88 | this.setData({ 89 | pbupload: false, 90 | pbrule: false, 91 | pbtip: false 92 | }) 93 | }, 94 | upload() { 95 | var that = this; 96 | var data = { 97 | cover: that.data.list[0].fileId, //封面 98 | eye: that.data.list[1].fileId, //必填 99 | one: that.data.list[2].fileId, //必填 100 | col2: that.data.list[3].fileId, 101 | col3: that.data.list[4].fileId, 102 | col4: that.data.list[5].fileId, 103 | po7: that.data.list[6].fileId, 104 | re7: that.data.list[7].fileId, 105 | row2: that.data.list[8].fileId, 106 | row3: that.data.list[9].fileId, 107 | row4: that.data.list[10].fileId, 108 | tian: that.data.list[11].fileId, 109 | element_name: that.data.stylename, //必填,素材包名称 110 | _author_avatar: that.data.userInfo.avatarUrl, 111 | _author_name: that.data.userInfo.nickName //必填,用户名称 112 | } 113 | this.setData({ 114 | pbupload: false, 115 | isuploaded: false, 116 | pbtip: true, 117 | }) 118 | wx.cloud.callFunction({ 119 | // 需调用的云函数名 120 | name: 'uploadQRElement', 121 | // 传给云函数的参数 122 | data: data, 123 | // 成功回调 124 | complete: (res) => { 125 | that.setData({ 126 | isuploaded: true, 127 | tip: `٩(๑>◡<๑)۶ :${res.result.msg},你可以继续上传素材哟~`, 128 | list: [{ 129 | name: "cover", 130 | temporary: "", 131 | fileId: "", 132 | url: '../../images/demo.png', 133 | }, { 134 | name: "eye", 135 | temporary: "", 136 | fileId: "", 137 | url: '../../images/upload/eye.png', 138 | }, { 139 | name: "one", 140 | temporary: "", 141 | fileId: "", 142 | url: '../../images/upload/one.png', 143 | }, { 144 | name: "col2", 145 | temporary: "", 146 | fileId: "", 147 | url: '../../images/upload/col2.png', 148 | }, { 149 | name: "col3", 150 | temporary: "", 151 | fileId: "", 152 | url: '../../images/upload/col3.png', 153 | }, { 154 | name: "col4", 155 | temporary: "", 156 | fileId: "", 157 | url: '../../images/upload/col4.png', 158 | }, { 159 | name: "po7", 160 | temporary: "", 161 | fileId: "", 162 | url: '../../images/upload/po7.png', 163 | }, { 164 | name: "re7", 165 | temporary: "", 166 | fileId: "", 167 | url: '../../images/upload/re7.png', 168 | }, { 169 | name: "row2", 170 | temporary: "", 171 | fileId: "", 172 | url: '../../images/upload/row2.png', 173 | }, { 174 | name: "row3", 175 | temporary: "", 176 | fileId: "", 177 | url: '../../images/upload/row3.png', 178 | }, { 179 | name: "row4", 180 | temporary: "", 181 | fileId: "", 182 | url: '../../images/upload/row4.png', 183 | }, { 184 | name: "tian", 185 | temporary: "", 186 | fileId: "", 187 | url: '../../images/upload/tian.png', 188 | }], 189 | }) 190 | } 191 | }) 192 | 193 | }, 194 | check() { 195 | if (this.data.list[0].fileId == "" || this.data.list[1].fileId == "" || this.data.list[2].fileId == "") { 196 | this.setData({ 197 | tip: '(▼へ▼メ)至少上传前三张示意图哦~,不明白可点击右上角查看设计指引哦~', 198 | pbtip: true, 199 | isuploaded: true 200 | }) 201 | return; 202 | } 203 | this.setData({ 204 | pbupload: true, 205 | isuploaded: false 206 | }) 207 | }, 208 | showpbupload() { 209 | var that = this; 210 | if (!this.data.ifgetinfo) { 211 | this.getUserProfile().then(() => { 212 | this.check() 213 | }).catch(() => { 214 | that.setData({ 215 | pbtip: true, 216 | tip: '(╬◣д◢)不授权无法上传素材哦!', 217 | isuploaded: true, 218 | ifgetinfo: false 219 | }) 220 | }); 221 | } else { 222 | this.check() 223 | } 224 | }, 225 | showpbrule() { 226 | wx.navigateTo({ 227 | url: '/pages/designrule/designrule' 228 | }) 229 | }, 230 | // 选择单张图片 231 | chooseSingleImg(e) { 232 | var that = this; 233 | var name = e.currentTarget.dataset.name; 234 | wx.chooseImage({ 235 | count: 1, 236 | sizeType: ['compressed'], 237 | sourceType: ['album', 'camera'], 238 | success: function (res) { 239 | for (let i = 0; i < that.data.list.length; i++) { 240 | if (that.data.list[i].name == name) { 241 | // 转成base64 242 | common.urlTobase64(res.tempFilePaths[0]).then(data => { 243 | // 上传图片 244 | common.uploadSingleImg(data).then(imgfileId => { 245 | // 上传成功后 246 | var temporary = `list[${i}].temporary`; 247 | var fileId = `list[${i}].fileId`; 248 | that.setData({ 249 | [temporary]: res.tempFilePaths[0], 250 | [fileId]: imgfileId 251 | }) 252 | }); 253 | }) 254 | break; 255 | } 256 | } 257 | } 258 | }) 259 | }, 260 | /** 261 | * 生命周期函数--监听页面加载 262 | */ 263 | onLoad: function (options) { 264 | var that = this; 265 | wx.getStorage({ 266 | key: 'userInfo', 267 | success: (e) => { 268 | var info = JSON.parse(e.data); 269 | that.setData({ 270 | userInfo: info, 271 | ifgetinfo:true 272 | }) 273 | }, 274 | fail: (e) => { 275 | that.setData({ 276 | pbtip: true, 277 | tip: '٩(๑>◡<๑)۶ 请点击头像授权资料哦~', 278 | isuploaded: true, 279 | ifgetinfo: false 280 | }) 281 | } 282 | }) 283 | }, 284 | getUserProfile(e) { 285 | return new Promise((resolve, reject) => { 286 | // 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认,开发者妥善保管用户快速填写的头像昵称,避免重复弹窗 287 | wx.getUserProfile({ 288 | desc: '展示用户信息', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 289 | success: (res) => { 290 | this.setData({ 291 | userInfo: res.userInfo, 292 | ifgetinfo: true, 293 | }) 294 | var info = JSON.stringify(res.userInfo); 295 | wx.setStorage({ 296 | key: "userInfo", 297 | data: info 298 | }), 299 | resolve(); 300 | }, 301 | fail: (e) => { 302 | this.setData({ 303 | ifgetinfo: false 304 | }) 305 | reject(e); 306 | } 307 | }) 308 | }) 309 | } 310 | }) -------------------------------------------------------------------------------- /miniprogram/pages/upload/upload.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "navbar":"../../components/navbar/navbar", 4 | "styleitem":"../../components/styleitem/styleitem", 5 | "page":"../../components/page/page", 6 | "icon":"../../components/icon/icon", 7 | "btn":"../../components/btn/btn", 8 | "avatar":"../../components/avatar/avatar", 9 | "missbox":"../../components/missbox/missbox", 10 | "popbox":"../../components/popbox/popbox", 11 | "cell":"../../components/cell/cell", 12 | "contain":"../../components/contain/contain" 13 | }, 14 | "navigationStyle": "custom" 15 | } -------------------------------------------------------------------------------- /miniprogram/pages/upload/upload.wxml: -------------------------------------------------------------------------------- 1 | 自定义素材 2 | 3 | 4 | 5 | 6 | {{userInfo.nickName}} 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 下一步 20 | 21 | 22 | 23 | 24 | 标题: 25 | 27 | 28 | 您将上传以下图片素材: 29 | 30 | 31 | 32 | 33 | 34 | ヾ(✿゚▽゚)ノ好看的风格,则有机会在社区中展示哦~ 35 | 36 | 上传素材包 37 | 38 | 39 | 40 | 41 | 42 | {{tip}} 43 | 44 | 45 | -------------------------------------------------------------------------------- /miniprogram/pages/upload/upload.wxss: -------------------------------------------------------------------------------- 1 | /* miniprogram/pages/upload/upload.wxss */ 2 | .opt{ 3 | display: flex; 4 | align-items: center; 5 | justify-content: space-between; 6 | margin: 0 20rpx; 7 | margin-left: 30rpx; 8 | margin-bottom: 30rpx; 9 | } 10 | .user{ 11 | text-align: center; 12 | margin-right: 40rpx; 13 | display: flex; 14 | align-items: center; 15 | } 16 | .user-name{ 17 | font-weight: bold; 18 | color: #fff; 19 | line-height: 50rpx; 20 | font-size: 36rpx; 21 | margin-left: 20rpx; 22 | } 23 | .list{ 24 | padding: 15rpx; 25 | width: 750rpx; 26 | box-sizing: border-box; 27 | display: flex; 28 | flex-wrap: wrap; 29 | justify-content: center; 30 | } 31 | .item{ 32 | width: 210rpx; 33 | padding-left: 15rpx; 34 | padding-right: 15rpx; 35 | display: inline-block; 36 | margin-bottom: 25rpx; 37 | } 38 | .item-name{ 39 | text-align: center; 40 | font-size: 36rpx; 41 | color: #fff; 42 | } 43 | .img{ 44 | width: 175rpx; 45 | height: 175rpx; 46 | margin: 15rpx; 47 | box-sizing: border-box; 48 | } 49 | .img image{ 50 | width: 100%; 51 | height: 100%; 52 | } 53 | 54 | .input{ 55 | background: #FFFFFF; 56 | border: 4rpx solid #000000; 57 | box-shadow: 4rpx 4rpx 0rpx #000; 58 | height: 80rpx; 59 | border-radius: 32rpx; 60 | padding-left: 20rpx; 61 | font-size: 36rpx; 62 | font-weight: bold; 63 | } 64 | .txt{ 65 | font-size: 36rpx; 66 | margin: 20rpx 0; 67 | } 68 | .img-box{ 69 | width:100%; 70 | height: 500rpx; 71 | overflow: scroll; 72 | 73 | } 74 | .img-item{ 75 | display: inline-block; 76 | width: 120rpx; 77 | height: 120rpx; 78 | padding: 20rpx; 79 | background: #FFFFFF; 80 | border: 4rpx solid #000000; 81 | box-shadow: 4rpx 4rpx 0rpx #000; 82 | box-sizing: border-box; 83 | margin: 10rpx; 84 | } 85 | .img-item image{ 86 | width: 100%; 87 | height: 100%; 88 | } 89 | .popbox{ 90 | height: 600rpx; 91 | overflow: scroll; 92 | } -------------------------------------------------------------------------------- /miniprogram/sitemap.json: -------------------------------------------------------------------------------- 1 | { 2 | "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", 3 | "rules": [{ 4 | "action": "allow", 5 | "page": "*" 6 | }] 7 | } -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "qrcode", 3 | "lockfileVersion": 2, 4 | "requires": true, 5 | "packages": { 6 | "": { 7 | "dependencies": { 8 | "qrcode-reader": "^1.0.4", 9 | "weapp-qrcode": "^1.0.0" 10 | } 11 | }, 12 | "node_modules/extend": { 13 | "version": "3.0.2", 14 | "resolved": "http://r.tnpm.oa.com/extend/-/extend-3.0.2.tgz", 15 | "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", 16 | "license": "MIT" 17 | }, 18 | "node_modules/qrcode-reader": { 19 | "version": "1.0.4", 20 | "resolved": "http://r.tnpm.oa.com/qrcode-reader/-/qrcode-reader-1.0.4.tgz", 21 | "integrity": "sha512-rRjALGNh9zVqvweg1j5OKIQKNsw3bLC+7qwlnead5K/9cb1cEIAGkwikt/09U0K+2IDWGD9CC6SP7tHAjUeqvQ==", 22 | "license": "Apache-2.0" 23 | }, 24 | "node_modules/weapp-qrcode": { 25 | "version": "1.0.0", 26 | "resolved": "http://r.tnpm.oa.com/weapp-qrcode/-/weapp-qrcode-1.0.0.tgz", 27 | "integrity": "sha512-4sa3W0rGDVJ9QaeZpAKlAuUxVyjhDwiUqHyGK/jJMsRMXnhb4yO8qWU/pZruMo+iT5J6CraS67lDMFb1VY+RaA==", 28 | "license": "MIT", 29 | "dependencies": { 30 | "extend": "^3.0.2" 31 | } 32 | } 33 | }, 34 | "dependencies": { 35 | "extend": { 36 | "version": "3.0.2", 37 | "resolved": "http://r.tnpm.oa.com/extend/-/extend-3.0.2.tgz", 38 | "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" 39 | }, 40 | "qrcode-reader": { 41 | "version": "1.0.4", 42 | "resolved": "http://r.tnpm.oa.com/qrcode-reader/-/qrcode-reader-1.0.4.tgz", 43 | "integrity": "sha512-rRjALGNh9zVqvweg1j5OKIQKNsw3bLC+7qwlnead5K/9cb1cEIAGkwikt/09U0K+2IDWGD9CC6SP7tHAjUeqvQ==" 44 | }, 45 | "weapp-qrcode": { 46 | "version": "1.0.0", 47 | "resolved": "http://r.tnpm.oa.com/weapp-qrcode/-/weapp-qrcode-1.0.0.tgz", 48 | "integrity": "sha512-4sa3W0rGDVJ9QaeZpAKlAuUxVyjhDwiUqHyGK/jJMsRMXnhb4yO8qWU/pZruMo+iT5J6CraS67lDMFb1VY+RaA==", 49 | "requires": { 50 | "extend": "^3.0.2" 51 | } 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "qrcode-reader": "^1.0.4", 4 | "weapp-qrcode": "^1.0.0" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /project.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "miniprogramRoot": "miniprogram/", 3 | "cloudfunctionRoot": "cloudfunctions/", 4 | "setting": { 5 | "urlCheck": true, 6 | "es6": true, 7 | "enhance": true, 8 | "postcss": true, 9 | "preloadBackgroundData": false, 10 | "minified": true, 11 | "newFeature": true, 12 | "coverView": true, 13 | "nodeModules": true, 14 | "autoAudits": false, 15 | "showShadowRootInWxmlPanel": true, 16 | "scopeDataCheck": false, 17 | "uglifyFileName": false, 18 | "checkInvalidKey": true, 19 | "checkSiteMap": true, 20 | "uploadWithSourceMap": true, 21 | "compileHotReLoad": false, 22 | "useMultiFrameRuntime": true, 23 | "useApiHook": true, 24 | "useApiHostProcess": true, 25 | "babelSetting": { 26 | "ignore": [], 27 | "disablePlugins": [], 28 | "outputPath": "" 29 | }, 30 | "enableEngineNative": false, 31 | "useIsolateContext": true, 32 | "useCompilerModule": true, 33 | "userConfirmedUseCompilerModuleSwitch": false, 34 | "userConfirmedBundleSwitch": false, 35 | "packNpmManually": false, 36 | "packNpmRelationList": [], 37 | "minifyWXSS": true, 38 | "condition": false 39 | }, 40 | "appid": "wxdb5a9d708acf35ee", 41 | "projectname": "qrcode", 42 | "libVersion": "2.16.1", 43 | "cloudfunctionTemplateRoot": "cloudfunctionTemplate/", 44 | "condition": { 45 | "search": { 46 | "list": [] 47 | }, 48 | "conversation": { 49 | "list": [] 50 | }, 51 | "plugin": { 52 | "list": [] 53 | }, 54 | "game": { 55 | "list": [] 56 | }, 57 | "miniprogram": { 58 | "list": [ 59 | { 60 | "id": -1, 61 | "name": "db guide", 62 | "pathName": "pages/databaseGuide/databaseGuide" 63 | } 64 | ] 65 | } 66 | }, 67 | "compileType": "miniprogram", 68 | "srcMiniprogramRoot": "miniprogram/", 69 | "packOptions": { 70 | "ignore": [], 71 | "include": [] 72 | }, 73 | "editorSetting": { 74 | "tabIndent": "insertSpaces", 75 | "tabSize": 2 76 | } 77 | } -------------------------------------------------------------------------------- /project.private.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "setting": {}, 3 | "condition": { 4 | "miniprogram": { 5 | "list": [ 6 | { 7 | "name": "db guide", 8 | "pathName": "pages/databaseGuide/databaseGuide", 9 | "query": "" 10 | }, 11 | { 12 | "name": "pages/qrcode/qrcode", 13 | "pathName": "pages/qrcode/qrcode", 14 | "query": "", 15 | "scene": null 16 | }, 17 | { 18 | "name": "pages/index/index", 19 | "pathName": "pages/index/index", 20 | "query": "", 21 | "scene": null 22 | }, 23 | { 24 | "name": "pages/uploadqrImg/uploadqrImg", 25 | "pathName": "pages/uploadqrImg/uploadqrImg", 26 | "query": "", 27 | "scene": null 28 | }, 29 | { 30 | "name": "pages/components/components", 31 | "pathName": "pages/components/components", 32 | "query": "", 33 | "scene": null 34 | }, 35 | { 36 | "name": "pages/qrlist/qrlist", 37 | "pathName": "pages/qrlist/qrlist", 38 | "query": "", 39 | "scene": null 40 | }, 41 | { 42 | "name": "pages/myqrlist/myqrlist", 43 | "pathName": "pages/myqrlist/myqrlist", 44 | "query": "", 45 | "scene": null 46 | }, 47 | { 48 | "name": "pages/upload/upload", 49 | "pathName": "pages/upload/upload", 50 | "query": "", 51 | "scene": null 52 | }, 53 | { 54 | "name": "pages/txtmade/txtmad", 55 | "pathName": "pages/txtmade/txtmad", 56 | "query": "", 57 | "scene": null 58 | }, 59 | { 60 | "name": "pages/txtmade/txtmade", 61 | "pathName": "pages/txtmade/txtmade", 62 | "query": "", 63 | "scene": null 64 | }, 65 | { 66 | "name": "pages/imgmade/imgmade", 67 | "pathName": "pages/imgmade/imgmade", 68 | "query": "", 69 | "scene": null 70 | }, 71 | { 72 | "name": "pages/designrule/designrule", 73 | "pathName": "pages/designrule/designrule", 74 | "query": "", 75 | "scene": null 76 | }, 77 | { 78 | "name": "pages/checkqr/checkqr", 79 | "pathName": "pages/checkqr/checkqr", 80 | "query": "", 81 | "scene": null 82 | } 83 | ] 84 | } 85 | }, 86 | "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html" 87 | } -------------------------------------------------------------------------------- /readme/cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/readme/cover.png -------------------------------------------------------------------------------- /readme/toolcode.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/readme/toolcode.jpg -------------------------------------------------------------------------------- /readme/上传.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/readme/上传.gif -------------------------------------------------------------------------------- /readme/上传指引.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/readme/上传指引.gif -------------------------------------------------------------------------------- /readme/图片生成.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/readme/图片生成.gif -------------------------------------------------------------------------------- /readme/我的生成.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/readme/我的生成.gif -------------------------------------------------------------------------------- /readme/我的素材.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/readme/我的素材.gif -------------------------------------------------------------------------------- /readme/文字生成.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/readme/文字生成.gif -------------------------------------------------------------------------------- /readme/流程.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/readme/流程.mp4 -------------------------------------------------------------------------------- /readme/社区.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/readme/社区.gif -------------------------------------------------------------------------------- /readme/艺术例子.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/readme/艺术例子.png -------------------------------------------------------------------------------- /readme/首页.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/readme/首页.gif -------------------------------------------------------------------------------- /readme/黑白例子.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeDaHub/incubator-qrcode/3031ac57ba174b410ade990e16d234edb7848180/readme/黑白例子.png --------------------------------------------------------------------------------