diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000000000000000000000000000000000000..39840a52ff943f50ab2028d7a2fe05918bcf63e5 --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +/src/**/miniprogram_npm \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000000000000000000000000000000000000..b855688f86b53747bf2969b7987d10b9547cefd1 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,31 @@ +module.exports = { + root: true, + env: { + browser: true, + node: true, + es6: true, + commonjs: true, + }, + extends: ['eslint:recommended', 'plugin:prettier/recommended'], + parserOptions: { + ecmaVersion: 10, + }, + rules: { + 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', + 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', + 'no-unused-vars': 'error', + 'no-useless-escape': 'off', + // 'no-var': 'error', + }, + globals: { + wx: true, + App: true, + Page: true, + getCurrentPages: true, + getApp: true, + Component: true, + requirePlugin: true, + requireMiniProgram: true, + define: true, + }, +}; diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..0e7dcbe071fe8a1d92981a45a28424953b928368 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +node_modules +.DS_Store +dist +dist-ssr +*.local +project.config.json \ No newline at end of file diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000000000000000000000000000000000000..93c38c6bb0a144d1f212518280111d23e9f37f29 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,9 @@ +module.exports = { + printWidth: 120, + useTabs: false, + singleQuote: true, + tabWidth: 2, + semi: true, + trailingComma: 'es5', + arrowParens: 'always', +}; diff --git a/README.en.md b/README.en.md index 0ec851040a74566fa7be5d37559e0f6fb28fd573..633ef6e483c9baf07358c4ef9cc98ebf7fab6dce 100644 --- a/README.en.md +++ b/README.en.md @@ -8,15 +8,7 @@ Software architecture description #### Installation -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx +1. pnpm install #### Contribution @@ -24,13 +16,3 @@ Software architecture description 2. Create Feat_xxx branch 3. Commit your code 4. Create Pull Request - - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md index 9f9061e840c8e89aa71ea76e1a0bb44b94ff3ab7..3dccf92cfd7c0110fdf2a5e92360451e49f54c59 100644 --- a/README.md +++ b/README.md @@ -6,32 +6,13 @@ The repository of OpenDesign miniprogram #### 软件架构 软件架构说明 - #### 安装教程 -1. xxxx -2. xxxx -3. xxxx - -#### 使用说明 - -1. xxxx -2. xxxx -3. xxxx +1. pnpm install #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 -4. 新建 Pull Request - - -#### 特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 -5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) +4. 新建 Pull Request \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000000000000000000000000000000000000..556ca5f99246ca7be9667d4f5594bf7ec28f210a --- /dev/null +++ b/package.json @@ -0,0 +1,21 @@ +{ + "name": "opendesign-miniprogram", + "version": "0.0.1", + "scripts": { + "lint": "eslint src", + "lint:mindspore": "eslint src/mindspore" + }, + "repository": { + "type": "git", + "url": "git@gitee.com:openeuler/opendesign-miniprogram.git" + }, + "keywords": [], + "author": "", + "license": "", + "devDependencies": { + "eslint": "^8.8.0", + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-prettier": "^4.0.0", + "prettier": "^2.5.1" + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000000000000000000000000000000000000..69bd4ef83c09e7d35f17b07e7825c5056b70d707 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,786 @@ +lockfileVersion: 5.3 + +specifiers: + eslint: ^8.8.0 + eslint-config-prettier: ^8.3.0 + eslint-plugin-prettier: ^4.0.0 + prettier: ^2.5.1 + +devDependencies: + eslint: registry.npmmirror.com/eslint/8.8.0 + eslint-config-prettier: registry.npmmirror.com/eslint-config-prettier/8.3.0_eslint@8.8.0 + eslint-plugin-prettier: registry.npmmirror.com/eslint-plugin-prettier/4.0.0_43197c8d12d1d439034cfcf65e1c48c2 + prettier: registry.npmmirror.com/prettier/2.5.1 + +packages: + + registry.npmmirror.com/@eslint/eslintrc/1.0.5: + resolution: {integrity: sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@eslint/eslintrc/-/eslintrc-1.0.5.tgz} + name: '@eslint/eslintrc' + version: 1.0.5 + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + ajv: registry.npmmirror.com/ajv/6.12.6 + debug: registry.npmmirror.com/debug/4.3.3 + espree: registry.npmmirror.com/espree/9.3.0 + globals: registry.npmmirror.com/globals/13.12.1 + ignore: registry.npmmirror.com/ignore/4.0.6 + import-fresh: registry.npmmirror.com/import-fresh/3.3.0 + js-yaml: registry.npmmirror.com/js-yaml/4.1.0 + minimatch: registry.npmmirror.com/minimatch/3.0.5 + strip-json-comments: registry.npmmirror.com/strip-json-comments/3.1.1 + transitivePeerDependencies: + - supports-color + dev: true + + registry.npmmirror.com/@humanwhocodes/config-array/0.9.3: + resolution: {integrity: sha512-3xSMlXHh03hCcCmFc0rbKp3Ivt2PFEJnQUJDDMTJQ2wkECZWdq4GePs2ctc5H8zV+cHPaq8k2vU8mrQjA6iHdQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@humanwhocodes/config-array/-/config-array-0.9.3.tgz} + name: '@humanwhocodes/config-array' + version: 0.9.3 + engines: {node: '>=10.10.0'} + dependencies: + '@humanwhocodes/object-schema': registry.npmmirror.com/@humanwhocodes/object-schema/1.2.1 + debug: registry.npmmirror.com/debug/4.3.3 + minimatch: registry.npmmirror.com/minimatch/3.0.5 + transitivePeerDependencies: + - supports-color + dev: true + + registry.npmmirror.com/@humanwhocodes/object-schema/1.2.1: + resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz} + name: '@humanwhocodes/object-schema' + version: 1.2.1 + dev: true + + registry.npmmirror.com/acorn-jsx/5.3.2_acorn@8.7.0: + resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz} + id: registry.npmmirror.com/acorn-jsx/5.3.2 + name: acorn-jsx + version: 5.3.2 + peerDependencies: + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + dependencies: + acorn: registry.npmmirror.com/acorn/8.7.0 + dev: true + + registry.npmmirror.com/acorn/8.7.0: + resolution: {integrity: sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/acorn/-/acorn-8.7.0.tgz} + name: acorn + version: 8.7.0 + engines: {node: '>=0.4.0'} + hasBin: true + dev: true + + registry.npmmirror.com/ajv/6.12.6: + resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/ajv/-/ajv-6.12.6.tgz} + name: ajv + version: 6.12.6 + dependencies: + fast-deep-equal: registry.npmmirror.com/fast-deep-equal/3.1.3 + fast-json-stable-stringify: registry.npmmirror.com/fast-json-stable-stringify/2.1.0 + json-schema-traverse: registry.npmmirror.com/json-schema-traverse/0.4.1 + uri-js: registry.npmmirror.com/uri-js/4.4.1 + dev: true + + registry.npmmirror.com/ansi-regex/5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz} + name: ansi-regex + version: 5.0.1 + engines: {node: '>=8'} + dev: true + + registry.npmmirror.com/ansi-styles/4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz} + name: ansi-styles + version: 4.3.0 + engines: {node: '>=8'} + dependencies: + color-convert: registry.npmmirror.com/color-convert/2.0.1 + dev: true + + registry.npmmirror.com/argparse/2.0.1: + resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/argparse/-/argparse-2.0.1.tgz} + name: argparse + version: 2.0.1 + dev: true + + registry.npmmirror.com/balanced-match/1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/balanced-match/-/balanced-match-1.0.2.tgz} + name: balanced-match + version: 1.0.2 + dev: true + + registry.npmmirror.com/brace-expansion/1.1.11: + resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/brace-expansion/-/brace-expansion-1.1.11.tgz} + name: brace-expansion + version: 1.1.11 + dependencies: + balanced-match: registry.npmmirror.com/balanced-match/1.0.2 + concat-map: registry.npmmirror.com/concat-map/0.0.1 + dev: true + + registry.npmmirror.com/callsites/3.1.0: + resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/callsites/-/callsites-3.1.0.tgz} + name: callsites + version: 3.1.0 + engines: {node: '>=6'} + dev: true + + registry.npmmirror.com/chalk/4.1.2: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz} + name: chalk + version: 4.1.2 + engines: {node: '>=10'} + dependencies: + ansi-styles: registry.npmmirror.com/ansi-styles/4.3.0 + supports-color: registry.npmmirror.com/supports-color/7.2.0 + dev: true + + registry.npmmirror.com/color-convert/2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz} + name: color-convert + version: 2.0.1 + engines: {node: '>=7.0.0'} + dependencies: + color-name: registry.npmmirror.com/color-name/1.1.4 + dev: true + + registry.npmmirror.com/color-name/1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz} + name: color-name + version: 1.1.4 + dev: true + + registry.npmmirror.com/concat-map/0.0.1: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/concat-map/-/concat-map-0.0.1.tgz} + name: concat-map + version: 0.0.1 + dev: true + + registry.npmmirror.com/cross-spawn/7.0.3: + resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/cross-spawn/-/cross-spawn-7.0.3.tgz} + name: cross-spawn + version: 7.0.3 + engines: {node: '>= 8'} + dependencies: + path-key: registry.npmmirror.com/path-key/3.1.1 + shebang-command: registry.npmmirror.com/shebang-command/2.0.0 + which: registry.npmmirror.com/which/2.0.2 + dev: true + + registry.npmmirror.com/debug/4.3.3: + resolution: {integrity: sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/debug/-/debug-4.3.3.tgz} + name: debug + version: 4.3.3 + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: registry.npmmirror.com/ms/2.1.2 + dev: true + + registry.npmmirror.com/deep-is/0.1.4: + resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/deep-is/-/deep-is-0.1.4.tgz} + name: deep-is + version: 0.1.4 + dev: true + + registry.npmmirror.com/doctrine/3.0.0: + resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/doctrine/-/doctrine-3.0.0.tgz} + name: doctrine + version: 3.0.0 + engines: {node: '>=6.0.0'} + dependencies: + esutils: registry.npmmirror.com/esutils/2.0.3 + dev: true + + registry.npmmirror.com/escape-string-regexp/4.0.0: + resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz} + name: escape-string-regexp + version: 4.0.0 + engines: {node: '>=10'} + dev: true + + registry.npmmirror.com/eslint-config-prettier/8.3.0_eslint@8.8.0: + resolution: {integrity: sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz} + id: registry.npmmirror.com/eslint-config-prettier/8.3.0 + name: eslint-config-prettier + version: 8.3.0 + hasBin: true + peerDependencies: + eslint: '>=7.0.0' + dependencies: + eslint: registry.npmmirror.com/eslint/8.8.0 + dev: true + + registry.npmmirror.com/eslint-plugin-prettier/4.0.0_43197c8d12d1d439034cfcf65e1c48c2: + resolution: {integrity: sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz} + id: registry.npmmirror.com/eslint-plugin-prettier/4.0.0 + name: eslint-plugin-prettier + version: 4.0.0 + engines: {node: '>=6.0.0'} + peerDependencies: + eslint: '>=7.28.0' + eslint-config-prettier: '*' + prettier: '>=2.0.0' + peerDependenciesMeta: + eslint-config-prettier: + optional: true + dependencies: + eslint: registry.npmmirror.com/eslint/8.8.0 + eslint-config-prettier: registry.npmmirror.com/eslint-config-prettier/8.3.0_eslint@8.8.0 + prettier: registry.npmmirror.com/prettier/2.5.1 + prettier-linter-helpers: registry.npmmirror.com/prettier-linter-helpers/1.0.0 + dev: true + + registry.npmmirror.com/eslint-scope/7.1.0: + resolution: {integrity: sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/eslint-scope/-/eslint-scope-7.1.0.tgz} + name: eslint-scope + version: 7.1.0 + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + esrecurse: registry.npmmirror.com/esrecurse/4.3.0 + estraverse: registry.npmmirror.com/estraverse/5.3.0 + dev: true + + registry.npmmirror.com/eslint-utils/3.0.0_eslint@8.8.0: + resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/eslint-utils/-/eslint-utils-3.0.0.tgz} + id: registry.npmmirror.com/eslint-utils/3.0.0 + name: eslint-utils + version: 3.0.0 + engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0} + peerDependencies: + eslint: '>=5' + dependencies: + eslint: registry.npmmirror.com/eslint/8.8.0 + eslint-visitor-keys: registry.npmmirror.com/eslint-visitor-keys/2.1.0 + dev: true + + registry.npmmirror.com/eslint-visitor-keys/2.1.0: + resolution: {integrity: sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz} + name: eslint-visitor-keys + version: 2.1.0 + engines: {node: '>=10'} + dev: true + + registry.npmmirror.com/eslint-visitor-keys/3.2.0: + resolution: {integrity: sha512-IOzT0X126zn7ALX0dwFiUQEdsfzrm4+ISsQS8nukaJXwEyYKRSnEIIDULYg1mCtGp7UUXgfGl7BIolXREQK+XQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/eslint-visitor-keys/-/eslint-visitor-keys-3.2.0.tgz} + name: eslint-visitor-keys + version: 3.2.0 + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: true + + registry.npmmirror.com/eslint/8.8.0: + resolution: {integrity: sha512-H3KXAzQGBH1plhYS3okDix2ZthuYJlQQEGE5k0IKuEqUSiyu4AmxxlJ2MtTYeJ3xB4jDhcYCwGOg2TXYdnDXlQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/eslint/-/eslint-8.8.0.tgz} + name: eslint + version: 8.8.0 + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + hasBin: true + dependencies: + '@eslint/eslintrc': registry.npmmirror.com/@eslint/eslintrc/1.0.5 + '@humanwhocodes/config-array': registry.npmmirror.com/@humanwhocodes/config-array/0.9.3 + ajv: registry.npmmirror.com/ajv/6.12.6 + chalk: registry.npmmirror.com/chalk/4.1.2 + cross-spawn: registry.npmmirror.com/cross-spawn/7.0.3 + debug: registry.npmmirror.com/debug/4.3.3 + doctrine: registry.npmmirror.com/doctrine/3.0.0 + escape-string-regexp: registry.npmmirror.com/escape-string-regexp/4.0.0 + eslint-scope: registry.npmmirror.com/eslint-scope/7.1.0 + eslint-utils: registry.npmmirror.com/eslint-utils/3.0.0_eslint@8.8.0 + eslint-visitor-keys: registry.npmmirror.com/eslint-visitor-keys/3.2.0 + espree: registry.npmmirror.com/espree/9.3.0 + esquery: registry.npmmirror.com/esquery/1.4.0 + esutils: registry.npmmirror.com/esutils/2.0.3 + fast-deep-equal: registry.npmmirror.com/fast-deep-equal/3.1.3 + file-entry-cache: registry.npmmirror.com/file-entry-cache/6.0.1 + functional-red-black-tree: registry.npmmirror.com/functional-red-black-tree/1.0.1 + glob-parent: registry.npmmirror.com/glob-parent/6.0.2 + globals: registry.npmmirror.com/globals/13.12.1 + ignore: registry.npmmirror.com/ignore/5.2.0 + import-fresh: registry.npmmirror.com/import-fresh/3.3.0 + imurmurhash: registry.npmmirror.com/imurmurhash/0.1.4 + is-glob: registry.npmmirror.com/is-glob/4.0.3 + js-yaml: registry.npmmirror.com/js-yaml/4.1.0 + json-stable-stringify-without-jsonify: registry.npmmirror.com/json-stable-stringify-without-jsonify/1.0.1 + levn: registry.npmmirror.com/levn/0.4.1 + lodash.merge: registry.npmmirror.com/lodash.merge/4.6.2 + minimatch: registry.npmmirror.com/minimatch/3.0.5 + natural-compare: registry.npmmirror.com/natural-compare/1.4.0 + optionator: registry.npmmirror.com/optionator/0.9.1 + regexpp: registry.npmmirror.com/regexpp/3.2.0 + strip-ansi: registry.npmmirror.com/strip-ansi/6.0.1 + strip-json-comments: registry.npmmirror.com/strip-json-comments/3.1.1 + text-table: registry.npmmirror.com/text-table/0.2.0 + v8-compile-cache: registry.npmmirror.com/v8-compile-cache/2.3.0 + transitivePeerDependencies: + - supports-color + dev: true + + registry.npmmirror.com/espree/9.3.0: + resolution: {integrity: sha512-d/5nCsb0JcqsSEeQzFZ8DH1RmxPcglRWh24EFTlUEmCKoehXGdpsx0RkHDubqUI8LSAIKMQp4r9SzQ3n+sm4HQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/espree/-/espree-9.3.0.tgz} + name: espree + version: 9.3.0 + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + acorn: registry.npmmirror.com/acorn/8.7.0 + acorn-jsx: registry.npmmirror.com/acorn-jsx/5.3.2_acorn@8.7.0 + eslint-visitor-keys: registry.npmmirror.com/eslint-visitor-keys/3.2.0 + dev: true + + registry.npmmirror.com/esquery/1.4.0: + resolution: {integrity: sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/esquery/-/esquery-1.4.0.tgz} + name: esquery + version: 1.4.0 + engines: {node: '>=0.10'} + dependencies: + estraverse: registry.npmmirror.com/estraverse/5.3.0 + dev: true + + registry.npmmirror.com/esrecurse/4.3.0: + resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/esrecurse/-/esrecurse-4.3.0.tgz} + name: esrecurse + version: 4.3.0 + engines: {node: '>=4.0'} + dependencies: + estraverse: registry.npmmirror.com/estraverse/5.3.0 + dev: true + + registry.npmmirror.com/estraverse/5.3.0: + resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/estraverse/-/estraverse-5.3.0.tgz} + name: estraverse + version: 5.3.0 + engines: {node: '>=4.0'} + dev: true + + registry.npmmirror.com/esutils/2.0.3: + resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/esutils/-/esutils-2.0.3.tgz} + name: esutils + version: 2.0.3 + engines: {node: '>=0.10.0'} + dev: true + + registry.npmmirror.com/fast-deep-equal/3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz} + name: fast-deep-equal + version: 3.1.3 + dev: true + + registry.npmmirror.com/fast-diff/1.2.0: + resolution: {integrity: sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/fast-diff/-/fast-diff-1.2.0.tgz} + name: fast-diff + version: 1.2.0 + dev: true + + registry.npmmirror.com/fast-json-stable-stringify/2.1.0: + resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz} + name: fast-json-stable-stringify + version: 2.1.0 + dev: true + + registry.npmmirror.com/fast-levenshtein/2.0.6: + resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz} + name: fast-levenshtein + version: 2.0.6 + dev: true + + registry.npmmirror.com/file-entry-cache/6.0.1: + resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz} + name: file-entry-cache + version: 6.0.1 + engines: {node: ^10.12.0 || >=12.0.0} + dependencies: + flat-cache: registry.npmmirror.com/flat-cache/3.0.4 + dev: true + + registry.npmmirror.com/flat-cache/3.0.4: + resolution: {integrity: sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/flat-cache/-/flat-cache-3.0.4.tgz} + name: flat-cache + version: 3.0.4 + engines: {node: ^10.12.0 || >=12.0.0} + dependencies: + flatted: registry.npmmirror.com/flatted/3.2.5 + rimraf: registry.npmmirror.com/rimraf/3.0.2 + dev: true + + registry.npmmirror.com/flatted/3.2.5: + resolution: {integrity: sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/flatted/-/flatted-3.2.5.tgz} + name: flatted + version: 3.2.5 + dev: true + + registry.npmmirror.com/fs.realpath/1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/fs.realpath/-/fs.realpath-1.0.0.tgz} + name: fs.realpath + version: 1.0.0 + dev: true + + registry.npmmirror.com/functional-red-black-tree/1.0.1: + resolution: {integrity: sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz} + name: functional-red-black-tree + version: 1.0.1 + dev: true + + registry.npmmirror.com/glob-parent/6.0.2: + resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/glob-parent/-/glob-parent-6.0.2.tgz} + name: glob-parent + version: 6.0.2 + engines: {node: '>=10.13.0'} + dependencies: + is-glob: registry.npmmirror.com/is-glob/4.0.3 + dev: true + + registry.npmmirror.com/glob/7.2.0: + resolution: {integrity: sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/glob/-/glob-7.2.0.tgz} + name: glob + version: 7.2.0 + dependencies: + fs.realpath: registry.npmmirror.com/fs.realpath/1.0.0 + inflight: registry.npmmirror.com/inflight/1.0.6 + inherits: registry.npmmirror.com/inherits/2.0.4 + minimatch: registry.npmmirror.com/minimatch/3.0.5 + once: registry.npmmirror.com/once/1.4.0 + path-is-absolute: registry.npmmirror.com/path-is-absolute/1.0.1 + dev: true + + registry.npmmirror.com/globals/13.12.1: + resolution: {integrity: sha512-317dFlgY2pdJZ9rspXDks7073GpDmXdfbM3vYYp0HAMKGDh1FfWPleI2ljVNLQX5M5lXcAslTcPTrOrMEFOjyw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/globals/-/globals-13.12.1.tgz} + name: globals + version: 13.12.1 + engines: {node: '>=8'} + dependencies: + type-fest: registry.npmmirror.com/type-fest/0.20.2 + dev: true + + registry.npmmirror.com/has-flag/4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz} + name: has-flag + version: 4.0.0 + engines: {node: '>=8'} + dev: true + + registry.npmmirror.com/ignore/4.0.6: + resolution: {integrity: sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/ignore/-/ignore-4.0.6.tgz} + name: ignore + version: 4.0.6 + engines: {node: '>= 4'} + dev: true + + registry.npmmirror.com/ignore/5.2.0: + resolution: {integrity: sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/ignore/-/ignore-5.2.0.tgz} + name: ignore + version: 5.2.0 + engines: {node: '>= 4'} + dev: true + + registry.npmmirror.com/import-fresh/3.3.0: + resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/import-fresh/-/import-fresh-3.3.0.tgz} + name: import-fresh + version: 3.3.0 + engines: {node: '>=6'} + dependencies: + parent-module: registry.npmmirror.com/parent-module/1.0.1 + resolve-from: registry.npmmirror.com/resolve-from/4.0.0 + dev: true + + registry.npmmirror.com/imurmurhash/0.1.4: + resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/imurmurhash/-/imurmurhash-0.1.4.tgz} + name: imurmurhash + version: 0.1.4 + engines: {node: '>=0.8.19'} + dev: true + + registry.npmmirror.com/inflight/1.0.6: + resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/inflight/-/inflight-1.0.6.tgz} + name: inflight + version: 1.0.6 + dependencies: + once: registry.npmmirror.com/once/1.4.0 + wrappy: registry.npmmirror.com/wrappy/1.0.2 + dev: true + + registry.npmmirror.com/inherits/2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/inherits/-/inherits-2.0.4.tgz} + name: inherits + version: 2.0.4 + dev: true + + registry.npmmirror.com/is-extglob/2.1.1: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/is-extglob/-/is-extglob-2.1.1.tgz} + name: is-extglob + version: 2.1.1 + engines: {node: '>=0.10.0'} + dev: true + + registry.npmmirror.com/is-glob/4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/is-glob/-/is-glob-4.0.3.tgz} + name: is-glob + version: 4.0.3 + engines: {node: '>=0.10.0'} + dependencies: + is-extglob: registry.npmmirror.com/is-extglob/2.1.1 + dev: true + + registry.npmmirror.com/isexe/2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/isexe/-/isexe-2.0.0.tgz} + name: isexe + version: 2.0.0 + dev: true + + registry.npmmirror.com/js-yaml/4.1.0: + resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/js-yaml/-/js-yaml-4.1.0.tgz} + name: js-yaml + version: 4.1.0 + hasBin: true + dependencies: + argparse: registry.npmmirror.com/argparse/2.0.1 + dev: true + + registry.npmmirror.com/json-schema-traverse/0.4.1: + resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz} + name: json-schema-traverse + version: 0.4.1 + dev: true + + registry.npmmirror.com/json-stable-stringify-without-jsonify/1.0.1: + resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz} + name: json-stable-stringify-without-jsonify + version: 1.0.1 + dev: true + + registry.npmmirror.com/levn/0.4.1: + resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/levn/-/levn-0.4.1.tgz} + name: levn + version: 0.4.1 + engines: {node: '>= 0.8.0'} + dependencies: + prelude-ls: registry.npmmirror.com/prelude-ls/1.2.1 + type-check: registry.npmmirror.com/type-check/0.4.0 + dev: true + + registry.npmmirror.com/lodash.merge/4.6.2: + resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/lodash.merge/-/lodash.merge-4.6.2.tgz} + name: lodash.merge + version: 4.6.2 + dev: true + + registry.npmmirror.com/minimatch/3.0.5: + resolution: {integrity: sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/minimatch/-/minimatch-3.0.5.tgz} + name: minimatch + version: 3.0.5 + dependencies: + brace-expansion: registry.npmmirror.com/brace-expansion/1.1.11 + dev: true + + registry.npmmirror.com/ms/2.1.2: + resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/ms/-/ms-2.1.2.tgz} + name: ms + version: 2.1.2 + dev: true + + registry.npmmirror.com/natural-compare/1.4.0: + resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/natural-compare/-/natural-compare-1.4.0.tgz} + name: natural-compare + version: 1.4.0 + dev: true + + registry.npmmirror.com/once/1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/once/-/once-1.4.0.tgz} + name: once + version: 1.4.0 + dependencies: + wrappy: registry.npmmirror.com/wrappy/1.0.2 + dev: true + + registry.npmmirror.com/optionator/0.9.1: + resolution: {integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/optionator/-/optionator-0.9.1.tgz} + name: optionator + version: 0.9.1 + engines: {node: '>= 0.8.0'} + dependencies: + deep-is: registry.npmmirror.com/deep-is/0.1.4 + fast-levenshtein: registry.npmmirror.com/fast-levenshtein/2.0.6 + levn: registry.npmmirror.com/levn/0.4.1 + prelude-ls: registry.npmmirror.com/prelude-ls/1.2.1 + type-check: registry.npmmirror.com/type-check/0.4.0 + word-wrap: registry.npmmirror.com/word-wrap/1.2.3 + dev: true + + registry.npmmirror.com/parent-module/1.0.1: + resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/parent-module/-/parent-module-1.0.1.tgz} + name: parent-module + version: 1.0.1 + engines: {node: '>=6'} + dependencies: + callsites: registry.npmmirror.com/callsites/3.1.0 + dev: true + + registry.npmmirror.com/path-is-absolute/1.0.1: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz} + name: path-is-absolute + version: 1.0.1 + engines: {node: '>=0.10.0'} + dev: true + + registry.npmmirror.com/path-key/3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/path-key/-/path-key-3.1.1.tgz} + name: path-key + version: 3.1.1 + engines: {node: '>=8'} + dev: true + + registry.npmmirror.com/prelude-ls/1.2.1: + resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/prelude-ls/-/prelude-ls-1.2.1.tgz} + name: prelude-ls + version: 1.2.1 + engines: {node: '>= 0.8.0'} + dev: true + + registry.npmmirror.com/prettier-linter-helpers/1.0.0: + resolution: {integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz} + name: prettier-linter-helpers + version: 1.0.0 + engines: {node: '>=6.0.0'} + dependencies: + fast-diff: registry.npmmirror.com/fast-diff/1.2.0 + dev: true + + registry.npmmirror.com/prettier/2.5.1: + resolution: {integrity: sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/prettier/-/prettier-2.5.1.tgz} + name: prettier + version: 2.5.1 + engines: {node: '>=10.13.0'} + hasBin: true + dev: true + + registry.npmmirror.com/punycode/2.1.1: + resolution: {integrity: sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/punycode/-/punycode-2.1.1.tgz} + name: punycode + version: 2.1.1 + engines: {node: '>=6'} + dev: true + + registry.npmmirror.com/regexpp/3.2.0: + resolution: {integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/regexpp/-/regexpp-3.2.0.tgz} + name: regexpp + version: 3.2.0 + engines: {node: '>=8'} + dev: true + + registry.npmmirror.com/resolve-from/4.0.0: + resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/resolve-from/-/resolve-from-4.0.0.tgz} + name: resolve-from + version: 4.0.0 + engines: {node: '>=4'} + dev: true + + registry.npmmirror.com/rimraf/3.0.2: + resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/rimraf/-/rimraf-3.0.2.tgz} + name: rimraf + version: 3.0.2 + hasBin: true + dependencies: + glob: registry.npmmirror.com/glob/7.2.0 + dev: true + + registry.npmmirror.com/shebang-command/2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/shebang-command/-/shebang-command-2.0.0.tgz} + name: shebang-command + version: 2.0.0 + engines: {node: '>=8'} + dependencies: + shebang-regex: registry.npmmirror.com/shebang-regex/3.0.0 + dev: true + + registry.npmmirror.com/shebang-regex/3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/shebang-regex/-/shebang-regex-3.0.0.tgz} + name: shebang-regex + version: 3.0.0 + engines: {node: '>=8'} + dev: true + + registry.npmmirror.com/strip-ansi/6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz} + name: strip-ansi + version: 6.0.1 + engines: {node: '>=8'} + dependencies: + ansi-regex: registry.npmmirror.com/ansi-regex/5.0.1 + dev: true + + registry.npmmirror.com/strip-json-comments/3.1.1: + resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz} + name: strip-json-comments + version: 3.1.1 + engines: {node: '>=8'} + dev: true + + registry.npmmirror.com/supports-color/7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz} + name: supports-color + version: 7.2.0 + engines: {node: '>=8'} + dependencies: + has-flag: registry.npmmirror.com/has-flag/4.0.0 + dev: true + + registry.npmmirror.com/text-table/0.2.0: + resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/text-table/-/text-table-0.2.0.tgz} + name: text-table + version: 0.2.0 + dev: true + + registry.npmmirror.com/type-check/0.4.0: + resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/type-check/-/type-check-0.4.0.tgz} + name: type-check + version: 0.4.0 + engines: {node: '>= 0.8.0'} + dependencies: + prelude-ls: registry.npmmirror.com/prelude-ls/1.2.1 + dev: true + + registry.npmmirror.com/type-fest/0.20.2: + resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/type-fest/-/type-fest-0.20.2.tgz} + name: type-fest + version: 0.20.2 + engines: {node: '>=10'} + dev: true + + registry.npmmirror.com/uri-js/4.4.1: + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/uri-js/-/uri-js-4.4.1.tgz} + name: uri-js + version: 4.4.1 + dependencies: + punycode: registry.npmmirror.com/punycode/2.1.1 + dev: true + + registry.npmmirror.com/v8-compile-cache/2.3.0: + resolution: {integrity: sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz} + name: v8-compile-cache + version: 2.3.0 + dev: true + + registry.npmmirror.com/which/2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/which/-/which-2.0.2.tgz} + name: which + version: 2.0.2 + engines: {node: '>= 8'} + hasBin: true + dependencies: + isexe: registry.npmmirror.com/isexe/2.0.0 + dev: true + + registry.npmmirror.com/word-wrap/1.2.3: + resolution: {integrity: sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/word-wrap/-/word-wrap-1.2.3.tgz} + name: word-wrap + version: 1.2.3 + engines: {node: '>=0.10.0'} + dev: true + + registry.npmmirror.com/wrappy/1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/wrappy/-/wrappy-1.0.2.tgz} + name: wrappy + version: 1.0.2 + dev: true diff --git a/src/mindspore/README.en.md b/src/mindspore/README.en.md new file mode 100644 index 0000000000000000000000000000000000000000..49eedac1d69da3ced2de412f5f0cd4ef1f72945a --- /dev/null +++ b/src/mindspore/README.en.md @@ -0,0 +1,36 @@ +# mini-mindspore + +#### Description +mindspore小程序 + +#### Software Architecture +Software architecture description + +#### Installation + +1. xxxx +2. xxxx +3. xxxx + +#### Instructions + +1. xxxx +2. xxxx +3. xxxx + +#### Contribution + +1. Fork the repository +2. Create Feat_xxx branch +3. Commit your code +4. Create Pull Request + + +#### Gitee Feature + +1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md +2. Gitee blog [blog.gitee.com](https://blog.gitee.com) +3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) +4. The most valuable open source project [GVP](https://gitee.com/gvp) +5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) +6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/src/mindspore/README.md b/src/mindspore/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8994778fcada6f0c3212aa0444ad06c90c84d1c9 --- /dev/null +++ b/src/mindspore/README.md @@ -0,0 +1,37 @@ +# mini-mindspore + +#### 介绍 +mindspore小程序 + +#### 软件架构 +软件架构说明 + + +#### 安装教程 + +1. xxxx +2. xxxx +3. xxxx + +#### 使用说明 + +1. xxxx +2. xxxx +3. xxxx + +#### 参与贡献 + +1. Fork 本仓库 +2. 新建 Feat_xxx 分支 +3. 提交代码 +4. 新建 Pull Request + + +#### 特技 + +1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md +2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) +3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 +4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 +5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) +6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/src/mindspore/app.js b/src/mindspore/app.js new file mode 100644 index 0000000000000000000000000000000000000000..bbe3e3dd79d5595be28a5b461e1abb4a957b3086 --- /dev/null +++ b/src/mindspore/app.js @@ -0,0 +1,18 @@ +//app.js +App({ + onLaunch: function () { + var self = this; + wx.getSystemInfo({ + success(res) { + if (res.model.indexOf('iPhone X') >= 0) { + self.globalData.iPhoneX = true; + } + }, + }); + }, + onShow() {}, + loginCallback: null, + globalData: { + iphoneX: false, + }, +}); diff --git a/src/mindspore/app.json b/src/mindspore/app.json new file mode 100644 index 0000000000000000000000000000000000000000..dfbb8f9124837507ad9ae0eb4d1a17af8a160a04 --- /dev/null +++ b/src/mindspore/app.json @@ -0,0 +1,125 @@ +{ + "pages": [ + "pages/index/index", + "pages/auth/auth", + "components/user-info/user-info", + "pages/meeting/meeting", + "pages/events/events", + "pages/my/my", + "pages/null/null" + ], + "subpackages": [ + { + "root": "package-meeting", + "pages": [ + "sig/sig-list", + "reserve/reserve", + "sig/add-sig-member", + "sig/member-detail", + "sig/add-member", + "sig/del-member", + "meeting/detail", + "meeting/meeting-success", + "meeting/meeting-list", + "sig/group" + ] + }, + { + "root": "package-events", + "pages": [ + "events/event-list", + "manage/enterprise-list", + "manage/member-detail", + "manage/add-member", + "manage/del-member", + "publish/publish", + "publish/success", + "events/event-detail", + "sign-up/sign-up", + "sign-up/sign-up-success", + "events/poster" + ] + }, + { + "root": "package-my", + "pages": [ + "my/privecy", + "my/my-meetings", + "my/my-collection", + "my/help", + "my/qrcode", + "events/my-list", + "events/send-email", + "my/feedback" + ] + } + ], + "preloadRule": { + "pages/index/index": { + "network": "all", + "packages": [ + "package-meeting", + "package-events", + "package-my" + ] + } + }, + "window": { + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#fff", + "navigationBarTitleText": "MindSpore", + "navigationBarTextStyle": "black", + "backgroundColor": "#fff" + }, + "usingComponents": { + "van-swipe-cell": "./miniprogram_npm/@vant/weapp/swipe-cell/index", + "van-dialog": "./miniprogram_npm/@vant/weapp/dialog/index", + "van-checkbox": "./miniprogram_npm/@vant/weapp/checkbox/index", + "van-checkbox-group": "./miniprogram_npm/@vant/weapp/checkbox-group/index", + "van-popup": "./miniprogram_npm/@vant/weapp/popup/index", + "van-radio": "./miniprogram_npm/@vant/weapp/radio/index", + "van-radio-group": "./miniprogram_npm/@vant/weapp/radio-group/index", + "van-datetime-picker": "./miniprogram_npm/@vant/weapp/datetime-picker/index", + "van-picker": "./miniprogram_npm/@vant/weapp/picker/index", + "van-action-sheet": "./miniprogram_npm/@vant/weapp/action-sheet/index", + "wxml-to-canvas": "./miniprogram_npm/wxml-to-canvas" + }, + "sitemapLocation": "sitemap.json", + "tabBar": { + "custom": true, + "color": "#C7CAD0", + "selectedColor": "#389EEB", + "backgroundColor": "#fff", + "list": [ + { + "iconPath": "static/tabbar/home.png", + "selectedIconPath": "static/tabbar/home-selected.png", + "pagePath": "pages/index/index", + "text": "首页" + }, + { + "iconPath": "static/tabbar/meeting.png", + "selectedIconPath": "static/tabbar/meeting-selected.png", + "pagePath": "pages/meeting/meeting", + "text": "会议" + }, + { + "iconPath": "static/tabbar/events.png", + "selectedIconPath": "static/tabbar/events-selected.png", + "pagePath": "pages/events/events", + "text": "活动" + }, + { + "iconPath": "static/tabbar/my.png", + "selectedIconPath": "static/tabbar/my-selected.png", + "pagePath": "pages/my/my", + "text": "我的" + } + ] + }, + "permission": { + "scope.userLocation": { + "desc": "您的位置信息将用于确定活动地址" + } + } +} \ No newline at end of file diff --git a/src/mindspore/app.wxss b/src/mindspore/app.wxss new file mode 100644 index 0000000000000000000000000000000000000000..967d518cd290232d660d5be832905e43679a2583 --- /dev/null +++ b/src/mindspore/app.wxss @@ -0,0 +1,175 @@ +/**app.wxss**/ +page { + height: 100vh; + background: #F5F7FA; + font-family: PingFangSC-Regular, PingFangSC; + font-weight: 400; +} + +.container { + padding: 0 30rpx 129rpx 30rpx; +} + +.container-x { + padding-bottom: 195rpx; +} + +page, +view, +scroll-view, +swiper, +swiper-item, +movable-area, +movable-view, +cover-view, +cover-image, +icon, +text, +rich-text, +progress, +button, +checkbox-group, +checkbox, +form, +input, +label, +picker, +picker-view, +radio-group, +radio, +slider, +switch, +textarea, +navigator, +functional-page-navigator, +image, +video, +camera, +live-player, +live-pusher, +map, +canvas, +open-data, +web-view, +ad { + box-sizing: border-box; +} + +.dialog-index--sig-dialog { + border-radius: 8rpx; + width: 550rpx; +} + +.van-dialog__header { + padding-top: 30rpx; + color: #222; + font-size: 36rpx; + line-height: 50rpx; +} + +.dialog-slot-content { + color: #6d7278; + font-size: 32rpx; +} + +.dialog-slot-content text { + word-break: break-all; + display: inherit; + text-align: center; + overflow: hidden; + line-height: 45rpx; + margin-top: 19rpx; + padding: 0 30rpx; +} + +.dialog-slot-content .blue { + color: #40ADFF; + margin-top: 0; +} + +.dialog-slot-content view { + margin-top: 52rpx; + border-top: 1px solid #f0f3f7; + height: 88rpx; + display: flex; + align-items: center; + justify-content: space-around; +} + +.dialog-slot-content view button { + font-size: 28rpx; + line-height: 88rpx; + text-align: center; + background-color: #fff; + color: #40ADFF; +} + + +.sig-pop-wrapper { + padding: 0 30rpx; +} + +.sig-pop-wrapper .title { + margin: 30rpx 0 40rpx 0; + color: #222; + font-size: 36rpx; +} + +.sig-pop-wrapper .item .radio { + flex-direction: row-reverse; + justify-content: space-between; +} + +.sig-pop-wrapper .item .name { + font-size: 34rpx; + color: #6d7278; + width: 600rpx; +} + +.sig-pop-wrapper .item { + height: 108rpx; + display: flex; + align-items: center; + border-bottom: 1px solid #f0f3f7; +} + +.sig-pop-wrapper .item:last-child { + border: none; +} + +.sig-pop-wrapper .btn-wrapper { + display: flex; + align-items: center; + justify-content: space-between; + height: 90rpx; + font-size: 36rpx; + margin: 60rpx 0; +} + +.sig-pop-wrapper .btn-wrapper .confirm { + height: 100%; + width: 320rpx; + text-align: center; + line-height: 90rpx; + color: #fff; + background-color: #40ADFF; +} + +.sig-pop-wrapper .btn-wrapper .cancel { + height: 100%; + width: 320rpx; + text-align: center; + line-height: 90rpx; + color: #40ADFF; + background-color: #fff; + border: 1px solid #40ADFF; +} + + +button::after { + content: unset; +} + +button { + background-color: unset; +} diff --git a/src/mindspore/components/meeting-list/meeting-list.js b/src/mindspore/components/meeting-list/meeting-list.js new file mode 100644 index 0000000000000000000000000000000000000000..d2866cacfd8fc092a07fd23d9cf2d7235dc8b491 --- /dev/null +++ b/src/mindspore/components/meeting-list/meeting-list.js @@ -0,0 +1,448 @@ +// components/meeting-list/meeting-list.js +const appAjax = require('./../../utils/app-ajax'); +const sessionUtil = require('../../utils/app-session.js'); +let that = null; +const remoteMethods = { + getMeettingData: function (_callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'GET', + service: that.properties.apiUrl, + success: function (ret) { + _callback && _callback(ret); + if (that.properties.pageType === 2) { + that.setData({ + list: ret, + }); + localMethod.filterData(); + } + }, + }); + }, + delMeeting: function (id, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'PUT', + service: 'DEL_MEETING', + otherParams: { + id: id, + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, + collect: function (id, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'POST', + service: 'COLLECT', + data: { + meeting: id, + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, + uncollect: function (id, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'DELETE', + service: 'UNCOLLECT', + otherParams: { + id: id, + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, +}; +const localMethod = { + filterData: function () { + let listTemp = []; + if (that.data.curFilterId === '' && that.data.curKeyword === '') { + that.setData({ + list: that.data.filterList, + }); + return; + } + if (that.data.curFilterId === '') { + that.data.filterList.forEach(function (item) { + if ( + item.topic.toLowerCase().includes(that.data.curKeyword.toLowerCase()) || + item.group_name.toLowerCase().includes(that.data.curKeyword.toLowerCase()) + ) { + listTemp.push(item); + } + }); + that.setData({ + list: listTemp, + }); + return; + } + if (that.data.curKeyword === '') { + if (that.data.curFilterId === 'All') { + listTemp = that.data.filterList; + } else { + that.data.filterList.forEach(function (item) { + if (item.group_name === that.data.curFilterId) { + listTemp.push(item); + } else if (item.group_name !== 'MSG' && item.group_name !== 'Tech' && that.data.curFilterId === 'SIG') { + listTemp.push(item); + } + }); + } + that.setData({ + list: listTemp, + }); + return; + } + that.data.filterList.forEach(function (item) { + if ( + item.group_name == that.data.curFilterId && + item.topic.toLowerCase().includes(that.data.curKeyword.toLowerCase()) + ) { + listTemp.push(item); + } else if ( + item.group_name !== 'MSG' && + item.group_name !== 'Tech' && + that.data.curFilterId === 'SIG' && + item.topic.toLowerCase().includes(that.data.curKeyword.toLowerCase()) + ) { + listTemp.push(item); + } else if ( + (that.data.curFilterId === 'All' && item.topic.toLowerCase().includes(that.data.curKeyword.toLowerCase())) || + item.group_name.toLowerCase().includes(that.data.curKeyword.toLowerCase()) + ) { + listTemp.push(item); + } + }); + that.setData({ + list: listTemp, + }); + }, + checkLogin() { + if (!sessionUtil.getUserInfoByKey('access')) { + wx.navigateTo({ + url: '/pages/auth/auth', + }); + return; + } + return true; + }, +}; +Component({ + /** + * 组件的属性列表 + * apiUrl: 接口资源路径 + * pageType: 1、首页 2、会议列表页 3、我的会议页面 4、我的收藏会议页面 + */ + properties: { + apiUrl: { + type: String, + value: 'GET_MEETING_DAILY', + }, + pageType: { + type: Number, + value: 1, + }, + isHome: { + type: Boolean, + value: false, + }, + }, + + /** + * 组件的初始数据 + */ + data: { + list: [], + curMmid: '', + curMid: '', + curJoinUrl: '', + collectionId: '', + id: '', + showDialog: false, + showDialogDel: false, + actionShow: false, + actions: [], + popShow: false, + columns: [ + { + group_name: '全部', + id: 'All', + }, + { + group_name: 'SIG Leader', + id: 'SIG', + }, + { + group_name: 'MSG组织者', + id: 'MSG', + }, + { + group_name: '专家委员会', + id: 'Tech', + }, + ], + curKeyword: '', + curFilterId: '', + curFilterName: '类型', + filterList: [], + }, + attached() {}, + pageLifetimes: { + // 组件所在页面的生命周期函数 + show: function () { + that = this; + if (this.properties.pageType === 3 || this.properties.pageType === 4) { + this.initData(); + } + }, + }, + /** + * 组件的方法列表 + */ + methods: { + collect: function () { + if (this.data.collectionId) { + remoteMethods.uncollect(this.data.collectionId, function () { + remoteMethods.getMeettingData(function (data) { + that.setData({ + list: data, + }); + }); + }); + } else { + wx.requestSubscribeMessage({ + tmplIds: ['tK51rqE72oFo5e5ajCnvkPwnsCncfydgcV1jb9ed6Qc', 'kKkokqmaH62qp_txDQrNnyoRbM5wCptTAymhmsfHT7c'], + complete() { + remoteMethods.collect(that.data.id, function (res) { + if (res.code == 201) { + remoteMethods.getMeettingData(function (data) { + that.setData({ + list: data, + }); + }); + } + }); + }, + }); + } + }, + getAddr: function () { + this.setData({ + showDialog: true, + }); + }, + copyLink: function () { + wx.setClipboardData({ + data: this.data.curJoinUrl, + success: function () { + that.setData({ + showDialog: false, + }); + }, + }); + }, + copyId: function () { + wx.setClipboardData({ + data: this.data.curMid, + success: function () { + that.setData({ + showDialog: false, + }); + }, + }); + }, + closeDialog: function () { + this.setData({ + showDialog: false, + }); + }, + delMeeting: function () { + this.setData({ + showDialogDel: true, + }); + }, + del: function () { + that = this; + remoteMethods.delMeeting(this.data.curMmid, function (data) { + if (data.code == 200) { + wx.redirectTo({ + url: that.properties.isHome + ? '/package-meeting/meeting/meeting-success?delete=1&ishome=true' + : '/package-meeting/meeting/meeting-success?delete=1', + }); + } else { + wx.showToast({ + title: '删除会议失败', + icon: 'error', + duration: 2000, + }); + } + }); + }, + delCancel: function () { + this.setData({ + showDialogDel: false, + }); + }, + toDetail: function (e) { + if (!localMethod.checkLogin()) { + return; + } + wx.navigateTo({ + url: '/package-meeting/meeting/detail?id=' + e.currentTarget.dataset.id, + }); + }, + initData() { + remoteMethods.getMeettingData(function (data) { + let listData = data; + that.setData({ + list: listData, + filterList: listData, + }); + }); + }, + getMore(e) { + if (!localMethod.checkLogin()) { + return; + } + this.setData({ + curMmid: e.currentTarget.dataset.item.mmid, + curMid: e.currentTarget.dataset.item.mid, + curJoinUrl: e.currentTarget.dataset.item.join_url, + collectionId: e.currentTarget.dataset.item.collection_id || '', + id: e.currentTarget.dataset.item.id, + }); + const collectDesc = this.data.collectionId ? '取消收藏' : '收藏会议'; + const userId = e.currentTarget.dataset.item.user_id; + if (sessionUtil.getUserInfoByKey('level') === 1) { + this.setData({ + actions: [ + { + name: collectDesc, + operaType: 1, + }, + { + name: '获取地址', + operaType: 2, + }, + ], + }); + } else if (sessionUtil.getUserInfoByKey('level') === 2) { + if (sessionUtil.getUserInfoByKey('userId') === userId) { + this.setData({ + actions: [ + { + name: collectDesc, + operaType: 1, + }, + { + name: '获取地址', + operaType: 2, + }, + { + name: '删除会议', + operaType: 3, + }, + ], + }); + } else { + this.setData({ + actions: [ + { + name: collectDesc, + operaType: 1, + }, + { + name: '获取地址', + operaType: 2, + }, + ], + }); + } + } else { + this.setData({ + actions: [ + { + name: collectDesc, + operaType: 1, + }, + { + name: '获取地址', + operaType: 2, + }, + { + name: '删除会议', + operaType: 3, + }, + ], + }); + } + this.setData({ + actionShow: true, + }); + this.triggerEvent('action-status', 1); + }, + onActionClose() { + this.setData({ + actionShow: false, + }); + this.triggerEvent('action-status', 0); + }, + onActionSelect(e) { + if (e.detail.operaType === 1) { + this.collect(); + } else if (e.detail.operaType === 2) { + this.getAddr(); + } else { + this.delMeeting(); + } + }, + filterSig: function () { + if (this.data.curFilterName === '类型') { + this.setData({ + popShow: true, + curFilterName: '全部', + curFilterId: 'All', + }); + } else { + this.setData({ + popShow: true, + }); + } + }, + pickerChange: function (e) { + this.setData({ + curFilterId: e.detail.value.id, + curFilterName: e.detail.value.group_name, + }); + }, + popConfirm: function () { + this.setData({ + popShow: false, + }); + localMethod.filterData(); + }, + popCancel: function () { + this.setData({ + popShow: false, + }); + }, + search: function (e) { + this.setData({ + curKeyword: e.detail.value, + }); + localMethod.filterData(); + }, + }, + ready() { + if (this.properties.pageType === 1 || this.properties.pageType === 2) { + this.initData(); + } + }, +}); diff --git a/src/mindspore/components/meeting-list/meeting-list.json b/src/mindspore/components/meeting-list/meeting-list.json new file mode 100644 index 0000000000000000000000000000000000000000..7efff18051c877e3ebeefb43d84ef1b1e323e8f2 --- /dev/null +++ b/src/mindspore/components/meeting-list/meeting-list.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/src/mindspore/components/meeting-list/meeting-list.wxml b/src/mindspore/components/meeting-list/meeting-list.wxml new file mode 100644 index 0000000000000000000000000000000000000000..addaf2e007b6eafad580dc78c4a9b437ae0f38f8 --- /dev/null +++ b/src/mindspore/components/meeting-list/meeting-list.wxml @@ -0,0 +1,73 @@ + +{{isHome?'最近':'今天'}}的会议({{list.length}}) + + + + + + {{curFilterName}} + + + + + + + + {{item.group_name}} + + + + {{item.topic}} + + + + {{item.date}} {{item.start}}-{{item.end}} (可回放) + + {{item.date}} {{item.start}}-{{item.end}} + + + + {{item.agenda}} + + + + + + + + + + 暂无会议! + 当前暂无任何会议哦 + + + + + {{curMid}} + {{curJoinUrl}} + + + + + + + + + + 请确认删除当前会议 + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/components/meeting-list/meeting-list.wxss b/src/mindspore/components/meeting-list/meeting-list.wxss new file mode 100644 index 0000000000000000000000000000000000000000..c4e18a54cda0ed62a2ef0677d0c4b729c5930979 --- /dev/null +++ b/src/mindspore/components/meeting-list/meeting-list.wxss @@ -0,0 +1,173 @@ +/* components/meeting-list/meeting-list.wxss */ +@import "../../app.wxss"; + +.today-meeting { + margin-bottom: 30rpx; + font-size: 36rpx; + font-weight: 400; + color: #333; + line-height: 50rpx; +} + +.list { + color: #6d7278; + font-size: 28rpx; + font-weight: 400; +} + +.list .item { + position: relative; + margin-bottom: 30rpx; + background-color: #fff; + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; + font-size: 24rpx; +} + +.list .item .collection { + width: 40rpx; + height: 26rpx; + position: absolute; + top: 33rpx; + left: 0; +} + +.list .item .name { + font-size: 30rpx; + color: #333; + font-weight: 400; + line-height: 48rpx; + margin-top: 0; +} + +.list .item .header { + height: 90rpx; + border-bottom: 2rpx solid #f0f3f7; + display: flex; + justify-content: space-between; + align-items: center; + padding: 0 30rpx; + color: #333; + font-size: 28rpx; +} + +.list .item .isCollection { + padding-left: 60rpx; +} + +.list .item .header image { + height: 36rpx; + width: 8rpx; +} + +.list .item .wrapper { + line-height: 40rpx; + padding: 20rpx 30rpx 30rpx; +} + +.list .item .wrapper image { + vertical-align: middle; + width: 28rpx; + height: 28rpx; + margin-right: 22rpx; +} + +.list .item .wrapper text { + vertical-align: middle; +} + +.list .item .wrapper .date { + margin: 20rpx 0; +} + +.list .item .desc { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.input-wraper { + box-sizing: border-box; + margin: 20rpx 0 30rpx; + height: 108rpx; + position: relative; + box-shadow: 0px 5px 15px 0px rgba(225, 230, 238, 1); + border-radius: 8rpx; + overflow: hidden; + background-color: #fff; +} + +.input-wraper .keyword { + padding-left: 94rpx; + border-left: 1px solid #f0f3f7; + height: 108rpx; + position: absolute; + top: 0; + right: 0; + width: 70%; + font-size: 28rpx; + line-height: 40rpx; +} + +.input-wraper .keyword .search-icon { + height: 39rpx; + width: 39rpx; + display: inline-block; + position: absolute; + top: 34rpx; + left: 32rpx; +} + +.input-wraper .filter-wraper { + position: absolute; + height: 108rpx; + left: 0; + top: 0; + width: 30%; + display: flex; + align-items: center; + justify-content: center; +} + +.input-wraper .filter-wraper text { + width: 110rpx; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + font-size: 28rpx; + color: #6d7278; +} + +.input-wraper .filter-wraper image { + margin-left: 17rpx; + width: 30rpx; + height: 30rpx; +} + +.empty-status .suc-wrapper { + position: absolute; + top: 50%; + transform: translate(-50%, -50%); + left: 50%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.empty-status .suc-wrapper image { + width: 344rpx; + height: 255rpx; +} + +.empty-status .suc-wrapper text { + text-align: center; + font-size: 28rpx; + color: #6d7278; +} + +.empty-status .suc-wrapper text:first-of-type { + font-size: 34rpx; + color: #333; + margin: 53rpx 0 20rpx 0; +} \ No newline at end of file diff --git a/src/mindspore/components/message/message.js b/src/mindspore/components/message/message.js new file mode 100644 index 0000000000000000000000000000000000000000..35f3ef962f974aaf000bc0901bf09ca00301ab1b --- /dev/null +++ b/src/mindspore/components/message/message.js @@ -0,0 +1,38 @@ +// components/message/message.js +Component({ + /** + * 组件的属性列表 + * + */ + properties: { + imgUrl: { + type: String, + value: '/static/sig/add-success.png', + }, + msgText: { + type: Array, + value: ['添加成员成功!', '您已成功添加此成员'], + }, + btnText: { + type: String, + value: '', + }, + }, + + /** + * 组件的初始数据 + */ + data: {}, + pageLifetimes: { + // 组件所在页面的生命周期函数 + show: function () {}, + }, + /** + * 组件的方法列表 + */ + methods: { + backTo() { + wx.navigateBack(); + }, + }, +}); diff --git a/src/mindspore/components/message/message.json b/src/mindspore/components/message/message.json new file mode 100644 index 0000000000000000000000000000000000000000..e8cfaaf80c404eb97d3cf8b6277ec15f37e6905e --- /dev/null +++ b/src/mindspore/components/message/message.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/src/mindspore/components/message/message.wxml b/src/mindspore/components/message/message.wxml new file mode 100644 index 0000000000000000000000000000000000000000..22d65845b05fd6e7be0f8f92c7c5b943d9311113 --- /dev/null +++ b/src/mindspore/components/message/message.wxml @@ -0,0 +1,11 @@ + + + + + + {{msgText[0]}} + {{msgText[1]}} + + + + diff --git a/src/mindspore/components/message/message.wxss b/src/mindspore/components/message/message.wxss new file mode 100644 index 0000000000000000000000000000000000000000..3a3e3a2d4c30d965459922197c5791508cf9e3c2 --- /dev/null +++ b/src/mindspore/components/message/message.wxss @@ -0,0 +1,43 @@ +/* components/message/message.wxss */ +.message-box { + height: 100vh; + display: flex; + justify-content: center; + align-items: center; + background: #F5F7FA; +} + +.message-box .content image{ + width: 315rpx; + height: 266rpx; + display: block; + margin: 0 auto; +} + +.message-box .content .title { + font-size: 34rpx; + color: #333333; + line-height: 48rpx; + margin: 42px 0 20px 0; +} + +.message-box .content text { + font-size: 28rpx; + font-weight: 400; + color: #6D7278; + line-height: 38rpx; + text-align: center; + display: block; +} + +.message-box .content .confirm { + width: 500rpx; + height: 90rpx; + background: #40ADFF; + border-radius: 20rpx; + color: #FFFFFF; + font-size: 36rpx; + line-height: 90rpx; + font-weight: 400; + margin-top: 128rpx; +} diff --git a/src/mindspore/components/user-info/user-info.js b/src/mindspore/components/user-info/user-info.js new file mode 100644 index 0000000000000000000000000000000000000000..bf5d9582ac51dc14b112d69a1168ee09d7d13cbe --- /dev/null +++ b/src/mindspore/components/user-info/user-info.js @@ -0,0 +1,70 @@ +// components/user-info/user-info.js +const sessionUtil = require('../../utils/app-session.js'); +const localMethods = { + getCurText() { + var timestamp = Date.parse(new Date()); + timestamp = timestamp / 1000; + var n = timestamp * 1000; + var date = new Date(n); + var h = date.getHours(); + var m = date.getMinutes(); + var hm = parseFloat(h + '.' + m); + if (23 < hm || hm <= 6) { + return '请睡吧'; + } + if (6 < hm && hm <= 12) { + return '上午好'; + } + if (12 < hm && hm <= 14) { + return '中午好'; + } + if (14 < hm && hm <= 18) { + return '下午好'; + } + if (18 < hm && hm <= 23) { + return '晚上好'; + } + }, +}; +Component({ + /** + * 组件的属性列表 + */ + properties: {}, + + /** + * 组件的初始数据 + */ + data: { + isLogin: false, + avatarUrl: '', + text: '', + nickName: '', + }, + pageLifetimes: { + // 组件所在页面的生命周期函数 + + show: function () { + this.setData({ + isLogin: sessionUtil.getUserInfoByKey('access'), + }); + if (this.data.isLogin) { + this.setData({ + avatarUrl: sessionUtil.getUserInfoByKey('avatarUrl'), + text: localMethods.getCurText(), + nickName: sessionUtil.getUserInfoByKey('nickName'), + }); + } + }, + }, + /** + * 组件的方法列表 + */ + methods: { + login() { + wx.navigateTo({ + url: '/pages/auth/auth', + }); + }, + }, +}); diff --git a/src/mindspore/components/user-info/user-info.json b/src/mindspore/components/user-info/user-info.json new file mode 100644 index 0000000000000000000000000000000000000000..7efff18051c877e3ebeefb43d84ef1b1e323e8f2 --- /dev/null +++ b/src/mindspore/components/user-info/user-info.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/src/mindspore/components/user-info/user-info.wxml b/src/mindspore/components/user-info/user-info.wxml new file mode 100644 index 0000000000000000000000000000000000000000..b77b9ef4778838e06811c4144bac0134d9c644be --- /dev/null +++ b/src/mindspore/components/user-info/user-info.wxml @@ -0,0 +1,9 @@ + + + + 登录 + + + + {{text}},{{nickName}} + \ No newline at end of file diff --git a/src/mindspore/components/user-info/user-info.wxss b/src/mindspore/components/user-info/user-info.wxss new file mode 100644 index 0000000000000000000000000000000000000000..5585becc9f6c13c864fdca67e59090f4cbd42ad7 --- /dev/null +++ b/src/mindspore/components/user-info/user-info.wxss @@ -0,0 +1,22 @@ +/* components/user-info/user-info.wxss */ +.userinfo { + padding-top: 30rpx; + margin-bottom: 30rpx; + line-height: 84rpx; +} + +.userinfo .image { + vertical-align: middle; + height: 84rpx; + width: 84rpx; + border-radius: 100%; + margin-right: 30rpx; +} + +.userinfo .text { + vertical-align: middle; + font-size: 36rpx; + line-height: 50rpx; + font-weight: 400; + color: #333; +} \ No newline at end of file diff --git a/src/mindspore/config/constants.js b/src/mindspore/config/constants.js new file mode 100644 index 0000000000000000000000000000000000000000..1c019b277cf2f9d1c4267507bcada5bbd26bd29b --- /dev/null +++ b/src/mindspore/config/constants.js @@ -0,0 +1,20 @@ +/** + * 常量配置 + */ +var _ = require('../utils/underscore-extend.js'); + +// 服务连接配置 +var serviceConfig = { + SERVICE_URL: 'https://api.mindspore.cn/meetings', // 正式环境 + // SERVICE_URL: "http://119.8.32.82/mindspore", // 测试环境 +}; + +// 存储配置 +var storageConfig = { + APP_USERINFO_SESSION: '_app_userinfo_session', +}; + +// 所有配置 +var constants = _.deepExtend(true, serviceConfig, storageConfig); + +module.exports = constants; diff --git a/src/mindspore/config/field-validate-rules.js b/src/mindspore/config/field-validate-rules.js new file mode 100644 index 0000000000000000000000000000000000000000..30afcef968a7dc218386750b7e904f6729b75855 --- /dev/null +++ b/src/mindspore/config/field-validate-rules.js @@ -0,0 +1,271 @@ +const rules = { + // 6位数字验证码 + numberCode6: { + regex: /^\d{6,6}$/, + errorMsg: '请输入6位数字验证码', + }, + + // 8位数字验证码 + numberCode8: { + regex: /^\d{8,8}$/, + errorMsg: '请输入8位数字验证码', + }, + + // 手机号码校验 + phone: { + regex: /(^1[3456789]\d{9}$)|^$/, + errorMsg: '请输入正确的手机号码', + }, + + // 电子邮箱校验 + email: { + regex: + /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i, + errorMsg: ' 无效的邮件地址', + }, + + // 电子邮箱和手机号码校验 + emailOrPhone: { + regex: /(^1[34578]\d{9}$)|(^[0-9a-z_][_.0-9a-z-]{0,31}@([0-9a-z][0-9a-z-]{0,30}\.){1,4}[a-z]{2,4}$)/, + errorMsg: ' 无效的手机号/邮箱', + }, + + // 金额类型 + money: { + regex: /^(\d+)(\.\d+)?$/, + errorMsg: '请输入正确的金额', + }, + + // 最多输入两位小数 + validateTwoDecimal: { + regex: /^(\d+)(\.\d+)?$/, + errorMsg: '最多输入两位小数', + }, + + // 正整数类型 + checkUnsignInt: { + regex: /^[1-9]{1}\d*$/, + errorMsg: '请输入正整数', + }, + + // 整数类型 + integer: { + regex: /^[\-\+]?\d+$/, + errorMsg: ' 无效的整数', + }, + + // 数字类型 + number: { + regex: /^[\-\+]?((([0-9]{1,3})([,][0-9]{3})*)|([0-9]+))?([\.]([0-9]+))?$/, + errorMsg: ' 无效的数值', + }, + + // 浮点数类型 + float: { + regex: /^(-?\d+)(\.\d+)?$/, + errorMsg: '请输入正确的浮点数', + }, + + // 日期YYYY-MM-DD + date: { + regex: /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/, + errorMsg: ' 无效的日期,格式必需为 YYYY-MM-DD', + }, + + // 校验日期格式 + dateFormat: { + regex: + /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(?:(?:0?[1-9]|1[0-2])(\/|-)(?:0?[1-9]|1\d|2[0-8]))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(0?2(\/|-)29)(\/|-)(?:(?:0[48]00|[13579][26]00|[2468][048]00)|(?:\d\d)?(?:0[48]|[2468][048]|[13579][26]))$/, + errorMsg: ' 无效的日期格式', + }, + + // 日期时间校验 + dateTimeFormat: { + regex: + /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1}$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^((1[012]|0?[1-9]){1}\/(0?[1-9]|[12][0-9]|3[01]){1}\/\d{2,4}\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1})$/, + errorMsg: ' 无效的日期或时间格式', + }, + + // ipv4地址校验 + ipv4: { + regex: /^((([01]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))[.]){3}(([0-1]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))$/, + errorMsg: ' 无效的 IP 地址', + }, + + // 网址校验 + url: { + regex: + /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i, + errorMsg: ' 无效的网址', + }, + + // 校验英文字母 + onlyLetter: { + regex: /^[a-zA-Z\ \']+$/, + errorMsg: ' 只能填写英文字母', + }, + + // 英文和数字校验 + onlyLetterNumber: { + regex: /^[0-9a-zA-Z]+$/, + errorMsg: ' 只能填写数字与英文字母', + }, + + // 汉字校验 + chinese: { + regex: /^[\u4E00-\u9FA5]+$/, + errorMsg: ' 只能填写中文汉字', + }, + + // 身份证校验 + chinaId: { + regex: + /^[1-9]\d{5}[1-9]\d{3}(((0[13578]|1[02])(0[1-9]|[12]\d|3[0-1]))|((0[469]|11)(0[1-9]|[12]\d|30))|(02(0[1-9]|[12]\d)))(\d{4}|\d{3}[xX])$/, + errorMsg: ' 无效的身份证号码', + }, + + // 邮政编码校验 + chinaZip: { + regex: /^\d{6}$/, + errorMsg: ' 无效的邮政编码', + }, + + // QQ号码校验 + qq: { + regex: /(^[0-9]{5,15}$)|^$/, + errorMsg: ' 无效的 QQ 号码', + }, + // 密码验证 + checkPassword618: { + regex: + /^([\w~`!@#$%^&*()_+-=\[\]\{\}\|\\:;'"<>,\.\?\/]{6,18}|[\w~`!@#$%^&*()_+-=\[\]\{\}\|\\:;'"<>,\.\?\/]{32}|^)$/, + errorMsg: ' 请输入6-18位密码', + }, + + // 密码验证-字母和数字组合 + checkPasswordLetterNumber: { + regex: /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,18}$/, + errorMsg: '密码应为6-18位字母和数字组合', + }, + + // 姓名格式验证 + checkRealName: { + regex: /^[A-Za-z\u4e00-\u9fa5]{0,15}$/, + errorMsg: '最多可输入15字,包含中文、字母', + }, + + // 验证昵称 + checkName: { + regex: /^[0-9A-Za-z\u4e00-\u9fa5]{0,15}$/, + errorMsg: ' 最多可输入15字,包含中文,字母,数字', + }, + // 验证邮编 + checkCode: { + regex: /^[0-9]{6}$/, + errorMsg: ' 请输入合法的邮政编码', + }, + + // 验证公司名称、工作描述 + checkSomeName: { + regex: /^[0-9A-Za-z\u4e00-\u9fa5]{0,30}$/, + errorMsg: ' 最多可输入30字,包含中文、字母、数字', + }, + + // 验证政府事业单位中(组织机构代码)包含数字或字母,且长度为15-30位 + checkOrganizationCode: { + regex: /^[0-9A-Za-z]{15,30}$/, + errorMsg: ' 请输入正确的组织机构代码', + }, + + // 企业认证-验证企业名称 + chenckCompanyName: { + regex: /^[0-9A-Za-z\u4e00-\u9fa5\()\()]{0,50}$/, + errorMsg: '最多可输入50字,包含中文、字母、数字', + }, + + // 企业认证-验证证件号 + checkCertificateLicense: { + regex: /^[0-9A-Za-z()-]{9,30}$/, + errorMsg: '请输入正确的证件号', + }, + + // 验证法定代表人 + validateLegalPerson: { + regex: /^[A-Za-z\u4e00-\u9fa5]{0,15}$/, + errorMsg: '请输入正确的法定代表人', + }, + + // 验证微信号 + validateWeixin: { + regex: /^(([A-Za-z]+[0-9A-Za-z_-]*))*$/, + errorMsg: '请输入正确的微信号', + }, + + // 验证微博地址 + validateWeibo: { + regex: /^(http[s]{0,1}:\/\/.+)*$/, + errorMsg: '请输入正确的微博地址', + }, + + // 银行卡号验证 + validateBankCard: { + regex: /^[0-9]{10,19}$/, + errorMsg: '请输入正确的银行卡号验证', + }, + + // 用户输入内容 + checkIntro: { + regex: /^[0-9A-Za-z\u4e00-\u9fa5]{0,500}$/, + errorMsg: '只能包含汉字、字母、数字,且最多为500字', + }, + + // 校验手机号码 + phonenumber: { + regex: /^[\-\+]?((([0-9]{1,3})([,][0-9]{3})*)|([0-9]+))?([\.]([0-9]+))?$/, + errorMsg: ' 无效的电话号码', + }, + + // 校验护照 + validatePassport: { + regex: /^1[45][0-9]{7}|([P|p|S|s]\\d{7})|([S|s|G|g]\\d{8})|([Gg|Tt|Ss|Ll|Qq|Dd|Aa|Ff]\\d{8})|([H|h|M|m]\\d{8,10})$/, + errorMsg: '请输入正确的护照', + }, + + // 校验香港身份证 + validateIdentityHK: { + regex: /^[A-Z]\d{6}\(\d|[A-Z]\)$/, + errorMsg: '请输入正确的香港身份证', + }, + + // 澳门身份证验证 + validateIdentityMC: { + regex: /^\d{7}\(\d\)$/, + errorMsg: '请输入正确的澳门身份证', + }, + + // 台湾身份证验证 + validateIdentityTW: { + regex: /^[A-Z]\d{9}$/, + errorMsg: '请输入正确的台湾身份证', + }, + + // 关键词校验 + keywordcheck: { + regex: /^[A-Za-z0-9\u4e00-\u9fa5]+(,[A-Za-z0-9\u4e00-\u9fa5]{1,15})*$/, + errorMsg: '必须以","(英文逗号)分隔符,最后一个关键词不需要逗号', + }, + + // 关键词最多输入10个 + validateKeywordMax10: { + regex: /^([A-Za-z0-9\u4e00-\u9fa5]+(\;|\;){0,1}){1,10}$/, + errorMsg: '请输入正确的关键词格式:最多可输入10个,以;隔开', + }, + + // 敏感词最多输入十个 + sensitiveWordsMax10: { + regex: /^[A-Za-z0-9\u4e00-\u9fa5]{1,10}$/, + errorMsg: '请输入需要新增的敏感词', + }, +}; + +module.exports = rules; diff --git a/src/mindspore/config/services-config.js b/src/mindspore/config/services-config.js new file mode 100644 index 0000000000000000000000000000000000000000..d1b32441b1a4883e2a9683c18f7839419f775b41 --- /dev/null +++ b/src/mindspore/config/services-config.js @@ -0,0 +1,171 @@ +var _ = require('../utils/underscore-extend.js'); + +// 通用接口配置 +var commonServiceConfig = { + // 登录接口 + LOGIN: '/login/', + + // sig列表 + SIG_LIST: '/sigs/', + + // 获取当前组已添加成员列表 + GROUP_MEMBER_LIST: '/users_include/', + + // 获取当前组未添加成员列表 + GROUP_EXCLUDE_MEMBER_LIST: '/users_exclude/', + + //获取所有组的信息 + ALL_GROUP_LIST: '/groups/', + + // 添加组员 + ADD_MEMBER_LIST: '/groupuser/action/new/', + + // 删除组员 + DEL_MEMBER_LIST: '/groupuser/action/del/', + + // 获取sig组未添加成员列表 + GET_USER_GROUP: '/usergroup/{id}/', + + // 创建会议 + SAVE_MEETING: '/meetings/', + + // 获取会议详情 + GET_MEETING_DETAIL: '/meetings/{id}/', + + // 最近的会议列表 + RECENTLY_MEETINGS: '/meetingslist/?range=recently', + + // 获取当日会议列表 + GET_MEETING_DAILY: '/meetingslist/?range=daily', + + // 获取前后一周会议列表 + GET_MEETING_WEEKLY: '/meetingslist/?range=weekly', + + // 删除会议 + DEL_MEETING: '/meeting/{id}/', + + // 获取用户状态 + GET_USER_STATUS: '/userinfo/{id}/', + + // 保存用户giteename + SAVE_MEMBER_DETAIL: '/user/{id}/', + + // 我创建的会议列表 + MY_MEETINGS_LIST: '/mymeetings/', + + // 收藏会议 + COLLECT: '/collect/', + + // 取消收藏 + UNCOLLECT: '/collect/{id}/', + + // 收藏列表 + MY_COLLECT_LIST: '/collections/', + + // 获取发起人列表 + ENTERPRISE_MEMBER_LIST: '/sponsors/', + + // 获取未添加发起人名单 + ENTERPRISE_EXCLUDE_MEMBER_LIST: '/nonsponsors/', + + // 添加发起人 + ENTERPRISE_ADD_MEMBER_LIST: '/sponsor/action/new/', + + // 编辑发起人信息 + ENTERPRISE_SAVE_MEMBER_DETAIL: '/sponsorinfo/{id}/', + + // 删除发起人 + ENTERPRISE_DEL_MEMBER_LIST: '/sponsor/action/del/', + + // 发布 + PUBLISH_EVENT: '/activity/', + + // 保存草稿 + SAVE_DRAFT: '/activitydraft/', + + // 获取草稿箱活动列表 + GET_DRAFT_LIST: '/activitiesdraft/', + + // 获取全量待发布 + DRAFTS: '/drafts/', + + //草稿详情 + DRAFT_DETAIL: '/sponsoractivitydraft/{id}/', + + // 修改草稿 + EDIT_DETAIL: '/draftupdate/{id}/', + + // 修改草稿并发布 + + EDIT_DETAIL_PUBLISH: '/draftpublish/{id}/', + + // 驳回活动发布 + REJECT_PUBLISH: '/activityreject/{id}/', + + // 活动审核通过 + RESOLVE_PUBLISH: '/activitypublish/{id}/', + + // 活动审核通过 + PUBLISHER_EVENTS_LIST: '/sponsoractivitiespublishing/', + + // 我发布的活动 + MY_EVENTS_LIST: '/sponsoractivities/', + + // 我发布的活动 + DEL_EVENT: '/activitydel/{id}/', + + // 所有活动 + ALL_EVENTS_LIST: '/activities/', + + // 所有活动 + EVENT_DETAIL: '/activity/{id}/', + + // 修改日程 + EDIT_SCHEDULE: '/activityupdate/{id}/', + + // 修改日程 + EXAMINE_DETAIL: '/draft/{id}/', + + // 修改日程 + EVENT_COLLECT: '/collectactivity/', + + // 修改日程 + EVENT_UNCOLLECT: '/collectactivitydel/{id}/', + + // 活动收藏列表 + EVENT_COLLECT_LIST: '/collectactivities/', + + // 最新活动列表 + LATEST_EVENTS: '/recentactivities/', + + // 获取报名者信息 + APPLICANT_INFO: '/applicantinfo/{id}/', + + // 报名 + SAVE_SIGNUP_INFO: '/activityregister/', + + // 我报名的活动 + MY_SIGNUP_EVENTS: '/registeractivities/', + + // 报名表单 + SEND_SIGNUP_INFO: '/applicantsinfo/', + + // 保存意见反馈 + SAVE_FEEDBACK: '/feedback/', + + // 获取已发布分类数量 + GET_EVENTS_COUNT: '/countactivities/', + + // 获取我已预定的会议 + GET_MY_MEETING: '/mymeetings/', + + // 获取我已收藏的会议 + GET_MY_COLLECT: '/collections/', + + // 获取我的活动报名信息 + GET_SIGNUP_INFO: '/ticket/{id}/', +}; + +let servicesConfig = _.deepExtend(true, commonServiceConfig); + +module.exports = servicesConfig; diff --git a/src/mindspore/custom-tab-bar/index.js b/src/mindspore/custom-tab-bar/index.js new file mode 100644 index 0000000000000000000000000000000000000000..8efa472e361d0113987d783c1ab11b4e68422e47 --- /dev/null +++ b/src/mindspore/custom-tab-bar/index.js @@ -0,0 +1,49 @@ +// custom-tab-bar/index.js +const sessionUtil = require('./../utils/app-session.js'); +Component({ + /** + * 组件的属性列表 + */ + properties: {}, + + /** + * 组件的初始数据 + */ + data: { + show: true, + _tabbat: 0, + iPhoneX: null, + urls: ['/pages/index/index', '/pages/meeting/meeting', '/pages/events/events', '/pages/my/my'], + }, + attached() { + let self = this; + wx.getSystemInfo({ + success(res) { + if (res.model.indexOf('iPhone X') >= 0 || res.model.indexOf('iPhone 11') >= 0) { + self.setData({ + iPhoneX: true, + }); + } + }, + }); + }, + /** + * 组件的方法列表 + */ + methods: { + switchTap: function (e) { + if (!sessionUtil.getUserInfoByKey('access')) { + wx.navigateTo({ + url: '/pages/auth/auth', + }); + return; + } + let self = this; + let index = e.currentTarget.dataset.index; + let urls = self.data.urls; + wx.switchTab({ + url: urls[index], + }); + }, + }, +}); diff --git a/src/mindspore/custom-tab-bar/index.json b/src/mindspore/custom-tab-bar/index.json new file mode 100644 index 0000000000000000000000000000000000000000..4575d1b8fadae381488ab3296b7a2e699a700a0a --- /dev/null +++ b/src/mindspore/custom-tab-bar/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "component": true +} \ No newline at end of file diff --git a/src/mindspore/custom-tab-bar/index.wxml b/src/mindspore/custom-tab-bar/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..efa40b7d7fa6fd0e8288f2770bbd9f7da794df21 --- /dev/null +++ b/src/mindspore/custom-tab-bar/index.wxml @@ -0,0 +1,19 @@ + + + + + 首页 + + + + 会议 + + + + 活动 + + + + 我的 + + \ No newline at end of file diff --git a/src/mindspore/custom-tab-bar/index.wxss b/src/mindspore/custom-tab-bar/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..1046c1ead4d667db031ab19f96792b6b2190bc70 --- /dev/null +++ b/src/mindspore/custom-tab-bar/index.wxss @@ -0,0 +1,36 @@ +/* custom-tab-bar/index.wxss */ +._tabbar { + width: 100%; + height: 99rpx; + display: flex; + align-items: center; + background: #fff; + font-size: 20rpx; + color: #C7CAD0; + box-shadow: 0 6rpx 20rpx 0 rgba(22, 124, 202, 0.15); +} + +._tabbar .titem { + text-align: center; + width: 25%; +} + +._tabbar .titem .img { + display: block; + margin: auto; + width: 54rpx; + height: 54rpx; + margin-bottom: 6rpx; +} + +._tabbar .tCdk { + color: #389EEB; +} + +._iPhoneX { + height: 165rpx; +} + +._iPhoneX .titem { + margin-bottom: 66rpx; +} \ No newline at end of file diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/action-sheet/index.js b/src/mindspore/miniprogram_npm/@vant/weapp/action-sheet/index.js new file mode 100644 index 0000000000000000000000000000000000000000..a9e4b076e603a012a306d176ab62038efbd5a714 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/action-sheet/index.js @@ -0,0 +1,64 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../common/component'); +var button_1 = require('../mixins/button'); +var open_type_1 = require('../mixins/open-type'); +component_1.VantComponent({ + mixins: [button_1.button, open_type_1.openType], + props: { + show: Boolean, + title: String, + cancelText: String, + description: String, + round: { + type: Boolean, + value: true, + }, + zIndex: { + type: Number, + value: 100, + }, + actions: { + type: Array, + value: [], + }, + overlay: { + type: Boolean, + value: true, + }, + closeOnClickOverlay: { + type: Boolean, + value: true, + }, + closeOnClickAction: { + type: Boolean, + value: true, + }, + safeAreaInsetBottom: { + type: Boolean, + value: true, + }, + }, + methods: { + onSelect: function (event) { + var index = event.currentTarget.dataset.index; + var item = this.data.actions[index]; + if (item && !item.disabled && !item.loading) { + this.$emit('select', item); + if (this.data.closeOnClickAction) { + this.onClose(); + } + } + }, + onCancel: function () { + this.$emit('cancel'); + }, + onClose: function () { + this.$emit('close'); + }, + onClickOverlay: function () { + this.$emit('click-overlay'); + this.onClose(); + }, + }, +}); diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/action-sheet/index.json b/src/mindspore/miniprogram_npm/@vant/weapp/action-sheet/index.json new file mode 100644 index 0000000000000000000000000000000000000000..19bf98915f6b60674e153fca262fc9e6dd595ea1 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/action-sheet/index.json @@ -0,0 +1,8 @@ +{ + "component": true, + "usingComponents": { + "van-icon": "../icon/index", + "van-popup": "../popup/index", + "van-loading": "../loading/index" + } +} diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/action-sheet/index.wxml b/src/mindspore/miniprogram_npm/@vant/weapp/action-sheet/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..c2bebcacf21b463f2086b67def0ed8cd74dd7d14 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/action-sheet/index.wxml @@ -0,0 +1,69 @@ + + + + + {{ title }} + + + + {{ description }} + + + + + + + + + + {{ cancelText }} + + + diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/action-sheet/index.wxss b/src/mindspore/miniprogram_npm/@vant/weapp/action-sheet/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..9b247d5d81acaf35e41a90a4c959f6e48738de1f --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/action-sheet/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-action-sheet{max-height:90%!important;max-height:var(--action-sheet-max-height,90%)!important;color:#323233;color:var(--action-sheet-item-text-color,#323233)}.van-action-sheet__cancel,.van-action-sheet__item{padding:14px 16px;text-align:center;font-size:16px;font-size:var(--action-sheet-item-font-size,16px);line-height:22px;line-height:var(--action-sheet-item-line-height,22px);background-color:#fff;background-color:var(--action-sheet-item-background,#fff)}.van-action-sheet__cancel--hover,.van-action-sheet__item--hover{background-color:#f2f3f5;background-color:var(--active-color,#f2f3f5)}.van-action-sheet__cancel:after,.van-action-sheet__item:after{border-width:0}.van-action-sheet__cancel{color:#646566;color:var(--action-sheet-cancel-text-color,#646566)}.van-action-sheet__gap{display:block;height:8px;height:var(--action-sheet-cancel-padding-top,8px);background-color:#f7f8fa;background-color:var(--action-sheet-cancel-padding-color,#f7f8fa)}.van-action-sheet__item--disabled{color:#c8c9cc;color:var(--action-sheet-item-disabled-text-color,#c8c9cc)}.van-action-sheet__item--disabled.van-action-sheet__item--hover{background-color:#fff;background-color:var(--action-sheet-item-background,#fff)}.van-action-sheet__subname{margin-top:8px;margin-top:var(--padding-xs,8px);font-size:12px;font-size:var(--action-sheet-subname-font-size,12px);color:#969799;color:var(--action-sheet-subname-color,#969799);line-height:20px;line-height:var(--action-sheet-subname-line-height,20px)}.van-action-sheet__header{text-align:center;font-weight:500;font-weight:var(--font-weight-bold,500);font-size:16px;font-size:var(--action-sheet-header-font-size,16px);line-height:48px;line-height:var(--action-sheet-header-height,48px)}.van-action-sheet__description{text-align:center;padding:20px 16px;padding:20px var(--padding-md,16px);color:#969799;color:var(--action-sheet-description-color,#969799);font-size:14px;font-size:var(--action-sheet-description-font-size,14px);line-height:20px;line-height:var(--action-sheet-description-line-height,20px)}.van-action-sheet__close{position:absolute!important;top:0;right:0;line-height:inherit!important;padding:0 16px;padding:var(--action-sheet-close-icon-padding,0 16px);font-size:22px!important;font-size:var(--action-sheet-close-icon-size,22px)!important;color:#c8c9cc;color:var(--action-sheet-close-icon-color,#c8c9cc)}.van-action-sheet__loading{display:-webkit-flex!important;display:flex!important} \ No newline at end of file diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/area/index.js b/src/mindspore/miniprogram_npm/@vant/weapp/area/index.js new file mode 100644 index 0000000000000000000000000000000000000000..73a4b2693c9aa97a7756f763bf55eea964ebf862 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/area/index.js @@ -0,0 +1,263 @@ +'use strict'; +var __assign = + (this && this.__assign) || + function () { + __assign = + Object.assign || + function (t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../common/component'); +var shared_1 = require('../picker/shared'); +var utils_1 = require('../common/utils'); +var EMPTY_CODE = '000000'; +component_1.VantComponent({ + classes: ['active-class', 'toolbar-class', 'column-class'], + props: __assign(__assign({}, shared_1.pickerProps), { + value: { + type: String, + observer: function (value) { + this.code = value; + this.setValues(); + }, + }, + areaList: { + type: Object, + value: {}, + observer: 'setValues', + }, + columnsNum: { + type: null, + value: 3, + }, + columnsPlaceholder: { + type: Array, + observer: function (val) { + this.setData({ + typeToColumnsPlaceholder: { + province: val[0] || '', + city: val[1] || '', + county: val[2] || '', + }, + }); + }, + }, + }), + data: { + columns: [{ values: [] }, { values: [] }, { values: [] }], + typeToColumnsPlaceholder: {}, + }, + mounted: function () { + var _this = this; + utils_1.requestAnimationFrame(function () { + _this.setValues(); + }); + }, + methods: { + getPicker: function () { + if (this.picker == null) { + this.picker = this.selectComponent('.van-area__picker'); + } + return this.picker; + }, + onCancel: function (event) { + this.emit('cancel', event.detail); + }, + onConfirm: function (event) { + var index = event.detail.index; + var value = event.detail.value; + value = this.parseValues(value); + this.emit('confirm', { value: value, index: index }); + }, + emit: function (type, detail) { + detail.values = detail.value; + delete detail.value; + this.$emit(type, detail); + }, + parseValues: function (values) { + var columnsPlaceholder = this.data.columnsPlaceholder; + return values.map(function (value, index) { + if ( + value && + (!value.code || value.name === columnsPlaceholder[index]) + ) { + return __assign(__assign({}, value), { code: '', name: '' }); + } + return value; + }); + }, + onChange: function (event) { + var _this = this; + var _a = event.detail, + index = _a.index, + picker = _a.picker, + value = _a.value; + this.code = value[index].code; + this.setValues().then(function () { + _this.$emit('change', { + picker: picker, + values: _this.parseValues(picker.getValues()), + index: index, + }); + }); + }, + getConfig: function (type) { + var areaList = this.data.areaList; + return (areaList && areaList[type + '_list']) || {}; + }, + getList: function (type, code) { + if (type !== 'province' && !code) { + return []; + } + var typeToColumnsPlaceholder = this.data.typeToColumnsPlaceholder; + var list = this.getConfig(type); + var result = Object.keys(list).map(function (code) { + return { + code: code, + name: list[code], + }; + }); + if (code != null) { + // oversea code + if (code[0] === '9' && type === 'city') { + code = '9'; + } + result = result.filter(function (item) { + return item.code.indexOf(code) === 0; + }); + } + if (typeToColumnsPlaceholder[type] && result.length) { + // set columns placeholder + var codeFill = + type === 'province' + ? '' + : type === 'city' + ? EMPTY_CODE.slice(2, 4) + : EMPTY_CODE.slice(4, 6); + result.unshift({ + code: '' + code + codeFill, + name: typeToColumnsPlaceholder[type], + }); + } + return result; + }, + getIndex: function (type, code) { + var compareNum = type === 'province' ? 2 : type === 'city' ? 4 : 6; + var list = this.getList(type, code.slice(0, compareNum - 2)); + // oversea code + if (code[0] === '9' && type === 'province') { + compareNum = 1; + } + code = code.slice(0, compareNum); + for (var i = 0; i < list.length; i++) { + if (list[i].code.slice(0, compareNum) === code) { + return i; + } + } + return 0; + }, + setValues: function () { + var picker = this.getPicker(); + if (!picker) { + return; + } + var code = this.code || this.getDefaultCode(); + var provinceList = this.getList('province'); + var cityList = this.getList('city', code.slice(0, 2)); + var stack = []; + var indexes = []; + var columnsNum = this.data.columnsNum; + if (columnsNum >= 1) { + stack.push(picker.setColumnValues(0, provinceList, false)); + indexes.push(this.getIndex('province', code)); + } + if (columnsNum >= 2) { + stack.push(picker.setColumnValues(1, cityList, false)); + indexes.push(this.getIndex('city', code)); + if (cityList.length && code.slice(2, 4) === '00') { + code = cityList[0].code; + } + } + if (columnsNum === 3) { + stack.push( + picker.setColumnValues( + 2, + this.getList('county', code.slice(0, 4)), + false + ) + ); + indexes.push(this.getIndex('county', code)); + } + return Promise.all(stack) + .catch(function () {}) + .then(function () { + return picker.setIndexes(indexes); + }) + .catch(function () {}); + }, + getDefaultCode: function () { + var columnsPlaceholder = this.data.columnsPlaceholder; + if (columnsPlaceholder.length) { + return EMPTY_CODE; + } + var countyCodes = Object.keys(this.getConfig('county')); + if (countyCodes[0]) { + return countyCodes[0]; + } + var cityCodes = Object.keys(this.getConfig('city')); + if (cityCodes[0]) { + return cityCodes[0]; + } + return ''; + }, + getValues: function () { + var picker = this.getPicker(); + if (!picker) { + return []; + } + return this.parseValues( + picker.getValues().filter(function (value) { + return !!value; + }) + ); + }, + getDetail: function () { + var values = this.getValues(); + var area = { + code: '', + country: '', + province: '', + city: '', + county: '', + }; + if (!values.length) { + return area; + } + var names = values.map(function (item) { + return item.name; + }); + area.code = values[values.length - 1].code; + if (area.code[0] === '9') { + area.country = names[1] || ''; + area.province = names[2] || ''; + } else { + area.province = names[0] || ''; + area.city = names[1] || ''; + area.county = names[2] || ''; + } + return area; + }, + reset: function (code) { + this.code = code || ''; + return this.setValues(); + }, + }, +}); diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/area/index.json b/src/mindspore/miniprogram_npm/@vant/weapp/area/index.json new file mode 100644 index 0000000000000000000000000000000000000000..a778e91cce16edbb1fd2af764415c4f8d2f0a0ea --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/area/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-picker": "../picker/index" + } +} diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/area/index.wxml b/src/mindspore/miniprogram_npm/@vant/weapp/area/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..f7dc51f53e9dc7fd462c4b314068ee160331ebce --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/area/index.wxml @@ -0,0 +1,20 @@ + + + diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/area/index.wxs b/src/mindspore/miniprogram_npm/@vant/weapp/area/index.wxs new file mode 100644 index 0000000000000000000000000000000000000000..07723c11af98212d0c454d9fbacabe9e6963e838 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/area/index.wxs @@ -0,0 +1,8 @@ +/* eslint-disable */ +function displayColumns(columns, columnsNum) { + return columns.slice(0, +columnsNum); +} + +module.exports = { + displayColumns: displayColumns, +}; diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/area/index.wxss b/src/mindspore/miniprogram_npm/@vant/weapp/area/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..99694d603361421fe8f1acfc76a09eae443cb3aa --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/area/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss'; \ No newline at end of file diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/button/index.js b/src/mindspore/miniprogram_npm/@vant/weapp/button/index.js new file mode 100644 index 0000000000000000000000000000000000000000..cbf57f0b98647fc5918f1fdc01caad0a1bc14b06 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/button/index.js @@ -0,0 +1,60 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../common/component'); +var button_1 = require('../mixins/button'); +var open_type_1 = require('../mixins/open-type'); +var version_1 = require('../common/version'); +var mixins = [button_1.button, open_type_1.openType]; +if (version_1.canIUseFormFieldButton()) { + mixins.push('wx://form-field-button'); +} +component_1.VantComponent({ + mixins: mixins, + classes: ['hover-class', 'loading-class'], + data: { + baseStyle: '', + }, + props: { + formType: String, + icon: String, + classPrefix: { + type: String, + value: 'van-icon', + }, + plain: Boolean, + block: Boolean, + round: Boolean, + square: Boolean, + loading: Boolean, + hairline: Boolean, + disabled: Boolean, + loadingText: String, + customStyle: String, + loadingType: { + type: String, + value: 'circular', + }, + type: { + type: String, + value: 'default', + }, + dataset: null, + size: { + type: String, + value: 'normal', + }, + loadingSize: { + type: String, + value: '20px', + }, + color: String, + }, + methods: { + onClick: function () { + if (!this.data.loading) { + this.$emit('click'); + } + }, + noop: function () {}, + }, +}); diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/button/index.json b/src/mindspore/miniprogram_npm/@vant/weapp/button/index.json new file mode 100644 index 0000000000000000000000000000000000000000..e00a588702da8887bbe5f8261aea5764251d14ff --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/button/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": { + "van-icon": "../icon/index", + "van-loading": "../loading/index" + } +} diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/button/index.wxml b/src/mindspore/miniprogram_npm/@vant/weapp/button/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..e4cec8aeb81d7784eb7219e28e87056b7fa23085 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/button/index.wxml @@ -0,0 +1,53 @@ + + + + diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/button/index.wxs b/src/mindspore/miniprogram_npm/@vant/weapp/button/index.wxs new file mode 100644 index 0000000000000000000000000000000000000000..8b649fe18d9444424b6b4c87737790d5bdd0b800 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/button/index.wxs @@ -0,0 +1,39 @@ +/* eslint-disable */ +var style = require('../wxs/style.wxs'); + +function rootStyle(data) { + if (!data.color) { + return data.customStyle; + } + + var properties = { + color: data.plain ? data.color : '#fff', + background: data.plain ? null : data.color, + }; + + // hide border when color is linear-gradient + if (data.color.indexOf('gradient') !== -1) { + properties.border = 0; + } else { + properties['border-color'] = data.color; + } + + return style([properties, data.customStyle]); +} + +function loadingColor(data) { + if (data.plain) { + return data.color ? data.color : '#c9c9c9'; + } + + if (data.type === 'default') { + return '#c9c9c9'; + } + + return '#fff'; +} + +module.exports = { + rootStyle: rootStyle, + loadingColor: loadingColor, +}; diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/button/index.wxss b/src/mindspore/miniprogram_npm/@vant/weapp/button/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..5a591fbd5ebe777d649cc7e6378a25d40615767f --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/button/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-button{position:relative;display:-webkit-inline-flex;display:inline-flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;padding:0;text-align:center;vertical-align:middle;-webkit-appearance:none;-webkit-text-size-adjust:100%;height:44px;height:var(--button-default-height,44px);line-height:20px;line-height:var(--button-line-height,20px);font-size:16px;font-size:var(--button-default-font-size,16px);transition:opacity .2s;transition:opacity var(--animation-duration-fast,.2s);border-radius:2px;border-radius:var(--button-border-radius,2px)}.van-button:before{position:absolute;top:50%;left:50%;width:100%;height:100%;border:inherit;border-radius:inherit;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);opacity:0;content:" ";background-color:#000;background-color:var(--black,#000);border-color:#000;border-color:var(--black,#000)}.van-button:after{border-width:0}.van-button--active:before{opacity:.15}.van-button--unclickable:after{display:none}.van-button--default{color:#323233;color:var(--button-default-color,#323233);background:#fff;background:var(--button-default-background-color,#fff);border:1px solid #ebedf0;border:var(--button-border-width,1px) solid var(--button-default-border-color,#ebedf0)}.van-button--primary{color:#fff;color:var(--button-primary-color,#fff);background:#07c160;background:var(--button-primary-background-color,#07c160);border:1px solid #07c160;border:var(--button-border-width,1px) solid var(--button-primary-border-color,#07c160)}.van-button--info{color:#fff;color:var(--button-info-color,#fff);background:#1989fa;background:var(--button-info-background-color,#1989fa);border:1px solid #1989fa;border:var(--button-border-width,1px) solid var(--button-info-border-color,#1989fa)}.van-button--danger{color:#fff;color:var(--button-danger-color,#fff);background:#ee0a24;background:var(--button-danger-background-color,#ee0a24);border:1px solid #ee0a24;border:var(--button-border-width,1px) solid var(--button-danger-border-color,#ee0a24)}.van-button--warning{color:#fff;color:var(--button-warning-color,#fff);background:#ff976a;background:var(--button-warning-background-color,#ff976a);border:1px solid #ff976a;border:var(--button-border-width,1px) solid var(--button-warning-border-color,#ff976a)}.van-button--plain{background:#fff;background:var(--button-plain-background-color,#fff)}.van-button--plain.van-button--primary{color:#07c160;color:var(--button-primary-background-color,#07c160)}.van-button--plain.van-button--info{color:#1989fa;color:var(--button-info-background-color,#1989fa)}.van-button--plain.van-button--danger{color:#ee0a24;color:var(--button-danger-background-color,#ee0a24)}.van-button--plain.van-button--warning{color:#ff976a;color:var(--button-warning-background-color,#ff976a)}.van-button--large{width:100%;height:50px;height:var(--button-large-height,50px)}.van-button--normal{padding:0 15px;font-size:14px;font-size:var(--button-normal-font-size,14px)}.van-button--small{min-width:60px;min-width:var(--button-small-min-width,60px);height:30px;height:var(--button-small-height,30px);padding:0 8px;padding:0 var(--padding-xs,8px);font-size:12px;font-size:var(--button-small-font-size,12px)}.van-button--mini{display:inline-block;min-width:50px;min-width:var(--button-mini-min-width,50px);height:22px;height:var(--button-mini-height,22px);font-size:10px;font-size:var(--button-mini-font-size,10px)}.van-button--mini+.van-button--mini{margin-left:5px}.van-button--block{display:-webkit-flex;display:flex;width:100%}.van-button--round{border-radius:999px;border-radius:var(--button-round-border-radius,999px)}.van-button--square{border-radius:0}.van-button--disabled{opacity:.5;opacity:var(--button-disabled-opacity,.5)}.van-button__text{display:inline}.van-button__icon+.van-button__text:not(:empty),.van-button__loading-text{margin-left:4px}.van-button__icon{min-width:1em;line-height:inherit!important;vertical-align:top}.van-button--hairline{padding-top:1px;border-width:0}.van-button--hairline:after{border-color:inherit;border-width:1px;border-radius:4px;border-radius:calc(var(--button-border-radius, 2px)*2)}.van-button--hairline.van-button--round:after{border-radius:999px;border-radius:var(--button-round-border-radius,999px)}.van-button--hairline.van-button--square:after{border-radius:0} \ No newline at end of file diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/calendar/calendar.wxml b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/calendar.wxml new file mode 100644 index 0000000000000000000000000000000000000000..26938c1a496daa399392781a1f541a918a86cb77 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/calendar.wxml @@ -0,0 +1,65 @@ + +
+ +
+ + + + + + + + + + + + {{ + computed.getButtonDisabled(type, currentDate) + ? confirmDisabledText + : confirmText + }} + + +
diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/calendar/components/header/index.js b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/components/header/index.js new file mode 100644 index 0000000000000000000000000000000000000000..cf725aec77f3c6b541d438e11079d7ad6bfe5e87 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/components/header/index.js @@ -0,0 +1,18 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../../../common/component'); +component_1.VantComponent({ + props: { + title: { + type: String, + value: '日期选择', + }, + subtitle: String, + showTitle: Boolean, + showSubtitle: Boolean, + }, + data: { + weekdays: ['日', '一', '二', '三', '四', '五', '六'], + }, + methods: {}, +}); diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/calendar/components/header/index.json b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/components/header/index.json new file mode 100644 index 0000000000000000000000000000000000000000..467ce2945f917ae0035594117b51f5304cdcdfa6 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/components/header/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxml b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..eb8e4b47a1a11e63cf50ae7be23b00a0790f4592 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxml @@ -0,0 +1,16 @@ + + + + {{ title }} + + + + {{ subtitle }} + + + + + {{ item }} + + + diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxss b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..4075e48f17ccea9eb15348c86b332b9464d534aa --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxss @@ -0,0 +1 @@ +@import '../../../common/index.wxss';.van-calendar__header{-webkit-flex-shrink:0;flex-shrink:0;box-shadow:0 2px 10px rgba(125,126,128,.16);box-shadow:var(--calendar-header-box-shadow,0 2px 10px rgba(125,126,128,.16))}.van-calendar__header-subtitle,.van-calendar__header-title{text-align:center;height:44px;height:var(--calendar-header-title-height,44px);font-weight:500;font-weight:var(--font-weight-bold,500);line-height:44px;line-height:var(--calendar-header-title-height,44px)}.van-calendar__header-title+.van-calendar__header-title,.van-calendar__header-title:empty{display:none}.van-calendar__header-title:empty+.van-calendar__header-title{display:block!important}.van-calendar__weekdays{display:-webkit-flex;display:flex}.van-calendar__weekday{-webkit-flex:1;flex:1;text-align:center;font-size:12px;font-size:var(--calendar-weekdays-font-size,12px);line-height:30px;line-height:var(--calendar-weekdays-height,30px)} \ No newline at end of file diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/calendar/components/month/index.js b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/components/month/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e8aaaf402824c59d0f7e93e3136c4aced56876fe --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/components/month/index.js @@ -0,0 +1,167 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../../../common/component'); +var utils_1 = require('../../utils'); +component_1.VantComponent({ + props: { + date: { + type: null, + observer: 'setDays', + }, + type: { + type: String, + observer: 'setDays', + }, + color: String, + minDate: { + type: null, + observer: 'setDays', + }, + maxDate: { + type: null, + observer: 'setDays', + }, + showMark: Boolean, + rowHeight: null, + formatter: { + type: null, + observer: 'setDays', + }, + currentDate: { + type: null, + observer: 'setDays', + }, + allowSameDay: Boolean, + showSubtitle: Boolean, + showMonthTitle: Boolean, + }, + data: { + visible: true, + days: [], + }, + methods: { + onClick: function (event) { + var index = event.currentTarget.dataset.index; + var item = this.data.days[index]; + if (item.type !== 'disabled') { + this.$emit('click', item); + } + }, + setDays: function () { + var days = []; + var startDate = new Date(this.data.date); + var year = startDate.getFullYear(); + var month = startDate.getMonth(); + var totalDay = utils_1.getMonthEndDay( + startDate.getFullYear(), + startDate.getMonth() + 1 + ); + for (var day = 1; day <= totalDay; day++) { + var date = new Date(year, month, day); + var type = this.getDayType(date); + var config = { + date: date, + type: type, + text: day, + bottomInfo: this.getBottomInfo(type), + }; + if (this.data.formatter) { + config = this.data.formatter(config); + } + days.push(config); + } + this.setData({ days: days }); + }, + getMultipleDayType: function (day) { + var currentDate = this.data.currentDate; + if (!Array.isArray(currentDate)) { + return ''; + } + var isSelected = function (date) { + return currentDate.some(function (item) { + return utils_1.compareDay(item, date) === 0; + }); + }; + if (isSelected(day)) { + var prevDay = utils_1.getPrevDay(day); + var nextDay = utils_1.getNextDay(day); + var prevSelected = isSelected(prevDay); + var nextSelected = isSelected(nextDay); + if (prevSelected && nextSelected) { + return 'multiple-middle'; + } + if (prevSelected) { + return 'end'; + } + return nextSelected ? 'start' : 'multiple-selected'; + } + return ''; + }, + getRangeDayType: function (day) { + var _a = this.data, + currentDate = _a.currentDate, + allowSameDay = _a.allowSameDay; + if (!Array.isArray(currentDate)) { + return; + } + var startDay = currentDate[0], + endDay = currentDate[1]; + if (!startDay) { + return; + } + var compareToStart = utils_1.compareDay(day, startDay); + if (!endDay) { + return compareToStart === 0 ? 'start' : ''; + } + var compareToEnd = utils_1.compareDay(day, endDay); + if (compareToStart === 0 && compareToEnd === 0 && allowSameDay) { + return 'start-end'; + } + if (compareToStart === 0) { + return 'start'; + } + if (compareToEnd === 0) { + return 'end'; + } + if (compareToStart > 0 && compareToEnd < 0) { + return 'middle'; + } + }, + getDayType: function (day) { + var _a = this.data, + type = _a.type, + minDate = _a.minDate, + maxDate = _a.maxDate, + currentDate = _a.currentDate; + if ( + utils_1.compareDay(day, minDate) < 0 || + utils_1.compareDay(day, maxDate) > 0 + ) { + return 'disabled'; + } + if (type === 'single') { + return utils_1.compareDay(day, currentDate) === 0 ? 'selected' : ''; + } + if (type === 'multiple') { + return this.getMultipleDayType(day); + } + /* istanbul ignore else */ + if (type === 'range') { + return this.getRangeDayType(day); + } + }, + getBottomInfo: function (type) { + if (this.data.type === 'range') { + if (type === 'start') { + return '开始'; + } + if (type === 'end') { + return '结束'; + } + if (type === 'start-end') { + return '开始/结束'; + } + } + }, + }, +}); diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/calendar/components/month/index.json b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/components/month/index.json new file mode 100644 index 0000000000000000000000000000000000000000..467ce2945f917ae0035594117b51f5304cdcdfa6 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/components/month/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxml b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..55bab83f7052326e7d65dc7958362c3f4dc483ed --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxml @@ -0,0 +1,39 @@ + + + + + + {{ computed.formatMonthTitle(date) }} + + + + + {{ computed.getMark(date) }} + + + + + {{ item.topInfo }} + {{ item.text }} + + {{ item.bottomInfo }} + + + + + {{ item.topInfo }} + {{ item.text }} + + {{ item.bottomInfo }} + + + + + diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxs b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxs new file mode 100644 index 0000000000000000000000000000000000000000..a057079893859f30492a02ff620e22387fb199cd --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxs @@ -0,0 +1,67 @@ +/* eslint-disable */ +var utils = require('../../utils.wxs'); + +function getMark(date) { + return getDate(date).getMonth() + 1; +} + +var ROW_HEIGHT = 64; + +function getDayStyle(type, index, date, rowHeight, color) { + var style = []; + var offset = getDate(date).getDay(); + + if (index === 0) { + style.push(['margin-left', (100 * offset) / 7 + '%']); + } + + if (rowHeight !== ROW_HEIGHT) { + style.push(['height', rowHeight + 'px']); + } + + if (color) { + if ( + type === 'start' || + type === 'end' || + type === 'multiple-selected' || + type === 'multiple-middle' + ) { + style.push(['background', color]); + } else if (type === 'middle') { + style.push(['color', color]); + } + } + + return style + .map(function(item) { + return item.join(':'); + }) + .join(';'); +} + +function formatMonthTitle(date) { + date = getDate(date); + return date.getFullYear() + '年' + (date.getMonth() + 1) + '月'; +} + +function getMonthStyle(visible, date, rowHeight) { + if (!visible) { + date = getDate(date); + + var totalDay = utils.getMonthEndDay( + date.getFullYear(), + date.getMonth() + 1 + ); + var offset = getDate(date).getDay(); + var padding = Math.ceil((totalDay + offset) / 7) * rowHeight; + + return 'padding-bottom:' + padding + 'px'; + } +} + +module.exports = { + getMark: getMark, + getDayStyle: getDayStyle, + formatMonthTitle: formatMonthTitle, + getMonthStyle: getMonthStyle +}; diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxss b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..17c12f4e60009cbbe9457f4370d57e30953fc0d4 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxss @@ -0,0 +1 @@ +@import '../../../common/index.wxss';.van-calendar{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;height:100%;background-color:#fff;background-color:var(--calendar-background-color,#fff)}.van-calendar__month-title{text-align:center;height:44px;height:var(--calendar-header-title-height,44px);font-weight:500;font-weight:var(--font-weight-bold,500);font-size:14px;font-size:var(--calendar-month-title-font-size,14px);line-height:44px;line-height:var(--calendar-header-title-height,44px)}.van-calendar__days{position:relative;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;-webkit-user-select:none;user-select:none}.van-calendar__month-mark{position:absolute;top:50%;left:50%;z-index:0;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);pointer-events:none;color:rgba(242,243,245,.8);color:var(--calendar-month-mark-color,rgba(242,243,245,.8));font-size:160px;font-size:var(--calendar-month-mark-font-size,160px)}.van-calendar__day,.van-calendar__selected-day{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;text-align:center}.van-calendar__day{position:relative;width:14.285%;height:64px;height:var(--calendar-day-height,64px);font-size:16px;font-size:var(--calendar-day-font-size,16px)}.van-calendar__day--end,.van-calendar__day--multiple-middle,.van-calendar__day--multiple-selected,.van-calendar__day--start,.van-calendar__day--start-end{color:#fff;color:var(--calendar-range-edge-color,#fff);background-color:#ee0a24;background-color:var(--calendar-range-edge-background-color,#ee0a24)}.van-calendar__day--start{border-radius:4px 0 0 4px;border-radius:var(--border-radius-md,4px) 0 0 var(--border-radius-md,4px)}.van-calendar__day--end{border-radius:0 4px 4px 0;border-radius:0 var(--border-radius-md,4px) var(--border-radius-md,4px) 0}.van-calendar__day--multiple-selected,.van-calendar__day--start-end{border-radius:4px;border-radius:var(--border-radius-md,4px)}.van-calendar__day--middle{color:#ee0a24;color:var(--calendar-range-middle-color,#ee0a24)}.van-calendar__day--middle:after{position:absolute;top:0;right:0;bottom:0;left:0;background-color:currentColor;content:"";opacity:.1;opacity:var(--calendar-range-middle-background-opacity,.1)}.van-calendar__day--disabled{cursor:default;color:#c8c9cc;color:var(--calendar-day-disabled-color,#c8c9cc)}.van-calendar__bottom-info,.van-calendar__top-info{position:absolute;right:0;left:0;font-size:10px;font-size:var(--calendar-info-font-size,10px);line-height:14px;line-height:var(--calendar-info-line-height,14px)}@media (max-width:350px){.van-calendar__bottom-info,.van-calendar__top-info{font-size:9px}}.van-calendar__top-info{top:6px}.van-calendar__bottom-info{bottom:6px}.van-calendar__selected-day{width:54px;width:var(--calendar-selected-day-size,54px);height:54px;height:var(--calendar-selected-day-size,54px);color:#fff;color:var(--calendar-selected-day-color,#fff);background-color:#ee0a24;background-color:var(--calendar-selected-day-background-color,#ee0a24);border-radius:4px;border-radius:var(--border-radius-md,4px)} \ No newline at end of file diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/calendar/index.js b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/index.js new file mode 100644 index 0000000000000000000000000000000000000000..1da8ee09c37ef352bb91a6fd8b6e77c11a6f5b15 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/index.js @@ -0,0 +1,325 @@ +'use strict'; +var __spreadArrays = + (this && this.__spreadArrays) || + function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) + s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; + }; +var __importDefault = + (this && this.__importDefault) || + function (mod) { + return mod && mod.__esModule ? mod : { default: mod }; + }; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../common/component'); +var utils_1 = require('./utils'); +var toast_1 = __importDefault(require('../toast/toast')); +var utils_2 = require('../common/utils'); +component_1.VantComponent({ + props: { + title: { + type: String, + value: '日期选择', + }, + color: String, + show: { + type: Boolean, + observer: function (val) { + if (val) { + this.initRect(); + this.scrollIntoView(); + } + }, + }, + formatter: null, + confirmText: { + type: String, + value: '确定', + }, + rangePrompt: String, + defaultDate: { + type: null, + observer: function (val) { + this.setData({ currentDate: val }); + this.scrollIntoView(); + }, + }, + allowSameDay: Boolean, + confirmDisabledText: String, + type: { + type: String, + value: 'single', + observer: 'reset', + }, + minDate: { + type: null, + value: Date.now(), + }, + maxDate: { + type: null, + value: new Date( + new Date().getFullYear(), + new Date().getMonth() + 6, + new Date().getDate() + ).getTime(), + }, + position: { + type: String, + value: 'bottom', + }, + rowHeight: { + type: null, + value: utils_1.ROW_HEIGHT, + }, + round: { + type: Boolean, + value: true, + }, + poppable: { + type: Boolean, + value: true, + }, + showMark: { + type: Boolean, + value: true, + }, + showTitle: { + type: Boolean, + value: true, + }, + showConfirm: { + type: Boolean, + value: true, + }, + showSubtitle: { + type: Boolean, + value: true, + }, + safeAreaInsetBottom: { + type: Boolean, + value: true, + }, + closeOnClickOverlay: { + type: Boolean, + value: true, + }, + maxRange: { + type: null, + value: null, + }, + }, + data: { + subtitle: '', + currentDate: null, + scrollIntoView: '', + }, + created: function () { + this.setData({ + currentDate: this.getInitialDate(), + }); + }, + mounted: function () { + if (this.data.show || !this.data.poppable) { + this.initRect(); + this.scrollIntoView(); + } + }, + methods: { + reset: function () { + this.setData({ currentDate: this.getInitialDate() }); + this.scrollIntoView(); + }, + initRect: function () { + var _this = this; + if (this.contentObserver != null) { + this.contentObserver.disconnect(); + } + var contentObserver = this.createIntersectionObserver({ + thresholds: [0, 0.1, 0.9, 1], + observeAll: true, + }); + this.contentObserver = contentObserver; + contentObserver.relativeTo('.van-calendar__body'); + contentObserver.observe('.month', function (res) { + if (res.boundingClientRect.top <= res.relativeRect.top) { + // @ts-ignore + _this.setData({ + subtitle: utils_1.formatMonthTitle(res.dataset.date), + }); + } + }); + }, + getInitialDate: function () { + var _a = this.data, + type = _a.type, + defaultDate = _a.defaultDate, + minDate = _a.minDate; + if (type === 'range') { + var _b = defaultDate || [], + startDay = _b[0], + endDay = _b[1]; + return [ + startDay || minDate, + endDay || utils_1.getNextDay(new Date(minDate)).getTime(), + ]; + } + if (type === 'multiple') { + return defaultDate || [minDate]; + } + return defaultDate || minDate; + }, + scrollIntoView: function () { + var _this = this; + utils_2.requestAnimationFrame(function () { + var _a = _this.data, + currentDate = _a.currentDate, + type = _a.type, + show = _a.show, + poppable = _a.poppable, + minDate = _a.minDate, + maxDate = _a.maxDate; + // @ts-ignore + var targetDate = type === 'single' ? currentDate : currentDate[0]; + var displayed = show || !poppable; + if (!targetDate || !displayed) { + return; + } + var months = utils_1.getMonths(minDate, maxDate); + months.some(function (month, index) { + if (utils_1.compareMonth(month, targetDate) === 0) { + _this.setData({ scrollIntoView: 'month' + index }); + return true; + } + return false; + }); + }); + }, + onOpen: function () { + this.$emit('open'); + }, + onOpened: function () { + this.$emit('opened'); + }, + onClose: function () { + this.$emit('close'); + }, + onClosed: function () { + this.$emit('closed'); + }, + onClickDay: function (event) { + var date = event.detail.date; + var _a = this.data, + type = _a.type, + currentDate = _a.currentDate, + allowSameDay = _a.allowSameDay; + if (type === 'range') { + // @ts-ignore + var startDay = currentDate[0], + endDay = currentDate[1]; + if (startDay && !endDay) { + var compareToStart = utils_1.compareDay(date, startDay); + if (compareToStart === 1) { + this.select([startDay, date], true); + } else if (compareToStart === -1) { + this.select([date, null]); + } else if (allowSameDay) { + this.select([date, date]); + } + } else { + this.select([date, null]); + } + } else if (type === 'multiple') { + var selectedIndex_1; + // @ts-ignore + var selected = currentDate.some(function (dateItem, index) { + var equal = utils_1.compareDay(dateItem, date) === 0; + if (equal) { + selectedIndex_1 = index; + } + return equal; + }); + if (selected) { + // @ts-ignore + var cancelDate = currentDate.splice(selectedIndex_1, 1); + this.setData({ currentDate: currentDate }); + this.unselect(cancelDate); + } else { + // @ts-ignore + this.select(__spreadArrays(currentDate, [date])); + } + } else { + this.select(date, true); + } + }, + unselect: function (dateArray) { + var date = dateArray[0]; + if (date) { + this.$emit('unselect', utils_1.copyDates(date)); + } + }, + select: function (date, complete) { + if (complete && this.data.type === 'range') { + var valid = this.checkRange(date); + if (!valid) { + // auto selected to max range if showConfirm + if (this.data.showConfirm) { + this.emit([ + date[0], + utils_1.getDayByOffset(date[0], this.data.maxRange - 1), + ]); + } else { + this.emit(date); + } + return; + } + } + this.emit(date); + if (complete && !this.data.showConfirm) { + this.onConfirm(); + } + }, + emit: function (date) { + var getTime = function (date) { + return date instanceof Date ? date.getTime() : date; + }; + this.setData({ + currentDate: Array.isArray(date) ? date.map(getTime) : getTime(date), + }); + this.$emit('select', utils_1.copyDates(date)); + }, + checkRange: function (date) { + var _a = this.data, + maxRange = _a.maxRange, + rangePrompt = _a.rangePrompt; + if (maxRange && utils_1.calcDateNum(date) > maxRange) { + toast_1.default({ + context: this, + message: + rangePrompt || + '\u9009\u62E9\u5929\u6570\u4E0D\u80FD\u8D85\u8FC7 ' + + maxRange + + ' \u5929', + }); + return false; + } + return true; + }, + onConfirm: function () { + var _this = this; + if ( + this.data.type === 'range' && + !this.checkRange(this.data.currentDate) + ) { + return; + } + wx.nextTick(function () { + // @ts-ignore + _this.$emit('confirm', utils_1.copyDates(_this.data.currentDate)); + }); + }, + }, +}); diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/calendar/index.json b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/index.json new file mode 100644 index 0000000000000000000000000000000000000000..397d5aea19a5301358cd2dfc4b0e9a1879fe5b6f --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/index.json @@ -0,0 +1,10 @@ +{ + "component": true, + "usingComponents": { + "header": "./components/header/index", + "month": "./components/month/index", + "van-button": "../button/index", + "van-popup": "../popup/index", + "van-toast": "../toast/index" + } +} diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/calendar/index.wxml b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..7df0b980bc248ff3ef5d86aecccbe22bf231e41c --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/index.wxml @@ -0,0 +1,25 @@ + + + + + + + + + + + + diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/calendar/index.wxs b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/index.wxs new file mode 100644 index 0000000000000000000000000000000000000000..2c04be10f07bb4614ede2e80d3935191635d3831 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/index.wxs @@ -0,0 +1,37 @@ +/* eslint-disable */ +var utils = require('./utils.wxs'); + +function getMonths(minDate, maxDate) { + var months = []; + var cursor = getDate(minDate); + + cursor.setDate(1); + + do { + months.push(cursor.getTime()); + cursor.setMonth(cursor.getMonth() + 1); + } while (utils.compareMonth(cursor, getDate(maxDate)) !== 1); + + return months; +} + +function getButtonDisabled(type, currentDate) { + if (currentDate == null) { + return true; + } + + if (type === 'range') { + return !currentDate[0] || !currentDate[1]; + } + + if (type === 'multiple') { + return !currentDate.length; + } + + return !currentDate; +} + +module.exports = { + getMonths: getMonths, + getButtonDisabled: getButtonDisabled +}; diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/calendar/index.wxss b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..9d78e0f4be3971db4a709cab484ee70dd38e61ce --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-calendar{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;height:100%;height:var(--calendar-height,100%);background-color:#fff;background-color:var(--calendar-background-color,#fff)}.van-calendar__close-icon{top:11px}.van-calendar__popup--bottom,.van-calendar__popup--top{height:80%;height:var(--calendar-popup-height,80%)}.van-calendar__popup--left,.van-calendar__popup--right{height:100%}.van-calendar__body{-webkit-flex:1;flex:1;overflow:auto;-webkit-overflow-scrolling:touch}.van-calendar__footer{-webkit-flex-shrink:0;flex-shrink:0;padding:0 16px;padding:0 var(--padding-md,16px)}.van-calendar__footer--safe-area-inset-bottom{padding-bottom:env(safe-area-inset-bottom)}.van-calendar__footer+.van-calendar__footer,.van-calendar__footer:empty{display:none}.van-calendar__footer:empty+.van-calendar__footer{display:block!important}.van-calendar__confirm{height:36px!important;height:var(--calendar-confirm-button-height,36px)!important;margin:7px 0!important;margin:var(--calendar-confirm-button-margin,7px 0)!important;line-height:34px!important;line-height:var(--calendar-confirm-button-line-height,34px)!important} \ No newline at end of file diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/calendar/utils.js b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..cdd1a0cb059a95f1da479b715a58ce4835b79991 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/utils.js @@ -0,0 +1,91 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +exports.getMonths = exports.getMonthEndDay = exports.copyDates = exports.calcDateNum = exports.getNextDay = exports.getPrevDay = exports.getDayByOffset = exports.compareDay = exports.compareMonth = exports.formatMonthTitle = exports.ROW_HEIGHT = void 0; +exports.ROW_HEIGHT = 64; +function formatMonthTitle(date) { + if (!(date instanceof Date)) { + date = new Date(date); + } + return date.getFullYear() + '\u5E74' + (date.getMonth() + 1) + '\u6708'; +} +exports.formatMonthTitle = formatMonthTitle; +function compareMonth(date1, date2) { + if (!(date1 instanceof Date)) { + date1 = new Date(date1); + } + if (!(date2 instanceof Date)) { + date2 = new Date(date2); + } + var year1 = date1.getFullYear(); + var year2 = date2.getFullYear(); + var month1 = date1.getMonth(); + var month2 = date2.getMonth(); + if (year1 === year2) { + return month1 === month2 ? 0 : month1 > month2 ? 1 : -1; + } + return year1 > year2 ? 1 : -1; +} +exports.compareMonth = compareMonth; +function compareDay(day1, day2) { + if (!(day1 instanceof Date)) { + day1 = new Date(day1); + } + if (!(day2 instanceof Date)) { + day2 = new Date(day2); + } + var compareMonthResult = compareMonth(day1, day2); + if (compareMonthResult === 0) { + var date1 = day1.getDate(); + var date2 = day2.getDate(); + return date1 === date2 ? 0 : date1 > date2 ? 1 : -1; + } + return compareMonthResult; +} +exports.compareDay = compareDay; +function getDayByOffset(date, offset) { + date = new Date(date); + date.setDate(date.getDate() + offset); + return date; +} +exports.getDayByOffset = getDayByOffset; +function getPrevDay(date) { + return getDayByOffset(date, -1); +} +exports.getPrevDay = getPrevDay; +function getNextDay(date) { + return getDayByOffset(date, 1); +} +exports.getNextDay = getNextDay; +function calcDateNum(date) { + var day1 = new Date(date[0]).getTime(); + var day2 = new Date(date[1]).getTime(); + return (day2 - day1) / (1000 * 60 * 60 * 24) + 1; +} +exports.calcDateNum = calcDateNum; +function copyDates(dates) { + if (Array.isArray(dates)) { + return dates.map(function (date) { + if (date === null) { + return date; + } + return new Date(date); + }); + } + return new Date(dates); +} +exports.copyDates = copyDates; +function getMonthEndDay(year, month) { + return 32 - new Date(year, month - 1, 32).getDate(); +} +exports.getMonthEndDay = getMonthEndDay; +function getMonths(minDate, maxDate) { + var months = []; + var cursor = new Date(minDate); + cursor.setDate(1); + do { + months.push(cursor.getTime()); + cursor.setMonth(cursor.getMonth() + 1); + } while (compareMonth(cursor, maxDate) !== 1); + return months; +} +exports.getMonths = getMonths; diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/calendar/utils.wxs b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/utils.wxs new file mode 100644 index 0000000000000000000000000000000000000000..e57f6b32befa9e3bc9f925189eb29c9b49e0a9af --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/calendar/utils.wxs @@ -0,0 +1,25 @@ +/* eslint-disable */ +function getMonthEndDay(year, month) { + return 32 - getDate(year, month - 1, 32).getDate(); +} + +function compareMonth(date1, date2) { + date1 = getDate(date1); + date2 = getDate(date2); + + var year1 = date1.getFullYear(); + var year2 = date2.getFullYear(); + var month1 = date1.getMonth(); + var month2 = date2.getMonth(); + + if (year1 === year2) { + return month1 === month2 ? 0 : month1 > month2 ? 1 : -1; + } + + return year1 > year2 ? 1 : -1; +} + +module.exports = { + getMonthEndDay: getMonthEndDay, + compareMonth: compareMonth +}; diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/card/index.js b/src/mindspore/miniprogram_npm/@vant/weapp/card/index.js new file mode 100644 index 0000000000000000000000000000000000000000..cb0f98273ba3f6ea8d06c863ecdd49ab4cdfa69a --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/card/index.js @@ -0,0 +1,51 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var link_1 = require('../mixins/link'); +var component_1 = require('../common/component'); +component_1.VantComponent({ + classes: [ + 'num-class', + 'desc-class', + 'thumb-class', + 'title-class', + 'price-class', + 'origin-price-class', + ], + mixins: [link_1.link], + props: { + tag: String, + num: String, + desc: String, + thumb: String, + title: String, + price: { + type: String, + observer: 'updatePrice', + }, + centered: Boolean, + lazyLoad: Boolean, + thumbLink: String, + originPrice: String, + thumbMode: { + type: String, + value: 'aspectFit', + }, + currency: { + type: String, + value: '¥', + }, + }, + methods: { + updatePrice: function () { + var price = this.data.price; + var priceArr = price.toString().split('.'); + this.setData({ + integerStr: priceArr[0], + decimalStr: priceArr[1] ? '.' + priceArr[1] : '', + }); + }, + onClickThumb: function () { + this.jumpLink('thumbLink'); + }, + }, +}); diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/card/index.json b/src/mindspore/miniprogram_npm/@vant/weapp/card/index.json new file mode 100644 index 0000000000000000000000000000000000000000..e917407692d20b91dbe066e7e198db5e93ae474a --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/card/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-tag": "../tag/index" + } +} diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/card/index.wxml b/src/mindspore/miniprogram_npm/@vant/weapp/card/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..62173e4a0de699496f5a9745bfdd8161d0a5f02e --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/card/index.wxml @@ -0,0 +1,56 @@ + + + + + + + + + {{ tag }} + + + + + + + {{ title }} + + + {{ desc }} + + + + + + + + + {{ currency }} + {{ integerStr }} + {{ decimalStr }} + + + {{ currency }} {{ originPrice }} + + x {{ num }} + + + + + + + + + + diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/card/index.wxss b/src/mindspore/miniprogram_npm/@vant/weapp/card/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..a21a5995810a30a1ba04a92fcd830d1b79b32ee6 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/card/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-card{position:relative;box-sizing:border-box;padding:8px 16px;padding:var(--card-padding,8px 16px);font-size:12px;font-size:var(--card-font-size,12px);color:#323233;color:var(--card-text-color,#323233);background-color:#fafafa;background-color:var(--card-background-color,#fafafa)}.van-card__header{display:-webkit-flex;display:flex}.van-card__header--center{-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-card__thumb{position:relative;-webkit-flex:none;flex:none;width:88px;width:var(--card-thumb-size,88px);height:88px;height:var(--card-thumb-size,88px);margin-right:8px;margin-right:var(--padding-xs,8px)}.van-card__thumb:empty{display:none}.van-card__img{width:100%;height:100%;border-radius:8px;border-radius:var(--border-radius-lg,8px)}.van-card__content{position:relative;display:-webkit-flex;display:flex;-webkit-flex:1;flex:1;-webkit-flex-direction:column;flex-direction:column;-webkit-justify-content:space-between;justify-content:space-between;min-width:0;min-height:88px;min-height:var(--card-thumb-size,88px)}.van-card__content--center{-webkit-justify-content:center;justify-content:center}.van-card__desc,.van-card__title{word-wrap:break-word}.van-card__title{font-weight:700;line-height:16px;line-height:var(--card-title-line-height,16px)}.van-card__desc{line-height:20px;line-height:var(--card-desc-line-height,20px);color:#646566;color:var(--card-desc-color,#646566)}.van-card__bottom{line-height:20px}.van-card__price{display:inline-block;font-weight:700;color:#ee0a24;color:var(--card-price-color,#ee0a24);font-size:12px;font-size:var(--card-price-font-size,12px)}.van-card__price-integer{font-size:16px;font-size:var(--card-price-integer-font-size,16px)}.van-card__price-decimal,.van-card__price-integer{font-family:Avenir-Heavy,PingFang SC,Helvetica Neue,Arial,sans-serif;font-family:var(--card-price-font-family,Avenir-Heavy,PingFang SC,Helvetica Neue,Arial,sans-serif)}.van-card__origin-price{display:inline-block;margin-left:5px;text-decoration:line-through;font-size:10px;font-size:var(--card-origin-price-font-size,10px);color:#646566;color:var(--card-origin-price-color,#646566)}.van-card__num{float:right}.van-card__tag{position:absolute!important;top:2px;left:0}.van-card__footer{-webkit-flex:none;flex:none;width:100%;text-align:right} \ No newline at end of file diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/cell-group/index.js b/src/mindspore/miniprogram_npm/@vant/weapp/cell-group/index.js new file mode 100644 index 0000000000000000000000000000000000000000..7d9348708d7c2e7534cebcb7f1e51ce2060fc730 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/cell-group/index.js @@ -0,0 +1,12 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../common/component'); +component_1.VantComponent({ + props: { + title: String, + border: { + type: Boolean, + value: true, + }, + }, +}); diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/cell-group/index.json b/src/mindspore/miniprogram_npm/@vant/weapp/cell-group/index.json new file mode 100644 index 0000000000000000000000000000000000000000..467ce2945f917ae0035594117b51f5304cdcdfa6 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/cell-group/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/cell-group/index.wxml b/src/mindspore/miniprogram_npm/@vant/weapp/cell-group/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..6e0b471df92a41a2110e7481263f539a5d69430d --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/cell-group/index.wxml @@ -0,0 +1,9 @@ + + {{ title }} + + + + diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/cell-group/index.wxss b/src/mindspore/miniprogram_npm/@vant/weapp/cell-group/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..edbccd5958c63dccfd0b9c3a53630e63d1ef483c --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/cell-group/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-cell-group__title{padding:16px 16px 8px;padding:var(--cell-group-title-padding,16px 16px 8px);font-size:14px;font-size:var(--cell-group-title-font-size,14px);line-height:16px;line-height:var(--cell-group-title-line-height,16px);color:#969799;color:var(--cell-group-title-color,#969799)} \ No newline at end of file diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/cell/index.js b/src/mindspore/miniprogram_npm/@vant/weapp/cell/index.js new file mode 100644 index 0000000000000000000000000000000000000000..7a18c9f2979329e3d0cf3734a05b424ab28b5ccc --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/cell/index.js @@ -0,0 +1,40 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var link_1 = require('../mixins/link'); +var component_1 = require('../common/component'); +component_1.VantComponent({ + classes: [ + 'title-class', + 'label-class', + 'value-class', + 'right-icon-class', + 'hover-class', + ], + mixins: [link_1.link], + props: { + title: null, + value: null, + icon: String, + size: String, + label: String, + center: Boolean, + isLink: Boolean, + required: Boolean, + clickable: Boolean, + titleWidth: String, + customStyle: String, + arrowDirection: String, + useLabelSlot: Boolean, + border: { + type: Boolean, + value: true, + }, + titleStyle: String, + }, + methods: { + onClick: function (event) { + this.$emit('click', event.detail); + this.jumpLink(); + }, + }, +}); diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/cell/index.json b/src/mindspore/miniprogram_npm/@vant/weapp/cell/index.json new file mode 100644 index 0000000000000000000000000000000000000000..0a336c083ec7c8f87af66097dd241c13b3f6dc2e --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/cell/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-icon": "../icon/index" + } +} diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/cell/index.wxml b/src/mindspore/miniprogram_npm/@vant/weapp/cell/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..7d7d746d9438008349a339a86784f4c338c258b8 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/cell/index.wxml @@ -0,0 +1,46 @@ + + + + + + + + + {{ title }} + + + + + {{ label }} + + + + + {{ value }} + + + + + + + + diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/cell/index.wxs b/src/mindspore/miniprogram_npm/@vant/weapp/cell/index.wxs new file mode 100644 index 0000000000000000000000000000000000000000..e3500c4343687b5618af3dec95496cef26f53ed4 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/cell/index.wxs @@ -0,0 +1,17 @@ +/* eslint-disable */ +var style = require('../wxs/style.wxs'); +var addUnit = require('../wxs/add-unit.wxs'); + +function titleStyle(data) { + return style([ + { + 'max-width': addUnit(data.titleWidth), + 'min-width': addUnit(data.titleWidth), + }, + data.titleStyle, + ]); +} + +module.exports = { + titleStyle: titleStyle, +}; diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/cell/index.wxss b/src/mindspore/miniprogram_npm/@vant/weapp/cell/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..605570db7dd8b26f23fb33fe3e8ca8a312e2d559 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/cell/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-cell{position:relative;display:-webkit-flex;display:flex;box-sizing:border-box;width:100%;padding:10px 16px;padding:var(--cell-vertical-padding,10px) var(--cell-horizontal-padding,16px);font-size:14px;font-size:var(--cell-font-size,14px);line-height:24px;line-height:var(--cell-line-height,24px);color:#323233;color:var(--cell-text-color,#323233);background-color:#fff;background-color:var(--cell-background-color,#fff)}.van-cell:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;right:16px;bottom:0;left:16px;border-bottom:1px solid #ebedf0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.van-cell--borderless:after{display:none}.van-cell-group{background-color:#fff;background-color:var(--cell-background-color,#fff)}.van-cell__label{margin-top:3px;margin-top:var(--cell-label-margin-top,3px);font-size:12px;font-size:var(--cell-label-font-size,12px);line-height:18px;line-height:var(--cell-label-line-height,18px);color:#969799;color:var(--cell-label-color,#969799)}.van-cell__value{overflow:hidden;text-align:right;vertical-align:middle;color:#969799;color:var(--cell-value-color,#969799)}.van-cell__title,.van-cell__value{-webkit-flex:1;flex:1}.van-cell__title:empty,.van-cell__value:empty{display:none}.van-cell__left-icon-wrap,.van-cell__right-icon-wrap{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;height:24px;height:var(--cell-line-height,24px);font-size:16px;font-size:var(--cell-icon-size,16px)}.van-cell__left-icon-wrap{margin-right:4px;margin-right:var(--padding-base,4px)}.van-cell__right-icon-wrap{margin-left:4px;margin-left:var(--padding-base,4px);color:#969799;color:var(--cell-right-icon-color,#969799)}.van-cell__left-icon{vertical-align:middle}.van-cell__left-icon,.van-cell__right-icon{line-height:24px;line-height:var(--cell-line-height,24px)}.van-cell--clickable.van-cell--hover{background-color:#f2f3f5;background-color:var(--cell-active-color,#f2f3f5)}.van-cell--required{overflow:visible}.van-cell--required:before{position:absolute;content:"*";left:8px;left:var(--padding-xs,8px);font-size:14px;font-size:var(--cell-font-size,14px);color:#ee0a24;color:var(--cell-required-color,#ee0a24)}.van-cell--center{-webkit-align-items:center;align-items:center}.van-cell--large{padding-top:12px;padding-top:var(--cell-large-vertical-padding,12px);padding-bottom:12px;padding-bottom:var(--cell-large-vertical-padding,12px)}.van-cell--large .van-cell__title{font-size:16px;font-size:var(--cell-large-title-font-size,16px)}.van-cell--large .van-cell__value{font-size:16px;font-size:var(--cell-large-value-font-size,16px)}.van-cell--large .van-cell__label{font-size:14px;font-size:var(--cell-large-label-font-size,14px)} \ No newline at end of file diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/checkbox-group/index.js b/src/mindspore/miniprogram_npm/@vant/weapp/checkbox-group/index.js new file mode 100644 index 0000000000000000000000000000000000000000..1c8016a6345cb2289c3ae80f6e9937ee0269a406 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/checkbox-group/index.js @@ -0,0 +1,38 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var relation_1 = require('../common/relation'); +var component_1 = require('../common/component'); +component_1.VantComponent({ + field: true, + relation: relation_1.useChildren('checkbox', function (target) { + this.updateChild(target); + }), + props: { + max: Number, + value: { + type: Array, + observer: 'updateChildren', + }, + disabled: { + type: Boolean, + observer: 'updateChildren', + }, + }, + methods: { + updateChildren: function () { + var _this = this; + this.children.forEach(function (child) { + return _this.updateChild(child); + }); + }, + updateChild: function (child) { + var _a = this.data, + value = _a.value, + disabled = _a.disabled; + child.setData({ + value: value.indexOf(child.data.name) !== -1, + parentDisabled: disabled, + }); + }, + }, +}); diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/checkbox-group/index.json b/src/mindspore/miniprogram_npm/@vant/weapp/checkbox-group/index.json new file mode 100644 index 0000000000000000000000000000000000000000..467ce2945f917ae0035594117b51f5304cdcdfa6 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/checkbox-group/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/checkbox-group/index.wxml b/src/mindspore/miniprogram_npm/@vant/weapp/checkbox-group/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..4fa864ce7aa9d8b620269649779b40fda753c36f --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/checkbox-group/index.wxml @@ -0,0 +1 @@ + diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/checkbox-group/index.wxss b/src/mindspore/miniprogram_npm/@vant/weapp/checkbox-group/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..99694d603361421fe8f1acfc76a09eae443cb3aa --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/checkbox-group/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss'; \ No newline at end of file diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/checkbox/index.js b/src/mindspore/miniprogram_npm/@vant/weapp/checkbox/index.js new file mode 100644 index 0000000000000000000000000000000000000000..7b9598bbd04ed65c39de6d2ea8b0b47beb149f74 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/checkbox/index.js @@ -0,0 +1,83 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var relation_1 = require('../common/relation'); +var component_1 = require('../common/component'); +function emit(target, value) { + target.$emit('input', value); + target.$emit('change', value); +} +component_1.VantComponent({ + field: true, + relation: relation_1.useParent('checkbox-group'), + classes: ['icon-class', 'label-class'], + props: { + value: Boolean, + disabled: Boolean, + useIconSlot: Boolean, + checkedColor: String, + labelPosition: { + type: String, + value: 'right', + }, + labelDisabled: Boolean, + shape: { + type: String, + value: 'round', + }, + iconSize: { + type: null, + value: 20, + }, + }, + data: { + parentDisabled: false, + }, + methods: { + emitChange: function (value) { + if (this.parent) { + this.setParentValue(this.parent, value); + } else { + emit(this, value); + } + }, + toggle: function () { + var _a = this.data, + parentDisabled = _a.parentDisabled, + disabled = _a.disabled, + value = _a.value; + if (!disabled && !parentDisabled) { + this.emitChange(!value); + } + }, + onClickLabel: function () { + var _a = this.data, + labelDisabled = _a.labelDisabled, + parentDisabled = _a.parentDisabled, + disabled = _a.disabled, + value = _a.value; + if (!disabled && !labelDisabled && !parentDisabled) { + this.emitChange(!value); + } + }, + setParentValue: function (parent, value) { + var parentValue = parent.data.value.slice(); + var name = this.data.name; + var max = parent.data.max; + if (value) { + if (max && parentValue.length >= max) { + return; + } + if (parentValue.indexOf(name) === -1) { + parentValue.push(name); + emit(parent, parentValue); + } + } else { + var index = parentValue.indexOf(name); + if (index !== -1) { + parentValue.splice(index, 1); + emit(parent, parentValue); + } + } + }, + }, +}); diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/checkbox/index.json b/src/mindspore/miniprogram_npm/@vant/weapp/checkbox/index.json new file mode 100644 index 0000000000000000000000000000000000000000..0a336c083ec7c8f87af66097dd241c13b3f6dc2e --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/checkbox/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-icon": "../icon/index" + } +} diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/checkbox/index.wxml b/src/mindspore/miniprogram_npm/@vant/weapp/checkbox/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..0c008d812285c5e9e5d122e371387042e02991c7 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/checkbox/index.wxml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/checkbox/index.wxs b/src/mindspore/miniprogram_npm/@vant/weapp/checkbox/index.wxs new file mode 100644 index 0000000000000000000000000000000000000000..eb9c7726312ae65433806cd8c9b3c3f44f205377 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/checkbox/index.wxs @@ -0,0 +1,20 @@ +/* eslint-disable */ +var style = require('../wxs/style.wxs'); +var addUnit = require('../wxs/add-unit.wxs'); + +function iconStyle(checkedColor, value, disabled, parentDisabled, iconSize) { + var styles = { + 'font-size': addUnit(iconSize), + }; + + if (checkedColor && value && !disabled && !parentDisabled) { + styles['border-color'] = checkedColor; + styles['background-color'] = checkedColor; + } + + return style(styles); +} + +module.exports = { + iconStyle: iconStyle, +}; diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/checkbox/index.wxss b/src/mindspore/miniprogram_npm/@vant/weapp/checkbox/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..afaf37bec1fdd0db46f6e8521e46a44f07e8cb1f --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/checkbox/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-checkbox{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;overflow:hidden;-webkit-user-select:none;user-select:none}.van-checkbox__icon-wrap,.van-checkbox__label{line-height:20px;line-height:var(--checkbox-size,20px)}.van-checkbox__icon-wrap{-webkit-flex:none;flex:none}.van-checkbox__icon{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;width:1em;height:1em;color:transparent;text-align:center;transition-property:color,border-color,background-color;font-size:20px;font-size:var(--checkbox-size,20px);border:1px solid #c8c9cc;border:1px solid var(--checkbox-border-color,#c8c9cc);transition-duration:.2s;transition-duration:var(--checkbox-transition-duration,.2s)}.van-checkbox__icon--round{border-radius:100%}.van-checkbox__icon--checked{color:#fff;color:var(--white,#fff);background-color:#1989fa;background-color:var(--checkbox-checked-icon-color,#1989fa);border-color:#1989fa;border-color:var(--checkbox-checked-icon-color,#1989fa)}.van-checkbox__icon--disabled{background-color:#ebedf0;background-color:var(--checkbox-disabled-background-color,#ebedf0);border-color:#c8c9cc;border-color:var(--checkbox-disabled-icon-color,#c8c9cc)}.van-checkbox__icon--disabled.van-checkbox__icon--checked{color:#c8c9cc;color:var(--checkbox-disabled-icon-color,#c8c9cc)}.van-checkbox__label{word-wrap:break-word;margin-left:10px;margin-left:var(--checkbox-label-margin,10px);color:#323233;color:var(--checkbox-label-color,#323233)}.van-checkbox__label--left{float:left;margin:0 10px 0 0;margin:0 var(--checkbox-label-margin,10px) 0 0}.van-checkbox__label--disabled{color:#c8c9cc;color:var(--checkbox-disabled-label-color,#c8c9cc)}.van-checkbox__label:empty{margin:0} \ No newline at end of file diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/circle/canvas.js b/src/mindspore/miniprogram_npm/@vant/weapp/circle/canvas.js new file mode 100644 index 0000000000000000000000000000000000000000..dbee1d732219170fad7c0ad0d3aed7134dd450b8 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/circle/canvas.js @@ -0,0 +1,47 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +exports.adaptor = void 0; +function adaptor(ctx) { + // @ts-ignore + return Object.assign(ctx, { + setStrokeStyle: function (val) { + ctx.strokeStyle = val; + }, + setLineWidth: function (val) { + ctx.lineWidth = val; + }, + setLineCap: function (val) { + ctx.lineCap = val; + }, + setFillStyle: function (val) { + ctx.fillStyle = val; + }, + setFontSize: function (val) { + ctx.font = String(val); + }, + setGlobalAlpha: function (val) { + ctx.globalAlpha = val; + }, + setLineJoin: function (val) { + ctx.lineJoin = val; + }, + setTextAlign: function (val) { + ctx.textAlign = val; + }, + setMiterLimit: function (val) { + ctx.miterLimit = val; + }, + setShadow: function (offsetX, offsetY, blur, color) { + ctx.shadowOffsetX = offsetX; + ctx.shadowOffsetY = offsetY; + ctx.shadowBlur = blur; + ctx.shadowColor = color; + }, + setTextBaseline: function (val) { + ctx.textBaseline = val; + }, + createCircularGradient: function () {}, + draw: function () {}, + }); +} +exports.adaptor = adaptor; diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/circle/index.js b/src/mindspore/miniprogram_npm/@vant/weapp/circle/index.js new file mode 100644 index 0000000000000000000000000000000000000000..13b90b32943b9c582c9bf72411397a9ab6337cb9 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/circle/index.js @@ -0,0 +1,211 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var color_1 = require('../common/color'); +var component_1 = require('../common/component'); +var utils_1 = require('../common/utils'); +var validator_1 = require('../common/validator'); +var version_1 = require('../common/version'); +var canvas_1 = require('./canvas'); +function format(rate) { + return Math.min(Math.max(rate, 0), 100); +} +var PERIMETER = 2 * Math.PI; +var BEGIN_ANGLE = -Math.PI / 2; +var STEP = 1; +component_1.VantComponent({ + props: { + text: String, + lineCap: { + type: String, + value: 'round', + }, + value: { + type: Number, + value: 0, + observer: 'reRender', + }, + speed: { + type: Number, + value: 50, + }, + size: { + type: Number, + value: 100, + observer: function () { + this.drawCircle(this.currentValue); + }, + }, + fill: String, + layerColor: { + type: String, + value: color_1.WHITE, + }, + color: { + type: null, + value: color_1.BLUE, + observer: function () { + var _this = this; + this.setHoverColor().then(function () { + _this.drawCircle(_this.currentValue); + }); + }, + }, + type: { + type: String, + value: '', + }, + strokeWidth: { + type: Number, + value: 4, + }, + clockwise: { + type: Boolean, + value: true, + }, + }, + data: { + hoverColor: color_1.BLUE, + }, + methods: { + getContext: function () { + var _this = this; + var _a = this.data, + type = _a.type, + size = _a.size; + if (type === '' || !version_1.canIUseCanvas2d()) { + var ctx = wx.createCanvasContext('van-circle', this); + return Promise.resolve(ctx); + } + var dpr = utils_1.getSystemInfoSync().pixelRatio; + return new Promise(function (resolve) { + wx.createSelectorQuery() + .in(_this) + .select('#van-circle') + .node() + .exec(function (res) { + var canvas = res[0].node; + var ctx = canvas.getContext(type); + if (!_this.inited) { + _this.inited = true; + canvas.width = size * dpr; + canvas.height = size * dpr; + ctx.scale(dpr, dpr); + } + resolve(canvas_1.adaptor(ctx)); + }); + }); + }, + setHoverColor: function () { + var _this = this; + var _a = this.data, + color = _a.color, + size = _a.size; + if (validator_1.isObj(color)) { + return this.getContext().then(function (context) { + var LinearColor = context.createLinearGradient(size, 0, 0, 0); + Object.keys(color) + .sort(function (a, b) { + return parseFloat(a) - parseFloat(b); + }) + .map(function (key) { + return LinearColor.addColorStop( + parseFloat(key) / 100, + color[key] + ); + }); + _this.hoverColor = LinearColor; + }); + } + this.hoverColor = color; + return Promise.resolve(); + }, + presetCanvas: function (context, strokeStyle, beginAngle, endAngle, fill) { + var _a = this.data, + strokeWidth = _a.strokeWidth, + lineCap = _a.lineCap, + clockwise = _a.clockwise, + size = _a.size; + var position = size / 2; + var radius = position - strokeWidth / 2; + context.setStrokeStyle(strokeStyle); + context.setLineWidth(strokeWidth); + context.setLineCap(lineCap); + context.beginPath(); + context.arc(position, position, radius, beginAngle, endAngle, !clockwise); + context.stroke(); + if (fill) { + context.setFillStyle(fill); + context.fill(); + } + }, + renderLayerCircle: function (context) { + var _a = this.data, + layerColor = _a.layerColor, + fill = _a.fill; + this.presetCanvas(context, layerColor, 0, PERIMETER, fill); + }, + renderHoverCircle: function (context, formatValue) { + var clockwise = this.data.clockwise; + // 结束角度 + var progress = PERIMETER * (formatValue / 100); + var endAngle = clockwise + ? BEGIN_ANGLE + progress + : 3 * Math.PI - (BEGIN_ANGLE + progress); + this.presetCanvas(context, this.hoverColor, BEGIN_ANGLE, endAngle); + }, + drawCircle: function (currentValue) { + var _this = this; + var size = this.data.size; + this.getContext().then(function (context) { + context.clearRect(0, 0, size, size); + _this.renderLayerCircle(context); + var formatValue = format(currentValue); + if (formatValue !== 0) { + _this.renderHoverCircle(context, formatValue); + } + context.draw(); + }); + }, + reRender: function () { + var _this = this; + // tofector 动画暂时没有想到好的解决方案 + var _a = this.data, + value = _a.value, + speed = _a.speed; + if (speed <= 0 || speed > 1000) { + this.drawCircle(value); + return; + } + this.clearInterval(); + this.currentValue = this.currentValue || 0; + this.interval = setInterval(function () { + if (_this.currentValue !== value) { + if (_this.currentValue < value) { + _this.currentValue += STEP; + } else { + _this.currentValue -= STEP; + } + _this.drawCircle(_this.currentValue); + } else { + _this.clearInterval(); + } + }, 1000 / speed); + }, + clearInterval: function () { + if (this.interval) { + clearInterval(this.interval); + this.interval = null; + } + }, + }, + mounted: function () { + var _this = this; + this.currentValue = this.data.value; + this.setHoverColor().then(function () { + _this.drawCircle(_this.currentValue); + }); + }, + destroyed: function () { + this.clearInterval(); + }, +}); diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/circle/index.json b/src/mindspore/miniprogram_npm/@vant/weapp/circle/index.json new file mode 100644 index 0000000000000000000000000000000000000000..467ce2945f917ae0035594117b51f5304cdcdfa6 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/circle/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/circle/index.wxml b/src/mindspore/miniprogram_npm/@vant/weapp/circle/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..52bc59fca8e6057621f0d3eb8807e1442fde3bb1 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/circle/index.wxml @@ -0,0 +1,9 @@ + + + + + + + + {{ text }} + diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/circle/index.wxss b/src/mindspore/miniprogram_npm/@vant/weapp/circle/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..3ab63dfd1e7220e500bd44170a7368236f93949d --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/circle/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-circle{position:relative;display:inline-block;text-align:center}.van-circle__text{position:absolute;top:50%;left:0;width:100%;-webkit-transform:translateY(-50%);transform:translateY(-50%);color:#323233;color:var(--circle-text-color,#323233)} \ No newline at end of file diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/col/index.js b/src/mindspore/miniprogram_npm/@vant/weapp/col/index.js new file mode 100644 index 0000000000000000000000000000000000000000..a33c44b9b095acbc1a5c2ebf16acbc04a525d696 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/col/index.js @@ -0,0 +1,11 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var relation_1 = require('../common/relation'); +var component_1 = require('../common/component'); +component_1.VantComponent({ + relation: relation_1.useParent('row'), + props: { + span: Number, + offset: Number, + }, +}); diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/col/index.json b/src/mindspore/miniprogram_npm/@vant/weapp/col/index.json new file mode 100644 index 0000000000000000000000000000000000000000..467ce2945f917ae0035594117b51f5304cdcdfa6 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/col/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/col/index.wxml b/src/mindspore/miniprogram_npm/@vant/weapp/col/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..975348b6e1a37c2e2d914a85be8a1d644cb8b49c --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/col/index.wxml @@ -0,0 +1,9 @@ + + + + + + diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/col/index.wxs b/src/mindspore/miniprogram_npm/@vant/weapp/col/index.wxs new file mode 100644 index 0000000000000000000000000000000000000000..507c1cb9b8e27624f7eb018741aea72ca2df1c16 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/col/index.wxs @@ -0,0 +1,18 @@ +/* eslint-disable */ +var style = require('../wxs/style.wxs'); +var addUnit = require('../wxs/add-unit.wxs'); + +function rootStyle(data) { + if (!data.gutter) { + return ''; + } + + return style({ + 'padding-right': addUnit(data.gutter / 2), + 'padding-left': addUnit(data.gutter / 2), + }); +} + +module.exports = { + rootStyle: rootStyle, +}; diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/col/index.wxss b/src/mindspore/miniprogram_npm/@vant/weapp/col/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..44c896a3ea71de650188e5d7c02ac697db680110 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/col/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-col{float:left;box-sizing:border-box}.van-col--1{width:4.16666667%}.van-col--offset-1{margin-left:4.16666667%}.van-col--2{width:8.33333333%}.van-col--offset-2{margin-left:8.33333333%}.van-col--3{width:12.5%}.van-col--offset-3{margin-left:12.5%}.van-col--4{width:16.66666667%}.van-col--offset-4{margin-left:16.66666667%}.van-col--5{width:20.83333333%}.van-col--offset-5{margin-left:20.83333333%}.van-col--6{width:25%}.van-col--offset-6{margin-left:25%}.van-col--7{width:29.16666667%}.van-col--offset-7{margin-left:29.16666667%}.van-col--8{width:33.33333333%}.van-col--offset-8{margin-left:33.33333333%}.van-col--9{width:37.5%}.van-col--offset-9{margin-left:37.5%}.van-col--10{width:41.66666667%}.van-col--offset-10{margin-left:41.66666667%}.van-col--11{width:45.83333333%}.van-col--offset-11{margin-left:45.83333333%}.van-col--12{width:50%}.van-col--offset-12{margin-left:50%}.van-col--13{width:54.16666667%}.van-col--offset-13{margin-left:54.16666667%}.van-col--14{width:58.33333333%}.van-col--offset-14{margin-left:58.33333333%}.van-col--15{width:62.5%}.van-col--offset-15{margin-left:62.5%}.van-col--16{width:66.66666667%}.van-col--offset-16{margin-left:66.66666667%}.van-col--17{width:70.83333333%}.van-col--offset-17{margin-left:70.83333333%}.van-col--18{width:75%}.van-col--offset-18{margin-left:75%}.van-col--19{width:79.16666667%}.van-col--offset-19{margin-left:79.16666667%}.van-col--20{width:83.33333333%}.van-col--offset-20{margin-left:83.33333333%}.van-col--21{width:87.5%}.van-col--offset-21{margin-left:87.5%}.van-col--22{width:91.66666667%}.van-col--offset-22{margin-left:91.66666667%}.van-col--23{width:95.83333333%}.van-col--offset-23{margin-left:95.83333333%}.van-col--24{width:100%}.van-col--offset-24{margin-left:100%} \ No newline at end of file diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/collapse-item/animate.js b/src/mindspore/miniprogram_npm/@vant/weapp/collapse-item/animate.js new file mode 100644 index 0000000000000000000000000000000000000000..43173837a4a02a2e681a7f368f244cd64ef22541 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/collapse-item/animate.js @@ -0,0 +1,77 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +exports.setContentAnimate = void 0; +var version_1 = require('../common/version'); +var utils_1 = require('../common/utils'); +function useAnimate(context, expanded, mounted, height) { + var selector = '.van-collapse-item__wrapper'; + if (expanded) { + context.animate( + selector, + [ + { height: 0, ease: 'ease-in-out', offset: 0 }, + { height: height + 'px', ease: 'ease-in-out', offset: 1 }, + { height: 'auto', ease: 'ease-in-out', offset: 1 }, + ], + mounted ? 300 : 0, + function () { + context.clearAnimation(selector); + } + ); + return; + } + context.animate( + selector, + [ + { height: height + 'px', ease: 'ease-in-out', offset: 0 }, + { height: 0, ease: 'ease-in-out', offset: 1 }, + ], + 300, + function () { + context.clearAnimation(selector); + } + ); +} +function useAnimation(context, expanded, mounted, height) { + var animation = wx.createAnimation({ + duration: 0, + timingFunction: 'ease-in-out', + }); + if (expanded) { + if (height === 0) { + animation.height('auto').top(1).step(); + } else { + animation + .height(height) + .top(1) + .step({ + duration: mounted ? 300 : 1, + }) + .height('auto') + .step(); + } + context.setData({ + animation: animation.export(), + }); + return; + } + animation.height(height).top(0).step({ duration: 1 }).height(0).step({ + duration: 300, + }); + context.setData({ + animation: animation.export(), + }); +} +function setContentAnimate(context, expanded, mounted) { + utils_1 + .getRect(context, '.van-collapse-item__content') + .then(function (rect) { + return rect.height; + }) + .then(function (height) { + version_1.canIUseAnimate() + ? useAnimate(context, expanded, mounted, height) + : useAnimation(context, expanded, mounted, height); + }); +} +exports.setContentAnimate = setContentAnimate; diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/collapse-item/index.js b/src/mindspore/miniprogram_npm/@vant/weapp/collapse-item/index.js new file mode 100644 index 0000000000000000000000000000000000000000..b30315cf92c3b4a8a608daac926c74ee10b08295 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/collapse-item/index.js @@ -0,0 +1,68 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../common/component'); +var relation_1 = require('../common/relation'); +var animate_1 = require('./animate'); +component_1.VantComponent({ + classes: ['title-class', 'content-class'], + relation: relation_1.useParent('collapse'), + props: { + name: null, + title: null, + value: null, + icon: String, + label: String, + disabled: Boolean, + clickable: Boolean, + border: { + type: Boolean, + value: true, + }, + isLink: { + type: Boolean, + value: true, + }, + }, + data: { + expanded: false, + }, + mounted: function () { + this.updateExpanded(); + this.mounted = true; + }, + methods: { + updateExpanded: function () { + if (!this.parent) { + return; + } + var _a = this.parent.data, + value = _a.value, + accordion = _a.accordion; + var _b = this.parent.children, + children = _b === void 0 ? [] : _b; + var name = this.data.name; + var index = children.indexOf(this); + var currentName = name == null ? index : name; + var expanded = accordion + ? value === currentName + : (value || []).some(function (name) { + return name === currentName; + }); + if (expanded !== this.data.expanded) { + animate_1.setContentAnimate(this, expanded, this.mounted); + } + this.setData({ index: index, expanded: expanded }); + }, + onClick: function () { + if (this.data.disabled) { + return; + } + var _a = this.data, + name = _a.name, + expanded = _a.expanded; + var index = this.parent.children.indexOf(this); + var currentName = name == null ? index : name; + this.parent.switch(currentName, !expanded); + }, + }, +}); diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/collapse-item/index.json b/src/mindspore/miniprogram_npm/@vant/weapp/collapse-item/index.json new file mode 100644 index 0000000000000000000000000000000000000000..0e5425cdfdb74071904957ca8bcfddb70782b1b4 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/collapse-item/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-cell": "../cell/index" + } +} diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/collapse-item/index.wxml b/src/mindspore/miniprogram_npm/@vant/weapp/collapse-item/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..ae4cc831712ce6026707e48c9646d572c3ac8c0b --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/collapse-item/index.wxml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/collapse-item/index.wxss b/src/mindspore/miniprogram_npm/@vant/weapp/collapse-item/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..0bb936c00343dc591c86395261d00f2e08c00cb3 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/collapse-item/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-collapse-item__title .van-cell__right-icon{-webkit-transform:rotate(90deg);transform:rotate(90deg);transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;transition:-webkit-transform var(--collapse-item-transition-duration,.3s);transition:transform var(--collapse-item-transition-duration,.3s);transition:transform var(--collapse-item-transition-duration,.3s),-webkit-transform var(--collapse-item-transition-duration,.3s)}.van-collapse-item__title--expanded .van-cell__right-icon{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.van-collapse-item__title--disabled .van-cell,.van-collapse-item__title--disabled .van-cell__right-icon{color:#c8c9cc!important;color:var(--collapse-item-title-disabled-color,#c8c9cc)!important}.van-collapse-item__title--disabled .van-cell--hover{background-color:#fff!important;background-color:var(--white,#fff)!important}.van-collapse-item__wrapper{overflow:hidden}.van-collapse-item__content{padding:15px;padding:var(--collapse-item-content-padding,15px);color:#969799;color:var(--collapse-item-content-text-color,#969799);font-size:13px;font-size:var(--collapse-item-content-font-size,13px);line-height:1.5;line-height:var(--collapse-item-content-line-height,1.5);background-color:#fff;background-color:var(--collapse-item-content-background-color,#fff)} \ No newline at end of file diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/collapse/index.js b/src/mindspore/miniprogram_npm/@vant/weapp/collapse/index.js new file mode 100644 index 0000000000000000000000000000000000000000..4e2c0973f7cd45fe67061c55433eb2310c5887ab --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/collapse/index.js @@ -0,0 +1,50 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../common/component'); +var relation_1 = require('../common/relation'); +component_1.VantComponent({ + relation: relation_1.useChildren('collapse-item'), + props: { + value: { + type: null, + observer: 'updateExpanded', + }, + accordion: { + type: Boolean, + observer: 'updateExpanded', + }, + border: { + type: Boolean, + value: true, + }, + }, + methods: { + updateExpanded: function () { + this.children.forEach(function (child) { + child.updateExpanded(); + }); + }, + switch: function (name, expanded) { + var _a = this.data, + accordion = _a.accordion, + value = _a.value; + var changeItem = name; + if (!accordion) { + name = expanded + ? (value || []).concat(name) + : (value || []).filter(function (activeName) { + return activeName !== name; + }); + } else { + name = expanded ? name : ''; + } + if (expanded) { + this.$emit('open', changeItem); + } else { + this.$emit('close', changeItem); + } + this.$emit('change', name); + this.$emit('input', name); + }, + }, +}); diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/collapse/index.json b/src/mindspore/miniprogram_npm/@vant/weapp/collapse/index.json new file mode 100644 index 0000000000000000000000000000000000000000..467ce2945f917ae0035594117b51f5304cdcdfa6 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/collapse/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/collapse/index.wxml b/src/mindspore/miniprogram_npm/@vant/weapp/collapse/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..fd4e171944a18874bd214effc5001a89bc38fafe --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/collapse/index.wxml @@ -0,0 +1,3 @@ + + + diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/collapse/index.wxss b/src/mindspore/miniprogram_npm/@vant/weapp/collapse/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..99694d603361421fe8f1acfc76a09eae443cb3aa --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/collapse/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss'; \ No newline at end of file diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/common/color.js b/src/mindspore/miniprogram_npm/@vant/weapp/common/color.js new file mode 100644 index 0000000000000000000000000000000000000000..885acaa7740c37c42afe6a68a8e87d1800e5916e --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/common/color.js @@ -0,0 +1,10 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +exports.GRAY_DARK = exports.GRAY = exports.ORANGE = exports.GREEN = exports.WHITE = exports.BLUE = exports.RED = void 0; +exports.RED = '#ee0a24'; +exports.BLUE = '#1989fa'; +exports.WHITE = '#fff'; +exports.GREEN = '#07c160'; +exports.ORANGE = '#ff976a'; +exports.GRAY = '#323233'; +exports.GRAY_DARK = '#969799'; diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/common/component.js b/src/mindspore/miniprogram_npm/@vant/weapp/common/component.js new file mode 100644 index 0000000000000000000000000000000000000000..2274506e0b12808c9f552838c945f18c6d6e8f9b --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/common/component.js @@ -0,0 +1,48 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +exports.VantComponent = void 0; +var basic_1 = require('../mixins/basic'); +function mapKeys(source, target, map) { + Object.keys(map).forEach(function (key) { + if (source[key]) { + target[map[key]] = source[key]; + } + }); +} +function VantComponent(vantOptions) { + var options = {}; + mapKeys(vantOptions, options, { + data: 'data', + props: 'properties', + mixins: 'behaviors', + methods: 'methods', + beforeCreate: 'created', + created: 'attached', + mounted: 'ready', + destroyed: 'detached', + classes: 'externalClasses', + }); + // add default externalClasses + options.externalClasses = options.externalClasses || []; + options.externalClasses.push('custom-class'); + // add default behaviors + options.behaviors = options.behaviors || []; + options.behaviors.push(basic_1.basic); + // add relations + var relation = vantOptions.relation; + if (relation) { + options.relations = relation.relations; + options.behaviors.push(relation.mixin); + } + // map field to form-field behavior + if (vantOptions.field) { + options.behaviors.push('wx://form-field'); + } + // add default options + options.options = { + multipleSlots: true, + addGlobalClass: true, + }; + Component(options); +} +exports.VantComponent = VantComponent; diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/common/index.wxss b/src/mindspore/miniprogram_npm/@vant/weapp/common/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..976825d7bfe20937b22d9ba32315561e6cadf953 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/common/index.wxss @@ -0,0 +1 @@ +.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{-webkit-line-clamp:3}.van-clearfix:after{display:table;clear:both;content:""}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #ebedf0;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px} \ No newline at end of file diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/common/relation.js b/src/mindspore/miniprogram_npm/@vant/weapp/common/relation.js new file mode 100644 index 0000000000000000000000000000000000000000..fcf9824cc6caab36269966e6fbc69eb36acf6ceb --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/common/relation.js @@ -0,0 +1,79 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +exports.useChildren = exports.useParent = void 0; +function useParent(name, onEffect) { + var _a; + var path = '../' + name + '/index'; + return { + relations: + ((_a = {}), + (_a[path] = { + type: 'ancestor', + linked: function () { + onEffect && onEffect.call(this); + }, + linkChanged: function () { + onEffect && onEffect.call(this); + }, + unlinked: function () { + onEffect && onEffect.call(this); + }, + }), + _a), + mixin: Behavior({ + created: function () { + var _this = this; + Object.defineProperty(this, 'parent', { + get: function () { + return _this.getRelationNodes(path)[0]; + }, + }); + Object.defineProperty(this, 'index', { + // @ts-ignore + get: function () { + var _a, _b; + return (_b = + (_a = _this.parent) === null || _a === void 0 + ? void 0 + : _a.children) === null || _b === void 0 + ? void 0 + : _b.indexOf(_this); + }, + }); + }, + }), + }; +} +exports.useParent = useParent; +function useChildren(name, onEffect) { + var _a; + var path = '../' + name + '/index'; + return { + relations: + ((_a = {}), + (_a[path] = { + type: 'descendant', + linked: function (target) { + onEffect && onEffect.call(this, target); + }, + linkChanged: function (target) { + onEffect && onEffect.call(this, target); + }, + unlinked: function (target) { + onEffect && onEffect.call(this, target); + }, + }), + _a), + mixin: Behavior({ + created: function () { + var _this = this; + Object.defineProperty(this, 'children', { + get: function () { + return _this.getRelationNodes(path) || []; + }, + }); + }, + }), + }; +} +exports.useChildren = useChildren; diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/common/style/clearfix.wxss b/src/mindspore/miniprogram_npm/@vant/weapp/common/style/clearfix.wxss new file mode 100644 index 0000000000000000000000000000000000000000..a0ca83843c90df59e257b60edac727b42dd94c90 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/common/style/clearfix.wxss @@ -0,0 +1 @@ +.van-clearfix:after{display:table;clear:both;content:""} \ No newline at end of file diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/common/style/ellipsis.wxss b/src/mindspore/miniprogram_npm/@vant/weapp/common/style/ellipsis.wxss new file mode 100644 index 0000000000000000000000000000000000000000..1e9dbc9e0952cef028b287b07744fa8b3343e980 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/common/style/ellipsis.wxss @@ -0,0 +1 @@ +.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{-webkit-line-clamp:3} \ No newline at end of file diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/common/style/hairline.wxss b/src/mindspore/miniprogram_npm/@vant/weapp/common/style/hairline.wxss new file mode 100644 index 0000000000000000000000000000000000000000..49b9e656fcb701be7db42660c9040740158d48f4 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/common/style/hairline.wxss @@ -0,0 +1 @@ +.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #ebedf0;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px} \ No newline at end of file diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/common/style/mixins/clearfix.wxss b/src/mindspore/miniprogram_npm/@vant/weapp/common/style/mixins/clearfix.wxss new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/common/style/mixins/ellipsis.wxss b/src/mindspore/miniprogram_npm/@vant/weapp/common/style/mixins/ellipsis.wxss new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/common/style/mixins/hairline.wxss b/src/mindspore/miniprogram_npm/@vant/weapp/common/style/mixins/hairline.wxss new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/common/style/theme.wxss b/src/mindspore/miniprogram_npm/@vant/weapp/common/style/theme.wxss new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/common/style/var.wxss b/src/mindspore/miniprogram_npm/@vant/weapp/common/style/var.wxss new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/common/utils.js b/src/mindspore/miniprogram_npm/@vant/weapp/common/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..c2cac34c6a93e8c3799124d22c836c3af8906e4c --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/common/utils.js @@ -0,0 +1,113 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +exports.getCurrentPage = exports.toPromise = exports.groupSetData = exports.getAllRect = exports.getRect = exports.pickExclude = exports.requestAnimationFrame = exports.addUnit = exports.getSystemInfoSync = exports.nextTick = exports.range = void 0; +var validator_1 = require('./validator'); +var version_1 = require('./version'); +function range(num, min, max) { + return Math.min(Math.max(num, min), max); +} +exports.range = range; +function nextTick(cb) { + if (version_1.canIUseNextTick()) { + wx.nextTick(cb); + } else { + setTimeout(function () { + cb(); + }, 1000 / 30); + } +} +exports.nextTick = nextTick; +var systemInfo; +function getSystemInfoSync() { + if (systemInfo == null) { + systemInfo = wx.getSystemInfoSync(); + } + return systemInfo; +} +exports.getSystemInfoSync = getSystemInfoSync; +function addUnit(value) { + if (!validator_1.isDef(value)) { + return undefined; + } + value = String(value); + return validator_1.isNumber(value) ? value + 'px' : value; +} +exports.addUnit = addUnit; +function requestAnimationFrame(cb) { + var systemInfo = getSystemInfoSync(); + if (systemInfo.platform === 'devtools') { + return setTimeout(function () { + cb(); + }, 1000 / 30); + } + return wx + .createSelectorQuery() + .selectViewport() + .boundingClientRect() + .exec(function () { + cb(); + }); +} +exports.requestAnimationFrame = requestAnimationFrame; +function pickExclude(obj, keys) { + if (!validator_1.isPlainObject(obj)) { + return {}; + } + return Object.keys(obj).reduce(function (prev, key) { + if (!keys.includes(key)) { + prev[key] = obj[key]; + } + return prev; + }, {}); +} +exports.pickExclude = pickExclude; +function getRect(context, selector) { + return new Promise(function (resolve) { + wx.createSelectorQuery() + .in(context) + .select(selector) + .boundingClientRect() + .exec(function (rect) { + if (rect === void 0) { + rect = []; + } + return resolve(rect[0]); + }); + }); +} +exports.getRect = getRect; +function getAllRect(context, selector) { + return new Promise(function (resolve) { + wx.createSelectorQuery() + .in(context) + .selectAll(selector) + .boundingClientRect() + .exec(function (rect) { + if (rect === void 0) { + rect = []; + } + return resolve(rect[0]); + }); + }); +} +exports.getAllRect = getAllRect; +function groupSetData(context, cb) { + if (version_1.canIUseGroupSetData()) { + context.groupSetData(cb); + } else { + cb(); + } +} +exports.groupSetData = groupSetData; +function toPromise(promiseLike) { + if (validator_1.isPromise(promiseLike)) { + return promiseLike; + } + return Promise.resolve(promiseLike); +} +exports.toPromise = toPromise; +function getCurrentPage() { + var pages = getCurrentPages(); + return pages[pages.length - 1]; +} +exports.getCurrentPage = getCurrentPage; diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/common/validator.js b/src/mindspore/miniprogram_npm/@vant/weapp/common/validator.js new file mode 100644 index 0000000000000000000000000000000000000000..5c54b737f90be9057dc06b6e2245263b35888782 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/common/validator.js @@ -0,0 +1,42 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +exports.isVideoUrl = exports.isImageUrl = exports.isBoolean = exports.isNumber = exports.isObj = exports.isDef = exports.isPromise = exports.isPlainObject = exports.isFunction = void 0; +function isFunction(val) { + return typeof val === 'function'; +} +exports.isFunction = isFunction; +function isPlainObject(val) { + return val !== null && typeof val === 'object' && !Array.isArray(val); +} +exports.isPlainObject = isPlainObject; +function isPromise(val) { + return isPlainObject(val) && isFunction(val.then) && isFunction(val.catch); +} +exports.isPromise = isPromise; +function isDef(value) { + return value !== undefined && value !== null; +} +exports.isDef = isDef; +function isObj(x) { + var type = typeof x; + return x !== null && (type === 'object' || type === 'function'); +} +exports.isObj = isObj; +function isNumber(value) { + return /^\d+(\.\d+)?$/.test(value); +} +exports.isNumber = isNumber; +function isBoolean(value) { + return typeof value === 'boolean'; +} +exports.isBoolean = isBoolean; +var IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i; +var VIDEO_REGEXP = /\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv)/i; +function isImageUrl(url) { + return IMAGE_REGEXP.test(url); +} +exports.isImageUrl = isImageUrl; +function isVideoUrl(url) { + return VIDEO_REGEXP.test(url); +} +exports.isVideoUrl = isVideoUrl; diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/common/version.js b/src/mindspore/miniprogram_npm/@vant/weapp/common/version.js new file mode 100644 index 0000000000000000000000000000000000000000..42f805105d16f7de1daab2c1bc2467c424408c6e --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/common/version.js @@ -0,0 +1,54 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +exports.canIUseCanvas2d = exports.canIUseNextTick = exports.canIUseGroupSetData = exports.canIUseAnimate = exports.canIUseFormFieldButton = exports.canIUseModel = void 0; +var utils_1 = require('./utils'); +function compareVersion(v1, v2) { + v1 = v1.split('.'); + v2 = v2.split('.'); + var len = Math.max(v1.length, v2.length); + while (v1.length < len) { + v1.push('0'); + } + while (v2.length < len) { + v2.push('0'); + } + for (var i = 0; i < len; i++) { + var num1 = parseInt(v1[i], 10); + var num2 = parseInt(v2[i], 10); + if (num1 > num2) { + return 1; + } + if (num1 < num2) { + return -1; + } + } + return 0; +} +function gte(version) { + var system = utils_1.getSystemInfoSync(); + return compareVersion(system.SDKVersion, version) >= 0; +} +function canIUseModel() { + return gte('2.9.3'); +} +exports.canIUseModel = canIUseModel; +function canIUseFormFieldButton() { + return gte('2.10.3'); +} +exports.canIUseFormFieldButton = canIUseFormFieldButton; +function canIUseAnimate() { + return gte('2.9.0'); +} +exports.canIUseAnimate = canIUseAnimate; +function canIUseGroupSetData() { + return gte('2.4.0'); +} +exports.canIUseGroupSetData = canIUseGroupSetData; +function canIUseNextTick() { + return wx.canIUse('nextTick'); +} +exports.canIUseNextTick = canIUseNextTick; +function canIUseCanvas2d() { + return gte('2.9.0'); +} +exports.canIUseCanvas2d = canIUseCanvas2d; diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/count-down/index.js b/src/mindspore/miniprogram_npm/@vant/weapp/count-down/index.js new file mode 100644 index 0000000000000000000000000000000000000000..348d48982f78ceaf17822bb4f6d7736cda8c66b1 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/count-down/index.js @@ -0,0 +1,103 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../common/component'); +var utils_1 = require('./utils'); +function simpleTick(fn) { + return setTimeout(fn, 30); +} +component_1.VantComponent({ + props: { + useSlot: Boolean, + millisecond: Boolean, + time: { + type: Number, + observer: 'reset', + }, + format: { + type: String, + value: 'HH:mm:ss', + }, + autoStart: { + type: Boolean, + value: true, + }, + }, + data: { + timeData: utils_1.parseTimeData(0), + formattedTime: '0', + }, + destroyed: function () { + clearTimeout(this.tid); + this.tid = null; + }, + methods: { + // 开始 + start: function () { + if (this.counting) { + return; + } + this.counting = true; + this.endTime = Date.now() + this.remain; + this.tick(); + }, + // 暂停 + pause: function () { + this.counting = false; + clearTimeout(this.tid); + }, + // 重置 + reset: function () { + this.pause(); + this.remain = this.data.time; + this.setRemain(this.remain); + if (this.data.autoStart) { + this.start(); + } + }, + tick: function () { + if (this.data.millisecond) { + this.microTick(); + } else { + this.macroTick(); + } + }, + microTick: function () { + var _this = this; + this.tid = simpleTick(function () { + _this.setRemain(_this.getRemain()); + if (_this.remain !== 0) { + _this.microTick(); + } + }); + }, + macroTick: function () { + var _this = this; + this.tid = simpleTick(function () { + var remain = _this.getRemain(); + if (!utils_1.isSameSecond(remain, _this.remain) || remain === 0) { + _this.setRemain(remain); + } + if (_this.remain !== 0) { + _this.macroTick(); + } + }); + }, + getRemain: function () { + return Math.max(this.endTime - Date.now(), 0); + }, + setRemain: function (remain) { + this.remain = remain; + var timeData = utils_1.parseTimeData(remain); + if (this.data.useSlot) { + this.$emit('change', timeData); + } + this.setData({ + formattedTime: utils_1.parseFormat(this.data.format, timeData), + }); + if (remain === 0) { + this.pause(); + this.$emit('finish'); + } + }, + }, +}); diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/count-down/index.json b/src/mindspore/miniprogram_npm/@vant/weapp/count-down/index.json new file mode 100644 index 0000000000000000000000000000000000000000..467ce2945f917ae0035594117b51f5304cdcdfa6 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/count-down/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/count-down/index.wxml b/src/mindspore/miniprogram_npm/@vant/weapp/count-down/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..e206e1677070434f2bd7d07cffb36e1365d5e476 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/count-down/index.wxml @@ -0,0 +1,4 @@ + + + {{ formattedTime }} + diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/count-down/index.wxss b/src/mindspore/miniprogram_npm/@vant/weapp/count-down/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..bc33f5dc8faedad81144c8c4fac06c831727e29f --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/count-down/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-count-down{color:#323233;color:var(--count-down-text-color,#323233);font-size:14px;font-size:var(--count-down-font-size,14px);line-height:20px;line-height:var(--count-down-line-height,20px)} \ No newline at end of file diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/count-down/utils.js b/src/mindspore/miniprogram_npm/@vant/weapp/count-down/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..10864a21fb0101a74fbece7b30a8c04d159fd043 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/count-down/utils.js @@ -0,0 +1,65 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +exports.isSameSecond = exports.parseFormat = exports.parseTimeData = void 0; +function padZero(num, targetLength) { + if (targetLength === void 0) { + targetLength = 2; + } + var str = num + ''; + while (str.length < targetLength) { + str = '0' + str; + } + return str; +} +var SECOND = 1000; +var MINUTE = 60 * SECOND; +var HOUR = 60 * MINUTE; +var DAY = 24 * HOUR; +function parseTimeData(time) { + var days = Math.floor(time / DAY); + var hours = Math.floor((time % DAY) / HOUR); + var minutes = Math.floor((time % HOUR) / MINUTE); + var seconds = Math.floor((time % MINUTE) / SECOND); + var milliseconds = Math.floor(time % SECOND); + return { + days: days, + hours: hours, + minutes: minutes, + seconds: seconds, + milliseconds: milliseconds, + }; +} +exports.parseTimeData = parseTimeData; +function parseFormat(format, timeData) { + var days = timeData.days; + var hours = timeData.hours, + minutes = timeData.minutes, + seconds = timeData.seconds, + milliseconds = timeData.milliseconds; + if (format.indexOf('DD') === -1) { + hours += days * 24; + } else { + format = format.replace('DD', padZero(days)); + } + if (format.indexOf('HH') === -1) { + minutes += hours * 60; + } else { + format = format.replace('HH', padZero(hours)); + } + if (format.indexOf('mm') === -1) { + seconds += minutes * 60; + } else { + format = format.replace('mm', padZero(minutes)); + } + if (format.indexOf('ss') === -1) { + milliseconds += seconds * 1000; + } else { + format = format.replace('ss', padZero(seconds)); + } + return format.replace('SSS', padZero(milliseconds, 3)); +} +exports.parseFormat = parseFormat; +function isSameSecond(time1, time2) { + return Math.floor(time1 / 1000) === Math.floor(time2 / 1000); +} +exports.isSameSecond = isSameSecond; diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/datetime-picker/index.js b/src/mindspore/miniprogram_npm/@vant/weapp/datetime-picker/index.js new file mode 100644 index 0000000000000000000000000000000000000000..6e119f2ad5cac62ae1d00eb3ef484562791ea924 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/datetime-picker/index.js @@ -0,0 +1,381 @@ +'use strict'; +var __assign = + (this && this.__assign) || + function () { + __assign = + Object.assign || + function (t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; +var __spreadArrays = + (this && this.__spreadArrays) || + function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) + s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; + }; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../common/component'); +var validator_1 = require('../common/validator'); +var shared_1 = require('../picker/shared'); +var currentYear = new Date().getFullYear(); +function isValidDate(date) { + return validator_1.isDef(date) && !isNaN(new Date(date).getTime()); +} +function range(num, min, max) { + return Math.min(Math.max(num, min), max); +} +function padZero(val) { + return ('00' + val).slice(-2); +} +function times(n, iteratee) { + var index = -1; + var result = Array(n < 0 ? 0 : n); + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} +function getTrueValue(formattedValue) { + if (formattedValue === undefined) { + formattedValue = '1'; + } + while (isNaN(parseInt(formattedValue, 10))) { + formattedValue = formattedValue.slice(1); + } + return parseInt(formattedValue, 10); +} +function getMonthEndDay(year, month) { + return 32 - new Date(year, month - 1, 32).getDate(); +} +var defaultFormatter = function (type, value) { + return value; +}; +component_1.VantComponent({ + classes: ['active-class', 'toolbar-class', 'column-class'], + props: __assign(__assign({}, shared_1.pickerProps), { + value: { + type: null, + observer: 'updateValue', + }, + filter: null, + type: { + type: String, + value: 'datetime', + observer: 'updateValue', + }, + showToolbar: { + type: Boolean, + value: true, + }, + formatter: { + type: null, + value: defaultFormatter, + }, + minDate: { + type: Number, + value: new Date(currentYear - 10, 0, 1).getTime(), + observer: 'updateValue', + }, + maxDate: { + type: Number, + value: new Date(currentYear + 10, 11, 31).getTime(), + observer: 'updateValue', + }, + minHour: { + type: Number, + value: 0, + observer: 'updateValue', + }, + maxHour: { + type: Number, + value: 23, + observer: 'updateValue', + }, + minMinute: { + type: Number, + value: 0, + observer: 'updateValue', + }, + maxMinute: { + type: Number, + value: 59, + observer: 'updateValue', + }, + }), + data: { + innerValue: Date.now(), + columns: [], + }, + methods: { + updateValue: function () { + var _this = this; + var data = this.data; + var val = this.correctValue(data.value); + var isEqual = val === data.innerValue; + if (!isEqual) { + this.updateColumnValue(val).then(function () { + _this.$emit('input', val); + }); + } else { + this.updateColumns(); + } + }, + getPicker: function () { + if (this.picker == null) { + this.picker = this.selectComponent('.van-datetime-picker'); + var picker_1 = this.picker; + var setColumnValues_1 = picker_1.setColumnValues; + picker_1.setColumnValues = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return setColumnValues_1.apply( + picker_1, + __spreadArrays(args, [false]) + ); + }; + } + return this.picker; + }, + updateColumns: function () { + var _a = this.data.formatter, + formatter = _a === void 0 ? defaultFormatter : _a; + var results = this.getOriginColumns().map(function (column) { + return { + values: column.values.map(function (value) { + return formatter(column.type, value); + }), + }; + }); + return this.set({ columns: results }); + }, + getOriginColumns: function () { + var filter = this.data.filter; + var results = this.getRanges().map(function (_a) { + var type = _a.type, + range = _a.range; + var values = times(range[1] - range[0] + 1, function (index) { + var value = range[0] + index; + value = type === 'year' ? '' + value : padZero(value); + return value; + }); + if (filter) { + values = filter(type, values); + } + return { type: type, values: values }; + }); + return results; + }, + getRanges: function () { + var data = this.data; + if (data.type === 'time') { + return [ + { + type: 'hour', + range: [data.minHour, data.maxHour], + }, + { + type: 'minute', + range: [data.minMinute, data.maxMinute], + }, + ]; + } + var _a = this.getBoundary('max', data.innerValue), + maxYear = _a.maxYear, + maxDate = _a.maxDate, + maxMonth = _a.maxMonth, + maxHour = _a.maxHour, + maxMinute = _a.maxMinute; + var _b = this.getBoundary('min', data.innerValue), + minYear = _b.minYear, + minDate = _b.minDate, + minMonth = _b.minMonth, + minHour = _b.minHour, + minMinute = _b.minMinute; + var result = [ + { + type: 'year', + range: [minYear, maxYear], + }, + { + type: 'month', + range: [minMonth, maxMonth], + }, + { + type: 'day', + range: [minDate, maxDate], + }, + { + type: 'hour', + range: [minHour, maxHour], + }, + { + type: 'minute', + range: [minMinute, maxMinute], + }, + ]; + if (data.type === 'date') result.splice(3, 2); + if (data.type === 'year-month') result.splice(2, 3); + return result; + }, + correctValue: function (value) { + var data = this.data; + // validate value + var isDateType = data.type !== 'time'; + if (isDateType && !isValidDate(value)) { + value = data.minDate; + } else if (!isDateType && !value) { + var minHour = data.minHour; + value = padZero(minHour) + ':00'; + } + // time type + if (!isDateType) { + var _a = value.split(':'), + hour = _a[0], + minute = _a[1]; + hour = padZero(range(hour, data.minHour, data.maxHour)); + minute = padZero(range(minute, data.minMinute, data.maxMinute)); + return hour + ':' + minute; + } + // date type + value = Math.max(value, data.minDate); + value = Math.min(value, data.maxDate); + return value; + }, + getBoundary: function (type, innerValue) { + var _a; + var value = new Date(innerValue); + var boundary = new Date(this.data[type + 'Date']); + var year = boundary.getFullYear(); + var month = 1; + var date = 1; + var hour = 0; + var minute = 0; + if (type === 'max') { + month = 12; + date = getMonthEndDay(value.getFullYear(), value.getMonth() + 1); + hour = 23; + minute = 59; + } + if (value.getFullYear() === year) { + month = boundary.getMonth() + 1; + if (value.getMonth() + 1 === month) { + date = boundary.getDate(); + if (value.getDate() === date) { + hour = boundary.getHours(); + if (value.getHours() === hour) { + minute = boundary.getMinutes(); + } + } + } + } + return ( + (_a = {}), + (_a[type + 'Year'] = year), + (_a[type + 'Month'] = month), + (_a[type + 'Date'] = date), + (_a[type + 'Hour'] = hour), + (_a[type + 'Minute'] = minute), + _a + ); + }, + onCancel: function () { + this.$emit('cancel'); + }, + onConfirm: function () { + this.$emit('confirm', this.data.innerValue); + }, + onChange: function () { + var _this = this; + var data = this.data; + var value; + var picker = this.getPicker(); + var originColumns = this.getOriginColumns(); + if (data.type === 'time') { + var indexes = picker.getIndexes(); + value = + +originColumns[0].values[indexes[0]] + + ':' + + +originColumns[1].values[indexes[1]]; + } else { + var indexes = picker.getIndexes(); + var values = indexes.map(function (value, index) { + return originColumns[index].values[value]; + }); + var year = getTrueValue(values[0]); + var month = getTrueValue(values[1]); + var maxDate = getMonthEndDay(year, month); + var date = getTrueValue(values[2]); + if (data.type === 'year-month') { + date = 1; + } + date = date > maxDate ? maxDate : date; + var hour = 0; + var minute = 0; + if (data.type === 'datetime') { + hour = getTrueValue(values[3]); + minute = getTrueValue(values[4]); + } + value = new Date(year, month - 1, date, hour, minute); + } + value = this.correctValue(value); + this.updateColumnValue(value).then(function () { + _this.$emit('input', value); + _this.$emit('change', picker); + }); + }, + updateColumnValue: function (value) { + var _this = this; + var values = []; + var type = this.data.type; + var formatter = this.data.formatter || defaultFormatter; + var picker = this.getPicker(); + if (type === 'time') { + var pair = value.split(':'); + values = [formatter('hour', pair[0]), formatter('minute', pair[1])]; + } else { + var date = new Date(value); + values = [ + formatter('year', '' + date.getFullYear()), + formatter('month', padZero(date.getMonth() + 1)), + ]; + if (type === 'date') { + values.push(formatter('day', padZero(date.getDate()))); + } + if (type === 'datetime') { + values.push( + formatter('day', padZero(date.getDate())), + formatter('hour', padZero(date.getHours())), + formatter('minute', padZero(date.getMinutes())) + ); + } + } + return this.set({ innerValue: value }) + .then(function () { + return _this.updateColumns(); + }) + .then(function () { + return picker.setValues(values); + }); + }, + }, + created: function () { + var _this = this; + var innerValue = this.correctValue(this.data.value); + this.updateColumnValue(innerValue).then(function () { + _this.$emit('input', innerValue); + }); + }, +}); diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/datetime-picker/index.json b/src/mindspore/miniprogram_npm/@vant/weapp/datetime-picker/index.json new file mode 100644 index 0000000000000000000000000000000000000000..a778e91cce16edbb1fd2af764415c4f8d2f0a0ea --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/datetime-picker/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-picker": "../picker/index" + } +} diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/datetime-picker/index.wxml b/src/mindspore/miniprogram_npm/@vant/weapp/datetime-picker/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..ade22024e970d0981e02ee902fcc0cc053d80ef7 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/datetime-picker/index.wxml @@ -0,0 +1,16 @@ + diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/datetime-picker/index.wxss b/src/mindspore/miniprogram_npm/@vant/weapp/datetime-picker/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..99694d603361421fe8f1acfc76a09eae443cb3aa --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/datetime-picker/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss'; \ No newline at end of file diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/definitions/index.js b/src/mindspore/miniprogram_npm/@vant/weapp/definitions/index.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/definitions/index.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/dialog/dialog.js b/src/mindspore/miniprogram_npm/@vant/weapp/dialog/dialog.js new file mode 100644 index 0000000000000000000000000000000000000000..d90d8ea437f9878358aec3ad43b4e21aa400591c --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/dialog/dialog.js @@ -0,0 +1,104 @@ +'use strict'; +var __assign = + (this && this.__assign) || + function () { + __assign = + Object.assign || + function (t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; +Object.defineProperty(exports, '__esModule', { value: true }); +var queue = []; +var defaultOptions = { + show: false, + title: '', + width: null, + theme: 'default', + message: '', + zIndex: 100, + overlay: true, + selector: '#van-dialog', + className: '', + asyncClose: false, + beforeClose: null, + transition: 'scale', + customStyle: '', + messageAlign: '', + overlayStyle: '', + confirmButtonText: '确认', + cancelButtonText: '取消', + showConfirmButton: true, + showCancelButton: false, + closeOnClickOverlay: false, + confirmButtonOpenType: '', +}; +var currentOptions = __assign({}, defaultOptions); +function getContext() { + var pages = getCurrentPages(); + return pages[pages.length - 1]; +} +var Dialog = function (options) { + options = __assign(__assign({}, currentOptions), options); + return new Promise(function (resolve, reject) { + var context = options.context || getContext(); + var dialog = context.selectComponent(options.selector); + delete options.context; + delete options.selector; + if (dialog) { + dialog.setData( + __assign( + { + callback: function (action, instance) { + action === 'confirm' ? resolve(instance) : reject(instance); + }, + }, + options + ) + ); + wx.nextTick(function () { + dialog.setData({ show: true }); + }); + queue.push(dialog); + } else { + console.warn( + '未找到 van-dialog 节点,请确认 selector 及 context 是否正确' + ); + } + }); +}; +Dialog.alert = function (options) { + return Dialog(options); +}; +Dialog.confirm = function (options) { + return Dialog(__assign({ showCancelButton: true }, options)); +}; +Dialog.close = function () { + queue.forEach(function (dialog) { + dialog.close(); + }); + queue = []; +}; +Dialog.stopLoading = function () { + queue.forEach(function (dialog) { + dialog.stopLoading(); + }); +}; +Dialog.currentOptions = currentOptions; +Dialog.defaultOptions = defaultOptions; +Dialog.setDefaultOptions = function (options) { + currentOptions = __assign(__assign({}, currentOptions), options); + Dialog.currentOptions = currentOptions; +}; +Dialog.resetDefaultOptions = function () { + currentOptions = __assign({}, defaultOptions); + Dialog.currentOptions = currentOptions; +}; +Dialog.resetDefaultOptions(); +exports.default = Dialog; diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/dialog/index.js b/src/mindspore/miniprogram_npm/@vant/weapp/dialog/index.js new file mode 100644 index 0000000000000000000000000000000000000000..09af643ff2bf4a5d95e271c3681ee840a394f0e9 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/dialog/index.js @@ -0,0 +1,127 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../common/component'); +var button_1 = require('../mixins/button'); +var open_type_1 = require('../mixins/open-type'); +var color_1 = require('../common/color'); +var utils_1 = require('../common/utils'); +component_1.VantComponent({ + mixins: [button_1.button, open_type_1.openType], + props: { + show: { + type: Boolean, + observer: function (show) { + !show && this.stopLoading(); + }, + }, + title: String, + message: String, + theme: { + type: String, + value: 'default', + }, + useSlot: Boolean, + className: String, + customStyle: String, + asyncClose: Boolean, + messageAlign: String, + beforeClose: null, + overlayStyle: String, + useTitleSlot: Boolean, + showCancelButton: Boolean, + closeOnClickOverlay: Boolean, + confirmButtonOpenType: String, + width: null, + zIndex: { + type: Number, + value: 2000, + }, + confirmButtonText: { + type: String, + value: '确认', + }, + cancelButtonText: { + type: String, + value: '取消', + }, + confirmButtonColor: { + type: String, + value: color_1.RED, + }, + cancelButtonColor: { + type: String, + value: color_1.GRAY, + }, + showConfirmButton: { + type: Boolean, + value: true, + }, + overlay: { + type: Boolean, + value: true, + }, + transition: { + type: String, + value: 'scale', + }, + }, + data: { + loading: { + confirm: false, + cancel: false, + }, + callback: function () {}, + }, + methods: { + onConfirm: function () { + this.handleAction('confirm'); + }, + onCancel: function () { + this.handleAction('cancel'); + }, + onClickOverlay: function () { + this.close('overlay'); + }, + close: function (action) { + var _this = this; + this.setData({ show: false }); + wx.nextTick(function () { + _this.$emit('close', action); + var callback = _this.data.callback; + if (callback) { + callback(action, _this); + } + }); + }, + stopLoading: function () { + this.setData({ + loading: { + confirm: false, + cancel: false, + }, + }); + }, + handleAction: function (action) { + var _a; + var _this = this; + this.$emit(action, { dialog: this }); + var _b = this.data, + asyncClose = _b.asyncClose, + beforeClose = _b.beforeClose; + if (!asyncClose && !beforeClose) { + this.close(action); + return; + } + this.setData(((_a = {}), (_a['loading.' + action] = true), _a)); + if (beforeClose) { + utils_1.toPromise(beforeClose(action)).then(function (value) { + if (value) { + _this.close(action); + } else { + _this.stopLoading(); + } + }); + } + }, + }, +}); diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/dialog/index.json b/src/mindspore/miniprogram_npm/@vant/weapp/dialog/index.json new file mode 100644 index 0000000000000000000000000000000000000000..43417fc8977861fcac5d1e799f8a1c2842a4e5c7 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/dialog/index.json @@ -0,0 +1,9 @@ +{ + "component": true, + "usingComponents": { + "van-popup": "../popup/index", + "van-button": "../button/index", + "van-goods-action": "../goods-action/index", + "van-goods-action-button": "../goods-action-button/index" + } +} diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/dialog/index.wxml b/src/mindspore/miniprogram_npm/@vant/weapp/dialog/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..fd13bc9ad225701a813eb8ad97f4c15d67465a6a --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/dialog/index.wxml @@ -0,0 +1,113 @@ + + + + + + {{ title }} + + + + + {{ message }} + + + + + {{ cancelButtonText }} + + + {{ confirmButtonText }} + + + + + + {{ cancelButtonText }} + + + {{ confirmButtonText }} + + + diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/dialog/index.wxss b/src/mindspore/miniprogram_npm/@vant/weapp/dialog/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..c6bac95745e625478d4203d82168e6e7f4f6bbf0 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/dialog/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-dialog{top:45%!important;overflow:hidden;width:320px;width:var(--dialog-width,320px);font-size:16px;font-size:var(--dialog-font-size,16px);border-radius:16px;border-radius:var(--dialog-border-radius,16px);background-color:#fff;background-color:var(--dialog-background-color,#fff)}@media (max-width:321px){.van-dialog{width:90%;width:var(--dialog-small-screen-width,90%)}}.van-dialog__header{text-align:center;padding-top:24px;padding-top:var(--dialog-header-padding-top,24px);font-weight:500;font-weight:var(--dialog-header-font-weight,500);line-height:24px;line-height:var(--dialog-header-line-height,24px)}.van-dialog__header--isolated{padding:24px 0;padding:var(--dialog-header-isolated-padding,24px 0)}.van-dialog__message{overflow-y:auto;text-align:center;-webkit-overflow-scrolling:touch;font-size:14px;font-size:var(--dialog-message-font-size,14px);line-height:20px;line-height:var(--dialog-message-line-height,20px);max-height:60vh;max-height:var(--dialog-message-max-height,60vh);padding:24px;padding:var(--dialog-message-padding,24px)}.van-dialog__message-text{word-wrap:break-word}.van-dialog__message--hasTitle{padding-top:8px;padding-top:var(--dialog-has-title-message-padding-top,8px);color:#646566;color:var(--dialog-has-title-message-text-color,#646566)}.van-dialog__message--round-button{padding-bottom:16px;color:#323233}.van-dialog__message--left{text-align:left}.van-dialog__message--right{text-align:right}.van-dialog__footer{display:-webkit-flex;display:flex}.van-dialog__footer--round-button{position:relative!important;padding:8px 24px 16px!important}.van-dialog__button{-webkit-flex:1;flex:1}.van-dialog__cancel,.van-dialog__confirm{border:0!important}.van-dialog-bounce-enter{-webkit-transform:translate3d(-50%,-50%,0) scale(.7);transform:translate3d(-50%,-50%,0) scale(.7);opacity:0}.van-dialog-bounce-leave-active{-webkit-transform:translate3d(-50%,-50%,0) scale(.9);transform:translate3d(-50%,-50%,0) scale(.9);opacity:0} \ No newline at end of file diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/divider/index.js b/src/mindspore/miniprogram_npm/@vant/weapp/divider/index.js new file mode 100644 index 0000000000000000000000000000000000000000..b643841fdc9b9842ff1e68aed50a5e5825000b54 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/divider/index.js @@ -0,0 +1,14 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../common/component'); +component_1.VantComponent({ + props: { + dashed: Boolean, + hairline: Boolean, + contentPosition: String, + fontSize: String, + borderColor: String, + textColor: String, + customStyle: String, + }, +}); diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/divider/index.json b/src/mindspore/miniprogram_npm/@vant/weapp/divider/index.json new file mode 100644 index 0000000000000000000000000000000000000000..a89ef4dbeefa01f5cd7971973aa4db6498d139f7 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/divider/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/divider/index.wxml b/src/mindspore/miniprogram_npm/@vant/weapp/divider/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..f6a5a457b2de3b6b00b580f35e7fa4ca51879c06 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/divider/index.wxml @@ -0,0 +1,9 @@ + + + + + + diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/divider/index.wxs b/src/mindspore/miniprogram_npm/@vant/weapp/divider/index.wxs new file mode 100644 index 0000000000000000000000000000000000000000..215b14f4792ab551d63ee58427cfc94295091378 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/divider/index.wxs @@ -0,0 +1,18 @@ +/* eslint-disable */ +var style = require('../wxs/style.wxs'); +var addUnit = require('../wxs/add-unit.wxs'); + +function rootStyle(data) { + return style([ + { + 'border-color': data.borderColor, + color: data.textColor, + 'font-size': addUnit(data.fontSize), + }, + data.customStyle, + ]); +} + +module.exports = { + rootStyle: rootStyle, +}; diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/divider/index.wxss b/src/mindspore/miniprogram_npm/@vant/weapp/divider/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..c055e3af96b3f03d78fefbcc8405efa234bcc84b --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/divider/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-divider{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;margin:16px 0;margin:var(--divider-margin,16px 0);color:#969799;color:var(--divider-text-color,#969799);font-size:14px;font-size:var(--divider-font-size,14px);line-height:24px;line-height:var(--divider-line-height,24px);border:0 solid #ebedf0;border-color:var(--divider-border-color,#ebedf0)}.van-divider:after,.van-divider:before{display:block;-webkit-flex:1;flex:1;box-sizing:border-box;height:1px;border-color:inherit;border-style:inherit;border-width:1px 0 0}.van-divider:before{content:""}.van-divider--hairline:after,.van-divider--hairline:before{-webkit-transform:scaleY(.5);transform:scaleY(.5)}.van-divider--dashed{border-style:dashed}.van-divider--center:before,.van-divider--left:before,.van-divider--right:before{margin-right:16px;margin-right:var(--divider-content-padding,16px)}.van-divider--center:after,.van-divider--left:after,.van-divider--right:after{content:"";margin-left:16px;margin-left:var(--divider-content-padding,16px)}.van-divider--left:before{max-width:10%;max-width:var(--divider-content-left-width,10%)}.van-divider--right:after{max-width:10%;max-width:var(--divider-content-right-width,10%)} \ No newline at end of file diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/dropdown-item/index.js b/src/mindspore/miniprogram_npm/@vant/weapp/dropdown-item/index.js new file mode 100644 index 0000000000000000000000000000000000000000..aac47c99bccf3efcccecee8d82a690c7f61600cc --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/dropdown-item/index.js @@ -0,0 +1,117 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var relation_1 = require('../common/relation'); +var component_1 = require('../common/component'); +component_1.VantComponent({ + field: true, + relation: relation_1.useParent('dropdown-menu', function () { + this.updateDataFromParent(); + }), + props: { + value: { + type: null, + observer: 'rerender', + }, + title: { + type: String, + observer: 'rerender', + }, + disabled: Boolean, + titleClass: { + type: String, + observer: 'rerender', + }, + options: { + type: Array, + value: [], + observer: 'rerender', + }, + popupStyle: String, + }, + data: { + transition: true, + showPopup: false, + showWrapper: false, + displayTitle: '', + }, + methods: { + rerender: function () { + var _this = this; + wx.nextTick(function () { + var _a; + (_a = _this.parent) === null || _a === void 0 + ? void 0 + : _a.updateItemListData(); + }); + }, + updateDataFromParent: function () { + if (this.parent) { + var _a = this.parent.data, + overlay = _a.overlay, + duration = _a.duration, + activeColor = _a.activeColor, + closeOnClickOverlay = _a.closeOnClickOverlay, + direction = _a.direction; + this.setData({ + overlay: overlay, + duration: duration, + activeColor: activeColor, + closeOnClickOverlay: closeOnClickOverlay, + direction: direction, + }); + } + }, + onOpen: function () { + this.$emit('open'); + }, + onOpened: function () { + this.$emit('opened'); + }, + onClose: function () { + this.$emit('close'); + }, + onClosed: function () { + this.$emit('closed'); + this.setData({ showWrapper: false }); + }, + onOptionTap: function (event) { + var option = event.currentTarget.dataset.option; + var value = option.value; + var shouldEmitChange = this.data.value !== value; + this.setData({ showPopup: false, value: value }); + this.$emit('close'); + this.rerender(); + if (shouldEmitChange) { + this.$emit('change', value); + } + }, + toggle: function (show, options) { + var _this = this; + var _a; + if (options === void 0) { + options = {}; + } + var showPopup = this.data.showPopup; + if (typeof show !== 'boolean') { + show = !showPopup; + } + if (show === showPopup) { + return; + } + this.setData({ + transition: !options.immediate, + showPopup: show, + }); + if (show) { + (_a = this.parent) === null || _a === void 0 + ? void 0 + : _a.getChildWrapperStyle().then(function (wrapperStyle) { + _this.setData({ wrapperStyle: wrapperStyle, showWrapper: true }); + _this.rerender(); + }); + } else { + this.rerender(); + } + }, + }, +}); diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/dropdown-item/index.json b/src/mindspore/miniprogram_npm/@vant/weapp/dropdown-item/index.json new file mode 100644 index 0000000000000000000000000000000000000000..88d540990b8eb84cabe720e54930e910490c6715 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/dropdown-item/index.json @@ -0,0 +1,8 @@ +{ + "component": true, + "usingComponents": { + "van-popup": "../popup/index", + "van-cell": "../cell/index", + "van-icon": "../icon/index" + } +} diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/dropdown-item/index.wxml b/src/mindspore/miniprogram_npm/@vant/weapp/dropdown-item/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..dd75292f8c5ae8ecf10ba79cf5753dff37b80b9c --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/dropdown-item/index.wxml @@ -0,0 +1,48 @@ + + + + + + + {{ item.text }} + + + + + + + diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/dropdown-item/index.wxss b/src/mindspore/miniprogram_npm/@vant/weapp/dropdown-item/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..7cab3f28a7de958bc08be86cb2012f7a2076eb3e --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/dropdown-item/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-dropdown-item{position:fixed;right:0;left:0;overflow:hidden}.van-dropdown-item__option{text-align:left}.van-dropdown-item__option--active .van-dropdown-item__icon,.van-dropdown-item__option--active .van-dropdown-item__title{color:#ee0a24;color:var(--dropdown-menu-option-active-color,#ee0a24)}.van-dropdown-item--up{top:0}.van-dropdown-item--down{bottom:0}.van-dropdown-item__icon{display:block;line-height:inherit} \ No newline at end of file diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/dropdown-item/shared.js b/src/mindspore/miniprogram_npm/@vant/weapp/dropdown-item/shared.js new file mode 100644 index 0000000000000000000000000000000000000000..db8b17d542e3ed1993a0ade562cf288f0446b1d9 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/dropdown-item/shared.js @@ -0,0 +1,2 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/dropdown-menu/index.js b/src/mindspore/miniprogram_npm/@vant/weapp/dropdown-menu/index.js new file mode 100644 index 0000000000000000000000000000000000000000..9c27c6477625676d45ceefce5446d63f4f638a15 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/dropdown-menu/index.js @@ -0,0 +1,126 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../common/component'); +var relation_1 = require('../common/relation'); +var utils_1 = require('../common/utils'); +var ARRAY = []; +component_1.VantComponent({ + field: true, + relation: relation_1.useChildren('dropdown-item', function () { + this.updateItemListData(); + }), + props: { + activeColor: { + type: String, + observer: 'updateChildrenData', + }, + overlay: { + type: Boolean, + value: true, + observer: 'updateChildrenData', + }, + zIndex: { + type: Number, + value: 10, + }, + duration: { + type: Number, + value: 200, + observer: 'updateChildrenData', + }, + direction: { + type: String, + value: 'down', + observer: 'updateChildrenData', + }, + closeOnClickOverlay: { + type: Boolean, + value: true, + observer: 'updateChildrenData', + }, + closeOnClickOutside: { + type: Boolean, + value: true, + }, + }, + data: { + itemListData: [], + }, + beforeCreate: function () { + var windowHeight = utils_1.getSystemInfoSync().windowHeight; + this.windowHeight = windowHeight; + ARRAY.push(this); + }, + destroyed: function () { + var _this = this; + ARRAY = ARRAY.filter(function (item) { + return item !== _this; + }); + }, + methods: { + updateItemListData: function () { + this.setData({ + itemListData: this.children.map(function (child) { + return child.data; + }), + }); + }, + updateChildrenData: function () { + this.children.forEach(function (child) { + child.updateDataFromParent(); + }); + }, + toggleItem: function (active) { + this.children.forEach(function (item, index) { + var showPopup = item.data.showPopup; + if (index === active) { + item.toggle(); + } else if (showPopup) { + item.toggle(false, { immediate: true }); + } + }); + }, + close: function () { + this.children.forEach(function (child) { + child.toggle(false, { immediate: true }); + }); + }, + getChildWrapperStyle: function () { + var _this = this; + var _a = this.data, + zIndex = _a.zIndex, + direction = _a.direction; + return utils_1.getRect(this, '.van-dropdown-menu').then(function (rect) { + var _a = rect.top, + top = _a === void 0 ? 0 : _a, + _b = rect.bottom, + bottom = _b === void 0 ? 0 : _b; + var offset = direction === 'down' ? bottom : _this.windowHeight - top; + var wrapperStyle = 'z-index: ' + zIndex + ';'; + if (direction === 'down') { + wrapperStyle += 'top: ' + utils_1.addUnit(offset) + ';'; + } else { + wrapperStyle += 'bottom: ' + utils_1.addUnit(offset) + ';'; + } + return wrapperStyle; + }); + }, + onTitleTap: function (event) { + var _this = this; + var index = event.currentTarget.dataset.index; + var child = this.children[index]; + if (!child.data.disabled) { + ARRAY.forEach(function (menuItem) { + if ( + menuItem && + menuItem.data.closeOnClickOutside && + menuItem !== _this + ) { + menuItem.close(); + } + }); + this.toggleItem(index); + } + }, + }, +}); diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/dropdown-menu/index.json b/src/mindspore/miniprogram_npm/@vant/weapp/dropdown-menu/index.json new file mode 100644 index 0000000000000000000000000000000000000000..467ce2945f917ae0035594117b51f5304cdcdfa6 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/dropdown-menu/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxml b/src/mindspore/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..037ac3b6eaf90cb48ffeb7b5b5a59706aa75355c --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxml @@ -0,0 +1,23 @@ + + + + + + + + {{ computed.displayTitle(item) }} + + + + + + diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxs b/src/mindspore/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxs new file mode 100644 index 0000000000000000000000000000000000000000..65388549c6d2168b32ee11ac2074e095c0804fab --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxs @@ -0,0 +1,16 @@ +/* eslint-disable */ +function displayTitle(item) { + if (item.title) { + return item.title; + } + + var match = item.options.filter(function(option) { + return option.value === item.value; + }); + var displayTitle = match.length ? match[0].text : ''; + return displayTitle; +} + +module.exports = { + displayTitle: displayTitle +}; diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxss b/src/mindspore/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..ec6caff634f767b19e169b2a74d8434bb512fa48 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-dropdown-menu{display:-webkit-flex;display:flex;box-shadow:0 2px 12px rgba(100,101,102,.12);-webkit-user-select:none;user-select:none;height:50px;height:var(--dropdown-menu-height,50px);background-color:#fff;background-color:var(--dropdown-menu-background-color,#fff)}.van-dropdown-menu__item{display:-webkit-flex;display:flex;-webkit-flex:1;flex:1;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;min-width:0}.van-dropdown-menu__item:active{opacity:.7}.van-dropdown-menu__item--disabled:active{opacity:1}.van-dropdown-menu__item--disabled .van-dropdown-menu__title{color:#969799;color:var(--dropdown-menu-title-disabled-text-color,#969799)}.van-dropdown-menu__title{position:relative;box-sizing:border-box;max-width:100%;padding:0 8px;padding:var(--dropdown-menu-title-padding,0 8px);color:#323233;color:var(--dropdown-menu-title-text-color,#323233);font-size:15px;font-size:var(--dropdown-menu-title-font-size,15px);line-height:18px;line-height:var(--dropdown-menu-title-line-height,18px)}.van-dropdown-menu__title:after{position:absolute;top:50%;right:-4px;margin-top:-5px;border-color:transparent transparent currentcolor currentcolor;border-style:solid;border-width:3px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);opacity:.8;content:""}.van-dropdown-menu__title--active{color:#ee0a24;color:var(--dropdown-menu-title-active-text-color,#ee0a24)}.van-dropdown-menu__title--down:after{margin-top:-1px;-webkit-transform:rotate(135deg);transform:rotate(135deg)} \ No newline at end of file diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/empty/index.js b/src/mindspore/miniprogram_npm/@vant/weapp/empty/index.js new file mode 100644 index 0000000000000000000000000000000000000000..d5b20259e37e355f957c45ff09826bddb2fbf513 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/empty/index.js @@ -0,0 +1,12 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../common/component'); +component_1.VantComponent({ + props: { + description: String, + image: { + type: String, + value: 'default', + }, + }, +}); diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/empty/index.json b/src/mindspore/miniprogram_npm/@vant/weapp/empty/index.json new file mode 100644 index 0000000000000000000000000000000000000000..e8cfaaf80c404eb97d3cf8b6277ec15f37e6905e --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/empty/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/empty/index.wxml b/src/mindspore/miniprogram_npm/@vant/weapp/empty/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..9c7b719a7249f1bf5dd67f876ccc4123b0a2d609 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/empty/index.wxml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + {{ description }} + + + + + + diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/empty/index.wxs b/src/mindspore/miniprogram_npm/@vant/weapp/empty/index.wxs new file mode 100644 index 0000000000000000000000000000000000000000..9696dd47452feaefa1f178b9fd8c4da4af280cf7 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/empty/index.wxs @@ -0,0 +1,14 @@ +/* eslint-disable */ +var PRESETS = ['error', 'search', 'default', 'network']; + +function imageUrl(image) { + if (PRESETS.indexOf(image) !== -1) { + return 'https://img.yzcdn.cn/vant/empty-image-' + image + '.png'; + } + + return image; +} + +module.exports = { + imageUrl: imageUrl, +}; diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/empty/index.wxss b/src/mindspore/miniprogram_npm/@vant/weapp/empty/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..aeb9d4b1506b5b2f37a288b8d5f41e6d209dbb92 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/empty/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-empty{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;padding:32px 0}.van-empty__image{width:160px;height:160px}.van-empty__image:empty{display:none}.van-empty__image__img{width:100%;height:100%}.van-empty__image:not(:empty)+.van-empty__image{display:none}.van-empty__description{margin-top:16px;padding:0 60px;color:#969799;font-size:14px;line-height:20px}.van-empty__description:empty,.van-empty__description:not(:empty)+.van-empty__description{display:none}.van-empty__bottom{margin-top:24px} \ No newline at end of file diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/field/index.js b/src/mindspore/miniprogram_npm/@vant/weapp/field/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e017616a2928c7c5ae8d9853cf4972c01c4b44ba --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/field/index.js @@ -0,0 +1,151 @@ +'use strict'; +var __assign = + (this && this.__assign) || + function () { + __assign = + Object.assign || + function (t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; +Object.defineProperty(exports, '__esModule', { value: true }); +var utils_1 = require('../common/utils'); +var component_1 = require('../common/component'); +var props_1 = require('./props'); +component_1.VantComponent({ + field: true, + classes: ['input-class', 'right-icon-class', 'label-class'], + props: __assign( + __assign( + __assign(__assign({}, props_1.commonProps), props_1.inputProps), + props_1.textareaProps + ), + { + size: String, + icon: String, + label: String, + error: Boolean, + center: Boolean, + isLink: Boolean, + leftIcon: String, + rightIcon: String, + autosize: null, + required: Boolean, + iconClass: String, + clickable: Boolean, + inputAlign: String, + customStyle: String, + errorMessage: String, + arrowDirection: String, + showWordLimit: Boolean, + errorMessageAlign: String, + readonly: { + type: Boolean, + observer: 'setShowClear', + }, + clearable: { + type: Boolean, + observer: 'setShowClear', + }, + border: { + type: Boolean, + value: true, + }, + titleWidth: { + type: String, + value: '6.2em', + }, + } + ), + data: { + focused: false, + innerValue: '', + showClear: false, + }, + created: function () { + this.value = this.data.value; + this.setData({ innerValue: this.value }); + }, + methods: { + onInput: function (event) { + var _a = (event.detail || {}).value, + value = _a === void 0 ? '' : _a; + this.value = value; + this.setShowClear(); + this.emitChange(); + }, + onFocus: function (event) { + this.focused = true; + this.setShowClear(); + this.$emit('focus', event.detail); + }, + onBlur: function (event) { + this.focused = false; + this.setShowClear(); + this.$emit('blur', event.detail); + }, + onClickIcon: function () { + this.$emit('click-icon'); + }, + onClickInput: function (event) { + this.$emit('click-input', event.detail); + }, + onClear: function () { + var _this = this; + this.setData({ innerValue: '' }); + this.value = ''; + this.setShowClear(); + utils_1.nextTick(function () { + _this.emitChange(); + _this.$emit('clear', ''); + }); + }, + onConfirm: function (event) { + var _a = (event.detail || {}).value, + value = _a === void 0 ? '' : _a; + this.value = value; + this.setShowClear(); + this.$emit('confirm', value); + }, + setValue: function (value) { + this.value = value; + this.setShowClear(); + if (value === '') { + this.setData({ innerValue: '' }); + } + this.emitChange(); + }, + onLineChange: function (event) { + this.$emit('linechange', event.detail); + }, + onKeyboardHeightChange: function (event) { + this.$emit('keyboardheightchange', event.detail); + }, + emitChange: function () { + var _this = this; + this.setData({ value: this.value }); + utils_1.nextTick(function () { + _this.$emit('input', _this.value); + _this.$emit('change', _this.value); + }); + }, + setShowClear: function () { + var _a = this.data, + clearable = _a.clearable, + readonly = _a.readonly; + var _b = this, + focused = _b.focused, + value = _b.value; + this.setData({ + showClear: !!clearable && !!focused && !!value && !readonly, + }); + }, + noop: function () {}, + }, +}); diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/field/index.json b/src/mindspore/miniprogram_npm/@vant/weapp/field/index.json new file mode 100644 index 0000000000000000000000000000000000000000..5906c5048acd40f797098314747f67ef4e5107db --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/field/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": { + "van-cell": "../cell/index", + "van-icon": "../icon/index" + } +} diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/field/index.wxml b/src/mindspore/miniprogram_npm/@vant/weapp/field/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..9dc8b66607cbad05fe7f5cafcc96c1ebd5460e2f --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/field/index.wxml @@ -0,0 +1,56 @@ + + + + + + + {{ label }} + + + + + + + + + + + + + + + + + + + + + {{ value.length >= maxlength ? maxlength : value.length }}/{{ maxlength }} + + + {{ errorMessage }} + + diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/field/index.wxs b/src/mindspore/miniprogram_npm/@vant/weapp/field/index.wxs new file mode 100644 index 0000000000000000000000000000000000000000..78575b9a87aba798b6c39d6723f84c330b4d1592 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/field/index.wxs @@ -0,0 +1,18 @@ +/* eslint-disable */ +var style = require('../wxs/style.wxs'); +var addUnit = require('../wxs/add-unit.wxs'); + +function inputStyle(autosize) { + if (autosize && autosize.constructor === 'Object') { + return style({ + 'min-height': addUnit(autosize.minHeight), + 'max-height': addUnit(autosize.maxHeight), + }); + } + + return ''; +} + +module.exports = { + inputStyle: inputStyle, +}; diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/field/index.wxss b/src/mindspore/miniprogram_npm/@vant/weapp/field/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..171f6133ee799d41f6454361fa4b9a37674cc70b --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/field/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-field{--cell-icon-size:16px;--cell-icon-size:var(--field-icon-size,16px)}.van-field__label{color:#646566;color:var(--field-label-color,#646566)}.van-field__label--disabled{color:#c8c9cc;color:var(--field-disabled-text-color,#c8c9cc)}.van-field__body{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center}.van-field__body--textarea{box-sizing:border-box;padding:3.6px 0;line-height:1.2em;min-height:24px;min-height:var(--cell-line-height,24px)}.van-field__control:empty+.van-field__control{display:block}.van-field__control{position:relative;display:none;box-sizing:border-box;width:100%;margin:0;padding:0;line-height:inherit;text-align:left;background-color:initial;border:0;resize:none;color:#323233;color:var(--field-input-text-color,#323233);height:24px;height:var(--cell-line-height,24px);min-height:24px;min-height:var(--cell-line-height,24px)}.van-field__control:empty{display:none}.van-field__control--textarea{height:18px;height:var(--field-text-area-min-height,18px);min-height:18px;min-height:var(--field-text-area-min-height,18px)}.van-field__control--error{color:#ee0a24;color:var(--field-input-error-text-color,#ee0a24)}.van-field__control--disabled{background-color:initial;opacity:1;color:#c8c9cc;color:var(--field-input-disabled-text-color,#c8c9cc)}.van-field__control--center{text-align:center}.van-field__control--right{text-align:right}.van-field__control--custom{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;min-height:24px;min-height:var(--cell-line-height,24px)}.van-field__placeholder{position:absolute;top:0;right:0;left:0;pointer-events:none;color:#c8c9cc;color:var(--field-placeholder-text-color,#c8c9cc)}.van-field__placeholder--error{color:#ee0a24;color:var(--field-error-message-color,#ee0a24)}.van-field__icon-root{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;min-height:24px;min-height:var(--cell-line-height,24px)}.van-field__clear-root,.van-field__icon-container{line-height:inherit;vertical-align:middle;padding:0 8px;padding:0 var(--padding-xs,8px);margin-right:-8px;margin-right:-var(--padding-xs,8px)}.van-field__button,.van-field__clear-root,.van-field__icon-container{-webkit-flex-shrink:0;flex-shrink:0}.van-field__clear-root{font-size:16px;font-size:var(--field-clear-icon-size,16px);color:#c8c9cc;color:var(--field-clear-icon-color,#c8c9cc)}.van-field__icon-container{font-size:16px;font-size:var(--field-icon-size,16px);color:#969799;color:var(--field-icon-container-color,#969799)}.van-field__icon-container:empty{display:none}.van-field__button{padding-left:8px;padding-left:var(--padding-xs,8px)}.van-field__button:empty{display:none}.van-field__error-message{text-align:left;font-size:12px;font-size:var(--field-error-message-text-font-size,12px);color:#ee0a24;color:var(--field-error-message-color,#ee0a24)}.van-field__error-message--center{text-align:center}.van-field__error-message--right{text-align:right}.van-field__word-limit{text-align:right;margin-top:4px;margin-top:var(--padding-base,4px);color:#646566;color:var(--field-word-limit-color,#646566);font-size:12px;font-size:var(--field-word-limit-font-size,12px);line-height:16px;line-height:var(--field-word-limit-line-height,16px)}.van-field__word-num{display:inline}.van-field__word-num--full{color:#ee0a24;color:var(--field-word-num-full-color,#ee0a24)} \ No newline at end of file diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/field/input.wxml b/src/mindspore/miniprogram_npm/@vant/weapp/field/input.wxml new file mode 100644 index 0000000000000000000000000000000000000000..3ecab24380242854bffb9167e3218b4acb46bc78 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/field/input.wxml @@ -0,0 +1,27 @@ + diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/field/props.js b/src/mindspore/miniprogram_npm/@vant/weapp/field/props.js new file mode 100644 index 0000000000000000000000000000000000000000..6ce703be56884a34c9f6148c6fb1fe97c096388e --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/field/props.js @@ -0,0 +1,66 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +exports.textareaProps = exports.inputProps = exports.commonProps = void 0; +exports.commonProps = { + value: { + type: String, + observer: function (value) { + if (value !== this.value) { + this.setData({ innerValue: value }); + this.value = value; + } + }, + }, + placeholder: String, + placeholderStyle: String, + placeholderClass: String, + disabled: Boolean, + maxlength: { + type: Number, + value: -1, + }, + cursorSpacing: { + type: Number, + value: 50, + }, + autoFocus: Boolean, + focus: Boolean, + cursor: { + type: Number, + value: -1, + }, + selectionStart: { + type: Number, + value: -1, + }, + selectionEnd: { + type: Number, + value: -1, + }, + adjustPosition: { + type: Boolean, + value: true, + }, + holdKeyboard: Boolean, +}; +exports.inputProps = { + type: { + type: String, + value: 'text', + }, + password: Boolean, + confirmType: String, + confirmHold: Boolean, +}; +exports.textareaProps = { + autoHeight: Boolean, + fixed: Boolean, + showConfirmBar: { + type: Boolean, + value: true, + }, + disableDefaultPadding: { + type: Boolean, + value: true, + }, +}; diff --git a/src/mindspore/miniprogram_npm/@vant/weapp/field/textarea.wxml b/src/mindspore/miniprogram_npm/@vant/weapp/field/textarea.wxml new file mode 100644 index 0000000000000000000000000000000000000000..5015a51d2a21b4716c90e3f57410a40d36b39786 --- /dev/null +++ b/src/mindspore/miniprogram_npm/@vant/weapp/field/textarea.wxml @@ -0,0 +1,29 @@ + + + + + + + 议题 {{index+1}} + 日程 + + + + + + + + 时间 + * + + + {{item.start||'请选择'}} + + {{item.end||'请选择'}} + + + + + 议题 + * + + + + + Speaker + + + + Title + + + + + + 继续添加 + + + 海报主题 + + + + + + + + + + + + + + + + + + + + + + + + + + + + * + 号为必填项 + + + + + 点击 【保存草稿】 后,您可以在“我的 > 我的活动 > 草稿箱”中查看此活动,并继续编辑 + + + + 点击 【申请发布】 后,你的活动将进入发布阶段,正式发布后,您仅能修改活动日程 + + + + + + + + + + + + + + 选择所属SIG + + + + + {{item.group_name}} + + + + + + + + + + + + + 选择活动日期 + + + + + + + + + + 选择日程开始时间 + + + + + + + + + + 选择日程结束时间 + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/package-events/publish/publish.wxss b/src/mindspore/package-events/publish/publish.wxss new file mode 100644 index 0000000000000000000000000000000000000000..03891a3f52506e1d88bb95965c638102457d7972 --- /dev/null +++ b/src/mindspore/package-events/publish/publish.wxss @@ -0,0 +1,373 @@ +/* package-events/publish/publish.wxss */ +page { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHwAAAAeCAYAAADuInrvAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACdSURBVGhD7dbBDYAwDAPAbsTYjFnEDn5YyT34WinWpT3nea9v0T9Q9qKyf9wKV7gVP/maI5xwwglfpkDhCh9z9Y05yGSVybMpfNn2UrjCvdKTK7Qti3DCCW9TmZyHcMIJT4pqyyKccMLbVCbnIZxwwpOi2rIIJ5zwNpXJeQgnnPCkqLYswgknvE1lch7CCSc8Kaoti3DCCW9TGZznA1f9oK8GgBpHAAAAAElFTkSuQmCC) no-repeat; + background-size: 100% 108rpx; + background-color: #f5f7fa !important; + padding: 0 30rpx; +} + +.container { + padding: 30rpx 0 129rpx 0; +} + +textarea { + height: 45rpx; + flex: 1; +} + +input { + flex: 1; +} + +.require { + color: #f76270; +} + +.blue { + color: #40ADFF; +} + +.gray { + color: #c7cad0; +} + +.placeholder { + color: #c7cad0; +} + +.radio-class { + font-size: 28rpx; +} + +.van-radio { + margin-right: 10rpx !important; +} + +.van-radio__label { + margin-left: 5rpx !important; +} + +.container .form .form-item { + padding: 0 30rpx; + background-color: #fff; + height: 108rpx; + color: #333; + font-size: 28rpx; + display: flex; + align-items: center; + justify-content: start; + border-bottom: 2rpx solid #f0f3f7; +} + +.container .form > .form-item { + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; +} + +.container .form .form-wrapper { + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; + background-color: #fff; + overflow: hidden; +} + +.container .form .form-item .arrow { + flex: 1; + display: flex; + justify-content: space-between; + align-items: center; +} + +.container .form .form-item .arrow .sel-data { + color: #6d7278; +} + +.container .form .form-item .sel-time { + flex: 1; + color: #333; + display: flex; + align-items: center; + justify-content: start; +} + +.container .form .form-item .sel-time .time { + color: #6d7278; + margin: 0 20rpx; + border: 1px solid #c7cad0; + background-color: #f0f3f7; + padding: 0 20rpx; + border-radius: 8rpx; +} + +.container .form .form-item .sel-time .start-time { + margin-left: 0; +} + +.container .form .form-item .label { + margin-right: 40rpx; + font-size: 34rpx; +} + +.container .form .form-item input { + color: #6d7278; +} + +.container .form .form-item .etherpad { + display: block; + color: #6d7278; + overflow-x: scroll; + flex: 1; +} + +.container .form .form-item textarea { + color: #6d7278; +} + +.container .form .form-item image { + width: 30rpx; + height: 30rpx; +} + +.container .form .meeting-desc { + margin-top: 20rpx; + padding-top: 30rpx; + align-items: flex-start; + height: 244rpx; +} + +.container .form .meeting-desc textarea { + height: 184rpx; + position: relative; +} + +.container .form .meeting-desc textarea .hint { + position: absolute; + right: 0; + bottom: 0; + color: #c7cad0; + font-size: 28rpx; +} + +.container .info { + font-size: 29rpx; + color: #6d7278; + margin-bottom: 60rpx; +} + +.container .info view { + margin: 30rpx 0; +} + +.container .info view image { + width: 28rpx; + height: 28rpx; + margin-right: 15rpx; + vertical-align: middle; +} + +.container .commit { + display: flex; + justify-content: space-between; + height: 90rpx; + font-size: 36rpx; +} + +.container .commit button { + width: 210rpx; + text-align: center; + line-height: 90rpx; + height: 100%; + border-radius: 8rpx; + padding: 0; +} + +.container .type5 button { + width: 330rpx; +} + +.container .commit .meeting-btn { + color: #fff; + background-color: #40ADFF; +} + +.container .commit .meeting-reset { + color: #40ADFF; + background-color: #fff; + border: 1px solid #40ADFF; +} + +.container .sig-pop-wrapper { + padding: 0 30rpx; +} + +.container .sig-pop-wrapper .title { + margin: 30rpx 0 40rpx 0; + color: #222; + font-size: 36rpx; +} + +.container .sig-pop-wrapper .item .radio { + flex-direction: row-reverse; + justify-content: space-between; +} + +.container .sig-pop-wrapper .item .name { + font-size: 34rpx; + color: #6d7278; + width: 600rpx; +} + +.container .sig-pop-wrapper .item { + height: 108rpx; + display: flex; + align-items: center; + border-bottom: 1px solid #f0f3f7; +} + +.container .sig-pop-wrapper .item:last-child { + border: none; +} + +.container .sig-pop-wrapper .btn-wrapper { + display: flex; + align-items: center; + justify-content: space-between; + height: 90rpx; + font-size: 36rpx; + margin: 60rpx 0; +} + +.container .sig-pop-wrapper .btn-wrapper .confirm { + height: 100%; + width: 320rpx; + text-align: center; + line-height: 90rpx; + color: #fff; + background-color: #40ADFF; +} + +.container .sig-pop-wrapper .btn-wrapper .cancel { + height: 100%; + width: 320rpx; + text-align: center; + line-height: 90rpx; + color: #40ADFF; + background-color: #fff; + border: 1px solid #40ADFF; +} + +.container .form .schedule { + margin-top: 20rpx; +} + +.container .form .schedule .form-item { + padding: 0 60rpx !important; +} + +.container .form .schedule .form-item .label { + font-size: 30rpx; + color: #6d7278; +} + +.container .form .schedule .header { + display: flex; + justify-content: space-between; + margin-top: 30rpx; +} + +.container .form .schedule .header .left .icon { + padding: 0 12rpx; + height: 26rpx; + background-color: #3265e8; + color: #fff; + border-radius: 0 26rpx 26rpx 0; + margin-right: 20rpx; + font-size: 25rpx; +} + +.container .form .schedule .header .left .title { + font-size: 34rpx; + line-height: 48rpx; + color: #333; +} + +.container .form .schedule .header .del-btn { + margin-right: 34rpx; +} + +.container .form .schedule .header .del-btn image { + height: 40rpx; + width: 40rpx; +} + +.container .form .add-shedule { + height: 108rpx; + line-height: 108rpx; + text-align: center; + border: 2rpx dashed #979797; + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; + color: #979797; + background-color: #fff; + margin-top: 20rpx; +} + +.container .form .topic { + margin-top: 20rpx; + padding: 30rpx; + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; + background-color: #fff; + font-size: 34rpx; + color: #333; +} + +.container .form .topic .header { + margin-bottom: 30rpx; +} + +.container .form .topic .img-wrapper { + margin-bottom: 30rpx; + display: flex; + justify-content: space-between; +} + +.container .form .topic .mb0 { + margin-bottom: 0; +} + +.container .form .topic .img-wrapper view { + width: 300rpx; + height: 150rpx; + border-radius: 8rpx; + overflow: hidden; + position: relative; +} + +.container .form .topic .img-wrapper view .sel { + position: absolute; + top: 14rpx; + left: 14rpx; + width: 40rpx; + height: 40rpx; +} + +.container .form .topic .img-wrapper view .img { + width: 300rpx; + height: 150rpx; +} + +.container .relative { + position: relative; +} + +.container .mask { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: #000; + opacity: 0.2; + z-index: 1000; +} \ No newline at end of file diff --git a/src/mindspore/package-events/publish/success.js b/src/mindspore/package-events/publish/success.js new file mode 100644 index 0000000000000000000000000000000000000000..1af62b2427fb5a761903a47d46750bf533e8a093 --- /dev/null +++ b/src/mindspore/package-events/publish/success.js @@ -0,0 +1,42 @@ +// package-events/publish/success.js +Page({ + /** + * 页面的初始数据 + */ + data: { + type: 1, + typeCn: '', + typeDesc: '', + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + if (options.type == 1) { + this.setData({ + type: 1, + typeCn: '保存', + typeDesc: '您可以在“我的 > 我的活动 > 草稿箱”查看此活动并继续修改内容', + }); + } else if (options.type == 2) { + this.setData({ + type: 2, + typeCn: '申请', + typeDesc: + '审核通过后您的活动将在openEuler官网和小程序上发布,请耐心等待,您可以在“我的 > 我的活动 > 发布中”查看此活动', + }); + } else if (options.type == 3) { + this.setData({ + type: 2, + typeCn: '修改', + typeDesc: '您可以在“我的 > 我的活动 > 已发布”查看此活动并继续修改日程', + }); + } + }, + toList() { + wx.switchTab({ + url: '/pages/events/events', + }); + }, +}); diff --git a/src/mindspore/package-events/publish/success.json b/src/mindspore/package-events/publish/success.json new file mode 100644 index 0000000000000000000000000000000000000000..ccbd3b3b5f94e240313352ce1e11dfb76acc0336 --- /dev/null +++ b/src/mindspore/package-events/publish/success.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "活动申请" +} \ No newline at end of file diff --git a/src/mindspore/package-events/publish/success.wxml b/src/mindspore/package-events/publish/success.wxml new file mode 100644 index 0000000000000000000000000000000000000000..b782d27bb424cb6203e8967093d688c46a8ad291 --- /dev/null +++ b/src/mindspore/package-events/publish/success.wxml @@ -0,0 +1,9 @@ + + + + + {{typeCn}}成功! + {{typeDesc}} + + + diff --git a/src/mindspore/package-events/publish/success.wxss b/src/mindspore/package-events/publish/success.wxss new file mode 100644 index 0000000000000000000000000000000000000000..5b75c4e2d79546346b71c10953937285ff9da340 --- /dev/null +++ b/src/mindspore/package-events/publish/success.wxss @@ -0,0 +1,46 @@ +/* package-events/publish/success.wxss */ +page { + background-color: #f5f7fa !important; +} + +.container { + height: 100%; + padding: 0 72rpx; +} + +.container .suc-wrapper { + margin-top: 423rpx; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.container .suc-wrapper image { + width: 234rpx; + height: 218rpx; +} + +.container .suc-wrapper text { + text-align: center; + margin-top: 20rpx; + font-size: 34rpx; + color: #333; +} + +.container .suc-wrapper text:last-child { + font-size: 28rpx; + color: #6d7278; +} + +.container button { + margin-top: 186rpx; + width: 500rpx; + height: 90rpx; + line-height: 90rpx; + text-align: center; + font-size: 36rpx; + color: #fff; + background-color: #40ADFF; + border-radius: 8rpx; +} \ No newline at end of file diff --git a/src/mindspore/package-events/sign-up/sign-up-success.js b/src/mindspore/package-events/sign-up/sign-up-success.js new file mode 100644 index 0000000000000000000000000000000000000000..5e390468ee6b918f3c147a6485b96c9d396d1aaa --- /dev/null +++ b/src/mindspore/package-events/sign-up/sign-up-success.js @@ -0,0 +1,69 @@ +// package-events/sign-up/sign-up-success.js +const { wxml, style } = require('./wxml-to-canvas.js'); +let that = null; +Page({ + /** + * 页面的初始数据 + */ + data: { + poster: 1, + title: '', + name: '', + tel: '', + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + that = this; + this.widget = this.selectComponent('.widget'); + this.setData({ + poster: decodeURIComponent(options.poster), + title: decodeURIComponent(options.title), + name: decodeURIComponent(options.name), + tel: decodeURIComponent(options.tel), + }); + }, + saveToAlbum() { + wx.showLoading({ + title: '保存中', + mask: true, + }); + const p1 = this.widget.renderToCanvas({ + wxml: wxml({ + title: that.data.title, + name: that.data.name, + tel: that.data.tel, + poster: that.data.poster, + }), + style: style(), + }); + p1.then(() => { + const p2 = this.widget.canvasToTempFilePath(); + p2.then((res) => { + wx.getSetting({ + success() { + wx.saveImageToPhotosAlbum({ + filePath: res.tempFilePath, + success: function () { + wx.showToast({ + title: '保存成功', + icon: 'success', + duration: 2000, + }); + }, + fail: function (err) { + console.log(err); + }, + complete(res) { + wx.hideLoading(); + console.log(res); + }, + }); + }, + }); + }); + }); + }, +}); diff --git a/src/mindspore/package-events/sign-up/sign-up-success.json b/src/mindspore/package-events/sign-up/sign-up-success.json new file mode 100644 index 0000000000000000000000000000000000000000..c30d35786814f385ca77a5a958e102705a38abd4 --- /dev/null +++ b/src/mindspore/package-events/sign-up/sign-up-success.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "活动报名" +} \ No newline at end of file diff --git a/src/mindspore/package-events/sign-up/sign-up-success.wxml b/src/mindspore/package-events/sign-up/sign-up-success.wxml new file mode 100644 index 0000000000000000000000000000000000000000..3369d45b3657479a7000b0eae88159c477a4a1b2 --- /dev/null +++ b/src/mindspore/package-events/sign-up/sign-up-success.wxml @@ -0,0 +1,15 @@ + + + + openEuler + 报名成功! + {{title}} + 您的参会凭证 + 姓名: {{name}} + 手机: {{tel}} + + + + + + diff --git a/src/mindspore/package-events/sign-up/sign-up-success.wxss b/src/mindspore/package-events/sign-up/sign-up-success.wxss new file mode 100644 index 0000000000000000000000000000000000000000..d782b343f5c7359be2313a16d5c1448967e3ed64 --- /dev/null +++ b/src/mindspore/package-events/sign-up/sign-up-success.wxss @@ -0,0 +1,85 @@ +/* package-events/sign-up/sign-up-success.wxss */ +.container { + height: 1502rpx; + background-size: 100% 100% !important; + display: flex; + flex-direction: column; + align-items: center; + overflow: hidden; +} + +.bg1 { + background: url(https://openeuler-website.obs.ap-southeast-1.myhuaweicloud.com/sign-up/bg1.png) no-repeat; +} + +.bg2 { + background: url(https://openeuler-website.obs.ap-southeast-1.myhuaweicloud.com/sign-up/bg2.png) no-repeat; +} + +.bg3 { + background: url(https://openeuler-website.obs.ap-southeast-1.myhuaweicloud.com/sign-up/bg3.png) no-repeat; +} + +.bg4 { + background: url(https://openeuler-website.obs.ap-southeast-1.myhuaweicloud.com/sign-up/bg4.png) no-repeat; +} + +.container .avatar { + margin-top: 188rpx; + width: 128rpx; + height: 128rpx; + border-radius: 100%; +} + +.container .open-euler { + margin-top: 20rpx; + color: #333; + font-size: 34rpx; + line-height: 48rpx; +} + +.container .success-text { + color: #333; + font-size: 40rpx; + margin-top: 60rpx; + font-weight: 500; +} + +.container .title { + color: #40ADFF; + font-size: 34rpx; + margin-top: 30rpx; +} + +.container .voucher { + color: #333; + font-size: 34rpx; + margin-top: 30rpx; +} + +.container .name { + margin-top: 128rpx; + font-size: 34rpx; + color: #40ADFF; +} + +.container .tel { + margin-top: 30rpx; + font-size: 34rpx; + color: #40ADFF; +} + +.container button { + margin-top: 128rpx; + width: 500rpx; + height: 90rpx; + line-height: 90rpx; + border-radius: 8rpx; + background-color: #40ADFF; + text-align: center; + color: #fff; +} +.canvas { + height: 0; + overflow: hidden; +} \ No newline at end of file diff --git a/src/mindspore/package-events/sign-up/sign-up.js b/src/mindspore/package-events/sign-up/sign-up.js new file mode 100644 index 0000000000000000000000000000000000000000..3872e6d8b81360330e18565b98bdc4d34d15a7c9 --- /dev/null +++ b/src/mindspore/package-events/sign-up/sign-up.js @@ -0,0 +1,163 @@ +// package-events/sign-up/sign-up.js +const appAjax = require('./../../utils/app-ajax'); +const sessionUtil = require('../../utils/app-session.js'); +const validationConfig = require('./../../config/field-validate-rules'); + +let that = null; + +let remoteMethods = { + getUserInfo: function (_callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'GET', + service: 'APPLICANT_INFO', + otherParams: { + id: sessionUtil.getUserInfoByKey('userId'), + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, + signUp: function (postData, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'POST', + data: postData, + service: 'SAVE_SIGNUP_INFO', + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, +}; + +let localMethods = { + validation() { + if (!that.data.name) { + this.toast('请输入您的姓名'); + return; + } + if (!validationConfig.phone.regex.test(that.data.tel)) { + this.toast('请输入正确的手机号码'); + return; + } + if (!validationConfig.email.regex.test(that.data.mail)) { + this.toast('请输入正确的邮箱地址'); + return; + } + if (!that.data.enterprise) { + this.toast('请输入您的工作单位名称'); + return; + } + return true; + }, + toast(msg) { + wx.showToast({ + title: msg, + icon: 'none', + duration: 2000, + }); + }, +}; + +Page({ + /** + * 页面的初始数据 + */ + data: { + name: '', + tel: '', + mail: '', + enterprise: '', + occupation: '', + gitee: '', + id: '', + eventTitle: '', + poster: 1, + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + that = this; + this.setData({ + id: options.id, + eventTitle: options.title, + poster: options.poster, + }); + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + remoteMethods.getUserInfo((res) => { + this.setData({ + name: res.name || '', + tel: res.telephone || '', + mail: res.email || '', + enterprise: res.company || '', + occupation: res.profession || '', + gitee: res.gitee_name || '', + }); + }); + }, + nameInput(e) { + this.setData({ + name: e.detail.value, + }); + }, + telInput(e) { + this.setData({ + tel: e.detail.value, + }); + }, + mailInput(e) { + this.setData({ + mail: e.detail.value, + }); + }, + enterpriseInput(e) { + this.setData({ + enterprise: e.detail.value, + }); + }, + occupationInput(e) { + this.setData({ + occupation: e.detail.value, + }); + }, + giteeInput(e) { + this.setData({ + gitee: e.detail.value, + }); + }, + signUp() { + if (!localMethods.validation()) { + return; + } + const postData = { + company: this.data.enterprise, + email: this.data.mail, + gitee_name: this.data.gitee, + name: this.data.name, + profession: this.data.occupation, + telephone: this.data.tel, + activity: this.data.id, + }; + remoteMethods.signUp(postData, () => { + wx.redirectTo({ + url: `/package-events/sign-up/sign-up-success?name=${encodeURIComponent( + this.data.name + )}&title=${encodeURIComponent(this.data.eventTitle)}&tel=${encodeURIComponent( + this.data.tel + )}&poster=${encodeURIComponent(this.data.poster)}`, + }); + }); + }, + back() { + wx.navigateBack(); + }, +}); diff --git a/src/mindspore/package-events/sign-up/sign-up.json b/src/mindspore/package-events/sign-up/sign-up.json new file mode 100644 index 0000000000000000000000000000000000000000..17a91848596dc0ff6ccd9f665b9ee41737d37bec --- /dev/null +++ b/src/mindspore/package-events/sign-up/sign-up.json @@ -0,0 +1,6 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "活动报名", + "navigationBarBackgroundColor": "#40ADFF", + "navigationBarTextStyle": "white" +} \ No newline at end of file diff --git a/src/mindspore/package-events/sign-up/sign-up.wxml b/src/mindspore/package-events/sign-up/sign-up.wxml new file mode 100644 index 0000000000000000000000000000000000000000..91d185ebcdc797f3dac5dba9e7a127043106ce82 --- /dev/null +++ b/src/mindspore/package-events/sign-up/sign-up.wxml @@ -0,0 +1,21 @@ + + + + + + + + + + + + * + 号为必填项 + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/package-events/sign-up/sign-up.wxss b/src/mindspore/package-events/sign-up/sign-up.wxss new file mode 100644 index 0000000000000000000000000000000000000000..11bc23d832daf5f0904b01625a6c1016eb683549 --- /dev/null +++ b/src/mindspore/package-events/sign-up/sign-up.wxss @@ -0,0 +1,100 @@ +/* package-events/sign-up/sign-up.wxss */ +page { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHwAAAAeCAYAAADuInrvAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACdSURBVGhD7dbBDYAwDAPAbsTYjFnEDn5YyT34WinWpT3nea9v0T9Q9qKyf9wKV7gVP/maI5xwwglfpkDhCh9z9Y05yGSVybMpfNn2UrjCvdKTK7Qti3DCCW9TmZyHcMIJT4pqyyKccMLbVCbnIZxwwpOi2rIIJ5zwNpXJeQgnnPCkqLYswgknvE1lch7CCSc8Kaoti3DCCW9TGZznA1f9oK8GgBpHAAAAAElFTkSuQmCC) no-repeat; + background-size: 100% 108rpx; + background-color: #f5f7fa !important; + padding: 0 30rpx; +} + +.container { + padding: 30rpx 0 129rpx 0; +} + +input { + flex: 1; +} + +.require { + color: #f76270; +} + +.placeholder { + color: #c7cad0; +} + +.container .form .form-item { + padding: 0 30rpx; + background-color: #fff; + height: 108rpx; + color: #333; + font-size: 28rpx; + display: flex; + align-items: center; + justify-content: start; + border-bottom: 2rpx solid #f0f3f7; +} + +.container .form > .form-item { + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; +} + +.container .form .form-wrapper { + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; + background-color: #fff; + overflow: hidden; +} + +.container .form .form-item .label { + margin-right: 40rpx; + font-size: 34rpx; +} + +.container .form .form-item input { + color: #6d7278; +} + +.container .info { + font-size: 29rpx; + color: #6d7278; + margin-bottom: 60rpx; +} + +.container .info view { + margin: 30rpx 0; +} + +.container .info view image { + width: 28rpx; + height: 28rpx; + margin-right: 15rpx; + vertical-align: middle; +} + +.container .commit { + display: flex; + justify-content: space-between; + height: 90rpx; + font-size: 36rpx; +} + +.container .commit button { + width: 330rpx; + text-align: center; + line-height: 90rpx; + height: 100%; + border-radius: 8rpx; + padding: 0; +} + +.container .commit .meeting-btn { + color: #fff; + background-color: #40ADFF; +} + +.container .commit .meeting-reset { + color: #40ADFF; + background-color: #fff; + border: 1px solid #40ADFF; +} \ No newline at end of file diff --git a/src/mindspore/package-events/sign-up/wxml-to-canvas.js b/src/mindspore/package-events/sign-up/wxml-to-canvas.js new file mode 100644 index 0000000000000000000000000000000000000000..a5cdb3ac7394a38cd0f0a6abaf23bbd96efb723e --- /dev/null +++ b/src/mindspore/package-events/sign-up/wxml-to-canvas.js @@ -0,0 +1,100 @@ +const wxml = (data) => { + return ` + + + + + openEuler + 报名成功! + ${data.title} + 您的参会凭证 + 姓名: ${data.name} + 手机: ${data.tel} + + + `; +}; + +const style = () => { + return { + container: { + width: 375, + height: 750, + flexDirection: 'column', + alignItems: 'center', + }, + absolute: { + width: 375, + height: 750, + flexDirection: 'column', + alignItems: 'center', + }, + avatar: { + marginTop: 110, + width: 64, + height: 64, + }, + openEuler: { + marginTop: 10, + color: '#333333', + fontSize: 17, + lineHeight: 24, + height: 24, + width: 100, + textAlign: 'center', + }, + successText: { + color: '#333333', + fontSize: 20, + marginTop: 30, + fontWeight: 500, + height: 28, + width: 100, + textAlign: 'center', + }, + title: { + color: '#40ADFF', + fontSize: 17, + marginTop: 15, + height: 25, + width: 300, + textAlign: 'center', + }, + voucher: { + color: '#333333', + fontSize: 17, + marginTop: 15, + height: 25, + width: 300, + textAlign: 'center', + }, + name: { + marginTop: 64, + fontSize: 17, + color: '#40ADFF', + height: 25, + width: 300, + textAlign: 'center', + }, + tel: { + marginTop: 15, + fontSize: 17, + color: '#40ADFF', + height: 25, + width: 350, + textAlign: 'center', + }, + bgImg: { + position: 'absolute', + width: 375, + height: 750, + top: 0, + left: 0, + }, + }; +}; + +module.exports = { + wxml, + style, +}; diff --git a/src/mindspore/package-meeting/meeting/detail.js b/src/mindspore/package-meeting/meeting/detail.js new file mode 100644 index 0000000000000000000000000000000000000000..6d6b8abe860ae5efec3437068e276bfaad2792c9 --- /dev/null +++ b/src/mindspore/package-meeting/meeting/detail.js @@ -0,0 +1,64 @@ +// pages/meeting/detail.js +var appAjax = require('./../../utils/app-ajax'); +let remoteMethods = { + getMeetingDetail: function (id, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'GET', + service: 'GET_MEETING_DETAIL', + otherParams: { + id: id, + }, + headers: { + Authorization: '', + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, +}; +Page({ + /** + * 页面的初始数据 + */ + data: { + id: '', + info: {}, + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + id: options.id, + }); + }, + copy: function (e) { + wx.setClipboardData({ + data: e.currentTarget.dataset.copy, + success: function () {}, + }); + }, + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + let that = this; + remoteMethods.getMeetingDetail(this.data.id, function (data) { + if (data) { + that.setData({ + info: data, + }); + } + }); + }, + + onShareAppMessage: function () { + return { + title: '会议详情', + path: `/package-meeting/meeting/detail?id=${this.data.id}`, + }; + }, +}); diff --git a/src/mindspore/package-meeting/meeting/detail.json b/src/mindspore/package-meeting/meeting/detail.json new file mode 100644 index 0000000000000000000000000000000000000000..c8c6dfa5682a33b401763cefa0628f3daad56054 --- /dev/null +++ b/src/mindspore/package-meeting/meeting/detail.json @@ -0,0 +1,5 @@ +{ + "navigationBarTitleText": "会议详情", + "navigationBarBackgroundColor": "#40ADFF", + "navigationBarTextStyle": "white" +} \ No newline at end of file diff --git a/src/mindspore/package-meeting/meeting/detail.wxml b/src/mindspore/package-meeting/meeting/detail.wxml new file mode 100644 index 0000000000000000000000000000000000000000..99f9d68a60f3108e4e59ffce1eebaaefa3c3e45e --- /dev/null +++ b/src/mindspore/package-meeting/meeting/detail.wxml @@ -0,0 +1,67 @@ + + + + {{info.topic}} + + + {{info.date}} {{info.start}}-{{info.end}} + + + + + {{info.group_name}} + + + + {{info.agenda}} + + + + Etherpad链接 + + + {{info.etherpad}} + + + + + + + 腾讯会议 + + + ID: {{info.mid}} + + + + {{info.join_url}} + + + + + + + + 录屏上传链接 + + + {{info.video_url}} + + + + + + + 回放链接 + + + {{info.replay_url}} + + + + + + \ No newline at end of file diff --git a/src/mindspore/package-meeting/meeting/detail.wxss b/src/mindspore/package-meeting/meeting/detail.wxss new file mode 100644 index 0000000000000000000000000000000000000000..4e52a710605f4a34649472df4a14e693107ef91c --- /dev/null +++ b/src/mindspore/package-meeting/meeting/detail.wxss @@ -0,0 +1,63 @@ +/* pages/meeting/detail.wxss */ +page { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXgAAAIpCAYAAACopyNpAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAfUSURBVHhe7dRBCsJAAATBvCxPVj9oVpSACQQ8yjZ1qNvMtZd1XcfyGADUCDxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxA1O/Ab193AP7u2OXLbu/Ogd/PAMzpGP1P4K9GAMxN4AGirgP/HMsNgGm8u33q+DZeDYPa4Bg1fEcAAAAASUVORK5CYII=) no-repeat; + background-size: 100% 108rpx; + background-color: #f5f7fa !important; +} + +.container { + padding-top: 20rpx; +} + +.container .detail-item { + background-color: #fff; + margin-bottom: 20rpx; + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; + padding: 30rpx; + color: #6d7278; + font-size: 32rpx; + font-weight: 400; +} + +.container .detail-item .name { + font-size: 36rpx; + color: #333; + font-weight: 400; + line-height: 50rpx; + margin-top: 0; +} + +.container .detail-item view { + margin-top: 20rpx; + line-height: 45rpx; +} + +.container .detail-item view image { + vertical-align: middle; + width: 30rpx; + height: 30rpx; + margin-right: 22rpx; +} + +.container .detail-item view text { + text-align: justify; + word-wrap: break-word; + word-break: break-all; + vertical-align: middle; +} + +.container .detail-item .btn-wraper { + display: flex; + justify-content: space-around; +} + +.container .detail-item .btn-wraper button { + height: 78rpx; + width: 220rpx; + border: 1px solid #40ADFF; + border-radius: 20rpx; + color: #40ADFF; + text-align: center; + line-height: 78rpx; +} \ No newline at end of file diff --git a/src/mindspore/package-meeting/meeting/meeting-list.js b/src/mindspore/package-meeting/meeting/meeting-list.js new file mode 100644 index 0000000000000000000000000000000000000000..51e1beda4954152ac25ac53284e89bfc8a6f7083 --- /dev/null +++ b/src/mindspore/package-meeting/meeting/meeting-list.js @@ -0,0 +1,36 @@ +// package-meeting/meeting/meeting-list.js +Page({ + /** + * 页面的初始数据 + */ + data: { + meetingConponent: null, + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function () { + this.setData({ + meetingConponent: this.selectComponent('#meeting'), + }); + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + wx.stopPullDownRefresh(); + this.data.meetingConponent.initData(); + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () {}, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () {}, +}); diff --git a/src/mindspore/package-meeting/meeting/meeting-list.json b/src/mindspore/package-meeting/meeting/meeting-list.json new file mode 100644 index 0000000000000000000000000000000000000000..0e527bcf47c044c00fc719e213b6ff6953795495 --- /dev/null +++ b/src/mindspore/package-meeting/meeting/meeting-list.json @@ -0,0 +1,9 @@ +{ + "usingComponents": { + "meeting-list": "/components/meeting-list/meeting-list" + }, + "navigationBarTitleText": "会议列表", + "enablePullDownRefresh": true, + "backgroundTextStyle": "dark", + "backgroundColor": "#fff" +} \ No newline at end of file diff --git a/src/mindspore/package-meeting/meeting/meeting-list.wxml b/src/mindspore/package-meeting/meeting/meeting-list.wxml new file mode 100644 index 0000000000000000000000000000000000000000..e0c3a559f5e10222b106f813f9bb56ac8cd3d56a --- /dev/null +++ b/src/mindspore/package-meeting/meeting/meeting-list.wxml @@ -0,0 +1,4 @@ + + + + diff --git a/src/mindspore/package-meeting/meeting/meeting-list.wxss b/src/mindspore/package-meeting/meeting/meeting-list.wxss new file mode 100644 index 0000000000000000000000000000000000000000..01ca2cb0e92c74fc9d1a37937405d5615ebf3eab --- /dev/null +++ b/src/mindspore/package-meeting/meeting/meeting-list.wxss @@ -0,0 +1,4 @@ +/* package-meeting/meeting/meeting-list.wxss */ +page { + background-color: #f5f7fa !important; +} \ No newline at end of file diff --git a/src/mindspore/package-meeting/meeting/meeting-success.js b/src/mindspore/package-meeting/meeting/meeting-success.js new file mode 100644 index 0000000000000000000000000000000000000000..88b244660f7b8f02e4de3a0c0c99c1e9341ae9ce --- /dev/null +++ b/src/mindspore/package-meeting/meeting/meeting-success.js @@ -0,0 +1,49 @@ +// pages/meeting/meeting-success.js +Page({ + /** + * 页面的初始数据 + */ + data: { + id: '', + imageUrl: '', + msgText: [], + btnText: '', + isHome: '', + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + id: options.id ? options.id : '', + msgText: options.delete ? ['删除成功!', '您已成功删除会议'] : ['预定成功', '您已成功预定会议'], + btnText: options.delete ? '查看会议列表' : '查看此会议', + imageUrl: options.delete ? '/static/sig/del-success.png' : '/static/sig/add-success.png', + isHome: options.ishome ? options.ishome : '', + }); + wx.setNavigationBarTitle({ + title: options.delete ? '会议列表' : '预定会议', + }); + }, + toDetail: function () { + if (this.data.id) { + wx.redirectTo({ + url: '/package-meeting/meeting/detail?id=' + this.data.id, + }); + } else { + if (this.data.isHome === 'true') { + wx.switchTab({ + url: '/pages/index/index', + }); + } else { + wx.navigateBack(); + } + } + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () {}, +}); diff --git a/src/mindspore/package-meeting/meeting/meeting-success.json b/src/mindspore/package-meeting/meeting/meeting-success.json new file mode 100644 index 0000000000000000000000000000000000000000..8835af0699ccec004cbe685ef938cd2d63ea7037 --- /dev/null +++ b/src/mindspore/package-meeting/meeting/meeting-success.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/src/mindspore/package-meeting/meeting/meeting-success.wxml b/src/mindspore/package-meeting/meeting/meeting-success.wxml new file mode 100644 index 0000000000000000000000000000000000000000..ddc7901aa28179a32b832fd8d756ae35a00acda6 --- /dev/null +++ b/src/mindspore/package-meeting/meeting/meeting-success.wxml @@ -0,0 +1,11 @@ + + + + + + {{msgText[0]}} + {{msgText[1]}} + + + + \ No newline at end of file diff --git a/src/mindspore/package-meeting/meeting/meeting-success.wxss b/src/mindspore/package-meeting/meeting/meeting-success.wxss new file mode 100644 index 0000000000000000000000000000000000000000..e7792412e3d9db15de7379c3c708492337f9425b --- /dev/null +++ b/src/mindspore/package-meeting/meeting/meeting-success.wxss @@ -0,0 +1,49 @@ +/* pages/meeting/meeting-success.wxss */ +.container { + height: 100%; + position: relative; + display: flex; + justify-content: center; + align-items: center; +} + +.container .content .suc-wrapper image{ + width: 346rpx; + height: 267rpx; + display: block; + margin: 0 auto; +} + +.container .content .suc-wrapper .reserve { + width: 316rpx; + height: 269rpx; +} + +.container .content .suc-wrapper text { + font-size: 28rpx; + font-weight: 400; + color: #6D7278; + line-height: 38rpx; + display: block; + text-align: center; +} + +.container .content .suc-wrapper text:first-of-type { + margin: 42rpx 0 20rpx 0; + font-size: 34rpx; + color: #333333; + line-height: 48rpx; +} + +.container .content button { + width: 500rpx; + height: 90rpx; + line-height: 90rpx; + text-align: center; + font-weight: 400; + font-size: 36rpx; + color: #fff; + background: #40ADFF; + border-radius: 20px; + margin-top: 128rpx; +} diff --git a/src/mindspore/package-meeting/reserve/reserve.js b/src/mindspore/package-meeting/reserve/reserve.js new file mode 100644 index 0000000000000000000000000000000000000000..7d0493b8ecdd56c22fe20032b3267d3977f8f88b --- /dev/null +++ b/src/mindspore/package-meeting/reserve/reserve.js @@ -0,0 +1,420 @@ +// pages/reserve/reserve.js +var appAjax = require('./../../utils/app-ajax'); +var appSession = require('./../../utils/app-session.js'); +var utils = require('./../../utils/utils.js'); +utils.formateDate(); +let remoteMethods = { + getUserGroup: function (id, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'GET', + service: 'GET_USER_GROUP', + otherParams: { + id: id, + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, + saveMeeting: function (postData, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'POST', + service: 'SAVE_MEETING', + data: postData, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, +}; +let localMethods = { + validation: function (that) { + if (!that.data.topic) { + this.toast('请输入会议名称'); + return; + } + if (!that.data.sponsor) { + this.toast('请联系管理员编辑您的gitee name'); + return; + } + if (!that.data.typeResult) { + this.toast('请选择会议类型'); + return; + } + if (that.data.meeting_type == 1 && !that.data.sigResult) { + this.toast('请选择所在SIG'); + return; + } + if (!that.data.date) { + this.toast('请选择日期'); + return; + } + if (!that.data.start) { + this.toast('请选择开始时间'); + return; + } + if (!that.data.end) { + this.toast('请选择结束时间'); + return; + } + if ( + that.data.start.split(':')[0] > that.data.end.split(':')[0] || + (that.data.start.split(':')[0] == that.data.end.split(':')[0] && + that.data.start.split(':')[1] >= that.data.end.split(':')[1]) + ) { + this.toast('开始时间必须小于结束时间'); + return; + } + return true; + }, + toast: function (msg) { + wx.showToast({ + title: msg, + icon: 'none', + duration: 2000, + }); + }, +}; +Page({ + /** + * 页面的初始数据 + */ + data: { + record: false, + topic: '', + sponsor: '', + date: '', + start: '', + end: '', + etherpad: '', + agenda: '', + emaillist: '', + sigPopShow: false, + typeResult: '', + group_name: '', + meeting_type: 1, + sigResult: '', + sigList: [], + datePopShow: false, + curDate: new Date().getTime(), + currentDate: new Date().getTime(), + minDate: new Date().getTime(), + timePopShow: false, + currentTime: '08:00', + minTime: 8, + maxTime: 22, + endTimePopShow: false, + currentEndTime: '08:00', + minEndTime: 8, + maxEndTime: 22, + showDialogWarn: false, + isSig: false, + showMeetType: false, + allData: [], + typeList: [], + filter(type, options) { + if (type === 'minute') { + return options.filter((option) => option % 15 === 0); + } + + return options; + }, + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function () {}, + recordoOnChange: function (event) { + this.setData({ + record: event.detail, + }); + }, + reset: function () { + this.setData({ + topic: '', + typeResult: '', + sigResult: '', + date: '', + start: '', + end: '', + etherpad: '', + agenda: '', + emaillist: '', + record: '', + }); + }, + meeting: function () { + if (!localMethods.validation(this)) { + return; + } + let that = this; + wx.requestSubscribeMessage({ + tmplIds: ['tK51rqE72oFo5e5ajCnvkPwnsCncfydgcV1jb9ed6Qc'], + success() {}, + complete() { + remoteMethods.saveMeeting( + { + topic: that.data.topic, + sponsor: that.data.sponsor, + group_name: that.data.group_name, + date: that.data.date, + start: that.data.start, + end: that.data.end, + etherpad: that.data.etherpad, + meeting_type: that.data.meeting_type, + emaillist: that.data.emaillist, + record: that.data.record ? 'cloud' : '', + agenda: that.data.agenda, + }, + function (data) { + if (data.id) { + wx.redirectTo({ + url: '/package-meeting/meeting/meeting-success?id=' + data.id, + }); + } else { + setTimeout(function () { + wx.showToast( + { + title: data.message, + icon: 'none', + duration: 2000, + }, + 100 + ); + }); + } + } + ); + }, + }); + }, + sigNameInput: function (e) { + this.setData({ + topic: e.detail.value, + }); + }, + etherInput: function (e) { + this.setData({ + etherpad: e.detail.value, + }); + }, + agendaInput: function (e) { + this.setData({ + agenda: e.detail.value, + }); + }, + emailInput: function (e) { + this.setData({ + emaillist: e.detail.value, + }); + }, + sigConfirm: function () { + this.data.allData.forEach((item) => { + if (item.group_name == this.data.sigResult) { + this.setData({ + etherpad: item.etherpad, + sigPopShow: false, + group_name: item.group_name, + }); + } + }); + }, + typeConfirm: function () { + if (this.data.typeResult.includes('SIG')) { + this.setData({ + isSig: true, + showMeetType: false, + meeting_type: 1, + }); + } else { + this.setData({ + showMeetType: false, + isSig: false, + }); + this.data.allData.forEach((item) => { + if (item.group_type != 1) { + if (this.data.typeResult.includes('MSG') && item.group_name == 'MSG') { + this.setData({ + etherpad: item.etherpad, + group_name: 'MSG', + meeting_type: 2, + }); + } else { + this.setData({ + etherpad: item.etherpad, + group_name: 'Tech', + meeting_type: 3, + }); + } + } + }); + } + }, + dateConfirm: function () { + this.setData({ + date: new Date(this.data.currentDate).Format('yyyy-MM-dd'), + datePopShow: false, + }); + }, + timeConfirm: function () { + this.setData({ + start: this.data.currentTime, + timePopShow: false, + }); + }, + endTimeConfirm: function () { + this.setData({ + end: this.data.currentEndTime, + endTimePopShow: false, + }); + }, + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + this.setData({ + sponsor: appSession.getUserInfoByKey('gitee') || '', + }); + let that = this; + remoteMethods.getUserGroup(appSession.getUserInfoByKey('userId'), function (data) { + if (data && data.length) { + that.setData({ + allData: data, + }); + let temp = []; + let sigValue = ''; + let typeTemp = []; + data.forEach((item) => { + if (item.group_type == '1') { + temp.push(item.group_name); + sigValue = item.description; + } else { + typeTemp.push(item.description); + } + }); + if (sigValue) { + typeTemp.push(sigValue); + } + that.setData({ + sigList: temp, + typeList: typeTemp, + }); + if (that.data.typeList[0].includes('SIG')) { + that.setData({ + typeResult: that.data.typeList[0], + isSig: true, + }); + } else { + that.data.allData.forEach((item) => { + if (item.group_type != 1) { + if (item.group_name == 'MSG' && that.data.typeList[0].includes('MSG')) { + that.setData({ + typeResult: that.data.typeList[0], + etherpad: item.etherpad, + group_name: item.group_name, + meeting_type: item.group_type, + }); + } else if (item.group_name == 'Tech' && that.data.typeList[0].includes('专家')) { + that.setData({ + typeResult: that.data.typeList[0], + etherpad: item.etherpad, + group_name: item.group_name, + meeting_type: item.group_type, + }); + } + } + }); + } + } + }); + }, + typeRadioOnChange: function (e) { + this.setData({ + typeResult: e.detail, + }); + }, + sigRadioOnChange: function (e) { + this.setData({ + sigResult: e.detail, + }); + }, + selType: function () { + this.setData({ + showMeetType: true, + }); + }, + selSig: function () { + if (!this.data.sigList.length) { + this.setData({ + showDialogWarn: true, + }); + return; + } + this.setData({ + sigPopShow: true, + }); + }, + warnCancel: function () { + this.setData({ + showDialogWarn: false, + }); + }, + sigCancel: function () { + this.setData({ + sigPopShow: false, + }); + }, + typeCancel: function () { + this.setData({ + showMeetType: false, + }); + }, + selDate: function () { + this.setData({ + datePopShow: true, + }); + }, + selTime: function () { + this.setData({ + timePopShow: true, + }); + }, + selEndTime: function () { + this.setData({ + endTimePopShow: true, + }); + }, + dateCancel: function () { + this.setData({ + datePopShow: false, + }); + }, + timeCancel: function () { + this.setData({ + timePopShow: false, + }); + }, + endTimeCancel: function () { + this.setData({ + endTimePopShow: false, + }); + }, + dateOnInput: function (e) { + this.setData({ + currentDate: e.detail, + }); + }, + timeOnInput: function (e) { + this.setData({ + currentTime: e.detail, + }); + }, + endTimeOnInput: function (e) { + this.setData({ + currentEndTime: e.detail, + }); + }, +}); diff --git a/src/mindspore/package-meeting/reserve/reserve.json b/src/mindspore/package-meeting/reserve/reserve.json new file mode 100644 index 0000000000000000000000000000000000000000..1e1496bde2ac8358a8fc7e542c270325a1db1be3 --- /dev/null +++ b/src/mindspore/package-meeting/reserve/reserve.json @@ -0,0 +1,6 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "预定会议", + "navigationBarBackgroundColor": "#40ADFF", + "navigationBarTextStyle": "white" +} \ No newline at end of file diff --git a/src/mindspore/package-meeting/reserve/reserve.wxml b/src/mindspore/package-meeting/reserve/reserve.wxml new file mode 100644 index 0000000000000000000000000000000000000000..cc2e80a4b86c65239b334048b2a7f3d6c1a74114 --- /dev/null +++ b/src/mindspore/package-meeting/reserve/reserve.wxml @@ -0,0 +1,179 @@ + + + + + + + + 会议名称 + * + + + + + 发起人 + + + + + 会议类型 + * + + + {{typeResult}} + + + + + + 选取所属SIG + * + + + {{sigResult}} + + + + + + 日期 + * + + + {{date}} + + + + + + 时间 + * + + + {{start||'请选择'}} + + {{end||'请选择'}} + + + + Etherpad链接 + + + + + 是否自动录制会议 + + + + + + + + + 勾选此项进入会议自动开启录屏,录制服务由Zoom提供,会后自动上传至B站mindspore的账号下 + + + + 会议内容 + + + + 邮件地址 + + + + + + + 多个邮箱地址用分号;隔开 + + + + + * + 号为必填项 + + + + + + + + + + 选择所属SIG + + + + + {{item}} + + + + + + + + + + + + + 选择会议类型 + + + + + {{item}} + + + + + + + + + + + + + 选择预定会议日期 + + + + + + + + + + 选择会议开始时间 + + + + + + + + + + 选择会议结束时间 + + + + + + + + + + 当前您不属于任何SIG组,请先在SIG管理中关联SIG组 + + + + + + + \ No newline at end of file diff --git a/src/mindspore/package-meeting/reserve/reserve.wxss b/src/mindspore/package-meeting/reserve/reserve.wxss new file mode 100644 index 0000000000000000000000000000000000000000..2d3eeb2ae176e4e1e717342bde1273e837010dd4 --- /dev/null +++ b/src/mindspore/package-meeting/reserve/reserve.wxss @@ -0,0 +1,242 @@ +/* pages/reserve/reserve.wxss */ +page { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXgAAAIpCAYAAACopyNpAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAfUSURBVHhe7dRBCsJAAATBvCxPVj9oVpSACQQ8yjZ1qNvMtZd1XcfyGADUCDxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxAlMADRAk8QJTAA0QJPECUwANECTxA1O/Ab193AP7u2OXLbu/Ogd/PAMzpGP1P4K9GAMxN4AGirgP/HMsNgGm8u33q+DZeDYPa4Bg1fEcAAAAASUVORK5CYII=) no-repeat; + background-size: 100% 108rpx; + background-color: #f5f7fa !important; + padding: 0 30rpx; +} + +.container { + padding: 30rpx 0 129rpx 0; +} + +textarea { + height: 45rpx; + flex: 1; +} + +input { + flex: 1; +} + +.require { + color: #f76270; +} + +.placeholder { + color: #c7cad0; +} + +.container .form .form-item { + padding: 0 30rpx; + background-color: #fff; + height: 108rpx; + color: #333; + font-size: 34rpx; + display: flex; + align-items: center; + justify-content: start; + border-bottom: 2rpx solid #f0f3f7; +} + +.container .form > .form-item { + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; +} + +.container .form .form-wrapper { + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; + background-color: #fff; + overflow: hidden; +} + +.container .form .form-item .arrow { + flex: 1; + display: flex; + justify-content: space-between; + align-items: center; +} + +.container .form .form-item .record { + justify-content: flex-end; +} + +.container .form .form-item .arrow .sel-data { + color: #6d7278; +} + +.container .form .form-item .sel-time { + flex: 1; + color: #333; + display: flex; + align-items: center; + justify-content: start; +} + +.container .form .form-item .sel-time .time { + color: #6d7278; + margin: 0 20rpx; + border: 1px solid #c7cad0; + background-color: #f0f3f7; + padding: 0 20rpx; + border-radius: 8rpx; +} + +.container .form .form-item .sel-time .start-time { + margin-left: 0; +} + +.container .form .form-item .label { + margin-right: 60rpx; +} + +.container .form .form-item input { + color: #6d7278; +} + +.container .form .form-item .etherpad { + display: block; + color: #6d7278; + overflow-x: scroll; + flex: 1; +} + +.container .form .form-item textarea { + color: #6d7278; +} + +.container .form .form-item image { + width: 30rpx; + height: 30rpx; +} + +.container .form .meeting-desc { + padding-top: 30rpx; + align-items: flex-start; + height: 244rpx; + margin-bottom: 20rpx; +} + +.container .form .meeting-desc textarea { + height: 184rpx; + position: relative; +} + +.container .form .meeting-desc textarea .hint { + position: absolute; + right: 0; + bottom: 0; + color: #c7cad0; + font-size: 28rpx; +} + +.container .info { + font-size: 29rpx; + color: #6d7278; + margin-bottom: 20rpx; +} + +.container .info view { + margin: 30rpx 0; +} + +.container .info view image { + width: 28rpx; + height: 28rpx; + margin-right: 15rpx; + vertical-align: middle; +} + +.container .commit { + display: flex; + justify-content: space-between; + height: 90rpx; + font-size: 36rpx; +} + +.container .commit button { + width: 320rpx; + text-align: center; + line-height: 90rpx; + height: 100%; + border-radius: 20rpx; +} + +.container .commit .meeting-btn { + color: #fff; + background-color: #40ADFF; +} + +.container .commit .meeting-reset { + color: #40ADFF; + background-color: #fff; + border: 1px solid #40ADFF; +} + +.container .sig-pop-wrapper { + padding: 0 30rpx; +} + +.container .sig-pop-wrapper .title { + margin: 30rpx 0 40rpx 0; + color: #222; + font-size: 36rpx; +} + +.container .sig-pop-wrapper .item .radio { + flex-direction: row-reverse; + justify-content: space-between; +} + +.container .sig-pop-wrapper .item .name { + font-size: 34rpx; + color: #6d7278; + width: 600rpx; +} + +.container .sig-pop-wrapper .item { + height: 108rpx; + display: flex; + align-items: center; + border-bottom: 1px solid #f0f3f7; +} + +.container .sig-pop-wrapper .item:last-child { + border: none; +} + +.container .sig-pop-wrapper .btn-wrapper { + display: flex; + align-items: center; + justify-content: space-between; + height: 90rpx; + font-size: 36rpx; + margin: 60rpx 0; +} + +.container .sig-pop-wrapper .btn-wrapper .confirm { + height: 100%; + width: 320rpx; + text-align: center; + line-height: 90rpx; + color: #fff; + background-color: #40ADFF; +} + +.container .sig-pop-wrapper .btn-wrapper .cancel { + height: 100%; + width: 320rpx; + text-align: center; + line-height: 90rpx; + color: #40ADFF; + background-color: #fff; + border: 1px solid #40ADFF; +} + +.container .dialog-slot-content text { + white-space: unset; + overflow: unset; + text-overflow: unset; + +} \ No newline at end of file diff --git a/src/mindspore/package-meeting/sig/add-member.js b/src/mindspore/package-meeting/sig/add-member.js new file mode 100644 index 0000000000000000000000000000000000000000..6c648111d444ea923ac44f8c512bd5d38a4e366e --- /dev/null +++ b/src/mindspore/package-meeting/sig/add-member.js @@ -0,0 +1,132 @@ +// pages/sig/add-member.js +var appAjax = require('./../../utils/app-ajax'); +let remoteMethods = { + getExcludeMemberList: function (postData, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'GET', + service: 'GROUP_EXCLUDE_MEMBER_LIST', + data: { + group: postData.id, + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, + addMemberList: function (postData, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'POST', + service: 'ADD_MEMBER_LIST', + data: postData, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, +}; +Page({ + /** + * 页面的初始数据 + */ + data: { + list: [], + result: [], + group_id: '', + keyword: '', + isShowMes: false, + btnText: '', + group_name: '', + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + group_id: options.group_id, + btnText: '返回' + options.grouptitle, + }); + if (options.grouptitle.includes('MSG')) { + this.setData({ + group_name: 'MSG', + }); + } else if (options.grouptitle.includes('专家')) { + this.setData({ + group_name: 'Tech', + }); + } else { + this.setData({ + group_name: options.grouptitle, + }); + } + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + let that = this; + remoteMethods.getExcludeMemberList( + { + id: that.data.group_name, + }, + function (data) { + that.setData({ + list: data, + }); + } + ); + }, + onChange: function (e) { + this.setData({ + result: e.detail, + }); + }, + comfirm: function () { + let that = this; + if (!this.data.result.length) { + wx.showToast({ + title: '请选择人员', + icon: 'none', + duration: 2000, + }); + return; + } + let postData = { + ids: this.data.result.join('-'), + group_id: this.data.group_id, + }; + remoteMethods.addMemberList(postData, function (data) { + if (data.code === 201) { + that.setData({ + isShowMes: true, + }); + } else { + wx.showToast({ + title: '操作失败', + icon: 'none', + duration: 2000, + }); + } + }); + }, + searchInput: function (e) { + let that = this; + this.setData({ + keyword: e.detail.value, + }); + remoteMethods.getExcludeMemberList( + { + id: this.data.group_name, + nickname: this.data.keyword, + }, + function (data) { + that.setData({ + list: data, + }); + } + ); + }, +}); diff --git a/src/mindspore/package-meeting/sig/add-member.json b/src/mindspore/package-meeting/sig/add-member.json new file mode 100644 index 0000000000000000000000000000000000000000..4f2dacb45a264c5d4e3e210dd2213b56d4e1bab9 --- /dev/null +++ b/src/mindspore/package-meeting/sig/add-member.json @@ -0,0 +1,6 @@ +{ + "usingComponents": { + "message": "/components/message/message" + }, + "navigationBarTitleText": "选择成员" +} \ No newline at end of file diff --git a/src/mindspore/package-meeting/sig/add-member.wxml b/src/mindspore/package-meeting/sig/add-member.wxml new file mode 100644 index 0000000000000000000000000000000000000000..5723327f8dd9c207f51effd47435e8ae839308a4 --- /dev/null +++ b/src/mindspore/package-meeting/sig/add-member.wxml @@ -0,0 +1,26 @@ + + + + + + + + + + + {{list.length?'':('没有找到 '+(keyword||' ')+' 相关成员')}} + + + + + + + {{item.nickname}} + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/package-meeting/sig/add-member.wxss b/src/mindspore/package-meeting/sig/add-member.wxss new file mode 100644 index 0000000000000000000000000000000000000000..602a939f4a18c50eb937fda35b3347a4468e92f8 --- /dev/null +++ b/src/mindspore/package-meeting/sig/add-member.wxss @@ -0,0 +1,88 @@ +/* pages/sig/add-member.wxss */ +.container { + background-color: #fff; + margin-top: 20rpx; + margin-bottom: 150rpx; + padding: 0; +} + +.container .fill { + width: 100%; + text-align: center; + font-size: 28rpx; + color: #6d7278; + height: 28rpx; + background-color: #f5f7fa; +} + +.container .input-wraper { + box-sizing: border-box; + margin: 20rpx 0 0 0; + height: 108rpx; + position: relative; +} + +.container .input-wraper .keyword { + padding-left: 94rpx; + background-color: #fff; + border-radius: 8rpx; + height: 108rpx; + position: absolute; + top: 0; + width: 100%; + font-size: 28rpx; + line-height: 40rpx; +} + +.container .input-wraper .search-icon { + height: 39rpx; + width: 39rpx; + display: inline-block; + position: absolute; + top: 34rpx; + left: 32rpx; +} + +.container .add-item { + border-bottom: 1px solid #c7cad0; + padding: 0 30rpx; + height: 108rpx; + line-height: 108rpx; + display: flex; + align-items: center; +} + +.container .add-item image { + width: 72rpx; + height: 72rpx; + border-radius: 8rpx; + display: inline-block; + border: 1px solid #979797; + margin: 0 20rpx 0 10rpx; +} + +.container .add-item text { + display: inline-block; + height: 100%; +} + +.container .add-item .inner { + height: 100%; + display: flex; + align-items: center; +} + +.container .add-btn { + position: fixed; + bottom: 60rpx; + left: 125rpx; + width: 500rpx; + height: 90rpx; + line-height: 90rpx; + font-size: 36rpx; + color: #fff; + background-color: #40ADFF; + border-radius: 8rpx; + text-align: center; + box-shadow: 0px 5px 20px 0px rgba(126, 146, 178, 0.7); +} \ No newline at end of file diff --git a/src/mindspore/package-meeting/sig/add-sig-member.js b/src/mindspore/package-meeting/sig/add-sig-member.js new file mode 100644 index 0000000000000000000000000000000000000000..1dfa77dd1edb461f72f946952e5e4d6e1c2f5ab6 --- /dev/null +++ b/src/mindspore/package-meeting/sig/add-sig-member.js @@ -0,0 +1,91 @@ +// pages/sig/add-sig-member.js +var appAjax = require('./../../utils/app-ajax'); +let remoteMethods = { + getSigMemberList: function (id, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'GET', + service: 'GROUP_MEMBER_LIST', + data: { + group: id, + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, +}; +Page({ + /** + * 页面的初始数据 + */ + data: { + memberList: [], + id: '', + groupTitle: '', + urlGroup: '', + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + wx.setNavigationBarTitle({ + title: options.name, + }); + this.setData({ + id: options.id, + groupTitle: options.name, + }); + if (options.name.includes('MSG')) { + this.setData({ + urlGroup: 'MSG', + }); + } else if (options.name.includes('专家')) { + this.setData({ + urlGroup: 'Tech', + }); + } else { + this.setData({ + urlGroup: options.name, + }); + } + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + let that = this; + remoteMethods.getSigMemberList(this.data.urlGroup, function (list) { + that.setData({ + memberList: list, + }); + }); + }, + toDetail: function (e) { + wx.navigateTo({ + url: + '/package-meeting/sig/member-detail?id=' + + e.currentTarget.dataset.id + + '&avatar=' + + e.currentTarget.dataset.avatar + + '&name=' + + e.currentTarget.dataset.name + + '&nickname=' + + e.currentTarget.dataset.nickname + + '&grouptitle=' + + this.data.groupTitle, + }); + }, + addMember: function () { + wx.navigateTo({ + url: '/package-meeting/sig/add-member?group_id=' + this.data.id + '&grouptitle=' + this.data.groupTitle, + }); + }, + delMember: function () { + wx.navigateTo({ + url: '/package-meeting/sig/del-member?group_id=' + this.data.id + '&grouptitle=' + this.data.groupTitle, + }); + }, +}); diff --git a/src/mindspore/package-meeting/sig/add-sig-member.json b/src/mindspore/package-meeting/sig/add-sig-member.json new file mode 100644 index 0000000000000000000000000000000000000000..8835af0699ccec004cbe685ef938cd2d63ea7037 --- /dev/null +++ b/src/mindspore/package-meeting/sig/add-sig-member.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/src/mindspore/package-meeting/sig/add-sig-member.wxml b/src/mindspore/package-meeting/sig/add-sig-member.wxml new file mode 100644 index 0000000000000000000000000000000000000000..8e1944695e8f3512d60fa4fcdf9c59897a883b6f --- /dev/null +++ b/src/mindspore/package-meeting/sig/add-sig-member.wxml @@ -0,0 +1,41 @@ + + + + + + + + 删除成员 + + + + 添加成员 + + + + + + + + + {{item.nickname}} + {{item.gitee_name}} + + + + + + + + + + + 该组暂无成员! + + + + + \ No newline at end of file diff --git a/src/mindspore/package-meeting/sig/add-sig-member.wxss b/src/mindspore/package-meeting/sig/add-sig-member.wxss new file mode 100644 index 0000000000000000000000000000000000000000..5590d5930e95b06e427cf8414bcf1b786275931a --- /dev/null +++ b/src/mindspore/package-meeting/sig/add-sig-member.wxss @@ -0,0 +1,128 @@ +/* pages/sig/add-sig-member.wxss */ +page { + padding: 20rpx 0 0 0; +} + +.container { + height: 100%; + padding: 30rpx; +} + +.container .sig-members { + width: 100%; +} + +.container .sig-members .box { + width: 100%; + margin-bottom: 20rpx; + display: flex; + justify-content: space-between; + align-items: center; +} + +.container .sig-members .opera-item { + width: 330rpx; + height: 90rpx; + box-shadow: 0px 5px 15px 0px rgba(0, 47, 167, 0.1); + border-radius: 8px; + border: 1px solid #979797; + display: flex; + justify-content: center; + align-items: center; +} + +.container .sig-members .opera-item image { + width: 28rpx; + height: 28rpx; + margin-right: 20rpx; +} + +.container .sig-members .opera-item text { + font-weight: 400; + color: #6D7278; + line-height: 40rpx; + font-size: 28rpx; +} + +.container .sig-members .member-item { + padding: 30rpx; + height: 195rpx; + background: #FFFFFF; + box-shadow: 0px 5px 15px 0px #E1E6EE; + border-radius: 8px; +} + +.container .sig-members .member-item image { + display: block; + width: 30rpx; + height: 30rpx; + border-radius: 50%; +} + +.container .sig-members .member-item .left { + display: flex; + justify-content: space-between; + align-items: center; +} + +.container .sig-members .member-item .left image { + display: block; + width: 135rpx; + height: 135rpx; + border-radius: 50%; + margin-right: 20rpx; +} + +.container .sig-members .member-item .member-info text { + display: block; + max-width: 400rpx; + font-size: 36rpx; + font-weight: 400; + color: #222222; + line-height: 50rpx; +} + +.container .sig-members .member-item .member-info text:last-of-type { + font-size: 26rpx; + color: #6D7278; + line-height: 37rpx; + margin-top: 20rpx; +} + +.container .empty-wraper { + display: flex; + justify-content: center; + align-items: center; + height: 100vh; +} + +.container .empty-wraper .img-wraper image { + height: 266rpx; + width: 315rpx; + display: block; + margin: 0 auto 42rpx auto; +} + +.container .empty-wraper .img-wraper { + color: #333; + font-size: 34rpx; + line-height: 38rpx; + text-align: center; +} + +.container .empty-wraper button { + width: 500rpx; + height: 90rpx; + line-height: 90rpx; + text-align: center; + background-color: #40ADFF; + color: #fff; + font-size: 36rpx; + border-radius: 20rpx; + margin-top: 128rpx; +} + +.container .empty-wraper button image { + width: 36rpx; + height: 34rpx; +} \ No newline at end of file diff --git a/src/mindspore/package-meeting/sig/del-member.js b/src/mindspore/package-meeting/sig/del-member.js new file mode 100644 index 0000000000000000000000000000000000000000..d73cf9557ae0461535521b50808df0f4a06fe8d8 --- /dev/null +++ b/src/mindspore/package-meeting/sig/del-member.js @@ -0,0 +1,114 @@ +// pages/sig/del-member.js +var appAjax = require('./../../utils/app-ajax'); +let remoteMethods = { + getCludeMemberList: function (postData, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'GET', + service: 'GROUP_MEMBER_LIST', + data: { + group: postData.id, + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, + delMemberList: function (postData, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'POST', + service: 'DEL_MEMBER_LIST', + data: postData, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, +}; +Page({ + /** + * 页面的初始数据 + */ + data: { + list: [], + result: [], + group_id: '', + isShowMes: false, + btnText: '', + group_name: '', + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + group_id: options.group_id, + btnText: '返回' + options.grouptitle, + }); + if (options.grouptitle.includes('MSG')) { + this.setData({ + group_name: 'MSG', + }); + } else if (options.grouptitle.includes('专家')) { + this.setData({ + group_name: 'Tech', + }); + } else { + this.setData({ + group_name: options.grouptitle, + }); + } + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + let that = this; + remoteMethods.getCludeMemberList( + { + id: this.data.group_name, + }, + function (data) { + that.setData({ + list: data, + }); + } + ); + }, + onChange: function (e) { + this.setData({ + result: e.detail, + }); + }, + del: function () { + let that = this; + if (!this.data.result.length) { + wx.showToast({ + title: '请选择人员', + icon: 'none', + duration: 2000, + }); + return; + } + let postData = { + ids: this.data.result.join('-'), + group_id: this.data.group_id, + }; + remoteMethods.delMemberList(postData, function (data) { + if (data.code === 204) { + that.setData({ + isShowMes: true, + }); + } else { + wx.showToast({ + title: '操作失败', + icon: 'none', + duration: 2000, + }); + } + }); + }, +}); diff --git a/src/mindspore/package-meeting/sig/del-member.json b/src/mindspore/package-meeting/sig/del-member.json new file mode 100644 index 0000000000000000000000000000000000000000..4f2dacb45a264c5d4e3e210dd2213b56d4e1bab9 --- /dev/null +++ b/src/mindspore/package-meeting/sig/del-member.json @@ -0,0 +1,6 @@ +{ + "usingComponents": { + "message": "/components/message/message" + }, + "navigationBarTitleText": "选择成员" +} \ No newline at end of file diff --git a/src/mindspore/package-meeting/sig/del-member.wxml b/src/mindspore/package-meeting/sig/del-member.wxml new file mode 100644 index 0000000000000000000000000000000000000000..b762106163d62cff7886a185576ef1ebafdc7557 --- /dev/null +++ b/src/mindspore/package-meeting/sig/del-member.wxml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + {{item.nickname}} + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/package-meeting/sig/del-member.wxss b/src/mindspore/package-meeting/sig/del-member.wxss new file mode 100644 index 0000000000000000000000000000000000000000..bcf2d2c3d3cd6b51545dc4de22be984660b7c855 --- /dev/null +++ b/src/mindspore/package-meeting/sig/del-member.wxss @@ -0,0 +1,51 @@ +/* pages/sig/del-member.wxss */ +.container { + background-color: #fff; + margin-top: 20rpx; + margin-bottom: 150rpx; + padding: 0; +} + +.container .del-item { + border-bottom: 1px solid #c7cad0; + padding: 0 30rpx; + height: 108rpx; + line-height: 108rpx; + display: flex; + align-items: center; +} + +.container .del-item image { + width: 72rpx; + height: 72rpx; + border-radius: 8rpx; + display: inline-block; + border: 1px solid #979797; + margin: 0 20rpx 0 10rpx; +} + +.container .del-item text { + display: inline-block; + height: 100%; +} + +.container .del-item .inner { + height: 100%; + display: flex; + align-items: center; +} + +.container .del-btn { + position: fixed; + bottom: 60rpx; + left: 125rpx; + width: 500rpx; + height: 90rpx; + line-height: 90rpx; + font-size: 36rpx; + color: #fff; + background: #40ADFF; + border-radius: 8rpx; + text-align: center; + box-shadow: 0px 5px 20px 0px rgba(126, 146, 178, 0.7); +} \ No newline at end of file diff --git a/src/mindspore/package-meeting/sig/group.js b/src/mindspore/package-meeting/sig/group.js new file mode 100644 index 0000000000000000000000000000000000000000..1bd7305866bdfd1f785bf4d0a18f43ba35c58a04 --- /dev/null +++ b/src/mindspore/package-meeting/sig/group.js @@ -0,0 +1,119 @@ +// package-meeting/sig/group.js +var appAjax = require('./../../utils/app-ajax'); +let remoteMethods = { + getALLGroupList: function (data, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'GET', + service: 'ALL_GROUP_LIST', + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, +}; +Page({ + /** + * 页面的初始数据 + */ + data: { + list: [ + { + id: 'SIG', + group_name: 'SIG Leader', + }, + { + id: '', + group_name: 'MSG组织者', + }, + { + id: '', + group_name: '专家委员会', + }, + ], + }, + toAddMember: function (e) { + if (e.target.dataset.id === 'SIG') { + wx.navigateTo({ + url: '/package-meeting/sig/sig-list', + }); + } else { + wx.navigateTo({ + url: + '/package-meeting/sig/add-sig-member?id=' + + e.currentTarget.dataset.id + + '&name=' + + e.currentTarget.dataset.name, + }); + } + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + let that = this; + remoteMethods.getALLGroupList('', function (list) { + let msgID = ''; + let techID = ''; + list.forEach((item) => { + if (item.name === 'MSG') { + msgID = item.id; + } else { + techID = item.id; + } + }); + that.setData({ + list: [ + { + id: 'SIG', + group_name: 'SIG Leader', + }, + { + id: msgID, + group_name: 'MSG组织者', + }, + { + id: techID, + group_name: '专家委员会', + }, + ], + }); + }); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () {}, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () {}, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () {}, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () {}, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () {}, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () {}, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () {}, +}); diff --git a/src/mindspore/package-meeting/sig/group.json b/src/mindspore/package-meeting/sig/group.json new file mode 100644 index 0000000000000000000000000000000000000000..4177af288ff92b6f3426d18d9bac53851a0717ab --- /dev/null +++ b/src/mindspore/package-meeting/sig/group.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "用户管理" +} \ No newline at end of file diff --git a/src/mindspore/package-meeting/sig/group.wxml b/src/mindspore/package-meeting/sig/group.wxml new file mode 100644 index 0000000000000000000000000000000000000000..e59cbccb5733eb1f9f396f5ca64021371595372a --- /dev/null +++ b/src/mindspore/package-meeting/sig/group.wxml @@ -0,0 +1,11 @@ + + + + + + {{item.group_name}} + + + + + diff --git a/src/mindspore/package-meeting/sig/group.wxss b/src/mindspore/package-meeting/sig/group.wxss new file mode 100644 index 0000000000000000000000000000000000000000..43b6a996416a0987f7e841ae00c6ae608aabd38f --- /dev/null +++ b/src/mindspore/package-meeting/sig/group.wxss @@ -0,0 +1,27 @@ +/* package-meeting/sig/group.wxss */ +.container { + padding-top: 30rpx; +} +.container .sig-list .item { + height: 108rpx; + background-color: #fff; + font-size: 34rpx; + color: #333; + border-radius: 8rpx; + display: flex; + justify-content: space-between; + align-items: center; + box-shadow: 0px 5px 15px 0px rgba(225, 230, 238, 1); + padding: 0 30rpx; + margin-bottom: 20rpx; +} + +.container .sig-list .item text { + line-height: 48rpx; +} + +.container .sig-list .item image { + flex-shrink: 1; + width: 31rpx; + height: 31rpx; +} \ No newline at end of file diff --git a/src/mindspore/package-meeting/sig/member-detail.js b/src/mindspore/package-meeting/sig/member-detail.js new file mode 100644 index 0000000000000000000000000000000000000000..7664dc3c0b991d3fb2d3ad198d48d08c9e16416a --- /dev/null +++ b/src/mindspore/package-meeting/sig/member-detail.js @@ -0,0 +1,119 @@ +// pages/sig/member-detail.js +var appAjax = require('./../../utils/app-ajax'); +let remoteMethods = { + saveMemberGiteeName: function (postData, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'PUT', + service: 'SAVE_MEMBER_DETAIL', + otherParams: { + id: postData.id, + }, + data: { + gitee_name: postData.gitee_name, + email: postData.email, + telephone: postData.email, + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, +}; +Page({ + /** + * 页面的初始数据 + */ + data: { + id: '', + avatar: '', + gitee_name: '', + name: '', + nickname: '', + phoneNmuber: '', + email: '', + btnText: '', + isShowMes: false, + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + id: options.id, + avatar: options.avatar, + nickname: options.nickname, + name: options.name, + gitee_name: options.name, + btnText: '返回' + options.grouptitle, + }); + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () {}, + confirm: function () { + let that = this; + if (!that.data.gitee_name) { + wx.showToast({ + title: '请输入ID', + icon: 'none', + duration: 2000, + }); + return; + } else if (!that.data.phoneNmuber) { + wx.showToast({ + title: '请输入手机号码', + icon: 'none', + duration: 2000, + }); + return; + } else if (!that.data.email) { + wx.showToast({ + title: '请输入电子邮箱地址', + icon: 'none', + duration: 2000, + }); + return; + } + remoteMethods.saveMemberGiteeName( + { + id: that.data.id, + gitee_name: that.data.gitee_name, + eamil: that.data.eamil, + telephone: that.data.phoneNmuber, + }, + function (data) { + that.setData({ + isShowMes: true, + }); + } + ); + }, + onInput: function (e) { + if (e.target.dataset.index === 'id') { + this.setData({ + gitee_name: e.detail.value, + }); + } else if (e.target.dataset.index === 'phone') { + this.setData({ + phoneNmuber: e.detail.value, + }); + } else if (e.target.dataset.index === 'email') { + this.setData({ + email: e.detail.value, + }); + } else { + return false; + } + }, + reset: function () { + this.setData({ + name: '', + phoneNmuber: '', + email: '', + }); + }, +}); diff --git a/src/mindspore/package-meeting/sig/member-detail.json b/src/mindspore/package-meeting/sig/member-detail.json new file mode 100644 index 0000000000000000000000000000000000000000..f8cc8296119b9d70c9a0de275e22e7085884cec8 --- /dev/null +++ b/src/mindspore/package-meeting/sig/member-detail.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "message": "/components/message/message" + } +} \ No newline at end of file diff --git a/src/mindspore/package-meeting/sig/member-detail.wxml b/src/mindspore/package-meeting/sig/member-detail.wxml new file mode 100644 index 0000000000000000000000000000000000000000..6cc5d767d57f5355014ca7c1fdc647241e5dcb9e --- /dev/null +++ b/src/mindspore/package-meeting/sig/member-detail.wxml @@ -0,0 +1,25 @@ + + + + + + + + 输入ID + + 输入手机 + + 输入邮箱 + + + + + + + \ No newline at end of file diff --git a/src/mindspore/package-meeting/sig/member-detail.wxss b/src/mindspore/package-meeting/sig/member-detail.wxss new file mode 100644 index 0000000000000000000000000000000000000000..a01a43c0f1a5e94cae33fd83b2ea6a40ecc659fb --- /dev/null +++ b/src/mindspore/package-meeting/sig/member-detail.wxss @@ -0,0 +1,184 @@ +/* pages/sig/member-detail.wxss */ +.container { + padding: 20rpx 0; +} + +.container .user-info { + padding-left: 20rpx; + height: 182rpx; + background-color: #fff; + display: flex; + align-items: center; +} + +.container .user-info image { + height: 135rpx; + width: 135rpx; + border-radius: 100%; + border: 1px solid #c7cad0; +} + +.container .user-info view { + display: inline-block; + padding-left: 20rpx; + display: flex; + flex-direction: column; +} + +.container .user-info view .user-id { + font-size: 36rpx; + color: #222; + line-height: 50rpx; + font-weight: 400; + margin-bottom: 20rpx; +} + +.container .user-info view .name { + color: #6d7278; + font-size: 26rpx; + line-height: 37rpx; + font-weight: 400; +} + +.container .input-title { + padding-left: 30rpx; + margin: 30rpx 0; + color: #333; + font-size: 34rpx; + line-height: 48rpx; + font-weight: 400; +} + +.container input { + height: 108rpx; + color: #333; + line-height: 45rpx; + font-size: 32rpx; + font-weight: 400rpx; + padding-left: 30rpx; + background-color: #fff; +} + +/* .container .limit-box .limit-item { + display: flex; + justify-content: space-between; + align-items: center; + height: 108rpx; + padding: 0 30rpx; + background-color: #fff; +} + +.container .limit-box .limit-item:nth-of-type(2) { + padding-left: 51rpx; + justify-content: left; +} + +.container .limit-box .limit-item input { + width: 270rpx; + height: 40rpx; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + padding-left: 0; + line-height: 42rpx; + font-size: 30rpx; +} + +.container .limit-box .limit-item text { + font-size: 30rpx; + font-weight: 400; + color: #333333; + line-height: 42rpx; +} + +.container .limit-box .limit-item:nth-of-type(2) text { + color: #6D7278; + flex-shrink: 0; +} + +.container .limit-box .limit-item .sig-choose { + width: 100%; + display: flex; + justify-content: space-between; + align-items: center; + margin-left: 40rpx; +} + +.container .limit-item .right { + width: 30rpx; + height: 30rpx; +} */ + +.container .sig-choose { + width: 100%; + display: flex; + justify-content: space-between; + align-items: center; + padding-right: 30rpx; + background-color: #fff; +} + +.container .sig-choose .right { + width: 30rpx; + height: 30rpx; +} + +.container .select-wrapper .value-class { + flex: none !important; +} + +.container .select-wrapper { + padding: 30rpx; +} + +.container .select-wrapper .title { + padding-bottom: 40rpx; + font-size: 36rpx; + font-weight: 400; + color: #222222; + line-height: 50rpx; +} + +.container .select-wrapper .van-cell { + padding-left: 0; + padding-right: 0; + font-size: 34rpx; + font-weight: 400; + color: #6D7278; + line-height: 48rpx +} + +.container .select-wrapper .btn-wraper { + padding: 0; + margin-top: 60rpx; +} + +.container .btn-wraper { + position: fixed; + bottom: 60px; + width: 100%; + left: 0; + display: flex; + justify-content: space-between; + padding: 0 30rpx; +} + +.container .btn-wraper button { + width: 320rpx; + height: 90rpx; + font-size: 36rpx; + line-height: 90rpx; + text-align: center; + border-radius: 20rpx; +} + +.container .btn-wraper .confirm { + color: #fff; + background-color: #40ADFF; +} + +.container .btn-wraper .reset { + color: #40ADFF; + background-color: #fff; + border: 1px solid #40ADFF; +} \ No newline at end of file diff --git a/src/mindspore/package-meeting/sig/sig-list.js b/src/mindspore/package-meeting/sig/sig-list.js new file mode 100644 index 0000000000000000000000000000000000000000..9f30036a4d85af47373ba63e8a092ca88e6c8303 --- /dev/null +++ b/src/mindspore/package-meeting/sig/sig-list.js @@ -0,0 +1,62 @@ +var appAjax = require('./../../utils/app-ajax'); +let remoteMethods = { + getSigList: function (keyword, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'GET', + service: 'SIG_LIST', + data: { + search: keyword, + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, +}; +Page({ + /** + * 页面的初始数据 + */ + data: { + keyword: '', + list: [], + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function () {}, + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + let that = this; + remoteMethods.getSigList('', function (list) { + that.setData({ + list: list, + }); + }); + }, + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () {}, + toAddMember: function (e) { + wx.navigateTo({ + url: + '/package-meeting/sig/add-sig-member?id=' + + e.currentTarget.dataset.id + + '&name=' + + e.currentTarget.dataset.name, + }); + }, + searchInput: function (e) { + let that = this; + remoteMethods.getSigList(e.detail.value, function (list) { + that.setData({ + list: list, + }); + }); + }, +}); diff --git a/src/mindspore/package-meeting/sig/sig-list.json b/src/mindspore/package-meeting/sig/sig-list.json new file mode 100644 index 0000000000000000000000000000000000000000..3b7472c8392e566eddfe983bca84892a9e73a5a2 --- /dev/null +++ b/src/mindspore/package-meeting/sig/sig-list.json @@ -0,0 +1,7 @@ +{ + "usingComponents": { + "van-cell": "@vant/weapp/cell/index", + "van-cell-group": "@vant/weapp/cell-group/index" + }, + "navigationBarTitleText": "SIG组管理" +} \ No newline at end of file diff --git a/src/mindspore/package-meeting/sig/sig-list.wxml b/src/mindspore/package-meeting/sig/sig-list.wxml new file mode 100644 index 0000000000000000000000000000000000000000..dbd7579d43936fdba4cf8f01599c058cc1947d7a --- /dev/null +++ b/src/mindspore/package-meeting/sig/sig-list.wxml @@ -0,0 +1,15 @@ + + + + + + + + + + {{item.name}} + + + + + \ No newline at end of file diff --git a/src/mindspore/package-meeting/sig/sig-list.wxss b/src/mindspore/package-meeting/sig/sig-list.wxss new file mode 100644 index 0000000000000000000000000000000000000000..14d82c86e7127cab1244c1628faacca6ac9d155e --- /dev/null +++ b/src/mindspore/package-meeting/sig/sig-list.wxss @@ -0,0 +1,54 @@ +/* pages/sig/sig-list.wxss */ + +.container .input-wraper { + box-sizing: border-box; + margin: 20rpx 0 30rpx; + height: 108rpx; + position: relative; +} + +.container .input-wraper .keyword { + padding-left: 94rpx; + background-color: #fff; + border-radius: 8rpx; + box-shadow: 0px 5px 15px 0px rgba(225, 230, 238, 1); + height: 108rpx; + position: absolute; + top: 0; + width: 100%; + font-size: 28rpx; + line-height: 40rpx; +} + +.container .input-wraper .search-icon { + height: 39rpx; + width: 39rpx; + display: inline-block; + position: absolute; + top: 34rpx; + left: 32rpx; +} + +.container .sig-list .item { + height: 108rpx; + background-color: #fff; + font-size: 34rpx; + color: #333; + border-radius: 8rpx; + display: flex; + justify-content: space-between; + align-items: center; + box-shadow: 0px 5px 15px 0px rgba(225, 230, 238, 1); + padding: 0 30rpx; + margin-bottom: 20rpx; +} + +.container .sig-list .item text { + line-height: 48rpx; +} + +.container .sig-list .item image { + flex-shrink: 1; + width: 31rpx; + height: 31rpx; +} \ No newline at end of file diff --git a/src/mindspore/package-my/events/my-list.js b/src/mindspore/package-my/events/my-list.js new file mode 100644 index 0000000000000000000000000000000000000000..c1fec15a083fd3c2d796f5f3665b01335b2304cd --- /dev/null +++ b/src/mindspore/package-my/events/my-list.js @@ -0,0 +1,346 @@ +// package-my/events/under-release.js +const appAjax = require('./../../utils/app-ajax'); +const sessionUtil = require('../../utils/app-session.js'); + +let that = null; +let remoteMethods = { + getList: function (_callback) { + let service = ''; + if (that.data.type == 4) { + service = 'GET_DRAFT_LIST'; + } else if (that.data.type == 1) { + service = 'DRAFTS'; + } else if (that.data.type == 5) { + service = 'PUBLISHER_EVENTS_LIST'; + } else if (that.data.type == 2) { + if (that.data.level == 2) { + service = 'MY_EVENTS_LIST'; + } else { + service = 'ALL_EVENTS_LIST'; + } + } else if (that.data.type == 6) { + service = 'EVENT_COLLECT_LIST'; + } else if (that.data.type == 7) { + service = 'MY_SIGNUP_EVENTS'; + } else if (that.data.type == 3) { + if (that.data.level == 2) { + service = 'MY_EVENTS_LIST'; + } else { + service = 'ALL_EVENTS_LIST'; + } + } + appAjax.postJson({ + autoShowWait: true, + type: 'GET', + service, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, + delDraft: function (_callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'DELETE', + service: 'DRAFT_DETAIL', + otherParams: { + id: that.data.curId, + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, + delEvent: function (_callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'PUT', + service: 'DEL_EVENT', + otherParams: { + id: that.data.curId, + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, + collect: function (_callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'POST', + service: 'EVENT_COLLECT', + data: { + activity: that.data.curId, + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, + unCollect: function (_callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'DELETE', + service: 'EVENT_UNCOLLECT', + otherParams: { + id: that.data.collectionId, + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, + getSignUpInfo: function (id, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'GET', + service: 'GET_SIGNUP_INFO', + otherParams: { + id, + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, +}; +Page({ + /** + * 页面的初始数据 + */ + data: { + type: 1, + list: [], + level: 1, + actionShow: false, + actions: [], + curId: '', + userId: '', + collectionId: '', + showDialogDel: false, + noAuthDialogShow: false, + user: '', + registerId: '', + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + type: options.type, + level: sessionUtil.getUserInfoByKey('eventLevel'), + user: sessionUtil.getUserInfoByKey('userId'), + }); + that = this; + let title = ''; + if (options.type == 1) { + title = '待发布'; + } else if (options.type == 2) { + title = '已发布'; + } else if (options.type == 3) { + title = '报名表单'; + } else if (options.type == 4) { + title = '草稿箱'; + } else if (options.type == 5) { + title = '发布中'; + } else if (options.type == 6) { + title = '我收藏的活动'; + } else if (options.type == 7) { + title = '我报名的活动'; + } + wx.setNavigationBarTitle({ + title, + }); + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + remoteMethods.getList((res) => { + this.setData({ + list: res, + }); + }); + }, + editDraft(e) { + wx.navigateTo({ + url: `/package-events/events/event-detail?id=${e.currentTarget.dataset.id}&type=4`, + }); + }, + onActionClose() { + this.setData({ + actionShow: false, + }); + }, + onActionSelect(e) { + if (this.data.type == 4) { + remoteMethods.delDraft(() => { + this.onShow(); + }); + } else if (this.data.type == 2 || this.data.type == 6 || this.data.type == 7) { + if (this.data.level == 3) { + if (e.detail.operaType == 1) { + if (this.data.collectionId) { + remoteMethods.unCollect(() => { + this.onShow(); + }); + } else { + remoteMethods.collect(() => { + this.onShow(); + }); + } + } else { + this.setData({ + showDialogDel: true, + }); + } + } else { + if (e.detail.operaType == 1) { + if (this.data.collectionId) { + remoteMethods.unCollect(() => { + this.onShow(); + }); + } else { + remoteMethods.collect(() => { + this.onShow(); + }); + } + } else if (e.detail.operaType == 3) { + remoteMethods.getSignUpInfo(this.data.curId, (res) => { + wx.navigateTo({ + url: `/package-events/sign-up/sign-up-success?name=${encodeURIComponent( + res.name + )}&title=${encodeURIComponent(res.title)}&tel=${encodeURIComponent( + res.telephone + )}&poster=${encodeURIComponent(res.poster)}`, + }); + }); + } else { + this.setData({ + noAuthDialogShow: true, + }); + } + } + } + }, + onMore(e) { + this.setData({ + actionShow: true, + curId: e.currentTarget.dataset.item.id, + userId: e.currentTarget.dataset.item.user, + collectionId: e.currentTarget.dataset.item.collection_id || '', + registerId: e.currentTarget.dataset.item.register_id || '', + }); + const strTemp = this.data.collectionId ? '取消收藏' : '收藏活动'; + if (this.data.type == 4) { + this.setData({ + actions: [ + { + name: '删除', + operaType: 1, + }, + ], + }); + } else if (this.data.type == 2 || this.data.type == 6 || this.data.type == 7) { + if (this.data.level == 3) { + this.setData({ + actions: [ + { + name: strTemp, + operaType: 1, + }, + { + name: '下架活动', + operaType: 2, + }, + ], + }); + } else { + if (this.data.user == this.data.userId) { + this.setData({ + actions: [ + { + name: strTemp, + operaType: 1, + }, + { + name: '下架活动', + operaType: 2, + }, + ], + }); + } else { + this.setData({ + actions: [ + { + name: strTemp, + operaType: 1, + }, + ], + }); + } + + if (this.data.registerId) { + let tempArr = this.data.actions; + tempArr.unshift({ + name: '查看门票', + operaType: 3, + }); + this.setData({ + actions: tempArr, + }); + } + } + } + }, + toExamine(e) { + wx.navigateTo({ + url: `/package-events/events/event-detail?id=${e.currentTarget.dataset.id}&type=1`, + }); + }, + del() { + this.setData({ + showDialogDel: false, + }); + remoteMethods.delEvent(() => { + remoteMethods.getList((res) => { + this.setData({ + list: res, + }); + }); + }); + }, + delCancel() { + this.setData({ + showDialogDel: false, + }); + }, + toUpdateSchedule(e) { + if (this.data.type == 4) { + this.editDraft(e); + } else if (this.data.type == 2 || this.data.type == 6 || this.data.type == 7) { + wx.navigateTo({ + url: `/package-events/events/event-detail?id=${e.currentTarget.dataset.id}&type=5`, + }); + } else if (this.data.type == 3) { + this.sendEmail(e); + } + }, + copyWechat() { + wx.setClipboardData({ + data: 'openeuler123', + success: () => { + this.setData({ + noAuthDialogShow: false, + }); + }, + }); + }, + sendEmail(e) { + wx.navigateTo({ + url: `/package-my/events/send-email?id=${e.currentTarget.dataset.id}`, + }); + }, +}); diff --git a/src/mindspore/package-my/events/my-list.json b/src/mindspore/package-my/events/my-list.json new file mode 100644 index 0000000000000000000000000000000000000000..8835af0699ccec004cbe685ef938cd2d63ea7037 --- /dev/null +++ b/src/mindspore/package-my/events/my-list.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/src/mindspore/package-my/events/my-list.wxml b/src/mindspore/package-my/events/my-list.wxml new file mode 100644 index 0000000000000000000000000000000000000000..68760153d17450756209a34a44c8425b2c94ee35 --- /dev/null +++ b/src/mindspore/package-my/events/my-list.wxml @@ -0,0 +1,103 @@ + + + + + + + {{item.enterprise}} + + + + + + + + {{item.title}} + + + {{item.date}} + + + + {{item.address||item.live_address}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 已报名 {{item.register_count}}人 + + + + + + + + + + + + + + + + + 暂无活动! + + + + + 请确认下架当前活动 + + + + + + + + + + 活动一经发布,暂不支持自行下架删除。如有需要,请联系 + 小助手 (微信号openeuler123) + 下架活动 + + + + + + + \ No newline at end of file diff --git a/src/mindspore/package-my/events/my-list.wxss b/src/mindspore/package-my/events/my-list.wxss new file mode 100644 index 0000000000000000000000000000000000000000..ea719fba868a230b89941f9eb96eaaf74a21f792 --- /dev/null +++ b/src/mindspore/package-my/events/my-list.wxss @@ -0,0 +1,206 @@ +/* package-my/events/under-release.wxss */ +page { + background-color: #f5f7fa !important; +} + +.container .event-list-wrapper { + padding: 30rpx 0 0; +} + +.container .event-list-wrapper .event-item { + margin-bottom: 30rpx; + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; + overflow: hidden; + position: relative; + background-color: #fff; +} + +.container .event-list-wrapper .event-item .collection { + width: 40rpx; + height: 26rpx; + position: absolute; + top: 33rpx; + left: 0; +} + +.container .event-list-wrapper .event-item .header { + height: 90rpx; + padding: 0 30rpx; + display: flex; + justify-content: space-between; + align-items: center; + font-size: 28rpx; + color: #333; + border-bottom: 2rpx solid #f0f3f7; +} + +.container .event-list-wrapper .event-item .isCollection { + padding-left: 60rpx; +} + +.container .event-list-wrapper .event-item .header image { + height: 36rpx; + width: 8rpx; +} + +.container .event-list-wrapper .event-item .body { + padding: 30rpx; + display: flex; +} + +.container .event-list-wrapper .event-item .body .left { + margin-right: 20rpx; +} + +.container .event-list-wrapper .event-item .body .left image { + width: 241rpx; + height: 241rpx; + border-radius: 8rpx; +} + +.container .event-list-wrapper .event-item .body .right .title { + font-size: 30rpx; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + margin-bottom: 20rpx; + width: 380rpx; +} + +.container .event-list-wrapper .event-item .body .right .date { + margin-bottom: 20rpx; + font-size: 24rpx; + color: #6d7278; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + width: 380rpx; +} + +.container .event-list-wrapper .event-item .body .right .date image { + height: 28rpx; + width: 28rpx; + margin-right: 16rpx; + vertical-align: middle; +} +.container .event-list-wrapper .event-item .body .right .date text { + vertical-align: middle; +} + +.container .event-list-wrapper .event-item .body .right .address { + font-size: 24rpx; + color: #6d7278; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + width: 380rpx; + margin-bottom: 30rpx; +} + +.container .event-list-wrapper .event-item .body .right .address image { + height: 28rpx; + width: 28rpx; + margin-right: 16rpx; + vertical-align: middle; +} + +.container .event-list-wrapper .event-item .body .right .address image text { + vertical-align: middle; +} + +.container .event-list-wrapper .event-item .body .right .button { + text-align: right; + height: 68rpx; +} + +.container .event-list-wrapper .event-item .body .right .button button { + height: 68rpx; + width: 172rpx; + text-align: center; + line-height: 68rpx; + color: #fff; + background-color: #40ADFF; + border-radius: 8rpx; + font-size: 28rpx; + display: inline-block; +} + +.container .event-list-wrapper .event-item .body .right .button .register { + background-color: #6682ca; +} + +.container .event-list-wrapper .event-item .mask { + position: absolute; + height: 100%; + width: 100%; + background-color: #40ADFF; + opacity: 0.65; + top: 0; + left: 0; +} + +.container .event-list-wrapper .event-item .mask .mask-img { + position: absolute; + height: 137rpx; + width: 180rpx; + left: 50%; + top: 50%; + margin-left: -90rpx; + margin-top: -68rpx; +} + +.empty-status .suc-wrapper { + position: absolute; + top: 50%; + transform: translate(-50%, -50%); + left: 50%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.empty-status .suc-wrapper image { + width: 234rpx; + height: 218rpx; +} + +.empty-status .suc-wrapper text { + text-align: center; + margin-top: 20rpx; + font-size: 34rpx; + color: #333; +} + +.container .event-list-wrapper .event-item .sendSignUpInfo { + height: 118rpx; + display: flex; + padding: 0 30rpx; + align-items: center; + justify-content: space-between; + border-top: 2rpx solid #f0f3f7; +} + +.container .event-list-wrapper .event-item .sendSignUpInfo .signUpNum { + font-size: 24rpx; + color: #40ADFF; +} + +.container .event-list-wrapper .event-item .sendSignUpInfo .sendBtn { + height: 68rpx; + width: 236rpx; + text-align: center; + line-height: 68rpx; + background-color: #40ADFF; + color: #fff; + border-radius: 8rpx ; + margin: unset; + font-size: 28rpx; + padding: unset; +} + +.container .event-list-wrapper .event-item .body .small image { + width: 180rpx; + height: 180rpx; +} \ No newline at end of file diff --git a/src/mindspore/package-my/events/send-email.js b/src/mindspore/package-my/events/send-email.js new file mode 100644 index 0000000000000000000000000000000000000000..3e35f96903c2150b8e1ba00a34723af4761b2e2c --- /dev/null +++ b/src/mindspore/package-my/events/send-email.js @@ -0,0 +1,67 @@ +// package-my/events/send-email.js +const appAjax = require('./../../utils/app-ajax'); +const validationConfig = require('./../../config/field-validate-rules'); + +let that = null; + +let remoteMethods = { + sendEmail: function (_callback) { + if (!validationConfig.email.regex.test(that.data.emailAddress)) { + wx.showToast({ + title: '请输入正确的邮箱地址', + icon: 'none', + duration: 2000, + }); + return; + } + appAjax.postJson({ + autoShowWait: true, + type: 'POST', + service: 'SEND_SIGNUP_INFO', + data: { + activity: that.data.id, + mailto: that.data.emailAddress, + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, +}; +Page({ + /** + * 页面的初始数据 + */ + data: { + emailAddress: '', + id: '', + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + that = this; + this.setData({ + id: options.id, + }); + }, + onInput: function (e) { + this.setData({ + emailAddress: e.detail.value, + }); + }, + confirm() { + remoteMethods.sendEmail(() => { + wx.showToast({ + title: '发送成功', + icon: 'success', + duration: 2000, + mask: true, + }); + setTimeout(() => { + wx.navigateBack(); + }, 2000); + }); + }, +}); diff --git a/src/mindspore/package-my/events/send-email.json b/src/mindspore/package-my/events/send-email.json new file mode 100644 index 0000000000000000000000000000000000000000..9f5e14bda2629dba8aa9db20f37633b164fea804 --- /dev/null +++ b/src/mindspore/package-my/events/send-email.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "报名表单" +} \ No newline at end of file diff --git a/src/mindspore/package-my/events/send-email.wxml b/src/mindspore/package-my/events/send-email.wxml new file mode 100644 index 0000000000000000000000000000000000000000..6fdc73ec78a5e92cc10485941c4b68878bb9c520 --- /dev/null +++ b/src/mindspore/package-my/events/send-email.wxml @@ -0,0 +1,8 @@ + + + 邮箱地址 + + + + + \ No newline at end of file diff --git a/src/mindspore/package-my/events/send-email.wxss b/src/mindspore/package-my/events/send-email.wxss new file mode 100644 index 0000000000000000000000000000000000000000..41ad9519fc23339d82480c223a34acf2759f3b2a --- /dev/null +++ b/src/mindspore/package-my/events/send-email.wxss @@ -0,0 +1,46 @@ +/* package-my/events/send-email.wxss */ +page { + background-color: #f5f7fa !important; +} +.container { + padding: 20rpx 0; +} + +.container .input-title { + padding-left: 30rpx; + margin: 30rpx 0; + color: #333; + font-size: 34rpx; + line-height: 48rpx; + font-weight: 400; +} + +.container input { + height: 108rpx; + color: #333; + line-height: 45rpx; + font-size: 32rpx; + font-weight: 400rpx; + padding-left: 30rpx; + background-color: #fff; +} + +.container .btn-wraper { + margin-top: 128rpx; + display: flex; + justify-content: space-between; + padding: 0 30rpx; +} + +.container .btn-wraper button { + width: 500rpx; + height: 90rpx; + font-size: 36rpx; + line-height: 90rpx; + text-align: center; +} + +.container .btn-wraper .confirm { + color: #fff; + background-color: #40ADFF; +} \ No newline at end of file diff --git a/src/mindspore/package-my/my/feedback.js b/src/mindspore/package-my/my/feedback.js new file mode 100644 index 0000000000000000000000000000000000000000..b4642b232fac2da3fc99aa323310ff8045b63d9d --- /dev/null +++ b/src/mindspore/package-my/my/feedback.js @@ -0,0 +1,75 @@ +// package-my/my/feedback.js +const appAjax = require('./../../utils/app-ajax'); +const validationConfig = require('./../../config/field-validate-rules'); + +let that = null; + +let remoteMethods = { + saveFeedback: function (_callback) { + if (!that.data.content) { + wx.showToast({ + title: '请输入留言反馈', + icon: 'none', + duration: 2000, + }); + return; + } + if (!validationConfig.email.regex.test(that.data.email)) { + wx.showToast({ + title: '请输入正确的邮箱地址', + icon: 'none', + duration: 2000, + }); + return; + } + appAjax.postJson({ + autoShowWait: true, + type: 'POST', + service: 'SAVE_FEEDBACK', + data: { + feedback_type: that.data.type, + feedback_content: that.data.content, + feedback_email: that.data.email, + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, +}; +Page({ + /** + * 页面的初始数据 + */ + data: { + type: 1, + content: '', + email: '', + isShowMes: false, + }, + onLoad() { + that = this; + }, + switchTab(e) { + this.setData({ + type: e.currentTarget.dataset.index, + }); + }, + contentInput(e) { + this.setData({ + content: e.detail.value, + }); + }, + emailInput(e) { + this.setData({ + email: e.detail.value, + }); + }, + saveFeedback() { + remoteMethods.saveFeedback(() => { + this.setData({ + isShowMes: true, + }); + }); + }, +}); diff --git a/src/mindspore/package-my/my/feedback.json b/src/mindspore/package-my/my/feedback.json new file mode 100644 index 0000000000000000000000000000000000000000..97d4001f7f7d932c9805724c67673e730181ca20 --- /dev/null +++ b/src/mindspore/package-my/my/feedback.json @@ -0,0 +1,6 @@ +{ + "usingComponents": { + "message": "/components/message/message" + }, + "navigationBarTitleText": "留言反馈" +} \ No newline at end of file diff --git a/src/mindspore/package-my/my/feedback.wxml b/src/mindspore/package-my/my/feedback.wxml new file mode 100644 index 0000000000000000000000000000000000000000..76ce897349c977a49014265455a1a2cc03774b6c --- /dev/null +++ b/src/mindspore/package-my/my/feedback.wxml @@ -0,0 +1,46 @@ + + + + + + + + + 反馈类型 + + 问题反馈 + 产品建议 + + + + + 留言反馈 + * + + + + + + + 邮箱地址 + * + + + + + + + + + * + 号为必填项 + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/package-my/my/feedback.wxss b/src/mindspore/package-my/my/feedback.wxss new file mode 100644 index 0000000000000000000000000000000000000000..8143f1cf7ef9cd5cb7439697f9b6b7c6c6ef7dcf --- /dev/null +++ b/src/mindspore/package-my/my/feedback.wxss @@ -0,0 +1,140 @@ +/* package-my/my/feedback.wxss */ +page { + background-color: #f5f7fa !important; +} + +.container { + padding: 20rpx 0 129rpx 0; +} + +textarea { + height: 45rpx; + flex: 1; +} + +input { + flex: 1; +} + +.require { + color: #f76270; +} + +.placeholder { + color: #c7cad0; +} + +.container .form .form-item { + padding: 0 30rpx; + background-color: #fff; + height: 108rpx; + color: #333; + font-size: 34rpx; + display: flex; + align-items: center; + justify-content: start; +} + +.container .form .form-wrapper { + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; + background-color: #fff; + overflow: hidden; +} + + + +.container .form .form-item .label { + margin-right: 60rpx; +} + +.container .form .form-item input { + color: #6d7278; +} + + +.container .form .form-item textarea { + color: #6d7278; +} + +.container .form .form-item image { + width: 30rpx; + height: 30rpx; +} + +.container .form .meeting-desc { + padding-top: 30rpx; + align-items: flex-start; + height: 244rpx; + margin: 20rpx 0; +} + +.container .form .meeting-desc textarea { + height: 184rpx; + position: relative; +} + +.container .form .meeting-desc textarea .hint { + position: absolute; + right: 0; + bottom: 0; + color: #c7cad0; + font-size: 28rpx; +} + +.container .info { + font-size: 29rpx; + color: #6d7278; + margin-bottom: 20rpx; + padding: 0 30rpx; +} + +.container .info view { + margin: 30rpx 0; +} + +.container .info view image { + width: 28rpx; + height: 28rpx; + margin-right: 15rpx; + vertical-align: middle; +} + +.container .commit { + display: flex; + justify-content: space-between; + height: 90rpx; + font-size: 36rpx; + margin-top: 108rpx; +} + +.container .commit button { + width: 500rpx; + text-align: center; + line-height: 90rpx; + height: 100%; + border-radius: 8rpx; +} + +.container .commit .meeting-btn { + color: #fff; + background-color: #40ADFF; +} + +.container .form .form-item .type .tab { + width: 152rpx; + height: 56rpx; + border: 2rpx solid #c7cad0; + border-radius: 8rpx; + color:#c7cad0; + font-size: 28rpx; + text-align: center; + line-height: 56rpx; + margin-right: 20rpx; + display: inline-block; +} + +.container .form .form-item .type .active { + border: 1rpx solid #40ADFF; + color:#40ADFF; +} \ No newline at end of file diff --git a/src/mindspore/package-my/my/help.js b/src/mindspore/package-my/my/help.js new file mode 100644 index 0000000000000000000000000000000000000000..a43248716f331b43750adbd48af35a37ebc33dad --- /dev/null +++ b/src/mindspore/package-my/my/help.js @@ -0,0 +1,25 @@ +// pages/my/help.js + +Page({ + /** + * 页面的初始数据 + */ + data: { + list: [ + { + name: '会议攻略', + contentImg: [], + }, + { + name: '活动攻略', + contentImg: [], + }, + ], + curIndex: 0, + }, + switchTab(e) { + this.setData({ + curIndex: e.currentTarget.dataset.index, + }); + }, +}); diff --git a/src/mindspore/package-my/my/help.json b/src/mindspore/package-my/my/help.json new file mode 100644 index 0000000000000000000000000000000000000000..bfe251b7e209137ac18ecb883878be810fcc53c7 --- /dev/null +++ b/src/mindspore/package-my/my/help.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "小程序使用攻略" +} \ No newline at end of file diff --git a/src/mindspore/package-my/my/help.wxml b/src/mindspore/package-my/my/help.wxml new file mode 100644 index 0000000000000000000000000000000000000000..ab96673da149d4ce17f8fbdd622f50c76cf6ce00 --- /dev/null +++ b/src/mindspore/package-my/my/help.wxml @@ -0,0 +1,17 @@ + + + + {{item.name}} + + + + + + + 暂无活动! + 后台正在熬夜开发中,敬请期待! + + + + + \ No newline at end of file diff --git a/src/mindspore/package-my/my/help.wxss b/src/mindspore/package-my/my/help.wxss new file mode 100644 index 0000000000000000000000000000000000000000..438adc9d5a90daf68c0faa0826caa937f96c0bc2 --- /dev/null +++ b/src/mindspore/package-my/my/help.wxss @@ -0,0 +1,64 @@ +/* pages/my/help.wxss */ +page { + background-color: #fff; +} + +.container { + padding: 0 !important; +} + +.container .tabs { + height: 134rpx; + display: flex; + justify-content: space-around; + align-items: center; + background-color: #fff; +} + +.container .tabs .tab-item { + color: #c7cad0; + font-size: 34rpx; + height: 100%; + line-height: 134rpx; +} + +.container .tabs .active { + border-bottom: 10rpx solid #40ADFF; + color: #333; + border-radius: 0 0 5px 5px; +} + +.container .gray-bg { + height: 20rpx; + background-color: #f5f7fa; +} + +.container .msg-box { + height: 100vh; + display: flex; + justify-content: center; + align-items: center; + background: #fff; +} +.container .msg-box .content image{ + width: 315rpx; + height: 266rpx; + display: block; + margin: 0 auto; +} + +.container .msg-box .content .title { + font-size: 34rpx; + color: #333333; + line-height: 48rpx; + margin: 42px 0 20px 0; +} + +.container .msg-box .content text { + font-size: 28rpx; + font-weight: 400; + color: #6D7278; + line-height: 38rpx; + text-align: center; + display: block; +} diff --git a/src/mindspore/package-my/my/my-collection.js b/src/mindspore/package-my/my/my-collection.js new file mode 100644 index 0000000000000000000000000000000000000000..7277efcebf729c0c57fd0baa8657d9db3839cd86 --- /dev/null +++ b/src/mindspore/package-my/my/my-collection.js @@ -0,0 +1,8 @@ +// pages/my/my-collection.js + +Page({ + /** + * 页面的初始数据 + */ + data: {}, +}); diff --git a/src/mindspore/package-my/my/my-collection.json b/src/mindspore/package-my/my/my-collection.json new file mode 100644 index 0000000000000000000000000000000000000000..82ddfe558f815ac8624b07adfda7ca68a4263967 --- /dev/null +++ b/src/mindspore/package-my/my/my-collection.json @@ -0,0 +1,6 @@ +{ + "usingComponents": { + "meeting-list": "/components/meeting-list/meeting-list" + }, + "navigationBarTitleText": "我收藏的会议" +} \ No newline at end of file diff --git a/src/mindspore/package-my/my/my-collection.wxml b/src/mindspore/package-my/my/my-collection.wxml new file mode 100644 index 0000000000000000000000000000000000000000..ed46844af2b649fcee45dcf8e6a4c8b47583d374 --- /dev/null +++ b/src/mindspore/package-my/my/my-collection.wxml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/mindspore/package-my/my/my-collection.wxss b/src/mindspore/package-my/my/my-collection.wxss new file mode 100644 index 0000000000000000000000000000000000000000..6ec15e4f49dfd62b357f113638de18bc3244dd2a --- /dev/null +++ b/src/mindspore/package-my/my/my-collection.wxss @@ -0,0 +1,7 @@ +/* pages/my/my-collection.wxss */ +page { + background-color: #f5f7fa !important; +} +.container { + padding-top: 30rpx; +} \ No newline at end of file diff --git a/src/mindspore/package-my/my/my-meetings.js b/src/mindspore/package-my/my/my-meetings.js new file mode 100644 index 0000000000000000000000000000000000000000..acc355e2fe5a2d8ef1bd16cd90fa461c969dd7e2 --- /dev/null +++ b/src/mindspore/package-my/my/my-meetings.js @@ -0,0 +1,8 @@ +// pages/my/my-meetings.js + +Page({ + /** + * 页面的初始数据 + */ + data: {}, +}); diff --git a/src/mindspore/package-my/my/my-meetings.json b/src/mindspore/package-my/my/my-meetings.json new file mode 100644 index 0000000000000000000000000000000000000000..e600d2930ed3ca88b20b0365d0285a85a0f6f4f2 --- /dev/null +++ b/src/mindspore/package-my/my/my-meetings.json @@ -0,0 +1,6 @@ +{ + "usingComponents": { + "meeting-list": "/components/meeting-list/meeting-list" + }, + "navigationBarTitleText": "我创建的会议" +} \ No newline at end of file diff --git a/src/mindspore/package-my/my/my-meetings.wxml b/src/mindspore/package-my/my/my-meetings.wxml new file mode 100644 index 0000000000000000000000000000000000000000..b9df297f56179b9f0f77204803eda5417be71446 --- /dev/null +++ b/src/mindspore/package-my/my/my-meetings.wxml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/mindspore/package-my/my/my-meetings.wxss b/src/mindspore/package-my/my/my-meetings.wxss new file mode 100644 index 0000000000000000000000000000000000000000..155e7a31aaf472048ba278909cc98f5a873e4658 --- /dev/null +++ b/src/mindspore/package-my/my/my-meetings.wxss @@ -0,0 +1,7 @@ +/* pages/my/my-meetings.wxss */ +page { + background-color: #f5f7fa !important; +} +.container { + padding-top: 30rpx; +} \ No newline at end of file diff --git a/src/mindspore/package-my/my/privecy.js b/src/mindspore/package-my/my/privecy.js new file mode 100644 index 0000000000000000000000000000000000000000..59441a09cafc6ae18055008879803e07c052c7b4 --- /dev/null +++ b/src/mindspore/package-my/my/privecy.js @@ -0,0 +1,47 @@ +// pages/my/privecy.js +Page({ + /** + * 页面的初始数据 + */ + data: {}, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function () {}, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () {}, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () {}, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () {}, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () {}, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () {}, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () {}, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () {}, +}); diff --git a/src/mindspore/package-my/my/privecy.json b/src/mindspore/package-my/my/privecy.json new file mode 100644 index 0000000000000000000000000000000000000000..8d1e7d7f43205e6dd7385b6979afcb79465003e3 --- /dev/null +++ b/src/mindspore/package-my/my/privecy.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "社区隐私声明" +} \ No newline at end of file diff --git a/src/mindspore/package-my/my/privecy.wxml b/src/mindspore/package-my/my/privecy.wxml new file mode 100644 index 0000000000000000000000000000000000000000..5810d8d8d770081e80dbff0f05b87a47716315c6 --- /dev/null +++ b/src/mindspore/package-my/my/privecy.wxml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/mindspore/package-my/my/privecy.wxss b/src/mindspore/package-my/my/privecy.wxss new file mode 100644 index 0000000000000000000000000000000000000000..736b4bf7abc395437354ea2ed0efe4ca3d443325 --- /dev/null +++ b/src/mindspore/package-my/my/privecy.wxss @@ -0,0 +1,9 @@ +/* pages/my/privecy.wxss */ +page { + background-color: #fff; +} + +.container image { + width: 690rpx; + height: 7872rpx; +} \ No newline at end of file diff --git a/src/mindspore/package-my/my/qrcode.js b/src/mindspore/package-my/my/qrcode.js new file mode 100644 index 0000000000000000000000000000000000000000..4f5181c20762188d94ac1d3800595ad8f84cf4b7 --- /dev/null +++ b/src/mindspore/package-my/my/qrcode.js @@ -0,0 +1,58 @@ +// package-my/my/qrcode.js +const resourceUrl = 'https://mindspore-website.obs.cn-north-4.myhuaweicloud.com:443/mindsporeMini/'; +Page({ + /** + * 页面的初始数据 + */ + data: { + type: 0, + data: [ + { + avatar: resourceUrl + 'official-acc.png', + }, + { + avatar: resourceUrl + 'live-b.png', + }, + { + avatar: resourceUrl + 'headline.png', + }, + ], + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + type: options.type - 1, + }); + }, + saveQrcode() { + const that = this; + wx.getSetting({ + success() { + wx.downloadFile({ + url: that.data.data[that.data.type].avatar, + success: function (res) { + wx.saveImageToPhotosAlbum({ + filePath: res.tempFilePath, + success: function () { + wx.showToast({ + title: '保存成功', + icon: 'success', + duration: 2000, + }); + }, + fail: function (err) { + console.log(err); + }, + complete(res) { + console.log(res); + }, + }); + }, + }); + }, + }); + }, +}); diff --git a/src/mindspore/package-my/my/qrcode.json b/src/mindspore/package-my/my/qrcode.json new file mode 100644 index 0000000000000000000000000000000000000000..8835af0699ccec004cbe685ef938cd2d63ea7037 --- /dev/null +++ b/src/mindspore/package-my/my/qrcode.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/src/mindspore/package-my/my/qrcode.wxml b/src/mindspore/package-my/my/qrcode.wxml new file mode 100644 index 0000000000000000000000000000000000000000..d1aa414a18f304d401c4763fc16d36d027392ee6 --- /dev/null +++ b/src/mindspore/package-my/my/qrcode.wxml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/mindspore/package-my/my/qrcode.wxss b/src/mindspore/package-my/my/qrcode.wxss new file mode 100644 index 0000000000000000000000000000000000000000..f7cf1a9002da8190d70f51468941df0b2c390f80 --- /dev/null +++ b/src/mindspore/package-my/my/qrcode.wxss @@ -0,0 +1,39 @@ +/* package-my/my/qrcode.wxss */ +.container { + padding: 0 50rpx 0 40rpx; +} + +.container .avatar { + margin-top: 10rpx; + width: 650rpx; + height: 1312rpx; +} + +.container .btn-box { + width: 100%; + height: 130rpx; + padding: 20rpx 30rpx; + border: 1px solid #F0F3F7; + background: #FFFFFF; + position: fixed; + bottom: 0; + left: 0; + display: flex; + justify-content: space-between; +} + +.container .btn-box button { + width: 330rpx; + height: 90rpx; + line-height: 90rpx; + border-radius: 20rpx; + background-color: #FFFFFF; + border: 1px solid #40ADFF; + text-align: center; + color: #40ADFF; +} + +.container .btn-box .save { + color: #FFFFFF; + background: #40ADFF; +} \ No newline at end of file diff --git a/src/mindspore/package.json b/src/mindspore/package.json new file mode 100644 index 0000000000000000000000000000000000000000..76c4827744c81da9107d7ab4f11c2faeb43d0aed --- /dev/null +++ b/src/mindspore/package.json @@ -0,0 +1,6 @@ +{ + "dependencies": { + "@vant/weapp": "^1.6.8", + "wxml-to-canvas": "^1.1.1" + } +} diff --git a/src/mindspore/pages/auth/auth.js b/src/mindspore/pages/auth/auth.js new file mode 100644 index 0000000000000000000000000000000000000000..6f6078e99e74a51d4a8dd10b3bacafc115a5ba03 --- /dev/null +++ b/src/mindspore/pages/auth/auth.js @@ -0,0 +1,71 @@ +// pages/auth/auth.js +const mixin = require('../../utils/page-mixin.js').$pageMixin; +const appUser = require('../../utils/app-user.js'); +let that = null; +Page( + mixin({ + /** + * 页面的初始数据 + */ + data: { + id: '', + canIUseGetUserProfile: false, + }, + onLoad(options) { + that = this; + if (options.id) { + this.setData({ + id: options.id, + }); + } + + if (wx.getUserProfile) { + this.setData({ + canIUseGetUserProfile: true, + }); + } + }, + onShow() {}, + /** + * 绑定获取用户信息 + */ + bindGetUserInfo: function () { + wx.getSetting({ + success: function (res) { + if (res.authSetting['scope.userInfo']) { + appUser.wxLogin(function () { + const pages = getCurrentPages(); // 当前页面 + const beforePage = pages[pages.length - 2]; // 前一个页面 + const id = beforePage.options.id || that.data.id; + const url = id ? '/' + beforePage.route + '?id=' + id : '/' + beforePage.route; + wx.reLaunch({ + url: url, + }); + }); + } + }, + }); + }, + bindGetUserProfile() { + wx.getUserProfile({ + desc: '用于会议和活动所需信息', + success: (res) => { + appUser.wxGetUserProfileLogin(function () { + const pages = getCurrentPages(); // 当前页面 + const beforePage = pages[pages.length - 2]; // 前一个页面 + const id = beforePage.options.id || that.data.id; + const url = id ? '/' + beforePage.route + '?id=' + id : '/' + beforePage.route; + wx.reLaunch({ + url: url, + }); + }, res.userInfo); + }, + }); + }, + toPrivacy() { + wx.navigateTo({ + url: '/package-my/my/privecy', + }); + }, + }) +); diff --git a/src/mindspore/pages/auth/auth.json b/src/mindspore/pages/auth/auth.json new file mode 100644 index 0000000000000000000000000000000000000000..a78fcb7d520e6041720a88cf55e6e6c22e8ef914 --- /dev/null +++ b/src/mindspore/pages/auth/auth.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "登录" +} \ No newline at end of file diff --git a/src/mindspore/pages/auth/auth.wxml b/src/mindspore/pages/auth/auth.wxml new file mode 100644 index 0000000000000000000000000000000000000000..d7bd61e88a1d3d7f82bab465605a2ad2f6780391 --- /dev/null +++ b/src/mindspore/pages/auth/auth.wxml @@ -0,0 +1,21 @@ + + + + + 为便于您在使用MindSpore小程序的过程中能够获得所有操作权限,需要您允许授权使用微信用户信息 + + + + 登录即表示同意隐私条款 + + \ No newline at end of file diff --git a/src/mindspore/pages/auth/auth.wxss b/src/mindspore/pages/auth/auth.wxss new file mode 100644 index 0000000000000000000000000000000000000000..0f463c26a96e34e573052e8cc8d3d5284d90ef17 --- /dev/null +++ b/src/mindspore/pages/auth/auth.wxss @@ -0,0 +1,74 @@ +/* pages/auth/auth.wxss */ +page { + background-color: #fff; + height: unset; +} + +.container { + padding: 0 !important; +} + +.container .img { + display: block; + width: 750rpx; + height: 448rpx; + margin: 0 auto; +} +.container .auth-logo { + display: block; + width: 169rpx; + height: 140rpx; + margin: 60rpx auto 0 auto; +} +.container .p { + margin-top: 40rpx; + line-height: 48rpx; + font-size: 34rpx; + color: #6d7278; + margin-bottom: 128rpx; + padding: 0 60rpx; + font-weight: 400; +} + +.container .button { + line-height: 90rpx; + padding: 0; + height: 90rpx; + width: 500rpx; + margin: 0 auto; + color: #fff; + font-size: 36rpx; + background-color: #40ADFF; + border-radius: 8rpx; + font-weight: normal; + box-shadow: 0px 5px 20px 0px rgba(126, 146, 178, 0.7); +} + +.container .button view { + height: 100%; + display: flex; + align-items: center; + justify-content: center; +} + +.container .button text { + vertical-align: middle; +} + +.container .button .wechat-icon { + vertical-align: middle; + margin-right: 20rpx; + width: 44rpx; + height: 36rpx; +} + +.container .privacy { + color: #6d7278; + font-size: 28prpx; + text-align: center; + margin-top: 30rpx; +} + +.container .privacy text { + color: #40ADFF; +} \ No newline at end of file diff --git a/src/mindspore/pages/events/events.js b/src/mindspore/pages/events/events.js new file mode 100644 index 0000000000000000000000000000000000000000..f6d5bfadd54391b10409b2798e5a3d631aaa8f2b --- /dev/null +++ b/src/mindspore/pages/events/events.js @@ -0,0 +1,307 @@ +// pages/events/events.js +const appAjax = require('./../../utils/app-ajax'); +const sessionUtil = require('../../utils/app-session.js'); +const appUser = require('../../utils/app-user.js'); +let that = null; + +let remoteMethods = { + getList: function (_callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'GET', + service: 'LATEST_EVENTS', + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, + delDraft: function (_callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'DELETE', + service: 'DRAFT_DETAIL', + otherParams: { + id: that.data.curId, + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, + delEvent: function (_callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'PUT', + service: 'DEL_EVENT', + otherParams: { + id: that.data.curId, + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, + collect: function (_callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'POST', + service: 'EVENT_COLLECT', + data: { + activity: that.data.curId, + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, + unCollect: function (_callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'DELETE', + service: 'EVENT_UNCOLLECT', + otherParams: { + id: that.data.collectionId, + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, + getSignUpInfo: function (id, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'GET', + service: 'GET_SIGNUP_INFO', + otherParams: { + id, + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, +}; +Page({ + /** + * 页面的初始数据 + */ + data: { + iphoneX: false, + level: 1, + noAuthDialogShow: false, + user: '', + list: [], + actionShow: false, + actions: [], + underDialogShow: false, + showDialogDel: false, + curId: '', + userId: '', + collectionId: '', + registerId: '', + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function () { + that = this; + this.setData({ + iphoneX: this.getTabBar().data.iPhoneX, + }); + appUser.updateUserInfo(function () { + that.setData({ + level: sessionUtil.getUserInfoByKey('eventLevel') || 1, + user: sessionUtil.getUserInfoByKey('userId'), + }); + remoteMethods.getList((res) => { + that.setData({ + list: res, + }); + }); + }); + }, + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + this.getTabBar().setData({ + _tabbat: 2, + }); + }, + navigateTo(e) { + const url = e.currentTarget.dataset.url; + if (this.data.level === 1 && url.includes('publish')) { + this.setData({ + noAuthDialogShow: true, + }); + return; + } + wx.navigateTo({ + url, + }); + }, + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + wx.stopPullDownRefresh(); + appUser.updateUserInfo(function () { + that.setData({ + level: sessionUtil.getUserInfoByKey('eventLevel') || 1, + }); + }); + }, + copyWechat() { + wx.setClipboardData({ + data: 'openeuler123', + success: () => { + this.setData({ + noAuthDialogShow: false, + underDialogShow: false, + }); + }, + }); + }, + onActionClose() { + this.setData({ + actionShow: false, + }); + this.getTabBar().setData({ + show: true, + }); + }, + onActionSelect(e) { + if (this.data.level == 3) { + if (e.detail.operaType == 1) { + if (this.data.collectionId) { + remoteMethods.unCollect(() => { + this.onLoad(); + }); + } else { + remoteMethods.collect(() => { + this.onLoad(); + }); + } + } else { + this.setData({ + showDialoogDel: true, + }); + } + } else { + if (e.detail.operaType == 1) { + if (this.data.collectionId) { + remoteMethods.unCollect(() => { + this.onLoad(); + }); + } else { + remoteMethods.collect(() => { + this.onLoad(); + }); + } + } else if (e.detail.operaType == 3) { + remoteMethods.getSignUpInfo(this.data.curId, (res) => { + wx.navigateTo({ + url: `/package-events/sign-up/sign-up-success?name=${encodeURIComponent( + res.name + )}&title=${encodeURIComponent(res.title)}&tel=${encodeURIComponent( + res.telephone + )}&poster=${encodeURIComponent(res.poster)}`, + }); + }); + } else { + this.setData({ + underDialogShow: true, + }); + } + } + }, + del() { + this.setData({ + showDialogDel: false, + }); + remoteMethods.delEvent(() => { + remoteMethods.getList((res) => { + this.setData({ + list: res, + }); + }); + }); + }, + delCancel() { + this.setData({ + showDialogDel: false, + }); + }, + onMore(e) { + this.getTabBar().setData({ + show: false, + }); + this.setData({ + actionShow: true, + curId: e.currentTarget.dataset.item.id, + userId: e.currentTarget.dataset.item.user, + collectionId: e.currentTarget.dataset.item.collection_id || '', + registerId: e.currentTarget.dataset.item.register_id || '', + }); + const strTemp = this.data.collectionId ? '取消收藏' : '收藏活动'; + if (this.data.level == 3) { + this.setData({ + actions: [ + { + name: strTemp, + operaType: 1, + }, + { + name: '下架活动', + operaType: 2, + }, + ], + }); + } else { + if (this.data.user == this.data.userId) { + this.setData({ + actions: [ + { + name: strTemp, + operaType: 1, + }, + { + name: '下架活动', + operaType: 2, + }, + ], + }); + } else { + this.setData({ + actions: [ + { + name: strTemp, + operaType: 1, + }, + ], + }); + } + + if (this.data.registerId) { + let tempArr = this.data.actions; + tempArr.unshift({ + name: '查看门票', + operaType: 3, + }); + this.setData({ + actions: tempArr, + }); + } + } + }, + toUpdateSchedule(e) { + console.log(e.currentTarget.dataset.id); + wx.navigateTo({ + url: `/package-events/events/event-detail?id=${e.currentTarget.dataset.id}&type=5`, + }); + }, + onPullDownRefresh: function () { + wx.stopPullDownRefresh(); + this.onLoad(); + }, +}); diff --git a/src/mindspore/pages/events/events.json b/src/mindspore/pages/events/events.json new file mode 100644 index 0000000000000000000000000000000000000000..214bdab32cffaafe01f6b78d112ae375f414aa25 --- /dev/null +++ b/src/mindspore/pages/events/events.json @@ -0,0 +1,9 @@ +{ + "usingComponents": { + "user-info": "/components/user-info/user-info" + }, + "navigationBarTitleText": "openEuler活动管理", + "enablePullDownRefresh": true, + "backgroundTextStyle": "dark", + "backgroundColor": "#fff" +} \ No newline at end of file diff --git a/src/mindspore/pages/events/events.wxml b/src/mindspore/pages/events/events.wxml new file mode 100644 index 0000000000000000000000000000000000000000..36c573da6dcecb9e56d431a46ab1bfa9a7ae46a3 --- /dev/null +++ b/src/mindspore/pages/events/events.wxml @@ -0,0 +1,115 @@ + + + + + + + 发起人管理 + + + + + 查看活动 + + + + 发布活动 + + + + 最新活动({{list.length}}) + + + + + {{item.enterprise}} + + + + + + + + {{item.title}} + + + {{item.date}} + + + + {{item.address||item.live_address}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 暂无活动! + + + + + 请确认下架当前活动 + + + + + + + + + + 活动一经发布,暂不支持自行下架删除。如有需要,请联系 + 小助手 (微信号openeuler123) + 下架活动 + + + + + + + + + + 您暂时没有发布活动的权限,请联系 + 小助手 (微信号openeuler123) + 提交发布活动权限申请 + + + + + + + \ No newline at end of file diff --git a/src/mindspore/pages/events/events.wxss b/src/mindspore/pages/events/events.wxss new file mode 100644 index 0000000000000000000000000000000000000000..9b33a69a59d0028c3bf533d5f7f03cfb48697983 --- /dev/null +++ b/src/mindspore/pages/events/events.wxss @@ -0,0 +1,211 @@ +/* pages/events/events.wxss */ +.container .meeting-level-wrapper { + margin: 60rpx 0; + font-size: 36rpx; + color: #333; +} + +.container .meeting-level-wrapper .sig-manage-btn { + margin-bottom: 30rpx; + background-color: #fff; + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; + height: 110rpx; + display: flex; + justify-content: center; + align-items: center; +} + +.container .meeting-level-wrapper .icon { + height: 63rpx; + width: 64rpx; + margin-right: 21rpx; +} + +.container .meeting-level-wrapper .tab-btn-wrapper { + display: flex; + justify-content: space-between; +} + +.container .meeting-level-wrapper .tab-btn-wrapper .btn { + height: 110rpx; + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; + width: 330rpx; + display: flex; + align-items: center; + justify-content: center; +} + +.container .latest-events { + margin-bottom: 30rpx; + color: #333; + font-size: 36rpx; + +} + +.container .event-list-wrapper .event-item { + margin-bottom: 30rpx; + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; + overflow: hidden; + position: relative; + background-color: #fff; +} + +.container .event-list-wrapper .event-item .collection { + width: 40rpx; + height: 26rpx; + position: absolute; + top: 33rpx; + left: 0; +} + +.container .event-list-wrapper .event-item .header { + height: 90rpx; + padding: 0 30rpx; + display: flex; + justify-content: space-between; + align-items: center; + font-size: 28rpx; + color: #333; + border-bottom: 2rpx solid #f0f3f7; +} + +.container .event-list-wrapper .event-item .isCollection { + padding-left: 60rpx; +} + +.container .event-list-wrapper .event-item .header image { + height: 36rpx; + width: 8rpx; +} + +.container .event-list-wrapper .event-item .body { + padding: 30rpx; + display: flex; +} + +.container .event-list-wrapper .event-item .body .left { + margin-right: 20rpx; +} + +.container .event-list-wrapper .event-item .body .left image { + width: 241rpx; + height: 241rpx; + border-radius: 8rpx; +} + +.container .event-list-wrapper .event-item .body .right .title { + font-size: 30rpx; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + margin-bottom: 20rpx; + width: 380rpx; +} + +.container .event-list-wrapper .event-item .body .right .date { + margin-bottom: 20rpx; + font-size: 24rpx; + color: #6d7278; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + width: 380rpx; +} + +.container .event-list-wrapper .event-item .body .right .date image { + height: 28rpx; + width: 28rpx; + margin-right: 16rpx; + vertical-align: middle; +} +.container .event-list-wrapper .event-item .body .right .date text { + vertical-align: middle; +} + +.container .event-list-wrapper .event-item .body .right .address { + font-size: 24rpx; + color: #6d7278; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + width: 380rpx; + margin-bottom: 30rpx; +} + +.container .event-list-wrapper .event-item .body .right .address image { + height: 28rpx; + width: 28rpx; + margin-right: 16rpx; + vertical-align: middle; +} + +.container .event-list-wrapper .event-item .body .right .address image text { + vertical-align: middle; +} + +.container .event-list-wrapper .event-item .body .right .button { + text-align: right; + height: 68rpx; +} + +.container .event-list-wrapper .event-item .body .right .button button { + height: 68rpx; + width: 172rpx; + text-align: center; + line-height: 68rpx; + color: #fff; + background-color: #40ADFF; + border-radius: 8rpx; + font-size: 28rpx; + display: inline-block; +} + +.container .event-list-wrapper .event-item .body .right .button .register { + background-color: #6682ca; +} + +.container .event-list-wrapper .event-item .mask { + position: absolute; + height: 100%; + width: 100%; + background-color: #40ADFF; + opacity: 0.65; + top: 0; + left: 0; +} + +.container .event-list-wrapper .event-item .mask .mask-img { + position: absolute; + height: 137rpx; + width: 180rpx; + left: 50%; + top: 50%; + margin-left: -90rpx; + margin-top: -68rpx; +} + +.empty-status .suc-wrapper { + position: absolute; + top: 50%; + transform: translate(-50%, -50%); + left: 50%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.empty-status .suc-wrapper image { + width: 234rpx; + height: 218rpx; +} + +.empty-status .suc-wrapper text { + text-align: center; + margin-top: 20rpx; + font-size: 34rpx; + color: #333; +} \ No newline at end of file diff --git a/src/mindspore/pages/index/index.js b/src/mindspore/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..3f0223ff3c182bf5ba8285ac98294cd8036306d1 --- /dev/null +++ b/src/mindspore/pages/index/index.js @@ -0,0 +1,91 @@ +//index.js +const mixin = require('../../utils/page-mixin.js').$pageMixin; +const sessionUtil = require('../../utils/app-session.js'); +const appUser = require('../../utils/app-user.js'); +let that = null; +Page( + mixin({ + data: { + imgUrls: [ + { + url: '/static/index/banner-1.png', + }, + ], + iphoneX: false, + meetingConponent: null, + autoplay: true, + }, + swithTab(e) { + if (!sessionUtil.getUserInfoByKey('access')) { + wx.navigateTo({ + url: '/pages/auth/auth', + }); + return; + } + wx.switchTab({ + url: e.currentTarget.dataset.url, + }); + }, + previewImage(e) { + const current = e.target.dataset.src; //获取当前点击的 图片 url + wx.previewImage({ + current, + urls: [current], + }); + }, + onLoad: function () { + that = this; + appUser.updateUserInfo(function () { + that.setData({ + meetingConponent: that.selectComponent('.meeting1'), + iphoneX: that.getTabBar().data.iPhoneX, + }); + }); + }, + onShow: function () { + this.getTabBar().setData({ + _tabbat: 0, + }); + }, + onPullDownRefresh: function () { + wx.stopPullDownRefresh(); + appUser.updateUserInfo(function () { + that.data.meetingConponent.initData(); + }); + }, + actionStatus(e) { + if (e.detail === 1) { + this.getTabBar().setData({ + show: false, + }); + } else { + this.getTabBar().setData({ + show: true, + }); + } + }, + checkLogin() { + if (!sessionUtil.getUserInfoByKey('access')) { + wx.navigateTo({ + url: '/pages/auth/auth', + }); + return; + } + }, + play() { + this.setData({ + autoplay: false, + }); + }, + pause() { + this.setData({ + autoplay: true, + }); + }, + ended() { + this.setData({ + autoplay: true, + }); + }, + }) +); diff --git a/src/mindspore/pages/index/index.json b/src/mindspore/pages/index/index.json new file mode 100644 index 0000000000000000000000000000000000000000..9a9cd8f381c6df2c1091eb8e37da31fc1d1dedc9 --- /dev/null +++ b/src/mindspore/pages/index/index.json @@ -0,0 +1,10 @@ +{ + "usingComponents": { + "user-info": "/components/user-info/user-info", + "meeting-list": "/components/meeting-list/meeting-list" + }, + "navigationBarTitleText": "MindSpore", + "enablePullDownRefresh": true, + "backgroundTextStyle": "dark", + "backgroundColor":"#fff" +} \ No newline at end of file diff --git a/src/mindspore/pages/index/index.wxml b/src/mindspore/pages/index/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..f0cc0b1646ed324e46c5e4107483db9307c5d8da --- /dev/null +++ b/src/mindspore/pages/index/index.wxml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + 会议 + + + + + 活动 + + + + + \ No newline at end of file diff --git a/src/mindspore/pages/index/index.wxss b/src/mindspore/pages/index/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..e0c066194df109028a7c0d9769bae0c4a46fa6b8 --- /dev/null +++ b/src/mindspore/pages/index/index.wxss @@ -0,0 +1,58 @@ +/**index.wxss**/ +page { + background-color: #fff; +} + +.container swiper { + height: 378rpx; + border-radius: 8rpx; + overflow: hidden; + box-shadow: 0px 5px 15px 0px rgba(225, 230, 238, 1); +} + +.container swiper .slide-image { + height: 378rpx; + width: 690rpx; +} + +.container .tab-btn-wrapper { + margin: 60rpx 0; + display: flex; + justify-content: space-between; +} + +.container .tab-btn-wrapper .btn { + width: 330rpx; + height: 110rpx; + background-color: #fff; + box-shadow: 0 6rpx 20rpx 0 rgba(22, 124, 202, 0.15); + border-radius: 8rpx; + display: flex; + justify-content: center; + align-items: center; + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUoAAABuCAYAAABBY1qRAAAMo0lEQVR4Xu2dC1PjOgyFU1p2gfv//+le7vJq7pwUQ2jT5mFblpPPMww7S/zIkX0iS7K8+/Patg1ltQjsd03ze980u91qX9HVix3bpvnv3dWQGEwCBHYQZQIUnTdxt2uah0PTwJU2gvpom+YvZGkDtlEvEKUR0KW7OdydNEuKDQKQpQ3OVr1AlFZIO+hHWqW24hQbBCBLG5wteoEoLVB20odIUmRJsUMAsrTDOmdPEGVOdB22/SRbJVqlqWTk4JHNEq+pKexJO4Mok8LpvzG232VkBFmWwT1VrxBlKiQraUcOHTl2KPYIKBDv70fTiDQpdSEAUdYlr+jRPuybZg9RRuO4tAGR5ctH08h2SakHAYiyHlklGenjoWkUV0kpi4DI8v1Ydgz0Ph0BiHI6VtU/KX58uq/+NVbzAm/Hpnn9WM3rrPpFIMpVi/fny93fNc0vgs5dSZzwIVfiuDoYiLIOOUWPUtrk4z3HGKOBzNAAHvEMoCZuEqJMDKjX5vB2e5XMaVyQpW/5QJS+5ZNkdGy5k8CYvZGP4yl8iOIPAYjSn0ySjgiSTApn9sbwhmeHeFEHEOUi2OqoxHa7Djn1R6k4y2dStLkTHETpTiTxA1KcpEiSeMl4LEu0oJAhhQ5R/CAAUfqRRfRIRIzaanNEMRrKog2gVRaFf7BziNKfTGaNSGE/OpIociTX5CzoXD+MVulLPBClL3mMjkZao8hRv0WQkOMoZFU+gFbpS2wQpaE8AskpH6TILvzWEK7liAzHssPzhsOlq8II4AEvLIBe9xBlJllI0xMx9n8ydUWzK0WAGx39CBaiTCSLbivMdjgRmjQTEFBmdFKylZ8Pu+e3tiWR6DJBiBzlRDloK03qsmUgUusmAkrFpi04pSwCu49j23Jh+zwhiBwVhkOc4jzceHoZAgpAl3OHUg6BXdu2LV+tcQFIYbzXNQpoj+Ng8URSBMhbmRTORY11RKmaeNiG8fsiyDtSlC2aYVSKRoBQoWgIoxv4IkqxpQzH2Cu/Mf0l++MegoyeZTQQjQCKTDSEkxoIMcr9aJUujC9olGpFXy7ZK7duDpENUiSJg2bS3OIhAwTIhJ4H5HCyrR/ON9TTD6LUA1uO3dJXRFclcNolz6Sk1TgEcOrE4RcObQRS1O+pytAFUWooW/x6yYstZw1RPnGTkdr5EMCpMw1bkZ+crmH73D8BN62Fy6cGiVKPbcUTTkqypVOHetYI4NS5jXgX05wp/8FVotwCWaJFWi91+otFQFdF6MoIyjcCFj6Fm0S5VrLU9lqJbZV9hwICNSGwRbPYNflo/crpanHwY5Qo10aWMuCKJKcacWtaRIx1GwgoMmXrYXzW15xMIsq1OHjk0dZ2mwICNSOwFf/BkIyk6GgdW2iR/f4nE6Uq1Xr3cLfVPhD2UzM5MPafCGwxVEjbbEWmlCiziFIDlOdNpwRqSf3EVrvEtKLP3AhsKVTIg6IzmyjDBKjhTg+22rmXK+2XQkCn57pTdCs/RudF0VlMlMHJI8L0Jis5ajqvNtHjpdYx/RogsHZbpfwJUnY8lCii/NqKH/3EdlnEVHkQHGMAASGwVg+4tVd7bDZFE2XoQF+30tqlN3DHwOfvIBCLwNriKrUJfDjYe7XH5JCMKIN2+Xo8HX+0LAo8/U22H0vI6csRAjX4C6bA5cUe2R+rbMDitKREGTpQGJEaz33UqrNF6mwnsZFT5iHPrBSBNeSS9WSPHNolZyHK0JG2BW8ZQolC1nGCx1e68nmt2QhUHePs7Dhxp+id8VZWouxrmNqO6yfGQ65ofJGjNEgc2rPXEhVWjkBtuWS9bbWFn+JTh0yHJkTZn5/SMrUl1+8p51VDkk15s62PLa18XfF6K0SgFueOpxjnWwQZpog5UZ7PTQ1SWmY/cDZkIoYYV7iSeaXsCIgsX5xe6VLqrPYQ6MIp7HTHhFKcKMcGyN9BAATmIyAFREeNp+za5rc+v4aUH2mR2hmWLtrRaos95xg2RFlaavQPApkQ0E5NzlSRQsnSJch2EL4n7VFYLPl47F7e2xb7X8lpRN8gkBcBaU7y4i4hiJiRiVdEkCVNaPpYSINUuGLMufjdn9dTdQ8vFSMU6oIACNxGIBBGTsLUFjtwSenk2N1pwUiCDIh+EWX4DwiT5QYC60ZARJkiXO+LRD7JUWF7HhLR6IPwkoggrxJl+AMXb617sfB2ICAERJohVE97yxCFcgudcA2sfofwPQ9o5jwReKFR9l+YI4IexM8YQMAegc4e9xm6p392Bzx2fg965E5kfJMo0S7tJyg9ggAITEegu3HBIq9EcOaMDU1qttKYlfRgjY2Rv4MACGwHAZGk7jnP6ZwatVEOwe01V9x2pgZvCgIg0FkF2s+rMIzgmLT1Ph+LEmt68G4ZYUQ3IAACjhAokVZuEVEKM7KJO5o5DAUENoSAttu5c92ew7mYKNUQmuWGZievCgIOEMjt3b72ilFEqUYfHd5v4UCeDAEEQCAxAiVTyEUTJQ6exLOB5kAABC4QKGGX7A8imijVmBw72oZTQAAEQCAHAsqCpHPbpUoSotTgPV4OVApU+gUBEEiHgEKBnt/TtbekpWREqc4fnF0StAQQ6oAACPhCwMN1vEmJUmfD5dzh4i9fE43RgECtCHjQJoVdUqJkC17rdGTcIOATgVLhQOdoJCdKdUDIkM9Jx6hAoDYEZJuMyUye6n2zEKWS/+rkDgUEQAAEliLg6Z7yLESJVrl0alAPBEAgIODBiRPGko0o0SqZ8CAAAjEI/Pduk0JtyhizEaU6f5IHHBf4FDnwTAIEuqsMPlNwqTmd5tD/ddm6eyVMSc1N/Vu/dd00czWBEBI28e9bwsYim8pKlLrwXIHoFBBIiUC420U2LBFjd8/LACHO7VOkeX4fDOQ5F8U0z3uyT+qNshKlJp084BQQiEGgI8TeJVgWGa3DeMMFWl5uGIzBsaa6SqOmdGpeSlai1EsSKuRF1PWMQ1vlo+5B0bWqn9qih9GHO6tlf+dKlLwS0XW6L1siSs6A551Qa2ldW+eOGD8J0vt7iSg1t0WalPQIeAk0D2+WXaNk+51+Eq2lxdrIcQh32TADYeK3TDczN0eUgg7vd7oJtIaWguYo7XEtRYT5Cw0zmTg3SZTcr5Ns/lTbkBwwIkb9nIfrVPtSAwPXDkrRHly+FyfVzdkoBRd2yrhJU3PtQI7SIrdUZLuUhkl40TKpl7z2YdDE8uc1/5FzMqAvmyy11tKM0tZp7drjmHxks5R2icNnDKnLv3tJr2bmzFFHOHTmT5Qaa6zR9phCDmiXy1B8fvNjpsnu9Q4Q/XO/DCxq+UdAmqM0SMtAcP+o/ByhtuC6AYD4y+mSUxylF4efGVHi+Z4+QWp4UlsjBYPr0qeNmR+jxINjczp8nhw6ZkTJCZ3pE8Tzk8H+KA2SsgyBbiu+58qUMfQ82SkhyjFp8fcOAW2rg4MGSOIRkINT2iVe8dtYetl+mxGl7v0mtix+gVm3IAeNttdbC++xwFn2SpEldsvraHsJE4IoLVZEhX3goLERmkKIpERAltfx9pDAF6K0WQ9V9CKnjNJbver0DB4aU5lhw7+hVTpIuWZGlEwE03U3qzNxYqdB4sGehVvqhzFPXUdUuSn1ES9VIMpSyDvolxM0DoRwNoTfh6Y5kIboQjClM56bESVxlH4WJSE+fmQxNBJiLYflUzKu0oQo9YF84mRO8dVJiE9xEUwegBJq3O8nP76ZB0uFC5kQJWe9y85jzmCXxX9p72TdukRO9vS/Ba6xNSFK7vheulTi6gUPNmew43AsWZvA9AGybE8Xj1nOaxOi5Npa26VGDKQt3rl7IzC9PFmaECVhD7mX0inusUtSQQxkfrAL9CA7vzzinG77Bl9z3kqzzE6UOHLyrio82Hnx9dY6u7OfEpHN8tUgHVt2oiS7eZ6lhgc7D641tEoi4Esp5Q4dyk6UfAHTLj3sj2nxrLU17JbDdksdv82R7Dc7URJoHr8UsT/GY7jWFlBELiWbI+NVVqJk2x23PNlex+G3ldpaZyJMMhD9lHiK9SMfi0wdWYmSo1jzl2rI4MMdNPOx23oNtMvhGaA1dTyecqrqZyz+Uh8cfXz2d99RBtmIUkz8eE+6+6mLV8ILd2CT4Wwqajx3jgC2y2lzQuas82RE4qxrWnk2ouTrNi6woD2KIMkgPo4XT0xHAM/4dKymPJmFKNEmb0PP2espU5NnUiCg5BoHLjKLhjILUZL5ZDh0QSdnpD2O2UiipUoDINBDQIqLMhF1TgmQWYRAcqLUrXLKZo5Avo8VQo6L5iaVEiMQPLjKSsTtj/PA/R/ljU5+Awg54QAAAABJRU5ErkJggg==) no-repeat; + background-size:100% 100%; +} + +.container .tab-btn-wrapper .events { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUoAAABuCAYAAABBY1qRAAAMo0lEQVR4Xu2dC1PjOgyFU1p2gfv//+le7vJq7pwUQ2jT5mFblpPPMww7S/zIkX0iS7K8+/Patg1ltQjsd03ze980u91qX9HVix3bpvnv3dWQGEwCBHYQZQIUnTdxt2uah0PTwJU2gvpom+YvZGkDtlEvEKUR0KW7OdydNEuKDQKQpQ3OVr1AlFZIO+hHWqW24hQbBCBLG5wteoEoLVB20odIUmRJsUMAsrTDOmdPEGVOdB22/SRbJVqlqWTk4JHNEq+pKexJO4Mok8LpvzG232VkBFmWwT1VrxBlKiQraUcOHTl2KPYIKBDv70fTiDQpdSEAUdYlr+jRPuybZg9RRuO4tAGR5ctH08h2SakHAYiyHlklGenjoWkUV0kpi4DI8v1Ydgz0Ph0BiHI6VtU/KX58uq/+NVbzAm/Hpnn9WM3rrPpFIMpVi/fny93fNc0vgs5dSZzwIVfiuDoYiLIOOUWPUtrk4z3HGKOBzNAAHvEMoCZuEqJMDKjX5vB2e5XMaVyQpW/5QJS+5ZNkdGy5k8CYvZGP4yl8iOIPAYjSn0ySjgiSTApn9sbwhmeHeFEHEOUi2OqoxHa7Djn1R6k4y2dStLkTHETpTiTxA1KcpEiSeMl4LEu0oJAhhQ5R/CAAUfqRRfRIRIzaanNEMRrKog2gVRaFf7BziNKfTGaNSGE/OpIociTX5CzoXD+MVulLPBClL3mMjkZao8hRv0WQkOMoZFU+gFbpS2wQpaE8AskpH6TILvzWEK7liAzHssPzhsOlq8II4AEvLIBe9xBlJllI0xMx9n8ydUWzK0WAGx39CBaiTCSLbivMdjgRmjQTEFBmdFKylZ8Pu+e3tiWR6DJBiBzlRDloK03qsmUgUusmAkrFpi04pSwCu49j23Jh+zwhiBwVhkOc4jzceHoZAgpAl3OHUg6BXdu2LV+tcQFIYbzXNQpoj+Ng8URSBMhbmRTORY11RKmaeNiG8fsiyDtSlC2aYVSKRoBQoWgIoxv4IkqxpQzH2Cu/Mf0l++MegoyeZTQQjQCKTDSEkxoIMcr9aJUujC9olGpFXy7ZK7duDpENUiSJg2bS3OIhAwTIhJ4H5HCyrR/ON9TTD6LUA1uO3dJXRFclcNolz6Sk1TgEcOrE4RcObQRS1O+pytAFUWooW/x6yYstZw1RPnGTkdr5EMCpMw1bkZ+crmH73D8BN62Fy6cGiVKPbcUTTkqypVOHetYI4NS5jXgX05wp/8FVotwCWaJFWi91+otFQFdF6MoIyjcCFj6Fm0S5VrLU9lqJbZV9hwICNSGwRbPYNflo/crpanHwY5Qo10aWMuCKJKcacWtaRIx1GwgoMmXrYXzW15xMIsq1OHjk0dZ2mwICNSOwFf/BkIyk6GgdW2iR/f4nE6Uq1Xr3cLfVPhD2UzM5MPafCGwxVEjbbEWmlCiziFIDlOdNpwRqSf3EVrvEtKLP3AhsKVTIg6IzmyjDBKjhTg+22rmXK+2XQkCn57pTdCs/RudF0VlMlMHJI8L0Jis5ajqvNtHjpdYx/RogsHZbpfwJUnY8lCii/NqKH/3EdlnEVHkQHGMAASGwVg+4tVd7bDZFE2XoQF+30tqlN3DHwOfvIBCLwNriKrUJfDjYe7XH5JCMKIN2+Xo8HX+0LAo8/U22H0vI6csRAjX4C6bA5cUe2R+rbMDitKREGTpQGJEaz33UqrNF6mwnsZFT5iHPrBSBNeSS9WSPHNolZyHK0JG2BW8ZQolC1nGCx1e68nmt2QhUHePs7Dhxp+id8VZWouxrmNqO6yfGQ65ofJGjNEgc2rPXEhVWjkBtuWS9bbWFn+JTh0yHJkTZn5/SMrUl1+8p51VDkk15s62PLa18XfF6K0SgFueOpxjnWwQZpog5UZ7PTQ1SWmY/cDZkIoYYV7iSeaXsCIgsX5xe6VLqrPYQ6MIp7HTHhFKcKMcGyN9BAATmIyAFREeNp+za5rc+v4aUH2mR2hmWLtrRaos95xg2RFlaavQPApkQ0E5NzlSRQsnSJch2EL4n7VFYLPl47F7e2xb7X8lpRN8gkBcBaU7y4i4hiJiRiVdEkCVNaPpYSINUuGLMufjdn9dTdQ8vFSMU6oIACNxGIBBGTsLUFjtwSenk2N1pwUiCDIh+EWX4DwiT5QYC60ZARJkiXO+LRD7JUWF7HhLR6IPwkoggrxJl+AMXb617sfB2ICAERJohVE97yxCFcgudcA2sfofwPQ9o5jwReKFR9l+YI4IexM8YQMAegc4e9xm6p392Bzx2fg965E5kfJMo0S7tJyg9ggAITEegu3HBIq9EcOaMDU1qttKYlfRgjY2Rv4MACGwHAZGk7jnP6ZwatVEOwe01V9x2pgZvCgIg0FkF2s+rMIzgmLT1Ph+LEmt68G4ZYUQ3IAACjhAokVZuEVEKM7KJO5o5DAUENoSAttu5c92ew7mYKNUQmuWGZievCgIOEMjt3b72ilFEqUYfHd5v4UCeDAEEQCAxAiVTyEUTJQ6exLOB5kAABC4QKGGX7A8imijVmBw72oZTQAAEQCAHAsqCpHPbpUoSotTgPV4OVApU+gUBEEiHgEKBnt/TtbekpWREqc4fnF0StAQQ6oAACPhCwMN1vEmJUmfD5dzh4i9fE43RgECtCHjQJoVdUqJkC17rdGTcIOATgVLhQOdoJCdKdUDIkM9Jx6hAoDYEZJuMyUye6n2zEKWS/+rkDgUEQAAEliLg6Z7yLESJVrl0alAPBEAgIODBiRPGko0o0SqZ8CAAAjEI/Pduk0JtyhizEaU6f5IHHBf4FDnwTAIEuqsMPlNwqTmd5tD/ddm6eyVMSc1N/Vu/dd00czWBEBI28e9bwsYim8pKlLrwXIHoFBBIiUC420U2LBFjd8/LACHO7VOkeX4fDOQ5F8U0z3uyT+qNshKlJp084BQQiEGgI8TeJVgWGa3DeMMFWl5uGIzBsaa6SqOmdGpeSlai1EsSKuRF1PWMQ1vlo+5B0bWqn9qih9GHO6tlf+dKlLwS0XW6L1siSs6A551Qa2ldW+eOGD8J0vt7iSg1t0WalPQIeAk0D2+WXaNk+51+Eq2lxdrIcQh32TADYeK3TDczN0eUgg7vd7oJtIaWguYo7XEtRYT5Cw0zmTg3SZTcr5Ns/lTbkBwwIkb9nIfrVPtSAwPXDkrRHly+FyfVzdkoBRd2yrhJU3PtQI7SIrdUZLuUhkl40TKpl7z2YdDE8uc1/5FzMqAvmyy11tKM0tZp7drjmHxks5R2icNnDKnLv3tJr2bmzFFHOHTmT5Qaa6zR9phCDmiXy1B8fvNjpsnu9Q4Q/XO/DCxq+UdAmqM0SMtAcP+o/ByhtuC6AYD4y+mSUxylF4efGVHi+Z4+QWp4UlsjBYPr0qeNmR+jxINjczp8nhw6ZkTJCZ3pE8Tzk8H+KA2SsgyBbiu+58qUMfQ82SkhyjFp8fcOAW2rg4MGSOIRkINT2iVe8dtYetl+mxGl7v0mtix+gVm3IAeNttdbC++xwFn2SpEldsvraHsJE4IoLVZEhX3goLERmkKIpERAltfx9pDAF6K0WQ9V9CKnjNJbver0DB4aU5lhw7+hVTpIuWZGlEwE03U3qzNxYqdB4sGehVvqhzFPXUdUuSn1ES9VIMpSyDvolxM0DoRwNoTfh6Y5kIboQjClM56bESVxlH4WJSE+fmQxNBJiLYflUzKu0oQo9YF84mRO8dVJiE9xEUwegBJq3O8nP76ZB0uFC5kQJWe9y85jzmCXxX9p72TdukRO9vS/Ba6xNSFK7vheulTi6gUPNmew43AsWZvA9AGybE8Xj1nOaxOi5Npa26VGDKQt3rl7IzC9PFmaECVhD7mX0inusUtSQQxkfrAL9CA7vzzinG77Bl9z3kqzzE6UOHLyrio82Hnx9dY6u7OfEpHN8tUgHVt2oiS7eZ6lhgc7D641tEoi4Esp5Q4dyk6UfAHTLj3sj2nxrLU17JbDdksdv82R7Dc7URJoHr8UsT/GY7jWFlBELiWbI+NVVqJk2x23PNlex+G3ldpaZyJMMhD9lHiK9SMfi0wdWYmSo1jzl2rI4MMdNPOx23oNtMvhGaA1dTyecqrqZyz+Uh8cfXz2d99RBtmIUkz8eE+6+6mLV8ILd2CT4Wwqajx3jgC2y2lzQuas82RE4qxrWnk2ouTrNi6woD2KIMkgPo4XT0xHAM/4dKymPJmFKNEmb0PP2espU5NnUiCg5BoHLjKLhjILUZL5ZDh0QSdnpD2O2UiipUoDINBDQIqLMhF1TgmQWYRAcqLUrXLKZo5Avo8VQo6L5iaVEiMQPLjKSsTtj/PA/R/ljU5+Awg54QAAAABJRU5ErkJggg==) no-repeat; + background-size:100% 100%; +} + +.container .tab-btn-wrapper .btn .icon { + width: 54rpx; + height: 54rpx; + margin-right: 14rpx; +} + +.container .tab-btn-wrapper .btn text { + color: #333; + font-size: 36rpx; + margin-right: 48rpx; +} + +.container .tab-btn-wrapper .btn .arrow { + width: 30rpx; + height: 30rpx; + margin-right: -33px; +} \ No newline at end of file diff --git a/src/mindspore/pages/meeting/meeting.js b/src/mindspore/pages/meeting/meeting.js new file mode 100644 index 0000000000000000000000000000000000000000..5ef96b440d1cae3c15bda3a09ba29957484c45a5 --- /dev/null +++ b/src/mindspore/pages/meeting/meeting.js @@ -0,0 +1,86 @@ +// pages/meeting/meeting.js +const mixin = require('../../utils/page-mixin.js').$pageMixin; +const sessionUtil = require('../../utils/app-session.js'); +const appUser = require('../../utils/app-user.js'); +let that = null; + +Page( + mixin({ + /** + * 页面的初始数据 + */ + data: { + noAuthDialogShow: false, + iphoneX: false, + meetingConponent: null, + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function () { + this.setData({ + iphoneX: this.getTabBar().data.iPhoneX, + meetingConponent: this.selectComponent('#meeting'), + }); + let that = this; + + appUser.updateUserInfo(function () { + that.setData({ + level: sessionUtil.getUserInfoByKey('level'), + }); + }); + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + that = this; + this.getTabBar().setData({ + _tabbat: 1, + }); + }, + onPullDownRefresh: function () { + wx.stopPullDownRefresh(); + appUser.updateUserInfo(function () { + that.setData({ + level: sessionUtil.getUserInfoByKey('level'), + }); + that.data.meetingConponent.initData(); + }); + }, + actionStatus(e) { + if (e.detail === 1) { + this.getTabBar().setData({ + show: false, + }); + } else { + this.getTabBar().setData({ + show: true, + }); + } + }, + navigateTo(e) { + const url = e.currentTarget.dataset.url; + if (this.data.level === 1 && url.includes('reserve')) { + this.setData({ + noAuthDialogShow: true, + }); + return; + } + wx.navigateTo({ + url, + }); + }, + copyWechat() { + wx.setClipboardData({ + data: 'mindspore0328', + success: () => { + this.setData({ + noAuthDialogShow: false, + }); + }, + }); + }, + }) +); diff --git a/src/mindspore/pages/meeting/meeting.json b/src/mindspore/pages/meeting/meeting.json new file mode 100644 index 0000000000000000000000000000000000000000..05308d2f3d5de88151da4a36d9b27dafd5e8b312 --- /dev/null +++ b/src/mindspore/pages/meeting/meeting.json @@ -0,0 +1,10 @@ +{ + "usingComponents": { + "user-info": "/components/user-info/user-info", + "meeting-list": "/components/meeting-list/meeting-list" + }, + "navigationBarTitleText": "MindSpore会议管理", + "enablePullDownRefresh": true, + "backgroundTextStyle": "dark", + "backgroundColor": "#fff" +} \ No newline at end of file diff --git a/src/mindspore/pages/meeting/meeting.wxml b/src/mindspore/pages/meeting/meeting.wxml new file mode 100644 index 0000000000000000000000000000000000000000..e78f20221021b82557cb0dc477f80318504718ae --- /dev/null +++ b/src/mindspore/pages/meeting/meeting.wxml @@ -0,0 +1,29 @@ + + + + + + + 用户管理 + + + + + 查看会议 + + + + 预定会议 + + + + + + + 您暂时没有预定会议的权限,请联系小助手(微信号mindspore0328) 提交预定会议权限申请 + + + + + + \ No newline at end of file diff --git a/src/mindspore/pages/meeting/meeting.wxss b/src/mindspore/pages/meeting/meeting.wxss new file mode 100644 index 0000000000000000000000000000000000000000..4b74939826334c348941813e72b6225914849abf --- /dev/null +++ b/src/mindspore/pages/meeting/meeting.wxss @@ -0,0 +1,42 @@ +/* pages/meeting/meeting.wxss */ +.container { + background-color: #fff; +} + +.container .meeting-level-wrapper { + margin: 60rpx 0; + font-size: 36rpx; + color: #333; +} + +.container .meeting-level-wrapper .sig-manage-btn { + margin-bottom: 30rpx; + background-color: #fff; + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; + height: 110rpx; + display: flex; + justify-content: center; + align-items: center; +} + +.container .meeting-level-wrapper .icon { + height: 63rpx; + width: 64rpx; + margin-right: 21rpx; +} + +.container .meeting-level-wrapper .tab-btn-wrapper { + display: flex; + justify-content: space-between; +} + +.container .meeting-level-wrapper .tab-btn-wrapper .btn { + height: 110rpx; + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; + width: 330rpx; + display: flex; + align-items: center; + justify-content: center; +} diff --git a/src/mindspore/pages/my/my.js b/src/mindspore/pages/my/my.js new file mode 100644 index 0000000000000000000000000000000000000000..29bb88bcf78ff2018cfdcea29f5c6d87221513d2 --- /dev/null +++ b/src/mindspore/pages/my/my.js @@ -0,0 +1,87 @@ +// pages/my/my.js +const appAjax = require('./../../utils/app-ajax'); +const sessionUtil = require('../../utils/app-session.js'); + +let remoteMethods = { + getMyMeeting: function (_callback) { + appAjax.postJson({ + type: 'GET', + service: 'GET_MY_MEETING', + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, + getMyCollect: function (_callback) { + appAjax.postJson({ + type: 'GET', + service: 'GET_MY_COLLECT', + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, +}; +Page({ + /** + * 页面的初始数据 + */ + data: { + iphoneX: false, + avatarUrl: '', + nickName: '', + level: 1, + avtivityLevel: 1, + meetingCount: 0, + collectCount: 0, + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function () { + this.setData({ + iphoneX: this.getTabBar().data.iPhoneX, + avatarUrl: sessionUtil.getUserInfoByKey('avatarUrl'), + nickName: sessionUtil.getUserInfoByKey('nickName'), + level: sessionUtil.getUserInfoByKey('level'), + avtivityLevel: sessionUtil.getUserInfoByKey('eventLevel'), + }); + remoteMethods.getMyMeeting((res) => { + this.setData({ + meetingCount: res.length, + }); + }); + remoteMethods.getMyCollect((res) => { + this.setData({ + collectCount: res.length, + }); + }); + }, + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + this.getTabBar().setData({ + _tabbat: 3, + }); + }, + go(e) { + wx.navigateTo({ + url: e.currentTarget.dataset.url, + }); + }, + onPullDownRefresh() { + wx.stopPullDownRefresh(); + remoteMethods.getMyMeeting((res) => { + this.setData({ + meetingCount: res.length, + }); + }); + remoteMethods.getMyCollect((res) => { + this.setData({ + collectCount: res.length, + }); + }); + }, +}); diff --git a/src/mindspore/pages/my/my.json b/src/mindspore/pages/my/my.json new file mode 100644 index 0000000000000000000000000000000000000000..5a3a277e0c1dbdf75a5e8c00cc5bd7af2e319900 --- /dev/null +++ b/src/mindspore/pages/my/my.json @@ -0,0 +1,9 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "我的", + "navigationBarBackgroundColor": "#40ADFF", + "navigationBarTextStyle": "white", + "enablePullDownRefresh": true, + "backgroundTextStyle": "light", + "backgroundColor": "#40ADFF" +} \ No newline at end of file diff --git a/src/mindspore/pages/my/my.wxml b/src/mindspore/pages/my/my.wxml new file mode 100644 index 0000000000000000000000000000000000000000..568e7a5dcc9185fe3558d011c8685752a88d8262 --- /dev/null +++ b/src/mindspore/pages/my/my.wxml @@ -0,0 +1,54 @@ + + + + + + + + 常用功能 + + + + 使用帮助 + + + + 留言反馈 + + + + 隐私声明 + + + + 关注公众号 + + + + B站直播 + + + + 关注头条号 + + + + \ No newline at end of file diff --git a/src/mindspore/pages/my/my.wxss b/src/mindspore/pages/my/my.wxss new file mode 100644 index 0000000000000000000000000000000000000000..0fdfcbcb6f4ef29cbbd90c3c58744846a12d8553 --- /dev/null +++ b/src/mindspore/pages/my/my.wxss @@ -0,0 +1,115 @@ +/* pages/my/my.wxss */ +.container { + padding: 0 !important; + margin-bottom: 99rpx; + background-color: #fff; +} + +.container .top-box { + padding-top: 97rpx; + background-color: #40ADFF; +} + +.container .user-info-wrapper { + background-color: #fff; + border-radius: 24rpx 24rpx 0 0; + padding: 0 30rpx; +} + +.container .user-info-wrapper .my-user-info { + height: 110rpx; +} + +.container .user-info-wrapper .my-user-info image { + border-radius: 100%; + height: 135rpx; + width: 135rpx; + border: 2rpx solid rgba(0, 47, 167, 0.15); + position: relative; + top: -67.5rpx; + margin-right: 20rpx; +} + +.container .user-info-wrapper .my-user-info text { + color: #fff; + font-size: 36rpx; + position: relative; + line-height: 50rpx; + top: -157.5rpx; +} + +.container .common-list .header { + font-size: 34rpx; + color: #333; +} + +.container .common-list .list { + display: flex; + flex-wrap: wrap; +} + +.container .common-list .list .item { + flex: 0 0 33.333333333333333%; + display: flex; + justify-content: center; + margin: 30rpx 0; + flex-direction: column; +} + +.container .common-list .list .item .count { + font-size: 40rpx; + margin-bottom: 10rpx; + text-align: center; +} + +.container .common-list .list .item .text { + font-size: 26rpx; + color: #6d7278; + text-align: center; +} + +.container .center-bg { + height: 20rpx; + background: #F5F7FA; +} + +.container .common-functions { + padding: 0 30rpx; + background-color: #fff; +} + +.container .my-events .header, .container .common-functions .header { + padding-top: 30rpx; +} + +.container .common-functions .header { + font-size: 34rpx; + color: #333; +} + +.container .common-functions .list { + display: flex; + flex-wrap: wrap; +} + +.container .common-functions .list .item { + flex: 0 0 33.333333333333333%; + display: flex; + justify-content: center; + margin: 30rpx 0; + flex-direction: column; + align-items: center; +} + +.container .common-functions .list .item image { + width: 54rpx; + height: 54rpx; + margin-bottom: 10rpx; + text-align: center; +} + +.container .common-functions .list .item text { + font-size: 26rpx; + color: #6d7278; + text-align: center; +} diff --git a/src/mindspore/pages/null/null.js b/src/mindspore/pages/null/null.js new file mode 100644 index 0000000000000000000000000000000000000000..dea5fdac8f6fd496ff8c7ce6ea29e04005b4e305 --- /dev/null +++ b/src/mindspore/pages/null/null.js @@ -0,0 +1,51 @@ +// pages/null/null.js +Page({ + /** + * 页面的初始数据 + */ + data: {}, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function () {}, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () {}, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + this.getTabBar().setData({ + _tabbat: 2, + }); + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () {}, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () {}, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () {}, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () {}, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () {}, +}); diff --git a/src/mindspore/pages/null/null.json b/src/mindspore/pages/null/null.json new file mode 100644 index 0000000000000000000000000000000000000000..cbb09e7aeec4f54f5cce909065e093680ec21319 --- /dev/null +++ b/src/mindspore/pages/null/null.json @@ -0,0 +1,7 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "MindSpore活动管理", + "backgroundTextStyle": "dark", + "backgroundColor": "#fff", + "enablePullDownRefresh": true +} \ No newline at end of file diff --git a/src/mindspore/pages/null/null.wxml b/src/mindspore/pages/null/null.wxml new file mode 100644 index 0000000000000000000000000000000000000000..1cf068606c639b5310571145b2562e34292c4838 --- /dev/null +++ b/src/mindspore/pages/null/null.wxml @@ -0,0 +1,9 @@ + + + + + 暂无活动! + 后台正在熬夜开发中,敬请期待! + + + diff --git a/src/mindspore/pages/null/null.wxss b/src/mindspore/pages/null/null.wxss new file mode 100644 index 0000000000000000000000000000000000000000..f3f10309dd82516c5e49e9bd181c4128d73e0f1f --- /dev/null +++ b/src/mindspore/pages/null/null.wxss @@ -0,0 +1,30 @@ +/* pages/null/null.wxss */ +.null { + height: 100vh; + display: flex; + justify-content: center; + align-items: center; +} + +.null .box image{ + width: 315rpx; + height: 266rpx; + display: block; + margin: 0 auto; +} + +.null .box .title { + font-size: 34rpx; + color: #333333; + line-height: 48rpx; + margin: 42px 0 20px 0; +} + +.null .box text { + font-size: 28rpx; + font-weight: 400; + color: #6D7278; + line-height: 38rpx; + text-align: center; + display: block; +} \ No newline at end of file diff --git a/src/mindspore/sitemap.json b/src/mindspore/sitemap.json new file mode 100644 index 0000000000000000000000000000000000000000..ca02add20b581be471b8d17f887b8e8337070546 --- /dev/null +++ b/src/mindspore/sitemap.json @@ -0,0 +1,7 @@ +{ + "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", + "rules": [{ + "action": "allow", + "page": "*" + }] +} \ No newline at end of file diff --git a/src/mindspore/static/auth/auth-logo.png b/src/mindspore/static/auth/auth-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..ccd14a6614efa6752cfc3a9f17bc8c115201e5c4 Binary files /dev/null and b/src/mindspore/static/auth/auth-logo.png differ diff --git a/src/mindspore/static/auth/auth.png b/src/mindspore/static/auth/auth.png new file mode 100644 index 0000000000000000000000000000000000000000..a865eec5e3d90bd0740cc387caed7bd7b1d9c64a Binary files /dev/null and b/src/mindspore/static/auth/auth.png differ diff --git a/src/mindspore/static/auth/wechat-icon.svg b/src/mindspore/static/auth/wechat-icon.svg new file mode 100644 index 0000000000000000000000000000000000000000..3cb7e30dbd356e12e730efa5cbe6022d948db43c --- /dev/null +++ b/src/mindspore/static/auth/wechat-icon.svg @@ -0,0 +1,9 @@ + + + Fill 1 + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/common/arrow-down.svg b/src/mindspore/static/common/arrow-down.svg new file mode 100644 index 0000000000000000000000000000000000000000..e9bc120d0f90b1fba88eaf825dc9ed9eb2f46423 --- /dev/null +++ b/src/mindspore/static/common/arrow-down.svg @@ -0,0 +1,9 @@ + + + Style备份 3 + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/common/arrow-right.svg b/src/mindspore/static/common/arrow-right.svg new file mode 100644 index 0000000000000000000000000000000000000000..3372d80cd89915ae937a968b3c356caa22f2023d --- /dev/null +++ b/src/mindspore/static/common/arrow-right.svg @@ -0,0 +1,18 @@ + + + Outlined/UI/button_right备份 7 + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/common/arrow-up.svg b/src/mindspore/static/common/arrow-up.svg new file mode 100644 index 0000000000000000000000000000000000000000..c9f8b6d8cce0e66f68d8144e5e863831dfd119b6 --- /dev/null +++ b/src/mindspore/static/common/arrow-up.svg @@ -0,0 +1,9 @@ + + + Style备份 2 + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/common/blue-bg.png b/src/mindspore/static/common/blue-bg.png new file mode 100644 index 0000000000000000000000000000000000000000..7ab558ee496a7e43c88d6d7094fc4cd79732c198 Binary files /dev/null and b/src/mindspore/static/common/blue-bg.png differ diff --git a/src/mindspore/static/common/collection-icon.svg b/src/mindspore/static/common/collection-icon.svg new file mode 100644 index 0000000000000000000000000000000000000000..e563c6569986584e695a39573f35e20c16086cb8 --- /dev/null +++ b/src/mindspore/static/common/collection-icon.svg @@ -0,0 +1,15 @@ + + + 编组 10 + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/common/default-avatar.png b/src/mindspore/static/common/default-avatar.png new file mode 100644 index 0000000000000000000000000000000000000000..da5cc598ebbe9da6f2377dfb9d85c19aae0a1dde Binary files /dev/null and b/src/mindspore/static/common/default-avatar.png differ diff --git a/src/mindspore/static/common/location.svg b/src/mindspore/static/common/location.svg new file mode 100644 index 0000000000000000000000000000000000000000..aaf8af23c096be6f24f4655a20c7f2eb3492bd0d --- /dev/null +++ b/src/mindspore/static/common/location.svg @@ -0,0 +1,11 @@ + + + 定位备份 + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/common/more.svg b/src/mindspore/static/common/more.svg new file mode 100644 index 0000000000000000000000000000000000000000..6c5f91d3aa3d21d7a85c455a64f60fd46daa5b58 --- /dev/null +++ b/src/mindspore/static/common/more.svg @@ -0,0 +1,14 @@ + + + 编组 2 + + + + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/common/search-icon.svg b/src/mindspore/static/common/search-icon.svg new file mode 100644 index 0000000000000000000000000000000000000000..eae39096930a9043ac9804f2d527cf520b8bd1f4 --- /dev/null +++ b/src/mindspore/static/common/search-icon.svg @@ -0,0 +1,31 @@ + + + Outlined/UI/search + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/common/swiper-tips.svg b/src/mindspore/static/common/swiper-tips.svg new file mode 100644 index 0000000000000000000000000000000000000000..4edf9c29c5265736b43404564996789c13e8f90b --- /dev/null +++ b/src/mindspore/static/common/swiper-tips.svg @@ -0,0 +1,17 @@ + + + 编组 + + + + + + + 向左滑动可收藏会议和获取地址 + + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/events/1.png b/src/mindspore/static/events/1.png new file mode 100644 index 0000000000000000000000000000000000000000..66fd19aa1cc1b222926fb669e3b5d2e39f238144 Binary files /dev/null and b/src/mindspore/static/events/1.png differ diff --git a/src/mindspore/static/events/2.png b/src/mindspore/static/events/2.png new file mode 100644 index 0000000000000000000000000000000000000000..ee03d0cfc9494bc485fe00081914da6fc08249db Binary files /dev/null and b/src/mindspore/static/events/2.png differ diff --git a/src/mindspore/static/events/3.png b/src/mindspore/static/events/3.png new file mode 100644 index 0000000000000000000000000000000000000000..5bdd25f5ea1e731d1936c24c68f8cafba60e6422 Binary files /dev/null and b/src/mindspore/static/events/3.png differ diff --git a/src/mindspore/static/events/4.png b/src/mindspore/static/events/4.png new file mode 100644 index 0000000000000000000000000000000000000000..fe7aa0272846f51495b0e891deadd92b99ee33ea Binary files /dev/null and b/src/mindspore/static/events/4.png differ diff --git a/src/mindspore/static/events/collect.svg b/src/mindspore/static/events/collect.svg new file mode 100644 index 0000000000000000000000000000000000000000..95390f8fb9a8fa4ae6a96b971019071bce2b888d --- /dev/null +++ b/src/mindspore/static/events/collect.svg @@ -0,0 +1,11 @@ + + + 收藏备份 3 + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/events/empty-events.png b/src/mindspore/static/events/empty-events.png new file mode 100644 index 0000000000000000000000000000000000000000..154a0bb3c1b5b03966d6c2d0fb1f08c46131a5fa Binary files /dev/null and b/src/mindspore/static/events/empty-events.png differ diff --git a/src/mindspore/static/events/enterprise-manage.svg b/src/mindspore/static/events/enterprise-manage.svg new file mode 100644 index 0000000000000000000000000000000000000000..b6877dd933fa616e1cd6b58a8dd846e1305a9ccd --- /dev/null +++ b/src/mindspore/static/events/enterprise-manage.svg @@ -0,0 +1,15 @@ + + + 功能区-发起人管理 + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/events/list-pic/1.png b/src/mindspore/static/events/list-pic/1.png new file mode 100644 index 0000000000000000000000000000000000000000..90a37b08dcc2086da68649dde1745e8b84411553 Binary files /dev/null and b/src/mindspore/static/events/list-pic/1.png differ diff --git a/src/mindspore/static/events/list-pic/2.png b/src/mindspore/static/events/list-pic/2.png new file mode 100644 index 0000000000000000000000000000000000000000..9f9b887a7e7b8a0ba2221bdc1fe5874e50d5f577 Binary files /dev/null and b/src/mindspore/static/events/list-pic/2.png differ diff --git a/src/mindspore/static/events/list-pic/3.png b/src/mindspore/static/events/list-pic/3.png new file mode 100644 index 0000000000000000000000000000000000000000..2209beb3057ad6bb8001318789898527c6f6f32e Binary files /dev/null and b/src/mindspore/static/events/list-pic/3.png differ diff --git a/src/mindspore/static/events/list-pic/4.png b/src/mindspore/static/events/list-pic/4.png new file mode 100644 index 0000000000000000000000000000000000000000..d7731571f41c6377946eded6f9ea8ffae9c2c295 Binary files /dev/null and b/src/mindspore/static/events/list-pic/4.png differ diff --git a/src/mindspore/static/events/look-event.svg b/src/mindspore/static/events/look-event.svg new file mode 100644 index 0000000000000000000000000000000000000000..9a581f083f7604421d33fd376fb72e1cdb0c8a2d --- /dev/null +++ b/src/mindspore/static/events/look-event.svg @@ -0,0 +1,18 @@ + + + 功能区-查看活动 + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/events/publish-event.svg b/src/mindspore/static/events/publish-event.svg new file mode 100644 index 0000000000000000000000000000000000000000..436e97fe49e54be4d5bf277118042eefa8209c61 --- /dev/null +++ b/src/mindspore/static/events/publish-event.svg @@ -0,0 +1,16 @@ + + + 功能区-发布活动 + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/events/schedule-del.svg b/src/mindspore/static/events/schedule-del.svg new file mode 100644 index 0000000000000000000000000000000000000000..a8ce541310193ab9dc835a52ad3403be9959b6f0 --- /dev/null +++ b/src/mindspore/static/events/schedule-del.svg @@ -0,0 +1,16 @@ + + + 删除 + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/events/selected.svg b/src/mindspore/static/events/selected.svg new file mode 100644 index 0000000000000000000000000000000000000000..73ac1610de968d756b329d6ddf0aff6e49959226 --- /dev/null +++ b/src/mindspore/static/events/selected.svg @@ -0,0 +1,12 @@ + + + 编组 2 + + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/events/share.svg b/src/mindspore/static/events/share.svg new file mode 100644 index 0000000000000000000000000000000000000000..0ba2090b537b4bcd15f882462e5e423aa3980d91 --- /dev/null +++ b/src/mindspore/static/events/share.svg @@ -0,0 +1,11 @@ + + + 分享 (1)备份 + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/events/uncollect.svg b/src/mindspore/static/events/uncollect.svg new file mode 100644 index 0000000000000000000000000000000000000000..357d70b469c5f5276a7efecfbbbf2a784758493d --- /dev/null +++ b/src/mindspore/static/events/uncollect.svg @@ -0,0 +1,11 @@ + + + 收藏备份 + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/index/banner-1.png b/src/mindspore/static/index/banner-1.png new file mode 100644 index 0000000000000000000000000000000000000000..9705b05266cbe801ce23876b562776f096562a11 Binary files /dev/null and b/src/mindspore/static/index/banner-1.png differ diff --git a/src/mindspore/static/index/btn-bg.jpg b/src/mindspore/static/index/btn-bg.jpg new file mode 100644 index 0000000000000000000000000000000000000000..8eaf49ab172ba68e4e2fc0f5eddd065ee8a1136d Binary files /dev/null and b/src/mindspore/static/index/btn-bg.jpg differ diff --git a/src/mindspore/static/index/date.png b/src/mindspore/static/index/date.png new file mode 100644 index 0000000000000000000000000000000000000000..5fdba26cc1cdab4ed801197a43bf848cf47a385b Binary files /dev/null and b/src/mindspore/static/index/date.png differ diff --git a/src/mindspore/static/index/date.svg b/src/mindspore/static/index/date.svg new file mode 100644 index 0000000000000000000000000000000000000000..84023000e84481786a527a5f368cdb44179db8c6 --- /dev/null +++ b/src/mindspore/static/index/date.svg @@ -0,0 +1,18 @@ + + + Outlined/UI/time + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/index/desc.svg b/src/mindspore/static/index/desc.svg new file mode 100644 index 0000000000000000000000000000000000000000..f12d90769ad01985dff25f023e97662675574795 --- /dev/null +++ b/src/mindspore/static/index/desc.svg @@ -0,0 +1,18 @@ + + + Outlined/UI/userguide + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/index/events-bg.jpg b/src/mindspore/static/index/events-bg.jpg new file mode 100644 index 0000000000000000000000000000000000000000..44e632799db61fec9508aa353e018a2c3302be77 Binary files /dev/null and b/src/mindspore/static/index/events-bg.jpg differ diff --git a/src/mindspore/static/index/events-btn.svg b/src/mindspore/static/index/events-btn.svg new file mode 100644 index 0000000000000000000000000000000000000000..c43cf2581f032f4891cb2e5860a23c4cb0929c99 --- /dev/null +++ b/src/mindspore/static/index/events-btn.svg @@ -0,0 +1,33 @@ + + + 功能区-我报名的活动 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/index/finger.svg b/src/mindspore/static/index/finger.svg new file mode 100644 index 0000000000000000000000000000000000000000..cc588546ae05158f502ce663c9e1b5ee9eccdba0 --- /dev/null +++ b/src/mindspore/static/index/finger.svg @@ -0,0 +1,36 @@ + + + shoushi + + + + + + + + + + + + + + + + + + + 会议讨论内容会议讨论内容会议讨论内容内容内内容… + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/index/group.svg b/src/mindspore/static/index/group.svg new file mode 100644 index 0000000000000000000000000000000000000000..3b78d993d9ac26eb8a89bbb4963c21eaf2414da0 --- /dev/null +++ b/src/mindspore/static/index/group.svg @@ -0,0 +1,18 @@ + + + Outlined/UI/account_group + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/index/link.svg b/src/mindspore/static/index/link.svg new file mode 100644 index 0000000000000000000000000000000000000000..cfd5b9b204a3269c2ba5099ad45193de8973ca61 --- /dev/null +++ b/src/mindspore/static/index/link.svg @@ -0,0 +1,18 @@ + + + Outlined/UI/link + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/index/meeting-bg.jpg b/src/mindspore/static/index/meeting-bg.jpg new file mode 100644 index 0000000000000000000000000000000000000000..daaa37f33f90c70ee90498e0892935eb6291bc9d Binary files /dev/null and b/src/mindspore/static/index/meeting-bg.jpg differ diff --git a/src/mindspore/static/index/meeting-btn.svg b/src/mindspore/static/index/meeting-btn.svg new file mode 100644 index 0000000000000000000000000000000000000000..92de32fa8e93c4d47c14808f346cd81dbc42b8c4 --- /dev/null +++ b/src/mindspore/static/index/meeting-btn.svg @@ -0,0 +1,29 @@ + + + 功能区-查看会议备份 + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/index/null-events.png b/src/mindspore/static/index/null-events.png new file mode 100644 index 0000000000000000000000000000000000000000..e5e8dc3f800be230e8716d68b5ea757afc4d399c Binary files /dev/null and b/src/mindspore/static/index/null-events.png differ diff --git a/src/mindspore/static/index/sponsor.svg b/src/mindspore/static/index/sponsor.svg new file mode 100644 index 0000000000000000000000000000000000000000..32756db3a9d17a68651463883a7cb0f77b633824 --- /dev/null +++ b/src/mindspore/static/index/sponsor.svg @@ -0,0 +1,18 @@ + + + Outlined/UI/account + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/meeting/look-meeting.svg b/src/mindspore/static/meeting/look-meeting.svg new file mode 100644 index 0000000000000000000000000000000000000000..6443d554e06cb13af6b74842caa215a4a087291a --- /dev/null +++ b/src/mindspore/static/meeting/look-meeting.svg @@ -0,0 +1,33 @@ + + + 功能区-查看会议 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/meeting/no-meeting.png b/src/mindspore/static/meeting/no-meeting.png new file mode 100644 index 0000000000000000000000000000000000000000..a8dd53180ef98f9ecb7bb089f43f035d7ffb552b Binary files /dev/null and b/src/mindspore/static/meeting/no-meeting.png differ diff --git a/src/mindspore/static/meeting/reserve-meeting.svg b/src/mindspore/static/meeting/reserve-meeting.svg new file mode 100644 index 0000000000000000000000000000000000000000..86dcd3a1052adc5f0fd0e396d15a361ef10cb65c --- /dev/null +++ b/src/mindspore/static/meeting/reserve-meeting.svg @@ -0,0 +1,38 @@ + + + 功能区-预定会议 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/meeting/sig-manage.svg b/src/mindspore/static/meeting/sig-manage.svg new file mode 100644 index 0000000000000000000000000000000000000000..4cbe83482cf6bc4fb6396c1a43a8511791087155 --- /dev/null +++ b/src/mindspore/static/meeting/sig-manage.svg @@ -0,0 +1,23 @@ + + + 功能区-SIG管理 + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/my/common-functions/feedback.svg b/src/mindspore/static/my/common-functions/feedback.svg new file mode 100644 index 0000000000000000000000000000000000000000..9bfcd617637c030655b3b5c7ce84f25e8f8dc94f --- /dev/null +++ b/src/mindspore/static/my/common-functions/feedback.svg @@ -0,0 +1,32 @@ + + + 功能区-留言反馈 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/my/common-functions/headlines.svg b/src/mindspore/static/my/common-functions/headlines.svg new file mode 100644 index 0000000000000000000000000000000000000000..084b59ec5340cde07e535cf1f1e27cdf29fd9da2 --- /dev/null +++ b/src/mindspore/static/my/common-functions/headlines.svg @@ -0,0 +1,33 @@ + + + 功能区-头条 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/my/common-functions/help.svg b/src/mindspore/static/my/common-functions/help.svg new file mode 100644 index 0000000000000000000000000000000000000000..a4f74c804776e81668d5de3025c973e6e74cddb5 --- /dev/null +++ b/src/mindspore/static/my/common-functions/help.svg @@ -0,0 +1,51 @@ + + + 功能区-使用帮助 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/my/common-functions/living.svg b/src/mindspore/static/my/common-functions/living.svg new file mode 100644 index 0000000000000000000000000000000000000000..37bf9abe03fb6b194b673a3fafca7f03bf734fc3 --- /dev/null +++ b/src/mindspore/static/my/common-functions/living.svg @@ -0,0 +1,28 @@ + + + 功能区-B站直播 + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/my/common-functions/official-account.svg b/src/mindspore/static/my/common-functions/official-account.svg new file mode 100644 index 0000000000000000000000000000000000000000..c6aff8926156d9906b5f2683e824266c10c4c82b --- /dev/null +++ b/src/mindspore/static/my/common-functions/official-account.svg @@ -0,0 +1,26 @@ + + + 功能区-公众号 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/my/common-functions/privacy.svg b/src/mindspore/static/my/common-functions/privacy.svg new file mode 100644 index 0000000000000000000000000000000000000000..7982337b5b0a1bf174c7c17db00be3052a2d6f32 --- /dev/null +++ b/src/mindspore/static/my/common-functions/privacy.svg @@ -0,0 +1,27 @@ + + + 功能区-隐私政策 + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/my/publishing.png b/src/mindspore/static/my/publishing.png new file mode 100644 index 0000000000000000000000000000000000000000..20784c0e7e012374495f0a5820b9e2e0b3856af6 Binary files /dev/null and b/src/mindspore/static/my/publishing.png differ diff --git a/src/mindspore/static/my/under-release.png b/src/mindspore/static/my/under-release.png new file mode 100644 index 0000000000000000000000000000000000000000..cfe33cd5df661a529ee62ec3fbbbab63ce592335 Binary files /dev/null and b/src/mindspore/static/my/under-release.png differ diff --git a/src/mindspore/static/reserve/info.svg b/src/mindspore/static/reserve/info.svg new file mode 100644 index 0000000000000000000000000000000000000000..d4d587230e4913fb09d46dd414a62a64502a5ccb --- /dev/null +++ b/src/mindspore/static/reserve/info.svg @@ -0,0 +1,9 @@ + + + Style + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/sig/add-success.png b/src/mindspore/static/sig/add-success.png new file mode 100644 index 0000000000000000000000000000000000000000..f73b246a48927575bd221ca440817a953ccb52d4 Binary files /dev/null and b/src/mindspore/static/sig/add-success.png differ diff --git a/src/mindspore/static/sig/del-success.png b/src/mindspore/static/sig/del-success.png new file mode 100644 index 0000000000000000000000000000000000000000..f274b3b0feee39e10088a599f4f4fc95efa2a321 Binary files /dev/null and b/src/mindspore/static/sig/del-success.png differ diff --git a/src/mindspore/static/sig/del.svg b/src/mindspore/static/sig/del.svg new file mode 100644 index 0000000000000000000000000000000000000000..c6976ce21c63222466fe5ccd343c127d92f20ae6 --- /dev/null +++ b/src/mindspore/static/sig/del.svg @@ -0,0 +1,9 @@ + + + Style + + + + + + \ No newline at end of file diff --git a/src/mindspore/static/sig/empty-img.png b/src/mindspore/static/sig/empty-img.png new file mode 100644 index 0000000000000000000000000000000000000000..51d972ee8a065582696c2da0c9d1c4b952040002 Binary files /dev/null and b/src/mindspore/static/sig/empty-img.png differ diff --git a/src/mindspore/static/sig/gray-add.svg b/src/mindspore/static/sig/gray-add.svg new file mode 100644 index 0000000000000000000000000000000000000000..6fea212046fe47094d2afaf603d6a3ef493650cf --- /dev/null +++ b/src/mindspore/static/sig/gray-add.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/mindspore/static/sig/white-add.svg b/src/mindspore/static/sig/white-add.svg new file mode 100644 index 0000000000000000000000000000000000000000..e5a3e8c43bccfa38f133f904ac8afadb2435487e --- /dev/null +++ b/src/mindspore/static/sig/white-add.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/mindspore/static/tabbar/events-selected.png b/src/mindspore/static/tabbar/events-selected.png new file mode 100644 index 0000000000000000000000000000000000000000..dc4fe026edc2efff4ea85c0437da8a3af01a8b7b Binary files /dev/null and b/src/mindspore/static/tabbar/events-selected.png differ diff --git a/src/mindspore/static/tabbar/events.png b/src/mindspore/static/tabbar/events.png new file mode 100644 index 0000000000000000000000000000000000000000..bfafd0ca868a03ee678ec1b84abc6d4fc2a4e770 Binary files /dev/null and b/src/mindspore/static/tabbar/events.png differ diff --git a/src/mindspore/static/tabbar/home-selected.png b/src/mindspore/static/tabbar/home-selected.png new file mode 100644 index 0000000000000000000000000000000000000000..279a874e138b44292d4277b7512e415a59946c0a Binary files /dev/null and b/src/mindspore/static/tabbar/home-selected.png differ diff --git a/src/mindspore/static/tabbar/home.png b/src/mindspore/static/tabbar/home.png new file mode 100644 index 0000000000000000000000000000000000000000..fbf3e293ff7abaa4c9ccaa9e17c5e809af5e073c Binary files /dev/null and b/src/mindspore/static/tabbar/home.png differ diff --git a/src/mindspore/static/tabbar/meeting-selected.png b/src/mindspore/static/tabbar/meeting-selected.png new file mode 100644 index 0000000000000000000000000000000000000000..304691d0840981b7af0cae50821fa9d736f0445c Binary files /dev/null and b/src/mindspore/static/tabbar/meeting-selected.png differ diff --git a/src/mindspore/static/tabbar/meeting.png b/src/mindspore/static/tabbar/meeting.png new file mode 100644 index 0000000000000000000000000000000000000000..a270b5dc9b1883d6eb6a21406f9a9d30265db4c9 Binary files /dev/null and b/src/mindspore/static/tabbar/meeting.png differ diff --git a/src/mindspore/static/tabbar/my-selected.png b/src/mindspore/static/tabbar/my-selected.png new file mode 100644 index 0000000000000000000000000000000000000000..c9b94a935987f7e717a36e71139856bdfd7a3e0e Binary files /dev/null and b/src/mindspore/static/tabbar/my-selected.png differ diff --git a/src/mindspore/static/tabbar/my.png b/src/mindspore/static/tabbar/my.png new file mode 100644 index 0000000000000000000000000000000000000000..41b8f747486da90164c6d210df6d8a0122ef83bf Binary files /dev/null and b/src/mindspore/static/tabbar/my.png differ diff --git a/src/mindspore/utils/app-ajax.js b/src/mindspore/utils/app-ajax.js new file mode 100644 index 0000000000000000000000000000000000000000..4c84b2d7b3c6a47ae12320c262821951cac4db43 --- /dev/null +++ b/src/mindspore/utils/app-ajax.js @@ -0,0 +1,182 @@ +/** + * 请求方法 + */ + +var appSession = require('./app-session.js'); +var underscore = require('./underscore-extend.js'); +const servicesConfig = require('../config/services-config.js'); +const CONSTANTS = require('../config/constants.js'); + +/* 基础通信参数 */ +var _authClient = function () { + var deviceId = 'miniprogram'; + + var auth = { + authParams: { + timestamp: new Date().getTime(), + deviceId: deviceId, + }, + clientParams: { + os: 'mini', + network: '', + deviceId: deviceId, + appVersion: CONSTANTS.APP_VERSION, + }, + openId: appSession.getUserInfoByKey('openId') || '', + appId: CONSTANTS.APP_ID, + areaCode: CONSTANTS.AREA_CODE, + miniId: CONSTANTS.MINI_ID, + }; + + return auth; +}; + +/** + * 获取service + * @param {Object} params + */ +var _getInterfaceUrl = function (params) { + var interfaceUrl; + if (!params.otherParams) { + return servicesConfig[params['service']]; + } + for (var key in params.otherParams) { + interfaceUrl = (interfaceUrl || servicesConfig[params['service']]).replace( + '{' + key + '}', + params.otherParams[key] + ); + } + + return interfaceUrl; +}; + +var _addUrlParam = function (data) { + var postData = ''; + for (var key in data) { + if (!postData) { + postData = '?' + key + '=' + data[key]; + } else { + postData += '&' + key + '=' + data[key]; + } + } + + return postData; +}; + +var appAjax = { + /** + * 提交请求 + * @param {Object} options + * service: "" // 接口名 + * data: "", // 请求参数 + * otherParams: "", // 通过url传递的参数 + * type : "", // 请求类型 + * success: "", // 成功回调 + * error: "", // 失败回调 + * complete: "" // 完成回调 + */ + postJson: function (params) { + var authClient = _authClient(); + + // 默认参数 + var defaultParams = { + service: '', // 服务的配置名称 + success: function () {}, // 成功后回调 + error: null, // 失败后回调 + autoShowWait: false, // 自动显示菊花 + loadingText: '加载中...', // 加载的提示语 + autoCloseWait: true, // 自动关闭菊花 + headers: { + 'base-params': JSON.stringify(authClient), + Authorization: appSession.getToken() ? 'Bearer ' + appSession.getToken() : '', + }, + isAsync: true, + }; + var ajaxParams = underscore.deepExtend(true, defaultParams, params); + // rest请求路径 + ajaxParams['url'] = CONSTANTS['SERVICE_URL'] + _getInterfaceUrl(ajaxParams); + if ( + (ajaxParams.type == 'GET' || ajaxParams.type == 'DELETE') && + ajaxParams.data && + typeof ajaxParams.data == 'object' + ) { + ajaxParams['url'] = ajaxParams['url'] + _addUrlParam(ajaxParams.data); + } + + // 是否展示loading + if (ajaxParams.autoShowWait && wx.showLoading) { + wx.showLoading({ + title: ajaxParams.loadingText, + mask: true, + }); + } + wx.request({ + url: ajaxParams.url, + header: ajaxParams.headers, + method: ajaxParams['type'] || 'POST', + data: ajaxParams.data, + success: function (res) { + if (res.statusCode === 401) { + wx.removeStorageSync('_app_userinfo_session'); + ajaxParams.success(0, res); + if (beforePage.route === 'pages/auth/auth') { + return; + } + wx.navigateTo({ + url: '/pages/auth/auth', + }); + return; + } + if (res.statusCode.toString()[0] != 2) { + var message = '有点忙开个小差,稍后再试~'; + if (ajaxParams.error) { + ajaxParams.error(message, res); + } else { + wx.showToast({ + title: message, + icon: 'none', + duration: 2000, + }); + } + return; + } + ajaxParams.success(res.data, res); + }, + fail: function (res) { + var message = '有点忙开个小差,稍后再试~'; + ajaxParams.error && ajaxParams.error(message, res); + }, + complete: function (res) { + if (!res.errMsg.includes('ok')) { + wx.showToast({ + title: res.errMsg, + icon: 'none', + duration: 2000, + }); + } + // 关闭loading + if (ajaxParams.autoShowWait && wx.hideLoading) { + wx.hideLoading(); + } + }, + }); + }, + + /** + * 上下拉 + */ + datalistParam: function () { + return { + lastdate: 0, + pageSize: 20, + type: 'DOWN', // DOWN UP + }; + }, + + // 下拉 + scrollDown: 'DOWN', + // 上拉 + scrollUp: 'UP', +}; + +module.exports = appAjax; diff --git a/src/mindspore/utils/app-session.js b/src/mindspore/utils/app-session.js new file mode 100644 index 0000000000000000000000000000000000000000..dd4b2d963ffea6bcd91a650310a5398f2c355f0e --- /dev/null +++ b/src/mindspore/utils/app-session.js @@ -0,0 +1,66 @@ +var constants = require('../config/constants.js'); +/** + * 获取用户信息 + */ +var _getUserinfo = function () { + var userInfo = wx.getStorageSync(constants.APP_USERINFO_SESSION); + + return userInfo; +}; + +/** + * 通过key获取值 + * @params key + */ +var _getValueByKey = function (key) { + if (!key) { + return; + } + + var userinfo = _getUserinfo(); + + if (!userinfo) { + return; + } + return userinfo[key]; +}; + +module.exports = { + /** + * 从缓存获取token + */ + getToken: function () { + return _getValueByKey('access'); + }, + + /** + * 通过key获取对应信息 + */ + getUserInfoByKey: function (key) { + return _getValueByKey(key); + }, + + /** + * 获取用户信息 + */ + getUserinfo: function () { + return _getUserinfo(); + }, + + /** + * 清楚用户信息 + */ + clearUserInfo: function () { + wx.removeStorageSync(constants.APP_USERINFO_SESSION); + }, + + /** + * 判断是否登录 + */ + loginCheck: function () { + if (_getUserinfo() && _getValueByKey('access')) { + return true; + } + return false; + }, +}; diff --git a/src/mindspore/utils/app-user.js b/src/mindspore/utils/app-user.js new file mode 100644 index 0000000000000000000000000000000000000000..a2097ebd3324914fc7ce607dfccaf9637bc44a8f --- /dev/null +++ b/src/mindspore/utils/app-user.js @@ -0,0 +1,291 @@ +var appAjax = require('./app-ajax.js'); +var appSession = require('./app-session.js'); +var constants = require('../config/constants'); +var app = getApp(); + +var remote = { + /** + * 绑定手机 + * @param {Object} phone + * @param {Object} _callback + */ + _bindUserPhone: function (phone, _callback) { + appAjax.postJson({ + service: 'BIND_PHONE', + data: { + phone: phone, + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, +}; + +var privateMethods = { + /** + * 登录 + * @param {Object} callback + */ + _login: function (callback) { + wx.showToast({ + title: '登录中', + icon: 'loading', + mask: true, + }); + + wx.login({ + success: function (data) { + wx.getUserInfo({ + success: function (res) { + // 登录 + appAjax.postJson({ + headers: { + Authorization: '', + }, + service: 'LOGIN', + data: { + userInfo: res.userInfo, + code: data.code, + }, + success: function (result) { + res.userInfo.access = result.access; + res.userInfo.level = result.level; + res.userInfo.eventLevel = result.activity_level; + res.userInfo.gitee = result.gitee_name; + res.userInfo.userId = result.user_id; + // // 缓存用户信息 + appUser.saveLoginInfo(res.userInfo || {}); + + // // 回调 + callback && callback(res.userInfo || {}); + }, + }); + }, + fail: function () { + wx.hideToast(); + }, + }); + }, + }); + }, +}; + +var appUser = { + /** + * 需要登录的跳转 + * page为空不能传null 要 "" + */ + loginRedirect: function (page, callback) { + // 是否有登录 + if (!appSession.loginCheck()) { + appUser.login(function (result) { + if (result && !result.phone) { + wx.navigateTo({ + url: '../register/bind-phone?page=' + page, + }); + } else { + wx.navigateTo({ + url: page, + }); + } + + // 支持回调 + callback && callback(); + }); + } else { + wx.navigateTo({ + url: page, + }); + } + }, + + /** + * 需要登录的操作 + * @param page 操作页 page为空不能传null 要 "" + * @param callback + */ + loginHandle: function (page, callback) { + // 是否有登录 + if (!appSession.loginCheck()) { + appUser.login(function (result) { + if (result && !result.phone) { + wx.navigateTo({ + url: '../register/bind-phone?page=' + page, + }); + } else { + callback && callback(); + } + }); + } else { + callback && callback(); + } + }, + + bindPhone: remote._bindUserPhone, + + /** + * 登录 + * @param {Object} successCallback + * @param {Object} failCallback + */ + login: function (callback) { + // 查看是否授权 + wx.getSetting({ + success: function (res) { + if (res.authSetting['scope.userInfo']) { + // 已经授权,可以直接调用 getUserInfo 获取头像昵称 + privateMethods._login(callback); + } else { + app.loginCallback = function () { + privateMethods._login(callback); + }; + wx.navigateTo({ + url: '/pages/auth/auth', + }); + } + }, + }); + }, + + /** + * 退出登录 + */ + logOut: function (callback) { + wx.showModal({ + title: '', + content: '确定要退出您的账号?', + success: function (res) { + if (res.confirm) { + // 清理用户信息 + appSession.clearUserInfo(); + callback && callback(); + } + }, + }); + }, + + /** + * 获取微信地址 + * @param {Object} callback 回调 + */ + getWxAddress: function (self, callback) { + wx.getSetting({ + success(res) { + var status = res.authSetting['scope.address']; + if (status == undefined) { + wx.authorize({ + scope: 'scope.address', + success() { + // 用户已经同意小程序使用地址功能,后续调用地址接口不会弹窗询问 + wx.chooseAddress({ + success: function (result) { + callback && callback(result); + }, + }); + }, + fail() { + self.setData({ + wxAddressShow: true, + }); + }, + }); + } else if (status) { + // 已获取权限 + wx.chooseAddress({ + success: function (result) { + callback && callback(result); + }, + }); + } + }, + }); + }, + + /** + * 微信登录 + * @param {Object} callback + * @param {Object} failCallback + */ + wxLogin: function (callback, failCallback) { + appUser.login(function (result) { + callback && callback(result || {}); + }, failCallback); + }, + + /** + * 保存用户信息 + * @param {Object} result + */ + saveLoginInfo: function (result) { + wx.setStorageSync(constants.APP_USERINFO_SESSION, result); + }, + + updateUserInfo: function (callback) { + let userInfo = wx.getStorageSync(constants.APP_USERINFO_SESSION); + if (userInfo && userInfo.userId) { + appAjax.postJson({ + type: 'GET', + service: 'GET_USER_STATUS', + otherParams: { + id: userInfo.userId, + }, + success: function (ret) { + if (ret) { + userInfo.gitee = ret.gitee_name; + userInfo.level = ret.level; + userInfo.eventLevel = ret.activity_level; + wx.setStorageSync(constants.APP_USERINFO_SESSION, userInfo); + } + callback && callback(); + }, + }); + } else { + callback && callback(); + } + }, + /** + * 兼容登录方法 + * @param {Object} callback + * @param {Object} userInfo + */ + wxGetUserProfileLogin(callback, userInfo) { + wx.showToast({ + title: '登录中', + icon: 'loading', + mask: true, + }); + + wx.login({ + success: function (data) { + appAjax.postJson({ + headers: { + Authorization: '', + }, + service: 'LOGIN', + data: { + userInfo: userInfo, + code: data.code, + }, + success: function (result) { + userInfo.access = result.access; + userInfo.level = result.level; + userInfo.eventLevel = result.activity_level; + userInfo.gitee = result.gitee_name; + userInfo.userId = result.user_id; + // // 缓存用户信息 + appUser.saveLoginInfo(userInfo || {}); + + // 回调 + callback && callback(userInfo || {}); + }, + }); + }, + complete() { + wx.hideToast(); + }, + }); + }, +}; + +module.exports = appUser; diff --git a/src/mindspore/utils/page-mixin.js b/src/mindspore/utils/page-mixin.js new file mode 100644 index 0000000000000000000000000000000000000000..bc90046b1c5444e75079dffe9ae84621428fcb09 --- /dev/null +++ b/src/mindspore/utils/page-mixin.js @@ -0,0 +1,138 @@ +/** + * 页面通用方法 + * author xzx + * since 2020-8-20 + */ + +const _ = require('./underscore-extend'); +const constants = require('../config/constants'); +const { deepExtend: $extend } = _; +const app = getApp(); + +// 页面数据 +const data = { + isIphoneX: app.globalData.isIphoneX, +}; + +// 页面方法 +const methods = { + /** + * 设置监听器 + */ + $setWatcher(data, watch) { + // 接收index.js传过来的data对象和watch对象 + watch && + Object.keys(watch).forEach((v) => { + // 将watch对象内的key遍历 + this.$observe(data, v, watch[v]); // 监听data内的v属性,传入watch内对应函数以调用 + }); + }, + + /** + * 监听属性 并执行监听函数 + */ + $observe(obj, key, watchFun) { + var val = obj[key]; // 给该属性设默认值 + var that = this; + Object.defineProperty(obj, key, { + configurable: true, + enumerable: true, + set(value) { + val = value; + watchFun.call(that, value, val); // 赋值(set)时,调用对应函数 + }, + get() { + return val; + }, + }); + }, + + /** + * 页面跳转 + */ + $navigateTo(event) { + wx.navigateTo({ + url: event.currentTarget.dataset.url, + }); + }, + + $stopPropagation() {}, +}; + +// 生命周期 +const lifeCycle = { + onLoad: { + before() { + this.$setWatcher(this.data, this.watch); // 设置监听器 + + var pages = getCurrentPages(); //获取加载的页面 + var currentPage = pages[pages.length - 1]; //获取当前页面的对象 + var url = currentPage.route; //当前页面url + + // 判断是否登录 + let userInfo = wx.getStorageSync(constants.APP_USERINFO_SESSION); + + if (url != 'pages/auth/auth') { + // wx.navigateTo({ + // url: `/package-events/events/event-detail?id=20` + // }) + if (!userInfo && !userInfo.access) { + // app.globalData.tourist = true; + } + } + }, + after() {}, + }, + + onShow: { + before() { + wx.hideHomeButton && wx.hideHomeButton(); + }, + }, +}; + +var local = { + getLifeCycle(rewriteList, lifeCycle, pageConfig) { + let config = {}; + + rewriteList.forEach((i) => { + if (i in pageConfig) { + config[i] = function () { + i in lifeCycle && 'before' in lifeCycle[i] && lifeCycle[i].before.call(this, ...arguments); + pageConfig[i].call(this, ...arguments); + i in lifeCycle && 'after' in lifeCycle[i] && lifeCycle[i].after.call(this, ...arguments); + }; + } + }); + + return config; + }, +}; + +var $pageMixin = function (pageConfig) { + let rewriteList = [ + 'onLoad', // 生命周期函数--监听页面加载 + // 'onReady', // 生命周期函数--监听页面初次渲染完成 + // 'onShow', // 生命周期函数--监听页面显示 + // 'onHide', // 生命周期函数--监听页面隐藏 + // 'onUnload', // 生命周期函数--监听页面卸载 + // 'onPullDownRefresh', // 页面相关事件处理函数--监听用户下拉动作 + // 'onReachBottom', // 页面上拉触底事件的处理函数 + // 'onShareAppMessage' // 用户点击右上角分享 + ]; + + let lifeConfig = local.getLifeCycle(rewriteList, lifeCycle, pageConfig); + + let baseConfig = { + data, + ...methods, + }; + + return $extend({}, baseConfig, pageConfig, lifeConfig); +}; + +module.exports = { + _, + $pageMixin, + $extend, +}; diff --git a/src/mindspore/utils/underscore-extend.js b/src/mindspore/utils/underscore-extend.js new file mode 100644 index 0000000000000000000000000000000000000000..f182990514fe10a723bb608ae5a8fa6271e14d07 --- /dev/null +++ b/src/mindspore/utils/underscore-extend.js @@ -0,0 +1,49 @@ +/** + * underscore扩展方法 + */ + +var _ = require('./underscore.js'); + +_.mixin({ + /** + * 对象深拷贝 + */ + deepExtend: function (target) { + var deep = true, + args = [].slice.call(arguments, 1); + + var extend = function (target, source, deep) { + var isArray = _.isArray; + var isWindow = function (obj) { + return obj != null && obj == obj.window; + }; + var isPlainObject = function (obj) { + return _.isObject(obj) && !isWindow(obj) && obj.__proto__ == Object.prototype; + }; + for (var key in source) { + //如果深度扩展 + if (deep && (isPlainObject(source[key]) || isArray(source[key]))) { + //如果要扩展的数据是对象且target相对应的key不是对象 + if (isPlainObject(source[key]) && !isPlainObject(target[key])) target[key] = {}; + //如果要扩展的数据是数组且target相对应的key不是数组 + if (isArray(source[key]) && !isArray(target[key])) target[key] = []; + extend(target[key], source[key], deep); + } else if (source[key] !== undefined) target[key] = source[key]; + } + }; + + if (typeof target == 'boolean') { + //当第一个参数为boolean类型的值时,表示是否深度扩展 + deep = target; + target = args.shift(); //target取第二个参数 + } + + //遍历后面的参数,全部扩展到target上 + args.forEach(function (arg) { + extend(target, arg, deep); + }); + return target; + }, +}); + +module.exports = _; diff --git a/src/mindspore/utils/underscore.js b/src/mindspore/utils/underscore.js new file mode 100644 index 0000000000000000000000000000000000000000..beadc7fdf3e8ab374a6aaa76ac4f0620c78b061d --- /dev/null +++ b/src/mindspore/utils/underscore.js @@ -0,0 +1,871 @@ +// Underscore.js 1.8.2 +// http://underscorejs.org +// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors +// Underscore may be freely distributed under the MIT license. +(function () { + function n(n) { + function t(t, r, e, u, i, o) { + for (; i >= 0 && o > i; i += n) { + var a = u ? u[i] : i; + e = r(e, t[a], a, t); + } + return e; + } + return function (r, e, u, i) { + e = d(e, i, 4); + var o = !w(r) && m.keys(r), + a = (o || r).length, + c = n > 0 ? 0 : a - 1; + return arguments.length < 3 && ((u = r[o ? o[c] : c]), (c += n)), t(r, e, u, o, c, a); + }; + } + function t(n) { + return function (t, r, e) { + r = b(r, e); + for (var u = null != t && t.length, i = n > 0 ? 0 : u - 1; i >= 0 && u > i; i += n) if (r(t[i], i, t)) return i; + return -1; + }; + } + function r(n, t) { + var r = S.length, + e = n.constructor, + u = (m.isFunction(e) && e.prototype) || o, + i = 'constructor'; + for (m.has(n, i) && !m.contains(t, i) && t.push(i); r--; ) + (i = S[r]), i in n && n[i] !== u[i] && !m.contains(t, i) && t.push(i); + } + var e = this, + u = e._, + i = Array.prototype, + o = Object.prototype, + a = Function.prototype, + c = i.push, + l = i.slice, + f = o.toString, + s = o.hasOwnProperty, + p = Array.isArray, + h = Object.keys, + v = a.bind, + g = Object.create, + y = function () {}, + m = function (n) { + return n instanceof m ? n : this instanceof m ? void (this._wrapped = n) : new m(n); + }; + 'undefined' != typeof exports + ? ('undefined' != typeof module && module.exports && (exports = module.exports = m), (exports._ = m)) + : (e._ = m), + (m.VERSION = '1.8.2'); + var d = function (n, t, r) { + if (t === void 0) return n; + switch (null == r ? 3 : r) { + case 1: + return function (r) { + return n.call(t, r); + }; + case 2: + return function (r, e) { + return n.call(t, r, e); + }; + case 3: + return function (r, e, u) { + return n.call(t, r, e, u); + }; + case 4: + return function (r, e, u, i) { + return n.call(t, r, e, u, i); + }; + } + return function () { + return n.apply(t, arguments); + }; + }, + b = function (n, t, r) { + return null == n ? m.identity : m.isFunction(n) ? d(n, t, r) : m.isObject(n) ? m.matcher(n) : m.property(n); + }; + m.iteratee = function (n, t) { + return b(n, t, 1 / 0); + }; + var x = function (n, t) { + return function (r) { + var e = arguments.length; + if (2 > e || null == r) return r; + for (var u = 1; e > u; u++) + for (var i = arguments[u], o = n(i), a = o.length, c = 0; a > c; c++) { + var l = o[c]; + (t && r[l] !== void 0) || (r[l] = i[l]); + } + return r; + }; + }, + _ = function (n) { + if (!m.isObject(n)) return {}; + if (g) return g(n); + y.prototype = n; + var t = new y(); + return (y.prototype = null), t; + }, + j = Math.pow(2, 53) - 1, + w = function (n) { + var t = n && n.length; + return 'number' == typeof t && t >= 0 && j >= t; + }; + (m.each = m.forEach = + function (n, t, r) { + t = d(t, r); + var e, u; + if (w(n)) for (e = 0, u = n.length; u > e; e++) t(n[e], e, n); + else { + var i = m.keys(n); + for (e = 0, u = i.length; u > e; e++) t(n[i[e]], i[e], n); + } + return n; + }), + (m.map = m.collect = + function (n, t, r) { + t = b(t, r); + for (var e = !w(n) && m.keys(n), u = (e || n).length, i = Array(u), o = 0; u > o; o++) { + var a = e ? e[o] : o; + i[o] = t(n[a], a, n); + } + return i; + }), + (m.reduce = m.foldl = m.inject = n(1)), + (m.reduceRight = m.foldr = n(-1)), + (m.find = m.detect = + function (n, t, r) { + var e; + return (e = w(n) ? m.findIndex(n, t, r) : m.findKey(n, t, r)), e !== void 0 && e !== -1 ? n[e] : void 0; + }), + (m.filter = m.select = + function (n, t, r) { + var e = []; + return ( + (t = b(t, r)), + m.each(n, function (n, r, u) { + t(n, r, u) && e.push(n); + }), + e + ); + }), + (m.reject = function (n, t, r) { + return m.filter(n, m.negate(b(t)), r); + }), + (m.every = m.all = + function (n, t, r) { + t = b(t, r); + for (var e = !w(n) && m.keys(n), u = (e || n).length, i = 0; u > i; i++) { + var o = e ? e[i] : i; + if (!t(n[o], o, n)) return !1; + } + return !0; + }), + (m.some = m.any = + function (n, t, r) { + t = b(t, r); + for (var e = !w(n) && m.keys(n), u = (e || n).length, i = 0; u > i; i++) { + var o = e ? e[i] : i; + if (t(n[o], o, n)) return !0; + } + return !1; + }), + (m.contains = + m.includes = + m.include = + function (n, t, r) { + return w(n) || (n = m.values(n)), m.indexOf(n, t, 'number' == typeof r && r) >= 0; + }), + (m.invoke = function (n, t) { + var r = l.call(arguments, 2), + e = m.isFunction(t); + return m.map(n, function (n) { + var u = e ? t : n[t]; + return null == u ? u : u.apply(n, r); + }); + }), + (m.pluck = function (n, t) { + return m.map(n, m.property(t)); + }), + (m.where = function (n, t) { + return m.filter(n, m.matcher(t)); + }), + (m.findWhere = function (n, t) { + return m.find(n, m.matcher(t)); + }), + (m.max = function (n, t, r) { + var e, + u, + i = -1 / 0, + o = -1 / 0; + if (null == t && null != n) { + n = w(n) ? n : m.values(n); + for (var a = 0, c = n.length; c > a; a++) (e = n[a]), e > i && (i = e); + } else + (t = b(t, r)), + m.each(n, function (n, r, e) { + (u = t(n, r, e)), (u > o || (u === -1 / 0 && i === -1 / 0)) && ((i = n), (o = u)); + }); + return i; + }), + (m.min = function (n, t, r) { + var e, + u, + i = 1 / 0, + o = 1 / 0; + if (null == t && null != n) { + n = w(n) ? n : m.values(n); + for (var a = 0, c = n.length; c > a; a++) (e = n[a]), i > e && (i = e); + } else + (t = b(t, r)), + m.each(n, function (n, r, e) { + (u = t(n, r, e)), (o > u || (1 / 0 === u && 1 / 0 === i)) && ((i = n), (o = u)); + }); + return i; + }), + (m.shuffle = function (n) { + for (var t, r = w(n) ? n : m.values(n), e = r.length, u = Array(e), i = 0; e > i; i++) + (t = m.random(0, i)), t !== i && (u[i] = u[t]), (u[t] = r[i]); + return u; + }), + (m.sample = function (n, t, r) { + return null == t || r + ? (w(n) || (n = m.values(n)), n[m.random(n.length - 1)]) + : m.shuffle(n).slice(0, Math.max(0, t)); + }), + (m.sortBy = function (n, t, r) { + return ( + (t = b(t, r)), + m.pluck( + m + .map(n, function (n, r, e) { + return { value: n, index: r, criteria: t(n, r, e) }; + }) + .sort(function (n, t) { + var r = n.criteria, + e = t.criteria; + if (r !== e) { + if (r > e || r === void 0) return 1; + if (e > r || e === void 0) return -1; + } + return n.index - t.index; + }), + 'value' + ) + ); + }); + var A = function (n) { + return function (t, r, e) { + var u = {}; + return ( + (r = b(r, e)), + m.each(t, function (e, i) { + var o = r(e, i, t); + n(u, e, o); + }), + u + ); + }; + }; + (m.groupBy = A(function (n, t, r) { + m.has(n, r) ? n[r].push(t) : (n[r] = [t]); + })), + (m.indexBy = A(function (n, t, r) { + n[r] = t; + })), + (m.countBy = A(function (n, t, r) { + m.has(n, r) ? n[r]++ : (n[r] = 1); + })), + (m.toArray = function (n) { + return n ? (m.isArray(n) ? l.call(n) : w(n) ? m.map(n, m.identity) : m.values(n)) : []; + }), + (m.size = function (n) { + return null == n ? 0 : w(n) ? n.length : m.keys(n).length; + }), + (m.partition = function (n, t, r) { + t = b(t, r); + var e = [], + u = []; + return ( + m.each(n, function (n, r, i) { + (t(n, r, i) ? e : u).push(n); + }), + [e, u] + ); + }), + (m.first = + m.head = + m.take = + function (n, t, r) { + return null == n ? void 0 : null == t || r ? n[0] : m.initial(n, n.length - t); + }), + (m.initial = function (n, t, r) { + return l.call(n, 0, Math.max(0, n.length - (null == t || r ? 1 : t))); + }), + (m.last = function (n, t, r) { + return null == n ? void 0 : null == t || r ? n[n.length - 1] : m.rest(n, Math.max(0, n.length - t)); + }), + (m.rest = + m.tail = + m.drop = + function (n, t, r) { + return l.call(n, null == t || r ? 1 : t); + }), + (m.compact = function (n) { + return m.filter(n, m.identity); + }); + var k = function (n, t, r, e) { + for (var u = [], i = 0, o = e || 0, a = n && n.length; a > o; o++) { + var c = n[o]; + if (w(c) && (m.isArray(c) || m.isArguments(c))) { + t || (c = k(c, t, r)); + var l = 0, + f = c.length; + for (u.length += f; f > l; ) u[i++] = c[l++]; + } else r || (u[i++] = c); + } + return u; + }; + (m.flatten = function (n, t) { + return k(n, t, !1); + }), + (m.without = function (n) { + return m.difference(n, l.call(arguments, 1)); + }), + (m.uniq = m.unique = + function (n, t, r, e) { + if (null == n) return []; + m.isBoolean(t) || ((e = r), (r = t), (t = !1)), null != r && (r = b(r, e)); + for (var u = [], i = [], o = 0, a = n.length; a > o; o++) { + var c = n[o], + l = r ? r(c, o, n) : c; + t + ? ((o && i === l) || u.push(c), (i = l)) + : r + ? m.contains(i, l) || (i.push(l), u.push(c)) + : m.contains(u, c) || u.push(c); + } + return u; + }), + (m.union = function () { + return m.uniq(k(arguments, !0, !0)); + }), + (m.intersection = function (n) { + if (null == n) return []; + for (var t = [], r = arguments.length, e = 0, u = n.length; u > e; e++) { + var i = n[e]; + if (!m.contains(t, i)) { + for (var o = 1; r > o && m.contains(arguments[o], i); o++); + o === r && t.push(i); + } + } + return t; + }), + (m.difference = function (n) { + var t = k(arguments, !0, !0, 1); + return m.filter(n, function (n) { + return !m.contains(t, n); + }); + }), + (m.zip = function () { + return m.unzip(arguments); + }), + (m.unzip = function (n) { + for (var t = (n && m.max(n, 'length').length) || 0, r = Array(t), e = 0; t > e; e++) r[e] = m.pluck(n, e); + return r; + }), + (m.object = function (n, t) { + for (var r = {}, e = 0, u = n && n.length; u > e; e++) t ? (r[n[e]] = t[e]) : (r[n[e][0]] = n[e][1]); + return r; + }), + (m.indexOf = function (n, t, r) { + var e = 0, + u = n && n.length; + if ('number' == typeof r) e = 0 > r ? Math.max(0, u + r) : r; + else if (r && u) return (e = m.sortedIndex(n, t)), n[e] === t ? e : -1; + if (t !== t) return m.findIndex(l.call(n, e), m.isNaN); + for (; u > e; e++) if (n[e] === t) return e; + return -1; + }), + (m.lastIndexOf = function (n, t, r) { + var e = n ? n.length : 0; + if (('number' == typeof r && (e = 0 > r ? e + r + 1 : Math.min(e, r + 1)), t !== t)) + return m.findLastIndex(l.call(n, 0, e), m.isNaN); + for (; --e >= 0; ) if (n[e] === t) return e; + return -1; + }), + (m.findIndex = t(1)), + (m.findLastIndex = t(-1)), + (m.sortedIndex = function (n, t, r, e) { + r = b(r, e, 1); + for (var u = r(t), i = 0, o = n.length; o > i; ) { + var a = Math.floor((i + o) / 2); + r(n[a]) < u ? (i = a + 1) : (o = a); + } + return i; + }), + (m.range = function (n, t, r) { + arguments.length <= 1 && ((t = n || 0), (n = 0)), (r = r || 1); + for (var e = Math.max(Math.ceil((t - n) / r), 0), u = Array(e), i = 0; e > i; i++, n += r) u[i] = n; + return u; + }); + var O = function (n, t, r, e, u) { + if (!(e instanceof t)) return n.apply(r, u); + var i = _(n.prototype), + o = n.apply(i, u); + return m.isObject(o) ? o : i; + }; + (m.bind = function (n, t) { + if (v && n.bind === v) return v.apply(n, l.call(arguments, 1)); + if (!m.isFunction(n)) throw new TypeError('Bind must be called on a function'); + var r = l.call(arguments, 2), + e = function () { + return O(n, e, t, this, r.concat(l.call(arguments))); + }; + return e; + }), + (m.partial = function (n) { + var t = l.call(arguments, 1), + r = function () { + for (var e = 0, u = t.length, i = Array(u), o = 0; u > o; o++) i[o] = t[o] === m ? arguments[e++] : t[o]; + for (; e < arguments.length; ) i.push(arguments[e++]); + return O(n, r, this, this, i); + }; + return r; + }), + (m.bindAll = function (n) { + var t, + r, + e = arguments.length; + if (1 >= e) throw new Error('bindAll must be passed function names'); + for (t = 1; e > t; t++) (r = arguments[t]), (n[r] = m.bind(n[r], n)); + return n; + }), + (m.memoize = function (n, t) { + var r = function (e) { + var u = r.cache, + i = '' + (t ? t.apply(this, arguments) : e); + return m.has(u, i) || (u[i] = n.apply(this, arguments)), u[i]; + }; + return (r.cache = {}), r; + }), + (m.delay = function (n, t) { + var r = l.call(arguments, 2); + return setTimeout(function () { + return n.apply(null, r); + }, t); + }), + (m.defer = m.partial(m.delay, m, 1)), + (m.throttle = function (n, t, r) { + var e, + u, + i, + o = null, + a = 0; + r || (r = {}); + var c = function () { + (a = r.leading === !1 ? 0 : m.now()), (o = null), (i = n.apply(e, u)), o || (e = u = null); + }; + return function () { + var l = m.now(); + a || r.leading !== !1 || (a = l); + var f = t - (l - a); + return ( + (e = this), + (u = arguments), + 0 >= f || f > t + ? (o && (clearTimeout(o), (o = null)), (a = l), (i = n.apply(e, u)), o || (e = u = null)) + : o || r.trailing === !1 || (o = setTimeout(c, f)), + i + ); + }; + }), + (m.debounce = function (n, t, r) { + var e, + u, + i, + o, + a, + c = function () { + var l = m.now() - o; + t > l && l >= 0 ? (e = setTimeout(c, t - l)) : ((e = null), r || ((a = n.apply(i, u)), e || (i = u = null))); + }; + return function () { + (i = this), (u = arguments), (o = m.now()); + var l = r && !e; + return e || (e = setTimeout(c, t)), l && ((a = n.apply(i, u)), (i = u = null)), a; + }; + }), + (m.wrap = function (n, t) { + return m.partial(t, n); + }), + (m.negate = function (n) { + return function () { + return !n.apply(this, arguments); + }; + }), + (m.compose = function () { + var n = arguments, + t = n.length - 1; + return function () { + for (var r = t, e = n[t].apply(this, arguments); r--; ) e = n[r].call(this, e); + return e; + }; + }), + (m.after = function (n, t) { + return function () { + return --n < 1 ? t.apply(this, arguments) : void 0; + }; + }), + (m.before = function (n, t) { + var r; + return function () { + return --n > 0 && (r = t.apply(this, arguments)), 1 >= n && (t = null), r; + }; + }), + (m.once = m.partial(m.before, 2)); + var F = !{ toString: null }.propertyIsEnumerable('toString'), + S = ['valueOf', 'isPrototypeOf', 'toString', 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString']; + (m.keys = function (n) { + if (!m.isObject(n)) return []; + if (h) return h(n); + var t = []; + for (var e in n) m.has(n, e) && t.push(e); + return F && r(n, t), t; + }), + (m.allKeys = function (n) { + if (!m.isObject(n)) return []; + var t = []; + for (var e in n) t.push(e); + return F && r(n, t), t; + }), + (m.values = function (n) { + for (var t = m.keys(n), r = t.length, e = Array(r), u = 0; r > u; u++) e[u] = n[t[u]]; + return e; + }), + (m.mapObject = function (n, t, r) { + t = b(t, r); + for (var e, u = m.keys(n), i = u.length, o = {}, a = 0; i > a; a++) (e = u[a]), (o[e] = t(n[e], e, n)); + return o; + }), + (m.pairs = function (n) { + for (var t = m.keys(n), r = t.length, e = Array(r), u = 0; r > u; u++) e[u] = [t[u], n[t[u]]]; + return e; + }), + (m.invert = function (n) { + for (var t = {}, r = m.keys(n), e = 0, u = r.length; u > e; e++) t[n[r[e]]] = r[e]; + return t; + }), + (m.functions = m.methods = + function (n) { + var t = []; + for (var r in n) m.isFunction(n[r]) && t.push(r); + return t.sort(); + }), + (m.extend = x(m.allKeys)), + (m.extendOwn = m.assign = x(m.keys)), + (m.findKey = function (n, t, r) { + t = b(t, r); + for (var e, u = m.keys(n), i = 0, o = u.length; o > i; i++) if (((e = u[i]), t(n[e], e, n))) return e; + }), + (m.pick = function (n, t, r) { + var e, + u, + i = {}, + o = n; + if (null == o) return i; + m.isFunction(t) + ? ((u = m.allKeys(o)), (e = d(t, r))) + : ((u = k(arguments, !1, !1, 1)), + (e = function (n, t, r) { + return t in r; + }), + (o = Object(o))); + for (var a = 0, c = u.length; c > a; a++) { + var l = u[a], + f = o[l]; + e(f, l, o) && (i[l] = f); + } + return i; + }), + (m.omit = function (n, t, r) { + if (m.isFunction(t)) t = m.negate(t); + else { + var e = m.map(k(arguments, !1, !1, 1), String); + t = function (n, t) { + return !m.contains(e, t); + }; + } + return m.pick(n, t, r); + }), + (m.defaults = x(m.allKeys, !0)), + (m.clone = function (n) { + return m.isObject(n) ? (m.isArray(n) ? n.slice() : m.extend({}, n)) : n; + }), + (m.tap = function (n, t) { + return t(n), n; + }), + (m.isMatch = function (n, t) { + var r = m.keys(t), + e = r.length; + if (null == n) return !e; + for (var u = Object(n), i = 0; e > i; i++) { + var o = r[i]; + if (t[o] !== u[o] || !(o in u)) return !1; + } + return !0; + }); + var E = function (n, t, r, e) { + if (n === t) return 0 !== n || 1 / n === 1 / t; + if (null == n || null == t) return n === t; + n instanceof m && (n = n._wrapped), t instanceof m && (t = t._wrapped); + var u = f.call(n); + if (u !== f.call(t)) return !1; + switch (u) { + case '[object RegExp]': + case '[object String]': + return '' + n == '' + t; + case '[object Number]': + return +n !== +n ? +t !== +t : 0 === +n ? 1 / +n === 1 / t : +n === +t; + case '[object Date]': + case '[object Boolean]': + return +n === +t; + } + var i = '[object Array]' === u; + if (!i) { + if ('object' != typeof n || 'object' != typeof t) return !1; + var o = n.constructor, + a = t.constructor; + if ( + o !== a && + !(m.isFunction(o) && o instanceof o && m.isFunction(a) && a instanceof a) && + 'constructor' in n && + 'constructor' in t + ) + return !1; + } + (r = r || []), (e = e || []); + for (var c = r.length; c--; ) if (r[c] === n) return e[c] === t; + if ((r.push(n), e.push(t), i)) { + if (((c = n.length), c !== t.length)) return !1; + for (; c--; ) if (!E(n[c], t[c], r, e)) return !1; + } else { + var l, + s = m.keys(n); + if (((c = s.length), m.keys(t).length !== c)) return !1; + for (; c--; ) if (((l = s[c]), !m.has(t, l) || !E(n[l], t[l], r, e))) return !1; + } + return r.pop(), e.pop(), !0; + }; + (m.isEqual = function (n, t) { + return E(n, t); + }), + (m.isEmpty = function (n) { + return null == n + ? !0 + : w(n) && (m.isArray(n) || m.isString(n) || m.isArguments(n)) + ? 0 === n.length + : 0 === m.keys(n).length; + }), + (m.isElement = function (n) { + return !(!n || 1 !== n.nodeType); + }), + (m.isArray = + p || + function (n) { + return '[object Array]' === f.call(n); + }), + (m.isObject = function (n) { + var t = typeof n; + return 'function' === t || ('object' === t && !!n); + }), + m.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error'], function (n) { + m['is' + n] = function (t) { + return f.call(t) === '[object ' + n + ']'; + }; + }), + m.isArguments(arguments) || + (m.isArguments = function (n) { + return m.has(n, 'callee'); + }), + 'function' != typeof /./ && + 'object' != typeof Int8Array && + (m.isFunction = function (n) { + return 'function' == typeof n || !1; + }), + (m.isFinite = function (n) { + return isFinite(n) && !isNaN(parseFloat(n)); + }), + (m.isNaN = function (n) { + return m.isNumber(n) && n !== +n; + }), + (m.isBoolean = function (n) { + return n === !0 || n === !1 || '[object Boolean]' === f.call(n); + }), + (m.isNull = function (n) { + return null === n; + }), + (m.isUndefined = function (n) { + return n === void 0; + }), + (m.has = function (n, t) { + return null != n && s.call(n, t); + }), + (m.noConflict = function () { + return (e._ = u), this; + }), + (m.identity = function (n) { + return n; + }), + (m.constant = function (n) { + return function () { + return n; + }; + }), + (m.noop = function () {}), + (m.property = function (n) { + return function (t) { + return null == t ? void 0 : t[n]; + }; + }), + (m.propertyOf = function (n) { + return null == n + ? function () {} + : function (t) { + return n[t]; + }; + }), + (m.matcher = m.matches = + function (n) { + return ( + (n = m.extendOwn({}, n)), + function (t) { + return m.isMatch(t, n); + } + ); + }), + (m.times = function (n, t, r) { + var e = Array(Math.max(0, n)); + t = d(t, r, 1); + for (var u = 0; n > u; u++) e[u] = t(u); + return e; + }), + (m.random = function (n, t) { + return null == t && ((t = n), (n = 0)), n + Math.floor(Math.random() * (t - n + 1)); + }), + (m.now = + Date.now || + function () { + return new Date().getTime(); + }); + var M = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''', '`': '`' }, + N = m.invert(M), + I = function (n) { + var t = function (t) { + return n[t]; + }, + r = '(?:' + m.keys(n).join('|') + ')', + e = RegExp(r), + u = RegExp(r, 'g'); + return function (n) { + return (n = null == n ? '' : '' + n), e.test(n) ? n.replace(u, t) : n; + }; + }; + (m.escape = I(M)), + (m.unescape = I(N)), + (m.result = function (n, t, r) { + var e = null == n ? void 0 : n[t]; + return e === void 0 && (e = r), m.isFunction(e) ? e.call(n) : e; + }); + var B = 0; + (m.uniqueId = function (n) { + var t = ++B + ''; + return n ? n + t : t; + }), + (m.templateSettings = { evaluate: /<%([\s\S]+?)%>/g, interpolate: /<%=([\s\S]+?)%>/g, escape: /<%-([\s\S]+?)%>/g }); + var T = /(.)^/, + R = { "'": "'", '\\': '\\', '\r': 'r', '\n': 'n', '\u2028': 'u2028', '\u2029': 'u2029' }, + q = /\\|'|\r|\n|\u2028|\u2029/g, + K = function (n) { + return '\\' + R[n]; + }; + (m.template = function (n, t, r) { + !t && r && (t = r), (t = m.defaults({}, t, m.templateSettings)); + var e = RegExp( + [(t.escape || T).source, (t.interpolate || T).source, (t.evaluate || T).source].join('|') + '|$', + 'g' + ), + u = 0, + i = "__p+='"; + n.replace(e, function (t, r, e, o, a) { + return ( + (i += n.slice(u, a).replace(q, K)), + (u = a + t.length), + r + ? (i += "'+\n((__t=(" + r + "))==null?'':_.escape(__t))+\n'") + : e + ? (i += "'+\n((__t=(" + e + "))==null?'':__t)+\n'") + : o && (i += "';\n" + o + "\n__p+='"), + t + ); + }), + (i += "';\n"), + t.variable || (i = 'with(obj||{}){\n' + i + '}\n'), + (i = + "var __t,__p='',__j=Array.prototype.join," + + "print=function(){__p+=__j.call(arguments,'');};\n" + + i + + 'return __p;\n'); + try { + var o = new Function(t.variable || 'obj', '_', i); + } catch (a) { + throw ((a.source = i), a); + } + var c = function (n) { + return o.call(this, n, m); + }, + l = t.variable || 'obj'; + return (c.source = 'function(' + l + '){\n' + i + '}'), c; + }), + (m.chain = function (n) { + var t = m(n); + return (t._chain = !0), t; + }); + var z = function (n, t) { + return n._chain ? m(t).chain() : t; + }; + (m.mixin = function (n) { + m.each(m.functions(n), function (t) { + var r = (m[t] = n[t]); + m.prototype[t] = function () { + var n = [this._wrapped]; + return c.apply(n, arguments), z(this, r.apply(m, n)); + }; + }); + }), + m.mixin(m), + m.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function (n) { + var t = i[n]; + m.prototype[n] = function () { + var r = this._wrapped; + return t.apply(r, arguments), ('shift' !== n && 'splice' !== n) || 0 !== r.length || delete r[0], z(this, r); + }; + }), + m.each(['concat', 'join', 'slice'], function (n) { + var t = i[n]; + m.prototype[n] = function () { + return z(this, t.apply(this._wrapped, arguments)); + }; + }), + (m.prototype.value = function () { + return this._wrapped; + }), + (m.prototype.valueOf = m.prototype.toJSON = m.prototype.value), + (m.prototype.toString = function () { + return '' + this._wrapped; + }), + 'function' == typeof define && + define.amd && + define('underscore', [], function () { + return m; + }); +}.call(this || module.exports)); +//# sourceMappingURL=underscore-min.map diff --git a/src/mindspore/utils/util.js b/src/mindspore/utils/util.js new file mode 100644 index 0000000000000000000000000000000000000000..fc58623ec061b64b1e1120e03c710a605d0eec6e --- /dev/null +++ b/src/mindspore/utils/util.js @@ -0,0 +1,19 @@ +const formatTime = (date) => { + const year = date.getFullYear(); + const month = date.getMonth() + 1; + const day = date.getDate(); + const hour = date.getHours(); + const minute = date.getMinutes(); + const second = date.getSeconds(); + + return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':'); +}; + +const formatNumber = (n) => { + n = n.toString(); + return n[1] ? n : '0' + n; +}; + +module.exports = { + formatTime: formatTime, +}; diff --git a/src/mindspore/utils/utils.js b/src/mindspore/utils/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..32adb33564ae98c2f1f2b784cc68ab884bef0f23 --- /dev/null +++ b/src/mindspore/utils/utils.js @@ -0,0 +1,274 @@ +/** + * 工具类 + */ + +var _ = require('./underscore-extend'); + +var utils = { + /** + * underscore工具库 + */ + _: _, + + /** + * 深拷贝工具 + */ + deepExtend: _.deepExtend, + + /** + * 获取时间差(小于一天) + * @param {Object} startTime 开始时间 long 毫秒数 + * @param {Object} endTime 结束时间 long 毫秒数 + * return { + * "days" : days, + * "hours" : hours, + * "minutes" : minutes, + * "seconds" : seconds + * } + */ + getDiffTime: function (startTime, endTime) { + // 相差时间 + var diffTime = endTime - startTime; + if (diffTime <= 0) { + return false; + } + // 计算出相差天数 + var days = Math.floor(diffTime / (24 * 3600 * 1000)); + // 计算出小时数 + var leave1 = diffTime % (24 * 3600 * 1000); //计算天数后剩余的毫秒数 + var hours = Math.floor(leave1 / (3600 * 1000)); + // 计算相差分钟数 + var leave2 = leave1 % (3600 * 1000); //计算小时数后剩余的毫秒数 + var minutes = Math.floor(leave2 / (60 * 1000)); + // 计算相差秒数 + var leave3 = leave2 % (60 * 1000); //计算分钟数后剩余的毫秒数 + var seconds = Math.round(leave3 / 1000); + + return { + days: days, + hours: hours, + minutes: minutes, + seconds: seconds, + }; + }, + + /** + * 返回定时器格式(若天和小时为0则隐藏天和小时) + * @param {Object} time + */ + getTiktokStr: function (time) { + var str = time.seconds + '秒'; + if (time.days != 0) { + str = time.days + '天' + time.hours + '小时' + time.minutes + '分钟' + str; + } else if (time.hours != 0) { + str = time.hours + '小时' + time.minutes + '分钟' + str; + } else if (time.minutes != 0) { + str = time.minutes + '分钟' + str; + } + return str; + }, + + /** + * 倒计时方法 + * @param {Object} startTime long 开始时间 + * @param {Object} endTime long 结束时间 + * @param {Object} renderFunc 回调渲染函数 + * @param {Object} endFunc 倒计时结束回调函数 + */ + intervalTime: function (startTime, endTime, renderFunc, endFunc) { + if (!startTime || !endTime) { + return; + } + startTime = parseInt(startTime); + endTime = parseInt(endTime); + + var that = this; + + var diffTime = that.getDiffTime(startTime, endTime); + diffTime = that.getTiktokStr(diffTime); + renderFunc && renderFunc(diffTime); + startTime += 1000; + + var interval = setInterval(function () { + diffTime = that.getDiffTime(startTime, endTime); + if (diffTime) { + startTime += 1000; + diffTime = that.getTiktokStr(diffTime); + renderFunc && renderFunc(diffTime); + } else { + clearInterval(interval); + endFunc && endFunc(); + } + }, 1000); + }, + + /** + * 判断对象是否为空 + */ + isEmptyObject: function (obj) { + var t; + for (t in obj) { + return false; + } + return true; + }, + + /** + * 获取当前页面url + */ + getCurrentUrl: function () { + var pageStack = getCurrentPages(); + var thisPage = pageStack[pageStack.length - 1]; + + var baseUrl = thisPage.route; + var paramObj = thisPage.options; + var params = ''; + + if (this.isEmptyObject(paramObj)) { + return baseUrl; + } else { + for (var i in paramObj) { + if (params.indexOf('?') >= 0) { + params += '&'; + } else { + params += '?'; + } + params += i + '=' + paramObj[i]; + } + } + + return baseUrl + params; + }, + + /** + * 替换html特殊字符串 + */ + replaceHtmlString: function (str) { + str = str.replace(/ /g, ' '); + return str; + }, + + /** + * 添加URL的参数 + * @param name 名称 + * @param value 值 + * @param url 链接地址 + */ + addUrlParam: function (name, value, url) { + if (!value) { + return url; + } + + if (url.indexOf(name + '=') > -1) { + return url; + } + var tmpUrl = url; + + // 判断是否已经有其他参数 + if (tmpUrl.indexOf('?') >= 0) { + tmpUrl += '&'; + } else { + tmpUrl += '?'; + } + tmpUrl += name + '=' + value; + + return tmpUrl; + }, + + /** + * 日期格式化 + */ + formateDate: function () { + // 对Date的扩展,将 Date 转化为指定格式的String + // 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符, + // 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字) + // 例子: + // (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423 + // (new Date()).Format("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18 + Date.prototype.Format = function (fmt) { + var o = { + 'M+': this.getMonth() + 1, //月份 + 'd+': this.getDate(), //日 + 'h+': this.getHours(), //小时 + 'm+': this.getMinutes(), //分 + 's+': this.getSeconds(), //秒 + 'q+': Math.floor((this.getMonth() + 3) / 3), //季度 + S: this.getMilliseconds(), //毫秒 + }; + if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length)); + for (var k in o) + if (new RegExp('(' + k + ')').test(fmt)) + fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length)); + return fmt; + }; + }, + + /** + * 版本比较 + * param {string} v1 > v2 ? 1 : -1 ; 相等返回0 + */ + compareVersion: function (v1, v2) { + v1 = v1.split('.'); + v2 = v2.split('.'); + var len = Math.max(v1.length, v2.length); + + while (v1.length < len) { + v1.push('0'); + } + + while (v2.length < len) { + v2.push('0'); + } + + for (var i = 0; i < len; i++) { + var num1 = parseInt(v1[i]); + var num2 = parseInt(v2[i]); + + if (num1 > num2) { + return 1; + } else if (num1 < num2) { + return -1; + } + } + + return 0; + }, + + /** + * 静态资源定时清理缓存用的后缀 + */ + resourceSuffix: function () { + var randomStr = '?' + new Date().getTime().toString().slice(0, 7) + '000000'; + return randomStr; + }, + + /** + * 资讯跳转方法(文章、图集) + * @param {Object} options + * jumpType:跳转方法名, + * infoType:资讯类型1文章 2图集 3视频 4链接(不支持), + * id:资讯详情id + */ + jumpToInfo: function (options) { + var id = options.id ? options.id : ''; + var type = options.infoType ? options.infoType : 1; + var jumpType = + options.jumpType && options.jumpType in wx && typeof wx[options.jumpType] == 'function' + ? options.jumpType + : 'navigateTo'; + + // 1文章 2图集 3视频 4链接(不支持) + var infoConfig = { + 1: '/pages/discovery/info', + 2: '/pages/discovery/picture-info', + }; + + var path = type in infoConfig ? infoConfig[type] + '?id=' + id : infoConfig[1] + '?id=' + id; + + wx[jumpType]({ + url: path, + }); + }, +}; + +module.exports = utils; diff --git a/src/mindspore/utils/wx-validate.js b/src/mindspore/utils/wx-validate.js new file mode 100644 index 0000000000000000000000000000000000000000..cd45cebeba48e45facc306dab8d2f7c786b5e01a --- /dev/null +++ b/src/mindspore/utils/wx-validate.js @@ -0,0 +1,426 @@ +/** + * 表单验证 + * @param {Object} rules 验证字段的规则 + * @param {Object} messages 验证字段的提示信息 + */ + +class WxValidate { + constructor(rules = {}, messages = {}) { + Object.assign(this, { + data: {}, + rules, + messages, + }); + this.__init(); + } + + /** + * __init + */ + __init() { + this.__initMethods(); + this.__initDefaults(); + this.__initData(); + } + + /** + * 初始化数据 + */ + __initData() { + this.form = {}; + this.errorList = []; + } + + /** + * 初始化默认提示信息 + */ + __initDefaults() { + this.defaults = { + messages: { + required: '这是必填字段。', + email: '请输入有效的电子邮件地址。', + tel: '请输入11位的手机号码。', + url: '请输入有效的网址。', + date: '请输入有效的日期。', + dateISO: '请输入有效的日期(ISO),例如:2009-06-23,1998/01/22。', + number: '请输入有效的数字。', + digits: '只能输入数字。', + idcard: '请输入18位的有效身份证。', + equalTo: this.formatTpl('输入值必须和 {0} 相同。'), + contains: this.formatTpl('输入值必须包含 {0}。'), + minlength: this.formatTpl('最少要输入 {0} 个字符。'), + maxlength: this.formatTpl('最多可以输入 {0} 个字符。'), + rangelength: this.formatTpl('请输入长度在 {0} 到 {1} 之间的字符。'), + min: this.formatTpl('请输入不小于 {0} 的数值。'), + max: this.formatTpl('请输入不大于 {0} 的数值。'), + range: this.formatTpl('请输入范围在 {0} 到 {1} 之间的数值。'), + }, + }; + } + + /** + * 初始化默认验证方法 + */ + __initMethods() { + const that = this; + that.methods = { + /** + * 验证必填元素 + */ + required(value, param) { + if (!that.depend(param)) { + return 'dependency-mismatch'; + } else if (typeof value === 'number') { + value = value.toString(); + } else if (typeof value === 'boolean') { + return !0; + } + + return value.length > 0; + }, + /** + * 验证电子邮箱格式 + */ + email(value) { + return ( + that.optional(value) || + /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test( + value + ) + ); + }, + /** + * 验证手机格式 + */ + tel(value) { + return that.optional(value) || /^1[3456789]\d{9}$/.test(value); + }, + /** + * 验证URL格式 + */ + url(value) { + return ( + that.optional(value) || + /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test( + value + ) + ); + }, + /** + * 验证日期格式 + */ + date(value) { + return that.optional(value) || !/Invalid|NaN/.test(new Date(value).toString()); + }, + /** + * 验证ISO类型的日期格式 + */ + dateISO(value) { + return that.optional(value) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value); + }, + /** + * 验证十进制数字 + */ + number(value) { + return that.optional(value) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value); + }, + /** + * 验证整数 + */ + digits(value) { + return that.optional(value) || /^\d+$/.test(value); + }, + /** + * 验证身份证号码 + */ + idcard(value) { + return ( + that.optional(value) || /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value) + ); + }, + /** + * 验证两个输入框的内容是否相同 + */ + equalTo(value, param) { + return that.optional(value) || value === that.data[param]; + }, + /** + * 验证是否包含某个值 + */ + contains(value, param) { + return that.optional(value) || value.indexOf(param) >= 0; + }, + /** + * 验证最小长度 + */ + minlength(value, param) { + return that.optional(value) || value.length >= param; + }, + /** + * 验证最大长度 + */ + maxlength(value, param) { + return that.optional(value) || value.length <= param; + }, + /** + * 验证一个长度范围[min, max] + */ + rangelength(value, param) { + return that.optional(value) || (value.length >= param[0] && value.length <= param[1]); + }, + /** + * 验证最小值 + */ + min(value, param) { + return that.optional(value) || value >= param; + }, + /** + * 验证最大值 + */ + max(value, param) { + return that.optional(value) || value <= param; + }, + /** + * 验证一个值范围[min, max] + */ + range(value, param) { + return that.optional(value) || (value >= param[0] && value <= param[1]); + }, + }; + } + + /** + * 添加自定义验证方法 + * @param {String} name 方法名 + * @param {Function} method 函数体,接收两个参数(value, param),value表示元素的值,param表示参数 + * @param {String} message 提示信息 + */ + addMethod(name, method, message) { + this.methods[name] = method; + this.defaults.messages[name] = message !== undefined ? message : this.defaults.messages[name]; + } + + /** + * 判断验证方法是否存在 + */ + isValidMethod(value) { + let methods = []; + for (let method in this.methods) { + if (method && typeof this.methods[method] === 'function') { + methods.push(method); + } + } + return methods.indexOf(value) !== -1; + } + + /** + * 格式化提示信息模板 + */ + formatTpl(source, params) { + const that = this; + if (arguments.length === 1) { + return function () { + let args = Array.from(arguments); + args.unshift(source); + return that.formatTpl.apply(this, args); + }; + } + if (params === undefined) { + return source; + } + if (arguments.length > 2 && params.constructor !== Array) { + params = Array.from(arguments).slice(1); + } + if (params.constructor !== Array) { + params = [params]; + } + params.forEach(function (n, i) { + source = source.replace(new RegExp('\\{' + i + '\\}', 'g'), function () { + return n; + }); + }); + return source; + } + + /** + * 判断规则依赖是否存在 + */ + depend(param) { + switch (typeof param) { + case 'boolean': + param = param; + break; + case 'string': + param = !!param.length; + break; + case 'function': + param = param(); + default: + param = !0; + } + return param; + } + + /** + * 判断输入值是否为空 + */ + optional(value) { + return !this.methods.required(value) && 'dependency-mismatch'; + } + + /** + * 获取自定义字段的提示信息 + * @param {String} param 字段名 + * @param {Object} rule 规则 + */ + customMessage(param, rule) { + const params = this.messages[param]; + const isObject = typeof params === 'object'; + if (params && isObject) return params[rule.method]; + } + + /** + * 获取某个指定字段的提示信息 + * @param {String} param 字段名 + * @param {Object} rule 规则 + */ + defaultMessage(param, rule) { + let message = this.customMessage(param, rule) || this.defaults.messages[rule.method]; + let type = typeof message; + + if (type === 'undefined') { + message = `Warning: No message defined for ${rule.method}.`; + } else if (type === 'function') { + message = message.call(this, rule.parameters); + } + + return message; + } + + /** + * 缓存错误信息 + * @param {String} param 字段名 + * @param {Object} rule 规则 + * @param {String} value 元素的值 + */ + formatTplAndAdd(param, rule, value) { + let msg = this.defaultMessage(param, rule); + + this.errorList.push({ + param: param, + msg: msg, + value: value, + }); + } + + /** + * 验证某个指定字段的规则 + * @param {String} param 字段名 + * @param {Object} rules 规则 + * @param {Object} data 需要验证的数据对象 + */ + checkParam(param, rules, data) { + // 缓存数据对象 + this.data = data; + + // 缓存字段对应的值 + const value = data[param] !== null && data[param] !== undefined ? data[param] : ''; + + // 遍历某个指定字段的所有规则,依次验证规则,否则缓存错误信息 + for (let method in rules) { + // 判断验证方法是否存在 + if (this.isValidMethod(method)) { + // 缓存规则的属性及值 + const rule = { + method: method, + parameters: rules[method], + }; + + // 调用验证方法 + const result = this.methods[method](value, rule.parameters); + + // 若result返回值为dependency-mismatch,则说明该字段的值为空或非必填字段 + if (result === 'dependency-mismatch') { + continue; + } + + this.setValue(param, method, result, value); + + // 判断是否通过验证,否则缓存错误信息,跳出循环 + if (!result) { + this.formatTplAndAdd(param, rule, value); + break; + } + } + } + } + + /** + * 设置字段的默认验证值 + * @param {String} param 字段名 + */ + setView(param) { + this.form[param] = { + $name: param, + $valid: true, + $invalid: false, + $error: {}, + $success: {}, + $viewValue: ``, + }; + } + + /** + * 设置字段的验证值 + * @param {String} param 字段名 + * @param {String} method 字段的方法 + * @param {Boolean} result 是否通过验证 + * @param {String} value 字段的值 + */ + setValue(param, method, result, value) { + const params = this.form[param]; + params.$valid = result; + params.$invalid = !result; + params.$error[method] = !result; + params.$success[method] = result; + params.$viewValue = value; + } + + /** + * 验证所有字段的规则,返回验证是否通过 + * @param {Object} data 需要验证数据对象 + */ + checkForm(data) { + this.__initData(); + + for (let param in this.rules) { + this.setView(param); + this.checkParam(param, this.rules[param], data); + } + + return this.valid(); + } + + /** + * 返回验证是否通过 + */ + valid() { + return this.size() === 0; + } + + /** + * 返回错误信息的个数 + */ + size() { + return this.errorList.length; + } + + /** + * 返回所有错误信息 + */ + validationErrors() { + return this.errorList; + } +} + +module.exports = WxValidate;