From 8c26650ac98272c485a312872740a024f67240e8 Mon Sep 17 00:00:00 2001 From: "0xWe11es.eth" <83463505+CSWellesSun@users.noreply.github.com> Date: Fri, 29 Sep 2023 21:59:44 +0800 Subject: [PATCH 1/3] Feat/register (#5) * feat: register & login * fix: rename page --- .gitignore | 1 + cloudfunctions/getPhoneNumber/config.json | 6 + cloudfunctions/getPhoneNumber/index.js | 46 + .../getPhoneNumber/package-lock.json | 1221 +++++++++++++++++ cloudfunctions/getPhoneNumber/package.json | 14 + miniprogram/app.js | 93 +- miniprogram/app.json | 29 +- miniprogram/pages/about/about.js | 67 - miniprogram/pages/about/about.json | 3 - miniprogram/pages/about/about.wxml | 34 - miniprogram/pages/about/about.wxss | 55 - miniprogram/pages/addV2/add.js | 313 ----- miniprogram/pages/addV2/add.json | 3 - miniprogram/pages/addV2/add.wxml | 82 -- miniprogram/pages/addV2/add.wxss | 140 -- .../applicationReceived.js | 88 -- .../applicationReceived.json | 5 - .../applicationReceived.wxml | 29 - .../applicationReceived.wxss | 547 -------- miniprogram/pages/award/add/add.js | 227 --- miniprogram/pages/award/add/add.json | 3 - miniprogram/pages/award/add/add.wxml | 76 - miniprogram/pages/award/add/add.wxss | 165 --- miniprogram/pages/award/award/award.js | 203 --- miniprogram/pages/award/award/award.json | 4 - miniprogram/pages/award/award/award.wxml | 56 - miniprogram/pages/award/award/award.wxss | 188 --- miniprogram/pages/calendar/calendar.js | 318 ----- miniprogram/pages/calendar/calendar.json | 3 - miniprogram/pages/calendar/calendar.wxml | 121 -- miniprogram/pages/calendar/calendar.wxss | 235 ---- miniprogram/pages/indexV2/index.js | 479 ------- miniprogram/pages/indexV2/index.json | 6 - miniprogram/pages/indexV2/index.wxml | 130 -- miniprogram/pages/indexV2/index.wxss | 331 ----- miniprogram/pages/info/index.js | 152 -- miniprogram/pages/info/index.json | 3 - miniprogram/pages/info/index.wxml | 56 - miniprogram/pages/info/index.wxss | 140 -- .../pages/info/infoUpdate/infoUpdate.js | 47 - .../pages/info/infoUpdate/infoUpdate.wxml | 2 - miniprogram/pages/infoUpdate/infoUpdate.js | 204 --- miniprogram/pages/infoUpdate/infoUpdate.json | 3 - miniprogram/pages/infoUpdate/infoUpdate.wxml | 53 - miniprogram/pages/infoUpdate/infoUpdate.wxss | 141 -- .../basic_information.js} | 0 .../basic_information.json} | 0 .../basic_information.wxml} | 0 .../basic_information.wxss} | 0 .../education_experience.js} | 0 .../education_experience.json} | 0 .../education_experience.wxml} | 0 .../education_experience.wxss} | 0 .../{myTag/myTag.js => my_tag/my_tag.js} | 0 .../{myTag/myTag.json => my_tag/my_tag.json} | 0 .../{myTag/myTag.wxml => my_tag/my_tag.wxml} | 0 .../{myTag/myTag.wxss => my_tag/my_tag.wxss} | 0 .../working_experience.js} | 0 .../working_experience.json} | 0 .../working_experience.wxml} | 0 .../working_experience.wxss} | 0 miniprogram/pages/invite/invite.js | 213 --- miniprogram/pages/invite/invite.json | 3 - miniprogram/pages/invite/invite.wxml | 72 - miniprogram/pages/invite/invite.wxss | 196 --- miniprogram/pages/login/login.js | 43 - miniprogram/pages/loginV2/login.js | 99 -- miniprogram/pages/loginV2/login.json | 5 - miniprogram/pages/loginV2/login.wxml | 23 - miniprogram/pages/loginV2/login.wxss | 266 ---- miniprogram/pages/mine/mine.json | 3 +- miniprogram/pages/mine/mine.wxml | 2 +- miniprogram/pages/mineV2/mine.js | 136 -- miniprogram/pages/mineV2/mine.json | 4 - miniprogram/pages/mineV2/mine.wxml | 116 -- miniprogram/pages/mineV2/mine.wxss | 293 ---- .../pages/myApplication/myApplication.js | 17 - .../pages/myApplication/myApplication.json | 5 - .../pages/myApplication/myApplication.wxml | 2 - .../pages/myApplication/myApplication.wxss | 1 - miniprogram/pages/myFriend/myFriend.js | 1 - miniprogram/pages/myFriend/myFriend.json | 5 - miniprogram/pages/myFriend/myFriend.wxml | 1 - miniprogram/pages/myFriend/myFriend.wxss | 0 miniprogram/pages/publish/publish.js | 353 ----- miniprogram/pages/publish/publish.json | 3 - miniprogram/pages/publish/publish.wxml | 51 - miniprogram/pages/publish/publish.wxss | 123 -- miniprogram/pages/register/register.js | 131 ++ .../login.json => register/register.json} | 0 .../login.wxml => register/register.wxml} | 16 +- .../login.wxss => register/register.wxss} | 0 .../pages/search/search_home/search_home.js | 37 +- miniprogram/pages/setting/setting.js | 149 -- miniprogram/pages/setting/setting.json | 3 - miniprogram/pages/setting/setting.wxml | 65 - miniprogram/pages/setting/setting.wxss | 101 -- miniprogram/pages/square/add/add.js | 134 -- miniprogram/pages/square/add/add.json | 3 - miniprogram/pages/square/add/add.wxml | 52 - miniprogram/pages/square/add/add.wxss | 129 -- miniprogram/pages/square/detail/detail.js | 171 --- miniprogram/pages/square/detail/detail.json | 5 - miniprogram/pages/square/detail/detail.wxml | 43 - miniprogram/pages/square/detail/detail.wxss | 86 -- miniprogram/pages/square/square/square.js | 134 -- miniprogram/pages/square/square/square.json | 4 - miniprogram/pages/square/square/square.wxml | 47 - miniprogram/pages/square/square/square.wxss | 143 -- project.config.json | 13 +- 110 files changed, 1513 insertions(+), 8111 deletions(-) create mode 100644 .gitignore create mode 100644 cloudfunctions/getPhoneNumber/config.json create mode 100644 cloudfunctions/getPhoneNumber/index.js create mode 100644 cloudfunctions/getPhoneNumber/package-lock.json create mode 100644 cloudfunctions/getPhoneNumber/package.json delete mode 100644 miniprogram/pages/about/about.js delete mode 100644 miniprogram/pages/about/about.json delete mode 100644 miniprogram/pages/about/about.wxml delete mode 100644 miniprogram/pages/about/about.wxss delete mode 100644 miniprogram/pages/addV2/add.js delete mode 100644 miniprogram/pages/addV2/add.json delete mode 100644 miniprogram/pages/addV2/add.wxml delete mode 100644 miniprogram/pages/addV2/add.wxss delete mode 100644 miniprogram/pages/applicationReceived/applicationReceived.js delete mode 100644 miniprogram/pages/applicationReceived/applicationReceived.json delete mode 100644 miniprogram/pages/applicationReceived/applicationReceived.wxml delete mode 100644 miniprogram/pages/applicationReceived/applicationReceived.wxss delete mode 100644 miniprogram/pages/award/add/add.js delete mode 100644 miniprogram/pages/award/add/add.json delete mode 100644 miniprogram/pages/award/add/add.wxml delete mode 100644 miniprogram/pages/award/add/add.wxss delete mode 100644 miniprogram/pages/award/award/award.js delete mode 100644 miniprogram/pages/award/award/award.json delete mode 100644 miniprogram/pages/award/award/award.wxml delete mode 100644 miniprogram/pages/award/award/award.wxss delete mode 100644 miniprogram/pages/calendar/calendar.js delete mode 100644 miniprogram/pages/calendar/calendar.json delete mode 100644 miniprogram/pages/calendar/calendar.wxml delete mode 100644 miniprogram/pages/calendar/calendar.wxss delete mode 100644 miniprogram/pages/indexV2/index.js delete mode 100644 miniprogram/pages/indexV2/index.json delete mode 100644 miniprogram/pages/indexV2/index.wxml delete mode 100644 miniprogram/pages/indexV2/index.wxss delete mode 100644 miniprogram/pages/info/index.js delete mode 100644 miniprogram/pages/info/index.json delete mode 100644 miniprogram/pages/info/index.wxml delete mode 100644 miniprogram/pages/info/index.wxss delete mode 100644 miniprogram/pages/info/infoUpdate/infoUpdate.js delete mode 100644 miniprogram/pages/info/infoUpdate/infoUpdate.wxml delete mode 100644 miniprogram/pages/infoUpdate/infoUpdate.js delete mode 100644 miniprogram/pages/infoUpdate/infoUpdate.json delete mode 100644 miniprogram/pages/infoUpdate/infoUpdate.wxml delete mode 100644 miniprogram/pages/infoUpdate/infoUpdate.wxss rename miniprogram/pages/information/{basicInformation/basicInformation.js => basic_information/basic_information.js} (100%) rename miniprogram/pages/information/{basicInformation/basicInformation.json => basic_information/basic_information.json} (100%) rename miniprogram/pages/information/{basicInformation/basicInformation.wxml => basic_information/basic_information.wxml} (100%) rename miniprogram/pages/information/{basicInformation/basicInformation.wxss => basic_information/basic_information.wxss} (100%) rename miniprogram/pages/information/{educationExperience/educationExperience.js => education_experience/education_experience.js} (100%) rename miniprogram/pages/information/{educationExperience/educationExperience.json => education_experience/education_experience.json} (100%) rename miniprogram/pages/information/{educationExperience/educationExperience.wxml => education_experience/education_experience.wxml} (100%) rename miniprogram/pages/information/{educationExperience/educationExperience.wxss => education_experience/education_experience.wxss} (100%) rename miniprogram/pages/information/{myTag/myTag.js => my_tag/my_tag.js} (100%) rename miniprogram/pages/information/{myTag/myTag.json => my_tag/my_tag.json} (100%) rename miniprogram/pages/information/{myTag/myTag.wxml => my_tag/my_tag.wxml} (100%) rename miniprogram/pages/information/{myTag/myTag.wxss => my_tag/my_tag.wxss} (100%) rename miniprogram/pages/information/{workingExperience/workingExperience.js => working_experience/working_experience.js} (100%) rename miniprogram/pages/information/{workingExperience/workingExperience.json => working_experience/working_experience.json} (100%) rename miniprogram/pages/information/{workingExperience/workingExperience.wxml => working_experience/working_experience.wxml} (100%) rename miniprogram/pages/information/{workingExperience/workingExperience.wxss => working_experience/working_experience.wxss} (100%) delete mode 100644 miniprogram/pages/invite/invite.js delete mode 100644 miniprogram/pages/invite/invite.json delete mode 100644 miniprogram/pages/invite/invite.wxml delete mode 100644 miniprogram/pages/invite/invite.wxss delete mode 100644 miniprogram/pages/login/login.js delete mode 100644 miniprogram/pages/loginV2/login.js delete mode 100644 miniprogram/pages/loginV2/login.json delete mode 100644 miniprogram/pages/loginV2/login.wxml delete mode 100644 miniprogram/pages/loginV2/login.wxss delete mode 100644 miniprogram/pages/mineV2/mine.js delete mode 100644 miniprogram/pages/mineV2/mine.json delete mode 100644 miniprogram/pages/mineV2/mine.wxml delete mode 100644 miniprogram/pages/mineV2/mine.wxss delete mode 100644 miniprogram/pages/myApplication/myApplication.js delete mode 100644 miniprogram/pages/myApplication/myApplication.json delete mode 100644 miniprogram/pages/myApplication/myApplication.wxml delete mode 100644 miniprogram/pages/myApplication/myApplication.wxss delete mode 100644 miniprogram/pages/myFriend/myFriend.js delete mode 100644 miniprogram/pages/myFriend/myFriend.json delete mode 100644 miniprogram/pages/myFriend/myFriend.wxml delete mode 100644 miniprogram/pages/myFriend/myFriend.wxss delete mode 100644 miniprogram/pages/publish/publish.js delete mode 100644 miniprogram/pages/publish/publish.json delete mode 100644 miniprogram/pages/publish/publish.wxml delete mode 100644 miniprogram/pages/publish/publish.wxss create mode 100644 miniprogram/pages/register/register.js rename miniprogram/pages/{login/login.json => register/register.json} (100%) rename miniprogram/pages/{login/login.wxml => register/register.wxml} (65%) rename miniprogram/pages/{login/login.wxss => register/register.wxss} (100%) delete mode 100644 miniprogram/pages/setting/setting.js delete mode 100644 miniprogram/pages/setting/setting.json delete mode 100644 miniprogram/pages/setting/setting.wxml delete mode 100644 miniprogram/pages/setting/setting.wxss delete mode 100644 miniprogram/pages/square/add/add.js delete mode 100644 miniprogram/pages/square/add/add.json delete mode 100644 miniprogram/pages/square/add/add.wxml delete mode 100644 miniprogram/pages/square/add/add.wxss delete mode 100644 miniprogram/pages/square/detail/detail.js delete mode 100644 miniprogram/pages/square/detail/detail.json delete mode 100644 miniprogram/pages/square/detail/detail.wxml delete mode 100644 miniprogram/pages/square/detail/detail.wxss delete mode 100644 miniprogram/pages/square/square/square.js delete mode 100644 miniprogram/pages/square/square/square.json delete mode 100644 miniprogram/pages/square/square/square.wxml delete mode 100644 miniprogram/pages/square/square/square.wxss diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..40b878d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules/ \ No newline at end of file diff --git a/cloudfunctions/getPhoneNumber/config.json b/cloudfunctions/getPhoneNumber/config.json new file mode 100644 index 0000000..5ecc33e --- /dev/null +++ b/cloudfunctions/getPhoneNumber/config.json @@ -0,0 +1,6 @@ +{ + "permissions": { + "openapi": [ + ] + } +} \ No newline at end of file diff --git a/cloudfunctions/getPhoneNumber/index.js b/cloudfunctions/getPhoneNumber/index.js new file mode 100644 index 0000000..ec1e130 --- /dev/null +++ b/cloudfunctions/getPhoneNumber/index.js @@ -0,0 +1,46 @@ +// 云函数入口文件 +const cloud = require("wx-server-sdk"); +const axios = require("axios"); + +cloud.init({ env: cloud.DYNAMIC_CURRENT_ENV }); // 使用当前云环境 + +// 云函数入口函数 +exports.main = async (event, context) => + new Promise((resolve, reject) => { + const {APP_ID} = cloud.getWXContext(); + const APP_SECRET = "todo" + + const { code } = event; + return new Promise((resolve, reject) => { + axios + .get( + "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + + APP_ID + + "&secret=" + + APP_SECRET + ) + .then((res) => { + // console.log(res); + let token = res.data.access_token; + // console.log(token); + + axios + .post( + "https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=" + + token, + { + code: code, + } + ) + .then((res) => { + resolve(res); + }) + .catch((err) => { + reject(err); + }); + }) + .catch((err) => { + reject(err); + }); + }); + }); diff --git a/cloudfunctions/getPhoneNumber/package-lock.json b/cloudfunctions/getPhoneNumber/package-lock.json new file mode 100644 index 0000000..169a82a --- /dev/null +++ b/cloudfunctions/getPhoneNumber/package-lock.json @@ -0,0 +1,1221 @@ +{ + "name": "getPhoneNumber", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "getPhoneNumber", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "wx-server-sdk": "~2.6.3" + } + }, + "node_modules/@cloudbase/database": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@cloudbase/database/-/database-1.4.1.tgz", + "integrity": "sha512-BYLXHS6c+WhxAvvdak8Z3W+heScqBBPu/CQ76gC8v1Scuy5qf4qxuPWNzyoxde/eZsmc+BRRCFyIq4xUnIot8g==", + "dependencies": { + "bson": "^4.0.3", + "lodash.clonedeep": "4.5.0", + "lodash.set": "4.3.2", + "lodash.unset": "4.5.2" + } + }, + "node_modules/@cloudbase/node-sdk": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/@cloudbase/node-sdk/-/node-sdk-2.9.1.tgz", + "integrity": "sha512-4JGLiy9/Ko7d1pnBgq5mtIUm5v9ig1tHqAeLrkMc8b4vVBRTnYlxJer3uKXq6+9fjLprxNyRSahEg4QR8/Gbkw==", + "dependencies": { + "@cloudbase/database": "1.4.1", + "@cloudbase/signature-nodejs": "1.0.0-beta.0", + "@types/retry": "^0.12.0", + "agentkeepalive": "^4.1.3", + "axios": "^0.21.1", + "is-regex": "^1.0.4", + "jsonwebtoken": "^8.5.1", + "lodash.merge": "^4.6.1", + "request": "^2.87.0", + "request-promise": "^4.2.5", + "retry": "^0.12.0", + "ts-node": "^8.10.2", + "xml2js": "^0.4.19" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/@cloudbase/signature-nodejs": { + "version": "1.0.0-beta.0", + "resolved": "https://registry.npmjs.org/@cloudbase/signature-nodejs/-/signature-nodejs-1.0.0-beta.0.tgz", + "integrity": "sha512-gpKqwsVk/D2PzvFamYNReymXSdvRSY90eZ1ARf+1wZ8oT6OpK9kr6nmevGykMxN1n17Gn92hBbWqAxU9o3+kAQ==", + "dependencies": { + "@types/clone": "^0.1.30", + "clone": "^2.1.2", + "is-stream": "^2.0.0", + "url": "^0.11.0" + } + }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" + }, + "node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" + }, + "node_modules/@types/clone": { + "version": "0.1.30", + "resolved": "https://registry.npmjs.org/@types/clone/-/clone-0.1.30.tgz", + "integrity": "sha512-vcxBr+ybljeSiasmdke1cQ9ICxoEwaBgM1OQ/P5h4MPj/kRyLcDl5L8PrftlbyV1kBbJIs3M3x1A1+rcWd4mEA==" + }, + "node_modules/@types/long": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", + "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==" + }, + "node_modules/@types/node": { + "version": "20.7.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.7.1.tgz", + "integrity": "sha512-LT+OIXpp2kj4E2S/p91BMe+VgGX2+lfO+XTpfXhh+bCk2LkQtHZSub8ewFBMGP5ClysPjTDFa4sMI8Q3n4T0wg==" + }, + "node_modules/@types/retry": { + "version": "0.12.3", + "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.3.tgz", + "integrity": "sha512-rkxEZUFIyDEZhC6EfHz6Hwos2zXewCOLBzhdgv7D55qu4OAySNwDZzxbaMpFI6XthdBa5oHhR5s6/9MSuTfw4g==" + }, + "node_modules/agentkeepalive": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.5.0.tgz", + "integrity": "sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==", + "dependencies": { + "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==" + }, + "node_modules/asn1": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", + "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", + "dependencies": { + "safer-buffer": "~2.1.0" + } + }, + "node_modules/assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "node_modules/aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", + "engines": { + "node": "*" + } + }, + "node_modules/aws4": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz", + "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==" + }, + "node_modules/axios": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", + "dependencies": { + "follow-redirects": "^1.14.0" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", + "dependencies": { + "tweetnacl": "^0.14.3" + } + }, + "node_modules/bignumber.js": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", + "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", + "engines": { + "node": "*" + } + }, + "node_modules/bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" + }, + "node_modules/bson": { + "version": "4.7.2", + "resolved": "https://registry.npmjs.org/bson/-/bson-4.7.2.tgz", + "integrity": "sha512-Ry9wCtIZ5kGqkJoi6aD8KjxFZEx78guTQDnpXWiNthsxzrxAK/i8E6pCHAIZTbaEFWcOCvbecMukfK7XUvyLpQ==", + "dependencies": { + "buffer": "^5.6.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" + }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==" + }, + "node_modules/clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==" + }, + "node_modules/dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", + "dependencies": { + "assert-plus": "^1.0.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", + "dependencies": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "node_modules/extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", + "engines": [ + "node >=0.6.0" + ] + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + }, + "node_modules/follow-redirects": { + "version": "1.15.3", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz", + "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", + "engines": { + "node": "*" + } + }, + "node_modules/form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 0.12" + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "node_modules/get-intrinsic": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", + "dependencies": { + "assert-plus": "^1.0.0" + } + }, + "node_modules/har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", + "engines": { + "node": ">=4" + } + }, + "node_modules/har-validator": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "deprecated": "this library is no longer supported", + "dependencies": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", + "dependencies": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + }, + "engines": { + "node": ">=0.8", + "npm": ">=1.3.7" + } + }, + "node_modules/humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", + "dependencies": { + "ms": "^2.0.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==" + }, + "node_modules/isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==" + }, + "node_modules/jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==" + }, + "node_modules/json-bigint": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", + "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", + "dependencies": { + "bignumber.js": "^9.0.0" + } + }, + "node_modules/json-schema": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==" + }, + "node_modules/jsonwebtoken": { + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", + "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==", + "dependencies": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^5.6.0" + }, + "engines": { + "node": ">=4", + "npm": ">=1.4.28" + } + }, + "node_modules/jsprim": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", + "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", + "dependencies": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.4.0", + "verror": "1.10.0" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "dependencies": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==" + }, + "node_modules/lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==" + }, + "node_modules/lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==" + }, + "node_modules/lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==" + }, + "node_modules/lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==" + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + }, + "node_modules/lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==" + }, + "node_modules/lodash.set": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz", + "integrity": "sha512-4hNPN5jlm/N/HLMCO43v8BXKq9Z7QdAGc/VGrRD61w8gN9g/6jF9A4L1pbUgBLCffi0w9VsXfTOij5x8iTyFvg==" + }, + "node_modules/lodash.unset": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/lodash.unset/-/lodash.unset-4.5.2.tgz", + "integrity": "sha512-bwKX88k2JhCV9D1vtE8+naDKlLiGrSmf8zi/Y9ivFHwbmRfA8RxS/aVJ+sIht2XOwqoNr4xUPUkGZpc1sHFEKg==" + }, + "node_modules/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==" + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "engines": { + "node": "*" + } + }, + "node_modules/object-inspect": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==" + }, + "node_modules/protobufjs": { + "version": "6.11.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", + "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", + "hasInstallScript": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.1", + "@types/node": ">=13.7.0", + "long": "^4.0.0" + }, + "bin": { + "pbjs": "bin/pbjs", + "pbts": "bin/pbts" + } + }, + "node_modules/psl": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", + "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==" + }, + "node_modules/punycode": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "engines": { + "node": ">=6" + } + }, + "node_modules/qs": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", + "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", + "dependencies": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/request-promise": { + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/request-promise/-/request-promise-4.2.6.tgz", + "integrity": "sha512-HCHI3DJJUakkOr8fNoCc73E5nU5bqITjOYFMDrKHYOXWXrgD/SBaC7LjwuPymUprRyuF06UK7hd/lMHkmUXglQ==", + "deprecated": "request-promise has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142", + "dependencies": { + "bluebird": "^3.5.0", + "request-promise-core": "1.1.4", + "stealthy-require": "^1.1.1", + "tough-cookie": "^2.3.3" + }, + "engines": { + "node": ">=0.10.0" + }, + "peerDependencies": { + "request": "^2.34" + } + }, + "node_modules/request-promise-core": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.4.tgz", + "integrity": "sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw==", + "dependencies": { + "lodash": "^4.17.19" + }, + "engines": { + "node": ">=0.10.0" + }, + "peerDependencies": { + "request": "^2.34" + } + }, + "node_modules/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", + "engines": { + "node": ">= 4" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/sax": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.3.0.tgz", + "integrity": "sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==" + }, + "node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/sshpk": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", + "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", + "dependencies": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + }, + "bin": { + "sshpk-conv": "bin/sshpk-conv", + "sshpk-sign": "bin/sshpk-sign", + "sshpk-verify": "bin/sshpk-verify" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/stealthy-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", + "integrity": "sha512-ZnWpYnYugiOVEY5GkcuJK1io5V8QmNYChG62gSit9pQVGErXtrKuPC55ITaVSukmMta5qpMU7vqLt2Lnni4f/g==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tcb-admin-node": { + "version": "1.23.0", + "resolved": "https://registry.npmjs.org/tcb-admin-node/-/tcb-admin-node-1.23.0.tgz", + "integrity": "sha512-SAbjTqMsSi63SId1BJ4kWdyGJzhxh9Tjvy3YXxcsoaAC2PtASn4UIYsBsiNEUfcn58QEn2tdvCvvf69WLLjjrg==", + "dependencies": { + "@cloudbase/database": "0.9.15", + "@cloudbase/signature-nodejs": "^1.0.0-beta.0", + "is-regex": "^1.0.4", + "jsonwebtoken": "^8.5.1", + "lodash.merge": "^4.6.1", + "request": "^2.87.0", + "xml2js": "^0.4.19" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/tcb-admin-node/node_modules/@cloudbase/database": { + "version": "0.9.15", + "resolved": "https://registry.npmjs.org/@cloudbase/database/-/database-0.9.15.tgz", + "integrity": "sha512-63e7iIl+van41B39Tw4ScNe9TRCt+5GHjc7q6i8NzkWBLC3U3KlbWo79YHsUHUPI79POpQ8UMlMVo7HXIAO3dg==", + "dependencies": { + "bson": "^4.0.2", + "lodash.clonedeep": "4.5.0", + "lodash.set": "4.3.2", + "lodash.unset": "4.5.2" + } + }, + "node_modules/tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dependencies": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/ts-node": { + "version": "8.10.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.10.2.tgz", + "integrity": "sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA==", + "dependencies": { + "arg": "^4.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "source-map-support": "^0.5.17", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "engines": { + "node": ">=6.0.0" + }, + "peerDependencies": { + "typescript": ">=2.7" + } + }, + "node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==" + }, + "node_modules/typescript": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/url": { + "version": "0.11.3", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.3.tgz", + "integrity": "sha512-6hxOLGfZASQK/cijlZnZJTq8OXAkt/3YGfQX45vvMYXpZoo8NdWZcY73K108Jf759lS1Bv/8wXnHDTSz17dSRw==", + "dependencies": { + "punycode": "^1.4.1", + "qs": "^6.11.2" + } + }, + "node_modules/url/node_modules/punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==" + }, + "node_modules/url/node_modules/qs": { + "version": "6.11.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.2.tgz", + "integrity": "sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", + "bin": { + "uuid": "bin/uuid" + } + }, + "node_modules/verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", + "engines": [ + "node >=0.6.0" + ], + "dependencies": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "node_modules/wx-server-sdk": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/wx-server-sdk/-/wx-server-sdk-2.6.3.tgz", + "integrity": "sha512-wCSAO94HScMVnalb4WVbOqjTyKxus4/jPYV41ct9liHXv/hGGlDqUWV1vb1icyQKXp+mSslvpBNNjYnZAM5MVA==", + "dependencies": { + "@cloudbase/node-sdk": "2.9.1", + "json-bigint": "^1.0.0", + "protobufjs": "^6.8.8", + "tcb-admin-node": "latest", + "tslib": "^1.9.3" + } + }, + "node_modules/xml2js": { + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", + "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==", + "dependencies": { + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/xmlbuilder": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "engines": { + "node": ">=6" + } + } + } +} diff --git a/cloudfunctions/getPhoneNumber/package.json b/cloudfunctions/getPhoneNumber/package.json new file mode 100644 index 0000000..a4365aa --- /dev/null +++ b/cloudfunctions/getPhoneNumber/package.json @@ -0,0 +1,14 @@ +{ + "name": "getPhoneNumber", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "wx-server-sdk": "~2.6.3" + } +} \ No newline at end of file diff --git a/miniprogram/app.js b/miniprogram/app.js index 438819a..29a5c83 100644 --- a/miniprogram/app.js +++ b/miniprogram/app.js @@ -12,23 +12,52 @@ App({ } else { wx.cloud.init({ traceUser: true, + env: "string-project-1gzuomj8360b6ac3", }); } - this.push = require("/manager/Push"); + let that = this; + wx.cloud.callFunction({ + name: "login", + success: (res) => { + that.globalData.openId = res.result.openid; - // 登录态判断 - this.globalData.userInfo = - wx.getStorageSync("userInfo") == "" - ? null - : wx.getStorageSync("userInfo"); - this.globalData.partnerInfo = - wx.getStorageSync("partnerInfo") == "" - ? null - : wx.getStorageSync("partnerInfo"); + // 数据库中查询 + wx.cloud + .database() + .collection("users") + .where({ + _openid: that.globalData.openId, + }) + .get() + .then((res) => { + if (res.data.length != 0) { + that.globalData.userInfo = res.data[0]; + } + that.globalData.needReloadData = true; + if (that.globalData.reloadCallback) { + that.globalData.reloadCallback(); + } + }) + .catch((err) => { + console.log(err); + wx.showModal({ + title: "登录失败", + content: "请检查网络连接", + }); + }); + }, + fail: (err) => { + console.log(err); + wx.showModal({ + title: "登录失败", + content: "请检查网络连接", + }); + return; + }, + }); // iPhoneX 判断 - let that = this; wx.getSystemInfo({ success: function (res) { //model中包含着设备信息 @@ -50,48 +79,20 @@ App({ }); }, - /** - * 后台监听 - */ - onHide: function () { - this.uploadFormID(); - }, - - /** - * 上传token - */ - uploadFormID: function () { - let ids = this.globalData.formIds; - - if (ids.length == 0) { - return; - } - - let formId = ids.pop(); - - this.push - .upload(formId) - .then((res) => { - console.log("上传formID:", formId); - this.uploadFormID(); - }) - .catch((err) => { - console.log(err); - }); - }, - globalData: { iPhoneX: false, navHeight: 0, headerHeight: 0, tabBarHeight: 0, + openId: null, userInfo: null, - partnerInfo: null, + // partnerInfo: null, needReloadData: false, // 新添加数据之后做一个标示,方便首页刷新 - needReloadPartner: true, // 需要刷新小伙伴信息 - habitAmount: -1, // 已经添加习惯数量 + reloadCallback: null, + // needReloadPartner: true, // 需要刷新小伙伴信息 + // habitAmount: -1, // 已经添加习惯数量 theme: "default", // 主题 - formIds: [], // 表单ID, - habits: [], // habits _id <=> habit + // formIds: [], // 表单ID, + // habits: [], // habits _id <=> habit }, }); diff --git a/miniprogram/app.json b/miniprogram/app.json index 033092c..08f809a 100644 --- a/miniprogram/app.json +++ b/miniprogram/app.json @@ -1,33 +1,14 @@ { "pages": [ - "pages/information/educationExperience/educationExperience", "pages/search/search_home/search_home", "pages/information/mainpage/mainpage", - "pages/login/login", + "pages/information/education_experience/education_experiencb", + "pages/register/register", "pages/search/search_input/search_input", "pages/mine/mine", - "pages/information/basicInformation/basicInformation", - "pages/information/workingExperience/workingExperience", - "pages/information/myTag/myTag", - "pages/myFriend/myFriend", - "pages/loginV2/login", - "pages/myApplication/myApplication", - "pages/applicationReceived/applicationReceived", - "pages/publish/publish", - "pages/square/square/square", - "pages/mineV2/mine", - "pages/indexV2/index", - "pages/setting/setting", - "pages/award/award/award", - "pages/invite/invite", - "pages/award/add/add", - "pages/square/detail/detail", - "pages/square/add/add", - "pages/addV2/add", - "pages/calendar/calendar", - "pages/about/about", - "pages/info/index", - "pages/info/infoUpdate/infoUpdate" + "pages/information/basic_information/basic_information", + "pages/information/working_experience/working_experience", + "pages/information/my_tag/my_tag" ], "window": { "navigationBarBackgroundColor": "#fff", diff --git a/miniprogram/pages/about/about.js b/miniprogram/pages/about/about.js deleted file mode 100644 index f12545f..0000000 --- a/miniprogram/pages/about/about.js +++ /dev/null @@ -1,67 +0,0 @@ -// pages/about/about.js -const app = getApp(); - -const TYPE = { - ABOUT_ZERO: "zero", // 关于作者 - TUTORIAL: "tutorial", // 使用教程 - DEV_LOG: "log", // 开发日记 -}; - -Page({ - /** - * 页面的初始数据 - */ - data: { - type: TYPE.ABOUT_ZERO, - - text: app.text.about, - headerHeight: app.globalData.navHeight + 20, - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - let type = options.type; - if (type == null) { - type = TYPE.ABOUT_ZERO; - } - - if (type == TYPE.DEV_LOG) { - // 开发日记 播放音乐 - - wx.showToast({ - title: "该页面有背景音乐,请注意调整音量", - icon: "none", - duration: 2000, - }); - - wx.playBackgroundAudio({ - dataUrl: "http://music.163.com/song/media/outer/url?id=17177324.mp3", - }); - } - - this.setData({ - type: type, - }); - }, - - /** - * 复制内容 - */ - copy: function (e) { - let data = ""; - - if (this.data.type == TYPE.ABOUT_ZERO) { - data = "110444480"; - } - - wx.setClipboardData({ - data: data, - }); - }, - - onUnload: function () { - wx.stopBackgroundAudio(); - }, -}); diff --git a/miniprogram/pages/about/about.json b/miniprogram/pages/about/about.json deleted file mode 100644 index a97367d..0000000 --- a/miniprogram/pages/about/about.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "usingComponents": {} -} diff --git a/miniprogram/pages/about/about.wxml b/miniprogram/pages/about/about.wxml deleted file mode 100644 index 78f2cc8..0000000 --- a/miniprogram/pages/about/about.wxml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - 吧啦吧啦 - - - - - - - {{ text.zero.title }} - {{ text.zero.content }} - - - - - - - - diff --git a/miniprogram/pages/about/about.wxss b/miniprogram/pages/about/about.wxss deleted file mode 100644 index 5c6fb67..0000000 --- a/miniprogram/pages/about/about.wxss +++ /dev/null @@ -1,55 +0,0 @@ -/* pages/about/about.wxss */ -@import "/Mango/Animation/mango.wxss"; - -page { - background: #f5f5f5; -} - -.interval { - width: 90vw; - margin: 0 5vw; -} - -.main { - background: white; - border-radius: 20rpx; - overflow: hidden; - - display: flex; - flex-direction: column; - justify-content: flex-start; - align-items: center; -} - -.body .image { - width: 100%; -} - -.body .content { - box-sizing: border-box; - -webkit-box-sizing: border-box; - - padding: 50rpx; - - display: flex; - flex-direction: column; - justify-content: flex-start; - align-items: center; -} - -.content-title { - font-size: 50rpx; - padding: 50rpx 0 20rpx; -} - -.content-text { - font-size: 30rpx; - font-weight: 300; -} - -.content-avatar { - width: 120rpx; - height: 120rpx; - - border-radius: 50%; -} diff --git a/miniprogram/pages/addV2/add.js b/miniprogram/pages/addV2/add.js deleted file mode 100644 index d9472da..0000000 --- a/miniprogram/pages/addV2/add.js +++ /dev/null @@ -1,313 +0,0 @@ -// pages/add/add.js -import Habit from "../../manager/Habit.js"; - -const app = getApp(); - -Page({ - /** - * 页面的初始数据 - */ - data: { - headerHeight: app.globalData.navHeight + 20, - iPhoneX: false, - icon: [], - weekday: ["一", "二", "三", "四", "五", "六", "日"], - weekday_bool: [true, true, true, true, true, true, true], - date: null, - - title: "", - selected_icon: 1, - selected_weekday: 0, - end_time: null, - share: false, - - // 编辑 - edit_id: null, - text: app.text.add, - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - let icon = []; - for (let i = 0; i < 2; i++) { - icon[i] = []; - for (let j = 1; j <= 24; j++) { - icon[i].push(i * 24 + j); - } - } - - let selected_weekday = 0; - for (let i = 0; i < 7; i++) { - selected_weekday += 1 << i; - } - - this.setData({ - iPhoneX: app.globalData.iPhoneX, - icon: icon, - selected_weekday: selected_weekday, - }); - - this.toast = this.selectComponent("#toast"); - - if (options.id != null) { - this.setData({ - edit_id: options.id, - }); - - this.loadHabit(); - - return; - } - - this.habitAmount(); - }, - - /** - * 习惯名字 - */ - nameInput: function (e) { - let value = e.detail.value; - - if (value.length >= 10) { - wx.showToast({ - title: this.data.text.nameLength, - icon: "none", - }); - } - - this.setData({ - title: value, - }); - }, - - /** - * 选择icon - */ - selectIcon: function (e) { - this.setData({ - selected_icon: e.currentTarget.dataset.id, - }); - }, - - /** - * 选择每周的第几天 - */ - selectDay: function (e) { - let index = parseInt(e.currentTarget.dataset.index); - let offset = parseInt(e.currentTarget.dataset.offset); - - let day_bool = this.data.weekday_bool; - let selected_weekday = this.data.selected_weekday; - - offset *= day_bool[index] ? -1 : 1; - - selected_weekday += offset; - day_bool[index] = !day_bool[index]; - - this.setData({ - weekday_bool: day_bool, - selected_weekday: selected_weekday, - }); - }, - - /** - * 是否共享 - */ - shareChange: function (e) { - this.setData({ - share: e.detail.value, - }); - }, - - /** - * 选择截止日期 - */ - bindDateChange: function (e) { - console.log(e.detail.value); - - let time = new Date(new Date().setHours(0, 0, 0, 0)).getTime(); - - if (new Date(e.detail.value).getTime() < time) { - this.setData({ - date: app.util.formatTime(new Date(), false), - }); - - this.toast.showWarning(this.data.text.dateError); - - return; - } - - this.setData({ - date: e.detail.value, - end_time: e.detail.value, - }); - }, - - /** - * save - */ - save: function () { - if (this.data.title.length == 0 || this.data.selected_weekday == 0) { - this.toast.showWarning(this.data.text.saveError); - return; - } - - let data = { - title: this.data.title, - icon: this.data.selected_icon, - weekday: this.data.selected_weekday, - end_time: this.data.end_time, - share: this.data.share, - }; - - this.toast.showLoading(); - if (this.data.edit_id) { - data.end_time = data.end_time == null ? null : new Date(data.end_time); - Habit.update(this.data.edit_id, data) - .then((res) => { - this.toast.showSuccess(); - - app.globalData.needReloadData = true; - - wx.switchTab({ - url: "/pages/mineV2/mine", - }); - }) - .catch((err) => { - this.toast.showFailure(err); - }); - } else { - Habit.add(data) - .then((res) => { - this.toast.showSuccess(); - - app.globalData.needReloadData = true; - app.globalData.habitAmount = app.globalData.habitAmount + 1; - - wx.switchTab({ - url: "/pages/mineV2/mine", - }); - }) - .catch((err) => { - this.toast.showFailure(err); - }); - } - }, - - /** - * 习惯数量获取 - */ - habitAmount: function () { - let maxAmount = 20; - - if (app.globalData.habitAmount == -1) { - this.toast.showLoading(); - Habit.count(app.globalData.userInfo._openid) - .then((res) => { - this.toast.hideLoading(); - - app.globalData.habitAmount = res; - if (res >= maxAmount) { - wx.showModal({ - title: this.data.text.manyTitle, - content: this.data.text.manyContent, - showCancel: false, - success: function (res) { - wx.navigateBack({ - delta: 1, - }); - }, - }); - } - }) - .catch((err) => { - this.toast.showFailure(app.text.sys.netError); - }); - } else if (app.globalData.habitAmount >= maxAmount) { - wx.showModal({ - title: this.data.text.manyTitle, - content: this.data.text.manyContent, - showCancel: false, - success: function (res) { - wx.navigateBack({ - delta: 1, - }); - }, - }); - } - }, - - /** - * 编辑状态加载数据 - */ - loadHabit: function () { - this.toast.showLoading(); - Habit.detail(this.data.edit_id) - .then((res) => { - this.toast.hideLoading(); - this.setData({ - title: res.title, - selected_icon: res.icon, - selected_weekday: res.weekday, - weekday_bool: this.weekDayChange(res.weekday), - date: - res.end_time == null - ? null - : app.util.formatTime(res.end_time, false), - end_time: res.end_time, - share: res.share, - }); - }) - .catch((err) => { - this.toast.showFailure(err); - }); - }, - - /** - * 删除习惯 - */ - del: function () { - let that = this; - wx.showModal({ - title: this.data.text.delTitle, - content: this.data.text.delContent, - success: function (res) { - if (res.confirm) { - that.toast.showLoading(); - Habit.del(that.data.edit_id) - .then((res) => { - that.toast.showSuccess(that.data.text.delSuccess); - - app.globalData.needReloadData = true; - app.globalData.habitAmount = app.globalData.habitAmount - 1; - - setTimeout(() => { - wx.switchTab({ - url: "/pages/mineV2/mine", - }); - }, 1000); - }) - .catch((err) => { - that.toast.showFailure(err); - }); - } - }, - }); - }, - - /** - * 每周相关转换 - */ - weekDayChange: function (number) { - let array = [false, false, false, false, false, false, false]; - let index = 0; - number = number.toString(2); - for (let i = number.length - 1; i >= 0; i--) { - array[index++] = number[i] == 1; - } - - return array; - }, -}); diff --git a/miniprogram/pages/addV2/add.json b/miniprogram/pages/addV2/add.json deleted file mode 100644 index a97367d..0000000 --- a/miniprogram/pages/addV2/add.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "usingComponents": {} -} diff --git a/miniprogram/pages/addV2/add.wxml b/miniprogram/pages/addV2/add.wxml deleted file mode 100644 index e8158b4..0000000 --- a/miniprogram/pages/addV2/add.wxml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - {{ text.iconTip }} - - - - - - - - - - - - - - - - {{ text.nameTip }} - - - - - - {{ text.beginTip }} - - {{ item }} - - - - - - - - {{ text.endTip }} - - - - - - - - - - - - - - - - - {{ text.finish }} - - - - - {{ text.delete }} - - - - - {{ text.egg }} - {{ text.mango }} - \ No newline at end of file diff --git a/miniprogram/pages/addV2/add.wxss b/miniprogram/pages/addV2/add.wxss deleted file mode 100644 index df62cbb..0000000 --- a/miniprogram/pages/addV2/add.wxss +++ /dev/null @@ -1,140 +0,0 @@ -/* pages/addV2/add.wxss */ -page { - background: #f5f5f5; -} - -.interval { - margin-left: 5vw; - width: 90vw; - border-radius: 20rpx; -} - -.body { - height: auto; -} - -/* 图标 */ - -.icon-body { - width: 90vw; - border-radius: 20rpx; - height: 70vw; /* 15 * 4 + 10*/ - background: white; -} - -.flag-icon { - width: 10vw; - height: 10vw; - margin: 2.5vw; - float: left; - border-radius: 10rpx; -} - -.flag-icon-bg { - background: #f5f5f5; -} - -.light-gray-bg { - background: lightgray; -} - -.flag-icon image { - width: 6vw; - height: 6vw; - margin: 2vw; -} - -/* 更多 */ -.other { - margin: 50rpx 0; - border-radius: 20rpx; - width: 90vw; - background: white; - box-sizing: border-box; - -webkit-box-sizing: border-box; - padding: 50rpx 20rpx; -} - -.flag-name-text { - margin-top: 0rpx; -} - -.flag-name { - font-size: 28rpx; - background: #f5f5f5; - height: 70rpx; - padding: 0 20rpx; - border-radius: 10rpx; -} - -.flag-date { - width: 10vw; - height: 10vw; - margin: 0 1vw; - border-radius: 6vw; - float: left; - text-align: center; - line-height: 10vw; - font-size: 30rpx; -} - -.date-on { - color: white; -} - -.flag-date-bg { - background: #f5f5f5; -} - -.no-block { - display: block; - float: left; -} - -.share-switch { - padding: 50rpx 30rpx 20rpx; -} - -.finish-btn, -.del-btn { - width: 50vw; - height: 100rpx; - line-height: 100rpx; - text-align: center; - border-radius: 10rpx; - font-size: 35rpx; - margin: 0 auto; - color: white; -} - -.del-btn { - background: #e64340; - color: white; -} - -.btn-bg { - height: 150rpx; - padding-top: 50rpx; - /* margin: 50rpx auto 150rpx; */ -} - -/* egg */ -.egg { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; -} - -.egg text { - font-size: 25rpx; - text-align: center; -} - -.egg-1 { - color: lightgray; -} - -.egg-2 { - color: #f1f1f1; -} diff --git a/miniprogram/pages/applicationReceived/applicationReceived.js b/miniprogram/pages/applicationReceived/applicationReceived.js deleted file mode 100644 index dd347df..0000000 --- a/miniprogram/pages/applicationReceived/applicationReceived.js +++ /dev/null @@ -1,88 +0,0 @@ -Page({ - // 页面数据 - data: { - // 搜索相关的data - inputFocus: false, // 聚焦 - inputValue: "", // 输入值 - allSearchResult: [ - { iconPath: "/images/search/defaultAvatar.svg", name: "Bill Gates" }, - { iconPath: "/images/search/defaultAvatar.svg", name: "周鸿祎" }, - { - iconPath: "/images/search/defaultAvatar.svg", - name: "Xiaoping (Bob) Xu", - }, - { iconPath: "/images/search/defaultAvatar.svg", name: "张三" }, - { iconPath: "/images/search/defaultAvatar.svg", name: "欧阳娜娜" }, - { - iconPath: "/images/search/defaultAvatar.svg", - name: "Harper Seven Becklyxxxx", - }, - ], // 大家都在搜 - historyResult: ["阿里巴巴+王华", "腾讯+张客人+PM"], // 历史记录 - searchNum: "4", // 搜索结果个数 - searchResult: [ - { - name: "李华", - job: "武侯分社-签证专员", - location: "四川省 成都", - company: "成都中港国际旅行社", - companyIcon: "/images/search/defaultCompany.svg", - }, - { name: "李华", job: "--", location: "", company: "", companyIcon: "" }, - { - name: "李华", - job: "PCG - 视觉设计师", - location: "", - company: "腾讯", - companyIcon: "/images/search/Tencent.png", - }, - { - name: "李华", - job: "运营部 - 产品运营", - location: "中国", - company: "", - companyIcon: "", - }, - ], - // Swiper相关的data - swiperHidden: false, - information: [1, 2, 3], - }, - - // onShow函数 - // onShow: function() { - - // if (typeof this.getTabBar === 'function' && this.getTabBar()) { - // this.getTabBar().setData({ - // selected: 0, - // page: this - // }); - // } - - // this.setData({ - // page: 0, - // }); - // }, - - // // 当点击伪搜索框时触发 - // bindInputFocus: function(e) { - // this.setData({ - // inputFocus: true, - // }); - // }, - - // // 当真搜索框失去焦点时触发 - // bindInputBlur: function(e) { - // this.setData({ - // inputFocus:false, - // }); - // }, - - // // 输入完成触发 - // bindInput: function(e) { - // var val = e.detail.value; - // this.setData({ - // inputValue: val - // }); - // } -}); diff --git a/miniprogram/pages/applicationReceived/applicationReceived.json b/miniprogram/pages/applicationReceived/applicationReceived.json deleted file mode 100644 index b33bb26..0000000 --- a/miniprogram/pages/applicationReceived/applicationReceived.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "usingComponents": {}, - "navigationBarTitleText": "我收到的申请", - "navigationBarTextStyle": "black" -} diff --git a/miniprogram/pages/applicationReceived/applicationReceived.wxml b/miniprogram/pages/applicationReceived/applicationReceived.wxml deleted file mode 100644 index 179c73c..0000000 --- a/miniprogram/pages/applicationReceived/applicationReceived.wxml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - {{item.name}} - {{item.job}} - - - {{item.location}} - - - - {{item.company}} - - - - - - - - diff --git a/miniprogram/pages/applicationReceived/applicationReceived.wxss b/miniprogram/pages/applicationReceived/applicationReceived.wxss deleted file mode 100644 index 1496932..0000000 --- a/miniprogram/pages/applicationReceived/applicationReceived.wxss +++ /dev/null @@ -1,547 +0,0 @@ -page { - background: #ffffff; -} - -.head { - position: absolute; - width: 100vw; - height: 34.95vh; - - z-index: 1; - background: #4f71be; -} - -/* 弦计划中文 */ -/* .stringChinese { - position: absolute; - width: 34.87vw; - height: 4.15vh; - left: 6.15vw; - top: 6.75vh; - - font-family: PingFang SC; - font-style: normal; - font-weight: 500; - font-size: 2.96vh; - line-height: 4.15vh; - - color: #FFFFFF; -} */ -/* 弦计划英文 */ -/* .stringEnglish { - position: absolute; - width: 55.13vw; - height: 3.2vh; - left: 6.15vw; - top: 10.9vh; - - font-family: Noto Sans; - font-style: normal; - font-weight: 300; - font-size: 2.37vh; - line-height: 3.2vh; - - color: #FFFFFF; -} */ - -/* 相关结果 */ -/* .resultView { - position: absolute; - display: flex; - justify-content: space-between; - align-items: center; - width: 87.69vw; - height: 2.49vh; - left: 6.15vw; - top: 24.76vh; -} - -.searchResultView { - position: absolute; - width: 100vw; - height: 52.73vh; - left: 0px; - top: 28.79vh; - display: flex; - flex-direction: column; - border-top: 0.12vh solid #F0F0F0; -} -.searchResultItem { - width: 100vw; - height: auto; - display: flex; - align-items: center; - border-bottom: 0.12vh solid #F0F0F0; - flex-direction: row; -} -.iconCircle { - display: flex; - width: 12.31vw; - height: 5.68vh; - margin-top: 1.66vh; - margin-left: 6.15vw; - margin-right: 6.15vw; - border-radius: 50%; - background: #F2F2F2; - align-self: flex-start; - align-items: center; - justify-content: center; -} */ - -.amountBg { - height: 180rpx; - background-color: #4f71be; - display: flex; - flex-direction: row; - align-items: center; -} -.Title { - color: #ffffff; - display: flex; - width: 100%; - flex-direction: row; - justify-content: center; -} -.img { - margin-left: 20px; -} -.account { - width: 70%; - color: #ffffff; - margin-left: 10px; -} -.nav { - /* width: 40%; */ - text-align: right; - margin-left: 15px; - color: #ffffff; -} -.clear { - padding-top: 70px; - background-color: #4f71be; -} -.item { - background-color: #ffffff; - display: flex; - flex-direction: row; - height: 50px; - align-items: center; -} -.icon { - width: 50px; - text-align: center; -} -.itemName { - width: 40%; - font-size: 14px; - font-weight: bold; -} -.line { - height: 10px; -} -.hr { - height: 1px; - background-color: #cccccc; - opacity: 0.2; -} -.remark { - font-weight: normal; - margin-top: 5px; -} -.right { - width: 40%; - text-align: right; -} -.opr { - color: #5495e6; - font-size: 13px; - font-weight: bold; - margin-right: 10px; -} - -page { - background: #ffffff; -} -/* 顶部 */ -.head { - position: absolute; - width: 100vw; - height: 34.95vh; - - z-index: 1; - background: #4f71be; -} -.headFocus { - position: absolute; - width: 100vw; - height: 19.79vh; - - z-index: 1; - background: #4f71be; -} -/* 弦计划中文 */ -.stringChinese { - position: absolute; - width: 34.87vw; - height: 4.15vh; - left: 6.15vw; - top: 6.75vh; - - /* font-family: PingFang SC; */ - font-style: normal; - font-weight: 500; - font-size: 2.96vh; - line-height: 4.15vh; - - color: #ffffff; -} -/* 弦计划英文 */ -.stringEnglish { - position: absolute; - width: 55.13vw; - height: 3.2vh; - left: 6.15vw; - top: 10.9vh; - - font-family: Noto Sans; - font-style: normal; - font-weight: 300; - font-size: 2.37vh; - line-height: 3.2vh; - - color: #ffffff; -} -/* Swiper相关的样式 */ -.swiper { - position: absolute; - height: 12.91vh; - top: 16.94vh; - width: 100vw; -} -.information { - height: 12.91vh; - width: 87.69vw; - background: #7293dd; - border-radius: 2.56vw; -} -/* 搜索框 */ -.searchBar { - position: absolute; - width: 87.69vw; - height: 5.57vh; - left: 6.15vw; - top: 32.11vh; - - z-index: 2; - background: #ffffff; - border: 1px solid #4f71be; - box-sizing: border-box; - border-radius: 2.56vw; - - display: flex; - flex-direction: row; - align-items: center; /**子view垂直居中*/ - vertical-align: center; /**垂直居中*/ -} -.searchBarFocus { - position: absolute; - width: 87.69vw; - height: 5.57vh; - left: 6.15vw; - top: 16.94vh; - - z-index: 2; - background: #ffffff; - border: 1px solid #4f71be; - box-sizing: border-box; - border-radius: 2.56vw; - - display: flex; - flex-direction: row; - align-items: center; /**子view垂直居中*/ - vertical-align: center; /**垂直居中*/ -} -.placeholder { - /* font-family: PingFang SC; */ - font-style: normal; - font-weight: normal; - font-size: 1.78vh; - line-height: 2.49vh; - - color: #c4c4c4; -} -.inputText { - /* font-family: PingFang SC; */ - font-style: normal; - font-weight: normal; - font-size: 1.78vh; - line-height: 2.49vh; - - color: rgba(0, 0, 0, 0.9); -} -/* 大家都在搜 */ -.allSearchView { - position: absolute; - display: flex; - justify-content: space-between; - align-items: center; - width: 87.69vw; - height: 2.49vh; - left: 6.15vw; - top: 39.93vh; -} -.allSearch { - width: 21.79vw; - /* font-family: PingFang SC; */ - font-style: normal; - font-weight: normal; - font-size: 1.78vh; - line-height: 2.49vh; - - color: #979797; -} -.allSearchResultView { - position: absolute; - width: 86.92vw; - height: 36.73vh; - left: 6.15vw; - top: 44.43vh; - - display: flex; - flex-wrap: wrap; - justify-content: flex-start; - align-content: flex-start; -} -.allSearchResultItem { - width: auto; - height: 5.57vh; - display: flex; - background: rgba(79, 113, 190, 0.04); - border-radius: 2.56vw; - align-items: center; - justify-content: center; - margin-right: 1.79vw; - margin-bottom: 1.18vh; -} -.allSearchResultText { - margin-right: 3.85vw; - max-width: 37.18vw; - overflow: hidden; - white-space: nowrap; /*不换行*/ - text-overflow: ellipsis; - font-family: Noto Sans; - font-style: normal; - font-weight: normal; - font-size: 1.78vh; - line-height: 2.37vh; - - color: rgba(0, 0, 0, 0.9); -} -/* 换一批 */ -.changeBatchView { - display: flex; - width: 21.79vw; - justify-content: space-between; - align-items: center; -} -.changeBatchIcon { - margin-left: 3.85vw; - width: 33.69rpx; - height: 33.69rpx; -} -.changeBatchText { - /* font-family: PingFang SC; */ - font-style: normal; - font-weight: normal; - font-size: 1.78vh; - line-height: 2.49vh; - - text-align: right; - - color: #979797; -} -/* 搜索提示 */ -.searchTipsView { - position: absolute; - width: 100vw; - height: 2.13vh; - left: 0; - top: 23.93vh; - - display: flex; - justify-content: center; - align-items: center; -} -.searchTips { - /* font-family: Noto Sans; */ - font-style: normal; - font-weight: normal; - font-size: 1.54vh; - line-height: 2.13vh; - text-align: center; - - color: #dadada; -} -/* 搜索历史 */ -.searchHistoryView { - position: absolute; - width: 85px; - height: 21px; - left: 24px; - top: 239px; -} -.searchHistoryText { - font-family: PingFang SC; - font-style: normal; - font-weight: normal; - font-size: 15px; - line-height: 21px; - - color: #979797; -} -.historyResultView { - position: absolute; - width: 86.92vw; - height: 36.73vh; - left: 6.15vw; - top: 32.82vh; - - display: flex; - flex-wrap: wrap; - justify-content: flex-start; - align-content: flex-start; -} -/* 相关结果 */ -.resultView { - position: absolute; - display: flex; - justify-content: space-between; - align-items: center; - width: 87.69vw; - height: 2.49vh; - left: 6.15vw; - top: 24.76vh; -} -.result { - width: 100%; - /* font-family: PingFang SC; */ - font-style: normal; - font-weight: normal; - font-size: 1.78vh; - line-height: 2.49vh; - - color: #979797; -} -.searchResultView { - position: absolute; - width: 100vw; - height: 52.73vh; - left: 0px; - /* top: 28.79vh; */ - display: flex; - flex-direction: column; - border-top: 0.12vh solid #f0f0f0; -} -.searchResultItem { - width: 100vw; - height: auto; - display: flex; - align-items: center; - border-bottom: 0.12vh solid #f0f0f0; - flex-direction: row; -} -.iconCircle { - display: flex; - width: 12.31vw; - height: 5.68vh; - margin-top: 1.66vh; - margin-left: 6.15vw; - margin-right: 6.15vw; - border-radius: 50%; - background: #f2f2f2; - align-self: flex-start; - align-items: center; - justify-content: center; -} -.informationView { - display: flex; - flex-direction: column; - width: 68.21vw; - margin-top: 1.9vh; - margin-bottom: 1.9vh; -} -.information1 { - /* font-family: PingFang SC; */ - font-style: normal; - font-weight: 500; - font-size: 2.01vh; - line-height: 2.84vh; - color: rgba(0, 0, 0, 0.9); - margin-bottom: 0.12vh; -} -.information2 { - font-family: PingFang SC; - font-style: normal; - font-weight: normal; - font-size: 1.54vh; - line-height: 2.13vh; - color: rgba(0, 0, 0, 0.9); - margin-bottom: 0.83vh; -} -.information3 { - display: flex; - height: auto; - margin-bottom: 0.36vh; - align-items: center; -} -.information3Text { - padding-top: 0.12vh; - font-family: PingFang SC; - font-style: normal; - font-weight: normal; - font-size: 1.18vh; - line-height: 1.66vh; - color: #979797; -} -/* 筛选 */ -.selectView { - display: flex; - width: 21.79vw; - justify-content: space-between; - align-items: center; -} -.selectIcon { - margin-left: 3.85vw; - width: 33.69rpx; - height: 33.69rpx; -} -.selectText { - /* font-family: PingFang SC; */ - font-style: normal; - font-weight: normal; - font-size: 1.78vh; - line-height: 2.49vh; - - text-align: right; - - color: #979797; -} -/* 隐私政策等 */ -.policy { - position: absolute; - width: 74.36vw; - height: 2.13vh; - left: 12.82vw; - top: 81.75vh; - - /* font-family: Noto Sans; */ - font-style: normal; - font-weight: normal; - font-size: 1.54vh; - line-height: 2.13vh; - /* identical to box height */ - - text-align: center; - - color: #516798; -} diff --git a/miniprogram/pages/award/add/add.js b/miniprogram/pages/award/add/add.js deleted file mode 100644 index 05a271e..0000000 --- a/miniprogram/pages/award/add/add.js +++ /dev/null @@ -1,227 +0,0 @@ -// pages/award/add/add.js -const app = getApp(); - -import Habit from "../../../manager/Habit"; -import Award from "../../../manager/Award"; - -Page({ - /** - * 页面的初始数据 - */ - data: { - headerHeight: app.globalData.navHeight + 20, - text: app.text.award.add, - - userInfo: app.globalData.userInfo, - partnerInfo: app.globalData.partnerInfo, - - myHabit: [], - partnerHabit: [], - dayHabit: false, // 是否是天数类型的打卡任务 - lastDay: 0, - times: [], // 选择坚持次数 - time_index: 0, - - title: "", - content: "", - habit_index: -1, - to_partner: false, - last_count: 30, // 次数 - }, - - onShow: function () { - this.setData({ - userInfo: app.globalData.userInfo, - partnerInfo: app.globalData.partnerInfo, - }); - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - this.toast = this.selectComponent("#toast"); - - let times = []; - for (let i = 1; i < 365; i++) { - times.push(i); - } - - times.push("一年有点长了哦"); - - this.setData({ - times: times, - }); - - this.loadData(); - }, - - /** - * 奖励给谁 - */ - toPartner: function (e) { - let my = e.currentTarget.dataset.type; - - this.setData({ - to_partner: !(my == "my"), - habit_index: -1, - }); - }, - - /** - * 加载习惯 - */ - loadData: function () { - this.toast.showLoading(); - Habit.loadAll( - this.data.userInfo._openid, - this.data.partnerInfo ? this.data.partnerInfo._openid : null, - ) - .then((res) => { - this.toast.hideLoading(); - - let myHabit = []; - let partnerHabit = []; - - res.forEach((item, _) => { - if (item.end_time == null || item.end_time >= new Date()) { - if (item._openid == this.data.userInfo._openid) { - myHabit.push(item); - } else { - partnerHabit.push(item); - } - } - }); - - this.setData({ - myHabit: myHabit, - partnerHabit: partnerHabit, - }); - }) - .catch((err) => { - this.toast.showFailure(err); - }); - }, - - /** - * 选择习惯 - */ - selectHabit: function (e) { - let index = e.currentTarget.dataset.index; - let habit = this.data.to_partner - ? this.data.partnerHabit[index] - : this.data.myHabit[index]; - - let data = { - habit_index: index, - }; - - let time = new Date(new Date().setHours(0, 0, 0, 0)).getTime(); - let day = 24 * 3600 * 1000; - - if (habit.end_time) { - data.dayHabit = true; - data.lastDay = parseInt((habit.end_time.getTime() + day - time) / day); - data.last_count = 0; - } else { - data.dayHabit = false; - data.lastDay = 0; - data.last_count = 30; - } - - this.setData(data); - }, - - /** - * 选择次数 - */ - timePickerChange: function (e) { - let time_index = e.detail.value; - let data = this.data.times[time_index]; - - if (time_index == this.data.times.length - 1) { - time_index = this.data.times.length - 2; - data = 364; - } - - this.setData({ - time_index: time_index, - last_count: data, - }); - }, - - /** - * 奖励输入 - */ - nameInput: function (e) { - this.setData({ - title: e.detail.value, - }); - }, - - /** - * 内容输入 - */ - contentInput: function (e) { - this.setData({ - content: e.detail.value, - }); - }, - - /** - * 保存 - * @param habit_id 习惯ID - * @param habit_name 习惯名 - * @param title 奖励标题 - * @param content 奖励备注 - * @param avatar 头像 - * @param isTime 是否是按照时间来计算 - * @param deadline 截止时间 - * @param current_count 当前次数 - * @param last_count 剩余次数 - * @param finish 是否已经完成:0.未完成, 1.已放弃 2.已领取 - * @param to_partner 赠送给对方:false.否 true.是 - */ - save: function () { - let index = this.data.habit_index; - let habit = this.data.to_partner - ? this.data.partnerHabit[index] - : this.data.myHabit[index]; - - if (this.data.habit_index == -1) { - this.toast.showWarning("还没有选择习惯!"); - return; - } - - if (this.data.title.length == 0) { - this.toast.showWarning("还没有填写奖励呢!"); - return; - } - - let data = { - habit_id: habit._id, - habit_name: habit.title, - title: this.data.title, - content: this.data.content, - avatar: this.data.userInfo.avatar, - isTime: this.data.dayHabit, - deadline: habit.end_time, - current_count: habit.times, - last_count: this.data.last_count, - finish: 0, - to_partner: this.data.to_partner, - }; - - this.toast.showLoading(); - - Award.add(data) - .then((res) => { - this.toast.hideLoading(); - }) - .catch((err) => { - this.toast.showFailure(err); - }); - - wx.navigateBack({}); - }, -}); diff --git a/miniprogram/pages/award/add/add.json b/miniprogram/pages/award/add/add.json deleted file mode 100644 index a97367d..0000000 --- a/miniprogram/pages/award/add/add.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "usingComponents": {} -} diff --git a/miniprogram/pages/award/add/add.wxml b/miniprogram/pages/award/add/add.wxml deleted file mode 100644 index 062618c..0000000 --- a/miniprogram/pages/award/add/add.wxml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - {{ text.tip1 }} - - - - - - - - - - - - - {{ text.tip2 }} - - - - - {{ item.title }} - - - - - - - {{ text.tip3 }} - - - - - {{ text.tip4 }} - - - - - - {{ text.tip5 }} {{ lastDay }} 天 - - - - - {{ text.tip6 }} - - - 次 - - {{ last_count }} - - - - - - - - {{ text.finish }} - - - - - - \ No newline at end of file diff --git a/miniprogram/pages/award/add/add.wxss b/miniprogram/pages/award/add/add.wxss deleted file mode 100644 index ed36d2d..0000000 --- a/miniprogram/pages/award/add/add.wxss +++ /dev/null @@ -1,165 +0,0 @@ -/* pages/award/add/add.wxss */ -@import "/Mango/Animation/mango.wxss"; - -page { - background: #f5f5f5; -} - -.interval { - margin-left: 5vw; - width: 90vw; - border-radius: 20rpx; -} - -.body { - height: auto; - background: white; - - box-sizing: border-box; - -webkit-box-sizing: border-box; - - padding: 10rpx 30rpx; - - transition: height 0.75s; - -webkit-transition: height 0.75s; -} - -/** - * 选择奖励对象 - */ -.avatar-list { - display: flex; - justify-content: flex-start; - align-items: center; -} - -.avatar-item { - width: 120rpx; - height: 120rpx; - - display: flex; - justify-content: center; - align-items: center; -} - -.avatar-item image { - width: 100rpx; - height: 100rpx; - border-radius: 50%; -} - -.avatar-item image.on { - border: solid 5rpx #fadf64; -} - -/** - * 选择习惯 - */ -.habit-list { - display: flex; - flex-direction: column; - justify-content: flex-start; -} - -.habit-cell { - width: 100%; - height: 100rpx; - margin: 10rpx 0; - border-radius: 20rpx; - - box-sizing: border-box; - -webkit-box-sizing: border-box; - padding: 0 20rpx; - - display: flex; - justify-content: flex-start; - align-items: center; -} - -.habit-cell image { - width: 40rpx; - height: 40rpx; -} - -.habit-cell text { - font-size: 28rpx; - color: gray; - padding-left: 20rpx; -} - -/** - * 奖励填写相关 - */ -.award-name { - font-size: 28rpx; - background: #f5f5f5; - height: 70rpx; - padding: 0 20rpx; - border-radius: 10rpx; -} - -/** - * 设置坚持天数 - */ -.extra-tip { - display: block; - font-size: 24rpx; - padding: 5rpx 0; - color: lightgray; -} - -.day { - display: flex; - justify-content: center; - align-items: center; - - position: relative; -} - -.day-bg { - width: 200rpx; - height: 150rpx; - - font-size: 20rpx; - - display: flex; - justify-content: flex-end; - align-items: center; -} - -.day-tip { - position: absolute; - height: 150rpx; - - font-size: 80rpx; - font-weight: bold; - - background: -webkit-linear-gradient(to right, #ffe259, #ffa751); - background: linear-gradient(to right, #ffe259, #ffa751); - -webkit-background-clip: text; - background-clip: text; - - -webkit-text-fill-color: transparent; -} - -/** - * 完成 - */ - -.btn-bg { - height: 150rpx; - padding-top: 50rpx; - /* margin: 50rpx auto 150rpx; */ -} - -.finish-btn { - width: 50vw; - height: 100rpx; - line-height: 100rpx; - text-align: center; - border-radius: 10rpx; - font-size: 35rpx; - margin: 0 auto; - - color: white; -} diff --git a/miniprogram/pages/award/award/award.js b/miniprogram/pages/award/award/award.js deleted file mode 100644 index c8529b7..0000000 --- a/miniprogram/pages/award/award/award.js +++ /dev/null @@ -1,203 +0,0 @@ -// pages/award/award.js -import Award from "../../../manager/Award"; -import Habit from "../../../manager/Habit"; - -const app = getApp(); - -Page({ - /** - * 页面的初始数据 - */ - data: { - text: app.text.award.award, - headerHeight: app.globalData.navHeight + 20, - - userInfo: app.globalData.userInfo, - partnerInfo: app.globalData.partnerInfo, - - ongoing: true, // 当前视角 true是正在进行,false是已处理 - page: 0, - lists: [], // 奖励列表 - }, - - onShow: function () { - this.setData({ - userInfo: app.globalData.userInfo, - partnerInfo: app.globalData.partnerInfo, - }); - - this.loadData(); - - if (typeof this.getTabBar === "function" && this.getTabBar()) { - this.getTabBar().setData({ - selected: 2, - page: this, - }); - } - }, - - onLoad: function (options) { - this.toast = this.selectComponent("#toast"); - }, - - /** - * 加载奖励 - */ - loadData: function () { - this.toast.showLoading(); - Award.lists( - this.data.userInfo._openid, - this.data.page, - this.data.partnerInfo ? this.data.partnerInfo._openid : null, - !this.data.ongoing, - ) - .then((res) => { - wx.stopPullDownRefresh(); - let lists = this.data.page == 0 ? [] : this.data.lists; - - let finish = 0; - res.forEach((item, index) => { - let habit = app.globalData.habits[item.habit_id]; - - if (habit) { - if (item.isTime) { - let time = new Date(new Date().setHours(0, 0, 0, 0)).getTime(); - let day = 24 * 3600 * 1000; - item.lastTime = parseInt( - (habit.end_time.getTime() + day - time) / day, - ); - } else { - item.lastCount = - item.last_count - (habit.times - item.current_count); - } - - item.habit = habit; - - lists.push(item); - finish++; - } else { - Habit.detail(item.habit_id) - .then((habit) => { - if (habit != null) { - if (item.isTime) { - let time = new Date( - new Date().setHours(0, 0, 0, 0), - ).getTime(); - let day = 24 * 3600 * 1000; - item.lastTime = parseInt( - (habit.end_time.getTime() + day - time) / day, - ); - } else { - item.lastCount = - item.last_count - (habit.times - item.current_count); - } - - item.habit = habit; - - lists.push(item); - } - - finish++; - - if (finish == res.length) { - this.toast.hideLoading(); - this.setData({ - lists: lists, - }); - } - }) - .catch((err) => { - this.toast.showFailure(err); - }); - } - }); - - if (finish == res.length) { - this.toast.hideLoading(); - this.setData({ - lists: lists, - }); - } - - this.setData({ - page: this.data.page + 1, - }); - }) - .catch((err) => { - console.log(err); - this.toast.showFailure(err); - }); - }, - - /** - * 切换视角 - */ - changeVisual: function (e) { - let visual = e.currentTarget.dataset.type; - let ongoing = visual == "ongoing"; - - if (this.data.ongoing == ongoing) { - return; - } - - this.setData({ - ongoing: ongoing, - page: 0, - }); - - this.loadData(); - }, - - /** - * 查看奖励 - */ - clickAward: function (e) { - if (!this.data.ongoing) { - return; - } - - let index = e.currentTarget.dataset.index; - let award = this.data.lists[index]; - - let url = - "/pages/calendar/calendar?habit_id=" + - award.habit._id + - "&type=award&time=" + - (award.lastTime ? award.lastTime : -1) + - "&count=" + - (award.lastCount ? award.lastCount : -1) + - "&award=" + - JSON.stringify(award); - - wx.navigateTo({ - url: url, - }); - }, - - /** - * 添加 - */ - add: function () { - wx.navigateTo({ - url: "/pages/award/add/add", - }); - }, - - /** - * 下拉刷新 - */ - onPullDownRefresh: function () { - this.setData({ - page: 0, - }); - - this.loadData(); - }, - - /** - * 上滑加载更多 - */ - onReachBottom: function () { - this.loadData(); - }, -}); diff --git a/miniprogram/pages/award/award/award.json b/miniprogram/pages/award/award/award.json deleted file mode 100644 index 66ab717..0000000 --- a/miniprogram/pages/award/award/award.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "usingComponents": {}, - "enablePullDownRefresh": true -} diff --git a/miniprogram/pages/award/award/award.wxml b/miniprogram/pages/award/award/award.wxml deleted file mode 100644 index f43e3d1..0000000 --- a/miniprogram/pages/award/award/award.wxml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - {{ text.ongoing }} - {{ text.finish }} - - - - - - - {{ text.onEmptyTip }} - 🎁 - {{ text.onEmptyButton }} - - - {{ text.finishEmptyTip }} - - - - - - - - - - - - {{ item._openid == userInfo._openid ? (item.to_partner ? text.toPartner : '') : (item.to_partner ? text.toMyself : '') }} {{ item.title }} - {{ item.content }} - {{ text.fromHabit }}{{ item.habit_name }} - - - - {{ item.isTime ? text.lastTime : text.lastCount }} - - - - {{ item.lastTime > 0 ? item.lastTime : text.timeFinish }} - - - {{ item.lastCount > 0 ? item.lastCount : text.countFinish }} - - - - - - - - - - \ No newline at end of file diff --git a/miniprogram/pages/award/award/award.wxss b/miniprogram/pages/award/award/award.wxss deleted file mode 100644 index d330b6a..0000000 --- a/miniprogram/pages/award/award/award.wxss +++ /dev/null @@ -1,188 +0,0 @@ -/* pages/award/award.wxss */ - -page { - background: #f5f5f5; -} - -.interval { - width: 90vw; - margin: 0 5vw; -} - -.body { - border-radius: 20rpx; - height: auto; - - display: flex; - flex-direction: column; - justify-content: flex-start; -} - -/** - * 大标题 - */ -.header { - position: relative; -} - -.bigTitle { - display: flex; - justify-content: flex-start; - align-items: center; - margin: 20rpx 0; - - position: absolute; - bottom: 0; -} - -.bigTitle view { - margin-right: 20rpx; - width: auto; - text-align: center; -} - -.bigTitle .big { - font-size: 70rpx; - font-weight: bold; - color: #3b353e; -} - -.bigTitle .small { - font-size: 40rpx; - color: gray; -} - -/** - * empty - */ -.empty { - height: 60vh; - - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; -} - -.empty text { - font-size: 30rpx; - color: lightgray; - padding: 10rpx 0; - text-align: center; -} - -/** - * 列表 - */ - -.list-cell { - border-radius: 20rpx; - - display: flex; - justify-content: flex-start; - align-items: flex-start; - - box-sizing: border-box; - -webkit-box-sizing: border-box; - padding: 30rpx 20rpx; - margin: 30rpx 0; -} - -.list-cell-avatar { - width: 100rpx; - - display: flex; - align-items: center; -} - -.list-cell-avatar image { - width: 80rpx; - height: 80rpx; - border-radius: 50%; -} - -.list-cell-content { - flex: 1; - - display: flex; - flex-direction: column; - justify-content: space-around; - align-items: flex-start; - - box-sizing: border-box; - -webkit-box-sizing: border-box; - padding: 0 10rpx; -} - -.cell-title { - color: white; - font-size: 40rpx; - font-weight: 500; -} - -.cell-content { - color: #f9f9f9; - font-size: 25rpx; - padding: 10rpx 0; -} - -.cell-habit { - color: white; - font-size: 20rpx; - font-weight: 300; -} - -.list-cell-right { - width: 120rpx; - - display: flex; - flex-direction: column; - justify-content: flex-start; - align-items: center; -} - -.right-header { - width: 100%; - height: 40rpx; - background: #fd746c; /* fallback for old browsers */ - background: -webkit-linear-gradient( - to right, - #fd746c, - #ff9068 - ); /* Chrome 10-25, Safari 5.1-6 */ - background: linear-gradient( - to right, - #fd746c, - #ff9068 - ); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */ - border-radius: 20rpx 20rpx 0 0; - - font-size: 25rpx; - color: white; - - display: flex; - justify-content: center; - align-items: center; -} - -.right-content { - width: 100%; - height: 60rpx; - border-radius: 0 0 20rpx 20rpx; - border: 2.5rpx solid #fd746c; - border-top: none; - - box-sizing: border-box; - -webkit-box-sizing: border-box; - - color: white; - - display: flex; - justify-content: center; - align-items: center; -} - -.other-grad-bg { - background: -webkit-linear-gradient(to right, #ff7e5f, #feb47b); - background: linear-gradient(to right, #ff7e5f, #feb47b); -} diff --git a/miniprogram/pages/calendar/calendar.js b/miniprogram/pages/calendar/calendar.js deleted file mode 100644 index 696b798..0000000 --- a/miniprogram/pages/calendar/calendar.js +++ /dev/null @@ -1,318 +0,0 @@ -import Record from "../../manager/Record"; -import Award from "../../manager/Award"; - -const app = getApp(); - -Page({ - data: { - headerHeight: app.globalData.navHeight, - text: app.text.calendar, - userInfo: app.globalData.userInfo, - - monthStr: [ - "January", - "February", - "March", - "April", - "May", - "June", - "July", - "August", - "September", - "October", - "November", - "December", - ], - month: 0, - days: [], - monthStart: -1, - - habit: null, - habit_id: null, - award: null, - - type: null, - - last_type: null, - last_num: 0, - }, - - onShow: function () { - this.setData({ - userInfo: app.globalData.userInfo, - }); - }, - - onLoad: function (options) { - this.toast = this.selectComponent("#toast"); - - let award = options.award ? JSON.parse(options.award) : null; - - if (award) { - award.formatTime = app.util.formatTime(award.create_time); - } - - this.setData({ - habit_id: options.habit_id, - type: options.type ? options.type : null, - habit: award ? award.habit : null, - award: award, - - last_type: options.time == -1 ? "count" : "time", - last_num: options.time == -1 ? options.count : options.time, - }); - - this.initCalendar(); - }, - - /** - * 日历初始化 - */ - initCalendar: function () { - let date = new Date(); - let _month = date.getMonth(); - - this.setData({ - month: date.getMonth(), - }); - - this.loadDay(); - }, - - /** - * 加载本月天数 - */ - loadDay: function () { - let date = new Date(); - let _year = date.getFullYear(); - let _month = this.data.month; - - let days = []; - - let _firstDay = new Date(_year, _month, 1); - for (let i = 0; i < 6 * 7; i++) { - var _thisDay = new Date(_year, _month, i + 1 - _firstDay.getDay()); - var _thisDayStr = this.getDateStr(_thisDay); - - if (_thisDay.getDate() == 1 && this.data.monthStart == -1) { - this.setData({ - monthStart: i, - }); - } - - days.push({ - day: _thisDay.getDate(), - on: false, - onStyle: "", - }); - - if (_thisDayStr == this.getDateStr(new Date())) { - // 当前天 - days[i].className = "currentDay"; - } else if ( - _thisDayStr.substr(0, 6) == this.getDateStr(_firstDay).substr(0, 6) - ) { - days[i].className = "currentMonth"; // 当前月 - } else { - // 其他月 - days[i].className = "otherMonth"; - } - } - - this.setData({ - days: days, - }); - - this.loadData(); - }, - - /** - * 改变月份 - */ - changeMonth: function (e) { - let type = e.currentTarget.dataset.type; - - let month = this.data.month; - if (type == "down") { - month = month == 0 ? 11 : month - 1; - } else { - month = month == 11 ? 0 : month + 1; - } - - this.setData({ - month: month, - monthStart: -1, - }); - - this.loadDay(); - }, - - /** - * 加载网络数据 - */ - loadData: function () { - this.toast.showLoading(); - - console.log(this.data.month); - - Record.month(this.data.habit_id, this.data.month) - .then((res) => { - this.toast.hideLoading(); - - let days = this.data.days; - let award = this.data.award; - - for (let i = 0; i < res.length; i++) { - let item = res[i]; - if (award) { - // 来自奖励 - if (item.time.getTime() < new Date(award.create_time).getTime()) { - continue; - } - } - - let day = item.time.getDate(); - days[day + this.data.monthStart - 1].on = true; - } - - for (let i = 0; i < days.length; i++) { - // 连续性判断 - if (days[i].on == true) { - if (i == 0 || !days[i - 1].on) { - days[i].onStyle = "onNormal onLeft"; - } else { - days[i].onStyle = "onNormal"; - } - } else { - if (i > 0 && !days[i].on) { - if (days[i - 1].on) { - if (days[i - 1].onStyle == "onNormal") { - days[i - 1].onStyle += " onRight"; - } else if (days[i - 1].onStyle == "onNormal onLeft") { - days[i - 1].onStyle = "onNormal onSingle"; - } - } - } - } - } - - this.setData({ - days: days, - }); - }) - .catch((err) => { - console.log(err); - - this.toast.showFailure(err); - }); - }, - - /** - * 编辑习惯 - */ - editHabit: function () { - wx.navigateTo({ - url: "/pages/addV2/add?id=" + this.data.habit_id, - }); - }, - - getDateStr: function (date) { - var _year = date.getFullYear(); - var _month = date.getMonth() + 1; // 月从0开始计数 - var _d = date.getDate(); - - _month = _month > 9 ? "" + _month : "0" + _month; - _d = _d > 9 ? "" + _d : "0" + _d; - return _year + _month + _d; - }, - - /** - * 完成 - */ - finish: function () { - let _id = this.data.award._id; - - let title = "Finish!"; - let content = ""; - - if (this.data.award.to_partner) { - content = "快去奖励小伙伴吧 ~"; - } else { - content = "快去奖励自己吧 ~"; - } - - let that = this; - wx.showModal({ - title: title, - content: content, - success: function (res) { - if (res.confirm) { - that.toast.showLoading(); - Award.update(_id, { - finish: 1, - }) - .then((res) => { - that.toast.showSuccess(); - - let pages = getCurrentPages(); - let prePage = pages[pages.length - 2]; - prePage.setData({ - page: 0, - }); - prePage.loadData(); - - wx.navigateBack({}); - }) - .catch((err) => { - that.toast.showFailure(err); - }); - } - }, - }); - }, - - /** - * 删除奖励 - */ - delete: function () { - let _id = this.data.award._id; - - let title = ""; - let content = ""; - - if (this.data.award.to_partner) { - title = "和小伙伴沟通清楚哦"; - content = "删除之后小伙伴就看不到奖励啦"; - } else { - title = "确定删除嘛"; - content = "删除之后就看不到奖励啦"; - } - - let that = this; - wx.showModal({ - title: title, - content: content, - success: function (res) { - if (res.confirm) { - that.toast.showLoading(); - Award.del(_id) - .then((res) => { - that.toast.showSuccess("删除成功"); - - let pages = getCurrentPages(); - let prePage = pages[pages.length - 2]; - prePage.setData({ - page: 0, - }); - prePage.loadData(); - - wx.navigateBack({}); - }) - .catch((err) => { - that.toast.showFailure(err); - }); - } - }, - }); - }, -}); diff --git a/miniprogram/pages/calendar/calendar.json b/miniprogram/pages/calendar/calendar.json deleted file mode 100644 index a97367d..0000000 --- a/miniprogram/pages/calendar/calendar.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "usingComponents": {} -} diff --git a/miniprogram/pages/calendar/calendar.wxml b/miniprogram/pages/calendar/calendar.wxml deleted file mode 100644 index 5e2f277..0000000 --- a/miniprogram/pages/calendar/calendar.wxml +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - - - - - - {{ monthStr[month] }} - - - - - - - - - S - M - T - W - T - F - S - - - - - - {{ item.day }} - - - - - - - - - - {{ text.detail.timeTip }}{{ award.formatTime }} - - - - - - - - - - - - {{ habit.title }} - - - - - - - - - - - - - - {{ text.detail.nameTip }} - {{ award.title }} - - {{ text.detail.contentTip }} - {{ award.content }} - - {{ text.detail.lastTip }} - - - - {{ last_type == 'time' ? '天' : '次' }} - - {{ last_num }} - - - - - {{ text.detail.finish }} - - - - - - - {{ text.detail.award }} - - - - - {{ text.detail.delete }} - - - - - - - - - - - - - - {{ text.editHabit }} - - - diff --git a/miniprogram/pages/calendar/calendar.wxss b/miniprogram/pages/calendar/calendar.wxss deleted file mode 100644 index 86940b5..0000000 --- a/miniprogram/pages/calendar/calendar.wxss +++ /dev/null @@ -1,235 +0,0 @@ -/* pages/test/test.wxss */ - -@import "/Mango/Animation/mango.wxss"; - -page { - background: #f5f5f5; -} - -view { - color: #333; - font-family: "Courier New", Courier, monospace; -} - -.calendar { - width: 100vw; - background: white; - - display: flex; - flex-direction: column; -} - -.calendar-header { - height: 10vh; - - display: flex; - justify-content: space-around; - align-items: center; -} - -.calendar-header .center { - font-weight: bolder; - font-size: 50rpx; - - display: flex; - justify-content: center; - align-items: center; -} - -.calendar-header .left, -.calendar-header .right { - width: 60rpx; - height: 60rpx; -} - -.calendar-header image { - width: 100%; - height: 100%; -} - -.calendar-body { - flex: 1; - - display: flex; - flex-direction: column; -} - -.calendar-body .weekday { - height: 80rpx; - - display: flex; - justify-content: center; - align-items: center; - - border-bottom: 1rpx solid #f5f5f5; -} - -.weekday .item { - flex: 1; - - text-align: center; - font-size: 40rpx; - font-weight: bold; -} - -.day { - display: flex; - flex-wrap: wrap; -} - -.day .item { - width: 14.285vw; - height: 100rpx; - - font-size: 30rpx; - font-weight: 600; - - display: flex; - justify-content: center; - align-items: center; -} - -.day .item view { - width: 100%; - height: 80rpx; - - display: flex; - justify-content: center; - align-items: center; -} - -.day .currentDay { - font-weight: bold; -} - -.day .otherMonth { - color: lightgray; -} - -.day .onNormal { - background: #ffa751; - color: white; -} - -.day .onSingle { - border-radius: 50rpx; -} - -.day .onLeft { - border-radius: 50rpx 0 0 50rpx; -} - -.day .onRight { - border-radius: 0 50rpx 50rpx 0; -} - -.list-cell { - width: 100vw; - height: 150rpx; - margin: 20rpx 0; - - background: white; - - box-sizing: border-box; - -webkit-box-sizing: border-box; - - padding: 0 50rpx; - - display: flex; - align-items: center; -} - -.list-cell-icon { - padding: 0 20rpx; -} - -.list-cell-icon image { - width: 70rpx; - height: 70rpx; -} - -.list-cell-content { - flex: 1; -} - -.list-cell-right image { - width: 50rpx; - height: 50rpx; -} - -.btn-bg { - height: 150rpx; - padding-top: 50rpx; - /* margin: 50rpx auto 150rpx; */ -} - -.finish-btn, -.del-btn { - width: 50vw; - height: 100rpx; - line-height: 100rpx; - text-align: center; - border-radius: 10rpx; - font-size: 35rpx; - margin: 0 auto; - color: white; -} - -.del-btn { - background: #e64340; -} - -/** - * 习惯详情 - */ - -.detail { - width: 100vw; - - box-sizing: border-box; - -webkit-box-sizing: border-box; - - padding: 5rpx 10vw; - - background: white; -} - -.day { - display: flex; - justify-content: center; - align-items: center; - - position: relative; -} - -.day-bg { - width: 200rpx; - height: 150rpx; - - font-size: 20rpx; - - display: flex; - justify-content: flex-end; - align-items: center; -} - -.day-tip { - position: absolute; - height: 150rpx; - - line-height: 150rpx; - font-size: 80rpx; - font-weight: bold; - - background: -webkit-linear-gradient(to right, #ffe259, #ffa751); - background: linear-gradient(to right, #ffe259, #ffa751); - -webkit-background-clip: text; - background-clip: text; - - -webkit-text-fill-color: transparent; -} - -.tip-text { - text-align: center; - padding-top: 20rpx; -} diff --git a/miniprogram/pages/indexV2/index.js b/miniprogram/pages/indexV2/index.js deleted file mode 100644 index c9c9c89..0000000 --- a/miniprogram/pages/indexV2/index.js +++ /dev/null @@ -1,479 +0,0 @@ -// pages/index/index.js -import Habit from "../../manager/Habit.js"; -import Record from "../../manager/Record.js"; -import User from "../../manager/User.js"; -import Push from "../../manager/Push.js"; - -const app = getApp(); - -Page({ - /** - * 页面的初始数据 - */ - data: { - iPhoneX: false, - userInfo: null, - partnerInfo: null, - partner: false, - page: 0, - lists: [], - my_lists: [], - my_finish_num: 0, - my_amount_num: 0, - partner_lists: [], - partner_finish_num: 0, - partner_amount_num: 0, - tixing: false, - currentHabit: null, - text: app.text.index, - myVisual: true, // 当前视角 true是我,false是小伙伴 - - showTodayTip: false, // 显示今日欢迎语 - nowHour: 0, // 当前时间 - - invitePartner: false, - }, - - onShow: function () { - if (typeof this.getTabBar === "function" && this.getTabBar()) { - this.getTabBar().setData({ - selected: 0, - page: this, - }); - } - - if (app.globalData.needReloadData) { - app.globalData.needReloadData = false; - this.setData({ - page: 0, - }); - - this.loadData(); - } - - this.setData({ - invitePartner: wx.getStorageSync("invite") || false, - }); - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - this.toast = this.selectComponent("#toast"); - - // iPhoneX - this.setData({ - iPhoneX: app.globalData.iPhoneX, - }); - - // 登录态 - if (app.globalData.userInfo == null || app.globalData.userInfo == "") { - wx.redirectTo({ - url: "/pages/loginV2/login", - }); - - return; - } - - // 用户信息 - this.setData({ - userInfo: app.globalData.userInfo, - partnerInfo: app.globalData.partnerInfo, - partner: app.globalData.partnerInfo == null ? false : true, - }); - - // 加载数据 - this.loadData(); - - // 加载伙伴数据 - if (app.globalData.needReloadPartner) { - this.loadPartner(); - } - }, - - /** - * 今日提示框 - */ - showTodayTip: function () { - let last = wx.getStorageSync("welcome"); - if (last != null) { - let temp = last.split(" "); - if (temp.length > 0) { - last = temp[0]; - } - } - let today = app.util.formatTime(new Date(), true, false); - today = today.split(" "); - today = today[0]; - - wx.setStorageSync("welcome", today); - - let show = last != today; - this.setData({ - showTodayTip: show, - nowHour: new Date().getHours(), - }); - }, - - /** - * 获取今天的习惯 - */ - loadData: function () { - this.toast.showLoading(); - Habit.loadToday( - app.globalData.userInfo._openid, - this.data.partnerInfo == null ? null : this.data.partnerInfo._openid, - ) - .then((habits) => { - Record.today( - app.globalData.userInfo._openid, - this.data.partnerInfo == null ? null : this.data.partnerInfo._openid, - ) - .then((records) => { - this.toast.hideLoading(); - wx.stopPullDownRefresh(); - this.showTodayTip(); - - let finish_id = new Array(); - records.forEach((record, index) => { - finish_id.push(record.habit_id); - }); - - let my_finish_num = 0; - let my_amount_num = 0; - let partner_finish_num = 0; - let partner_amount_num = 0; - let resData = [[], []]; - let app_habits = {}; // 留一份到app.js - habits.forEach((habit, index) => { - app_habits[habit._id] = habit; - - let id_index = finish_id.indexOf(habit._id); - if (id_index != -1) { - // 已完成 - habit.finish_id = records[id_index]._id; - habit.finish = true; - habit.finish_time = records[id_index].time; - if (habit._openid == this.data.userInfo._openid) { - my_finish_num++; - } else { - partner_finish_num++; - } - } else { - // 未完成 - habit.finish_id = ""; - habit.finish = false; - } - - if (this.data.partnerInfo == null) { - // 单人 - if (habit._openid == this.data.userInfo._openid) { - // 本人 - my_amount_num++; - resData[0].push(habit); - } - } else { - // 两人 - if (habit._openid == this.data.userInfo._openid) { - // 本人 - my_amount_num++; - resData[0].push(habit); - } else { - // mango - partner_amount_num++; - resData[1].push(habit); - } - } - }); - - this.setData({ - lists: this.data.myVisual ? resData[0] : resData[1], - - my_lists: resData[0], - my_amount_num: my_amount_num, - my_finish_num: my_finish_num, - - partner_lists: resData[1], - partner_amount_num: partner_amount_num, - partner_finish_num: partner_finish_num, - }); - - app.globalData.habits = app_habits; - }) - .catch((err) => { - this.toast.showFailure(err); - }); - }) - .catch((err) => { - this.toast.showFailure(err); - }); - }, - - /** - * 刷新小伙伴信息 - */ - loadPartner: function () { - User.myPartner(app.globalData.userInfo._openid) - .then((res) => { - let lastPartnerInfo = app.globalData.partnerInfo; - if (lastPartnerInfo == null && res != null) { - // 最新绑定小伙伴 - this.toast.showLoading(this.data.text.newPartner); - setTimeout(() => { - this.toast.hideLoading(); - // 重新加载数据 - this.loadData(); - }, 1500); - } else if (lastPartnerInfo != null && res == null) { - // 小伙伴解除 - this.toast.showFailure(this.data.text.relievePartner); - } else if ( - lastPartnerInfo != null && - res != null && - lastPartnerInfo._openid != res._openid - ) { - this.toast.showSuccess(this.data.text.refreshPartner); - } - - app.globalData.partnerInfo = res; - wx.setStorageSync("partnerInfo", res); - - this.setData({ - partnerInfo: res, - partner: res == null ? false : true, - }); - }) - .catch((err) => { - this.toast.showFailure(err); - }); - }, - - /** - * 打卡 - */ - finishHabit: function (e) { - let habitId = e.currentTarget.dataset.habitid; - let index = e.currentTarget.dataset.index; - - this.toast.showLoading(); - Record.finish(habitId) - .then((res) => { - this.toast.showSuccess(this.data.text.finishCard); - let my_lists = this.data.my_lists; - if (this.data.partner) { - my_lists[index].finish = true; - my_lists[index].finish_id = res._id._id; - my_lists[index].times = my_lists[index].times + 1; - } else { - my_lists[index].finish = true; - my_lists[index].finish_id = res._id._id; - my_lists[index].times = my_lists[index].times + 1; - } - - app.globalData.habits[my_lists[index]._id].times = - my_lists[index].times; - - this.setData({ - lists: my_lists, - my_lists: my_lists, - my_finish_num: this.data.my_finish_num + 1, - }); - }) - .catch((err) => { - this.toast.showFailure(err); - }); - }, - - /** - * 取消打卡 - */ - cancelHabit: function (e) { - let _id = e.currentTarget.dataset.finishid; - let habitId = e.currentTarget.dataset.habitid; - let index = e.currentTarget.dataset.index; - - let that = this; - let text = this.data.text; - wx.showModal({ - title: text.cancelTitle, - content: text.cancelContent, - showCancel: true, - success(res) { - if (res.confirm) { - that.toast.showLoading(); - let my_lists = that.data.my_lists; - Record.cancel(_id, habitId, my_lists[index].times) - .then((res) => { - if (that.data.partner) { - my_lists[index].finish = false; - my_lists[index].finish_id = ""; - my_lists[index].times = - my_lists[index].times > 0 ? my_lists[index].times - 1 : 0; - } else { - my_lists[index].finish = false; - my_lists[index].finish_id = ""; - my_lists[index].times = - my_lists[index].times > 0 ? my_lists[index].times - 1 : 0; - } - - app.globalData.habits[my_lists[index]._id].times = - my_lists[index].times; - - that.setData({ - lists: my_lists, - my_lists: my_lists, - my_finish_num: that.data.my_finish_num - 1, - }); - - that.toast.showSuccess(text.cancelCard); - }) - .catch((err) => { - that.toast.showFailure(err); - }); - } - }, - }); - }, - - /** - * 点击对方打卡 - */ - partnerHabit: function (e) { - let index = e.currentTarget.dataset.index; - let habit = this.data.partner_lists[index]; - - let time = new Date(new Date().setHours(0, 0, 0, 0)).getTime(); - let day = 24 * 3600 * 1000; - habit.lastday = - habit.end_time == null - ? "∞" - : parseInt((habit.end_time.getTime() + day - time) / day); - - if (habit.finish) { - wx.showModal({ - title: habit.title, - content: - "打卡时间: " + app.util.formatTime(habit.finish_time, true, false), - cancelText: "好的", - confirmText: "查看详情", - success: function (res) { - if (res.confirm) { - wx.navigateTo({ - url: "/pages/calendar/calendar?habit_id=" + habit._id, - }); - } - }, - }); - } else { - let that = this; - - wx.showModal({ - title: "提醒对方打开", - content: "快来提醒小伙伴打开叭!", - success: function (res) { - if (res.confirm) { - that.toast.showLoading(); - let more = - habit.lastday >= 0 && habit.lastday != "∞" - ? "还剩" + habit.lastday + "天!" - : "已打卡" + habit.times + "次!"; - Push.push( - that.data.partnerInfo._openid, - habit.title, - "醒醒,你该打卡啦", - more, - ) - .then(() => { - that.toast.hideLoading(); - wx.showModal({ - title: "已发送", - content: "小可爱的督促已经送达 ^.^", - showCancel: false, - }); - }) - .catch((res) => { - console.log(res); - that.toast.hideLoading(); - that.setData({ - tixing: true, - currentHabit: habit, - }); - }); - } - }, - }); - } - }, - - /** - * 下拉刷新 - */ - onPullDownRefresh: function () { - this.setData({ - page: 0, - }); - - this.loadData(); - }, - - /** - * 转发监听 - */ - onShareAppMessage: function (options) { - this.setData({ - tixing: false, - }); - - return { - title: "该打卡啦 " + "[ " + this.data.currentHabit.title + " ]", - path: "/pages/indexV2/index", - imageUrl: "/images/card.png", - }; - }, - - /** - * 切换视角 - */ - changeVisual: function (e) { - let visual = e.currentTarget.dataset.type; - let my = visual == "my"; - - if (this.data.myVisual == my) { - return; - } - - this.setData({ - myVisual: my, - lists: [], - }); - - this.setData({ - lists: my ? this.data.my_lists : this.data.partner_lists, - }); - }, - - /** - * 刷新伙伴关系 - */ - refresh: function () { - wx.reLaunch({ - url: "/pages/indexV2/index", - }); - }, - - /** - * 点击今日提醒按钮 - */ - modalClick: function (e) { - this.setData({ - showTodayTip: false, - }); - }, - - addHabit: function () { - wx.navigateTo({ - url: "/pages/add/add", - }); - }, -}); diff --git a/miniprogram/pages/indexV2/index.json b/miniprogram/pages/indexV2/index.json deleted file mode 100644 index a4e429d..0000000 --- a/miniprogram/pages/indexV2/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "usingComponents": { - "modal": "/components/modal/modal" - }, - "enablePullDownRefresh": true -} diff --git a/miniprogram/pages/indexV2/index.wxml b/miniprogram/pages/indexV2/index.wxml deleted file mode 100644 index d96e453..0000000 --- a/miniprogram/pages/indexV2/index.wxml +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - -
- - - {{ text.mine }} - {{ partnerInfo.sex == 1 ? text.he : text.she }} - - - - - - -
- - - - - - {{ text.refreshTip }} - - - - {{ text.refreshNoTitle }} - - - - {{ text.refreshTitle }} - - - - - - - {{ myVisual ? (partnerInfo.sex == 1 ? text.he : text.she) : text.mine }}{{ text.taTip }} - - - - - - - {{ !myVisual ? my_finish_num + "/" + my_amount_num : partner_finish_num + "/" + partner_amount_num }} - - - - {{ text.todayTip }} - - - - - - {{ text.empty }} - {{ text.addHabit }} - - - - - - {{ text.empty }} - - - - - - - - - - - - - - {{ item.title }} - - - {{ item.finish ? text.finish + " · " : ""}}{{ text.reach }} {{ item.times}} 次 - - - - - - - - - {{ nowHour <= 12 ? text.todayMorningTip : text.todayAfternoonTip }} - {{ text.todayTip1 }} {{ my_amount_num }} {{ text.todayTip2 }} - - - - {{ text.noFormIdTitle }} - {{ text. noFormIdContent }} - - - - \ No newline at end of file diff --git a/miniprogram/pages/indexV2/index.wxss b/miniprogram/pages/indexV2/index.wxss deleted file mode 100644 index 181bb94..0000000 --- a/miniprogram/pages/indexV2/index.wxss +++ /dev/null @@ -1,331 +0,0 @@ -/* pages/indexV2/index.wxss */ -@import "/Mango/Animation/mango.wxss"; - -page { - background: #f5f5f5; -} - -.interval { - margin-left: 5vw; - width: 90vw; -} - -.header { - display: flex; - flex-direction: column; - justify-content: flex-end; - align-items: flex-start; - height: 100%; -} - -/* 头像区 */ -.user-info { - height: 150rpx; - border-radius: 20rpx; - background: white; - margin: 0 auto; - color: #3b353e; - - display: flex; - justify-content: flex-start; - align-items: center; -} - -.user-avatar { - width: 150rpx; - height: 150rpx; - - display: flex; - justify-content: center; - align-items: center; -} - -.user-avatar image { - width: 100rpx; - height: 100rpx; - border-radius: 50%; -} - -.user-name { - height: 150rpx; - display: flex; - flex-direction: row; - justify-content: space-between; - align-items: center; - flex: 1; - font-size: 35rpx; - padding-right: 30rpx; - font-weight: bold; -} - -.today .today-tip { - font-size: 30rpx; - font-weight: 300; -} - -.today .num { - font-size: 60rpx; - font-family: "Lucida Sans", "Lucida Sans Regular", "Lucida Grande", - "Lucida Sans Unicode", Geneva, Verdana, sans-serif; -} - -.ta-today .num { - font-family: "Lucida Sans", "Lucida Sans Regular", "Lucida Grande", - "Lucida Sans Unicode", Geneva, Verdana, sans-serif; -} - -/* 大标题 */ -.bigTitle { - display: flex; - justify-content: flex-start; - align-items: center; - margin: 20rpx 0; -} - -.bigTitle view { - /* margin-right: 50rpx; */ - width: 100rpx; - text-align: center; -} - -.bigTitle .big { - font-size: 70rpx; - font-weight: bold; - color: #3b353e; -} - -.bigTitle .small { - font-size: 40rpx; - color: gray; -} - -.today-tip { - margin: 50rpx auto 20rpx; -} - -/** -* cell -*/ - -.habit-list { - background: white; - height: auto; - margin: 30rpx auto; - border-radius: 20rpx; - overflow: hidden; -} - -.empty { - width: 100%; - height: 150rpx; - text-align: center; - font-size: 25rpx; - line-height: 50rpx; - color: lightgray; - text-decoration: underline; - - display: flex; - flex-direction: column; - justify-content: center; -} - -/* 清单 */ -.list-cell { - width: 90vw; - height: 150rpx; - position: relative; - margin: 10rpx auto; - - display: flex; - flex-direction: row; - justify-content: flex-start; - align-items: center; -} - -.list-cell-left { - display: flex; - justify-content: center; - align-items: center; - width: 150rpx; - height: 150rpx; -} - -.list-cell-icon { - width: 70rpx; - height: 70rpx; - background: #f5f5f5; - - display: flex; - justify-content: center; - align-items: center; -} - -.list-cell-icon image, -.list-cell-right image { - width: 40rpx; - height: 40rpx; -} - -.list-cell-content-title { - font-size: 30rpx; - color: #242529; - font-weight: bold; -} - -.list-cell-content { - width: auto; - height: 150rpx; - - display: flex; - flex-direction: column; - justify-content: center; - align-items: flex-start; -} - -.list-cell-right { - width: 150rpx; - height: 150rpx; - line-height: 130rpx; - text-align: center; - position: absolute; - top: 0; - right: 0; -} - -.day { - color: #b8b6ce; - font-size: 25rpx; - font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif; -} - -.finish { - color: #b8b6ce; -} - -/* Ta的进度 */ -.ta-today { - background: white; - border-radius: 20rpx; - height: 100rpx; - - display: flex; - align-items: center; - justify-content: space-between; - - overflow: hidden; - padding: 0 20rpx; - box-sizing: border-box; - -webkit-box-sizing: border-box; -} - -/* PROGRESS */ -.progress { - background-color: #e5e9eb; - height: 0.25em; - position: relative; - width: 85%; -} -.progress-bar { - transition: width 1s; - -webkit-transition: width 1s; - width: 0%; - background-image: linear-gradient( - to right, - #4cd964, - #5ac8fa, - #007aff, - #34aadc, - #5856d6, - #ff2d55 - ); - background-image: -webkit-linear-gradient( - to right, - #4cd964, - #5ac8fa, - #007aff, - #34aadc, - #5856d6, - #ff2d55 - ); - background-size: 24em 0.25em; - height: 100%; - position: relative; -} -.progress-shadow { - background-image: linear-gradient(to bottom, #eaecee, white, transparent); - background-image: -webkit-linear-gradient( - to bottom, - #eaecee, - white, - transparent - ); - height: 4em; - position: absolute; - top: 100%; - transform: skew(45deg); - transform-origin: 0 0; - width: 100%; -} - -/** - * 今日提示框 - */ -modal text { - padding: 20rpx 0; -} - -.modal-title { - color: #242529; - font-weight: 500; - font-size: 50rpx; -} - -.modal-content { - color: #242529; - font-weight: 300; - text-align: center; -} - -.modal-num { - font-size: 60rpx; -} - -.noFormIdBtn { - width: 50vw; - height: 80rpx; - background: -webkit-linear-gradient(to right, #ffe259, #ffa751); - background: linear-gradient(to right, #ffe259, #ffa751); - border-radius: 50rpx; - border: 5rpx solid #242529; - margin: 20rpx 0; - - display: flex; - justify-content: center; - align-items: center; - color: #242529; - font-weight: 500; -} - -/** - * 首页刷新好友关系 - */ -.partner-refresh { - width: 100%; - height: 150rpx; - - background: white; - border-radius: 20rpx; - - margin-top: 40rpx; -} - -.invite { - display: block; - width: 100%; - height: 100%; - line-height: 150rpx; - text-align: center; - font-size: 30rpx; - color: #b8b6ce; - text-decoration: underline; -} diff --git a/miniprogram/pages/info/index.js b/miniprogram/pages/info/index.js deleted file mode 100644 index 3bda00a..0000000 --- a/miniprogram/pages/info/index.js +++ /dev/null @@ -1,152 +0,0 @@ -// pages/add/add.js -/* -by DeepZheng -*/ -import Info from "../../manager/Info.js"; - -const app = getApp(); - -Page({ - /** - * 页面的初始数据 - */ - data: { - headerHeight: app.globalData.navHeight + 20, - iPhoneX: false, - icon: [], - weekday: ["一", "二", "三", "四", "五", "六", "日"], - weekday_bool: [true, true, true, true, true, true, true], - date: null, - - title: "", - selected_icon: 1, - selected_weekday: 0, - end_time: null, - share: false, - //userAge: "dfs", - //userCareer: "fsf", - //userName: "dfs", - //userSchool: "", - - // 编辑 - edit_id: null, - text: app.text.add, - }, - - onShow: function () { - if (typeof this.getTabBar === "function" && this.getTabBar()) { - this.getTabBar().setData({ - selected: 3, - page: this, - }); - } - - this.setData({ - page: 0, - }); - - this.loadData(); - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - this.toast = this.selectComponent("#toast"); - console.log("shasda"); - if (options.id != null) { - this.setData({ - edit_id: options.id, - }); - - this.loadInfo(); - - return; - } - - //this.habitAmount(); - }, - - /** - * 加载数据 - */ - loadData: function () { - this.toast.showLoading(); - Info.loadInfo(app.globalData.userInfo._openid).then((res) => { - this.toast.hideLoading(); - // wx.stopPullDownRefresh(); - - console.log(res); - let Name = res[0].name.length > 0 ? res[0].name : ""; - let Age = res[0].age.length > 0 ? res[0].age : " "; - let School = res[0].school.length > 0 ? res[0].school : " "; - let Career = res[0].career.length > 0 ? res[0].career : " "; - this.setData({ - userName: Name, - userAge: Age, - userSchool: School, - userCareer: Career, - }); - }); - }, - - /** - * 是否共享 - */ - shareChange: function (e) { - this.setData({ - share: e.detail.value, - }); - }, - - /** - * save - */ - save: function () { - if (this.data.title.length == 0 || this.data.selected_weekday == 0) { - this.toast.showWarning(this.data.text.saveError); - return; - } - - let data = { - name: this.data.name, - age: this.data.age, - school: this.data.school, - career: this.data.career, - share: this.data.share, - }; - - //this.toast.showLoading(); - if (this.data.edit_id) { - data.end_time = data.end_time == null ? null : new Date(data.end_time); - Info.update(this.data.edit_id, data) - .then((res) => { - this.toast.showSuccess(); - - app.globalData.needReloadData = true; - - wx.switchTab({ - url: "/pages/mineV2/mine", - }); - }) - .catch((err) => { - this.toast.showFailure(err); - }); - } else { - Info.add(data) - .then((res) => { - this.toast.showSuccess(); - - app.globalData.needReloadData = true; - app.globalData.habitAmount = app.globalData.habitAmount + 1; - - wx.switchTab({ - url: "/pages/mineV2/mine", - }); - }) - .catch((err) => { - this.toast.showFailure(err); - }); - } - }, -}); diff --git a/miniprogram/pages/info/index.json b/miniprogram/pages/info/index.json deleted file mode 100644 index a97367d..0000000 --- a/miniprogram/pages/info/index.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "usingComponents": {} -} diff --git a/miniprogram/pages/info/index.wxml b/miniprogram/pages/info/index.wxml deleted file mode 100644 index 9b80f64..0000000 --- a/miniprogram/pages/info/index.wxml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - {{ "我的名字" }} - - - - {{ "学校" }} - - - - {{ "年龄" }} - - - - {{ "职业经历" }} - - - - - - - - - - - - - {{ "修改信息" }} - - - - - - - - {{ text.delete }} - - - - - {{ text.egg }} - {{ text.mango }} - \ No newline at end of file diff --git a/miniprogram/pages/info/index.wxss b/miniprogram/pages/info/index.wxss deleted file mode 100644 index d0a13bf..0000000 --- a/miniprogram/pages/info/index.wxss +++ /dev/null @@ -1,140 +0,0 @@ -/* pages/info/index.wxss */ -page { - background: #f5f5f5; -} - -.interval { - margin-left: 5vw; - width: 90vw; - border-radius: 20rpx; -} - -.body { - height: auto; -} - -/* 图标 */ - -.icon-body { - width: 90vw; - border-radius: 20rpx; - height: 70vw; /* 15 * 4 + 10*/ - background: white; -} - -.flag-icon { - width: 10vw; - height: 10vw; - margin: 2.5vw; - float: left; - border-radius: 10rpx; -} - -.flag-icon-bg { - background: #f5f5f5; -} - -.light-gray-bg { - background: lightgray; -} - -.flag-icon image { - width: 6vw; - height: 6vw; - margin: 2vw; -} - -/* 更多 */ -.other { - margin: 50rpx 0; - border-radius: 20rpx; - width: 90vw; - background: white; - box-sizing: border-box; - -webkit-box-sizing: border-box; - padding: 50rpx 20rpx; -} - -.flag-name-text { - margin-top: 0rpx; -} - -.flag-name { - font-size: 28rpx; - background: #f5f5f5; - height: 70rpx; - padding: 0 20rpx; - border-radius: 10rpx; -} - -.flag-date { - width: 10vw; - height: 10vw; - margin: 0 1vw; - border-radius: 6vw; - float: left; - text-align: center; - line-height: 10vw; - font-size: 30rpx; -} - -.date-on { - color: white; -} - -.flag-date-bg { - background: #f5f5f5; -} - -.no-block { - display: block; - float: left; -} - -.share-switch { - padding: 50rpx 30rpx 20rpx; -} - -.finish-btn, -.del-btn { - width: 50vw; - height: 100rpx; - line-height: 100rpx; - text-align: center; - border-radius: 10rpx; - font-size: 35rpx; - margin: 0 auto; - color: white; -} - -.del-btn { - background: #e64340; - color: white; -} - -.btn-bg { - height: 150rpx; - padding-top: 50rpx; - /* margin: 50rpx auto 150rpx; */ -} - -/* egg */ -.egg { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; -} - -.egg text { - font-size: 25rpx; - text-align: center; -} - -.egg-1 { - color: lightgray; -} - -.egg-2 { - color: #f1f1f1; -} diff --git a/miniprogram/pages/info/infoUpdate/infoUpdate.js b/miniprogram/pages/info/infoUpdate/infoUpdate.js deleted file mode 100644 index 6c57f87..0000000 --- a/miniprogram/pages/info/infoUpdate/infoUpdate.js +++ /dev/null @@ -1,47 +0,0 @@ -// pages/info/infoUpdate/infoUpdate.js -Page({ - /** - * 页面的初始数据 - */ - data: {}, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) {}, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function () {}, - - /** - * 生命周期函数--监听页面显示 - */ - onShow: function () {}, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function () {}, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function () {}, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function () {}, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function () {}, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () {}, -}); diff --git a/miniprogram/pages/info/infoUpdate/infoUpdate.wxml b/miniprogram/pages/info/infoUpdate/infoUpdate.wxml deleted file mode 100644 index 25752bb..0000000 --- a/miniprogram/pages/info/infoUpdate/infoUpdate.wxml +++ /dev/null @@ -1,2 +0,0 @@ - -pages/info/infoUpdate/infoUpdate.wxml diff --git a/miniprogram/pages/infoUpdate/infoUpdate.js b/miniprogram/pages/infoUpdate/infoUpdate.js deleted file mode 100644 index 60d32bd..0000000 --- a/miniprogram/pages/infoUpdate/infoUpdate.js +++ /dev/null @@ -1,204 +0,0 @@ -/* -by DeepZheng -*/ -import Info from "../../manager/Info.js"; - -const app = getApp(); - -Page({ - /** - * 页面的初始数据 - */ - data: { - headerHeight: app.globalData.navHeight + 20, - iPhoneX: false, - icon: [], - weekday: ["一", "二", "三", "四", "五", "六", "日"], - weekday_bool: [true, true, true, true, true, true, true], - date: null, - - title: "", - selected_icon: 1, - selected_weekday: 0, - end_time: null, - share: false, - - // 编辑 - edit_id: null, - text: app.text.add, - }, - - onShow: function () { - if (typeof this.getTabBar === "function" && this.getTabBar()) { - this.getTabBar().setData({ - selected: 3, - page: this, - }); - } - - this.setData({ - page: 0, - }); - - this.loadData(); - }, - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - this.toast = this.selectComponent("#toast"); - - //this.habitAmount(); - }, - - /** - * 加载数据 - */ - loadData: function () { - this.toast.showLoading(); - console.log("load"); - Info.loadInfo(app.globalData.userInfo._openid).then((res) => { - this.toast.hideLoading(); - // wx.stopPullDownRefresh(); - console.log("hhh"); - console.log(res); - let edit_id = res[0]._id.length > 0 ? res[0]._id : null; - let Name = res[0].name.length > 0 ? res[0].name : ""; - let Age = res[0].age.length > 0 ? res[0].age : " "; - let School = res[0].school.length > 0 ? res[0].school : " "; - let Career = res[0].career.length > 0 ? res[0].career : " "; - console.log("set"); - this.setData({ - userName: Name, - userAge: Age, - userSchool: School, - userCareer: Career, - edit_id: edit_id, - }); - console.log(this.data.userCareer); - console.log("career"); - }); - }, - /** - * 名字 - */ - nameInput: function (e) { - let value = e.detail.value; - - if (value.length >= 10) { - wx.showToast({ - title: this.data.text.nameLength, - icon: "none", - }); - } - - this.setData({ - name: value, - }); - }, - /** - * 学校 - */ - schoolInput: function (e) { - let value = e.detail.value; - - if (value.length >= 20) { - wx.showToast({ - title: this.data.text.schoolLength, - icon: "none", - }); - } - - this.setData({ - school: value, - }); - }, - /** - * 年龄 - */ - ageInput: function (e) { - let value = e.detail.value; - console.log(value); - if (value.length >= 5) { - wx.showToast({ - title: this.data.text.ageLength, - icon: "none", - }); - } - - this.setData({ - age: value, - }); - }, - /** - * 职业 - */ - careerInput: function (e) { - let value = e.detail.value; - - if (value.length >= 20) { - wx.showToast({ - title: this.data.text.careerLength, - icon: "none", - }); - } - - this.setData({ - career: value, - }); - }, - - /** - * 是否共享 - */ - shareChange: function (e) { - this.setData({ - share: e.detail.value, - }); - }, - - /** - * save - */ - save: function () { - let data = { - name: this.data.name, - age: this.data.age, - school: this.data.school, - career: this.data.career, - share: this.data.share, - }; - - this.toast.showLoading(); - if (this.data.edit_id != null) { - data.end_time = data.end_time == null ? null : new Date(data.end_time); - Info.update(this.data.edit_id, data) - .then((res) => { - this.toast.showSuccess(); - - app.globalData.needReloadData = true; - - wx.switchTab({ - url: "/pages/info/index", - }); - }) - .catch((err) => { - this.toast.showFailure(err); - }); - } else { - Info.add(data) - .then((res) => { - this.toast.showSuccess(); - - app.globalData.needReloadData = true; - - wx.switchTab({ - url: "/pages/mineV2/mine", - }); - }) - .catch((err) => { - this.toast.showFailure(err); - }); - } - }, -}); diff --git a/miniprogram/pages/infoUpdate/infoUpdate.json b/miniprogram/pages/infoUpdate/infoUpdate.json deleted file mode 100644 index a97367d..0000000 --- a/miniprogram/pages/infoUpdate/infoUpdate.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "usingComponents": {} -} diff --git a/miniprogram/pages/infoUpdate/infoUpdate.wxml b/miniprogram/pages/infoUpdate/infoUpdate.wxml deleted file mode 100644 index 5078769..0000000 --- a/miniprogram/pages/infoUpdate/infoUpdate.wxml +++ /dev/null @@ -1,53 +0,0 @@ - -pages/info/infoUpdate/infoUpdate.wxml - - - - - - - - - - {{ "我的名字" }} - - - - {{ "学校" }} - - - - {{ "年龄" }} - - - - {{ "职业经历" }} - - - - - - - - - - - {{ text.finish }} - - - - - - {{ text.egg }} - {{ text.mango }} - \ No newline at end of file diff --git a/miniprogram/pages/infoUpdate/infoUpdate.wxss b/miniprogram/pages/infoUpdate/infoUpdate.wxss deleted file mode 100644 index 7e00709..0000000 --- a/miniprogram/pages/infoUpdate/infoUpdate.wxss +++ /dev/null @@ -1,141 +0,0 @@ -/* pages/info/infoUpdate/infoUpdate.wxss */ -/* pages/info/index.wxss */ -page { - background: #f5f5f5; -} - -.interval { - margin-left: 5vw; - width: 90vw; - border-radius: 20rpx; -} - -.body { - height: auto; -} - -/* 图标 */ - -.icon-body { - width: 90vw; - border-radius: 20rpx; - height: 70vw; /* 15 * 4 + 10*/ - background: white; -} - -.flag-icon { - width: 10vw; - height: 10vw; - margin: 2.5vw; - float: left; - border-radius: 10rpx; -} - -.flag-icon-bg { - background: #f5f5f5; -} - -.light-gray-bg { - background: lightgray; -} - -.flag-icon image { - width: 6vw; - height: 6vw; - margin: 2vw; -} - -/* 更多 */ -.other { - margin: 50rpx 0; - border-radius: 20rpx; - width: 90vw; - background: white; - box-sizing: border-box; - -webkit-box-sizing: border-box; - padding: 50rpx 20rpx; -} - -.flag-name-text { - margin-top: 0rpx; -} - -.flag-name { - font-size: 28rpx; - background: #f5f5f5; - height: 70rpx; - padding: 0 20rpx; - border-radius: 10rpx; -} - -.flag-date { - width: 10vw; - height: 10vw; - margin: 0 1vw; - border-radius: 6vw; - float: left; - text-align: center; - line-height: 10vw; - font-size: 30rpx; -} - -.date-on { - color: white; -} - -.flag-date-bg { - background: #f5f5f5; -} - -.no-block { - display: block; - float: left; -} - -.share-switch { - padding: 50rpx 30rpx 20rpx; -} - -.finish-btn, -.del-btn { - width: 50vw; - height: 100rpx; - line-height: 100rpx; - text-align: center; - border-radius: 10rpx; - font-size: 35rpx; - margin: 0 auto; - color: white; -} - -.del-btn { - background: #e64340; - color: white; -} - -.btn-bg { - height: 150rpx; - padding-top: 50rpx; - /* margin: 50rpx auto 150rpx; */ -} - -/* egg */ -.egg { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; -} - -.egg text { - font-size: 25rpx; - text-align: center; -} - -.egg-1 { - color: lightgray; -} - -.egg-2 { - color: #f1f1f1; -} diff --git a/miniprogram/pages/information/basicInformation/basicInformation.js b/miniprogram/pages/information/basic_information/basic_information.js similarity index 100% rename from miniprogram/pages/information/basicInformation/basicInformation.js rename to miniprogram/pages/information/basic_information/basic_information.js diff --git a/miniprogram/pages/information/basicInformation/basicInformation.json b/miniprogram/pages/information/basic_information/basic_information.json similarity index 100% rename from miniprogram/pages/information/basicInformation/basicInformation.json rename to miniprogram/pages/information/basic_information/basic_information.json diff --git a/miniprogram/pages/information/basicInformation/basicInformation.wxml b/miniprogram/pages/information/basic_information/basic_information.wxml similarity index 100% rename from miniprogram/pages/information/basicInformation/basicInformation.wxml rename to miniprogram/pages/information/basic_information/basic_information.wxml diff --git a/miniprogram/pages/information/basicInformation/basicInformation.wxss b/miniprogram/pages/information/basic_information/basic_information.wxss similarity index 100% rename from miniprogram/pages/information/basicInformation/basicInformation.wxss rename to miniprogram/pages/information/basic_information/basic_information.wxss diff --git a/miniprogram/pages/information/educationExperience/educationExperience.js b/miniprogram/pages/information/education_experience/education_experience.js similarity index 100% rename from miniprogram/pages/information/educationExperience/educationExperience.js rename to miniprogram/pages/information/education_experience/education_experience.js diff --git a/miniprogram/pages/information/educationExperience/educationExperience.json b/miniprogram/pages/information/education_experience/education_experience.json similarity index 100% rename from miniprogram/pages/information/educationExperience/educationExperience.json rename to miniprogram/pages/information/education_experience/education_experience.json diff --git a/miniprogram/pages/information/educationExperience/educationExperience.wxml b/miniprogram/pages/information/education_experience/education_experience.wxml similarity index 100% rename from miniprogram/pages/information/educationExperience/educationExperience.wxml rename to miniprogram/pages/information/education_experience/education_experience.wxml diff --git a/miniprogram/pages/information/educationExperience/educationExperience.wxss b/miniprogram/pages/information/education_experience/education_experience.wxss similarity index 100% rename from miniprogram/pages/information/educationExperience/educationExperience.wxss rename to miniprogram/pages/information/education_experience/education_experience.wxss diff --git a/miniprogram/pages/information/myTag/myTag.js b/miniprogram/pages/information/my_tag/my_tag.js similarity index 100% rename from miniprogram/pages/information/myTag/myTag.js rename to miniprogram/pages/information/my_tag/my_tag.js diff --git a/miniprogram/pages/information/myTag/myTag.json b/miniprogram/pages/information/my_tag/my_tag.json similarity index 100% rename from miniprogram/pages/information/myTag/myTag.json rename to miniprogram/pages/information/my_tag/my_tag.json diff --git a/miniprogram/pages/information/myTag/myTag.wxml b/miniprogram/pages/information/my_tag/my_tag.wxml similarity index 100% rename from miniprogram/pages/information/myTag/myTag.wxml rename to miniprogram/pages/information/my_tag/my_tag.wxml diff --git a/miniprogram/pages/information/myTag/myTag.wxss b/miniprogram/pages/information/my_tag/my_tag.wxss similarity index 100% rename from miniprogram/pages/information/myTag/myTag.wxss rename to miniprogram/pages/information/my_tag/my_tag.wxss diff --git a/miniprogram/pages/information/workingExperience/workingExperience.js b/miniprogram/pages/information/working_experience/working_experience.js similarity index 100% rename from miniprogram/pages/information/workingExperience/workingExperience.js rename to miniprogram/pages/information/working_experience/working_experience.js diff --git a/miniprogram/pages/information/workingExperience/workingExperience.json b/miniprogram/pages/information/working_experience/working_experience.json similarity index 100% rename from miniprogram/pages/information/workingExperience/workingExperience.json rename to miniprogram/pages/information/working_experience/working_experience.json diff --git a/miniprogram/pages/information/workingExperience/workingExperience.wxml b/miniprogram/pages/information/working_experience/working_experience.wxml similarity index 100% rename from miniprogram/pages/information/workingExperience/workingExperience.wxml rename to miniprogram/pages/information/working_experience/working_experience.wxml diff --git a/miniprogram/pages/information/workingExperience/workingExperience.wxss b/miniprogram/pages/information/working_experience/working_experience.wxss similarity index 100% rename from miniprogram/pages/information/workingExperience/workingExperience.wxss rename to miniprogram/pages/information/working_experience/working_experience.wxss diff --git a/miniprogram/pages/invite/invite.js b/miniprogram/pages/invite/invite.js deleted file mode 100644 index 96a4c3c..0000000 --- a/miniprogram/pages/invite/invite.js +++ /dev/null @@ -1,213 +0,0 @@ -// pages/invite/invite.js -const app = getApp(); - -import User from "../../manager/User"; -import Partner from "../../manager/Partner"; - -Page({ - /** - * 页面的初始数据 - */ - data: { - text: app.text.invite, - navHeight: app.globalData.navHeight, - - userInfo: null, - - bg: [ - "cloud://mango-604951.6d61-mango-604951/system/invite_bg1.png", - "cloud://mango-604951.6d61-mango-604951/system/invite_bg2.png", - "cloud://mango-604951.6d61-mango-604951/system/invite_bg3.png", - ], - - selected: 0, // 已经选择的背景图 - name: "", - content: "", - - user_id: null, - invite: false, - loading: true, // 来自邀请界面网络加载 - user: null, - }, - - onShow: function () { - this.setData({ - userInfo: app.globalData.userInfo, - }); - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - this.toast = this.selectComponent("#toast"); - - if (options.user_id) { - let user_id = options.user_id; - let name = options.name ? decodeURIComponent(options.name) : ""; - let content = options.content ? decodeURIComponent(options.content) : ""; - let index = options.index; - - this.setData({ - invite: true, - user_id: user_id, - name: name, - content: content, - selected: index, - }); - - this.toast.showLoading(); - User.findUser(user_id) - .then((res) => { - this.toast.hideLoading(); - - this.setData({ - loading: false, - user: res, - }); - }) - .catch((err) => { - this.toast.showFailure("找不到这个人哦"); - }); - } else { - let placeholder = this.data.text.placeholder[0]; - - this.setData({ - name: placeholder.name, - content: placeholder.content, - }); - } - }, - - /** - * 选择背景图 - */ - selectBg: function (e) { - let index = e.currentTarget.dataset.index; - let placeholder = this.data.text.placeholder[index]; - - this.setData({ - selected: index, - name: placeholder.name, - content: placeholder.content, - }); - }, - - /** - * 输入昵称 - */ - nameInput: function (e) { - this.setData({ - name: e.detail.value, - }); - }, - - /** - * 输入邀请语 - */ - contentInput: function (e) { - this.setData({ - content: e.detail.value, - }); - }, - - /** - * 接受 - */ - receive: function () { - if (this.data.userInfo) { - this.toast.showLoading(); - - User.myPartner(this.data.userInfo._openid) - .then((res) => { - if (res == null) { - Partner.bind(this.data.userInfo._openid, this.data.user_id) - .then((res) => { - this.toast.showSuccess("绑定成功"); - - wx.setStorageSync("invite", null); - - app.globalData.needReloadPartner = true; - wx.reLaunch({ - url: "/pages/indexV2/index", - }); - }) - .catch((err) => { - this.toast.showFailure("服务器离家出走啦"); - }); - } else { - this.toast.hideLoading(); - - wx.showModal({ - title: "你已经有小伙伴啦", - content: - "如果你想好了,你可以到设置里面与已经绑定的小伙伴解除关系。", - showCancel: false, - }); - } - }) - .catch((err) => { - this.toast.showFailure("服务器离家出走啦"); - }); - } else { - let path = - "/pages/invite/invite?user_id=" + - this.data.user_id + - "&index=" + - this.data.selected + - "&name=" + - encodeURIComponent(this.data.name) + - "&content=" + - encodeURIComponent(this.data.content); - wx.setStorageSync("invite", path); - - wx.redirectTo({ - url: "/pages/loginV2/login", - }); - } - }, - - /** - * 拒绝 - */ - reject: function () { - wx.showModal({ - title: "Mango Daily", - content: "要不,我带你去首页看看吧", - success: function (res) { - if (res.confirm) { - wx.switchTab({ - url: "/pages/indexV2/index", - }); - } - }, - }); - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - wx.setStorageSync("invite", true); - - let path = - "/pages/invite/invite?user_id=" + - this.data.userInfo._openid + - "&index=" + - this.data.selected + - "&name=" + - encodeURIComponent(this.data.name) + - "&content=" + - encodeURIComponent(this.data.content); - - return { - title: this.data.name + " " + this.data.content, - path: path, - success: (res) => { - wx.switchTab({ - url: "/pages/indexV2/index", - }); - }, - }; - }, -}); diff --git a/miniprogram/pages/invite/invite.json b/miniprogram/pages/invite/invite.json deleted file mode 100644 index a97367d..0000000 --- a/miniprogram/pages/invite/invite.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "usingComponents": {} -} diff --git a/miniprogram/pages/invite/invite.wxml b/miniprogram/pages/invite/invite.wxml deleted file mode 100644 index fc9834a..0000000 --- a/miniprogram/pages/invite/invite.wxml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - {{ name }} - {{ content }} - - {{ text.receive }} - {{ text.reject }} - - - {{ text.mangoTip }} - - - - - - - - - - {{ name }} - {{ content }} - - - - - - - {{ text.bgTip }} - - - - - - - - - - {{ text.nameTip }} - - - - - {{ text.contentTip }} - - - - - - - - - - \ No newline at end of file diff --git a/miniprogram/pages/invite/invite.wxss b/miniprogram/pages/invite/invite.wxss deleted file mode 100644 index 3e2f89f..0000000 --- a/miniprogram/pages/invite/invite.wxss +++ /dev/null @@ -1,196 +0,0 @@ -/* pages/invite/invite.wxss */ -@import "/Mango/Animation/mango.wxss"; - -page { - background: #f5f5f5; -} - -.interval { - width: 90vw; - margin: 20rpx 5vw; -} - -.body { - width: 100vw; - height: 80vw; - background: lightgray; - - position: relative; -} - -.body .placeholder { - position: absolute; - - width: 100%; - height: 100%; - - background: rgba(0, 0, 0, 0.1); - - box-sizing: border-box; - -webkit-box-sizing: border-box; - - padding: 0 150rpx 0 50rpx; - - display: flex; - flex-direction: column; - justify-content: center; - align-items: flex-start; - - color: white; - font-weight: bold; -} - -.name { - font-size: 80rpx; -} - -.content { - font-size: 40rpx; - padding: 15rpx 0; -} - -.avatar { - width: 120rpx; - height: 120rpx; - border-radius: 50%; - - margin-bottom: 50rpx; -} - -.body image { - width: 100%; - height: 100%; -} - -.images { - width: 100%; - height: 120rpx; - - display: flex; -} - -.images .bg { - flex: 1; - height: 100%; - background: white; - margin: 0 10rpx; - - border-radius: 20rpx; - - overflow: hidden; - - position: relative; -} - -.select-blur { - width: 100%; - height: 100%; - - position: absolute; - background: rgba(0, 0, 0, 0.4); -} - -.images .bg image { - width: 100%; - height: 100%; -} - -input { - font-size: 28rpx; - background: #eaeaea; - height: 80rpx; - padding: 0 20rpx; - border-radius: 10rpx; -} - -/* .btn-bg { - height: 150rpx; - padding-top: 50rpx; -} */ - -.finish-btn { - width: 50vw; - height: 80rpx; - background: -webkit-linear-gradient(to right, #ffe259, #ffa751); - background: linear-gradient(to right, #ffe259, #ffa751); - border-radius: 50rpx; - border: 5rpx solid #242529; - margin: 50rpx auto; - - display: flex; - justify-content: center; - align-items: center; - color: #242529; - font-weight: 500; -} - -/** - * 来自邀请 - */ -.from-body { - width: 100vw; - height: 100vh; - - position: relative; - - color: white; - font-weight: bold; -} - -.from-bg { - width: 100%; - height: 100%; - - filter: blur(10px); - -webkit-filter: blur(10px); -} - -.from-content { - position: absolute; - left: 0; - top: 0; - - width: 100%; - height: 100%; - - display: flex; - flex-direction: column; - justify-content: center; - text-align: center; -} - -.buttons { - margin-top: 100rpx; - - display: flex; - flex-direction: column; - align-items: center; -} - -.receive-btn { - width: 50vw; - height: 80rpx; - line-height: 80rpx; - - border-radius: 40rpx; - - background: rgba(255, 255, 255, 0.2); - - margin-bottom: 40rpx; -} - -.reject-btn { - font-size: 25rpx; - text-decoration: underline; -} - -.mango-daily { - width: 100%; - - position: absolute; - bottom: 50px; - - font-size: 20rpx; - text-align: center; - font-weight: 300; -} diff --git a/miniprogram/pages/login/login.js b/miniprogram/pages/login/login.js deleted file mode 100644 index 4d22553..0000000 --- a/miniprogram/pages/login/login.js +++ /dev/null @@ -1,43 +0,0 @@ -const defaultAvatarUrl = - "https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0"; - -Page({ - data: { - avatarFlag: false, - phoneFlag: false, - code: null, - - avatarUrl: defaultAvatarUrl, - phoneNumber: null, - }, - - startFunction: function () { - wx.redirectTo({ - url: "../information/educationExperience/educationExperience", - }); - }, - - getPhoneNumber(e) { - // 用户拒绝授权 - if (e.detail.errMsg == "getPhoneNumber:fail user deny") { - wx.showToast({ - icon: "none", - title: "请允许获取手机号,否则功能不可用!", - }); - return; - } - this.setData({ - code: e.detail.code, - phoneFlag: true, - }); - console.log(this.data.code); - }, - - onChooseAvatar(e) { - this.setData({ - avatarUrl: e.detail, - avatarFlag: true, - }); - console.log(this.data.avatarUrl); - }, -}); diff --git a/miniprogram/pages/loginV2/login.js b/miniprogram/pages/loginV2/login.js deleted file mode 100644 index 2a3a69f..0000000 --- a/miniprogram/pages/loginV2/login.js +++ /dev/null @@ -1,99 +0,0 @@ -// pages/about/index.js -import User from "../../manager/User.js"; - -const app = getApp(); - -Page({ - /** - * 页面的初始数据 - */ - data: { - text: app.text.login, - - data: [ - { - title: "芒果Daily", - data: "与好朋友共享每日清单\n快去提醒Ta打卡吧", - }, - ], - - loading: false, - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - this.hello = this.selectComponent("#hello"); - app.globalData.needReloadPartner = false; - }, - - login: function (e) { - this.setData({ - loading: true, - }); - - // 拒绝授权 - if (e.detail.errMsg == "getUserInfo:fail auth deny") { - wx.showModal({ - title: "请授权", - content: "否则您无法继续使用", - showCancel: false, - }); - - this.setData({ - loading: false, - }); - - return; - } - - wx.cloud - .callFunction({ - name: "login", - }) - .then((res) => { - //console.log(res) - if (res.errMsg == "cloud.callFunction:ok") { - let _openid = res.result.openid; - let userInfo = e.detail.userInfo; - userInfo._openid = _openid; - - User.login(userInfo) - .then((res) => { - app.globalData.userInfo = res.userInfo; - wx.setStorageSync("userInfo", res.userInfo); - - app.globalData.partnerInfo = res.partnerInfo; - wx.setStorageSync("partnerInfo", res.partnerInfo); - - this.hello.show(userInfo.nickname); - }) - .catch((err) => { - wx.showModal({ - title: "错误", - content: "网络异常[0]", - showCancel: false, - }); - - console.log(err); - }); - } else { - wx.showModal({ - title: "错误", - content: "网络异常[1]", - showCancel: false, - }); - } - }) - .catch((code, msg) => { - console.log(code, msg); - - wx.showModal({ - title: "错误", - content: "网络异常[2]", - showCancel: false, - }); - }); - }, -}); diff --git a/miniprogram/pages/loginV2/login.json b/miniprogram/pages/loginV2/login.json deleted file mode 100644 index 4193a77..0000000 --- a/miniprogram/pages/loginV2/login.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "usingComponents": { - "hello": "/components/hello/hello" - } -} diff --git a/miniprogram/pages/loginV2/login.wxml b/miniprogram/pages/loginV2/login.wxml deleted file mode 100644 index 7243bc3..0000000 --- a/miniprogram/pages/loginV2/login.wxml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - {{ text.title }} - - {{ text.tip1 }} - {{ text.tip2 }} - {{ text.tip3 }} - - - - - - - - - - - - - \ No newline at end of file diff --git a/miniprogram/pages/loginV2/login.wxss b/miniprogram/pages/loginV2/login.wxss deleted file mode 100644 index d48a76e..0000000 --- a/miniprogram/pages/loginV2/login.wxss +++ /dev/null @@ -1,266 +0,0 @@ -/* pages/loginV2/login.wxss */ - -@import "../../Mango/Animation/mango.wxss"; - -.login-body { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - width: 100vw; - height: 100vh; - background: #f5f5f5; -} - -.logo-text { - font-size: 50rpx; - font-weight: bold; - font-family: "Courier New", Courier, monospace; -} - -.tip { - margin-top: 100rpx; - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; -} - -.tip text { - line-height: 80rpx; - font-size: 30rpx; - color: gray; - font-weight: 300; -} -.bottom { - position: relative; - /* margin-bottom: 150rpx; */ -} - -button { - background-color: transparent; - z-index: 9; - position: absolute; - top: 50%; - left: 0; - right: 0; - margin: 0 auto; -} - -button::after { - border: 0; -} - -button[disabled], -button[disabled]:not([type]), -.button-hover { - background-color: transparent; -} - -/** - * 动画 - */ - -.watch-face { - margin-top: 100rpx; - - height: 250rpx; - width: 250rpx; - - display: flex; - justify-content: center; - align-items: center; - -webkit-transform-origin: center center; - transform-origin: center center; - - mix-blend-mode: screen; -} - -.circle { - background: #fff; - height: 125rpx; - width: 125rpx; - border-radius: 50%; - position: absolute; - mix-blend-mode: screen; - transform: translate(0, 0); - -webkit-transform: translate(0, 0); -} - -.circle:nth-child(odd) { - background: #61bea2; -} - -.circle:nth-child(even) { - background: #529ca0; -} - -.circle:nth-child(1) { - animation: circle-1 4s ease alternate infinite; - -webkit-animation: circle-1 4s ease alternate infinite; -} - -.circle:nth-child(2) { - animation: circle-2 4s ease alternate infinite; - -webkit-animation: circle-2 4s ease alternate infinite; -} - -.circle:nth-child(3) { - animation: circle-3 4s ease alternate infinite; - -webkit-animation: circle-3 4s ease alternate infinite; -} - -.circle:nth-child(4) { - animation: circle-4 4s ease alternate infinite; - -webkit-animation: circle-4 4s ease alternate infinite; -} - -.circle:nth-child(5) { - animation: circle-5 4s ease alternate infinite; - -webkit-animation: circle-5 4s ease alternate infinite; -} - -.circle:nth-child(6) { - animation: circle-6 4s ease alternate infinite; - -webkit-animation: circle-6 4s ease alternate infinite; -} - -.pulse { - animation: pulse 8s linear normal infinite; -} - -@keyframes circle-1 { - 0% { - transform: translate(0, 0); - } - 100% { - transform: translate(-35rpx, -50rpx); - } -} -@-webkit-keyframes circle-1 { - 0% { - transform: translate(0, 0); - -webkit-transform: translate(0, 0); - } - 100% { - transform: translate(-35rpx, -50rpx); - -webkit-transform: translate(-35rpx, -50rpx); - } -} - -@keyframes circle-2 { - 0% { - transform: translate(0, 0); - } - 100% { - transform: translate(35rpx, 50rpx); - } -} -@-webkit-keyframes circle-2 { - 0% { - transform: translate(0, 0); - -webkit-transform: translate(0, 0); - } - 100% { - transform: translate(35rpx, 50rpx); - -webkit-transform: translate(35rpx, 50rpx); - } -} - -@keyframes circle-3 { - 0% { - transform: translate(0, 0); - } - 100% { - transform: translate(-60rpx, 0); - } -} -@-webkit-keyframes circle-3 { - 0% { - transform: translate(0, 0); - -webkit-transform: translate(0, 0); - } - 100% { - transform: translate(-60rpx, 0); - -webkit-transform: translate(-60rpx, 0); - } -} - -@keyframes circle-4 { - 0% { - transform: translate(0, 0); - } - 100% { - transform: translate(60rpx, 0); - } -} -@-webkit-keyframes circle-4 { - 0% { - transform: translate(0, 0); - -webkit-transform: translate(0, 0); - } - 100% { - transform: translate(60rpx, 0); - -webkit-transform: translate(60rpx, 0); - } -} - -@keyframes circle-5 { - 0% { - transform: translate(0, 0); - } - 100% { - transform: translate(-35rpx, 50rpx); - } -} -@-webkit-keyframes circle-5 { - 0% { - transform: translate(0, 0); - -webkit-transform: translate(0, 0); - } - 100% { - transform: translate(-35rpx, 50rpx); - -webkit-transform: translate(-35rpx, 50rpx); - } -} - -@keyframes circle-6 { - 0% { - transform: translate(0, 0); - } - 100% { - transform: translate(35rpx, -50rpx); - } -} -@-webkit-keyframes circle-6 { - 0% { - transform: translate(0, 0); - -webkit-transform: translate(0, 0); - } - 100% { - transform: translate(35rpx, -50rpx); - -webkit-transform: translate(35rpx, -50rpx); - } -} - -@keyframes pulse { - 0% { - transform: rotate(0); - } - - 100% { - transform: rotate(360deg); - } -} - -@-webkit-keyframes pulse { - 0% { - transform: rotate(0); - -webkit-transform: rotate(0); - } - - 100% { - transform: rotate(360deg); - -webkit-transform: rotate(360deg); - } -} diff --git a/miniprogram/pages/mine/mine.json b/miniprogram/pages/mine/mine.json index ab91c7d..a97367d 100644 --- a/miniprogram/pages/mine/mine.json +++ b/miniprogram/pages/mine/mine.json @@ -1,4 +1,3 @@ { - "usingComponents": {}, - "navigationBarBackgroundColor": "#4F80FF" + "usingComponents": {} } diff --git a/miniprogram/pages/mine/mine.wxml b/miniprogram/pages/mine/mine.wxml index 230971f..eb874ce 100644 --- a/miniprogram/pages/mine/mine.wxml +++ b/miniprogram/pages/mine/mine.wxml @@ -3,7 +3,7 @@ - diff --git a/miniprogram/pages/mineV2/mine.js b/miniprogram/pages/mineV2/mine.js deleted file mode 100644 index 0c23f40..0000000 --- a/miniprogram/pages/mineV2/mine.js +++ /dev/null @@ -1,136 +0,0 @@ -// pages/mineV2/mine.js -import Habit from "../../manager/Habit.js"; - -const app = getApp(); - -Page({ - /** - * 页面的初始数据 - */ - data: { - theme: app.globalData.theme, - iPhoneX: false, - userInfo: null, - partnerInfo: null, - partner: false, - page: 0, - lists: [], - weekday: ["一", "二", "三", "四", "五", "六", "日"], - - animation: null, - - text: app.text.mine, - sinceToday: 0, - partnerTime: 0, - }, - - onShow: function () { - if (typeof this.getTabBar === "function" && this.getTabBar()) { - this.getTabBar().setData({ - selected: 3, - page: this, - }); - } - - this.setData({ - page: 0, - }); - - this.loadData(); - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - this.nav = this.selectComponent("#nav"); - this.toast = this.selectComponent("#toast"); - - this.setData({ - iPhoneX: app.globalData.iPhoneX, - }); - - // 用户信息 - this.setData({ - userInfo: app.globalData.userInfo, - partnerInfo: app.globalData.partnerInfo, - partner: app.globalData.partnerInfo == null ? false : true, - sinceToday: app.util.sinceToday(app.globalData.userInfo.register_time), - partnerTime: - app.globalData.partnerInfo == null - ? 0 - : app.util.sinceToday(app.globalData.partnerInfo.bind_time), - }); - }, - - /** - * 加载数据 - */ - loadData: function () { - this.toast.showLoading(); - Habit.loadAll(app.globalData.userInfo._openid, this.data.page) - .then((res) => { - this.toast.hideLoading(); - - let today = new Date(); - let lists = this.data.page == 0 ? [] : this.data.lists; - - let time = new Date(new Date().setHours(0, 0, 0, 0)).getTime(); - let day = 24 * 3600 * 1000; - - res.forEach((value, _) => { - value.weekday = this.weekDayChange(value.weekday); - value.lastday = - value.end_time == null - ? "∞" - : parseInt((value.end_time.getTime() + day - time) / day); - lists.push(value); - }); - - console.log(res); - this.setData({ - page: this.data.page + 1, - lists: lists, - }); - }) - .catch((err) => { - console.log(err); - this.toast.showFailure(err); - }); - }, - - /** - * 每周相关转换 - */ - weekDayChange: function (number) { - let array = [false, false, false, false, false, false, false]; - let index = 0; - number = number.toString(2); - for (let i = number.length - 1; i >= 0; i--) { - array[index++] = number[i] == 1; - } - - return array; - }, - - /** - * 上滑加载更多 - */ - // onReachBottom: function(){ - // this.loadData(); - // }, - - addHabit: function () { - wx.navigateTo({ - url: "/pages/add/add", - }); - }, - - onPageScroll: function (e) { - if (e.scrollTop <= app.globalData.headerHeight) { - this.nav.hide(); - } else { - this.nav.show(); - } - }, -}); diff --git a/miniprogram/pages/mineV2/mine.json b/miniprogram/pages/mineV2/mine.json deleted file mode 100644 index 66ab717..0000000 --- a/miniprogram/pages/mineV2/mine.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "usingComponents": {}, - "enablePullDownRefresh": true -} diff --git a/miniprogram/pages/mineV2/mine.wxml b/miniprogram/pages/mineV2/mine.wxml deleted file mode 100644 index 0026881..0000000 --- a/miniprogram/pages/mineV2/mine.wxml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - - - - - - - - - - - {{ partner ? (partnerInfo.sex == 1 ? text.myPartnerBoy : text.myPartnerGirl ) : text.myPartner}} - - - - - - - - - {{ partnerInfo.nickname }} - {{ text.together }} {{ partnerTime }} 天 - - - - - - {{ text.inviteTip }} - - - - - - - {{ "我的信息"}} - - - - - {{ "查看我的信息" }} - - - - - - - - {{ text.myHabit }} - - - - - {{ text.empty }} - {{ text.addHabit }} - - - - - - - - - - - - - - - {{ item.title }} - - - {{ text.habitTip1 }}{{ item.times}} 次 · {{ item.lastday >= 0 || item.lastday == '∞' ? text.habitTip2 + item.lastday + " 天" : text.habitFinish }} - - - - - - - - - - -
\ No newline at end of file diff --git a/miniprogram/pages/mineV2/mine.wxss b/miniprogram/pages/mineV2/mine.wxss deleted file mode 100644 index 77f9378..0000000 --- a/miniprogram/pages/mineV2/mine.wxss +++ /dev/null @@ -1,293 +0,0 @@ -/* pages/mineV2/mine.wxss */ -@import "/Mango/UI/theme/default.wxss"; -@import "/Mango/Animation/mango.wxss"; - -page { - background: #f5f5f5; - min-height: 100vh; -} - -.body { - width: 100vw; - background: #f5f5f5; -} - -.interval { - margin-left: 5vw; - width: 90vw; -} - -.header-bg { - width: 100%; - height: 400rpx; - position: relative; -} - -.user-info { - display: flex; - flex-direction: column; - justify-content: flex-start; - /* align-items: center */ - position: absolute; - bottom: 0; - background: white; - height: 200rpx; - border-radius: 20rpx; - box-sizing: border-box; - -webkit-box-sizing: border-box; - - padding: 90rpx 5vw 10rpx; -} - -.setting { - width: 60rpx; - height: 60rpx; - - display: right; - position: absolute; - right: 8vw; - bottom: 125rpx; -} - -.user-name { - color: #3b353e; - font-weight: bold; - font-size: 45rpx; - font-family: "Courier New", Courier, monospace; -} - -.day { - color: #b8b6ce; - font-size: 25rpx; - font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif; -} - -.avatar { - width: 150rpx; - height: 150rpx; - border-radius: 50%; - display: float; - position: absolute; - left: 10vw; - bottom: 125rpx; -} - -.header-text-bg { - background: white; - height: 150rpx; -} - -.header-text { - display: flex; - justify-content: space-between; - align-items: flex-end; -} - -.header-text .textarea { - display: flex; - flex-direction: column; - justify-content: center; - align-items: flex-start; -} - -.header-text .invite-btn { - font-size: 35rpx; - width: 180rpx; - height: 60rpx; - text-align: center; - line-height: 60rpx; - color: white; - border-radius: 10rpx; -} - -.header-text .line { - width: 100rpx; - height: 5rpx; - border-radius: 5rpx; -} - -.header-text text { - font-size: 30rpx; - font-weight: 300; -} - -/** - * 统计 - */ - -.flag-statis { - width: 100%; - height: 100rpx; - margin-top: 50rpx; -} - -.flag-statis-layout { - width: 33%; - height: 100rpx; - float: left; -} - -.flag-statis-layout text { - display: block; - text-align: center; -} - -.layout-num { - line-height: 50rpx; - font-weight: bold; -} - -.layout-text { - font-size: 24rpx; - color: lightgray; -} - -/** -* cell -*/ - -.habit-list { - background: white; - height: auto; - margin: 30rpx auto; - border-radius: 20rpx; - overflow: hidden; -} - -.empty { - width: 100%; - height: 150rpx; - text-align: center; - font-size: 25rpx; - line-height: 50rpx; - color: lightgray; - text-decoration: underline; - - display: flex; - flex-direction: column; - justify-content: center; -} - -/* 清单 */ -.list-cell { - width: 90vw; - height: 150rpx; - position: relative; - margin: 10rpx auto; - - display: flex; - flex-direction: row; - justify-content: flex-start; - align-items: center; -} - -.list-cell-left { - display: flex; - justify-content: center; - align-items: center; - width: 150rpx; - height: 150rpx; -} - -.list-cell-icon { - width: 70rpx; - height: 70rpx; - background: #f5f5f5; - - display: flex; - justify-content: center; - align-items: center; -} - -.list-cell-icon image, -.list-cell-right image { - width: 40rpx; - height: 40rpx; -} - -.list-cell-content-title { - font-size: 30rpx; - color: #242529; - font-weight: bold; -} - -.list-cell-content { - width: auto; - height: 150rpx; - - display: flex; - flex-direction: column; - justify-content: center; - align-items: flex-start; -} - -.list-cell-right { - width: 150rpx; - height: 150rpx; - line-height: 130rpx; - text-align: center; - position: absolute; - top: 0; - right: 0; -} - -/** - * 伙伴 - */ -.partner { - height: 150rpx; - border-radius: 20rpx; - background: white; - margin: 30rpx auto; -} - -.invite { - display: block; - width: 100%; - height: 100%; - line-height: 150rpx; - text-align: center; - font-size: 30rpx; - color: #b8b6ce; - text-decoration: underline; -} - -.partner-info { - width: 100%; - height: 100%; - - display: flex; - justify-content: flex-start; - align-items: center; -} - -.partner-avatar { - width: 150rpx; - height: 150rpx; - - display: flex; - justify-content: center; - align-items: center; -} - -.partner-avatar image { - width: 100rpx; - height: 100rpx; - border-radius: 50%; -} - -.partner-name { - height: 150rpx; - display: flex; - flex-direction: column; - justify-content: center; - align-items: flex-start; -} - -.partner-name .user-name { - font-size: 35rpx; -} - -.partner-name .day { - padding-top: 10rpx; -} diff --git a/miniprogram/pages/myApplication/myApplication.js b/miniprogram/pages/myApplication/myApplication.js deleted file mode 100644 index 188d2a1..0000000 --- a/miniprogram/pages/myApplication/myApplication.js +++ /dev/null @@ -1,17 +0,0 @@ -// pages/myApplication/myApplication.js -Component({ - /** - * 组件的属性列表 - */ - properties: {}, - - /** - * 组件的初始数据 - */ - data: {}, - - /** - * 组件的方法列表 - */ - methods: {}, -}); diff --git a/miniprogram/pages/myApplication/myApplication.json b/miniprogram/pages/myApplication/myApplication.json deleted file mode 100644 index 1e5f545..0000000 --- a/miniprogram/pages/myApplication/myApplication.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "usingComponents": {}, - "navigationBarTitleText": "我的申请", - "navigationBarTextStyle": "black" -} diff --git a/miniprogram/pages/myApplication/myApplication.wxml b/miniprogram/pages/myApplication/myApplication.wxml deleted file mode 100644 index b0745a1..0000000 --- a/miniprogram/pages/myApplication/myApplication.wxml +++ /dev/null @@ -1,2 +0,0 @@ - -pages/myApplication/myApplication.wxml diff --git a/miniprogram/pages/myApplication/myApplication.wxss b/miniprogram/pages/myApplication/myApplication.wxss deleted file mode 100644 index 80d7dc2..0000000 --- a/miniprogram/pages/myApplication/myApplication.wxss +++ /dev/null @@ -1 +0,0 @@ -/* pages/myApplication/myApplication.wxss */ diff --git a/miniprogram/pages/myFriend/myFriend.js b/miniprogram/pages/myFriend/myFriend.js deleted file mode 100644 index 560d44d..0000000 --- a/miniprogram/pages/myFriend/myFriend.js +++ /dev/null @@ -1 +0,0 @@ -Page({}); diff --git a/miniprogram/pages/myFriend/myFriend.json b/miniprogram/pages/myFriend/myFriend.json deleted file mode 100644 index 79e4a37..0000000 --- a/miniprogram/pages/myFriend/myFriend.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "usingComponents": {}, - "navigationBarTitleText": "我的好友", - "navigationBarTextStyle": "black" -} diff --git a/miniprogram/pages/myFriend/myFriend.wxml b/miniprogram/pages/myFriend/myFriend.wxml deleted file mode 100644 index 7f4eb25..0000000 --- a/miniprogram/pages/myFriend/myFriend.wxml +++ /dev/null @@ -1 +0,0 @@ -pages/myfriends/myfriends.wxml diff --git a/miniprogram/pages/myFriend/myFriend.wxss b/miniprogram/pages/myFriend/myFriend.wxss deleted file mode 100644 index e69de29..0000000 diff --git a/miniprogram/pages/publish/publish.js b/miniprogram/pages/publish/publish.js deleted file mode 100644 index c4d2e13..0000000 --- a/miniprogram/pages/publish/publish.js +++ /dev/null @@ -1,353 +0,0 @@ -// pages/publish/publish.js,发布快递信息 -const app = getApp(); -//const pay = require('../../services/pay.js') -Page({ - /** - * 页面的初始数据 - */ - data: { - img_url: [], - content: "", - clould_img_id_list: [], - maxContentLength: 1000, - minContentLength: 1, - address: { - id: 0, - province_id: 0, - city_id: 0, - district_id: 0, - address: "", - full_region: "", - author_parcel_name: "", - Pickup_code: "", - mobile: "", - note: "", - is_default: 0, - blockNum: "", - deliverer_id: "", //增加记录deliverer_id - }, - }, - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - console.log(getApp().globalData); - // 本页面要传数据到服务器,要对是否拿到这些数据做校验 - }, - input: function (e) { - if (e.detail.value.length >= this.data.maxContentLength) { - wx.showToast({ - title: "已达到最大字数限制", - }); - } - this.setData({ - content: e.detail.value, - }); - }, - ///Pickup_code - bindinputPickup_code(event) { - let address = this.data.address; - address.Pickup_code = event.detail.value; - this.setData({ - address: address, - }); - }, - bindinputMobile(event) { - let address = this.data.address; - address.mobile = event.detail.value; - this.setData({ - address: address, - }); - }, - bindinputName(event) { - let address = this.data.address; - address.author_parcel_name = event.detail.value; - this.setData({ - address: address, - }); - }, - bindinputBlockNum(event) { - let address = this.data.address; - address.blockNum = event.detail.value; - this.setData({ - address: address, - }); - }, - bindinputAddress(event) { - let address = this.data.address; - address.address = event.detail.value; - this.setData({ - address: address, - }); - }, - bindinputNote(event) { - let address = this.data.address; - address.note = event.detail.value; - this.setData({ - address: address, - }); - }, - /// - chooseimage: function () { - var that = this; - wx.chooseImage({ - count: 9, // 默认9 - sizeType: ["original", "compressed"], // 可以指定是原图还是压缩图,默认二者都有 - sourceType: ["album", "camera"], // 可以指定来源是相册还是相机,默认二者都有 - success: function (res) { - if (res.tempFilePaths.length > 0) { - //图如果满了9张,不显示加图 - if (res.tempFilePaths.length == 9) { - that.setData({ - hideAdd: 1, - }); - } else { - that.setData({ - hideAdd: 0, - }); - } - //把每次选择的图push进数组 - let img_url = that.data.img_url; - for (let i = 0; i < res.tempFilePaths.length; i++) { - if (img_url.length >= 9) { - wx.showToast({ - image: "../../images/warn1.png", - title: "图片过多", - }); - that.setData({ - hideAdd: 1, - }); - break; - } - img_url.push(res.tempFilePaths[i]); - } - that.setData({ - img_url: img_url, - }); - } - }, - }); - }, - /** - * 执行发布时图片已经上传完成,写入数据库的是图片的fileId - */ - - publish: function (img_url_ok) { - var that = this; - wx.cloud.callFunction({ - name: "publish_post", - data: { - openid: app.globalData.openId, // 不是直接含在 event 里的?这个云端其实能直接拿到 - author_name: app.globalData.wechatNickName, - author_avatar_url: app.globalData.wechatAvatarUrl, - //调用这两个都是用全局变量的 - content: this.data.content, - image_url: img_url_ok, //本地要显示图像,图像是一个链接的形式,链接是可以直接得到的,不用 event 之类的来装 - x: "2", - pickup_code: this.data.address.Pickup_code, - id: this.data.address.id, - deliverer_id: this.data.address.deliverer_id, //增加记录送货者的id - // city_id: this.data.address.city_id, - address: this.data.address.address, - //两个 address 不歧义,第二个 address 是在第一个address 包里面的,外面看不到 - // full_region: this.data.address.full_region, - //full_region: this.data.address.blockNum, - blockNum: this.data.address.blockNum, - author_parcel_name: that.data.address.author_parcel_name, - mobile: this.data.address.mobile, - //is_default: this.data.address.is_default, - note: this.data.address.note, - publish_time: "", - update_time: "", //目前让服务器自己生成这两个时间 - }, - success: function (res) { - let data = { - openId: app.globalData.openId, - }; - pay.payOrder(data); - - /// console.log("flag2") - // 强制刷新,这个传参很粗暴 - var pages = getCurrentPages(); // 获取页面栈 - var prevPage = pages[pages.length - 2]; // 上一个页面 - prevPage.setData({ - update: true, - }); - wx.hideLoading(); - wx.navigateBack({ - delta: 1, - }); - }, - fail: function (res) { - console.log(res); - that.publishFail("发布失败"); - }, - }); - }, - //发布按钮事件 - send: function () { - if (this.data.content.length < this.data.minContentLength) { - wx.showToast({ - image: "../../images/warn1.png", - title: "内容太短!", - }); - return; - } - if (this.data.address.address.length < this.data.minContentLength) { - wx.showToast({ - image: "../../images/warn.png", - title: "地址太短!", - }); - return; - } - var that = this; - - wx.showModal({ - title: "提示", - content: "是否确认发布并抵押1积分?", - success(res) { - if (res.confirm) { - console.log("用户点击确定"); - - wx.showLoading({ - title: "发布中", - mask: true, - }); - - let img_url = that.data.img_url; - let img_url_ok = []; - //由于图片只能一张一张地上传,所以用循环 - if (img_url.length == 0) { - that.publish([]); - return; - } - for (let i = 0; i < img_url.length; i++) { - var str = img_url[i]; - var obj = str.lastIndexOf("/"); - var fileName = str.substr(obj + 1); - console.log(fileName); - wx.cloud.uploadFile({ - cloudPath: "post_images/" + fileName, //必须指定文件名,否则返回的文件id不对 - filePath: img_url[i], // 小程序临时文件路径 - success: (res) => { - // get resource ID: - console.log(res); - //把上传成功的图片的地址放入数组中 - img_url_ok.push(res.fileID); - - //如果全部传完,则可以将图片路径保存到数据库 - - if (img_url_ok.length == img_url.length) { - console.log(img_url_ok); - that.publish(img_url_ok); - } - }, - fail: (err) => { - // handle error - that.publishFail("图片上传失败"); - console.log("fail: " + err.errMsg); - }, - }); - } - - wx.showToast({ - icon: "success", - title: "发布成功!", - duration: 2000, - }); - } else if (res.cancel) { - console.log("用户点击取消"); - // wx.navigateTo({ - // url: '../publish/publish?postid=' + e.currentTarget.dataset.postid, - // }) //这里不该有,是用于postlist进detail时、传那一单的id - } - }, - }); - - // wx.showLoading({ - // title: '发布中', - // mask: true - // }) - - // let img_url = that.data.img_url; - // let img_url_ok = []; - // //由于图片只能一张一张地上传,所以用循环 - // if (img_url.length == 0) { - // this.publish([]) - // return - // } - // for (let i = 0; i < img_url.length; i++) { - // var str = img_url[i]; - // var obj = str.lastIndexOf("/"); - // var fileName = str.substr(obj + 1) - // console.log(fileName) - // wx.cloud.uploadFile({ - // cloudPath: 'post_images/' + fileName,//必须指定文件名,否则返回的文件id不对 - // filePath: img_url[i], // 小程序临时文件路径 - // success: res => { - // // get resource ID: - // console.log(res) - // //把上传成功的图片的地址放入数组中 - // img_url_ok.push(res.fileID) - - // //如果全部传完,则可以将图片路径保存到数据库 - - // if (img_url_ok.length == img_url.length) { - // console.log(img_url_ok) - // that.publish(img_url_ok) - - // } - - // }, - // fail: err => { - // // handle error - // that.publishFail('图片上传失败') - // console.log('fail: ' + err.errMsg) - // } - // }) - // } - }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function () {}, - - /** - * 生命周期函数--监听页面显示 - */ - onShow: function () {}, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function () {}, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function () {}, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function () {}, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function () {}, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () {}, - publishFail(info) { - wx.showToast({ - image: "../../images/warn1.png", - title: info, - mask: true, - duration: 2500, - }); - }, -}); diff --git a/miniprogram/pages/publish/publish.json b/miniprogram/pages/publish/publish.json deleted file mode 100644 index a97367d..0000000 --- a/miniprogram/pages/publish/publish.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "usingComponents": {} -} diff --git a/miniprogram/pages/publish/publish.wxml b/miniprogram/pages/publish/publish.wxml deleted file mode 100644 index aa71bfb..0000000 --- a/miniprogram/pages/publish/publish.wxml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - \n - - - - - - - - -
\ No newline at end of file diff --git a/miniprogram/pages/publish/publish.wxss b/miniprogram/pages/publish/publish.wxss deleted file mode 100644 index 76e133f..0000000 --- a/miniprogram/pages/publish/publish.wxss +++ /dev/null @@ -1,123 +0,0 @@ -/* pages/publish/publish.wxss */ -.send-publish { - width: 100%; - padding-top: 10rpx; - color: #757575; - height: 75rpx; - background-color: rgba(246, 232, 154, 0.678); - line-height: 60rpx; -} -.page { - padding-left: 25rpx; - padding-right: 25rpx; - padding-top: 50rpx; -} -.text { - width: 100%; - margin-bottom: 3px; - font-size: 12pt; - font-weight: bold; - padding-left: 25rpx; - padding-right: 25rpx; - padding-bottom: 25rpx; -} -.image { - width: 25%; - height: 25%; - padding: 5px; -} -.moment_img { - width: 70px; - height: 70px; -} -.image_content { - width: 100%; - display: flex; - flex-wrap: wrap; - margin-bottom: 75px; -} -/**/ -.page .add-form { - background: #fff; - width: 100%; - height: auto; - overflow: hidden; -} -.form-item { - height: 70rpx; - padding-left: 25rpx; - /*border-bottom: 1px solid #dadada;*/ - border-top: 1px solid #dadada; - display: -webkit-box; - /*align-items: center;*/ - padding-top: 30rpx; - padding-right: 25rpx; - font-size: 12pt; -} -.input { - flex: 1; - height: 44rpx; - line-height: 44rpx; - overflow: hidden; -} -.form-default { - border-bottom: 1px solid #dadada; - height: 96rpx; - background: #fff; - padding-top: 25rpx; - font-size: 12pt; -} - -.message-input { - background-color: #fff; - font-size: 12pt; - width: 92%; - height: 175px; - border: 2px solid rgba(141, 68, 32, 0.767); - border-right: 2px solid rgba(141, 68, 32, 0.767); - border-radius: 5px; - padding-top: 35rpx; - padding-left: 25rpx; - padding-right: 25rpx; - padding-bottom: 25rpx; - margin: 0 auto; - display: block; - line-height: 40rpx; - flex: 1; - overflow: hidden; -} - -.message-content { - font-size: 12pt; - color: #757575; -} - -.send-publish { - width: 100%; - padding-top: 7rpx; - color: #444343; - height: 75rpx; - background-color: #e3bd4a; - border: 2px solid rgba(141, 68, 32, 0.767); - line-height: 60rpx; - font-weight: bold; -} - -.default-input { - margin: 0 auto; - display: block; - width: 240rpx; - height: 40rpx; - padding-left: 50rpx; - line-height: 40rpx; - background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/checkbox-sed825af9d3-a6b8540d42.png) - 1rpx -448rpx no-repeat; - background-size: 38rpx 486rpx; - font-size: 12pt; -} - -.default-input.selected { - background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/checkbox-sed825af9d3-a6b8540d42.png) - 0 -192rpx no-repeat; - background-size: 38rpx 486rpx; -} diff --git a/miniprogram/pages/register/register.js b/miniprogram/pages/register/register.js new file mode 100644 index 0000000..8a5bc90 --- /dev/null +++ b/miniprogram/pages/register/register.js @@ -0,0 +1,131 @@ +const defaultAvatarUrl = + "https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0"; + +Page({ + data: { + flag: 0, + code: null, + + avatarUrl: defaultAvatarUrl, + nickname: null, + phoneNumber: null, + + loading: false, + }, + + register: function () { + wx.cloud + .database() + .collection("users") + .add({ + data: { + avatarUrl: this.data.avatarUrl, + nickname: this.data.nickname, + }, + }) + .then((res) => { + wx.showModal({ + title: "注册成功", + content: "是否继续完善信息?", + success: (res) => { + if (res.confirm) { + wx.redirectTo({ + url: "../information/educationExperience/educationExperience", + }); + } else if (res.cancel) { + wx.switchTab({ + url: "../search/search_home/search_home", + }); + } + }, + }); + }) + .catch((err) => { + console.log(err); + wx.showToast({ + icon: "none", + title: "注册失败", + }); + }); + }, + + next: function () { + let that = this; + wx.showModal({ + title: "提示", + content: "本产品暂仅对弦计划内部成员开放欢迎关注弦计划获取纳新动态,如你为内部成员但无法进入请联系工作人员", + showCancel: false, + success: (res) => { + that.setData({ + flag: 1, + }); + }, + }); + }, + + // getPhoneNumber(e) { + // // 用户拒绝授权 + // if (e.detail.errMsg == "getPhoneNumber:fail user deny") { + // wx.showToast({ + // icon: "none", + // title: "请允许获取手机号,否则功能不可用!", + // }); + // return; + // } + // console.log(e); + // if (e.detail.code) { + // console.log(e.detail.code); + // wx.cloud + // .callFunction({ + // name: "getPhoneNumber", + // data: { + // code: e.detail.code, + // }, + // }) + // .then((res) => { + // console.log(res); + // if (res.errMsg == "cloud.callFunction:ok") { + // let phoneNumber = res.result.phoneNumber; + // this.setData({ + // phoneNumber: phoneNumber, + // phoneFlag: true, + // }); + // } else { + // wx.showToast({ + // icon: "none", + // title: "获取失败", + // }); + // } + // }) + // .catch((err) => { + // console.log(err); + // wx.showToast({ + // icon: "none", + // title: "获取失败", + // }); + // }); + // } + // }, + + getUserProfile(e) { + wx.getUserProfile({ + desc: "获取你的昵称和头像", + lang: "zh_CN", + success: (result) => { + console.log(result); + this.setData({ + avatarUrl: result.userInfo.avatarUrl, + nickname: result.userInfo.nickName, + flag: 2 + }); + }, + fail: (res) => { + console.log(res); + wx.showToast({ + title: "获取失败", + icon: "none", + }); + }, + }); + }, +}); diff --git a/miniprogram/pages/login/login.json b/miniprogram/pages/register/register.json similarity index 100% rename from miniprogram/pages/login/login.json rename to miniprogram/pages/register/register.json diff --git a/miniprogram/pages/login/login.wxml b/miniprogram/pages/register/register.wxml similarity index 65% rename from miniprogram/pages/login/login.wxml rename to miniprogram/pages/register/register.wxml index efbe637..2c6a723 100644 --- a/miniprogram/pages/login/login.wxml +++ b/miniprogram/pages/register/register.wxml @@ -1,26 +1,26 @@ - + - - + - - + - \ No newline at end of file diff --git a/miniprogram/pages/login/login.wxss b/miniprogram/pages/register/register.wxss similarity index 100% rename from miniprogram/pages/login/login.wxss rename to miniprogram/pages/register/register.wxss diff --git a/miniprogram/pages/search/search_home/search_home.js b/miniprogram/pages/search/search_home/search_home.js index 9847449..fb2984f 100644 --- a/miniprogram/pages/search/search_home/search_home.js +++ b/miniprogram/pages/search/search_home/search_home.js @@ -31,18 +31,35 @@ Page({ // onLoad函数 onLoad: function (options) { - var that = this; - // 登录态 - if (app.globalData.userInfo == null || app.globalData.userInfo == "") { - wx.redirectTo({ - url: "../../login/login", + if (app.globalData.needReloadData) { + if (app.globalData.openId == null || app.globalData.openId == "") { + return; + } + // 登录态 + if (app.globalData.userInfo == null || app.globalData.userInfo == "") { + wx.redirectTo({ + url: "../../register/register", + }); + return; + } + // 用户信息 + that.setData({ + userInfo: app.globalData.userInfo, }); - return; + } else { + app.globalData.reloadCallback = () => { + if (app.globalData.openId == null || app.globalData.openId == "") { + return; + } + // 登录态 + if (app.globalData.userInfo == null || app.globalData.userInfo == "") { + wx.redirectTo({ + url: "../../register/register", + }); + return; + } + }; } - // 用户信息 - that.setData({ - userInfo: app.globalData.userInfo, - }); }, // onShow函数 diff --git a/miniprogram/pages/setting/setting.js b/miniprogram/pages/setting/setting.js deleted file mode 100644 index 230619b..0000000 --- a/miniprogram/pages/setting/setting.js +++ /dev/null @@ -1,149 +0,0 @@ -// pages/setting/setting.js -const app = getApp(); - -import Partner from "../../manager/Partner"; - -const URL = "https://md.solikeu.com/"; -const PAGE = { - index: "", -}; - -Page({ - /** - * 页面的初始数据 - */ - data: { - headerHeight: app.globalData.navHeight + 20, - showToastStyle: false, - toastStyle: 0, - - text: app.text.setting, - }, - - onShow: function () { - this.setData({ - userInfo: app.globalData.userInfo, - partnerInfo: app.globalData.partnerInfo, - }); - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - this.toast = this.selectComponent("#toast"); - - this.setData({ - toastStyle: wx.getStorageSync("toastStyle"), - }); - }, - - /** - * 提示框风格 - */ - cellToastStyle: function () { - this.setData({ - showToastStyle: !this.data.showToastStyle, - }); - }, - - /** - * 修改提示框风格 - */ - changeToastStyle: function (e) { - let style = e.currentTarget.dataset.style; - wx.setStorageSync("toastStyle", style); - - this.toast.showSuccess("设置成功"); - - this.setData({ - toastStyle: style, - }); - }, - - /** - * 解绑 - */ - unbind: function () { - let that = this; - - wx.showModal({ - title: "警告", - content: "这个选项不可以乱点的", - confirmColor: "#E64340", - success: function (res) { - if (res.confirm) { - wx.showModal({ - title: "再次警告", - content: "确定与好友解除绑定吗", - confirmColor: "#E64340", - success: function (res) { - if (res.confirm) { - that.toast.showLoading(); - - Partner.unbind( - that.data.userInfo._openid, - that.data.partnerInfo._openid, - ) - .then((res) => { - that.toast.showSuccess(res); - - setTimeout(() => { - wx.reLaunch({ - url: "/pages/indexV2/index", - }); - }, 2000); - }) - .catch((err) => { - console.log(err); - - that.toast.showFailure(err); - }); - } - }, - }); - } - }, - }); - }, - - /** - * 刷新绑定信息 - */ - reload: function () { - app.globalData.needReloadPartner = true; - - wx.reLaunch({ - url: "/pages/indexV2/index", - }); - }, - - /** - * 点击cell - */ - cellClick: function (e) { - let type = e.currentTarget.dataset.type; - wx.navigateTo({ - url: "/pages/about/about?type=" + type, - }); - }, - - /** - * 复制内容 - */ - copyUrl: function (e) { - let page = PAGE[e.currentTarget.dataset.page]; - let url = URL + page; - - wx.setClipboardData({ - data: url, - complete: function () { - wx.showModal({ - title: "已复制链接", - content: "请在浏览器打开", - showCancel: false, - }); - }, - }); - }, -}); diff --git a/miniprogram/pages/setting/setting.json b/miniprogram/pages/setting/setting.json deleted file mode 100644 index a97367d..0000000 --- a/miniprogram/pages/setting/setting.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "usingComponents": {} -} diff --git a/miniprogram/pages/setting/setting.wxml b/miniprogram/pages/setting/setting.wxml deleted file mode 100644 index 30685e1..0000000 --- a/miniprogram/pages/setting/setting.wxml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - {{ text.tip1 }} - - - - {{ text.setting1[1] }} - - - - - {{ text.tip2 }} - - - {{ text.setting2[0] }} - - - - - - - - - - - - - - {{ text.setting2[1] }} - - - - {{ text.setting2[2] }} - - - - {{ text.tip3 }} - - - {{ text.setting3[0] }} - - - - - {{ text.footer[0] }} - {{ text.footer[1] }} - {{ text.footer[2] }} - {{ text.footer[3] }} - {{ text.footer[4] }} - - diff --git a/miniprogram/pages/setting/setting.wxss b/miniprogram/pages/setting/setting.wxss deleted file mode 100644 index 8851204..0000000 --- a/miniprogram/pages/setting/setting.wxss +++ /dev/null @@ -1,101 +0,0 @@ -/* pages/setting/setting.wxss */ -page { - background: #f5f5f5; -} - -.interval { - margin-left: 5vw; - width: 90vw; - border-radius: 20rpx; -} - -.table-view { - background: white; -} - -.cell { - height: 100rpx; - - display: flex; - justify-content: flex-start; - align-items: center; -} - -.cell text { - font-size: 30rpx; - padding-left: 50rpx; - font-weight: 300; - color: #3b353e; -} - -/* 提示框风格 */ -.toast-style { - width: 100%; - - box-sizing: border-box; - -webkit-box-sizing: border-box; - padding: 0 50rpx; - - display: flex; - justify-content: space-between; - align-items: center; - - transition: height 0.5s; - -webkit-transition: height 0.5s; -} - -.toast-style-item { - width: 48%; - height: 100%; - background: #f5f5f5; - border-radius: 10rpx; - - box-sizing: border-box; - -webkit-box-sizing: border-box; - padding: 0 10rpx; - - display: flex; - flex-direction: column; - justify-content: flex-start; - align-items: center; - - position: relative; -} - -.tip-image { - width: 100%; - height: 100%; - border-radius: 10rpx; -} - -.finish-image { - width: 40rpx; - height: 100%; - max-height: 40rpx; - position: absolute; - bottom: 0; - right: 0; -} - -.toast-style-item text { - font-size: 20rpx; - color: #3b353e; - font-weight: 300; - padding: 10rpx 0; -} - -.footer { - margin: 150rpx auto 50rpx; - - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; -} - -.footer text { - font-size: 20rpx; - line-height: 50rpx; - font-weight: 300; - color: lightgray; -} diff --git a/miniprogram/pages/square/add/add.js b/miniprogram/pages/square/add/add.js deleted file mode 100644 index 7a2dc39..0000000 --- a/miniprogram/pages/square/add/add.js +++ /dev/null @@ -1,134 +0,0 @@ -// pages/square/add/add.js -import Article from "../../../manager/Article.js"; - -const app = getApp(); - -Page({ - /** - * 页面的初始数据 - */ - data: { - text: app.text.square.add, - headerHeight: app.globalData.navHeight, - currentTime: app.util.formatTime(new Date(), false, false), - - share: 0, - share_partner: false, - content: "", - image: null, - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - this.toast = this.selectComponent("#toast"); - }, - - /** - * 选择图片 - */ - chooseImage: function () { - let that = this; - wx.chooseImage({ - count: 1, - sizeType: ["compressed"], // 压缩图 - sourceType: ["album", "camera"], - success: function (res) { - that.setData({ - image: res.tempFilePaths[0], - }); - }, - }); - }, - - /** - * 选择分享限度 - */ - selectShare: function (e) { - let type = e.currentTarget.dataset.type; - let share = e.currentTarget.dataset.share; - - this.setData({ - share: type, - share_partner: Boolean(share), - }); - }, - - /** - * 正文输入 - */ - contentInput: function (e) { - let value = e.detail.value; - this.setData({ - content: value, - }); - }, - - /** - * 完成 - */ - finish: function () { - if (this.data.content.length == 0) { - this.toast.showWarning("啥都没写呢!"); - return; - } else { - this.toast.showLoading(); - - let filePath = this.data.image; - if (filePath == null) { - this.publish(null); - } else { - let name = Math.random() * 1000000; - let cloudPath = name + filePath.match(/\.[^.]+?$/)[0]; - - wx.cloud - .uploadFile({ - cloudPath: cloudPath, - filePath: filePath, - }) - .then((res) => { - this.publish(res.fileID); - }) - .catch((err) => { - this.toast.showFailure("图片上传失败"); - }); - } - } - }, - - /** - * 发布核心 - */ - publish: function (fileID) { - let userInfo = app.globalData.userInfo; - let data = { - avatar: userInfo.avatar, - image: fileID, - content: this.data.content, - share: parseInt(this.data.share), - share_partner: this.data.share_partner, - }; - - Article.add(data) - .then((res) => { - this.toast.showSuccess("发布成功"); - - let pages = getCurrentPages(); - let prePage = pages[pages.length - 2]; - - prePage.setData({ - page: 0, - noMore: false, - }); - prePage.loadData(); - - wx.navigateBack({ - delta: 1, - }); - }) - .catch((err) => { - this.toast.showFailure(err); - }); - }, -}); diff --git a/miniprogram/pages/square/add/add.json b/miniprogram/pages/square/add/add.json deleted file mode 100644 index a97367d..0000000 --- a/miniprogram/pages/square/add/add.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "usingComponents": {} -} diff --git a/miniprogram/pages/square/add/add.wxml b/miniprogram/pages/square/add/add.wxml deleted file mode 100644 index f021183..0000000 --- a/miniprogram/pages/square/add/add.wxml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - {{ text.limitTip }} - - - - - {{ text.limitMy }} - - - - - - - {{ text.limitAll }} - - - - - - {{ text.finish }} - - - \ No newline at end of file diff --git a/miniprogram/pages/square/add/add.wxss b/miniprogram/pages/square/add/add.wxss deleted file mode 100644 index dd7a313..0000000 --- a/miniprogram/pages/square/add/add.wxss +++ /dev/null @@ -1,129 +0,0 @@ -/* pages/square/add/add.wxss */ - -page { - background: #f5f5f5; -} - -.body { - height: 100vh; - - display: flex; - flex-direction: column; - align-items: center; - justify-content: flex-start; - - box-sizing: border-box; - -webkit-box-sizing: border-box; -} - -/* - * 图片区域 - */ -.image-area { - width: 100vw; - height: 400rpx; - /* background: rebeccapurple; */ - - display: flex; - align-items: center; - justify-content: center; - - overflow: hidden; -} - -.image-area .icon { - width: 100rpx; - height: 100rpx; -} - -.image-area .image { - width: 100%; - height: 100%; - - background-repeat: no-repeat; - background-size: 100vw auto; - background-position: center center; -} - -/** - * 菜单区 - */ -.menu { - width: 100%; - height: 100rpx; - /* background: gray; */ - - display: flex; - justify-content: space-around; - align-items: center; - - color: gray; - font-size: 30rpx; - - background: white; - border-bottom: 2rpx solid #f5f5f5; -} - -.limit { - display: flex; - justify-content: flex-start; - align-items: center; -} - -.limit-icon { - width: 50rpx; - height: 50rpx; - - display: flex; - justify-content: center; - align-items: center; -} - -.limit-icon image { - width: 30rpx; - height: 30rpx; -} - -/** - * 输入区域 - */ -.content-area { - /* background: blue; */ - flex: 1; - width: 100vw; - - box-sizing: border-box; - -webkit-box-sizing: border-box; - padding: 50rpx; - - background: white; - - position: relative; - - display: flex; - flex-direction: column; - align-items: flex-end; - justify-content: flex-start; -} - -.content-area textarea { - width: 100%; - flex: 1; - font-size: 35rpx; -} - -/** - * 完成 - */ -.finish { - width: 200rpx; - height: 80rpx; - - margin-top: 10rpx; - - line-height: 80rpx; - text-align: center; - border-radius: 40rpx; - - color: #242529; -} diff --git a/miniprogram/pages/square/detail/detail.js b/miniprogram/pages/square/detail/detail.js deleted file mode 100644 index 8b03d9b..0000000 --- a/miniprogram/pages/square/detail/detail.js +++ /dev/null @@ -1,171 +0,0 @@ -// pages/square/detail/detail.js -import Article from "../../../manager/Article"; - -const app = getApp(); - -Page({ - /** - * 页面的初始数据 - */ - data: { - text: app.text.square.detail, - headerHeight: app.globalData.navHeight + 20, - - item: null, - delete: false, - - userInfo: app.globalData.userInfo, - partnerInfo: app.globalData.partnerInfo, - - partnerAddTip: false, - partnerContent: "", - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - this.toast = this.selectComponent("#toast"); - - let jsonStr = options.item; - let _id = options._id; - if (jsonStr == null && _id == null) { - this.toast.showFailure("非法请求"); - - wx.navigateBack(); - } else { - if (_id) { - this.toast.showLoading(); - Article.find(_id) - .then((res) => { - this.toast.hideLoading(); - - res.formatTimeFull = app.util.formatTime(res.time, true, false); - - this.setData({ - item: res, - }); - }) - .catch((err) => { - this.toast.showFailure(err); - }); - } else { - let item = JSON.parse(jsonStr); - - this.setData({ - item: item, - delete: item._openid == this.data.userInfo._openid, - }); - } - } - }, - - /** - * 删除文章 - */ - del: function () { - let that = this; - - wx.showModal({ - title: "确定要删除嘛", - content: "删除就不可恢复啦", - success: function (res) { - if (res.confirm) { - Article.del(that.data.item._id) - .then((res) => { - that.toast.showSuccess("删除成功"); - - let pages = getCurrentPages(); - let prePage = pages[pages.length - 2]; - - prePage.setData({ - page: 0, - noMore: false, - }); - - prePage.loadData(); - - wx.navigateBack(); - }) - .catch((err) => { - this.toast.showFailure(err); - }); - } - }, - }); - }, - - /** - * 伙伴点击添加内容 - */ - partnerAdd: function () { - this.setData({ - partnerAddTip: true, - }); - }, - - /** - * 点击modal空白区域 - */ - modalClose: function () { - this.setData({ - partnerAddTip: false, - }); - }, - - /** - * 发布评论 - */ - modalClick: function () { - this.setData({ - partnerAddTip: false, - }); - - if (this.data.partnerContent == "") { - this.showWarning("还没填写内容呢"); - - return; - } - - this.toast.showLoading(); - console.log(this.data.item._id); - - Article.update(this.data.item._id, { - partner_avatar: this.data.userInfo.avatar, - partner_content: this.data.partnerContent, - partner_time: new Date(), - }) - .then((res) => { - console.log(res); - - this.toast.showSuccess("评论成功"); - - this.setData({ - "item.partner_avatar": this.data.userInfo.avatar, - "item.partner_content": this.data.partnerContent, - }); - }) - .catch((err) => { - this.toast.showFailure(err); - }); - }, - - /** - * 内容输入 - */ - contentInput: function (e) { - this.setData({ - partnerContent: e.detail.value, - }); - }, - - /** - * 分享 - */ - onShareAppMessage: function () { - return { - title: this.data.item.content, - path: "/pages/square/detail/detail?_id=" + this.data.item._id, - }; - }, -}); diff --git a/miniprogram/pages/square/detail/detail.json b/miniprogram/pages/square/detail/detail.json deleted file mode 100644 index aef10c5..0000000 --- a/miniprogram/pages/square/detail/detail.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "usingComponents": { - "modal": "/components/modal/modal" - } -} diff --git a/miniprogram/pages/square/detail/detail.wxml b/miniprogram/pages/square/detail/detail.wxml deleted file mode 100644 index 0cb6234..0000000 --- a/miniprogram/pages/square/detail/detail.wxml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - {{ item.content }} - {{ item.formatTimeFull }} - - - - - - - - - - - {{ text.delete }} - - - - - - - - -
diff --git a/miniprogram/pages/square/detail/detail.wxss b/miniprogram/pages/square/detail/detail.wxss deleted file mode 100644 index 8fa7af1..0000000 --- a/miniprogram/pages/square/detail/detail.wxss +++ /dev/null @@ -1,86 +0,0 @@ -/* pages/square/detail/detail.wxss */ - -@import "/Mango/Animation/mango.wxss"; - -page { - background: #f5f5f5; -} - -.interval { - width: 90vw; - margin: 0 5vw; -} - -.main { - background: white; - border-radius: 20rpx; - overflow: hidden; - - display: flex; - flex-direction: column; - justify-content: flex-start; - align-items: center; -} - -.body .image { - width: 100%; -} - -.body .content { - box-sizing: border-box; - -webkit-box-sizing: border-box; - - padding: 50rpx; - - display: flex; - flex-direction: column; - justify-content: flex-start; - align-items: center; -} - -.content-text { - font-size: 50rpx; - font-weight: 300; -} - -.content-time { - font-weight: 300; - color: gray; - padding: 80rpx 0 20rpx; -} - -.content-avatar { - width: 120rpx; - height: 120rpx; - border-radius: 50%; - margin: 20rpx auto; -} - -/* -* 删除 -*/ -.partner-btn, -.del-btn { - width: 50vw; - height: 100rpx; - line-height: 100rpx; - text-align: center; - border-radius: 10rpx; - font-size: 35rpx; - margin: 0 auto; - color: white; -} - -.del-btn { - background: #e64340; -} - -textarea { - width: 70vw; - height: 350rpx; - - box-sizing: border-box; - -webkit-box-sizing: border-box; - - padding: 10rpx 30rpx; -} diff --git a/miniprogram/pages/square/square/square.js b/miniprogram/pages/square/square/square.js deleted file mode 100644 index 80139fe..0000000 --- a/miniprogram/pages/square/square/square.js +++ /dev/null @@ -1,134 +0,0 @@ -// pages/square/square/square.js -import Article from "../../../manager/Article"; - -const app = getApp(); - -Page({ - /** - * 页面的初始数据 - */ - data: { - text: app.text.square.square, - headerHeight: app.globalData.navHeight + 20, - - page: 0, - lists: [], - noMore: false, - - myVisual: false, // 当前视角 true是我,false是广场 - }, - - onShow: function () { - if (typeof this.getTabBar === "function" && this.getTabBar()) { - this.getTabBar().setData({ - selected: 1, - page: this, - }); - } - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - this.nav = this.selectComponent("#nav"); - this.toast = this.selectComponent("#toast"); - - this.loadData(); - }, - - /** - * 加载数据 - */ - loadData: function () { - let userInfo = app.globalData.userInfo; - let partnerInfo = app.globalData.partnerInfo; - - this.toast.showLoading(); - Article.lists( - this.data.page, - this.data.myVisual ? userInfo._openid : null, - partnerInfo == null ? null : partnerInfo._openid, - ) - .then((res) => { - this.toast.hideLoading(); - wx.stopPullDownRefresh(); - - let lists = this.data.page == 0 ? [] : this.data.lists; - res.forEach((item, _) => { - let time = app.util.formatTime(item.time, false, false); - time = time.split("-"); - item.formatTime = time[1] + "-" + time[2]; - item.formatTimeFull = app.util.formatTime(item.time, true, false); - lists.push(item); - }); - - this.setData({ - page: this.data.page + 1, - lists: lists, - noMore: res.length == 0, - }); - }) - .catch((err) => { - this.toast.showFailure(err); - }); - }, - - /** - * 切换视角 - */ - changeVisual: function (e) { - let visual = e.currentTarget.dataset.type; - let my = visual == "my"; - - if (this.data.myVisual == my) { - return; - } - - this.setData({ - myVisual: my, - lists: [], - page: 0, - noMore: false, - }); - - this.loadData(); - }, - - /** - * 详情 - */ - detail: function (e) { - let item = JSON.stringify(e.currentTarget.dataset.item); - wx.navigateTo({ - url: "/pages/square/detail/detail?item=" + item, - }); - }, - - /** - * 下拉刷新 - */ - onPullDownRefresh: function () { - this.setData({ - page: 0, - noMore: false, - }); - - this.loadData(); - }, - - /** - * 上滑加载更多 - */ - onReachBottom: function () { - this.loadData(); - }, - - onPageScroll: function (e) { - if (e.scrollTop <= app.globalData.headerHeight) { - this.nav.hide(); - } else { - this.nav.show(); - } - }, -}); diff --git a/miniprogram/pages/square/square/square.json b/miniprogram/pages/square/square/square.json deleted file mode 100644 index 66ab717..0000000 --- a/miniprogram/pages/square/square/square.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "usingComponents": {}, - "enablePullDownRefresh": true -} diff --git a/miniprogram/pages/square/square/square.wxml b/miniprogram/pages/square/square/square.wxml deleted file mode 100644 index 21d5edd..0000000 --- a/miniprogram/pages/square/square/square.wxml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - {{ text.square }} - {{ text.mine }} - - - - - - - - - - - - - - - - - - {{ item.formatTime }} - - - - - {{ item.content }} - - - - - - - {{ text.noMore }} - - - diff --git a/miniprogram/pages/square/square/square.wxss b/miniprogram/pages/square/square/square.wxss deleted file mode 100644 index 996b56d..0000000 --- a/miniprogram/pages/square/square/square.wxss +++ /dev/null @@ -1,143 +0,0 @@ -/* pages/square/square/square.wxss */ - -page { - background: #f5f5f5; -} - -.interval { - width: 90vw; - margin: 0 5vw; -} - -/** - * 大标题 - */ - -.header { - position: relative; -} - -.bigTitle { - display: flex; - justify-content: flex-start; - align-items: center; - margin: 20rpx 0; - - position: absolute; - bottom: 0; -} - -.bigTitle view { - /* margin-right: 50rpx; */ - width: 150rpx; - text-align: center; -} - -.bigTitle .big { - font-size: 70rpx; - font-weight: bold; - color: #3b353e; -} - -.bigTitle .small { - font-size: 40rpx; - color: gray; -} - -/** - * cell - */ -.cell { - width: 100%; - background: white; - border-radius: 40rpx; - margin-bottom: 80rpx; - - overflow: hidden; - - display: flex; - flex-direction: column; - justify-content: flex-start; - align-items: flex-start; - - position: relative; -} - -.cell-avatar { - position: absolute; - top: 20rpx; - right: 20rpx; -} - -.cell-avatar image { - width: 60rpx; - height: 60rpx; - border-radius: 50%; - margin: 0 10rpx; -} - -.cell-image { - width: 100%; - overflow: hidden; -} - -.cell-image image { - width: 100%; - height: 400rpx; -} - -.cell-image .no-image { - width: 100%; - height: 80rpx; - - display: flex; - justify-content: flex-start; - align-items: flex-end; - - box-sizing: border-box; - -webkit-box-sizing: border-box; - - padding-left: 40rpx; - - font-size: 30rpx; - color: gray; -} - -.cell-text { - height: 150rpx; - - box-sizing: border-box; - -webkit-box-sizing: border-box; - - padding: 10rpx 20rpx; - - display: flex; - justify-content: center; - align-items: center; -} - -.cell-text text { - text-align: center; - color: gray; - font-weight: 300; - - overflow: hidden; - text-overflow: ellipsis; - word-break: break-all; - display: -webkit-box; - line-clamp: 2; - -webkit-line-clamp: 2; - -webkit-box-orient: vertical; -} - -/** - * 没有更多 - */ -.no-more { - width: 100%; - height: 100rpx; - line-height: 100rpx; - text-align: center; - color: lightgray; - font-size: 25rpx; -} diff --git a/project.config.json b/project.config.json index 7b0b71f..707a74f 100644 --- a/project.config.json +++ b/project.config.json @@ -21,8 +21,6 @@ "compileHotReLoad": false, "lazyloadPlaceholderEnable": false, "useMultiFrameRuntime": true, - "useApiHook": true, - "useApiHostProcess": true, "babelSetting": { "ignore": [], "disablePlugins": [], @@ -41,17 +39,11 @@ "useStaticServer": true }, "appid": "wx8d60424db5f9bcc3", - "projectname": "String-project", - "libVersion": "2.22.0", "simulatorType": "wechat", "simulatorPluginLibVersion": {}, "cloudfunctionTemplateRoot": "cloudfunctionTemplate/", "compileType": "miniprogram", "srcMiniprogramRoot": "miniprogram/", - "packOptions": { - "ignore": [], - "include": [] - }, "editorSetting": { "tabIndent": "insertSpaces", "tabSize": 2 @@ -92,5 +84,10 @@ } ] } + }, + "libVersion": "2.22.0", + "packOptions": { + "ignore": [], + "include": [] } } \ No newline at end of file From 60f7f14b14c90a3da55c1a1628a06bb0c9c0e8aa Mon Sep 17 00:00:00 2001 From: "0xWe11es.eth" <83463505+CSWellesSun@users.noreply.github.com> Date: Fri, 29 Sep 2023 22:09:00 +0800 Subject: [PATCH 2/3] Feat/register (#6) * feat: register & login * fix: rename page * fix: minor bug --- miniprogram/app.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miniprogram/app.json b/miniprogram/app.json index 08f809a..4d81186 100644 --- a/miniprogram/app.json +++ b/miniprogram/app.json @@ -2,7 +2,7 @@ "pages": [ "pages/search/search_home/search_home", "pages/information/mainpage/mainpage", - "pages/information/education_experience/education_experiencb", + "pages/information/education_experience/education_experiencn", "pages/register/register", "pages/search/search_input/search_input", "pages/mine/mine", From fd47be15aac4e9f10e26d02e27a6291feaf6670a Mon Sep 17 00:00:00 2001 From: "0xWe11es.eth" <83463505+CSWellesSun@users.noreply.github.com> Date: Fri, 29 Sep 2023 22:44:38 +0800 Subject: [PATCH 3/3] Feat/register (#7) * feat: register & login * fix: rename page * fix: minor bug