├── README.md ├── Snipaste_2019-01-03_10-16-38.png ├── Snipaste_2019-01-03_10-17-26.png ├── Snipaste_2019-01-03_10-17-42.png ├── Snipaste_2019-01-03_10-17-52.png ├── cloudfunctions ├── addperson │ ├── index.js │ ├── package-lock.json │ └── package.json ├── login │ ├── index.js │ └── package-lock.json ├── saveformid │ ├── index.js │ ├── package-lock.json │ └── package.json └── savething │ ├── index.js │ ├── package-lock.json │ └── package.json ├── miniprogram ├── apis │ ├── index.js │ └── qqmap-wx-jssdk.min.js ├── app.js ├── app.json ├── app.wxss ├── components │ ├── aboutus │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── music │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── nothing │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ └── toptip │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss ├── config.js ├── images │ ├── add.svg │ ├── address.svg │ ├── arrowright.svg │ ├── cusser.svg │ ├── cut.svg │ ├── del.svg │ ├── delete.svg │ ├── delete_w.svg │ ├── edit.svg │ ├── edit_w.svg │ ├── finish.svg │ ├── gh_38a8dfd54795_430.jpg │ ├── gh_6b47f7286356_258.jpg │ ├── half.png │ ├── half.svg │ ├── loading.gif │ ├── love.jpg │ ├── music.svg │ ├── new.png │ ├── normal.png │ ├── pause.svg │ ├── play.svg │ ├── selected.png │ ├── selected.svg │ ├── show-wall.svg │ ├── star-half-b.svg │ ├── success.svg │ ├── tag.png │ ├── tag.svg │ ├── time.svg │ ├── wechat.svg │ └── wechatzone.svg ├── libs │ ├── node-schedule │ │ └── schedule.js │ └── regenerator-runtime │ │ └── runtime.js ├── pages │ ├── chooseLib │ │ ├── chooseLib.js │ │ ├── chooseLib.json │ │ ├── chooseLib.wxml │ │ └── chooseLib.wxss │ ├── doing │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── index │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ ├── index.wxss │ │ └── user-unlogin.png │ ├── memory │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── self │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── share │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ ├── index.wxss │ │ └── user-unlogin.png │ └── wall │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss └── style │ └── guide.wxss ├── project.config.json └── readme.md /README.md: -------------------------------------------------------------------------------- 1 | # 云开发 quickstart 2 | 3 | 这是云开发的快速启动指引,其中演示了如何上手使用云开发的三大基础能力: 4 | 5 | - 数据库:一个既可在小程序前端操作,也能在云函数中读写的 JSON 文档型数据库 6 | - 文件存储:在小程序前端直接上传/下载云端文件,在云开发控制台可视化管理 7 | - 云函数:在云端运行的代码,微信私有协议天然鉴权,开发者只需编写业务逻辑代码 8 | ![Image text](https://www.gdfed.xyz/gh_38a8dfd54795_430.jpg) 9 | 10 | ## 参考文档 11 | 12 | - [云开发文档](https://developers.weixin.qq.com/miniprogram/dev/wxcloud/basis/getting-started.html) 13 | 14 | -------------------------------------------------------------------------------- /Snipaste_2019-01-03_10-16-38.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdFed/thelow/690a00a0a61e9a9afdcfc66e65cafd680a137d53/Snipaste_2019-01-03_10-16-38.png -------------------------------------------------------------------------------- /Snipaste_2019-01-03_10-17-26.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdFed/thelow/690a00a0a61e9a9afdcfc66e65cafd680a137d53/Snipaste_2019-01-03_10-17-26.png -------------------------------------------------------------------------------- /Snipaste_2019-01-03_10-17-42.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdFed/thelow/690a00a0a61e9a9afdcfc66e65cafd680a137d53/Snipaste_2019-01-03_10-17-42.png -------------------------------------------------------------------------------- /Snipaste_2019-01-03_10-17-52.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdFed/thelow/690a00a0a61e9a9afdcfc66e65cafd680a137d53/Snipaste_2019-01-03_10-17-52.png -------------------------------------------------------------------------------- /cloudfunctions/addperson/index.js: -------------------------------------------------------------------------------- 1 | // 云函数入口文件 2 | const cloud = require('wx-server-sdk') 3 | cloud.init() 4 | 5 | const db = cloud.database() 6 | 7 | // 云函数入口函数 8 | exports.main = async (event, context) => { 9 | let data = event.person 10 | data.openid = event.userInfo.openId 11 | try { 12 | const res = await db.collection('personinfo').where({openid: event.userInfo.openId}).count() 13 | console.log(res.total) 14 | if(res.total){ 15 | return await db.collection('personinfo').where({ 16 | openid: event.userInfo.openId 17 | }).update({data: event.person}) 18 | } else { 19 | return await db.collection('personinfo').add({data}) 20 | } 21 | 22 | 23 | } catch (e) { 24 | console.error(e) 25 | } 26 | } -------------------------------------------------------------------------------- /cloudfunctions/addperson/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "addperson", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "ajv": { 8 | "version": "5.5.2", 9 | "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", 10 | "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", 11 | "requires": { 12 | "co": "4.6.0", 13 | "fast-deep-equal": "1.1.0", 14 | "fast-json-stable-stringify": "2.0.0", 15 | "json-schema-traverse": "0.3.1" 16 | } 17 | }, 18 | "asn1": { 19 | "version": "0.2.4", 20 | "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", 21 | "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", 22 | "requires": { 23 | "safer-buffer": "2.1.2" 24 | } 25 | }, 26 | "assert-plus": { 27 | "version": "1.0.0", 28 | "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", 29 | "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" 30 | }, 31 | "asynckit": { 32 | "version": "0.4.0", 33 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", 34 | "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" 35 | }, 36 | "aws-sign2": { 37 | "version": "0.7.0", 38 | "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", 39 | "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" 40 | }, 41 | "aws4": { 42 | "version": "1.8.0", 43 | "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", 44 | "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" 45 | }, 46 | "bcrypt-pbkdf": { 47 | "version": "1.0.2", 48 | "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", 49 | "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", 50 | "optional": true, 51 | "requires": { 52 | "tweetnacl": "0.14.5" 53 | } 54 | }, 55 | "caseless": { 56 | "version": "0.12.0", 57 | "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", 58 | "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" 59 | }, 60 | "co": { 61 | "version": "4.6.0", 62 | "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", 63 | "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" 64 | }, 65 | "combined-stream": { 66 | "version": "1.0.7", 67 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", 68 | "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", 69 | "requires": { 70 | "delayed-stream": "1.0.0" 71 | } 72 | }, 73 | "core-util-is": { 74 | "version": "1.0.2", 75 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", 76 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" 77 | }, 78 | "dashdash": { 79 | "version": "1.14.1", 80 | "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", 81 | "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", 82 | "requires": { 83 | "assert-plus": "1.0.0" 84 | } 85 | }, 86 | "deep-assign": { 87 | "version": "2.0.0", 88 | "resolved": "https://registry.npmjs.org/deep-assign/-/deep-assign-2.0.0.tgz", 89 | "integrity": "sha1-6+BrHwfwja5ZdiDj3RYi83GhxXI=", 90 | "requires": { 91 | "is-obj": "1.0.1" 92 | } 93 | }, 94 | "delayed-stream": { 95 | "version": "1.0.0", 96 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 97 | "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" 98 | }, 99 | "ecc-jsbn": { 100 | "version": "0.1.2", 101 | "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", 102 | "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", 103 | "optional": true, 104 | "requires": { 105 | "jsbn": "0.1.1", 106 | "safer-buffer": "2.1.2" 107 | } 108 | }, 109 | "extend": { 110 | "version": "3.0.2", 111 | "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", 112 | "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" 113 | }, 114 | "extsprintf": { 115 | "version": "1.3.0", 116 | "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", 117 | "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" 118 | }, 119 | "fast-deep-equal": { 120 | "version": "1.1.0", 121 | "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", 122 | "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" 123 | }, 124 | "fast-json-stable-stringify": { 125 | "version": "2.0.0", 126 | "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", 127 | "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" 128 | }, 129 | "forever-agent": { 130 | "version": "0.6.1", 131 | "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", 132 | "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" 133 | }, 134 | "form-data": { 135 | "version": "2.3.2", 136 | "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", 137 | "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", 138 | "requires": { 139 | "asynckit": "0.4.0", 140 | "combined-stream": "1.0.6", 141 | "mime-types": "2.1.20" 142 | }, 143 | "dependencies": { 144 | "combined-stream": { 145 | "version": "1.0.6", 146 | "resolved": "http://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", 147 | "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", 148 | "requires": { 149 | "delayed-stream": "1.0.0" 150 | } 151 | } 152 | } 153 | }, 154 | "getpass": { 155 | "version": "0.1.7", 156 | "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", 157 | "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", 158 | "requires": { 159 | "assert-plus": "1.0.0" 160 | } 161 | }, 162 | "har-schema": { 163 | "version": "2.0.0", 164 | "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", 165 | "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" 166 | }, 167 | "har-validator": { 168 | "version": "5.1.0", 169 | "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.0.tgz", 170 | "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==", 171 | "requires": { 172 | "ajv": "5.5.2", 173 | "har-schema": "2.0.0" 174 | } 175 | }, 176 | "http-signature": { 177 | "version": "1.2.0", 178 | "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", 179 | "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", 180 | "requires": { 181 | "assert-plus": "1.0.0", 182 | "jsprim": "1.4.1", 183 | "sshpk": "1.14.2" 184 | } 185 | }, 186 | "is-obj": { 187 | "version": "1.0.1", 188 | "resolved": "http://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", 189 | "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=" 190 | }, 191 | "is-typedarray": { 192 | "version": "1.0.0", 193 | "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", 194 | "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" 195 | }, 196 | "isstream": { 197 | "version": "0.1.2", 198 | "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", 199 | "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" 200 | }, 201 | "jsbn": { 202 | "version": "0.1.1", 203 | "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", 204 | "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", 205 | "optional": true 206 | }, 207 | "json-schema": { 208 | "version": "0.2.3", 209 | "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", 210 | "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" 211 | }, 212 | "json-schema-traverse": { 213 | "version": "0.3.1", 214 | "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", 215 | "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" 216 | }, 217 | "json-stringify-safe": { 218 | "version": "5.0.1", 219 | "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", 220 | "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" 221 | }, 222 | "jsprim": { 223 | "version": "1.4.1", 224 | "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", 225 | "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", 226 | "requires": { 227 | "assert-plus": "1.0.0", 228 | "extsprintf": "1.3.0", 229 | "json-schema": "0.2.3", 230 | "verror": "1.10.0" 231 | } 232 | }, 233 | "mime-db": { 234 | "version": "1.36.0", 235 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.36.0.tgz", 236 | "integrity": "sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw==" 237 | }, 238 | "mime-types": { 239 | "version": "2.1.20", 240 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.20.tgz", 241 | "integrity": "sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A==", 242 | "requires": { 243 | "mime-db": "1.36.0" 244 | } 245 | }, 246 | "oauth-sign": { 247 | "version": "0.9.0", 248 | "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", 249 | "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" 250 | }, 251 | "performance-now": { 252 | "version": "2.1.0", 253 | "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", 254 | "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" 255 | }, 256 | "psl": { 257 | "version": "1.1.29", 258 | "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", 259 | "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==" 260 | }, 261 | "punycode": { 262 | "version": "1.4.1", 263 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", 264 | "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" 265 | }, 266 | "qs": { 267 | "version": "6.5.2", 268 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", 269 | "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" 270 | }, 271 | "request": { 272 | "version": "2.88.0", 273 | "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", 274 | "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", 275 | "requires": { 276 | "aws-sign2": "0.7.0", 277 | "aws4": "1.8.0", 278 | "caseless": "0.12.0", 279 | "combined-stream": "1.0.7", 280 | "extend": "3.0.2", 281 | "forever-agent": "0.6.1", 282 | "form-data": "2.3.2", 283 | "har-validator": "5.1.0", 284 | "http-signature": "1.2.0", 285 | "is-typedarray": "1.0.0", 286 | "isstream": "0.1.2", 287 | "json-stringify-safe": "5.0.1", 288 | "mime-types": "2.1.20", 289 | "oauth-sign": "0.9.0", 290 | "performance-now": "2.1.0", 291 | "qs": "6.5.2", 292 | "safe-buffer": "5.1.2", 293 | "tough-cookie": "2.4.3", 294 | "tunnel-agent": "0.6.0", 295 | "uuid": "3.3.2" 296 | } 297 | }, 298 | "safe-buffer": { 299 | "version": "5.1.2", 300 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 301 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 302 | }, 303 | "safer-buffer": { 304 | "version": "2.1.2", 305 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 306 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 307 | }, 308 | "sshpk": { 309 | "version": "1.14.2", 310 | "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz", 311 | "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", 312 | "requires": { 313 | "asn1": "0.2.4", 314 | "assert-plus": "1.0.0", 315 | "bcrypt-pbkdf": "1.0.2", 316 | "dashdash": "1.14.1", 317 | "ecc-jsbn": "0.1.2", 318 | "getpass": "0.1.7", 319 | "jsbn": "0.1.1", 320 | "safer-buffer": "2.1.2", 321 | "tweetnacl": "0.14.5" 322 | } 323 | }, 324 | "tough-cookie": { 325 | "version": "2.4.3", 326 | "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", 327 | "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", 328 | "requires": { 329 | "psl": "1.1.29", 330 | "punycode": "1.4.1" 331 | } 332 | }, 333 | "tslib": { 334 | "version": "1.9.3", 335 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", 336 | "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==" 337 | }, 338 | "tunnel-agent": { 339 | "version": "0.6.0", 340 | "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", 341 | "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", 342 | "requires": { 343 | "safe-buffer": "5.1.2" 344 | } 345 | }, 346 | "tweetnacl": { 347 | "version": "0.14.5", 348 | "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", 349 | "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", 350 | "optional": true 351 | }, 352 | "uuid": { 353 | "version": "3.3.2", 354 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", 355 | "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" 356 | }, 357 | "verror": { 358 | "version": "1.10.0", 359 | "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", 360 | "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", 361 | "requires": { 362 | "assert-plus": "1.0.0", 363 | "core-util-is": "1.0.2", 364 | "extsprintf": "1.3.0" 365 | } 366 | }, 367 | "wx-server-sdk": { 368 | "version": "0.0.19", 369 | "resolved": "http://registry.npm.taobao.org/wx-server-sdk/download/wx-server-sdk-0.0.19.tgz", 370 | "integrity": "sha1-tekWN/2cJGZLmZOvJKuB+zNnwoI=", 371 | "requires": { 372 | "tcb-admin-node": "1.1.4", 373 | "tslib": "1.9.3" 374 | }, 375 | "dependencies": { 376 | "tcb-admin-node": { 377 | "version": "1.1.4", 378 | "resolved": "http://registry.npm.taobao.org/tcb-admin-node/download/tcb-admin-node-1.1.4.tgz", 379 | "integrity": "sha1-Ta/2w4k6wBL3QPOAyNE8D0qTQ/c=", 380 | "requires": { 381 | "deep-assign": "2.0.0", 382 | "request": "2.88.0" 383 | } 384 | } 385 | } 386 | } 387 | } 388 | } 389 | -------------------------------------------------------------------------------- /cloudfunctions/addperson/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "addperson", 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": "latest" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /cloudfunctions/login/index.js: -------------------------------------------------------------------------------- 1 | // 云函数模板 2 | // 部署:在 cloud-functions/login 文件夹右击选择 “上传并部署” 3 | 4 | /** 5 | * 这个示例将经自动鉴权过的小程序用户 openid 返回给小程序端 6 | * 7 | * event 参数包含 8 | * - 小程序端调用传入的 data 9 | * - 经过微信鉴权直接可信的用户唯一标识 openid 10 | * 11 | */ 12 | exports.main = (event, context) => { 13 | console.log(event) 14 | console.log(context) 15 | 16 | // 可执行其他自定义逻辑 17 | // console.log 的内容可以在云开发云函数调用日志查看 18 | 19 | return { 20 | openid: event.userInfo.openId, 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /cloudfunctions/login/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "lockfileVersion": 1 3 | } 4 | -------------------------------------------------------------------------------- /cloudfunctions/saveformid/index.js: -------------------------------------------------------------------------------- 1 | // 云函数入口文件 2 | const cloud = require('wx-server-sdk') 3 | cloud.init() 4 | 5 | const db = cloud.database() 6 | 7 | // 云函数入口函数 8 | exports.main = async (event, context) => { 9 | try { 10 | if(event.formid != 'the formId is a mock one'){ 11 | return await db.collection('formid').add({ 12 | data: { 13 | openid: event.userInfo.openId, 14 | formid: event.formid, 15 | timestamp: +new Date() 16 | } 17 | }) 18 | } 19 | } catch (e) { 20 | console.error(e) 21 | } 22 | } -------------------------------------------------------------------------------- /cloudfunctions/saveformid/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "saveformid", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "ajv": { 8 | "version": "5.5.2", 9 | "resolved": "http://registry.npm.taobao.org/ajv/download/ajv-5.5.2.tgz", 10 | "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", 11 | "requires": { 12 | "co": "4.6.0", 13 | "fast-deep-equal": "1.1.0", 14 | "fast-json-stable-stringify": "2.0.0", 15 | "json-schema-traverse": "0.3.1" 16 | } 17 | }, 18 | "asn1": { 19 | "version": "0.2.4", 20 | "resolved": "http://registry.npm.taobao.org/asn1/download/asn1-0.2.4.tgz", 21 | "integrity": "sha1-jSR136tVO7M+d7VOWeiAu4ziMTY=", 22 | "requires": { 23 | "safer-buffer": "2.1.2" 24 | } 25 | }, 26 | "assert-plus": { 27 | "version": "1.0.0", 28 | "resolved": "http://registry.npm.taobao.org/assert-plus/download/assert-plus-1.0.0.tgz", 29 | "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" 30 | }, 31 | "asynckit": { 32 | "version": "0.4.0", 33 | "resolved": "http://registry.npm.taobao.org/asynckit/download/asynckit-0.4.0.tgz", 34 | "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" 35 | }, 36 | "aws-sign2": { 37 | "version": "0.7.0", 38 | "resolved": "http://registry.npm.taobao.org/aws-sign2/download/aws-sign2-0.7.0.tgz", 39 | "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" 40 | }, 41 | "aws4": { 42 | "version": "1.8.0", 43 | "resolved": "http://registry.npm.taobao.org/aws4/download/aws4-1.8.0.tgz", 44 | "integrity": "sha1-8OAD2cqef1nHpQiUXXsu+aBKVC8=" 45 | }, 46 | "bcrypt-pbkdf": { 47 | "version": "1.0.2", 48 | "resolved": "http://registry.npm.taobao.org/bcrypt-pbkdf/download/bcrypt-pbkdf-1.0.2.tgz", 49 | "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", 50 | "optional": true, 51 | "requires": { 52 | "tweetnacl": "0.14.5" 53 | } 54 | }, 55 | "caseless": { 56 | "version": "0.12.0", 57 | "resolved": "http://registry.npm.taobao.org/caseless/download/caseless-0.12.0.tgz", 58 | "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" 59 | }, 60 | "co": { 61 | "version": "4.6.0", 62 | "resolved": "http://registry.npm.taobao.org/co/download/co-4.6.0.tgz", 63 | "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" 64 | }, 65 | "combined-stream": { 66 | "version": "1.0.7", 67 | "resolved": "http://registry.npm.taobao.org/combined-stream/download/combined-stream-1.0.7.tgz", 68 | "integrity": "sha1-LR0kMXr7ir6V1tLAsHtXgTU52Cg=", 69 | "requires": { 70 | "delayed-stream": "1.0.0" 71 | } 72 | }, 73 | "core-util-is": { 74 | "version": "1.0.2", 75 | "resolved": "http://registry.npm.taobao.org/core-util-is/download/core-util-is-1.0.2.tgz", 76 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" 77 | }, 78 | "dashdash": { 79 | "version": "1.14.1", 80 | "resolved": "http://registry.npm.taobao.org/dashdash/download/dashdash-1.14.1.tgz", 81 | "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", 82 | "requires": { 83 | "assert-plus": "1.0.0" 84 | } 85 | }, 86 | "deep-assign": { 87 | "version": "2.0.0", 88 | "resolved": "http://registry.npm.taobao.org/deep-assign/download/deep-assign-2.0.0.tgz", 89 | "integrity": "sha1-6+BrHwfwja5ZdiDj3RYi83GhxXI=", 90 | "requires": { 91 | "is-obj": "1.0.1" 92 | } 93 | }, 94 | "delayed-stream": { 95 | "version": "1.0.0", 96 | "resolved": "http://registry.npm.taobao.org/delayed-stream/download/delayed-stream-1.0.0.tgz", 97 | "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" 98 | }, 99 | "ecc-jsbn": { 100 | "version": "0.1.2", 101 | "resolved": "http://registry.npm.taobao.org/ecc-jsbn/download/ecc-jsbn-0.1.2.tgz", 102 | "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", 103 | "optional": true, 104 | "requires": { 105 | "jsbn": "0.1.1", 106 | "safer-buffer": "2.1.2" 107 | } 108 | }, 109 | "extend": { 110 | "version": "3.0.2", 111 | "resolved": "http://registry.npm.taobao.org/extend/download/extend-3.0.2.tgz", 112 | "integrity": "sha1-+LETa0Bx+9jrFAr/hYsQGewpFfo=" 113 | }, 114 | "extsprintf": { 115 | "version": "1.3.0", 116 | "resolved": "http://registry.npm.taobao.org/extsprintf/download/extsprintf-1.3.0.tgz", 117 | "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" 118 | }, 119 | "fast-deep-equal": { 120 | "version": "1.1.0", 121 | "resolved": "http://registry.npm.taobao.org/fast-deep-equal/download/fast-deep-equal-1.1.0.tgz", 122 | "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" 123 | }, 124 | "fast-json-stable-stringify": { 125 | "version": "2.0.0", 126 | "resolved": "http://registry.npm.taobao.org/fast-json-stable-stringify/download/fast-json-stable-stringify-2.0.0.tgz", 127 | "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" 128 | }, 129 | "forever-agent": { 130 | "version": "0.6.1", 131 | "resolved": "http://registry.npm.taobao.org/forever-agent/download/forever-agent-0.6.1.tgz", 132 | "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" 133 | }, 134 | "form-data": { 135 | "version": "2.3.2", 136 | "resolved": "http://registry.npm.taobao.org/form-data/download/form-data-2.3.2.tgz", 137 | "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", 138 | "requires": { 139 | "asynckit": "0.4.0", 140 | "combined-stream": "1.0.6", 141 | "mime-types": "2.1.20" 142 | }, 143 | "dependencies": { 144 | "combined-stream": { 145 | "version": "1.0.6", 146 | "resolved": "http://registry.npm.taobao.org/combined-stream/download/combined-stream-1.0.6.tgz", 147 | "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", 148 | "requires": { 149 | "delayed-stream": "1.0.0" 150 | } 151 | } 152 | } 153 | }, 154 | "getpass": { 155 | "version": "0.1.7", 156 | "resolved": "http://registry.npm.taobao.org/getpass/download/getpass-0.1.7.tgz", 157 | "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", 158 | "requires": { 159 | "assert-plus": "1.0.0" 160 | } 161 | }, 162 | "har-schema": { 163 | "version": "2.0.0", 164 | "resolved": "http://registry.npm.taobao.org/har-schema/download/har-schema-2.0.0.tgz", 165 | "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" 166 | }, 167 | "har-validator": { 168 | "version": "5.1.0", 169 | "resolved": "http://registry.npm.taobao.org/har-validator/download/har-validator-5.1.0.tgz", 170 | "integrity": "sha1-RGV/VoiiLP1LckhugbOj+xF0LCk=", 171 | "requires": { 172 | "ajv": "5.5.2", 173 | "har-schema": "2.0.0" 174 | } 175 | }, 176 | "http-signature": { 177 | "version": "1.2.0", 178 | "resolved": "http://registry.npm.taobao.org/http-signature/download/http-signature-1.2.0.tgz", 179 | "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", 180 | "requires": { 181 | "assert-plus": "1.0.0", 182 | "jsprim": "1.4.1", 183 | "sshpk": "1.14.2" 184 | } 185 | }, 186 | "is-obj": { 187 | "version": "1.0.1", 188 | "resolved": "http://registry.npm.taobao.org/is-obj/download/is-obj-1.0.1.tgz", 189 | "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=" 190 | }, 191 | "is-typedarray": { 192 | "version": "1.0.0", 193 | "resolved": "http://registry.npm.taobao.org/is-typedarray/download/is-typedarray-1.0.0.tgz", 194 | "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" 195 | }, 196 | "isstream": { 197 | "version": "0.1.2", 198 | "resolved": "http://registry.npm.taobao.org/isstream/download/isstream-0.1.2.tgz", 199 | "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" 200 | }, 201 | "jsbn": { 202 | "version": "0.1.1", 203 | "resolved": "http://registry.npm.taobao.org/jsbn/download/jsbn-0.1.1.tgz", 204 | "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", 205 | "optional": true 206 | }, 207 | "json-schema": { 208 | "version": "0.2.3", 209 | "resolved": "http://registry.npm.taobao.org/json-schema/download/json-schema-0.2.3.tgz", 210 | "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" 211 | }, 212 | "json-schema-traverse": { 213 | "version": "0.3.1", 214 | "resolved": "http://registry.npm.taobao.org/json-schema-traverse/download/json-schema-traverse-0.3.1.tgz", 215 | "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" 216 | }, 217 | "json-stringify-safe": { 218 | "version": "5.0.1", 219 | "resolved": "http://registry.npm.taobao.org/json-stringify-safe/download/json-stringify-safe-5.0.1.tgz", 220 | "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" 221 | }, 222 | "jsprim": { 223 | "version": "1.4.1", 224 | "resolved": "http://registry.npm.taobao.org/jsprim/download/jsprim-1.4.1.tgz", 225 | "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", 226 | "requires": { 227 | "assert-plus": "1.0.0", 228 | "extsprintf": "1.3.0", 229 | "json-schema": "0.2.3", 230 | "verror": "1.10.0" 231 | } 232 | }, 233 | "mime-db": { 234 | "version": "1.36.0", 235 | "resolved": "http://registry.npm.taobao.org/mime-db/download/mime-db-1.36.0.tgz", 236 | "integrity": "sha1-UCBHjbPH/pOq17vMTc+GnEM2M5c=" 237 | }, 238 | "mime-types": { 239 | "version": "2.1.20", 240 | "resolved": "http://registry.npm.taobao.org/mime-types/download/mime-types-2.1.20.tgz", 241 | "integrity": "sha1-kwy3GdVx6QNzhSD4RwkRVIyizBk=", 242 | "requires": { 243 | "mime-db": "1.36.0" 244 | } 245 | }, 246 | "oauth-sign": { 247 | "version": "0.9.0", 248 | "resolved": "http://registry.npm.taobao.org/oauth-sign/download/oauth-sign-0.9.0.tgz", 249 | "integrity": "sha1-R6ewFrqmi1+g7PPe4IqFxnmsZFU=" 250 | }, 251 | "performance-now": { 252 | "version": "2.1.0", 253 | "resolved": "http://registry.npm.taobao.org/performance-now/download/performance-now-2.1.0.tgz", 254 | "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" 255 | }, 256 | "psl": { 257 | "version": "1.1.29", 258 | "resolved": "http://registry.npm.taobao.org/psl/download/psl-1.1.29.tgz", 259 | "integrity": "sha1-YPWA02AXC7cip5fMcEQR5tqFDGc=" 260 | }, 261 | "punycode": { 262 | "version": "1.4.1", 263 | "resolved": "http://registry.npm.taobao.org/punycode/download/punycode-1.4.1.tgz", 264 | "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" 265 | }, 266 | "qs": { 267 | "version": "6.5.2", 268 | "resolved": "http://registry.npm.taobao.org/qs/download/qs-6.5.2.tgz", 269 | "integrity": "sha1-yzroBuh0BERYTvFUzo7pjUA/PjY=" 270 | }, 271 | "request": { 272 | "version": "2.88.0", 273 | "resolved": "http://registry.npm.taobao.org/request/download/request-2.88.0.tgz", 274 | "integrity": "sha1-nC/KT301tZLv5Xx/ClXoEFIST+8=", 275 | "requires": { 276 | "aws-sign2": "0.7.0", 277 | "aws4": "1.8.0", 278 | "caseless": "0.12.0", 279 | "combined-stream": "1.0.7", 280 | "extend": "3.0.2", 281 | "forever-agent": "0.6.1", 282 | "form-data": "2.3.2", 283 | "har-validator": "5.1.0", 284 | "http-signature": "1.2.0", 285 | "is-typedarray": "1.0.0", 286 | "isstream": "0.1.2", 287 | "json-stringify-safe": "5.0.1", 288 | "mime-types": "2.1.20", 289 | "oauth-sign": "0.9.0", 290 | "performance-now": "2.1.0", 291 | "qs": "6.5.2", 292 | "safe-buffer": "5.1.2", 293 | "tough-cookie": "2.4.3", 294 | "tunnel-agent": "0.6.0", 295 | "uuid": "3.3.2" 296 | } 297 | }, 298 | "safe-buffer": { 299 | "version": "5.1.2", 300 | "resolved": "http://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.1.2.tgz", 301 | "integrity": "sha1-mR7GnSluAxN0fVm9/St0XDX4go0=" 302 | }, 303 | "safer-buffer": { 304 | "version": "2.1.2", 305 | "resolved": "http://registry.npm.taobao.org/safer-buffer/download/safer-buffer-2.1.2.tgz", 306 | "integrity": "sha1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo=" 307 | }, 308 | "sshpk": { 309 | "version": "1.14.2", 310 | "resolved": "http://registry.npm.taobao.org/sshpk/download/sshpk-1.14.2.tgz", 311 | "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", 312 | "requires": { 313 | "asn1": "0.2.4", 314 | "assert-plus": "1.0.0", 315 | "bcrypt-pbkdf": "1.0.2", 316 | "dashdash": "1.14.1", 317 | "ecc-jsbn": "0.1.2", 318 | "getpass": "0.1.7", 319 | "jsbn": "0.1.1", 320 | "safer-buffer": "2.1.2", 321 | "tweetnacl": "0.14.5" 322 | } 323 | }, 324 | "tcb-admin-node": { 325 | "version": "1.1.4", 326 | "resolved": "http://registry.npm.taobao.org/tcb-admin-node/download/tcb-admin-node-1.1.4.tgz", 327 | "integrity": "sha1-Ta/2w4k6wBL3QPOAyNE8D0qTQ/c=", 328 | "requires": { 329 | "deep-assign": "2.0.0", 330 | "request": "2.88.0" 331 | } 332 | }, 333 | "tough-cookie": { 334 | "version": "2.4.3", 335 | "resolved": "http://registry.npm.taobao.org/tough-cookie/download/tough-cookie-2.4.3.tgz", 336 | "integrity": "sha1-U/Nto/R3g7CSWvoG/587FlKA94E=", 337 | "requires": { 338 | "psl": "1.1.29", 339 | "punycode": "1.4.1" 340 | } 341 | }, 342 | "tslib": { 343 | "version": "1.9.3", 344 | "resolved": "http://registry.npm.taobao.org/tslib/download/tslib-1.9.3.tgz", 345 | "integrity": "sha1-1+TdeSRdhUKMTX5IIqeZF5VMooY=" 346 | }, 347 | "tunnel-agent": { 348 | "version": "0.6.0", 349 | "resolved": "http://registry.npm.taobao.org/tunnel-agent/download/tunnel-agent-0.6.0.tgz", 350 | "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", 351 | "requires": { 352 | "safe-buffer": "5.1.2" 353 | } 354 | }, 355 | "tweetnacl": { 356 | "version": "0.14.5", 357 | "resolved": "http://registry.npm.taobao.org/tweetnacl/download/tweetnacl-0.14.5.tgz", 358 | "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", 359 | "optional": true 360 | }, 361 | "uuid": { 362 | "version": "3.3.2", 363 | "resolved": "http://registry.npm.taobao.org/uuid/download/uuid-3.3.2.tgz", 364 | "integrity": "sha1-G0r0lV6zB3xQHCOHL8ZROBFYcTE=" 365 | }, 366 | "verror": { 367 | "version": "1.10.0", 368 | "resolved": "http://registry.npm.taobao.org/verror/download/verror-1.10.0.tgz", 369 | "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", 370 | "requires": { 371 | "assert-plus": "1.0.0", 372 | "core-util-is": "1.0.2", 373 | "extsprintf": "1.3.0" 374 | } 375 | }, 376 | "wx-server-sdk": { 377 | "version": "0.0.19", 378 | "resolved": "http://registry.npm.taobao.org/wx-server-sdk/download/wx-server-sdk-0.0.19.tgz", 379 | "integrity": "sha1-tekWN/2cJGZLmZOvJKuB+zNnwoI=", 380 | "requires": { 381 | "tcb-admin-node": "1.1.4", 382 | "tslib": "1.9.3" 383 | } 384 | } 385 | } 386 | } 387 | -------------------------------------------------------------------------------- /cloudfunctions/saveformid/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "saveformid", 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": "latest" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /cloudfunctions/savething/index.js: -------------------------------------------------------------------------------- 1 | // 云函数入口文件 2 | const cloud = require('wx-server-sdk') 3 | cloud.init() 4 | 5 | const db = cloud.database() 6 | 7 | // 云函数入口函数 8 | exports.main = async (event, context) => { 9 | try { 10 | return await db.collection('personsweethings').add({ 11 | data: { 12 | openid: event.userInfo.openId, 13 | id: event.id, 14 | donetime: event.donetime, 15 | doneaddr: event.doneaddr, 16 | happy: event.happy, 17 | txt: event.txt, 18 | wallshow: event.wallshow, 19 | picaddr: event.picaddr, 20 | timestamp: +new Date() 21 | } 22 | }) 23 | } catch (e) { 24 | console.error(e) 25 | } 26 | } -------------------------------------------------------------------------------- /cloudfunctions/savething/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "savething", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "ajv": { 8 | "version": "5.5.2", 9 | "resolved": "http://registry.npm.taobao.org/ajv/download/ajv-5.5.2.tgz", 10 | "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", 11 | "requires": { 12 | "co": "4.6.0", 13 | "fast-deep-equal": "1.1.0", 14 | "fast-json-stable-stringify": "2.0.0", 15 | "json-schema-traverse": "0.3.1" 16 | } 17 | }, 18 | "asn1": { 19 | "version": "0.2.4", 20 | "resolved": "http://registry.npm.taobao.org/asn1/download/asn1-0.2.4.tgz", 21 | "integrity": "sha1-jSR136tVO7M+d7VOWeiAu4ziMTY=", 22 | "requires": { 23 | "safer-buffer": "2.1.2" 24 | } 25 | }, 26 | "assert-plus": { 27 | "version": "1.0.0", 28 | "resolved": "http://registry.npm.taobao.org/assert-plus/download/assert-plus-1.0.0.tgz", 29 | "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" 30 | }, 31 | "asynckit": { 32 | "version": "0.4.0", 33 | "resolved": "http://registry.npm.taobao.org/asynckit/download/asynckit-0.4.0.tgz", 34 | "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" 35 | }, 36 | "aws-sign2": { 37 | "version": "0.7.0", 38 | "resolved": "http://registry.npm.taobao.org/aws-sign2/download/aws-sign2-0.7.0.tgz", 39 | "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" 40 | }, 41 | "aws4": { 42 | "version": "1.8.0", 43 | "resolved": "http://registry.npm.taobao.org/aws4/download/aws4-1.8.0.tgz", 44 | "integrity": "sha1-8OAD2cqef1nHpQiUXXsu+aBKVC8=" 45 | }, 46 | "bcrypt-pbkdf": { 47 | "version": "1.0.2", 48 | "resolved": "http://registry.npm.taobao.org/bcrypt-pbkdf/download/bcrypt-pbkdf-1.0.2.tgz", 49 | "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", 50 | "optional": true, 51 | "requires": { 52 | "tweetnacl": "0.14.5" 53 | } 54 | }, 55 | "caseless": { 56 | "version": "0.12.0", 57 | "resolved": "http://registry.npm.taobao.org/caseless/download/caseless-0.12.0.tgz", 58 | "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" 59 | }, 60 | "co": { 61 | "version": "4.6.0", 62 | "resolved": "http://registry.npm.taobao.org/co/download/co-4.6.0.tgz", 63 | "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" 64 | }, 65 | "combined-stream": { 66 | "version": "1.0.6", 67 | "resolved": "http://registry.npm.taobao.org/combined-stream/download/combined-stream-1.0.6.tgz", 68 | "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", 69 | "requires": { 70 | "delayed-stream": "1.0.0" 71 | } 72 | }, 73 | "core-util-is": { 74 | "version": "1.0.2", 75 | "resolved": "http://registry.npm.taobao.org/core-util-is/download/core-util-is-1.0.2.tgz", 76 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" 77 | }, 78 | "dashdash": { 79 | "version": "1.14.1", 80 | "resolved": "http://registry.npm.taobao.org/dashdash/download/dashdash-1.14.1.tgz", 81 | "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", 82 | "requires": { 83 | "assert-plus": "1.0.0" 84 | } 85 | }, 86 | "deep-assign": { 87 | "version": "2.0.0", 88 | "resolved": "http://registry.npm.taobao.org/deep-assign/download/deep-assign-2.0.0.tgz", 89 | "integrity": "sha1-6+BrHwfwja5ZdiDj3RYi83GhxXI=", 90 | "requires": { 91 | "is-obj": "1.0.1" 92 | } 93 | }, 94 | "delayed-stream": { 95 | "version": "1.0.0", 96 | "resolved": "http://registry.npm.taobao.org/delayed-stream/download/delayed-stream-1.0.0.tgz", 97 | "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" 98 | }, 99 | "ecc-jsbn": { 100 | "version": "0.1.2", 101 | "resolved": "http://registry.npm.taobao.org/ecc-jsbn/download/ecc-jsbn-0.1.2.tgz", 102 | "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", 103 | "optional": true, 104 | "requires": { 105 | "jsbn": "0.1.1", 106 | "safer-buffer": "2.1.2" 107 | } 108 | }, 109 | "extend": { 110 | "version": "3.0.2", 111 | "resolved": "http://registry.npm.taobao.org/extend/download/extend-3.0.2.tgz", 112 | "integrity": "sha1-+LETa0Bx+9jrFAr/hYsQGewpFfo=" 113 | }, 114 | "extsprintf": { 115 | "version": "1.3.0", 116 | "resolved": "http://registry.npm.taobao.org/extsprintf/download/extsprintf-1.3.0.tgz", 117 | "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" 118 | }, 119 | "fast-deep-equal": { 120 | "version": "1.1.0", 121 | "resolved": "http://registry.npm.taobao.org/fast-deep-equal/download/fast-deep-equal-1.1.0.tgz", 122 | "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" 123 | }, 124 | "fast-json-stable-stringify": { 125 | "version": "2.0.0", 126 | "resolved": "http://registry.npm.taobao.org/fast-json-stable-stringify/download/fast-json-stable-stringify-2.0.0.tgz", 127 | "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" 128 | }, 129 | "forever-agent": { 130 | "version": "0.6.1", 131 | "resolved": "http://registry.npm.taobao.org/forever-agent/download/forever-agent-0.6.1.tgz", 132 | "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" 133 | }, 134 | "form-data": { 135 | "version": "2.3.2", 136 | "resolved": "http://registry.npm.taobao.org/form-data/download/form-data-2.3.2.tgz", 137 | "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", 138 | "requires": { 139 | "asynckit": "0.4.0", 140 | "combined-stream": "1.0.6", 141 | "mime-types": "2.1.20" 142 | } 143 | }, 144 | "getpass": { 145 | "version": "0.1.7", 146 | "resolved": "http://registry.npm.taobao.org/getpass/download/getpass-0.1.7.tgz", 147 | "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", 148 | "requires": { 149 | "assert-plus": "1.0.0" 150 | } 151 | }, 152 | "har-schema": { 153 | "version": "2.0.0", 154 | "resolved": "http://registry.npm.taobao.org/har-schema/download/har-schema-2.0.0.tgz", 155 | "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" 156 | }, 157 | "har-validator": { 158 | "version": "5.1.0", 159 | "resolved": "http://registry.npm.taobao.org/har-validator/download/har-validator-5.1.0.tgz", 160 | "integrity": "sha1-RGV/VoiiLP1LckhugbOj+xF0LCk=", 161 | "requires": { 162 | "ajv": "5.5.2", 163 | "har-schema": "2.0.0" 164 | } 165 | }, 166 | "http-signature": { 167 | "version": "1.2.0", 168 | "resolved": "http://registry.npm.taobao.org/http-signature/download/http-signature-1.2.0.tgz", 169 | "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", 170 | "requires": { 171 | "assert-plus": "1.0.0", 172 | "jsprim": "1.4.1", 173 | "sshpk": "1.14.2" 174 | } 175 | }, 176 | "is-obj": { 177 | "version": "1.0.1", 178 | "resolved": "http://registry.npm.taobao.org/is-obj/download/is-obj-1.0.1.tgz", 179 | "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=" 180 | }, 181 | "is-typedarray": { 182 | "version": "1.0.0", 183 | "resolved": "http://registry.npm.taobao.org/is-typedarray/download/is-typedarray-1.0.0.tgz", 184 | "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" 185 | }, 186 | "isstream": { 187 | "version": "0.1.2", 188 | "resolved": "http://registry.npm.taobao.org/isstream/download/isstream-0.1.2.tgz", 189 | "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" 190 | }, 191 | "jsbn": { 192 | "version": "0.1.1", 193 | "resolved": "http://registry.npm.taobao.org/jsbn/download/jsbn-0.1.1.tgz", 194 | "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", 195 | "optional": true 196 | }, 197 | "json-schema": { 198 | "version": "0.2.3", 199 | "resolved": "http://registry.npm.taobao.org/json-schema/download/json-schema-0.2.3.tgz", 200 | "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" 201 | }, 202 | "json-schema-traverse": { 203 | "version": "0.3.1", 204 | "resolved": "http://registry.npm.taobao.org/json-schema-traverse/download/json-schema-traverse-0.3.1.tgz", 205 | "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" 206 | }, 207 | "json-stringify-safe": { 208 | "version": "5.0.1", 209 | "resolved": "http://registry.npm.taobao.org/json-stringify-safe/download/json-stringify-safe-5.0.1.tgz", 210 | "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" 211 | }, 212 | "jsprim": { 213 | "version": "1.4.1", 214 | "resolved": "http://registry.npm.taobao.org/jsprim/download/jsprim-1.4.1.tgz", 215 | "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", 216 | "requires": { 217 | "assert-plus": "1.0.0", 218 | "extsprintf": "1.3.0", 219 | "json-schema": "0.2.3", 220 | "verror": "1.10.0" 221 | } 222 | }, 223 | "mime-db": { 224 | "version": "1.36.0", 225 | "resolved": "http://registry.npm.taobao.org/mime-db/download/mime-db-1.36.0.tgz", 226 | "integrity": "sha1-UCBHjbPH/pOq17vMTc+GnEM2M5c=" 227 | }, 228 | "mime-types": { 229 | "version": "2.1.20", 230 | "resolved": "http://registry.npm.taobao.org/mime-types/download/mime-types-2.1.20.tgz", 231 | "integrity": "sha1-kwy3GdVx6QNzhSD4RwkRVIyizBk=", 232 | "requires": { 233 | "mime-db": "1.36.0" 234 | } 235 | }, 236 | "oauth-sign": { 237 | "version": "0.9.0", 238 | "resolved": "http://registry.npm.taobao.org/oauth-sign/download/oauth-sign-0.9.0.tgz", 239 | "integrity": "sha1-R6ewFrqmi1+g7PPe4IqFxnmsZFU=" 240 | }, 241 | "performance-now": { 242 | "version": "2.1.0", 243 | "resolved": "http://registry.npm.taobao.org/performance-now/download/performance-now-2.1.0.tgz", 244 | "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" 245 | }, 246 | "psl": { 247 | "version": "1.1.29", 248 | "resolved": "http://registry.npm.taobao.org/psl/download/psl-1.1.29.tgz", 249 | "integrity": "sha1-YPWA02AXC7cip5fMcEQR5tqFDGc=" 250 | }, 251 | "punycode": { 252 | "version": "1.4.1", 253 | "resolved": "http://registry.npm.taobao.org/punycode/download/punycode-1.4.1.tgz", 254 | "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" 255 | }, 256 | "qs": { 257 | "version": "6.5.2", 258 | "resolved": "http://registry.npm.taobao.org/qs/download/qs-6.5.2.tgz", 259 | "integrity": "sha1-yzroBuh0BERYTvFUzo7pjUA/PjY=" 260 | }, 261 | "request": { 262 | "version": "2.88.0", 263 | "resolved": "http://registry.npm.taobao.org/request/download/request-2.88.0.tgz", 264 | "integrity": "sha1-nC/KT301tZLv5Xx/ClXoEFIST+8=", 265 | "requires": { 266 | "aws-sign2": "0.7.0", 267 | "aws4": "1.8.0", 268 | "caseless": "0.12.0", 269 | "combined-stream": "1.0.6", 270 | "extend": "3.0.2", 271 | "forever-agent": "0.6.1", 272 | "form-data": "2.3.2", 273 | "har-validator": "5.1.0", 274 | "http-signature": "1.2.0", 275 | "is-typedarray": "1.0.0", 276 | "isstream": "0.1.2", 277 | "json-stringify-safe": "5.0.1", 278 | "mime-types": "2.1.20", 279 | "oauth-sign": "0.9.0", 280 | "performance-now": "2.1.0", 281 | "qs": "6.5.2", 282 | "safe-buffer": "5.1.2", 283 | "tough-cookie": "2.4.3", 284 | "tunnel-agent": "0.6.0", 285 | "uuid": "3.3.2" 286 | } 287 | }, 288 | "safe-buffer": { 289 | "version": "5.1.2", 290 | "resolved": "http://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.1.2.tgz", 291 | "integrity": "sha1-mR7GnSluAxN0fVm9/St0XDX4go0=" 292 | }, 293 | "safer-buffer": { 294 | "version": "2.1.2", 295 | "resolved": "http://registry.npm.taobao.org/safer-buffer/download/safer-buffer-2.1.2.tgz", 296 | "integrity": "sha1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo=" 297 | }, 298 | "sshpk": { 299 | "version": "1.14.2", 300 | "resolved": "http://registry.npm.taobao.org/sshpk/download/sshpk-1.14.2.tgz", 301 | "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", 302 | "requires": { 303 | "asn1": "0.2.4", 304 | "assert-plus": "1.0.0", 305 | "bcrypt-pbkdf": "1.0.2", 306 | "dashdash": "1.14.1", 307 | "ecc-jsbn": "0.1.2", 308 | "getpass": "0.1.7", 309 | "jsbn": "0.1.1", 310 | "safer-buffer": "2.1.2", 311 | "tweetnacl": "0.14.5" 312 | } 313 | }, 314 | "tcb-admin-node": { 315 | "version": "1.1.2", 316 | "resolved": "http://registry.npm.taobao.org/tcb-admin-node/download/tcb-admin-node-1.1.2.tgz", 317 | "integrity": "sha1-1UHzg2mS1WvgB39lxHePXv9yBT4=", 318 | "requires": { 319 | "deep-assign": "2.0.0", 320 | "request": "2.88.0" 321 | } 322 | }, 323 | "tough-cookie": { 324 | "version": "2.4.3", 325 | "resolved": "http://registry.npm.taobao.org/tough-cookie/download/tough-cookie-2.4.3.tgz", 326 | "integrity": "sha1-U/Nto/R3g7CSWvoG/587FlKA94E=", 327 | "requires": { 328 | "psl": "1.1.29", 329 | "punycode": "1.4.1" 330 | } 331 | }, 332 | "tslib": { 333 | "version": "1.9.3", 334 | "resolved": "http://registry.npm.taobao.org/tslib/download/tslib-1.9.3.tgz", 335 | "integrity": "sha1-1+TdeSRdhUKMTX5IIqeZF5VMooY=" 336 | }, 337 | "tunnel-agent": { 338 | "version": "0.6.0", 339 | "resolved": "http://registry.npm.taobao.org/tunnel-agent/download/tunnel-agent-0.6.0.tgz", 340 | "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", 341 | "requires": { 342 | "safe-buffer": "5.1.2" 343 | } 344 | }, 345 | "tweetnacl": { 346 | "version": "0.14.5", 347 | "resolved": "http://registry.npm.taobao.org/tweetnacl/download/tweetnacl-0.14.5.tgz", 348 | "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", 349 | "optional": true 350 | }, 351 | "uuid": { 352 | "version": "3.3.2", 353 | "resolved": "http://registry.npm.taobao.org/uuid/download/uuid-3.3.2.tgz", 354 | "integrity": "sha1-G0r0lV6zB3xQHCOHL8ZROBFYcTE=" 355 | }, 356 | "verror": { 357 | "version": "1.10.0", 358 | "resolved": "http://registry.npm.taobao.org/verror/download/verror-1.10.0.tgz", 359 | "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", 360 | "requires": { 361 | "assert-plus": "1.0.0", 362 | "core-util-is": "1.0.2", 363 | "extsprintf": "1.3.0" 364 | } 365 | }, 366 | "wx-server-sdk": { 367 | "version": "0.0.18", 368 | "resolved": "http://registry.npm.taobao.org/wx-server-sdk/download/wx-server-sdk-0.0.18.tgz", 369 | "integrity": "sha1-RT2zgUEwmGmbN0PcahVLgpCFQnM=", 370 | "requires": { 371 | "tcb-admin-node": "1.1.2", 372 | "tslib": "1.9.3" 373 | } 374 | } 375 | } 376 | } 377 | -------------------------------------------------------------------------------- /cloudfunctions/savething/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "savething", 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": "latest" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /miniprogram/apis/index.js: -------------------------------------------------------------------------------- 1 | // 引入SDK核心类 2 | var QQMapWX = require('./qqmap-wx-jssdk.min.js'); 3 | 4 | // 实例化API核心类 5 | var qqMap = new QQMapWX({ 6 | key: 'GDKEY' // 必填 7 | }); 8 | export default { 9 | func(name, data){ 10 | try{ 11 | return wx.cloud.callFunction({name, data}) 12 | }catch(err){ 13 | console.log(err) 14 | } 15 | }, 16 | getlocation(){ 17 | // 调用接口 18 | return new Promise((resolve, reject)=>{ 19 | try { 20 | wx.getLocation({ 21 | success: function(res) { 22 | console.log(res) 23 | let location = { 24 | latitude: res.latitude, 25 | longitude: res.longitude 26 | } 27 | qqMap.reverseGeocoder({ 28 | location, 29 | success: function(res) { 30 | resolve(res) 31 | }, 32 | fail: function(err) { 33 | reject(err) 34 | }, 35 | complete: function(res) { 36 | console.log(res) 37 | } 38 | }) 39 | } 40 | }) 41 | } catch(err){ 42 | console.log(err) 43 | } 44 | }) 45 | 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /miniprogram/apis/qqmap-wx-jssdk.min.js: -------------------------------------------------------------------------------- 1 | var _createClass=function(){function a(e,c){for(var b=0;b{ 18 | wx.openid = ret.result.openid 19 | }).catch(err=>{ 20 | console.log(err) 21 | }) 22 | } 23 | }catch(err){ 24 | console.log(err) 25 | } 26 | } 27 | }) 28 | -------------------------------------------------------------------------------- /miniprogram/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "pages": [ 3 | "pages/index/index", 4 | "pages/chooseLib/chooseLib", 5 | "pages/doing/index", 6 | "pages/wall/index", 7 | "pages/memory/index", 8 | "pages/share/index", 9 | "pages/self/index" 10 | ], 11 | "window": { 12 | "backgroundColor": "#fff", 13 | "backgroundTextStyle": "light", 14 | "navigationBarBackgroundColor": "#fff", 15 | "navigationBarTitleText": "和你的100个愿望清单", 16 | "navigationBarTextStyle": "black", 17 | "onReachBottomDistance": 50, 18 | "requiredBackgroundModes": ["audio"], 19 | "cloud": true 20 | } 21 | } -------------------------------------------------------------------------------- /miniprogram/app.wxss: -------------------------------------------------------------------------------- 1 | /**app.wxss**/ 2 | /* .container { 3 | display: flex; 4 | flex-direction: column; 5 | align-items: center; 6 | box-sizing: border-box; 7 | } */ 8 | button:after { 9 | border: none; 10 | } 11 | -------------------------------------------------------------------------------- /miniprogram/components/aboutus/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | // externalClasses: ['top-tip'], 3 | // properties: { 4 | // tipsShow: { 5 | // type: Boolean 6 | // } 7 | // }, 8 | data: { 9 | }, 10 | attached: function () { }, 11 | methods: { 12 | } 13 | }) -------------------------------------------------------------------------------- /miniprogram/components/aboutus/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /miniprogram/components/aboutus/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 关于我们 4 | 做自己喜欢的,美女与野猪工作室 5 | 小程序内容和图片源自网络,如有侵权请联系后台 6 | 针对小程序内容的最终解释权归美女与野猪工作室所有 7 | 8 | -------------------------------------------------------------------------------- /miniprogram/components/aboutus/index.wxss: -------------------------------------------------------------------------------- 1 | /**index.wxss**/ 2 | .aboutus{ 3 | width: 750rpx; 4 | box-sizing: border-box; 5 | padding: 96rpx 0; 6 | display: flex; 7 | justify-content: center; 8 | flex-direction: column; 9 | align-items: center; 10 | } 11 | .aboutus .title{ 12 | font-size: 28rpx; 13 | color: #333; 14 | padding-bottom: 12rpx; 15 | } 16 | .aboutus .cont{ 17 | font-size: 30rpx; 18 | color: #2b2b2b; 19 | } 20 | .aboutus .rule{ 21 | font-size: 20rpx; 22 | color: #666; 23 | } -------------------------------------------------------------------------------- /miniprogram/components/music/index.js: -------------------------------------------------------------------------------- 1 | const app = getApp() 2 | const bgmList = [ 3 | `cloud://demo-f09591.6465-demo-f09591/AnnaKendrick-Cups.mp3`, 4 | `cloud://demo-f09591.6465-demo-f09591/MadilynBailey-GalwayGirl.mp3`, 5 | `cloud://demo-f09591.6465-demo-f09591/TheOffspring-HitThat.mp3`, 6 | `cloud://demo-f09591.6465-demo-f09591/Tropkillaz-MAMBO.mp3`, 7 | `cloud://demo-f09591.6465-demo-f09591/ZOOLY-40'z.mp3` 8 | ] 9 | let playIndex = Math.round(Math.random()*(bgmList.length-1)) 10 | Component({ 11 | externalClasses: [], 12 | properties: {}, 13 | data: { 14 | bgmPlay: true, 15 | bgmTitle: '', 16 | showMusicStatic: false, 17 | playMusic:{ 18 | src: bgmList[playIndex], 19 | title: wx.getTitleBySrc(bgmList[playIndex]) 20 | } 21 | }, 22 | attached: function () { 23 | this.bgm = wx.getBackgroundAudioManager() 24 | this.bgm.src=this.data.playMusic.src 25 | this.bgm.title=this.data.playMusic.title 26 | this.bgm.startTime=0 27 | this.cut() 28 | this.bgm.onEnded(function(e){ 29 | that.cut() 30 | }) 31 | this.bgm.onError(function(e){ 32 | console.log(e) 33 | }) 34 | }, 35 | methods: { 36 | showMusic(){ 37 | this.setData({ 38 | showMusicStatic: true 39 | }) 40 | }, 41 | hideMusic(){ 42 | this.setData({ 43 | showMusicStatic: false 44 | }) 45 | }, 46 | play(){ 47 | let bgmPlay = !this.data.bgmPlay 48 | bgmPlay?this.bgm.play():this.bgm.pause() 49 | this.setData({ 50 | bgmPlay: !this.data.bgmPlay 51 | }) 52 | }, 53 | cut(){ 54 | playIndex = ++playIndex%4 55 | this.setData({ 56 | playMusic:{ 57 | src: bgmList[playIndex], 58 | title: wx.getTitleBySrc(bgmList[playIndex]) 59 | }, 60 | bgmPlay: true 61 | }) 62 | this.bgm.src=this.data.playMusic.src 63 | this.bgm.title=this.data.playMusic.title 64 | } 65 | } 66 | }) -------------------------------------------------------------------------------- /miniprogram/components/music/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /miniprogram/components/music/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | {{playMusic.title}} 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /miniprogram/components/music/index.wxss: -------------------------------------------------------------------------------- 1 | /**index.wxss**/ 2 | .music{ 3 | background: #fff; 4 | position: fixed; 5 | z-index: 999; 6 | top: 100rpx; 7 | right: 0; 8 | box-shadow:0 4rpx 8rpx 0 rgba(43,45,46,.16); 9 | border-radius:40rpx 0 0 40rpx; 10 | min-width: 80rpx; 11 | height: 80rpx; 12 | padding: 10rpx; 13 | box-sizing: border-box; 14 | display: flex; 15 | justify-content: space-around; 16 | align-items: center; 17 | transition: all 1s; 18 | } 19 | .music image{ 20 | width: 60rpx; 21 | height: 60rpx; 22 | } 23 | .music.show{ 24 | width: 400rpx; 25 | } 26 | .music .show{ 27 | display: flex; 28 | justify-content: space-around; 29 | align-items: center; 30 | } 31 | .music .show .title{ 32 | overflow: hidden; 33 | width: 200rpx; 34 | } 35 | .music .show .title .inner{ 36 | padding: 0 20rpx; 37 | font-size: 24rpx; 38 | text-align: center; 39 | margin: 0 -50%; 40 | white-space: nowrap; 41 | color: #2b2b2b; 42 | animation: translate 12s linear infinite alternate; 43 | } 44 | .now-play{ 45 | animation: rotate 5s linear infinite; 46 | } 47 | .now-stop{ 48 | animation: none; 49 | } -------------------------------------------------------------------------------- /miniprogram/components/nothing/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | data: { 3 | logoImg: wx.logoImg 4 | }, 5 | attached: function () { }, 6 | methods: { 7 | 8 | } 9 | }) -------------------------------------------------------------------------------- /miniprogram/components/nothing/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /miniprogram/components/nothing/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 和你的100个愿望清单 6 | 深圳 7 | 2018.9.20 8 | ---------------------------- 9 | 爱情里最浪漫的一件事儿,无非是你在闹,他在笑,如此温暖过一生。每一对恋人都有很多相处的琐事,哪怕再小的事,因为有你,温暖而甜蜜…… 10 | 11 | 12 | -------------------------------------------------------------------------------- /miniprogram/components/nothing/index.wxss: -------------------------------------------------------------------------------- 1 | /**index.wxss**/ 2 | .nothing{ 3 | /* padding: 12rpx; */ 4 | width: 100%; 5 | box-sizing: border-box; 6 | position: relative; 7 | min-height: 480rpx; 8 | border-bottom: 12rpx solid #eee; 9 | overflow: hidden; 10 | } 11 | .nothing .bg{ 12 | opacity: .3; 13 | width: 100%; 14 | height: 100%; 15 | position: absolute; 16 | top: 0; 17 | left: 0; 18 | } 19 | /* .nothing .new::before{ 20 | content: ''; 21 | position: absolute; 22 | top: 0; 23 | left: 0; 24 | width: 0; 25 | height: 0; 26 | border-width: 60rpx 60rpx 0 0; 27 | border-style: solid; 28 | border-color:#36d964 transparent transparent #36d964; 29 | } */ 30 | .nothing .new { 31 | font-size: 20rpx; 32 | line-height: 40rpx; 33 | position: absolute; 34 | z-index: 3; 35 | top: 18rpx; 36 | width: 116rpx; 37 | height: 56rpx; 38 | left: -10rpx; 39 | color: #fff; 40 | text-align: center; 41 | opacity: .8; 42 | } 43 | .nothing .new image{ 44 | width: 100%; 45 | height: 100%; 46 | } 47 | 48 | /* .nothing .new .words{ 49 | position: relative; 50 | z-index: 2; 51 | text-align: center; 52 | transform: rotate(-45deg); 53 | } */ 54 | .nothing .inner{ 55 | position: relative; 56 | z-index: 2; 57 | width: 100%; 58 | height: 100%; 59 | padding: 24rpx; 60 | box-sizing: border-box; 61 | display: flex; 62 | justify-content: center; 63 | align-items: flex-start; 64 | flex-direction: column; 65 | box-shadow:0 0 16rpx 0 rgba(255,255,255,.16) inset; 66 | } 67 | .nothing view{ 68 | width: 100%; 69 | box-sizing: border-box; 70 | } 71 | .nothing .thing{ 72 | font-size: 30rpx; 73 | color: #2b2b2b; 74 | text-align: right; 75 | padding-right: 48rpx; 76 | line-height: 60rpx; 77 | } 78 | .nothing .time{ 79 | font-size: 28rpx; 80 | color: #2b2b2b; 81 | text-align: right; 82 | padding-right: 48rpx; 83 | line-height: 40rpx; 84 | } 85 | .nothing .addr{ 86 | font-size: 28rpx; 87 | color: #2b2b2b; 88 | text-align: right; 89 | padding-right:48rpx; 90 | line-height: 40rpx; 91 | } 92 | .nothing .line{ 93 | text-align: right; 94 | color: #666; 95 | line-height: 40rpx; 96 | } 97 | .nothing .txt{ 98 | font-size: 30rpx; 99 | color: #2b2b2b; 100 | /* padding: 0 12rpx; */ 101 | text-align: center; 102 | line-height: 60rpx; 103 | } -------------------------------------------------------------------------------- /miniprogram/components/toptip/index.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | // externalClasses: ['top-tip'], 3 | // properties: { 4 | // tipsShow: { 5 | // type: Boolean 6 | // } 7 | // }, 8 | data: { 9 | tipsShow: true 10 | }, 11 | // attached: function () { }, 12 | methods: { 13 | closeTips: function () { 14 | // this.triggerEvent('close', {}) 15 | this.setData({ 16 | tipsShow: false 17 | }) 18 | }, 19 | } 20 | }) -------------------------------------------------------------------------------- /miniprogram/components/toptip/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /miniprogram/components/toptip/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 所填内容部分保存后不能修改(有需请联系客服),请认真填写哦~ 4 | 5 | 6 | -------------------------------------------------------------------------------- /miniprogram/components/toptip/index.wxss: -------------------------------------------------------------------------------- 1 | /**index.wxss**/ 2 | .toptip{ 3 | /* width: 750rpx; 4 | height: 40rpx; */ 5 | } 6 | .tips{ 7 | position: fixed; 8 | top: 0; 9 | width: 100%; 10 | /* box-shadow:0 4rpx 8rpx 0 rgba(43,45,46,.16); */ 11 | background: lightblue; 12 | /* opacity: .8; */ 13 | font-size: 20rpx; 14 | height: 40rpx; 15 | line-height: 40rpx; 16 | text-align: center; 17 | color: #fff; 18 | display: flex; 19 | justify-content: space-around; 20 | align-items: center; 21 | } 22 | .divline{ 23 | width: 750rpx; 24 | height: 40rpx; 25 | } 26 | .tips image{ 27 | width: 32rpx; 28 | height: 32rpx; 29 | vertical-align: middle; 30 | } -------------------------------------------------------------------------------- /miniprogram/config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | getTitleBySrc(src){ 3 | return src.split('/').pop().split('.mp3')[0] 4 | }, 5 | logoImg: 'cloud://demo-f09591.6465-demo-f09591/love.jpg', 6 | formatDate (date) { 7 | var y = date.getFullYear(); 8 | var m = date.getMonth() + 1; 9 | m = m < 10 ? '0' + m : m; 10 | var d = date.getDate(); 11 | d = d < 10 ? ('0' + d) : d; 12 | return y + '-' + m + '-' + d; 13 | }, 14 | formatTime (date) { 15 | var y = date.getFullYear(); 16 | var m = date.getMonth() + 1; 17 | m = m < 10 ? '0' + m : m; 18 | var d = date.getDate(); 19 | d = d < 10 ? ('0' + d) : d; 20 | var h = date.getHours() 21 | h = h < 10 ? '0' + h : h; 22 | var min = date.getMinutes() 23 | min = min < 10 ? '0' + min : min; 24 | var s = date.getSeconds() 25 | s = s < 10 ? '0' + s : s; 26 | return `${y}-${m}-${d} ${h}:${min}:${s}` 27 | }, 28 | } 29 | -------------------------------------------------------------------------------- /miniprogram/images/add.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /miniprogram/images/address.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /miniprogram/images/arrowright.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /miniprogram/images/cusser.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /miniprogram/images/cut.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /miniprogram/images/del.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /miniprogram/images/delete.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /miniprogram/images/delete_w.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /miniprogram/images/edit.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /miniprogram/images/edit_w.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /miniprogram/images/finish.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /miniprogram/images/gh_38a8dfd54795_430.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdFed/thelow/690a00a0a61e9a9afdcfc66e65cafd680a137d53/miniprogram/images/gh_38a8dfd54795_430.jpg -------------------------------------------------------------------------------- /miniprogram/images/gh_6b47f7286356_258.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdFed/thelow/690a00a0a61e9a9afdcfc66e65cafd680a137d53/miniprogram/images/gh_6b47f7286356_258.jpg -------------------------------------------------------------------------------- /miniprogram/images/half.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdFed/thelow/690a00a0a61e9a9afdcfc66e65cafd680a137d53/miniprogram/images/half.png -------------------------------------------------------------------------------- /miniprogram/images/half.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /miniprogram/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdFed/thelow/690a00a0a61e9a9afdcfc66e65cafd680a137d53/miniprogram/images/loading.gif -------------------------------------------------------------------------------- /miniprogram/images/love.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdFed/thelow/690a00a0a61e9a9afdcfc66e65cafd680a137d53/miniprogram/images/love.jpg -------------------------------------------------------------------------------- /miniprogram/images/music.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /miniprogram/images/new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdFed/thelow/690a00a0a61e9a9afdcfc66e65cafd680a137d53/miniprogram/images/new.png -------------------------------------------------------------------------------- /miniprogram/images/normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdFed/thelow/690a00a0a61e9a9afdcfc66e65cafd680a137d53/miniprogram/images/normal.png -------------------------------------------------------------------------------- /miniprogram/images/pause.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /miniprogram/images/play.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /miniprogram/images/selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdFed/thelow/690a00a0a61e9a9afdcfc66e65cafd680a137d53/miniprogram/images/selected.png -------------------------------------------------------------------------------- /miniprogram/images/selected.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /miniprogram/images/show-wall.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /miniprogram/images/star-half-b.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /miniprogram/images/success.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /miniprogram/images/tag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GdFed/thelow/690a00a0a61e9a9afdcfc66e65cafd680a137d53/miniprogram/images/tag.png -------------------------------------------------------------------------------- /miniprogram/images/tag.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /miniprogram/images/time.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /miniprogram/images/wechat.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /miniprogram/images/wechatzone.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /miniprogram/libs/node-schedule/schedule.js: -------------------------------------------------------------------------------- 1 | 2 | 'use strict'; 3 | 4 | /* 5 | node-schedule 6 | A cron-like and not-cron-like job scheduler for Node. 7 | */ 8 | 9 | var events = require('events'), 10 | util = require('util'), 11 | cronParser = require('cron-parser'), 12 | CronDate = require('cron-parser/lib/date'), 13 | lt = require('long-timeout'), 14 | sorted = require('sorted-array-functions'); 15 | 16 | /* Job object */ 17 | var anonJobCounter = 0; 18 | var scheduledJobs = {}; 19 | 20 | function isValidDate(date) { 21 | // Taken from http://stackoverflow.com/a/12372720/1562178 22 | // If getTime() returns NaN it'll return false anyway 23 | return date.getTime() === date.getTime(); 24 | } 25 | 26 | function Job(name, job, callback) { 27 | // setup a private pendingInvocations variable 28 | var pendingInvocations = []; 29 | 30 | //setup a private number of invocations variable 31 | var triggeredJobs = 0; 32 | 33 | // Set scope vars 34 | var jobName = name && typeof name === 'string' ? name : ''; 35 | this.job = name && typeof name === 'function' ? name : job; 36 | 37 | // Make sure callback is actually a callback 38 | if (this.job === name) { 39 | // Name wasn't provided and maybe a callback is there 40 | this.callback = typeof job === 'function' ? job : false; 41 | } else { 42 | // Name was provided, and maybe a callback is there 43 | this.callback = typeof callback === 'function' ? callback : false; 44 | } 45 | 46 | // Check for generator 47 | if (typeof this.job === 'function' && 48 | this.job.prototype && 49 | this.job.prototype.next) { 50 | this.job = function() { 51 | return this.next().value; 52 | }.bind(this.job.call(this)); 53 | } 54 | 55 | // define properties 56 | Object.defineProperty(this, 'name', { 57 | value: jobName, 58 | writable: false, 59 | enumerable: true 60 | }); 61 | 62 | // method that require private access 63 | this.trackInvocation = function(invocation) { 64 | // add to our invocation list 65 | sorted.add(pendingInvocations, invocation, sorter); 66 | return true; 67 | }; 68 | this.stopTrackingInvocation = function(invocation) { 69 | var invIdx = pendingInvocations.indexOf(invocation); 70 | if (invIdx > -1) { 71 | pendingInvocations.splice(invIdx, 1); 72 | return true; 73 | } 74 | 75 | return false; 76 | }; 77 | this.triggeredJobs = function() { 78 | return triggeredJobs; 79 | }; 80 | this.setTriggeredJobs = function(triggeredJob) { 81 | triggeredJobs = triggeredJob; 82 | }; 83 | this.cancel = function(reschedule) { 84 | reschedule = (typeof reschedule == 'boolean') ? reschedule : false; 85 | 86 | var inv, newInv; 87 | var newInvs = []; 88 | for (var j = 0; j < pendingInvocations.length; j++) { 89 | inv = pendingInvocations[j]; 90 | 91 | cancelInvocation(inv); 92 | 93 | if (reschedule && inv.recurrenceRule.recurs) { 94 | newInv = scheduleNextRecurrence(inv.recurrenceRule, this, inv.fireDate, inv.endDate); 95 | if (newInv !== null) { 96 | newInvs.push(newInv); 97 | } 98 | } 99 | } 100 | 101 | pendingInvocations = []; 102 | 103 | for (var k = 0; k < newInvs.length; k++) { 104 | this.trackInvocation(newInvs[k]); 105 | } 106 | 107 | // remove from scheduledJobs if reschedule === false 108 | if (!reschedule) { 109 | if (this.name) { 110 | delete scheduledJobs[this.name]; 111 | } 112 | } 113 | 114 | return true; 115 | }; 116 | this.cancelNext = function(reschedule) { 117 | reschedule = (typeof reschedule == 'boolean') ? reschedule : true; 118 | 119 | if (!pendingInvocations.length) { 120 | return false; 121 | } 122 | 123 | var newInv; 124 | var nextInv = pendingInvocations.shift(); 125 | 126 | cancelInvocation(nextInv); 127 | 128 | if (reschedule && nextInv.recurrenceRule.recurs) { 129 | newInv = scheduleNextRecurrence(nextInv.recurrenceRule, this, nextInv.fireDate, nextInv.endDate); 130 | if (newInv !== null) { 131 | this.trackInvocation(newInv); 132 | } 133 | } 134 | 135 | return true; 136 | }; 137 | this.reschedule = function(spec) { 138 | var inv; 139 | var cInvs = pendingInvocations.slice(); 140 | 141 | for (var j = 0; j < cInvs.length; j++) { 142 | inv = cInvs[j]; 143 | 144 | cancelInvocation(inv); 145 | } 146 | 147 | pendingInvocations = []; 148 | 149 | if (this.schedule(spec)) { 150 | this.setTriggeredJobs(0); 151 | return true; 152 | } else { 153 | pendingInvocations = cInvs; 154 | return false; 155 | } 156 | }; 157 | this.nextInvocation = function() { 158 | if (!pendingInvocations.length) { 159 | return null; 160 | } 161 | return pendingInvocations[0].fireDate; 162 | }; 163 | this.pendingInvocations = function() { 164 | return pendingInvocations; 165 | }; 166 | } 167 | 168 | util.inherits(Job, events.EventEmitter); 169 | 170 | Job.prototype.invoke = function(fireDate) { 171 | if (typeof this.job == 'function') { 172 | this.setTriggeredJobs(this.triggeredJobs() + 1); 173 | this.job(fireDate); 174 | } else { 175 | this.job.execute(fireDate); 176 | } 177 | }; 178 | 179 | Job.prototype.runOnDate = function(date) { 180 | return this.schedule(date); 181 | }; 182 | 183 | Job.prototype.schedule = function(spec) { 184 | var self = this; 185 | var success = false; 186 | var inv; 187 | var start; 188 | var end; 189 | var tz; 190 | 191 | if (typeof spec === 'object' && spec.rule) { 192 | start = spec.start || undefined; 193 | end = spec.end || undefined; 194 | tz = spec.tz; 195 | spec = spec.rule; 196 | 197 | if (start) { 198 | if (!(start instanceof Date)) { 199 | start = new Date(start); 200 | } 201 | 202 | start = new CronDate(start, tz); 203 | if (!isValidDate(start) || start.getTime() < Date.now()) { 204 | start = undefined; 205 | } 206 | } 207 | 208 | if (end && !(end instanceof Date) && !isValidDate(end = new Date(end))) { 209 | end = undefined; 210 | } 211 | 212 | if (end) { 213 | end = new CronDate(end, tz); 214 | } 215 | } 216 | 217 | try { 218 | var res = cronParser.parseExpression(spec, { currentDate: start, tz: tz }); 219 | inv = scheduleNextRecurrence(res, self, start, end); 220 | if (inv !== null) { 221 | success = self.trackInvocation(inv); 222 | } 223 | } catch (err) { 224 | var type = typeof spec; 225 | if ((type === 'string') || (type === 'number')) { 226 | spec = new Date(spec); 227 | } 228 | 229 | if ((spec instanceof Date) && (isValidDate(spec))) { 230 | spec = new CronDate(spec); 231 | if (spec.getTime() >= Date.now()) { 232 | inv = new Invocation(self, spec); 233 | scheduleInvocation(inv); 234 | success = self.trackInvocation(inv); 235 | } 236 | } else if (type === 'object') { 237 | if (!(spec instanceof RecurrenceRule)) { 238 | var r = new RecurrenceRule(); 239 | if ('year' in spec) { 240 | r.year = spec.year; 241 | } 242 | if ('month' in spec) { 243 | r.month = spec.month; 244 | } 245 | if ('date' in spec) { 246 | r.date = spec.date; 247 | } 248 | if ('dayOfWeek' in spec) { 249 | r.dayOfWeek = spec.dayOfWeek; 250 | } 251 | if ('hour' in spec) { 252 | r.hour = spec.hour; 253 | } 254 | if ('minute' in spec) { 255 | r.minute = spec.minute; 256 | } 257 | if ('second' in spec) { 258 | r.second = spec.second; 259 | } 260 | 261 | spec = r; 262 | } 263 | 264 | spec.tz = tz; 265 | inv = scheduleNextRecurrence(spec, self, start, end); 266 | if (inv !== null) { 267 | success = self.trackInvocation(inv); 268 | } 269 | } 270 | } 271 | 272 | scheduledJobs[this.name] = this; 273 | return success; 274 | }; 275 | 276 | /* API 277 | invoke() 278 | runOnDate(date) 279 | schedule(date || recurrenceRule || cronstring) 280 | cancel(reschedule = false) 281 | cancelNext(reschedule = true) 282 | 283 | Property constraints 284 | name: readonly 285 | job: readwrite 286 | */ 287 | 288 | /* DoesntRecur rule */ 289 | var DoesntRecur = new RecurrenceRule(); 290 | DoesntRecur.recurs = false; 291 | 292 | /* Invocation object */ 293 | function Invocation(job, fireDate, recurrenceRule, endDate) { 294 | this.job = job; 295 | this.fireDate = fireDate; 296 | this.endDate = endDate; 297 | this.recurrenceRule = recurrenceRule || DoesntRecur; 298 | 299 | this.timerID = null; 300 | } 301 | 302 | function sorter(a, b) { 303 | return (a.fireDate.getTime() - b.fireDate.getTime()); 304 | } 305 | 306 | /* Range object */ 307 | function Range(start, end, step) { 308 | this.start = start || 0; 309 | this.end = end || 60; 310 | this.step = step || 1; 311 | } 312 | 313 | Range.prototype.contains = function(val) { 314 | if (this.step === null || this.step === 1) { 315 | return (val >= this.start && val <= this.end); 316 | } else { 317 | for (var i = this.start; i < this.end; i += this.step) { 318 | if (i === val) { 319 | return true; 320 | } 321 | } 322 | 323 | return false; 324 | } 325 | }; 326 | 327 | /* RecurrenceRule object */ 328 | /* 329 | Interpreting each property: 330 | null - any value is valid 331 | number - fixed value 332 | Range - value must fall in range 333 | array - value must validate against any item in list 334 | 335 | NOTE: Cron months are 1-based, but RecurrenceRule months are 0-based. 336 | */ 337 | function RecurrenceRule(year, month, date, dayOfWeek, hour, minute, second) { 338 | this.recurs = true; 339 | 340 | this.year = (year == null) ? null : year; 341 | this.month = (month == null) ? null : month; 342 | this.date = (date == null) ? null : date; 343 | this.dayOfWeek = (dayOfWeek == null) ? null : dayOfWeek; 344 | this.hour = (hour == null) ? null : hour; 345 | this.minute = (minute == null) ? null : minute; 346 | this.second = (second == null) ? 0 : second; 347 | } 348 | 349 | RecurrenceRule.prototype.isValid = function() { 350 | function isValidType(num) { 351 | if (Array.isArray(num) || (num instanceof Array)) { 352 | return num.every(function(e) { 353 | return isValidType(e); 354 | }); 355 | } 356 | return !(Number.isNaN(Number(num)) && !(num instanceof Range)); 357 | } 358 | if (this.month !== null && (this.month < 0 || this.month > 11 || !isValidType(this.month))) { 359 | return false; 360 | } 361 | if (this.dayOfWeek !== null && (this.dayOfWeek < 0 || this.dayOfWeek > 6 || !isValidType(this.dayOfWeek))) { 362 | return false; 363 | } 364 | if (this.hour !== null && (this.hour < 0 || this.hour > 23 || !isValidType(this.hour))) { 365 | return false; 366 | } 367 | if (this.minute !== null && (this.minute < 0 || this.minute > 59 || !isValidType(this.minute))) { 368 | return false; 369 | } 370 | if (this.second !== null && (this.second < 0 || this.second > 59 || !isValidType(this.second))) { 371 | return false; 372 | } 373 | if (this.date !== null) { 374 | if(!isValidType(this.date)) { 375 | return false; 376 | } 377 | switch (this.month) { 378 | case 3: 379 | case 5: 380 | case 8: 381 | case 10: 382 | if (this.date < 1 || this. date > 30) { 383 | return false; 384 | } 385 | break; 386 | case 1: 387 | if (this.date < 1 || this. date > 29) { 388 | return false; 389 | } 390 | break; 391 | default: 392 | if (this.date < 1 || this. date > 31) { 393 | return false; 394 | } 395 | } 396 | } 397 | return true; 398 | }; 399 | 400 | RecurrenceRule.prototype.nextInvocationDate = function(base) { 401 | base = ((base instanceof CronDate) || (base instanceof Date)) ? base : (new Date()); 402 | if (!this.recurs) { 403 | return null; 404 | } 405 | 406 | if(!this.isValid()) { 407 | return null; 408 | } 409 | 410 | var now = new CronDate(Date.now(), this.tz); 411 | var fullYear = now.getFullYear(); 412 | if ((this.year !== null) && 413 | (typeof this.year == 'number') && 414 | (this.year < fullYear)) { 415 | return null; 416 | } 417 | 418 | var next = new CronDate(base.getTime(), this.tz); 419 | next.addSecond(); 420 | 421 | while (true) { 422 | if (this.year !== null) { 423 | fullYear = next.getFullYear(); 424 | if ((typeof this.year == 'number') && (this.year < fullYear)) { 425 | next = null; 426 | break; 427 | } 428 | 429 | if (!recurMatch(fullYear, this.year)) { 430 | next.addYear(); 431 | next.setMonth(0); 432 | next.setDate(1); 433 | next.setHours(0); 434 | next.setMinutes(0); 435 | next.setSeconds(0); 436 | continue; 437 | } 438 | } 439 | if (this.month != null && !recurMatch(next.getMonth(), this.month)) { 440 | next.addMonth(); 441 | continue; 442 | } 443 | if (this.date != null && !recurMatch(next.getDate(), this.date)) { 444 | next.addDay(); 445 | continue; 446 | } 447 | if (this.dayOfWeek != null && !recurMatch(next.getDay(), this.dayOfWeek)) { 448 | next.addDay(); 449 | continue; 450 | } 451 | if (this.hour != null && !recurMatch(next.getHours(), this.hour)) { 452 | next.addHour(); 453 | continue; 454 | } 455 | if (this.minute != null && !recurMatch(next.getMinutes(), this.minute)) { 456 | next.addMinute(); 457 | continue; 458 | } 459 | if (this.second != null && !recurMatch(next.getSeconds(), this.second)) { 460 | next.addSecond(); 461 | continue; 462 | } 463 | 464 | break; 465 | } 466 | 467 | return next ? next.toDate() : null; 468 | }; 469 | 470 | function recurMatch(val, matcher) { 471 | if (matcher == null) { 472 | return true; 473 | } 474 | 475 | if (typeof matcher === 'number') { 476 | return (val === matcher); 477 | } else if(typeof matcher === 'string') { 478 | return (val === Number(matcher)); 479 | } else if (matcher instanceof Range) { 480 | return matcher.contains(val); 481 | } else if (Array.isArray(matcher) || (matcher instanceof Array)) { 482 | for (var i = 0; i < matcher.length; i++) { 483 | if (recurMatch(val, matcher[i])) { 484 | return true; 485 | } 486 | } 487 | } 488 | 489 | return false; 490 | } 491 | 492 | /* Date-based scheduler */ 493 | function runOnDate(date, job) { 494 | var now = Date.now(); 495 | var then = date.getTime(); 496 | 497 | return lt.setTimeout(function() { 498 | if (then > Date.now()) 499 | runOnDate(date, job); 500 | else 501 | job(); 502 | }, (then < now ? 0 : then - now)); 503 | } 504 | 505 | var invocations = []; 506 | var currentInvocation = null; 507 | 508 | function scheduleInvocation(invocation) { 509 | sorted.add(invocations, invocation, sorter); 510 | prepareNextInvocation(); 511 | var date = invocation.fireDate instanceof CronDate ? invocation.fireDate.toDate() : invocation.fireDate; 512 | invocation.job.emit('scheduled', date); 513 | } 514 | 515 | function prepareNextInvocation() { 516 | if (invocations.length > 0 && currentInvocation !== invocations[0]) { 517 | if (currentInvocation !== null) { 518 | lt.clearTimeout(currentInvocation.timerID); 519 | currentInvocation.timerID = null; 520 | currentInvocation = null; 521 | } 522 | 523 | currentInvocation = invocations[0]; 524 | 525 | var job = currentInvocation.job; 526 | var cinv = currentInvocation; 527 | currentInvocation.timerID = runOnDate(currentInvocation.fireDate, function() { 528 | currentInvocationFinished(); 529 | 530 | if (job.callback) { 531 | job.callback(); 532 | } 533 | 534 | if (cinv.recurrenceRule.recurs || cinv.recurrenceRule._endDate === null) { 535 | var inv = scheduleNextRecurrence(cinv.recurrenceRule, cinv.job, cinv.fireDate, cinv.endDate); 536 | if (inv !== null) { 537 | inv.job.trackInvocation(inv); 538 | } 539 | } 540 | 541 | job.stopTrackingInvocation(cinv); 542 | 543 | job.invoke(cinv.fireDate instanceof CronDate ? cinv.fireDate.toDate() : cinv.fireDate); 544 | job.emit('run'); 545 | }); 546 | } 547 | } 548 | 549 | function currentInvocationFinished() { 550 | invocations.shift(); 551 | currentInvocation = null; 552 | prepareNextInvocation(); 553 | } 554 | 555 | function cancelInvocation(invocation) { 556 | var idx = invocations.indexOf(invocation); 557 | if (idx > -1) { 558 | invocations.splice(idx, 1); 559 | if (invocation.timerID !== null) { 560 | lt.clearTimeout(invocation.timerID); 561 | } 562 | 563 | if (currentInvocation === invocation) { 564 | currentInvocation = null; 565 | } 566 | 567 | invocation.job.emit('canceled', invocation.fireDate); 568 | prepareNextInvocation(); 569 | } 570 | } 571 | 572 | /* Recurrence scheduler */ 573 | function scheduleNextRecurrence(rule, job, prevDate, endDate) { 574 | 575 | prevDate = (prevDate instanceof CronDate) ? prevDate : new CronDate(); 576 | 577 | var date = (rule instanceof RecurrenceRule) ? rule.nextInvocationDate(prevDate) : rule.next(); 578 | if (date === null) { 579 | return null; 580 | } 581 | 582 | if ((endDate instanceof CronDate) && date.getTime() > endDate.getTime()) { 583 | return null; 584 | } 585 | 586 | var inv = new Invocation(job, date, rule, endDate); 587 | scheduleInvocation(inv); 588 | 589 | return inv; 590 | } 591 | 592 | /* Convenience methods */ 593 | function scheduleJob() { 594 | if (arguments.length < 2) { 595 | return null; 596 | } 597 | 598 | var name = (arguments.length >= 3 && typeof arguments[0] === 'string') ? arguments[0] : null; 599 | var spec = name ? arguments[1] : arguments[0]; 600 | var method = name ? arguments[2] : arguments[1]; 601 | var callback = name ? arguments[3] : arguments[2]; 602 | 603 | var job = new Job(name, method, callback); 604 | 605 | if (job.schedule(spec)) { 606 | return job; 607 | } 608 | 609 | return null; 610 | } 611 | 612 | function rescheduleJob(job, spec) { 613 | if (job instanceof Job) { 614 | if (job.reschedule(spec)) { 615 | return job; 616 | } 617 | } else if (typeof job == 'string' || job instanceof String) { 618 | if (job in scheduledJobs && scheduledJobs.hasOwnProperty(job)) { 619 | if (scheduledJobs[job].reschedule(spec)) { 620 | return scheduledJobs[job]; 621 | } 622 | } 623 | } 624 | return null; 625 | } 626 | 627 | function cancelJob(job) { 628 | var success = false; 629 | if (job instanceof Job) { 630 | success = job.cancel(); 631 | } else if (typeof job == 'string' || job instanceof String) { 632 | if (job in scheduledJobs && scheduledJobs.hasOwnProperty(job)) { 633 | success = scheduledJobs[job].cancel(); 634 | } 635 | } 636 | 637 | return success; 638 | } 639 | 640 | /* Public API */ 641 | module.exports.Job = Job; 642 | module.exports.Range = Range; 643 | module.exports.RecurrenceRule = RecurrenceRule; 644 | module.exports.Invocation = Invocation; 645 | module.exports.scheduleJob = scheduleJob; 646 | module.exports.rescheduleJob = rescheduleJob; 647 | module.exports.scheduledJobs = scheduledJobs; 648 | module.exports.cancelJob = cancelJob; 649 | -------------------------------------------------------------------------------- /miniprogram/pages/chooseLib/chooseLib.js: -------------------------------------------------------------------------------- 1 | // pages/chooseLib/chooseLib.js 2 | Page({ 3 | 4 | /** 5 | * 页面的初始数据 6 | */ 7 | data: { 8 | 9 | }, 10 | 11 | /** 12 | * 生命周期函数--监听页面加载 13 | */ 14 | onLoad: function (options) { 15 | 16 | }, 17 | 18 | /** 19 | * 生命周期函数--监听页面初次渲染完成 20 | */ 21 | onReady: function () { 22 | 23 | }, 24 | 25 | /** 26 | * 生命周期函数--监听页面显示 27 | */ 28 | onShow: function () { 29 | 30 | }, 31 | 32 | /** 33 | * 生命周期函数--监听页面隐藏 34 | */ 35 | onHide: function () { 36 | 37 | }, 38 | 39 | /** 40 | * 生命周期函数--监听页面卸载 41 | */ 42 | onUnload: function () { 43 | 44 | }, 45 | 46 | /** 47 | * 页面相关事件处理函数--监听用户下拉动作 48 | */ 49 | onPullDownRefresh: function () { 50 | 51 | }, 52 | 53 | /** 54 | * 页面上拉触底事件的处理函数 55 | */ 56 | onReachBottom: function () { 57 | 58 | }, 59 | 60 | /** 61 | * 用户点击右上角分享 62 | */ 63 | onShareAppMessage: function () { 64 | 65 | } 66 | }) -------------------------------------------------------------------------------- /miniprogram/pages/chooseLib/chooseLib.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "选择基础库" 3 | } -------------------------------------------------------------------------------- /miniprogram/pages/chooseLib/chooseLib.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 初始化失败 7 | 8 | 9 | 请使用 2.2.3 或以上的基础库以使用云能力 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /miniprogram/pages/chooseLib/chooseLib.wxss: -------------------------------------------------------------------------------- 1 | /* pages/chooseLib/chooseLib.wxss */ 2 | 3 | @import "../../style/guide.wxss"; 4 | 5 | .black { 6 | color: black; 7 | } -------------------------------------------------------------------------------- /miniprogram/pages/doing/index.js: -------------------------------------------------------------------------------- 1 | //index.js 2 | const app = getApp() 3 | Page({ 4 | data: { 5 | editStatus: true, 6 | thing: null, 7 | happy: 0, 8 | txt: '', 9 | time: wx.formatDate(new Date()), 10 | photos: '', 11 | wallshow: false, 12 | region: ['广东省', '深圳市', '南山区'], 13 | sweethingid: 0, 14 | openid: '' 15 | }, 16 | onLoad (options) { 17 | let id = parseInt(options.id) 18 | wx.func('sweething',{id}).then(ret=>{ 19 | this.setData({thing: ret.result.data[0]}) 20 | }).catch(err=>{ 21 | console.log(err) 22 | }) 23 | wx.func('login',{}).then(res=>{ 24 | this.setData({ 25 | openid: res.result.openid 26 | }) 27 | }).catch(err=>{ 28 | console.log(err) 29 | }) 30 | 31 | }, 32 | onShow: function () { 33 | // wx.showShareMenu() 34 | let that = this 35 | wx.getlocation().then(ret=>{ 36 | let addr = ret.result.address_component 37 | that.setData({ 38 | region: [addr.province, addr.city, addr.district] 39 | }) 40 | }).catch(err=>{ 41 | console.log(err) 42 | }) 43 | }, 44 | bindTimeChange(e){ 45 | // console.log('bindTimeChange',e) 46 | this.setData({ 47 | time: e.detail.value 48 | }) 49 | }, 50 | bindRegionChange: function (e) { 51 | // console.log('bindRegionChange',e) 52 | this.setData({ 53 | region: e.detail.value 54 | }) 55 | }, 56 | switchChange(e){ 57 | // console.log('switchChange',e) 58 | this.setData({ 59 | wallshow: e.detail.value 60 | }) 61 | }, 62 | sliderChange(e){ 63 | // console.log('sliderChange',e) 64 | this.setData({ 65 | happy: e.detail.value 66 | }) 67 | }, 68 | textareaBlur(e){ 69 | // console.log('textareaBlur',e) 70 | this.setData({ 71 | txt: e.detail.value 72 | }) 73 | }, 74 | addPic(){ 75 | let that = this 76 | wx.chooseImage({ 77 | count: 1, 78 | sizeType: 'compressed', 79 | sourceType: ['album', 'camera'], 80 | success (res) { 81 | if(res.tempFiles[0].size > 2097152){ 82 | wx.showToast({ 83 | title: '上传图片不能大于2M', //提示的内容, 84 | icon: 'none', //图标 85 | }); 86 | return 87 | } 88 | const tempFilePath = res.tempFilePaths[0] 89 | that.setData({ 90 | photos: tempFilePath 91 | }) 92 | } 93 | }) 94 | }, 95 | delPic(e){ 96 | this.setData({ 97 | photos: '' 98 | }) 99 | }, 100 | editAll() { 101 | this.setData({ 102 | editStatus: true 103 | }) 104 | }, 105 | save() { 106 | let that = this 107 | this.setData({ 108 | editStatus: false 109 | }) 110 | let time = this.data.time.split('-') 111 | time = `${time[0]}年${time[1]}月${time[2]}日` 112 | let addr = this.data.region[1] 113 | addr = addr.substring(0, addr.length-1) 114 | let thing = this.data.thing.thing 115 | let txt = `${time},那天我们在${addr},${thing}。` 116 | if(this.data.photos){ 117 | // 上传图片 118 | const cloudPath = 'img/' + wx.openid+'TO'+ this.data.thing.id+'TIME'+(+new Date())+'TIME' + '.jpg' 119 | wx.cloud.uploadFile({ 120 | cloudPath, 121 | filePath: this.data.photos, // 小程序临时文件路径 122 | }).then(realpath=>{ 123 | wx.func('savething',{ 124 | id: this.data.thing.id, 125 | donetime: this.data.time, 126 | doneaddr: this.data.region, 127 | happy: this.data.happy, 128 | txt: this.data.txt || txt, 129 | wallshow: this.data.wallshow, 130 | picaddr: realpath.fileID 131 | }).then(ret=>{ 132 | console.log(ret) 133 | that.setData({sweethingid: ret.result._id}) 134 | }).catch(err=>{ 135 | console.log(err) 136 | }) 137 | }).catch(err=>{ 138 | console.log(err) 139 | }) 140 | }else{ 141 | wx.func('savething',{ 142 | id: this.data.thing.id, 143 | donetime: this.data.time, 144 | doneaddr: this.data.region, 145 | happy: this.data.happy, 146 | txt: this.data.txt || txt, 147 | wallshow: this.data.wallshow, 148 | picaddr: '' 149 | }).then(ret=>{ 150 | that.setData({sweethingid: ret.result._id}) 151 | console.log(ret) 152 | }).catch(err=>{ 153 | console.log(err) 154 | }) 155 | } 156 | }, 157 | share(){ 158 | wx.navigateTo({ url: `../share/index?sweethingid=${this.data.sweethingid}` }); 159 | }, 160 | formSubmit(e){ 161 | console.log(e) 162 | let that = this 163 | setTimeout(()=>{ 164 | wx.func('sendmsg', { 165 | templateid: '9uHCLq3DZ-kZWnTZfAf8UL9zv2IuSdwzqhQyDLuAUcw', 166 | formid: e.detail.formId, 167 | openid: that.data.openid, 168 | page: `pages/share/index?sweethingid=${that.data.sweethingid}`, 169 | formdata: { 170 | keyword1: { 171 | value: `${that.data.thing.thing}` 172 | // value: `No.${that.data.thing.id} ${that.data.thing.thing}` 173 | }, 174 | keyword2: { 175 | value: wx.formatTime(new Date()) 176 | }, 177 | keyword3: { 178 | value: that.data.time 179 | } , 180 | keyword4: { 181 | value: '恭喜您完成一份愿望,赶紧分享让TA也知道吧~' 182 | } 183 | } 184 | }) 185 | }, 2000) 186 | } 187 | }) 188 | -------------------------------------------------------------------------------- /miniprogram/pages/doing/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "记录点滴", 3 | "usingComponents": { 4 | "toptip": "../../components/toptip/index" 5 | } 6 | } -------------------------------------------------------------------------------- /miniprogram/pages/doing/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 事件 6 | 7 | No.{{thing.id}} {{thing.thing}} 8 | 9 | 10 | 11 | 日期 12 | 13 | 14 | 15 | {{time}} 16 | 17 | 18 | 19 | 20 | 21 | 地点 22 | 23 | 24 | 25 | {{region[0]}},{{region[1]}},{{region[2]}} 26 | 27 | 28 | 29 | 30 | 31 | 幸福值 32 | 33 | 34 | 35 | 36 | 37 | 38 | 感想 39 | 40 |