diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..5d47c21 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4257947 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.svn +.vscode +node_modules +.idea +.DS_Store diff --git a/.neoconf.json b/.neoconf.json new file mode 100644 index 0000000..437bfce --- /dev/null +++ b/.neoconf.json @@ -0,0 +1,10 @@ +{ + "emmet_language_server": { + "init_options": { + "preferences": { + "css.intUnit": "rpx", + "css.floatUnitr": "rpx" + } + } + } +} diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..f20f145 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,28 @@ +{ + "$schema": "http://json.schemastore.org/prettierrc", + "printWidth": 120, + "tabWidth": 2, + "useTabs": false, + "semi": false, + "singleQuote": true, + "bracketSpacing": true, + "trailingComma": "all", + "arrowParens": "always", + "endOfLine": "lf", + "htmlWhitespaceSensitivity": "ignore", + "singleAttributePerLine": false, + "overrides": [ + { + "files": "*.wxml", + "options": { "parser": "html" } + }, + { + "files": "*.wxss", + "options": { "parser": "css" } + }, + { + "files": "*.wxs", + "options": { "parser": "babel" } + } + ] +} diff --git a/.trae/rules/project_rules.md b/.trae/rules/project_rules.md new file mode 100644 index 0000000..25028eb --- /dev/null +++ b/.trae/rules/project_rules.md @@ -0,0 +1,2 @@ +1. 本项目使用 TypeScript + scss 进行开发 +2. 不使用测试框架 diff --git a/babel.config.json b/babel.config.json new file mode 100644 index 0000000..5f36c55 --- /dev/null +++ b/babel.config.json @@ -0,0 +1,11 @@ +{ + "plugins": [ + [ + "@babel/plugin-transform-react-jsx", + { + "runtime": "automatic", + "importSource": "@antv/f2" + } + ] + ] +} diff --git a/dist.nu b/dist.nu new file mode 100644 index 0000000..5f298e8 --- /dev/null +++ b/dist.nu @@ -0,0 +1,5 @@ +cd ./src/images/ +svn add . --no-ignore --force +svn ci -m "版本更新" +cd .. +cd .. diff --git a/dist.ps1 b/dist.ps1 new file mode 100644 index 0000000..d75626b --- /dev/null +++ b/dist.ps1 @@ -0,0 +1,8 @@ +# Change to the src/images directory, or exit if the directory doesn't exist +Set-Location -Path ./src/images/ -ErrorAction Stop + +# Add all files to svn, including ignored files and forced additions +svn add . --no-ignore --force + +# Commit the changes with a message +svn ci -m "版本更新" diff --git a/dist.sh b/dist.sh new file mode 100644 index 0000000..1874050 --- /dev/null +++ b/dist.sh @@ -0,0 +1,5 @@ +#!/bin/bash +cd ./src/images/ || exit +svn add . --no-ignore --force +svn ci -m "版本更新" +exit diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..dc39439 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,29 @@ +// eslint.config.mjs +import antfu from '@antfu/eslint-config' +import prettierConfig from 'eslint-config-prettier' + +export default antfu( + { + env: { + es6: true, + }, + stylistic: false, + parserOptions: { project: ['./tsconfig.json'] }, + globals: { + wx: true, + App: true, + Page: true, + getCurrentPages: true, + getApp: true, + Component: true, + requirePlugin: true, + requireMiniProgram: true, + }, + rules: { + 'eslint-comments/no-unlimited-disable': 'off', + 'ts/no-require-imports': 'off', + eqeqeq: 'off', + }, + }, + prettierConfig, +) diff --git a/package.json b/package.json new file mode 100644 index 0000000..53607af --- /dev/null +++ b/package.json @@ -0,0 +1,32 @@ +{ + "name": "nuohe", + "version": "1.0.0", + "description": "", + "author": "", + "license": "", + "keywords": [], + "scripts": { + "beforeCompile": "babel src/pages --out-dir src/pages --only **/*.jsx", + "lint:fix": "eslint . --fix" + }, + "dependencies": { + "@miniprogram-component-plus/video-swiper": "^1.0.1", + "@vant/weapp": "^1.11.2", + "dayjs": "^1.11.10", + "echarts": "^5.4.3", + "miniprogram-licia": "^1.39.2", + "mp-html": "^2.4.2", + "number-precision": "^1.6.0", + "typescript": "^5.3.3" + }, + "devDependencies": { + "@antfu/eslint-config": "^3.2.0", + "@babel/cli": "^7.23.4", + "@babel/core": "^7.23.6", + "@babel/plugin-transform-react-jsx": "^7.23.4", + "eslint": "^9.9.1", + "eslint-config-prettier": "^9.1.0", + "miniprogram-api-typings": "^3.12.2", + "prettier": "^3.3.3" + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..9e7f93a --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,3339 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + '@miniprogram-component-plus/video-swiper': + specifier: ^1.0.1 + version: 1.0.1 + '@vant/weapp': + specifier: ^1.11.2 + version: 1.11.2 + dayjs: + specifier: ^1.11.10 + version: 1.11.10 + echarts: + specifier: ^5.4.3 + version: 5.5.1 + miniprogram-licia: + specifier: ^1.39.2 + version: 1.39.2 + mp-html: + specifier: ^2.4.2 + version: 2.4.2 + number-precision: + specifier: ^1.6.0 + version: 1.6.0 + typescript: + specifier: ^5.3.3 + version: 5.3.3 + devDependencies: + '@antfu/eslint-config': + specifier: ^3.2.0 + version: 3.2.0(@typescript-eslint/utils@8.4.0(eslint@9.9.1)(typescript@5.3.3))(@vue/compiler-sfc@3.5.1)(eslint@9.9.1)(typescript@5.3.3) + '@babel/cli': + specifier: ^7.23.4 + version: 7.23.4(@babel/core@7.23.6) + '@babel/core': + specifier: ^7.23.6 + version: 7.23.6 + '@babel/plugin-transform-react-jsx': + specifier: ^7.23.4 + version: 7.23.4(@babel/core@7.23.6) + eslint: + specifier: ^9.9.1 + version: 9.9.1 + eslint-config-prettier: + specifier: ^9.1.0 + version: 9.1.0(eslint@9.9.1) + miniprogram-api-typings: + specifier: ^3.12.2 + version: 3.12.2 + prettier: + specifier: ^3.3.3 + version: 3.3.3 + +packages: + + '@ampproject/remapping@2.2.1': + resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==} + engines: {node: '>=6.0.0'} + + '@antfu/eslint-config@3.2.0': + resolution: {integrity: sha512-WdMqNAEXaRtBOual7yhkvVdakgeCJTmnqWwg1rVeiWce3lqRfMnhZocrnvQERR4ps23isHklpxvlYWHUEiYeAA==} + hasBin: true + peerDependencies: + '@eslint-react/eslint-plugin': ^1.5.8 + '@prettier/plugin-xml': ^3.4.1 + '@unocss/eslint-plugin': '>=0.50.0' + astro-eslint-parser: ^1.0.2 + eslint: ^9.5.0 + eslint-plugin-astro: ^1.2.0 + eslint-plugin-format: '>=0.1.0' + eslint-plugin-react-hooks: ^4.6.0 + eslint-plugin-react-refresh: ^0.4.4 + eslint-plugin-solid: ^0.14.3 + eslint-plugin-svelte: '>=2.35.1' + prettier-plugin-astro: ^0.13.0 + prettier-plugin-slidev: ^1.0.5 + svelte-eslint-parser: '>=0.37.0' + peerDependenciesMeta: + '@eslint-react/eslint-plugin': + optional: true + '@prettier/plugin-xml': + optional: true + '@unocss/eslint-plugin': + optional: true + astro-eslint-parser: + optional: true + eslint-plugin-astro: + optional: true + eslint-plugin-format: + optional: true + eslint-plugin-react-hooks: + optional: true + eslint-plugin-react-refresh: + optional: true + eslint-plugin-solid: + optional: true + eslint-plugin-svelte: + optional: true + prettier-plugin-astro: + optional: true + prettier-plugin-slidev: + optional: true + svelte-eslint-parser: + optional: true + + '@antfu/install-pkg@0.4.1': + resolution: {integrity: sha512-T7yB5QNG29afhWVkVq7XeIMBa5U/vs9mX69YqayXypPRmYzUmzwnYltplHmPtZ4HPCn+sQKeXW8I47wCbuBOjw==} + + '@antfu/utils@0.7.10': + resolution: {integrity: sha512-+562v9k4aI80m1+VuMHehNJWLOFjBnXn3tdOitzD0il5b7smkSBal4+a3oKiQTbrwMmN/TBUMDvbdoWDehgOww==} + + '@babel/cli@7.23.4': + resolution: {integrity: sha512-j3luA9xGKCXVyCa5R7lJvOMM+Kc2JEnAEIgz2ggtjQ/j5YUVgfsg/WsG95bbsgq7YLHuiCOzMnoSasuY16qiCw==} + engines: {node: '>=6.9.0'} + hasBin: true + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/code-frame@7.23.5': + resolution: {integrity: sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==} + engines: {node: '>=6.9.0'} + + '@babel/compat-data@7.23.5': + resolution: {integrity: sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw==} + engines: {node: '>=6.9.0'} + + '@babel/core@7.23.6': + resolution: {integrity: sha512-FxpRyGjrMJXh7X3wGLGhNDCRiwpWEF74sKjTLDJSG5Kyvow3QZaG0Adbqzi9ZrVjTWpsX+2cxWXD71NMg93kdw==} + engines: {node: '>=6.9.0'} + + '@babel/generator@7.23.6': + resolution: {integrity: sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==} + engines: {node: '>=6.9.0'} + + '@babel/helper-annotate-as-pure@7.22.5': + resolution: {integrity: sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==} + engines: {node: '>=6.9.0'} + + '@babel/helper-compilation-targets@7.23.6': + resolution: {integrity: sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ==} + engines: {node: '>=6.9.0'} + + '@babel/helper-environment-visitor@7.22.20': + resolution: {integrity: sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==} + engines: {node: '>=6.9.0'} + + '@babel/helper-function-name@7.23.0': + resolution: {integrity: sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==} + engines: {node: '>=6.9.0'} + + '@babel/helper-hoist-variables@7.22.5': + resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} + engines: {node: '>=6.9.0'} + + '@babel/helper-module-imports@7.22.15': + resolution: {integrity: sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==} + engines: {node: '>=6.9.0'} + + '@babel/helper-module-transforms@7.23.3': + resolution: {integrity: sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/helper-plugin-utils@7.22.5': + resolution: {integrity: sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==} + engines: {node: '>=6.9.0'} + + '@babel/helper-simple-access@7.22.5': + resolution: {integrity: sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==} + engines: {node: '>=6.9.0'} + + '@babel/helper-split-export-declaration@7.22.6': + resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==} + engines: {node: '>=6.9.0'} + + '@babel/helper-string-parser@7.23.4': + resolution: {integrity: sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==} + engines: {node: '>=6.9.0'} + + '@babel/helper-string-parser@7.24.8': + resolution: {integrity: sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==} + engines: {node: '>=6.9.0'} + + '@babel/helper-validator-identifier@7.22.20': + resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} + engines: {node: '>=6.9.0'} + + '@babel/helper-validator-identifier@7.24.7': + resolution: {integrity: sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==} + engines: {node: '>=6.9.0'} + + '@babel/helper-validator-option@7.23.5': + resolution: {integrity: sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==} + engines: {node: '>=6.9.0'} + + '@babel/helpers@7.23.6': + resolution: {integrity: sha512-wCfsbN4nBidDRhpDhvcKlzHWCTlgJYUUdSJfzXb2NuBssDSIjc3xcb+znA7l+zYsFljAcGM0aFkN40cR3lXiGA==} + engines: {node: '>=6.9.0'} + + '@babel/highlight@7.23.4': + resolution: {integrity: sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==} + engines: {node: '>=6.9.0'} + + '@babel/parser@7.23.6': + resolution: {integrity: sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ==} + engines: {node: '>=6.0.0'} + hasBin: true + + '@babel/parser@7.25.6': + resolution: {integrity: sha512-trGdfBdbD0l1ZPmcJ83eNxB9rbEax4ALFTF7fN386TMYbeCQbyme5cOEXQhbGXKebwGaB/J52w1mrklMcbgy6Q==} + engines: {node: '>=6.0.0'} + hasBin: true + + '@babel/plugin-syntax-jsx@7.23.3': + resolution: {integrity: sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-react-jsx@7.23.4': + resolution: {integrity: sha512-5xOpoPguCZCRbo/JeHlloSkTA8Bld1J/E1/kLfD1nsuiW1m8tduTA1ERCgIZokDflX/IBzKcqR3l7VlRgiIfHA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/template@7.22.15': + resolution: {integrity: sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==} + engines: {node: '>=6.9.0'} + + '@babel/traverse@7.23.6': + resolution: {integrity: sha512-czastdK1e8YByZqezMPFiZ8ahwVMh/ESl9vPgvgdB9AmFMGP5jfpFax74AQgl5zj4XHzqeYAg2l8PuUeRS1MgQ==} + engines: {node: '>=6.9.0'} + + '@babel/types@7.23.4': + resolution: {integrity: sha512-7uIFwVYpoplT5jp/kVv6EF93VaJ8H+Yn5IczYiaAi98ajzjfoZfslet/e0sLh+wVBjb2qqIut1b0S26VSafsSQ==} + engines: {node: '>=6.9.0'} + + '@babel/types@7.23.6': + resolution: {integrity: sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg==} + engines: {node: '>=6.9.0'} + + '@babel/types@7.25.6': + resolution: {integrity: sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==} + engines: {node: '>=6.9.0'} + + '@clack/core@0.3.4': + resolution: {integrity: sha512-H4hxZDXgHtWTwV3RAVenqcC4VbJZNegbBjlPvzOzCouXtS2y3sDvlO3IsbrPNWuLWPPlYVYPghQdSF64683Ldw==} + + '@clack/prompts@0.7.0': + resolution: {integrity: sha512-0MhX9/B4iL6Re04jPrttDm+BsP8y6mS7byuv0BvXgdXhbV5PdlsHt55dvNsuBCPZ7xq1oTAOOuotR9NFbQyMSA==} + bundledDependencies: + - is-unicode-supported + + '@es-joy/jsdoccomment@0.43.1': + resolution: {integrity: sha512-I238eDtOolvCuvtxrnqtlBaw0BwdQuYqK7eA6XIonicMdOOOb75mqdIzkGDUbS04+1Di007rgm9snFRNeVrOog==} + engines: {node: '>=16'} + + '@es-joy/jsdoccomment@0.48.0': + resolution: {integrity: sha512-G6QUWIcC+KvSwXNsJyDTHvqUdNoAVJPPgkc3+Uk4WBKqZvoXhlvazOgm9aL0HwihJLQf0l+tOE2UFzXBqCqgDw==} + engines: {node: '>=16'} + + '@eslint-community/eslint-plugin-eslint-comments@4.4.0': + resolution: {integrity: sha512-yljsWl5Qv3IkIRmJ38h3NrHXFCm4EUl55M8doGTF6hvzvFF8kRpextgSrg2dwHev9lzBZyafCr9RelGIyQm6fw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 + + '@eslint-community/eslint-utils@4.4.0': + resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + + '@eslint-community/regexpp@4.11.0': + resolution: {integrity: sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + + '@eslint/compat@1.1.1': + resolution: {integrity: sha512-lpHyRyplhGPL5mGEh6M9O5nnKk0Gz4bFI+Zu6tKlPpDUN7XshWvH9C/px4UVm87IAANE0W81CEsNGbS1KlzXpA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@eslint/config-array@0.18.0': + resolution: {integrity: sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@eslint/eslintrc@3.1.0': + resolution: {integrity: sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@eslint/js@9.9.1': + resolution: {integrity: sha512-xIDQRsfg5hNBqHz04H1R3scSVwmI+KUbqjsQKHKQ1DAUSaUjYPReZZmS/5PNiKu1fUvzDd6H7DEDKACSEhu+TQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@eslint/object-schema@2.1.4': + resolution: {integrity: sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@humanwhocodes/module-importer@1.0.1': + resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} + engines: {node: '>=12.22'} + + '@humanwhocodes/retry@0.3.0': + resolution: {integrity: sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==} + engines: {node: '>=18.18'} + + '@jridgewell/gen-mapping@0.3.3': + resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==} + engines: {node: '>=6.0.0'} + + '@jridgewell/resolve-uri@3.1.1': + resolution: {integrity: sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==} + engines: {node: '>=6.0.0'} + + '@jridgewell/set-array@1.1.2': + resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==} + engines: {node: '>=6.0.0'} + + '@jridgewell/sourcemap-codec@1.4.15': + resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} + + '@jridgewell/sourcemap-codec@1.5.0': + resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} + + '@jridgewell/trace-mapping@0.3.20': + resolution: {integrity: sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==} + + '@miniprogram-component-plus/video-swiper@1.0.1': + resolution: {integrity: sha512-1rlmsS3/TR0Zu0nZHwEwb9UCQWY/ofPv73zU56FLfZh72Xw+BcIzfohrDxrGs5QpoL4KCLl9G7UB5w+3ZRSZzQ==} + + '@nicolo-ribaudo/chokidar-2@2.1.8-no-fsevents.3': + resolution: {integrity: sha512-s88O1aVtXftvp5bCPB7WnmXc5IwOZZ7YPuwNPt+GtOOXpPvad1LfbmjYv+qII7zP6RU2QGnqve27dnLycEnyEQ==} + + '@nodelib/fs.scandir@2.1.5': + resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} + engines: {node: '>= 8'} + + '@nodelib/fs.stat@2.0.5': + resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} + engines: {node: '>= 8'} + + '@nodelib/fs.walk@1.2.8': + resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} + engines: {node: '>= 8'} + + '@pkgr/core@0.1.1': + resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==} + engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} + + '@stylistic/eslint-plugin@2.7.2': + resolution: {integrity: sha512-3DVLU5HEuk2pQoBmXJlzvrxbKNpu2mJ0SRqz5O/CJjyNCr12ZiPcYMEtuArTyPOk5i7bsAU44nywh1rGfe3gKQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: '>=8.40.0' + + '@types/eslint@8.56.12': + resolution: {integrity: sha512-03ruubjWyOHlmljCVoxSuNDdmfZDzsrrz0P2LeJsOXr+ZwFQ+0yQIwNCwt/GYhV7Z31fgtXJTAEs+FYlEL851g==} + + '@types/eslint@9.6.1': + resolution: {integrity: sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==} + + '@types/estree@1.0.5': + resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} + + '@types/json-schema@7.0.15': + resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} + + '@types/mdast@3.0.15': + resolution: {integrity: sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==} + + '@types/normalize-package-data@2.4.4': + resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} + + '@types/unist@2.0.11': + resolution: {integrity: sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==} + + '@typescript-eslint/eslint-plugin@8.4.0': + resolution: {integrity: sha512-rg8LGdv7ri3oAlenMACk9e+AR4wUV0yrrG+XKsGKOK0EVgeEDqurkXMPILG2836fW4ibokTB5v4b6Z9+GYQDEw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 + eslint: ^8.57.0 || ^9.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@typescript-eslint/parser@8.4.0': + resolution: {integrity: sha512-NHgWmKSgJk5K9N16GIhQ4jSobBoJwrmURaLErad0qlLjrpP5bECYg+wxVTGlGZmJbU03jj/dfnb6V9bw+5icsA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@typescript-eslint/scope-manager@8.4.0': + resolution: {integrity: sha512-n2jFxLeY0JmKfUqy3P70rs6vdoPjHK8P/w+zJcV3fk0b0BwRXC/zxRTEnAsgYT7MwdQDt/ZEbtdzdVC+hcpF0A==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@typescript-eslint/type-utils@8.4.0': + resolution: {integrity: sha512-pu2PAmNrl9KX6TtirVOrbLPLwDmASpZhK/XU7WvoKoCUkdtq9zF7qQ7gna0GBZFN0hci0vHaSusiL2WpsQk37A==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@typescript-eslint/types@7.18.0': + resolution: {integrity: sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==} + engines: {node: ^18.18.0 || >=20.0.0} + + '@typescript-eslint/types@8.4.0': + resolution: {integrity: sha512-T1RB3KQdskh9t3v/qv7niK6P8yvn7ja1mS7QK7XfRVL6wtZ8/mFs/FHf4fKvTA0rKnqnYxl/uHFNbnEt0phgbw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@typescript-eslint/typescript-estree@8.4.0': + resolution: {integrity: sha512-kJ2OIP4dQw5gdI4uXsaxUZHRwWAGpREJ9Zq6D5L0BweyOrWsL6Sz0YcAZGWhvKnH7fm1J5YFE1JrQL0c9dd53A==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@typescript-eslint/utils@8.4.0': + resolution: {integrity: sha512-swULW8n1IKLjRAgciCkTCafyTHHfwVQFt8DovmaF69sKbOxTSFMmIZaSHjqO9i/RV0wIblaawhzvtva8Nmm7lQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + + '@typescript-eslint/visitor-keys@8.4.0': + resolution: {integrity: sha512-zTQD6WLNTre1hj5wp09nBIDiOc2U5r/qmzo7wxPn4ZgAjHql09EofqhF9WF+fZHzL5aCyaIpPcT2hyxl73kr9A==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@vant/weapp@1.11.2': + resolution: {integrity: sha512-NlZQEW4ijxD1GAmTY0dz2mEw0KWff9DSi5k5WGl1YS19qGp1l3BssID/uBnzrC82HjWH/Sb5V9+r7/YEcfnBPQ==} + + '@vitest/eslint-plugin@1.1.0': + resolution: {integrity: sha512-Ur80Y27Wbw8gFHJ3cv6vypcjXmrx6QHfw+q435h6Q2L+tf+h4Xf5pJTCL4YU/Jps9EVeggQxS85OcUZU7sdXRw==} + peerDependencies: + '@typescript-eslint/utils': '>= 8.0' + eslint: '>= 8.57.0' + typescript: '>= 5.0.0' + vitest: '*' + peerDependenciesMeta: + '@typescript-eslint/utils': + optional: true + typescript: + optional: true + vitest: + optional: true + + '@vue/compiler-core@3.5.1': + resolution: {integrity: sha512-WdjF+NSgFYdWttHevHw5uaJFtKPalhmxhlu2uREj8cLP0uyKKIR60/JvSZNTp0x+NSd63iTiORQTx3+tt55NWQ==} + + '@vue/compiler-dom@3.5.1': + resolution: {integrity: sha512-Ao23fB1lINo18HLCbJVApvzd9OQe8MgmQSgyY5+umbWj2w92w9KykVmJ4Iv2US5nak3ixc2B+7Km7JTNhQ8kSQ==} + + '@vue/compiler-sfc@3.5.1': + resolution: {integrity: sha512-DFizMNH8eDglLhlfwJ0+ciBsztaYe3fY/zcZjrqL1ljXvUw/UpC84M1d7HpBTCW68SNqZyIxrs1XWmf+73Y65w==} + + '@vue/compiler-ssr@3.5.1': + resolution: {integrity: sha512-C1hpSHQgRM8bg+5XWWD7CkFaVpSn9wZHCLRd10AmxqrH17d4EMP6+XcZpwBOM7H1jeStU5naEapZZWX0kso1tQ==} + + '@vue/shared@3.5.1': + resolution: {integrity: sha512-NdcTRoO4KuW2RSFgpE2c+E/R/ZHaRzWPxAGxhmxZaaqLh6nYCXx7lc9a88ioqOCxCaV2SFJmujkxbUScW7dNsQ==} + + acorn-jsx@5.3.2: + resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} + peerDependencies: + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + + acorn@8.12.1: + resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} + engines: {node: '>=0.4.0'} + hasBin: true + + ajv@6.12.6: + resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} + + ansi-regex@5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + + ansi-styles@3.2.1: + resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} + engines: {node: '>=4'} + + ansi-styles@4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + + anymatch@3.1.3: + resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} + engines: {node: '>= 8'} + + are-docs-informative@0.0.2: + resolution: {integrity: sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==} + engines: {node: '>=14'} + + argparse@2.0.1: + resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} + + balanced-match@1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + + binary-extensions@2.2.0: + resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} + engines: {node: '>=8'} + + boolbase@1.0.0: + resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} + + brace-expansion@1.1.11: + resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + + brace-expansion@2.0.1: + resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} + + braces@3.0.2: + resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} + engines: {node: '>=8'} + + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + + browserslist@4.22.2: + resolution: {integrity: sha512-0UgcrvQmBDvZHFGdYUehrCNIazki7/lUP3kkoi/r3YB2amZbFM9J43ZRkJTXBUZK4gmx56+Sqk9+Vs9mwZx9+A==} + engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} + hasBin: true + + browserslist@4.23.3: + resolution: {integrity: sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA==} + engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} + hasBin: true + + builtin-modules@3.3.0: + resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} + engines: {node: '>=6'} + + callsites@3.1.0: + resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} + engines: {node: '>=6'} + + caniuse-lite@1.0.30001565: + resolution: {integrity: sha512-xrE//a3O7TP0vaJ8ikzkD2c2NgcVUvsEe2IvFTntV4Yd1Z9FVzh+gW+enX96L0psrbaFMcVcH2l90xNuGDWc8w==} + + caniuse-lite@1.0.30001657: + resolution: {integrity: sha512-DPbJAlP8/BAXy3IgiWmZKItubb3TYGP0WscQQlVGIfT4s/YlFYVuJgyOsQNP7rJRChx/qdMeLJQJP0Sgg2yjNA==} + + chalk@2.4.2: + resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} + engines: {node: '>=4'} + + chalk@4.1.2: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} + engines: {node: '>=10'} + + character-entities-legacy@1.1.4: + resolution: {integrity: sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==} + + character-entities@1.2.4: + resolution: {integrity: sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==} + + character-reference-invalid@1.1.4: + resolution: {integrity: sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==} + + chokidar@3.5.3: + resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} + engines: {node: '>= 8.10.0'} + + ci-info@4.0.0: + resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} + engines: {node: '>=8'} + + clean-regexp@1.0.0: + resolution: {integrity: sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==} + engines: {node: '>=4'} + + cliui@8.0.1: + resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} + engines: {node: '>=12'} + + color-convert@1.9.3: + resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} + + color-convert@2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + + color-name@1.1.3: + resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} + + color-name@1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + + commander@4.1.1: + resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} + engines: {node: '>= 6'} + + comment-parser@1.4.1: + resolution: {integrity: sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==} + engines: {node: '>= 12.0.0'} + + concat-map@0.0.1: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + + confbox@0.1.7: + resolution: {integrity: sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==} + + convert-source-map@2.0.0: + resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + + core-js-compat@3.38.1: + resolution: {integrity: sha512-JRH6gfXxGmrzF3tZ57lFx97YARxCXPaMzPo6jELZhv88pBH5VXpQ+y0znKGlFnzuaihqhLbefxSJxWJMPtfDzw==} + + cross-spawn@7.0.3: + resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + engines: {node: '>= 8'} + + cssesc@3.0.0: + resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==} + engines: {node: '>=4'} + hasBin: true + + dayjs@1.11.10: + resolution: {integrity: sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==} + + debug@3.2.7: + resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + debug@4.3.4: + resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + debug@4.3.6: + resolution: {integrity: sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + deep-is@0.1.4: + resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} + + doctrine@3.0.0: + resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} + engines: {node: '>=6.0.0'} + + echarts@5.5.1: + resolution: {integrity: sha512-Fce8upazaAXUVUVsjgV6mBnGuqgO+JNDlcgF79Dksy4+wgGpQB2lmYoO4TSweFg/mZITdpGHomw/cNBJZj1icA==} + + electron-to-chromium@1.4.616: + resolution: {integrity: sha512-1n7zWYh8eS0L9Uy+GskE0lkBUNK83cXTVJI0pU3mGprFsbfSdAc15VTFbo+A+Bq4pwstmL30AVcEU3Fo463lNg==} + + electron-to-chromium@1.5.14: + resolution: {integrity: sha512-bEfPECb3fJ15eaDnu9LEJ2vPGD6W1vt7vZleSVyFhYuMIKm3vz/g9lt7IvEzgdwj58RjbPKUF2rXTCN/UW47tQ==} + + emoji-regex@8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + + enhanced-resolve@5.17.1: + resolution: {integrity: sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==} + engines: {node: '>=10.13.0'} + + entities@4.5.0: + resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} + engines: {node: '>=0.12'} + + error-ex@1.3.2: + resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} + + es-module-lexer@1.5.4: + resolution: {integrity: sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==} + + escalade@3.1.1: + resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} + engines: {node: '>=6'} + + escalade@3.2.0: + resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} + engines: {node: '>=6'} + + escape-string-regexp@1.0.5: + resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} + engines: {node: '>=0.8.0'} + + escape-string-regexp@4.0.0: + resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} + engines: {node: '>=10'} + + eslint-compat-utils@0.5.1: + resolution: {integrity: sha512-3z3vFexKIEnjHE3zCMRo6fn/e44U7T1khUjg+Hp0ZQMCigh28rALD0nPFBcGZuiLC5rLZa2ubQHDRln09JfU2Q==} + engines: {node: '>=12'} + peerDependencies: + eslint: '>=6.0.0' + + eslint-config-flat-gitignore@0.3.0: + resolution: {integrity: sha512-0Ndxo4qGhcewjTzw52TK06Mc00aDtHNTdeeW2JfONgDcLkRO/n/BteMRzNVpLQYxdCC/dFEilfM9fjjpGIJ9Og==} + peerDependencies: + eslint: ^9.5.0 + + eslint-config-prettier@9.1.0: + resolution: {integrity: sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==} + hasBin: true + peerDependencies: + eslint: '>=7.0.0' + + eslint-flat-config-utils@0.3.1: + resolution: {integrity: sha512-eFT3EaoJN1hlN97xw4FIEX//h0TiFUobgl2l5uLkIwhVN9ahGq95Pbs+i1/B5UACA78LO3rco3JzuvxLdTUOPA==} + + eslint-import-resolver-node@0.3.9: + resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} + + eslint-merge-processors@0.1.0: + resolution: {integrity: sha512-IvRXXtEajLeyssvW4wJcZ2etxkR9mUf4zpNwgI+m/Uac9RfXHskuJefkHUcawVzePnd6xp24enp5jfgdHzjRdQ==} + peerDependencies: + eslint: '*' + + eslint-plugin-antfu@2.4.1: + resolution: {integrity: sha512-VfS8kCz4iif43/Ahrnb6XHi4L5evyZEX3URFQJwj55KPBvmhRv4TgBHm7fsfQewJltFFkDRVIC6Vkg5QbS0ZnA==} + peerDependencies: + eslint: '*' + + eslint-plugin-command@0.2.3: + resolution: {integrity: sha512-1bBYNfjZg60N2ZpLV5ATYSYyueIJ+zl5yKrTs0UFDdnyu07dNSZ7Xplnc+Wb6SXTdc1sIaoIrnuyhvztcltX6A==} + peerDependencies: + eslint: '*' + + eslint-plugin-es-x@7.8.0: + resolution: {integrity: sha512-7Ds8+wAAoV3T+LAKeu39Y5BzXCrGKrcISfgKEqTS4BDN8SFEDQd0S43jiQ8vIa3wUKD07qitZdfzlenSi8/0qQ==} + engines: {node: ^14.18.0 || >=16.0.0} + peerDependencies: + eslint: '>=8' + + eslint-plugin-import-x@4.2.1: + resolution: {integrity: sha512-WWi2GedccIJa0zXxx3WDnTgouGQTtdYK1nhXMwywbqqAgB0Ov+p1pYBsWh3VaB0bvBOwLse6OfVII7jZD9xo5Q==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + + eslint-plugin-jsdoc@50.2.2: + resolution: {integrity: sha512-i0ZMWA199DG7sjxlzXn5AeYZxpRfMJjDPUl7lL9eJJX8TPRoIaxJU4ys/joP5faM5AXE1eqW/dslCj3uj4Nqpg==} + engines: {node: '>=18'} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 + + eslint-plugin-jsonc@2.16.0: + resolution: {integrity: sha512-Af/ZL5mgfb8FFNleH6KlO4/VdmDuTqmM+SPnWcdoWywTetv7kq+vQe99UyQb9XO3b0OWLVuTH7H0d/PXYCMdSg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: '>=6.0.0' + + eslint-plugin-markdown@5.1.0: + resolution: {integrity: sha512-SJeyKko1K6GwI0AN6xeCDToXDkfKZfXcexA6B+O2Wr2btUS9GrC+YgwSyVli5DJnctUHjFXcQ2cqTaAmVoLi2A==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: '>=8' + + eslint-plugin-n@17.10.2: + resolution: {integrity: sha512-e+s4eAf5NtJaxPhTNu3qMO0Iz40WANS93w9LQgYcvuljgvDmWi/a3rh+OrNyMHeng6aOWGJO0rCg5lH4zi8yTw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: '>=8.23.0' + + eslint-plugin-no-only-tests@3.3.0: + resolution: {integrity: sha512-brcKcxGnISN2CcVhXJ/kEQlNa0MEfGRtwKtWA16SkqXHKitaKIMrfemJKLKX1YqDU5C/5JY3PvZXd5jEW04e0Q==} + engines: {node: '>=5.0.0'} + + eslint-plugin-perfectionist@3.4.0: + resolution: {integrity: sha512-vXyd1sFg3H/7aKgBUie62bA6E0EN3Dh0LCD5r4vR/IYtTljxOnyckI1AV0Arw4eYjC/W9T1X04Pl2mdLsdWtMA==} + engines: {node: ^18.0.0 || >=20.0.0} + peerDependencies: + astro-eslint-parser: ^1.0.2 + eslint: '>=8.0.0' + svelte: '>=3.0.0' + svelte-eslint-parser: ^0.41.0 + vue-eslint-parser: '>=9.0.0' + peerDependenciesMeta: + astro-eslint-parser: + optional: true + svelte: + optional: true + svelte-eslint-parser: + optional: true + vue-eslint-parser: + optional: true + + eslint-plugin-regexp@2.6.0: + resolution: {integrity: sha512-FCL851+kislsTEQEMioAlpDuK5+E5vs0hi1bF8cFlPlHcEjeRhuAzEsGikXRreE+0j4WhW2uO54MqTjXtYOi3A==} + engines: {node: ^18 || >=20} + peerDependencies: + eslint: '>=8.44.0' + + eslint-plugin-toml@0.11.1: + resolution: {integrity: sha512-Y1WuMSzfZpeMIrmlP1nUh3kT8p96mThIq4NnHrYUhg10IKQgGfBZjAWnrg9fBqguiX4iFps/x/3Hb5TxBisfdw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: '>=6.0.0' + + eslint-plugin-unicorn@55.0.0: + resolution: {integrity: sha512-n3AKiVpY2/uDcGrS3+QsYDkjPfaOrNrsfQxU9nt5nitd9KuvVXrfAvgCO9DYPSfap+Gqjw9EOrXIsBp5tlHZjA==} + engines: {node: '>=18.18'} + peerDependencies: + eslint: '>=8.56.0' + + eslint-plugin-unused-imports@4.1.3: + resolution: {integrity: sha512-lqrNZIZjFMUr7P06eoKtQLwyVRibvG7N+LtfKtObYGizAAGrcqLkc3tDx+iAik2z7q0j/XI3ihjupIqxhFabFA==} + peerDependencies: + '@typescript-eslint/eslint-plugin': ^8.0.0-0 || ^7.0.0 || ^6.0.0 || ^5.0.0 + eslint: ^9.0.0 || ^8.0.0 + peerDependenciesMeta: + '@typescript-eslint/eslint-plugin': + optional: true + + eslint-plugin-vue@9.28.0: + resolution: {integrity: sha512-ShrihdjIhOTxs+MfWun6oJWuk+g/LAhN+CiuOl/jjkG3l0F2AuK5NMTaWqyvBgkFtpYmyks6P4603mLmhNJW8g==} + engines: {node: ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.2.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 + + eslint-plugin-yml@1.14.0: + resolution: {integrity: sha512-ESUpgYPOcAYQO9czugcX5OqRvn/ydDVwGCPXY4YjPqc09rHaUVUA6IE6HLQys4rXk/S+qx3EwTd1wHCwam/OWQ==} + engines: {node: ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: '>=6.0.0' + + eslint-processor-vue-blocks@0.1.2: + resolution: {integrity: sha512-PfpJ4uKHnqeL/fXUnzYkOax3aIenlwewXRX8jFinA1a2yCFnLgMuiH3xvCgvHHUlV2xJWQHbCTdiJWGwb3NqpQ==} + peerDependencies: + '@vue/compiler-sfc': ^3.3.0 + eslint: ^8.50.0 || ^9.0.0 + + eslint-scope@7.2.2: + resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + eslint-scope@8.0.2: + resolution: {integrity: sha512-6E4xmrTw5wtxnLA5wYL3WDfhZ/1bUBGOXV0zQvVRDOtrR8D0p6W7fs3JweNYhwRYeGvd/1CKX2se0/2s7Q/nJA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + eslint-visitor-keys@3.4.3: + resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + eslint-visitor-keys@4.0.0: + resolution: {integrity: sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + eslint@9.9.1: + resolution: {integrity: sha512-dHvhrbfr4xFQ9/dq+jcVneZMyRYLjggWjk6RVsIiHsP8Rz6yZ8LvZ//iU4TrZF+SXWG+JkNF2OyiZRvzgRDqMg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + hasBin: true + peerDependencies: + jiti: '*' + peerDependenciesMeta: + jiti: + optional: true + + espree@10.1.0: + resolution: {integrity: sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + espree@9.6.1: + resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + esquery@1.6.0: + resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==} + engines: {node: '>=0.10'} + + esrecurse@4.3.0: + resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} + engines: {node: '>=4.0'} + + estraverse@5.3.0: + resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} + engines: {node: '>=4.0'} + + estree-walker@2.0.2: + resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} + + esutils@2.0.3: + resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} + engines: {node: '>=0.10.0'} + + fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + fast-glob@3.3.2: + resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} + engines: {node: '>=8.6.0'} + + fast-json-stable-stringify@2.1.0: + resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + + fast-levenshtein@2.0.6: + resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + + fastq@1.17.1: + resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} + + file-entry-cache@8.0.0: + resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} + engines: {node: '>=16.0.0'} + + fill-range@7.0.1: + resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} + engines: {node: '>=8'} + + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + + find-up-simple@1.0.0: + resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} + engines: {node: '>=18'} + + find-up@4.1.0: + resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} + engines: {node: '>=8'} + + find-up@5.0.0: + resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} + engines: {node: '>=10'} + + flat-cache@4.0.1: + resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} + engines: {node: '>=16'} + + flatted@3.3.1: + resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} + + fs-readdir-recursive@1.1.0: + resolution: {integrity: sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==} + + fs.realpath@1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + + gensync@1.0.0-beta.2: + resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} + engines: {node: '>=6.9.0'} + + get-caller-file@2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + + get-tsconfig@4.8.0: + resolution: {integrity: sha512-Pgba6TExTZ0FJAn1qkJAjIeKoDJ3CsI2ChuLohJnZl/tTU8MVrq3b+2t5UOPfRa4RMsorClBjJALkJUMjG1PAw==} + + glob-parent@5.1.2: + resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} + engines: {node: '>= 6'} + + glob-parent@6.0.2: + resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} + engines: {node: '>=10.13.0'} + + glob@7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + + globals@11.12.0: + resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} + engines: {node: '>=4'} + + globals@13.24.0: + resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} + engines: {node: '>=8'} + + globals@14.0.0: + resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} + engines: {node: '>=18'} + + globals@15.9.0: + resolution: {integrity: sha512-SmSKyLLKFbSr6rptvP8izbyxJL4ILwqO9Jg23UA0sDlGlu58V59D1//I3vlc0KJphVdUR7vMjHIplYnzBxorQA==} + engines: {node: '>=18'} + + graceful-fs@4.2.11: + resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} + + graphemer@1.4.0: + resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} + + has-flag@3.0.0: + resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} + engines: {node: '>=4'} + + has-flag@4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + + hasown@2.0.2: + resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} + engines: {node: '>= 0.4'} + + hosted-git-info@2.8.9: + resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} + + ignore@5.3.2: + resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} + engines: {node: '>= 4'} + + import-fresh@3.3.0: + resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} + engines: {node: '>=6'} + + imurmurhash@0.1.4: + resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} + engines: {node: '>=0.8.19'} + + indent-string@4.0.0: + resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} + engines: {node: '>=8'} + + inflight@1.0.6: + resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + + inherits@2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + + is-alphabetical@1.0.4: + resolution: {integrity: sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==} + + is-alphanumerical@1.0.4: + resolution: {integrity: sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A==} + + is-arrayish@0.2.1: + resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} + + is-binary-path@2.1.0: + resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} + engines: {node: '>=8'} + + is-builtin-module@3.2.1: + resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==} + engines: {node: '>=6'} + + is-core-module@2.15.1: + resolution: {integrity: sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==} + engines: {node: '>= 0.4'} + + is-decimal@1.0.4: + resolution: {integrity: sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==} + + is-extglob@2.1.1: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} + engines: {node: '>=0.10.0'} + + is-fullwidth-code-point@3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + + is-glob@4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + + is-hexadecimal@1.0.4: + resolution: {integrity: sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==} + + is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + + is-path-inside@3.0.3: + resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} + engines: {node: '>=8'} + + isexe@2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + + js-tokens@4.0.0: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + + js-yaml@4.1.0: + resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} + hasBin: true + + jsdoc-type-pratt-parser@4.0.0: + resolution: {integrity: sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==} + engines: {node: '>=12.0.0'} + + jsdoc-type-pratt-parser@4.1.0: + resolution: {integrity: sha512-Hicd6JK5Njt2QB6XYFS7ok9e37O8AYk3jTcppG4YVQnYjOemymvTcmc7OWsmq/Qqj5TdRFO5/x/tIPmBeRtGHg==} + engines: {node: '>=12.0.0'} + + jsesc@0.5.0: + resolution: {integrity: sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==} + hasBin: true + + jsesc@2.5.2: + resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} + engines: {node: '>=4'} + hasBin: true + + jsesc@3.0.2: + resolution: {integrity: sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==} + engines: {node: '>=6'} + hasBin: true + + json-buffer@3.0.1: + resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} + + json-parse-even-better-errors@2.3.1: + resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} + + json-schema-traverse@0.4.1: + resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} + + json-stable-stringify-without-jsonify@1.0.1: + resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + + json5@2.2.3: + resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} + engines: {node: '>=6'} + hasBin: true + + jsonc-eslint-parser@2.4.0: + resolution: {integrity: sha512-WYDyuc/uFcGp6YtM2H0uKmUwieOuzeE/5YocFJLnLfclZ4inf3mRn8ZVy1s7Hxji7Jxm6Ss8gqpexD/GlKoGgg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + keyv@4.5.4: + resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} + + levn@0.4.1: + resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} + engines: {node: '>= 0.8.0'} + + lines-and-columns@1.2.4: + resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + + local-pkg@0.5.0: + resolution: {integrity: sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==} + engines: {node: '>=14'} + + locate-path@5.0.0: + resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} + engines: {node: '>=8'} + + locate-path@6.0.0: + resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} + engines: {node: '>=10'} + + lodash.merge@4.6.2: + resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} + + lodash@4.17.21: + resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + + lru-cache@5.1.1: + resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} + + magic-string@0.30.11: + resolution: {integrity: sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==} + + make-dir@2.1.0: + resolution: {integrity: sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==} + engines: {node: '>=6'} + + mdast-util-from-markdown@0.8.5: + resolution: {integrity: sha512-2hkTXtYYnr+NubD/g6KGBS/0mFmBcifAsI0yIWRiRo0PjVs6SSOSOdtzbp6kSGnShDN6G5aWZpKQ2lWRy27mWQ==} + + mdast-util-to-string@2.0.0: + resolution: {integrity: sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w==} + + merge2@1.4.1: + resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} + engines: {node: '>= 8'} + + micromark@2.11.4: + resolution: {integrity: sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==} + + micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + engines: {node: '>=8.6'} + + min-indent@1.0.1: + resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} + engines: {node: '>=4'} + + minimatch@3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + + minimatch@9.0.5: + resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} + engines: {node: '>=16 || 14 >=14.17'} + + miniprogram-api-typings@3.12.2: + resolution: {integrity: sha512-OJB2uVAfhycX4teG/zEVpoThushQqLOx946XACDpVc6OQydiJWjn7djVzvNCbv0VOA7sbHGPQp/RkXD9vMCDEw==} + + miniprogram-licia@1.39.2: + resolution: {integrity: sha512-ACzl0QWTkLZ1yUnkC/NeLOy75XJlemO62/H6uaTwig+Io5TvNa94BOWyu6ofnpZPA5pTc02vaSnPnDmmaX4Vyw==} + + mlly@1.7.1: + resolution: {integrity: sha512-rrVRZRELyQzrIUAVMHxP97kv+G786pHmOKzuFII8zDYahFBS7qnHh2AlYSl1GAHhaMPCz6/oHjVMcfFYgFYHgA==} + + mp-html@2.4.2: + resolution: {integrity: sha512-MSfJh5ckuaI2uibeO4qiUl2e/j5fpXy6cmW/ZzSkb+U3rTJfMSNzODqrDwG0YWOd8BVI+tD9/jLZiBhJbMupUg==} + + ms@2.1.2: + resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} + + nanoid@3.3.7: + resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + + natural-compare-lite@1.4.0: + resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} + + natural-compare@1.4.0: + resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + + node-releases@2.0.14: + resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==} + + node-releases@2.0.18: + resolution: {integrity: sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==} + + normalize-package-data@2.5.0: + resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} + + normalize-path@3.0.0: + resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} + engines: {node: '>=0.10.0'} + + nth-check@2.1.1: + resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} + + number-precision@1.6.0: + resolution: {integrity: sha512-05OLPgbgmnixJw+VvEh18yNPUo3iyp4BEWJcrLu4X9W05KmMifN7Mu5exYvQXqxxeNWhvIF+j3Rij+HmddM/hQ==} + + once@1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + + optionator@0.9.4: + resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} + engines: {node: '>= 0.8.0'} + + p-limit@2.3.0: + resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} + engines: {node: '>=6'} + + p-limit@3.1.0: + resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} + engines: {node: '>=10'} + + p-locate@4.1.0: + resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} + engines: {node: '>=8'} + + p-locate@5.0.0: + resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} + engines: {node: '>=10'} + + p-try@2.2.0: + resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} + engines: {node: '>=6'} + + package-manager-detector@0.2.0: + resolution: {integrity: sha512-E385OSk9qDcXhcM9LNSe4sdhx8a9mAPrZ4sMLW+tmxl5ZuGtPUcdFu+MPP2jbgiWAZ6Pfe5soGFMd+0Db5Vrog==} + + parent-module@1.0.1: + resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} + engines: {node: '>=6'} + + parse-entities@2.0.0: + resolution: {integrity: sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ==} + + parse-gitignore@2.0.0: + resolution: {integrity: sha512-RmVuCHWsfu0QPNW+mraxh/xjQVw/lhUCUru8Zni3Ctq3AoMhpDTq0OVdKS6iesd6Kqb7viCV3isAL43dciOSog==} + engines: {node: '>=14'} + + parse-imports@2.1.1: + resolution: {integrity: sha512-TDT4HqzUiTMO1wJRwg/t/hYk8Wdp3iF/ToMIlAoVQfL1Xs/sTxq1dKWSMjMbQmIarfWKymOyly40+zmPHXMqCA==} + engines: {node: '>= 18'} + + parse-json@5.2.0: + resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} + engines: {node: '>=8'} + + path-exists@4.0.0: + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} + engines: {node: '>=8'} + + path-is-absolute@1.0.1: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + engines: {node: '>=0.10.0'} + + path-key@3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + + path-parse@1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + + pathe@1.1.2: + resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} + + picocolors@1.0.0: + resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} + + picocolors@1.1.0: + resolution: {integrity: sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==} + + picomatch@2.3.1: + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + engines: {node: '>=8.6'} + + picomatch@4.0.2: + resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==} + engines: {node: '>=12'} + + pify@4.0.1: + resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==} + engines: {node: '>=6'} + + pkg-types@1.2.0: + resolution: {integrity: sha512-+ifYuSSqOQ8CqP4MbZA5hDpb97n3E8SVWdJe+Wms9kj745lmd3b7EZJiqvmLwAlmRfjrI7Hi5z3kdBJ93lFNPA==} + + pluralize@8.0.0: + resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} + engines: {node: '>=4'} + + postcss-selector-parser@6.1.2: + resolution: {integrity: sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==} + engines: {node: '>=4'} + + postcss@8.4.45: + resolution: {integrity: sha512-7KTLTdzdZZYscUc65XmjFiB73vBhBfbPztCYdUNvlaso9PrzjzcmjqBPR0lNGkcVlcO4BjiO5rK/qNz+XAen1Q==} + engines: {node: ^10 || ^12 || >=14} + + prelude-ls@1.2.1: + resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} + engines: {node: '>= 0.8.0'} + + prettier@3.3.3: + resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} + engines: {node: '>=14'} + hasBin: true + + punycode@2.3.1: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} + engines: {node: '>=6'} + + queue-microtask@1.2.3: + resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + + read-pkg-up@7.0.1: + resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==} + engines: {node: '>=8'} + + read-pkg@5.2.0: + resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==} + engines: {node: '>=8'} + + readdirp@3.6.0: + resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} + engines: {node: '>=8.10.0'} + + refa@0.12.1: + resolution: {integrity: sha512-J8rn6v4DBb2nnFqkqwy6/NnTYMcgLA+sLr0iIO41qpv0n+ngb7ksag2tMRl0inb1bbO/esUwzW1vbJi7K0sI0g==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + + regexp-ast-analysis@0.7.1: + resolution: {integrity: sha512-sZuz1dYW/ZsfG17WSAG7eS85r5a0dDsvg+7BiiYR5o6lKCAtUrEwdmRmaGF6rwVj3LcmAeYkOWKEPlbPzN3Y3A==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + + regexp-tree@0.1.27: + resolution: {integrity: sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==} + hasBin: true + + regjsparser@0.10.0: + resolution: {integrity: sha512-qx+xQGZVsy55CH0a1hiVwHmqjLryfh7wQyF5HO07XJ9f7dQMY/gPQHhlyDkIzJKC+x2fUCpCcUODUUUFrm7SHA==} + hasBin: true + + require-directory@2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + + resolve-from@4.0.0: + resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} + engines: {node: '>=4'} + + resolve-pkg-maps@1.0.0: + resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + + resolve@1.22.8: + resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} + hasBin: true + + reusify@1.0.4: + resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} + engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + + run-parallel@1.2.0: + resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + + scslre@0.3.0: + resolution: {integrity: sha512-3A6sD0WYP7+QrjbfNA2FN3FsOaGGFoekCVgTyypy53gPxhbkCIjtO6YWgdrfM+n/8sI8JeXZOIxsHjMTNxQ4nQ==} + engines: {node: ^14.0.0 || >=16.0.0} + + semver@5.7.2: + resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} + hasBin: true + + semver@6.3.1: + resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} + hasBin: true + + semver@7.6.3: + resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==} + engines: {node: '>=10'} + hasBin: true + + shebang-command@2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + + shebang-regex@3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + + sisteransi@1.0.5: + resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} + + slash@2.0.0: + resolution: {integrity: sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==} + engines: {node: '>=6'} + + slashes@3.0.12: + resolution: {integrity: sha512-Q9VME8WyGkc7pJf6QEkj3wE+2CnvZMI+XJhwdTPR8Z/kWQRXi7boAWLDibRPyHRTUTPx5FaU7MsyrjI3yLB4HA==} + + source-map-js@1.2.0: + resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} + engines: {node: '>=0.10.0'} + + spdx-correct@3.2.0: + resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} + + spdx-exceptions@2.5.0: + resolution: {integrity: sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==} + + spdx-expression-parse@3.0.1: + resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} + + spdx-expression-parse@4.0.0: + resolution: {integrity: sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==} + + spdx-license-ids@3.0.20: + resolution: {integrity: sha512-jg25NiDV/1fLtSgEgyvVyDunvaNHbuwF9lfNV17gSmPFAlYzdfNBlLtLzXTevwkPj7DhGbmN9VnmJIgLnhvaBw==} + + stable-hash@0.0.4: + resolution: {integrity: sha512-LjdcbuBeLcdETCrPn9i8AYAZ1eCtu4ECAWtP7UleOiZ9LzVxRzzUZEoZ8zB24nhkQnDWyET0I+3sWokSDS3E7g==} + + string-width@4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + + strip-ansi@6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + + strip-indent@3.0.0: + resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} + engines: {node: '>=8'} + + strip-json-comments@3.1.1: + resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} + engines: {node: '>=8'} + + supports-color@5.5.0: + resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} + engines: {node: '>=4'} + + supports-color@7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + + supports-preserve-symlinks-flag@1.0.0: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + + synckit@0.6.2: + resolution: {integrity: sha512-Vhf+bUa//YSTYKseDiiEuQmhGCoIF3CVBhunm3r/DQnYiGT4JssmnKQc44BIyOZRK2pKjXXAgbhfmbeoC9CJpA==} + engines: {node: '>=12.20'} + + synckit@0.9.1: + resolution: {integrity: sha512-7gr8p9TQP6RAHusBOSLs46F4564ZrjV8xFmw5zCmgmhGUcw2hxsShhJ6CEiHQMgPDwAQ1fWHPM0ypc4RMAig4A==} + engines: {node: ^14.18.0 || >=16.0.0} + + tapable@2.2.1: + resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==} + engines: {node: '>=6'} + + text-table@0.2.0: + resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} + + tinyexec@0.3.0: + resolution: {integrity: sha512-tVGE0mVJPGb0chKhqmsoosjsS+qUnJVGJpZgsHYQcGoPlG3B51R3PouqTgEGH2Dc9jjFyOqOpix6ZHNMXp1FZg==} + + to-fast-properties@2.0.0: + resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} + engines: {node: '>=4'} + + to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + + toml-eslint-parser@0.10.0: + resolution: {integrity: sha512-khrZo4buq4qVmsGzS5yQjKe/WsFvV8fGfOjDQN0q4iy9FjRfPWRgTFrU8u1R2iu/SfWLhY9WnCi4Jhdrcbtg+g==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + ts-api-utils@1.3.0: + resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} + engines: {node: '>=16'} + peerDependencies: + typescript: '>=4.2.0' + + tslib@2.3.0: + resolution: {integrity: sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==} + + tslib@2.7.0: + resolution: {integrity: sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==} + + type-check@0.4.0: + resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} + engines: {node: '>= 0.8.0'} + + type-fest@0.20.2: + resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} + engines: {node: '>=10'} + + type-fest@0.6.0: + resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==} + engines: {node: '>=8'} + + type-fest@0.8.1: + resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==} + engines: {node: '>=8'} + + typescript@5.3.3: + resolution: {integrity: sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==} + engines: {node: '>=14.17'} + hasBin: true + + ufo@1.5.4: + resolution: {integrity: sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==} + + unist-util-stringify-position@2.0.3: + resolution: {integrity: sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==} + + update-browserslist-db@1.0.13: + resolution: {integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==} + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + + update-browserslist-db@1.1.0: + resolution: {integrity: sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==} + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + + uri-js@4.4.1: + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + + util-deprecate@1.0.2: + resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + + validate-npm-package-license@3.0.4: + resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} + + vue-eslint-parser@9.4.3: + resolution: {integrity: sha512-2rYRLWlIpaiN8xbPiDyXZXRgLGOtWxERV7ND5fFAv5qo1D2N9Fu9MNajBNc6o13lZ+24DAWCkQCvj4klgmcITg==} + engines: {node: ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: '>=6.0.0' + + which@2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + + word-wrap@1.2.5: + resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} + engines: {node: '>=0.10.0'} + + wrap-ansi@7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} + + wrappy@1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + + xml-name-validator@4.0.0: + resolution: {integrity: sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==} + engines: {node: '>=12'} + + y18n@5.0.8: + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} + engines: {node: '>=10'} + + yallist@3.1.1: + resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + + yaml-eslint-parser@1.2.3: + resolution: {integrity: sha512-4wZWvE398hCP7O8n3nXKu/vdq1HcH01ixYlCREaJL5NUMwQ0g3MaGFUBNSlmBtKmhbtVG/Cm6lyYmSVTEVil8A==} + engines: {node: ^14.17.0 || >=16.0.0} + + yaml@2.5.1: + resolution: {integrity: sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==} + engines: {node: '>= 14'} + hasBin: true + + yargs-parser@21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + + yargs@17.7.2: + resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} + engines: {node: '>=12'} + + yocto-queue@0.1.0: + resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} + engines: {node: '>=10'} + + zrender@5.6.0: + resolution: {integrity: sha512-uzgraf4njmmHAbEUxMJ8Oxg+P3fT04O+9p7gY+wJRVxo8Ge+KmYv0WJev945EH4wFuc4OY2NLXz46FZrWS9xJg==} + +snapshots: + + '@ampproject/remapping@2.2.1': + dependencies: + '@jridgewell/gen-mapping': 0.3.3 + '@jridgewell/trace-mapping': 0.3.20 + + '@antfu/eslint-config@3.2.0(@typescript-eslint/utils@8.4.0(eslint@9.9.1)(typescript@5.3.3))(@vue/compiler-sfc@3.5.1)(eslint@9.9.1)(typescript@5.3.3)': + dependencies: + '@antfu/install-pkg': 0.4.1 + '@clack/prompts': 0.7.0 + '@eslint-community/eslint-plugin-eslint-comments': 4.4.0(eslint@9.9.1) + '@stylistic/eslint-plugin': 2.7.2(eslint@9.9.1)(typescript@5.3.3) + '@typescript-eslint/eslint-plugin': 8.4.0(@typescript-eslint/parser@8.4.0(eslint@9.9.1)(typescript@5.3.3))(eslint@9.9.1)(typescript@5.3.3) + '@typescript-eslint/parser': 8.4.0(eslint@9.9.1)(typescript@5.3.3) + '@vitest/eslint-plugin': 1.1.0(@typescript-eslint/utils@8.4.0(eslint@9.9.1)(typescript@5.3.3))(eslint@9.9.1)(typescript@5.3.3) + eslint: 9.9.1 + eslint-config-flat-gitignore: 0.3.0(eslint@9.9.1) + eslint-flat-config-utils: 0.3.1 + eslint-merge-processors: 0.1.0(eslint@9.9.1) + eslint-plugin-antfu: 2.4.1(eslint@9.9.1) + eslint-plugin-command: 0.2.3(eslint@9.9.1) + eslint-plugin-import-x: 4.2.1(eslint@9.9.1)(typescript@5.3.3) + eslint-plugin-jsdoc: 50.2.2(eslint@9.9.1) + eslint-plugin-jsonc: 2.16.0(eslint@9.9.1) + eslint-plugin-markdown: 5.1.0(eslint@9.9.1) + eslint-plugin-n: 17.10.2(eslint@9.9.1) + eslint-plugin-no-only-tests: 3.3.0 + eslint-plugin-perfectionist: 3.4.0(eslint@9.9.1)(typescript@5.3.3)(vue-eslint-parser@9.4.3(eslint@9.9.1)) + eslint-plugin-regexp: 2.6.0(eslint@9.9.1) + eslint-plugin-toml: 0.11.1(eslint@9.9.1) + eslint-plugin-unicorn: 55.0.0(eslint@9.9.1) + eslint-plugin-unused-imports: 4.1.3(@typescript-eslint/eslint-plugin@8.4.0(@typescript-eslint/parser@8.4.0(eslint@9.9.1)(typescript@5.3.3))(eslint@9.9.1)(typescript@5.3.3))(eslint@9.9.1) + eslint-plugin-vue: 9.28.0(eslint@9.9.1) + eslint-plugin-yml: 1.14.0(eslint@9.9.1) + eslint-processor-vue-blocks: 0.1.2(@vue/compiler-sfc@3.5.1)(eslint@9.9.1) + globals: 15.9.0 + jsonc-eslint-parser: 2.4.0 + local-pkg: 0.5.0 + parse-gitignore: 2.0.0 + picocolors: 1.1.0 + toml-eslint-parser: 0.10.0 + vue-eslint-parser: 9.4.3(eslint@9.9.1) + yaml-eslint-parser: 1.2.3 + yargs: 17.7.2 + transitivePeerDependencies: + - '@typescript-eslint/utils' + - '@vue/compiler-sfc' + - supports-color + - svelte + - typescript + - vitest + + '@antfu/install-pkg@0.4.1': + dependencies: + package-manager-detector: 0.2.0 + tinyexec: 0.3.0 + + '@antfu/utils@0.7.10': {} + + '@babel/cli@7.23.4(@babel/core@7.23.6)': + dependencies: + '@babel/core': 7.23.6 + '@jridgewell/trace-mapping': 0.3.20 + commander: 4.1.1 + convert-source-map: 2.0.0 + fs-readdir-recursive: 1.1.0 + glob: 7.2.3 + make-dir: 2.1.0 + slash: 2.0.0 + optionalDependencies: + '@nicolo-ribaudo/chokidar-2': 2.1.8-no-fsevents.3 + chokidar: 3.5.3 + + '@babel/code-frame@7.23.5': + dependencies: + '@babel/highlight': 7.23.4 + chalk: 2.4.2 + + '@babel/compat-data@7.23.5': {} + + '@babel/core@7.23.6': + dependencies: + '@ampproject/remapping': 2.2.1 + '@babel/code-frame': 7.23.5 + '@babel/generator': 7.23.6 + '@babel/helper-compilation-targets': 7.23.6 + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.6) + '@babel/helpers': 7.23.6 + '@babel/parser': 7.23.6 + '@babel/template': 7.22.15 + '@babel/traverse': 7.23.6 + '@babel/types': 7.23.6 + convert-source-map: 2.0.0 + debug: 4.3.4 + gensync: 1.0.0-beta.2 + json5: 2.2.3 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + + '@babel/generator@7.23.6': + dependencies: + '@babel/types': 7.23.6 + '@jridgewell/gen-mapping': 0.3.3 + '@jridgewell/trace-mapping': 0.3.20 + jsesc: 2.5.2 + + '@babel/helper-annotate-as-pure@7.22.5': + dependencies: + '@babel/types': 7.23.4 + + '@babel/helper-compilation-targets@7.23.6': + dependencies: + '@babel/compat-data': 7.23.5 + '@babel/helper-validator-option': 7.23.5 + browserslist: 4.22.2 + lru-cache: 5.1.1 + semver: 6.3.1 + + '@babel/helper-environment-visitor@7.22.20': {} + + '@babel/helper-function-name@7.23.0': + dependencies: + '@babel/template': 7.22.15 + '@babel/types': 7.23.6 + + '@babel/helper-hoist-variables@7.22.5': + dependencies: + '@babel/types': 7.23.6 + + '@babel/helper-module-imports@7.22.15': + dependencies: + '@babel/types': 7.23.4 + + '@babel/helper-module-transforms@7.23.3(@babel/core@7.23.6)': + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-module-imports': 7.22.15 + '@babel/helper-simple-access': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + '@babel/helper-validator-identifier': 7.22.20 + + '@babel/helper-plugin-utils@7.22.5': {} + + '@babel/helper-simple-access@7.22.5': + dependencies: + '@babel/types': 7.23.6 + + '@babel/helper-split-export-declaration@7.22.6': + dependencies: + '@babel/types': 7.23.6 + + '@babel/helper-string-parser@7.23.4': {} + + '@babel/helper-string-parser@7.24.8': {} + + '@babel/helper-validator-identifier@7.22.20': {} + + '@babel/helper-validator-identifier@7.24.7': {} + + '@babel/helper-validator-option@7.23.5': {} + + '@babel/helpers@7.23.6': + dependencies: + '@babel/template': 7.22.15 + '@babel/traverse': 7.23.6 + '@babel/types': 7.23.6 + transitivePeerDependencies: + - supports-color + + '@babel/highlight@7.23.4': + dependencies: + '@babel/helper-validator-identifier': 7.22.20 + chalk: 2.4.2 + js-tokens: 4.0.0 + + '@babel/parser@7.23.6': + dependencies: + '@babel/types': 7.23.6 + + '@babel/parser@7.25.6': + dependencies: + '@babel/types': 7.25.6 + + '@babel/plugin-syntax-jsx@7.23.3(@babel/core@7.23.6)': + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-plugin-utils': 7.22.5 + + '@babel/plugin-transform-react-jsx@7.23.4(@babel/core@7.23.6)': + dependencies: + '@babel/core': 7.23.6 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-module-imports': 7.22.15 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-jsx': 7.23.3(@babel/core@7.23.6) + '@babel/types': 7.23.4 + + '@babel/template@7.22.15': + dependencies: + '@babel/code-frame': 7.23.5 + '@babel/parser': 7.23.6 + '@babel/types': 7.23.6 + + '@babel/traverse@7.23.6': + dependencies: + '@babel/code-frame': 7.23.5 + '@babel/generator': 7.23.6 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-function-name': 7.23.0 + '@babel/helper-hoist-variables': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + '@babel/parser': 7.23.6 + '@babel/types': 7.23.6 + debug: 4.3.4 + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + + '@babel/types@7.23.4': + dependencies: + '@babel/helper-string-parser': 7.23.4 + '@babel/helper-validator-identifier': 7.22.20 + to-fast-properties: 2.0.0 + + '@babel/types@7.23.6': + dependencies: + '@babel/helper-string-parser': 7.23.4 + '@babel/helper-validator-identifier': 7.22.20 + to-fast-properties: 2.0.0 + + '@babel/types@7.25.6': + dependencies: + '@babel/helper-string-parser': 7.24.8 + '@babel/helper-validator-identifier': 7.24.7 + to-fast-properties: 2.0.0 + + '@clack/core@0.3.4': + dependencies: + picocolors: 1.1.0 + sisteransi: 1.0.5 + + '@clack/prompts@0.7.0': + dependencies: + '@clack/core': 0.3.4 + picocolors: 1.1.0 + sisteransi: 1.0.5 + + '@es-joy/jsdoccomment@0.43.1': + dependencies: + '@types/eslint': 8.56.12 + '@types/estree': 1.0.5 + '@typescript-eslint/types': 7.18.0 + comment-parser: 1.4.1 + esquery: 1.6.0 + jsdoc-type-pratt-parser: 4.0.0 + + '@es-joy/jsdoccomment@0.48.0': + dependencies: + comment-parser: 1.4.1 + esquery: 1.6.0 + jsdoc-type-pratt-parser: 4.1.0 + + '@eslint-community/eslint-plugin-eslint-comments@4.4.0(eslint@9.9.1)': + dependencies: + escape-string-regexp: 4.0.0 + eslint: 9.9.1 + ignore: 5.3.2 + + '@eslint-community/eslint-utils@4.4.0(eslint@9.9.1)': + dependencies: + eslint: 9.9.1 + eslint-visitor-keys: 3.4.3 + + '@eslint-community/regexpp@4.11.0': {} + + '@eslint/compat@1.1.1': {} + + '@eslint/config-array@0.18.0': + dependencies: + '@eslint/object-schema': 2.1.4 + debug: 4.3.4 + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + + '@eslint/eslintrc@3.1.0': + dependencies: + ajv: 6.12.6 + debug: 4.3.4 + espree: 10.1.0 + globals: 14.0.0 + ignore: 5.3.2 + import-fresh: 3.3.0 + js-yaml: 4.1.0 + minimatch: 3.1.2 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - supports-color + + '@eslint/js@9.9.1': {} + + '@eslint/object-schema@2.1.4': {} + + '@humanwhocodes/module-importer@1.0.1': {} + + '@humanwhocodes/retry@0.3.0': {} + + '@jridgewell/gen-mapping@0.3.3': + dependencies: + '@jridgewell/set-array': 1.1.2 + '@jridgewell/sourcemap-codec': 1.4.15 + '@jridgewell/trace-mapping': 0.3.20 + + '@jridgewell/resolve-uri@3.1.1': {} + + '@jridgewell/set-array@1.1.2': {} + + '@jridgewell/sourcemap-codec@1.4.15': {} + + '@jridgewell/sourcemap-codec@1.5.0': {} + + '@jridgewell/trace-mapping@0.3.20': + dependencies: + '@jridgewell/resolve-uri': 3.1.1 + '@jridgewell/sourcemap-codec': 1.4.15 + + '@miniprogram-component-plus/video-swiper@1.0.1': {} + + '@nicolo-ribaudo/chokidar-2@2.1.8-no-fsevents.3': + optional: true + + '@nodelib/fs.scandir@2.1.5': + dependencies: + '@nodelib/fs.stat': 2.0.5 + run-parallel: 1.2.0 + + '@nodelib/fs.stat@2.0.5': {} + + '@nodelib/fs.walk@1.2.8': + dependencies: + '@nodelib/fs.scandir': 2.1.5 + fastq: 1.17.1 + + '@pkgr/core@0.1.1': {} + + '@stylistic/eslint-plugin@2.7.2(eslint@9.9.1)(typescript@5.3.3)': + dependencies: + '@types/eslint': 9.6.1 + '@typescript-eslint/utils': 8.4.0(eslint@9.9.1)(typescript@5.3.3) + eslint: 9.9.1 + eslint-visitor-keys: 4.0.0 + espree: 10.1.0 + estraverse: 5.3.0 + picomatch: 4.0.2 + transitivePeerDependencies: + - supports-color + - typescript + + '@types/eslint@8.56.12': + dependencies: + '@types/estree': 1.0.5 + '@types/json-schema': 7.0.15 + + '@types/eslint@9.6.1': + dependencies: + '@types/estree': 1.0.5 + '@types/json-schema': 7.0.15 + + '@types/estree@1.0.5': {} + + '@types/json-schema@7.0.15': {} + + '@types/mdast@3.0.15': + dependencies: + '@types/unist': 2.0.11 + + '@types/normalize-package-data@2.4.4': {} + + '@types/unist@2.0.11': {} + + '@typescript-eslint/eslint-plugin@8.4.0(@typescript-eslint/parser@8.4.0(eslint@9.9.1)(typescript@5.3.3))(eslint@9.9.1)(typescript@5.3.3)': + dependencies: + '@eslint-community/regexpp': 4.11.0 + '@typescript-eslint/parser': 8.4.0(eslint@9.9.1)(typescript@5.3.3) + '@typescript-eslint/scope-manager': 8.4.0 + '@typescript-eslint/type-utils': 8.4.0(eslint@9.9.1)(typescript@5.3.3) + '@typescript-eslint/utils': 8.4.0(eslint@9.9.1)(typescript@5.3.3) + '@typescript-eslint/visitor-keys': 8.4.0 + eslint: 9.9.1 + graphemer: 1.4.0 + ignore: 5.3.2 + natural-compare: 1.4.0 + ts-api-utils: 1.3.0(typescript@5.3.3) + optionalDependencies: + typescript: 5.3.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/parser@8.4.0(eslint@9.9.1)(typescript@5.3.3)': + dependencies: + '@typescript-eslint/scope-manager': 8.4.0 + '@typescript-eslint/types': 8.4.0 + '@typescript-eslint/typescript-estree': 8.4.0(typescript@5.3.3) + '@typescript-eslint/visitor-keys': 8.4.0 + debug: 4.3.4 + eslint: 9.9.1 + optionalDependencies: + typescript: 5.3.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/scope-manager@8.4.0': + dependencies: + '@typescript-eslint/types': 8.4.0 + '@typescript-eslint/visitor-keys': 8.4.0 + + '@typescript-eslint/type-utils@8.4.0(eslint@9.9.1)(typescript@5.3.3)': + dependencies: + '@typescript-eslint/typescript-estree': 8.4.0(typescript@5.3.3) + '@typescript-eslint/utils': 8.4.0(eslint@9.9.1)(typescript@5.3.3) + debug: 4.3.4 + ts-api-utils: 1.3.0(typescript@5.3.3) + optionalDependencies: + typescript: 5.3.3 + transitivePeerDependencies: + - eslint + - supports-color + + '@typescript-eslint/types@7.18.0': {} + + '@typescript-eslint/types@8.4.0': {} + + '@typescript-eslint/typescript-estree@8.4.0(typescript@5.3.3)': + dependencies: + '@typescript-eslint/types': 8.4.0 + '@typescript-eslint/visitor-keys': 8.4.0 + debug: 4.3.4 + fast-glob: 3.3.2 + is-glob: 4.0.3 + minimatch: 9.0.5 + semver: 7.6.3 + ts-api-utils: 1.3.0(typescript@5.3.3) + optionalDependencies: + typescript: 5.3.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/utils@8.4.0(eslint@9.9.1)(typescript@5.3.3)': + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@9.9.1) + '@typescript-eslint/scope-manager': 8.4.0 + '@typescript-eslint/types': 8.4.0 + '@typescript-eslint/typescript-estree': 8.4.0(typescript@5.3.3) + eslint: 9.9.1 + transitivePeerDependencies: + - supports-color + - typescript + + '@typescript-eslint/visitor-keys@8.4.0': + dependencies: + '@typescript-eslint/types': 8.4.0 + eslint-visitor-keys: 3.4.3 + + '@vant/weapp@1.11.2': {} + + '@vitest/eslint-plugin@1.1.0(@typescript-eslint/utils@8.4.0(eslint@9.9.1)(typescript@5.3.3))(eslint@9.9.1)(typescript@5.3.3)': + dependencies: + eslint: 9.9.1 + optionalDependencies: + '@typescript-eslint/utils': 8.4.0(eslint@9.9.1)(typescript@5.3.3) + typescript: 5.3.3 + + '@vue/compiler-core@3.5.1': + dependencies: + '@babel/parser': 7.25.6 + '@vue/shared': 3.5.1 + entities: 4.5.0 + estree-walker: 2.0.2 + source-map-js: 1.2.0 + + '@vue/compiler-dom@3.5.1': + dependencies: + '@vue/compiler-core': 3.5.1 + '@vue/shared': 3.5.1 + + '@vue/compiler-sfc@3.5.1': + dependencies: + '@babel/parser': 7.25.6 + '@vue/compiler-core': 3.5.1 + '@vue/compiler-dom': 3.5.1 + '@vue/compiler-ssr': 3.5.1 + '@vue/shared': 3.5.1 + estree-walker: 2.0.2 + magic-string: 0.30.11 + postcss: 8.4.45 + source-map-js: 1.2.0 + + '@vue/compiler-ssr@3.5.1': + dependencies: + '@vue/compiler-dom': 3.5.1 + '@vue/shared': 3.5.1 + + '@vue/shared@3.5.1': {} + + acorn-jsx@5.3.2(acorn@8.12.1): + dependencies: + acorn: 8.12.1 + + acorn@8.12.1: {} + + ajv@6.12.6: + dependencies: + fast-deep-equal: 3.1.3 + fast-json-stable-stringify: 2.1.0 + json-schema-traverse: 0.4.1 + uri-js: 4.4.1 + + ansi-regex@5.0.1: {} + + ansi-styles@3.2.1: + dependencies: + color-convert: 1.9.3 + + ansi-styles@4.3.0: + dependencies: + color-convert: 2.0.1 + + anymatch@3.1.3: + dependencies: + normalize-path: 3.0.0 + picomatch: 2.3.1 + optional: true + + are-docs-informative@0.0.2: {} + + argparse@2.0.1: {} + + balanced-match@1.0.2: {} + + binary-extensions@2.2.0: + optional: true + + boolbase@1.0.0: {} + + brace-expansion@1.1.11: + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + + brace-expansion@2.0.1: + dependencies: + balanced-match: 1.0.2 + + braces@3.0.2: + dependencies: + fill-range: 7.0.1 + optional: true + + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + + browserslist@4.22.2: + dependencies: + caniuse-lite: 1.0.30001565 + electron-to-chromium: 1.4.616 + node-releases: 2.0.14 + update-browserslist-db: 1.0.13(browserslist@4.22.2) + + browserslist@4.23.3: + dependencies: + caniuse-lite: 1.0.30001657 + electron-to-chromium: 1.5.14 + node-releases: 2.0.18 + update-browserslist-db: 1.1.0(browserslist@4.23.3) + + builtin-modules@3.3.0: {} + + callsites@3.1.0: {} + + caniuse-lite@1.0.30001565: {} + + caniuse-lite@1.0.30001657: {} + + chalk@2.4.2: + dependencies: + ansi-styles: 3.2.1 + escape-string-regexp: 1.0.5 + supports-color: 5.5.0 + + chalk@4.1.2: + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + + character-entities-legacy@1.1.4: {} + + character-entities@1.2.4: {} + + character-reference-invalid@1.1.4: {} + + chokidar@3.5.3: + dependencies: + anymatch: 3.1.3 + braces: 3.0.2 + glob-parent: 5.1.2 + is-binary-path: 2.1.0 + is-glob: 4.0.3 + normalize-path: 3.0.0 + readdirp: 3.6.0 + optionalDependencies: + fsevents: 2.3.3 + optional: true + + ci-info@4.0.0: {} + + clean-regexp@1.0.0: + dependencies: + escape-string-regexp: 1.0.5 + + cliui@8.0.1: + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + + color-convert@1.9.3: + dependencies: + color-name: 1.1.3 + + color-convert@2.0.1: + dependencies: + color-name: 1.1.4 + + color-name@1.1.3: {} + + color-name@1.1.4: {} + + commander@4.1.1: {} + + comment-parser@1.4.1: {} + + concat-map@0.0.1: {} + + confbox@0.1.7: {} + + convert-source-map@2.0.0: {} + + core-js-compat@3.38.1: + dependencies: + browserslist: 4.23.3 + + cross-spawn@7.0.3: + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + + cssesc@3.0.0: {} + + dayjs@1.11.10: {} + + debug@3.2.7: + dependencies: + ms: 2.1.2 + + debug@4.3.4: + dependencies: + ms: 2.1.2 + + debug@4.3.6: + dependencies: + ms: 2.1.2 + + deep-is@0.1.4: {} + + doctrine@3.0.0: + dependencies: + esutils: 2.0.3 + + echarts@5.5.1: + dependencies: + tslib: 2.3.0 + zrender: 5.6.0 + + electron-to-chromium@1.4.616: {} + + electron-to-chromium@1.5.14: {} + + emoji-regex@8.0.0: {} + + enhanced-resolve@5.17.1: + dependencies: + graceful-fs: 4.2.11 + tapable: 2.2.1 + + entities@4.5.0: {} + + error-ex@1.3.2: + dependencies: + is-arrayish: 0.2.1 + + es-module-lexer@1.5.4: {} + + escalade@3.1.1: {} + + escalade@3.2.0: {} + + escape-string-regexp@1.0.5: {} + + escape-string-regexp@4.0.0: {} + + eslint-compat-utils@0.5.1(eslint@9.9.1): + dependencies: + eslint: 9.9.1 + semver: 7.6.3 + + eslint-config-flat-gitignore@0.3.0(eslint@9.9.1): + dependencies: + '@eslint/compat': 1.1.1 + eslint: 9.9.1 + find-up-simple: 1.0.0 + + eslint-config-prettier@9.1.0(eslint@9.9.1): + dependencies: + eslint: 9.9.1 + + eslint-flat-config-utils@0.3.1: + dependencies: + '@types/eslint': 9.6.1 + pathe: 1.1.2 + + eslint-import-resolver-node@0.3.9: + dependencies: + debug: 3.2.7 + is-core-module: 2.15.1 + resolve: 1.22.8 + transitivePeerDependencies: + - supports-color + + eslint-merge-processors@0.1.0(eslint@9.9.1): + dependencies: + eslint: 9.9.1 + + eslint-plugin-antfu@2.4.1(eslint@9.9.1): + dependencies: + '@antfu/utils': 0.7.10 + eslint: 9.9.1 + + eslint-plugin-command@0.2.3(eslint@9.9.1): + dependencies: + '@es-joy/jsdoccomment': 0.43.1 + eslint: 9.9.1 + + eslint-plugin-es-x@7.8.0(eslint@9.9.1): + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@9.9.1) + '@eslint-community/regexpp': 4.11.0 + eslint: 9.9.1 + eslint-compat-utils: 0.5.1(eslint@9.9.1) + + eslint-plugin-import-x@4.2.1(eslint@9.9.1)(typescript@5.3.3): + dependencies: + '@typescript-eslint/utils': 8.4.0(eslint@9.9.1)(typescript@5.3.3) + debug: 4.3.4 + doctrine: 3.0.0 + eslint: 9.9.1 + eslint-import-resolver-node: 0.3.9 + get-tsconfig: 4.8.0 + is-glob: 4.0.3 + minimatch: 9.0.5 + semver: 7.6.3 + stable-hash: 0.0.4 + tslib: 2.7.0 + transitivePeerDependencies: + - supports-color + - typescript + + eslint-plugin-jsdoc@50.2.2(eslint@9.9.1): + dependencies: + '@es-joy/jsdoccomment': 0.48.0 + are-docs-informative: 0.0.2 + comment-parser: 1.4.1 + debug: 4.3.6 + escape-string-regexp: 4.0.0 + eslint: 9.9.1 + espree: 10.1.0 + esquery: 1.6.0 + parse-imports: 2.1.1 + semver: 7.6.3 + spdx-expression-parse: 4.0.0 + synckit: 0.9.1 + transitivePeerDependencies: + - supports-color + + eslint-plugin-jsonc@2.16.0(eslint@9.9.1): + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@9.9.1) + eslint: 9.9.1 + eslint-compat-utils: 0.5.1(eslint@9.9.1) + espree: 9.6.1 + graphemer: 1.4.0 + jsonc-eslint-parser: 2.4.0 + natural-compare: 1.4.0 + synckit: 0.6.2 + + eslint-plugin-markdown@5.1.0(eslint@9.9.1): + dependencies: + eslint: 9.9.1 + mdast-util-from-markdown: 0.8.5 + transitivePeerDependencies: + - supports-color + + eslint-plugin-n@17.10.2(eslint@9.9.1): + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@9.9.1) + enhanced-resolve: 5.17.1 + eslint: 9.9.1 + eslint-plugin-es-x: 7.8.0(eslint@9.9.1) + get-tsconfig: 4.8.0 + globals: 15.9.0 + ignore: 5.3.2 + minimatch: 9.0.5 + semver: 7.6.3 + + eslint-plugin-no-only-tests@3.3.0: {} + + eslint-plugin-perfectionist@3.4.0(eslint@9.9.1)(typescript@5.3.3)(vue-eslint-parser@9.4.3(eslint@9.9.1)): + dependencies: + '@typescript-eslint/types': 8.4.0 + '@typescript-eslint/utils': 8.4.0(eslint@9.9.1)(typescript@5.3.3) + eslint: 9.9.1 + minimatch: 9.0.5 + natural-compare-lite: 1.4.0 + optionalDependencies: + vue-eslint-parser: 9.4.3(eslint@9.9.1) + transitivePeerDependencies: + - supports-color + - typescript + + eslint-plugin-regexp@2.6.0(eslint@9.9.1): + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@9.9.1) + '@eslint-community/regexpp': 4.11.0 + comment-parser: 1.4.1 + eslint: 9.9.1 + jsdoc-type-pratt-parser: 4.1.0 + refa: 0.12.1 + regexp-ast-analysis: 0.7.1 + scslre: 0.3.0 + + eslint-plugin-toml@0.11.1(eslint@9.9.1): + dependencies: + debug: 4.3.4 + eslint: 9.9.1 + eslint-compat-utils: 0.5.1(eslint@9.9.1) + lodash: 4.17.21 + toml-eslint-parser: 0.10.0 + transitivePeerDependencies: + - supports-color + + eslint-plugin-unicorn@55.0.0(eslint@9.9.1): + dependencies: + '@babel/helper-validator-identifier': 7.24.7 + '@eslint-community/eslint-utils': 4.4.0(eslint@9.9.1) + ci-info: 4.0.0 + clean-regexp: 1.0.0 + core-js-compat: 3.38.1 + eslint: 9.9.1 + esquery: 1.6.0 + globals: 15.9.0 + indent-string: 4.0.0 + is-builtin-module: 3.2.1 + jsesc: 3.0.2 + pluralize: 8.0.0 + read-pkg-up: 7.0.1 + regexp-tree: 0.1.27 + regjsparser: 0.10.0 + semver: 7.6.3 + strip-indent: 3.0.0 + + eslint-plugin-unused-imports@4.1.3(@typescript-eslint/eslint-plugin@8.4.0(@typescript-eslint/parser@8.4.0(eslint@9.9.1)(typescript@5.3.3))(eslint@9.9.1)(typescript@5.3.3))(eslint@9.9.1): + dependencies: + eslint: 9.9.1 + optionalDependencies: + '@typescript-eslint/eslint-plugin': 8.4.0(@typescript-eslint/parser@8.4.0(eslint@9.9.1)(typescript@5.3.3))(eslint@9.9.1)(typescript@5.3.3) + + eslint-plugin-vue@9.28.0(eslint@9.9.1): + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@9.9.1) + eslint: 9.9.1 + globals: 13.24.0 + natural-compare: 1.4.0 + nth-check: 2.1.1 + postcss-selector-parser: 6.1.2 + semver: 7.6.3 + vue-eslint-parser: 9.4.3(eslint@9.9.1) + xml-name-validator: 4.0.0 + transitivePeerDependencies: + - supports-color + + eslint-plugin-yml@1.14.0(eslint@9.9.1): + dependencies: + debug: 4.3.4 + eslint: 9.9.1 + eslint-compat-utils: 0.5.1(eslint@9.9.1) + lodash: 4.17.21 + natural-compare: 1.4.0 + yaml-eslint-parser: 1.2.3 + transitivePeerDependencies: + - supports-color + + eslint-processor-vue-blocks@0.1.2(@vue/compiler-sfc@3.5.1)(eslint@9.9.1): + dependencies: + '@vue/compiler-sfc': 3.5.1 + eslint: 9.9.1 + + eslint-scope@7.2.2: + dependencies: + esrecurse: 4.3.0 + estraverse: 5.3.0 + + eslint-scope@8.0.2: + dependencies: + esrecurse: 4.3.0 + estraverse: 5.3.0 + + eslint-visitor-keys@3.4.3: {} + + eslint-visitor-keys@4.0.0: {} + + eslint@9.9.1: + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@9.9.1) + '@eslint-community/regexpp': 4.11.0 + '@eslint/config-array': 0.18.0 + '@eslint/eslintrc': 3.1.0 + '@eslint/js': 9.9.1 + '@humanwhocodes/module-importer': 1.0.1 + '@humanwhocodes/retry': 0.3.0 + '@nodelib/fs.walk': 1.2.8 + ajv: 6.12.6 + chalk: 4.1.2 + cross-spawn: 7.0.3 + debug: 4.3.4 + escape-string-regexp: 4.0.0 + eslint-scope: 8.0.2 + eslint-visitor-keys: 4.0.0 + espree: 10.1.0 + esquery: 1.6.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 8.0.0 + find-up: 5.0.0 + glob-parent: 6.0.2 + ignore: 5.3.2 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + is-path-inside: 3.0.3 + json-stable-stringify-without-jsonify: 1.0.1 + levn: 0.4.1 + lodash.merge: 4.6.2 + minimatch: 3.1.2 + natural-compare: 1.4.0 + optionator: 0.9.4 + strip-ansi: 6.0.1 + text-table: 0.2.0 + transitivePeerDependencies: + - supports-color + + espree@10.1.0: + dependencies: + acorn: 8.12.1 + acorn-jsx: 5.3.2(acorn@8.12.1) + eslint-visitor-keys: 4.0.0 + + espree@9.6.1: + dependencies: + acorn: 8.12.1 + acorn-jsx: 5.3.2(acorn@8.12.1) + eslint-visitor-keys: 3.4.3 + + esquery@1.6.0: + dependencies: + estraverse: 5.3.0 + + esrecurse@4.3.0: + dependencies: + estraverse: 5.3.0 + + estraverse@5.3.0: {} + + estree-walker@2.0.2: {} + + esutils@2.0.3: {} + + fast-deep-equal@3.1.3: {} + + fast-glob@3.3.2: + dependencies: + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.8 + + fast-json-stable-stringify@2.1.0: {} + + fast-levenshtein@2.0.6: {} + + fastq@1.17.1: + dependencies: + reusify: 1.0.4 + + file-entry-cache@8.0.0: + dependencies: + flat-cache: 4.0.1 + + fill-range@7.0.1: + dependencies: + to-regex-range: 5.0.1 + optional: true + + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + + find-up-simple@1.0.0: {} + + find-up@4.1.0: + dependencies: + locate-path: 5.0.0 + path-exists: 4.0.0 + + find-up@5.0.0: + dependencies: + locate-path: 6.0.0 + path-exists: 4.0.0 + + flat-cache@4.0.1: + dependencies: + flatted: 3.3.1 + keyv: 4.5.4 + + flatted@3.3.1: {} + + fs-readdir-recursive@1.1.0: {} + + fs.realpath@1.0.0: {} + + fsevents@2.3.3: + optional: true + + function-bind@1.1.2: {} + + gensync@1.0.0-beta.2: {} + + get-caller-file@2.0.5: {} + + get-tsconfig@4.8.0: + dependencies: + resolve-pkg-maps: 1.0.0 + + glob-parent@5.1.2: + dependencies: + is-glob: 4.0.3 + + glob-parent@6.0.2: + dependencies: + is-glob: 4.0.3 + + glob@7.2.3: + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + + globals@11.12.0: {} + + globals@13.24.0: + dependencies: + type-fest: 0.20.2 + + globals@14.0.0: {} + + globals@15.9.0: {} + + graceful-fs@4.2.11: {} + + graphemer@1.4.0: {} + + has-flag@3.0.0: {} + + has-flag@4.0.0: {} + + hasown@2.0.2: + dependencies: + function-bind: 1.1.2 + + hosted-git-info@2.8.9: {} + + ignore@5.3.2: {} + + import-fresh@3.3.0: + dependencies: + parent-module: 1.0.1 + resolve-from: 4.0.0 + + imurmurhash@0.1.4: {} + + indent-string@4.0.0: {} + + inflight@1.0.6: + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + + inherits@2.0.4: {} + + is-alphabetical@1.0.4: {} + + is-alphanumerical@1.0.4: + dependencies: + is-alphabetical: 1.0.4 + is-decimal: 1.0.4 + + is-arrayish@0.2.1: {} + + is-binary-path@2.1.0: + dependencies: + binary-extensions: 2.2.0 + optional: true + + is-builtin-module@3.2.1: + dependencies: + builtin-modules: 3.3.0 + + is-core-module@2.15.1: + dependencies: + hasown: 2.0.2 + + is-decimal@1.0.4: {} + + is-extglob@2.1.1: {} + + is-fullwidth-code-point@3.0.0: {} + + is-glob@4.0.3: + dependencies: + is-extglob: 2.1.1 + + is-hexadecimal@1.0.4: {} + + is-number@7.0.0: {} + + is-path-inside@3.0.3: {} + + isexe@2.0.0: {} + + js-tokens@4.0.0: {} + + js-yaml@4.1.0: + dependencies: + argparse: 2.0.1 + + jsdoc-type-pratt-parser@4.0.0: {} + + jsdoc-type-pratt-parser@4.1.0: {} + + jsesc@0.5.0: {} + + jsesc@2.5.2: {} + + jsesc@3.0.2: {} + + json-buffer@3.0.1: {} + + json-parse-even-better-errors@2.3.1: {} + + json-schema-traverse@0.4.1: {} + + json-stable-stringify-without-jsonify@1.0.1: {} + + json5@2.2.3: {} + + jsonc-eslint-parser@2.4.0: + dependencies: + acorn: 8.12.1 + eslint-visitor-keys: 3.4.3 + espree: 9.6.1 + semver: 7.6.3 + + keyv@4.5.4: + dependencies: + json-buffer: 3.0.1 + + levn@0.4.1: + dependencies: + prelude-ls: 1.2.1 + type-check: 0.4.0 + + lines-and-columns@1.2.4: {} + + local-pkg@0.5.0: + dependencies: + mlly: 1.7.1 + pkg-types: 1.2.0 + + locate-path@5.0.0: + dependencies: + p-locate: 4.1.0 + + locate-path@6.0.0: + dependencies: + p-locate: 5.0.0 + + lodash.merge@4.6.2: {} + + lodash@4.17.21: {} + + lru-cache@5.1.1: + dependencies: + yallist: 3.1.1 + + magic-string@0.30.11: + dependencies: + '@jridgewell/sourcemap-codec': 1.5.0 + + make-dir@2.1.0: + dependencies: + pify: 4.0.1 + semver: 5.7.2 + + mdast-util-from-markdown@0.8.5: + dependencies: + '@types/mdast': 3.0.15 + mdast-util-to-string: 2.0.0 + micromark: 2.11.4 + parse-entities: 2.0.0 + unist-util-stringify-position: 2.0.3 + transitivePeerDependencies: + - supports-color + + mdast-util-to-string@2.0.0: {} + + merge2@1.4.1: {} + + micromark@2.11.4: + dependencies: + debug: 4.3.4 + parse-entities: 2.0.0 + transitivePeerDependencies: + - supports-color + + micromatch@4.0.8: + dependencies: + braces: 3.0.3 + picomatch: 2.3.1 + + min-indent@1.0.1: {} + + minimatch@3.1.2: + dependencies: + brace-expansion: 1.1.11 + + minimatch@9.0.5: + dependencies: + brace-expansion: 2.0.1 + + miniprogram-api-typings@3.12.2: {} + + miniprogram-licia@1.39.2: {} + + mlly@1.7.1: + dependencies: + acorn: 8.12.1 + pathe: 1.1.2 + pkg-types: 1.2.0 + ufo: 1.5.4 + + mp-html@2.4.2: {} + + ms@2.1.2: {} + + nanoid@3.3.7: {} + + natural-compare-lite@1.4.0: {} + + natural-compare@1.4.0: {} + + node-releases@2.0.14: {} + + node-releases@2.0.18: {} + + normalize-package-data@2.5.0: + dependencies: + hosted-git-info: 2.8.9 + resolve: 1.22.8 + semver: 5.7.2 + validate-npm-package-license: 3.0.4 + + normalize-path@3.0.0: + optional: true + + nth-check@2.1.1: + dependencies: + boolbase: 1.0.0 + + number-precision@1.6.0: {} + + once@1.4.0: + dependencies: + wrappy: 1.0.2 + + optionator@0.9.4: + dependencies: + deep-is: 0.1.4 + fast-levenshtein: 2.0.6 + levn: 0.4.1 + prelude-ls: 1.2.1 + type-check: 0.4.0 + word-wrap: 1.2.5 + + p-limit@2.3.0: + dependencies: + p-try: 2.2.0 + + p-limit@3.1.0: + dependencies: + yocto-queue: 0.1.0 + + p-locate@4.1.0: + dependencies: + p-limit: 2.3.0 + + p-locate@5.0.0: + dependencies: + p-limit: 3.1.0 + + p-try@2.2.0: {} + + package-manager-detector@0.2.0: {} + + parent-module@1.0.1: + dependencies: + callsites: 3.1.0 + + parse-entities@2.0.0: + dependencies: + character-entities: 1.2.4 + character-entities-legacy: 1.1.4 + character-reference-invalid: 1.1.4 + is-alphanumerical: 1.0.4 + is-decimal: 1.0.4 + is-hexadecimal: 1.0.4 + + parse-gitignore@2.0.0: {} + + parse-imports@2.1.1: + dependencies: + es-module-lexer: 1.5.4 + slashes: 3.0.12 + + parse-json@5.2.0: + dependencies: + '@babel/code-frame': 7.23.5 + error-ex: 1.3.2 + json-parse-even-better-errors: 2.3.1 + lines-and-columns: 1.2.4 + + path-exists@4.0.0: {} + + path-is-absolute@1.0.1: {} + + path-key@3.1.1: {} + + path-parse@1.0.7: {} + + pathe@1.1.2: {} + + picocolors@1.0.0: {} + + picocolors@1.1.0: {} + + picomatch@2.3.1: {} + + picomatch@4.0.2: {} + + pify@4.0.1: {} + + pkg-types@1.2.0: + dependencies: + confbox: 0.1.7 + mlly: 1.7.1 + pathe: 1.1.2 + + pluralize@8.0.0: {} + + postcss-selector-parser@6.1.2: + dependencies: + cssesc: 3.0.0 + util-deprecate: 1.0.2 + + postcss@8.4.45: + dependencies: + nanoid: 3.3.7 + picocolors: 1.1.0 + source-map-js: 1.2.0 + + prelude-ls@1.2.1: {} + + prettier@3.3.3: {} + + punycode@2.3.1: {} + + queue-microtask@1.2.3: {} + + read-pkg-up@7.0.1: + dependencies: + find-up: 4.1.0 + read-pkg: 5.2.0 + type-fest: 0.8.1 + + read-pkg@5.2.0: + dependencies: + '@types/normalize-package-data': 2.4.4 + normalize-package-data: 2.5.0 + parse-json: 5.2.0 + type-fest: 0.6.0 + + readdirp@3.6.0: + dependencies: + picomatch: 2.3.1 + optional: true + + refa@0.12.1: + dependencies: + '@eslint-community/regexpp': 4.11.0 + + regexp-ast-analysis@0.7.1: + dependencies: + '@eslint-community/regexpp': 4.11.0 + refa: 0.12.1 + + regexp-tree@0.1.27: {} + + regjsparser@0.10.0: + dependencies: + jsesc: 0.5.0 + + require-directory@2.1.1: {} + + resolve-from@4.0.0: {} + + resolve-pkg-maps@1.0.0: {} + + resolve@1.22.8: + dependencies: + is-core-module: 2.15.1 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + + reusify@1.0.4: {} + + run-parallel@1.2.0: + dependencies: + queue-microtask: 1.2.3 + + scslre@0.3.0: + dependencies: + '@eslint-community/regexpp': 4.11.0 + refa: 0.12.1 + regexp-ast-analysis: 0.7.1 + + semver@5.7.2: {} + + semver@6.3.1: {} + + semver@7.6.3: {} + + shebang-command@2.0.0: + dependencies: + shebang-regex: 3.0.0 + + shebang-regex@3.0.0: {} + + sisteransi@1.0.5: {} + + slash@2.0.0: {} + + slashes@3.0.12: {} + + source-map-js@1.2.0: {} + + spdx-correct@3.2.0: + dependencies: + spdx-expression-parse: 3.0.1 + spdx-license-ids: 3.0.20 + + spdx-exceptions@2.5.0: {} + + spdx-expression-parse@3.0.1: + dependencies: + spdx-exceptions: 2.5.0 + spdx-license-ids: 3.0.20 + + spdx-expression-parse@4.0.0: + dependencies: + spdx-exceptions: 2.5.0 + spdx-license-ids: 3.0.20 + + spdx-license-ids@3.0.20: {} + + stable-hash@0.0.4: {} + + string-width@4.2.3: + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + + strip-ansi@6.0.1: + dependencies: + ansi-regex: 5.0.1 + + strip-indent@3.0.0: + dependencies: + min-indent: 1.0.1 + + strip-json-comments@3.1.1: {} + + supports-color@5.5.0: + dependencies: + has-flag: 3.0.0 + + supports-color@7.2.0: + dependencies: + has-flag: 4.0.0 + + supports-preserve-symlinks-flag@1.0.0: {} + + synckit@0.6.2: + dependencies: + tslib: 2.7.0 + + synckit@0.9.1: + dependencies: + '@pkgr/core': 0.1.1 + tslib: 2.7.0 + + tapable@2.2.1: {} + + text-table@0.2.0: {} + + tinyexec@0.3.0: {} + + to-fast-properties@2.0.0: {} + + to-regex-range@5.0.1: + dependencies: + is-number: 7.0.0 + + toml-eslint-parser@0.10.0: + dependencies: + eslint-visitor-keys: 3.4.3 + + ts-api-utils@1.3.0(typescript@5.3.3): + dependencies: + typescript: 5.3.3 + + tslib@2.3.0: {} + + tslib@2.7.0: {} + + type-check@0.4.0: + dependencies: + prelude-ls: 1.2.1 + + type-fest@0.20.2: {} + + type-fest@0.6.0: {} + + type-fest@0.8.1: {} + + typescript@5.3.3: {} + + ufo@1.5.4: {} + + unist-util-stringify-position@2.0.3: + dependencies: + '@types/unist': 2.0.11 + + update-browserslist-db@1.0.13(browserslist@4.22.2): + dependencies: + browserslist: 4.22.2 + escalade: 3.1.1 + picocolors: 1.0.0 + + update-browserslist-db@1.1.0(browserslist@4.23.3): + dependencies: + browserslist: 4.23.3 + escalade: 3.2.0 + picocolors: 1.1.0 + + uri-js@4.4.1: + dependencies: + punycode: 2.3.1 + + util-deprecate@1.0.2: {} + + validate-npm-package-license@3.0.4: + dependencies: + spdx-correct: 3.2.0 + spdx-expression-parse: 3.0.1 + + vue-eslint-parser@9.4.3(eslint@9.9.1): + dependencies: + debug: 4.3.4 + eslint: 9.9.1 + eslint-scope: 7.2.2 + eslint-visitor-keys: 3.4.3 + espree: 9.6.1 + esquery: 1.6.0 + lodash: 4.17.21 + semver: 7.6.3 + transitivePeerDependencies: + - supports-color + + which@2.0.2: + dependencies: + isexe: 2.0.0 + + word-wrap@1.2.5: {} + + wrap-ansi@7.0.0: + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + + wrappy@1.0.2: {} + + xml-name-validator@4.0.0: {} + + y18n@5.0.8: {} + + yallist@3.1.1: {} + + yaml-eslint-parser@1.2.3: + dependencies: + eslint-visitor-keys: 3.4.3 + lodash: 4.17.21 + yaml: 2.5.1 + + yaml@2.5.1: {} + + yargs-parser@21.1.1: {} + + yargs@17.7.2: + dependencies: + cliui: 8.0.1 + escalade: 3.1.1 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 21.1.1 + + yocto-queue@0.1.0: {} + + zrender@5.6.0: + dependencies: + tslib: 2.3.0 diff --git a/project.config.json b/project.config.json new file mode 100644 index 0000000..51a3bc0 --- /dev/null +++ b/project.config.json @@ -0,0 +1,75 @@ +{ + "description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", + "miniprogramRoot": "./src", + "compileType": "miniprogram", + "setting": { + "useCompilerPlugins": [ + "typescript", + "sass" + ], + "urlCheck": true, + "coverView": true, + "es6": true, + "postcss": true, + "lazyloadPlaceholderEnable": false, + "preloadBackgroundData": false, + "minified": true, + "autoAudits": false, + "uglifyFileName": false, + "uploadWithSourceMap": true, + "enhance": true, + "useMultiFrameRuntime": true, + "showShadowRootInWxmlPanel": true, + "packNpmManually": true, + "packNpmRelationList": [ + { + "packageJsonPath": "package.json", + "miniprogramNpmDistDir": "./src" + } + ], + "minifyWXSS": true, + "useStaticServer": true, + "showES6CompileOption": false, + "checkInvalidKey": true, + "babelSetting": { + "ignore": [], + "disablePlugins": [], + "outputPath": "" + }, + "disableUseStrict": false, + "minifyWXML": true, + "localPlugins": false, + "condition": false, + "ignoreUploadUnusedFiles": true + }, + "simulatorType": "wechat", + "simulatorPluginLibVersion": {}, + "condition": {}, + "editorSetting": { + "tabIndent": "insertSpaces", + "tabSize": 2 + }, + "packOptions": { + "ignore": [ + { + "value": "images/*.*", + "type": "glob" + }, + { + "value": "images/**/*.*", + "type": "glob" + }, + { + "value": "images/**/**/*.*", + "type": "glob" + } + ], + "include": [] + }, + "appid": "wxc3cdb3c4d4f62cea", + "scripts": { + "beforeCompile": "pnpm run beforeCompile", + "beforePreview": "pnpm run beforeCompile", + "beforeUpload": "pnpm run beforeCompile" + } +} diff --git a/project.private.config.json b/project.private.config.json new file mode 100644 index 0000000..82c70e4 --- /dev/null +++ b/project.private.config.json @@ -0,0 +1,771 @@ +{ + "projectname": "zaiding-miniprogram", + "setting": { + "compileHotReLoad": true, + "urlCheck": true + }, + "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", + "condition": { + "miniprogram": { + "list": [ + { + "name": "腾讯健康药箱", + "pathName": "pages/demo/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "知识库-视频详情", + "pathName": "pages/repositoryVideoDetail/index", + "query": "id=3", + "launchMode": "default", + "scene": null + }, + { + "name": "医生-转诊医生详情", + "pathName": "doctor/pages/d_transferDetail/index", + "query": "type=1", + "launchMode": "default", + "scene": null + }, + { + "name": "医生-转诊推荐记录", + "pathName": "doctor/pages/d_transferLog/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "医生-转诊", + "pathName": "doctor/pages/d_transfer/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "pages/adlResult/index", + "pathName": "pages/adlResult/index", + "query": "id=849&reset=1&m_d=undefined&nrdl=undefined&wy=0&idafa=1", + "launchMode": "default", + "scene": null + }, + { + "name": "adl结果", + "pathName": "pages/adlResult/index", + "query": "id=658&reset=1&m_d=undefined&nrdl=undefined", + "launchMode": "default", + "scene": null + }, + { + "name": "个人信息及隐私保护政策", + "pathName": "doc/pages/doc1/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "公共-知情录入结果", + "pathName": "public/pages/informedResult/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "公共-知情录入", + "pathName": "public/pages/informed/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "公共-知情同意书", + "pathName": "public/pages/informedStart/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "医生端-患者列表", + "pathName": "doctor/pages/d_patientList/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "就诊地图", + "pathName": "pages/doctor/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "doctor/pages/d_patientDetail/index", + "pathName": "doctor/pages/d_patientDetail/index", + "query": "id=1123", + "launchMode": "default", + "scene": null + }, + { + "name": "复诊记录", + "pathName": "pages/referral/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "医生端-自定义导出", + "pathName": "doctor/pages/d_customExport/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "医生端-报告中心", + "pathName": "doctor/pages/d_exportList/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "test", + "pathName": "pages/webview/index", + "query": "es=201503", + "launchMode": "default", + "scene": null + }, + { + "name": "外部-首页", + "pathName": "pages/index/index", + "query": "es=201501", + "launchMode": "default", + "scene": null + }, + { + "name": "外部-webview", + "pathName": "pages/webview/index", + "query": "es=201503", + "launchMode": "default", + "scene": null + }, + { + "name": "外部-adl", + "pathName": "pages/adl/index", + "query": "m_d=1&es=201502", + "launchMode": "default", + "scene": null + }, + { + "name": "皮下剂型-video", + "pathName": "gift/pages/cutaneousVideo/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "皮下剂型", + "pathName": "gift/pages/cutaneous/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "医生端_任务详情", + "pathName": "doctor/pages/d_taskDetail/index", + "query": "id=10", + "launchMode": "default", + "scene": null + }, + { + "name": "医生端adl结果页", + "pathName": "octor/pages/d_adlResult/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "医生端_患者详情", + "pathName": "doctor/pages/d_patientDetail/index", + "query": "id=940", + "launchMode": "default", + "scene": null + }, + { + "name": "会议详情", + "pathName": "pages/liveDetail/index", + "query": "id=95", + "launchMode": "default", + "scene": null + }, + { + "name": "医生端_互动页_医生视角", + "pathName": "doctor/pages/d_interactiveDoctor/index", + "query": "patientId=940", + "launchMode": "default", + "scene": null + }, + { + "name": "bind", + "pathName": "pages/start/index", + "query": "scene=doctorId%3D2%26inviteChan%3D1", + "launchMode": "default", + "scene": 1047 + }, + { + "name": "医生端_中转页", + "pathName": "doctor/pages/d_trans/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "医生端_切换医生", + "pathName": "doctor/pages/d_changeDoctor/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "互动页_患者视角", + "pathName": "pages/interactivePatient/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "医生端_新建任务", + "pathName": "doctor/pages/d_createTask/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "医生端_任务列表", + "pathName": "doctor/pages/d_taskList/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "医生端_首页", + "pathName": "doctor/pages/d_home/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "医生端_邀约患者", + "pathName": "doctor/pages/d_invite/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "医生端_更换手机号", + "pathName": "doctor/pages/d_changePhone/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "医生端_个人信息", + "pathName": "doctor/pages/d_userInfo/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "医生端_我的", + "pathName": "doctor/pages/d_my/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "医生端_患者列表", + "pathName": "doctor/pages/d_patient/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "医生端-互动页", + "pathName": "doctor/pages/d_interactive/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "医生端_登录页", + "pathName": "doctor/pages/d_login/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "我的-用药患者审核失败", + "pathName": "gift/pages/vipReject/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "我的-用药患者审核中(已关注)", + "pathName": "gift/pages/vipStartPending/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "我的-用药患者审核中", + "pathName": "gift/pages/vipPending/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "我的->用药患者", + "pathName": "gift/pages/vipCert/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "我的->用药患者失败", + "pathName": "gift/pages/vipReject/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "医院详情", + "pathName": "pages/hospital/index", + "query": "id=3", + "launchMode": "default", + "scene": null + }, + { + "name": "能量规则", + "pathName": "gift/pages/scoreRule/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "有奖征文", + "pathName": "pages/storyGuide/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "订单详情", + "pathName": "gift/pages/orderDetail/index", + "query": "id=4", + "launchMode": "default", + "scene": null + }, + { + "name": "下单成功", + "pathName": "gift/pages/orderEnd/index", + "query": "id=4", + "launchMode": "default", + "scene": null + }, + { + "name": "确认订单", + "pathName": "gift/pages/conformOrder/index", + "query": "id=4", + "launchMode": "default", + "scene": null + }, + { + "name": "礼品详情", + "pathName": "gift/pages/giftDetail/index", + "query": "id=3", + "launchMode": "default", + "scene": null + }, + { + "name": "nrdl详情", + "pathName": "pages/nrdlDetail/index", + "query": "id=2", + "launchMode": "default", + "scene": null + }, + { + "name": "能量明细", + "pathName": "gift/pages/priceDetail/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "我的礼品", + "pathName": "gift/pages/myGift/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "地址编辑", + "pathName": "gift/pages/siteEdit/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "地址管理", + "pathName": "gift/pages/siteList/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "礼品中心", + "pathName": "gift/pages/giftList/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "城市列表", + "pathName": "pages/nrdlTable/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "dtp药房", + "pathName": "gift/pages/dtpDurg/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "输液中心", + "pathName": "pages/infusionCenter/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "首页", + "pathName": "pages/index/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "nrdl", + "pathName": "pages/nrdl/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "随访知情同意书", + "pathName": "pages/taskAgreement/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "登录", + "pathName": "pages/login/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "知情同意书", + "pathName": "pages/privacyAgreement/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "录入信息", + "pathName": "pages/enterInfo/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "上传诊断证明", + "pathName": "pages/uploadCert/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "初始进入-审核失败", + "pathName": "pages/startReject/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "初始进入-审核中", + "pathName": "pages/startPending/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "诊断证明成功", + "pathName": "pages/certReslove/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "诊断证明审核中", + "pathName": "pages/certPending/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "专属服务用户进入", + "pathName": "pages/vipLogin/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "奇迹故事", + "pathName": "pages/story/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "奇迹故事详情", + "pathName": "pages/publishStoryDetail/index", + "query": "id=5", + "launchMode": "default", + "scene": null + }, + { + "name": "奇迹故事编辑", + "pathName": "pages/storyEnter/index", + "query": "storyleadin=", + "launchMode": "default", + "scene": null + }, + { + "name": "我的", + "pathName": "pages/my/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "知识库", + "pathName": "pages/repository/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "会议课堂", + "pathName": "pages/live/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "会议结果", + "pathName": "pages/liveResult/index", + "query": "id=19", + "launchMode": "default", + "scene": null + }, + { + "name": "签到", + "pathName": "pages/signIn/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "我的故事", + "pathName": "pages/storyList/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "我的故事详情", + "pathName": "pages/storyDetail/index", + "query": "id=88", + "launchMode": "default", + "scene": null + }, + { + "name": "我的收藏", + "pathName": "pages/mySave/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "我报名的会议", + "pathName": "pages/myLive/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "知识库详情", + "pathName": "pages/repositoryDetail/index", + "query": "id=16", + "launchMode": "default", + "scene": null + }, + { + "name": "公众号关注", + "pathName": "pages/thePublic/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "adl", + "pathName": "pages/adl/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "adl分享", + "pathName": "pages/adlShare/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "adl测评", + "pathName": "pages/adlTest/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "健康报告", + "pathName": "gift/pages/myHealthRecord/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "奇迹故事编辑结果", + "pathName": "pages/storyEnterResult/index", + "query": "id=2", + "launchMode": "default", + "scene": null + }, + { + "name": "配置头像", + "pathName": "pages/getUserInfo/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "个人信息", + "pathName": "pages/personalInformation/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "我的亲友", + "pathName": "pages/family/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "修改手机号", + "pathName": "pages/changePhone/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "切换账号", + "pathName": "pages/changeUser/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "家庭成员", + "pathName": "pages/familyList/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "亲友扫码", + "pathName": "pages/familyScan/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "微页面", + "pathName": "pages/smallPage/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "签到", + "pathName": "pages/signIn/index", + "query": "scene=id%3D46", + "launchMode": "default", + "scene": 1047 + }, + { + "name": "健康报告图表", + "pathName": "gift/pages/myHealthRecordChart/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "医生详情", + "pathName": "pages/doctorDetail/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "用药记录", + "pathName": "pages/drugRecord/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "商保项目", + "pathName": "pages/comIns/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "微医-webview", + "pathName": "pages/webview/index", + "query": "", + "launchMode": "default", + "scene": null + } + ] + } + }, + "libVersion": "3.5.8" +} \ No newline at end of file diff --git a/src/api/request.ts b/src/api/request.ts new file mode 100644 index 0000000..aa310a1 --- /dev/null +++ b/src/api/request.ts @@ -0,0 +1,72 @@ +interface IGlobalParams { + gUrl: string; + version: string; +} + +export const request = function ( + { gUrl, version }: IGlobalParams, + { url, method, data, header, showMsg = true, loading = false, isJSON = false, ...options }: IAgaxParams, +): Promise { + return new Promise((resolve, reject) => { + if (loading) { + wx.showLoading({ + title: "加载中...", + mask: true, + }); + } + wx.request({ + header: { + loginState: getApp().globalData.loginState, + ...header, + }, + url: gUrl + url, + method: method, + data: { + loginState: getApp().globalData.loginState, + ...(data as object), + }, + ...options, + success(res: any) { + const { code, data } = res.data; + if (isJSON) { + resolve(res.data); + } else if (code === 0) { + resolve(data); + } else if (showMsg) { + const msg = errPicker(res.data); + if (loading) { + setTimeout(() => { + wx.showToast({ + title: msg, + icon: "none", + }); + }, 30); + } else { + wx.showToast({ + title: msg, + icon: "none", + }); + reject(res); + } + } else { + reject(res); + } + }, + fail(err) { + reject(err); + }, + complete() { + if (loading) { + wx.hideLoading(); + } + }, + }); + }); +}; + +function errPicker(err) { + if (typeof err === "string") { + return err; + } + return err.data || err.msg || err.errMsg || (err.detail && err.detail.errMsg) || "未知错误"; +} diff --git a/src/app.json b/src/app.json new file mode 100644 index 0000000..3b80c50 --- /dev/null +++ b/src/app.json @@ -0,0 +1,173 @@ +{ + "$schema": "https://dldir1.qq.com/WechatWebDev/editor-extension/wx-json/app.schema.json", + "pages": [ + "pages/start/index", + "pages/index/index", + "pages/login/index", + "pages/vipLogin/index", + "pages/vipLoginReject/index", + "pages/startReject/index", + "pages/startPending/index", + "pages/story/index", + "pages/publishStoryDetail/index", + "pages/storyEnter/index", + "pages/storyEnterResult/index", + "pages/storyList/index", + "pages/storyGuide/index", + "pages/storyDetail/index", + "pages/my/index", + "pages/mySave/index", + "pages/myLive/index", + "pages/getUserInfo/index", + "pages/personalInformation/index", + "pages/changePhone/index", + "pages/changeUser/index", + "pages/cancellation/index", + "pages/family/index", + "pages/familyList/index", + "pages/familyScan/index", + "pages/thePublic/index", + "pages/privacyAgreement/index", + "pages/taskAgreement/index", + "pages/enterInfo/index", + "pages/uploadCert/index", + "pages/certReslove/index", + "pages/certPending/index", + "pages/repository/index", + "pages/repositoryDetail/index", + "pages/repositoryVideoDetail/index", + "pages/live/index", + "pages/liveDetail/index", + "pages/liveResult/index", + "pages/signIn/index", + "pages/adl/index", + "pages/adlShare/index", + "pages/adlTest/index", + "pages/adlResult/index", + "pages/smallPage/index", + "pages/hospital/index", + "pages/doctor/index", + "pages/doctorDetail/index", + "pages/drugRecord/index", + "pages/comIns/index", + "pages/webview/index", + "pages/nrdl/index", + "pages/nrdlDetail/index", + "pages/infusionCenter/index", + "pages/nrdlTable/index", + "pages/interactivePatient/index", + "pages/referral/index", + "pages/demo/index" + ], + "subpackages": [ + { + "root": "gift", + "pages": [ + "pages/giftList/index", + "pages/giftDetail/index", + "pages/conformOrder/index", + "pages/siteList/index", + "pages/siteEdit/index", + "pages/orderEnd/index", + "pages/orderDetail/index", + "pages/myGift/index", + "pages/priceDetail/index", + "pages/scoreRule/index", + "pages/dtpDurg/index", + "pages/vipCert/index", + "pages/vipReject/index", + "pages/vipPending/index", + "pages/vipStartPending/index", + "pages/myHealthRecord/index", + "pages/myHealthRecordChart/index", + "pages/cutaneous/index", + "pages/cutaneousDetail/index", + "pages/cutaneousVideo/index" + ] + }, + { + "root": "doctor", + "pages": [ + "pages/d_login/index", + "pages/d_home/index", + "pages/d_patient/index", + "pages/d_interactive/index", + "pages/d_my/index", + "pages/d_userInfo/index", + "pages/d_changePhone/index", + "pages/d_invite/index", + "pages/d_taskDetail/index", + "pages/d_taskList/index", + "pages/d_interactiveDoctor/index", + "pages/d_patientDetail/index", + "pages/d_createTask/index", + "pages/d_changeDoctor/index", + "pages/d_trans/index", + "pages/d_exportList/index", + "pages/d_customExport/index", + "pages/d_customExportMiddle/index", + "pages/d_patientList/index", + "pages/d_transfer/index", + "pages/d_transferLog/index", + "pages/d_transferDetail/index" + ] + }, + { + "root": "public", + "pages": ["pages/informedStart/index", "pages/informed/index", "pages/informedResult/index"] + }, + { + "root": "doc", + "pages": ["pages/doc1/index", "pages/doc2/index"] + }, + { + "root": "resource", + "independent": true, + "pages": [] + } + ], + "tabBar": { + "custom": true, + "list": [ + { + "pagePath": "pages/index/index", + "text": "首页" + }, + { + "pagePath": "pages/repository/index", + "text": "知识库" + }, + { + "pagePath": "pages/live/index", + "text": "会议课堂" + }, + { + "pagePath": "pages/story/index", + "text": "奇迹故事" + }, + { + "pagePath": "pages/my/index", + "text": "我的" + } + ] + }, + "window": { + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#fff", + "navigationBarTitleText": "Weixin", + "navigationBarTextStyle": "black" + }, + "sitemapLocation": "sitemap.json", + "resolveAlias": { + "@/*": "/*" + }, + "usingComponents": { + "pagination": "/components/pagination/index" + }, + "requiredPrivateInfos": ["getFuzzyLocation"], + "permission": { + "scope.userFuzzyLocation": { + "desc": "获取您的当前位置,用于模糊匹配您附近的活动" + } + } +} diff --git a/src/app.scss b/src/app.scss new file mode 100644 index 0000000..2edf2a7 --- /dev/null +++ b/src/app.scss @@ -0,0 +1,87 @@ +.page-meat { + background-repeat: no-repeat; +} +.van-tabbar { + background: rgba(255, 255, 255, 0.8); + box-shadow: 0rpx 4rpx 12rpx 0rpx rgba(0, 0, 0, 0.12); +} + +.van-tabbar-item__icon { + margin-bottom: 0 !important; +} + +.clearfix:after { + content: '020'; + display: block; + height: 0; + clear: both; + visibility: hidden; +} + +.clearfix { + /* 触发 hasLayout */ + zoom: 1; +} + +.scroll::-webkit-scrollbar { + width: 0; + height: 0; + color: transparent; +} + +.theme1 { + --name: #fff; +} + +.theme2 { + --name: #000; +} + +.van-hairline--bottom:after { + border-bottom-width: 0px !important; +} + +.extend-via-pseudo-elem { + position: relative; + overflow: visible; + &::before { + content: ''; + position: absolute; + top: -20rpx; + right: -20rpx; + bottom: -20rpx; + left: -20rpx; + } +} + +view { + word-break: break-all; +} +.mp-html { + video { + // width: 100% !important; + // object-fit: contain !important; + // max-height: 350rpx; + } +} + +.van-tabbar { + display: flex; + justify-content: space-around; + .van-tabbar-item { + } + [is='miniprogram_npm/@vant/weapp/tabbar-item/index'] { + flex: none !important; + } +} + +// .tab-item:first-of-type, +// .tab-item:last-of-type { +// .van-tabbar-item { +// width: 2em; +// } +// } + +.pre-line { + white-space: pre-line; +} diff --git a/src/app.ts b/src/app.ts new file mode 100644 index 0000000..c616f81 --- /dev/null +++ b/src/app.ts @@ -0,0 +1,643 @@ +/* eslint-disable */ +// app.ts +import { request } from './api/request' +import { parseScene } from './utils/util' +const licia = require('miniprogram-licia') + +const dayjs = require('dayjs') +require('/utils/dayjs/day-zh-cn.js') +const relativeTime = require('/utils/dayjs/relativeTime.js') +dayjs.locale('zh-cn') // 全局使用 +dayjs.extend(relativeTime) + +// page +import page from '@/utils/page' + +App({ + globalData: { + // dev + // appid:wxc3cdb3c4d4f62cea + url: 'https://m.igg4.hbraas.com', + upFileUrl: 'https://m.igg4.hbraas.com/', + imageUrl: 'https://m.igg4.hbraas.com/igg4/', + // pro + // appid:wx96f45ca4f1fa36ec + // url: 'https://m.igg4.hbsaas.com', + // upFileUrl: 'https://m.igg4.hbsaas.com/', + // imageUrl: 'https://m.igg4.hbsaas.com/igg4/', + //login + registrationSource: 0, + registChannel: 0, + regBusinessId: '', + IsAliQiWei: 0, + + scene: {}, + listeners: [], + + Timestamp: new Date().getTime(), + loginState: '', + isLogin: 0, // 0 未登录 1 已登录 + isReg: '0', + WorkerId: '', + loginType: '', // 1:患者 2:医生 + + first: true, + // anyWhere: true, + anyWhere: false, + + userInfo: {}, + DiagnoseType: [ + { + id: 1, + name: 'Ⅰ型 眼肌无力,可伴闭眼无力,其它肌群肌力正常', + }, + { + id: 2, + name: 'Ⅱa 型 主要累及四肢肌或(和)躯干肌,可有较轻的咽喉肌受累', + }, + { + id: 3, + name: 'Ⅱb 型 主要累及咽喉肌或(和)呼吸肌,可有轻度或相同的四肢肌或(和)躯干肌受累', + }, + { + id: 4, + name: 'Ⅲa 型 主要累及四肢肌或(和)躯干肌,可有较轻的咽喉肌受累', + }, + { + id: 5, + name: 'Ⅲb 型 主要累及咽喉肌或(和)呼吸肌,可有轻度或相同的四肢肌或(和)躯干肌受累', + }, + { + id: 6, + name: 'Ⅳa 型 主要累及四肢肌或(和)躯干肌受累,可有较轻的咽喉肌受累', + }, + { + id: 7, + name: 'Ⅳb 型 主要累及咽喉肌或(和)呼吸肌,可有轻度或相同的四肢肌或(和)躯干肌受累', + }, + { + id: 8, + name: 'Ⅴ型 气管插管,伴或不伴机械通气(除外术后常规使用);仅鼻饲而不进行气管插管的病例为Ⅳb 型', + }, + { + id: 9, + name: '其它', + }, + ], + storyStatus: { + 1: '已提交待审核', + 2: '审核未通过', + 3: '审核通过待校正', + 4: '校正完成', + 5: '已发布', + 100: '审核未通过', + }, + liveStatus: { + 1: '待开始', + 2: '会议中', + 3: '已结束', + 99: '取消', + 100: '已删除', + }, + activityStatus: { + 1: '待开始', + 2: '进行中', + 3: '已结束', + 99: '取消', + 100: '已删除', + }, + }, + onLaunch() { + // if (options.path) { + // this.globalData.anyWhere = true; + // } + Page = page as WechatMiniprogram.Page.Constructor + + wx.ajax = licia.curry(request)({ gUrl: this.globalData.url }) + + this.autoUpdate() + + wx.setInnerAudioOption({ + obeyMuteSwitch: false, + mixWithOther: false, + }) + }, + onShow(options) { + if (options.query.scene) { + this.globalData.anyWhere = false + this.globalData.scene = parseScene(options.query.scene) as { workerId: string } + console.log('DEBUGPRINT[317]: app.ts:129: this.globalData.scene=', this.globalData.scene) + } + this.startLogin() + }, + startLogin() { + const that = this + wx.login({ + success(res) { + wx.ajax({ + method: 'GET', + url: '?r=igg4/user/init-login', + data: { + code: res.code, + }, + }).then((res) => { + that.globalData.loginState = res.loginState + that.globalData.isReg = res.isReg + that.globalData.isLogin = res.isLogin + that.globalData.loginType = res.loginType + if (!Object.keys(that.globalData.scene)?.length) { + that.globalData.anyWhere = res.anyWhere + } + if (wx.getLaunchOptionsSync()?.query?.activity === 'NRDL') { + that.clickPush() + } + that.getUserInfo() + }) + }, + }) + }, + waitLogin({ isReg = true, loginPage = false, pub = false } = { isReg: true, loginPage: false, pub: false }) { + let time: number + const regFun = (resolve) => { + if (this.verifySys(pub)) { + if (this.globalData.loginType === 1) { + this.registrationVerification(() => resolve(), loginPage) + } else { + resolve() + } + } + } + const unRegFun = (resolve) => { + if (!this.verifySys(pub)) return + resolve() + } + return new Promise((resolve: (value?) => void) => { + if (isReg) { + if (Object.keys(this.globalData.userInfo).length) { + regFun(resolve) + return + } + time = setInterval(() => { + if (Object.keys(this.globalData.userInfo).length) { + clearInterval(time) + regFun(resolve) + } + }, 500) + return + } + this.globalData.anyWhere = true + if (this.globalData.loginState) { + unRegFun(resolve) + return + } + time = setInterval(() => { + if (this.globalData.loginState) { + clearInterval(time) + unRegFun(resolve) + } + }, 500) + }) + }, + registrationVerification(callback: () => void, loginPage = false) { + // 1-空白用户,2-注册用户,3-疾病患者,4-用药患者 + const { PatientId, AuditStatus, isFollow, UserType } = this.globalData.userInfo + const { anyWhere, first } = this.globalData + + if (loginPage || (anyWhere && first)) { + callback() + return + } + + if (UserType == 4) { + this.globalData.first = false + callback() + return + } + + if (UserType == 1) { + this.globalData.registChannel = 0 + this.globalData.first = false + wx.reLaunch({ + url: '/pages/login/index', + }) + return + } + + let urlKey = '' + if (!PatientId) { + urlKey = 'enterInfo' + } else if (AuditStatus == 0) { + urlKey = 'noCert' + } else if (AuditStatus == 1) { + urlKey = isFollow ? 'nopending' : 'pending' + } else if (AuditStatus == 2) { + urlKey = 'reject' + } + let navUrl = { + enterInfo: '/pages/enterInfo/index', + noCert: '/pages/enterInfo/index', + reject: '/pages/enterInfo/index', + pending: '/pages/enterInfo/index', + nopending: '/pages/enterInfo/index', + }[urlKey] + + if (navUrl && first) { + this.globalData.registChannel = 0 + this.globalData.first = false + wx.reLaunch({ + url: navUrl, + }) + this.globalData.first = false + return + } + + this.globalData.first = false + callback() + }, + verifySys(pub = false) { + // 1:患者 2:医生 + const { loginType, isLogin, anyWhere } = this.globalData + const pages = getCurrentPages() + const currentPage = pages[pages.length - 1] + const url = currentPage.route + const options = currentPage.options + const ignorePath = ['pages/start/index'] + + // 未登录用户 + if (!isLogin) { + // 医生端页面重定向到医生端登录页 + if (url.includes('doctor/pages')) { + wx.reLaunch({ + url: '/doctor/pages/d_login/index', + }) + return false + } + // 患者端随便看看 + if (anyWhere) { + return true + } + wx.reLaunch({ + url: '/pages/login/index', + }) + return false + } + if (ignorePath.includes(url)) return true + + if (loginType === 1) { + if (url.includes('doctor/pages')) { + wx.reLaunch({ + url: '/pages/index/index', + }) + return false + } else { + return true + } + } + if (loginType === 2 && !pub) { + if (url.includes('doctor/pages')) { + return true + } else { + const params = Object.entries(options) + .map(([key, value]) => `${key}=${value}`) + .join('&') + wx.reLaunch({ + url: '/doctor/pages/d_trans/index?path=' + encodeURIComponent(`/${url}?${params}`), + }) + return false + } + } + return true + }, + permissionVerification(grade = 1, registChannel = 0, backPage = null, regBusinessId = '') { + // 1-空白用户,2-注册用户,3-疾病患者,4-用药患者 + const { PatientId, AuditStatus, isFollow, UserType } = this.globalData.userInfo + const that = this + this.globalData.registChannel = registChannel + this.globalData.regBusinessId = regBusinessId + let isReject = false + return new Promise((resolve, reject) => { + if (grade == 2 && Number(UserType) < 2) { + wx.reLaunch({ + url: '/pages/login/index', + }) + isReject = true + } + if (grade == 3 && Number(UserType) < 3) { + if (UserType == 1) { + wx.reLaunch({ + url: '/pages/login/index', + }) + isReject = true + } + if (UserType == 2) { + let urlKey = '' + if (!PatientId) { + urlKey = 'enterInfo' + } else if (AuditStatus == 0) { + urlKey = 'noCert' + } else if (AuditStatus == 1) { + if (backPage && (backPage as string).includes('liveResult')) { + urlKey = 'liveResult' + } else { + urlKey = isFollow ? 'nopending' : 'pending' + } + } else if (AuditStatus == 2) { + urlKey = 'reject' + } + let navUrl = { + enterInfo: '/pages/enterInfo/index', + noCert: '/pages/enterInfo/index', + reject: '/pages/enterInfo/index', + pending: '/pages/enterInfo/index', + nopending: '/pages/enterInfo/index', + liveResult: backPage, + }[urlKey] + if (urlKey == 'liveResult') { + wx.navigateTo({ + url: navUrl as string, + }) + } else { + wx.reLaunch({ + url: navUrl as string, + }) + } + isReject = true + } + } + if (grade == 4 && Number(UserType) < 4) { + wx.reLaunch({ + url: '/pages/vipLogin/index', + }) + isReject = true + } + if (isReject) { + that.globalData.backPage = backPage + reject(null) + return + } + resolve(null) + }) + }, + getUserInfo(self, update = false, callback = (_userInfo) => {}) { + if (this.globalData.userInfo?.UserId && !update) { + self?.setData({ + userInfo: this.globalData.userInfo, + }) + callback(this.globalData.userInfo) + return + } + wx.ajax({ + method: 'GET', + url: '?r=igg4/account/info', + showMsg: false, + }).then((res) => { + res.UserType = res.UserType || 1 + if (res.UserType > 2) { + this.globalData.anyWhere = false + } + this.globalData.userInfo = res + this.triggerListeners() + self?.setData({ + userInfo: res, + }) + const { doctorId, inviteChan, recDoctorId: recommendDoctorId } = this.globalData.scene + if ( + doctorId && + res.InviteDoctorId != doctorId && + this.globalData.isLogin && + res.PatientId && + !recommendDoctorId + ) { + wx.ajax({ + method: 'POST', + url: '?r=igg4/account/update-doctor', + data: { + inviteDoctorId: doctorId, + inviteChannel: inviteChan, + }, + }) + } + if (recommendDoctorId && doctorId) { + wx.ajax({ + method: 'POST', + url: '?r=igg4/doctor-recommend/add-record', + data: { + recommendDoctorId: doctorId, + beRecommendDoctorId: recommendDoctorId, + }, + }) + this.globalData.scene.recDoctorId = '' + this.globalData.scene.doctorId = '' + } + callback(res) + }) + }, + mpBehavior(data: { PageName: string; doctor?: boolean }) { + let url = '?r=igg4/mp-behavior/add' + if (data.doctor) { + url = '?r=igg4/doctor/mp-behavior/add' + } + delete data.doctor + wx.ajax({ + method: 'POST', + url, + data: data, + loading: false, + showMsg: false, + }).then((res) => { + console.log('res: ', res) + }) + }, + + // 更新用户信息 + async updateUserInfo(encryptedData, iv) { + let loginState = this.globalData.loginState + const encodeEncryptedData = encodeURIComponent(encryptedData) + const encodeIv = encodeURIComponent(iv) + const { + data: { code, msg }, + } = await wx.ajax({ + method: 'POST', + url: '?r=eyecare/user/update-wx-user-info', + data: { + loginState, + encryptedData: encodeEncryptedData, + iv: encodeIv, + }, + }) + if (code !== 0) { + wx.showToast({ + duration: 1500, + title: msg, + icon: 'none', + }) + } + return code + }, + getCode() { + return new Promise((resolve) => { + wx.login({ + success: (res) => { + resolve(res.code) + }, + fail: () => { + wx.showToast({ + duration: 10000, + title: '发生错误请重试', + icon: 'none', + }) + }, + }) + }) + }, + // 微信登录 + doLogin() { + return new Promise((resolve) => { + wx.showLoading({ + title: '加载中...', + mask: true, + }) + this.getCode().then((code) => { + wx.ajax({ + url: '?r=eyecare/user/init-login', + data: { + code, + }, + }).then((res) => { + if (res.data.code === 0) { + resolve(res) + } + }) + }) + }) + }, + clickPush() { + wx.ajax({ + method: 'POST', + url: '?r=igg4/nrdl/add-push-click-record', + }) + }, + watch: function (key, method) { + var obj = this.globalData + //加个前缀生成隐藏变量,防止死循环发生 + let ori = obj[key] //obj[key]这个不能放在Object.defineProperty里 + if (ori) { + //处理已经声明的变量,绑定处理 + method(ori) + } + Object.defineProperty(obj, key, { + configurable: true, + enumerable: true, + set: function (value) { + this['_' + key] = value + console.log('是否会被执行2') + method(value) + }, + get: function () { + // 在其它界面调用key值的时候,这里就会执行。 + if (typeof this['_' + key] == 'undefined') { + if (ori) { + //这里读取数据的时候隐藏变量和 globalData设置不一样,所以要做同步处理 + this['_' + key] = ori + return ori + } else { + return undefined + } + } else { + return this['_' + key] + } + }, + }) + }, + // 注册监听器函数的方法 + registerListener: function (listener: () => {}) { + this.globalData.listeners.push(listener) + }, + // 触发监听器函数的方法 + triggerListeners: function () { + var listeners = this.globalData.listeners + for (var i = 0; i < listeners.length; i++) { + listeners[i]() + } + }, + autoUpdate: function () { + var self = this + // 获取小程序更新机制兼容 + if (wx.canIUse('getUpdateManager')) { + const updateManager = wx.getUpdateManager() + //1. 检查小程序是否有新版本发布 + updateManager.onCheckForUpdate(function (res) { + // 请求完新版本信息的回调 + if (res.hasUpdate) { + //检测到新版本,需要更新,给出提示 + wx.showModal({ + title: '更新提示', + content: '检测到新版本,是否下载新版本并重启小程序?', + success: function (res) { + if (res.confirm) { + //2. 用户确定下载更新小程序,小程序下载及更新静默进行 + self.downLoadAndUpdate(updateManager) + } else if (res.cancel) { + //用户点击取消按钮的处理,如果需要强制更新,则给出二次弹窗,如果不需要,则这里的代码都可以删掉了 + wx.showModal({ + title: '温馨提示~', + content: '本次版本更新涉及到新的功能添加,旧版本无法正常访问的哦~', + showCancel: false, //隐藏取消按钮 + confirmText: '确定更新', //只保留确定更新按钮 + success: function (res) { + if (res.confirm) { + //下载新版本,并重新应用 + self.downLoadAndUpdate(updateManager) + } + }, + }) + } + }, + }) + } + }) + } else { + // 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示 + wx.showModal({ + title: '提示', + content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。', + }) + } + }, + downLoadAndUpdate: function (updateManager) { + //静默下载更新小程序新版本 + updateManager.onUpdateReady(function () { + wx.hideLoading() + //新的版本已经下载好,调用 applyUpdate 应用新版本并重启 + updateManager.applyUpdate() + }) + updateManager.onUpdateFailed(function () { + // 新的版本下载失败 + wx.showModal({ + title: '新版本更新失败', + content: '您可删除当前小程序,重新打开尝试', + }) + }) + }, + getTheme() { + return new Promise((resolve) => { + const checkUserType = () => { + const userInfo = this.globalData.userInfo + if (userInfo.UserType) { + // resolve(userInfo.UserType >= 4 ? 'DRUG' : 'PATIENT') + resolve('PATIENT') + return true + } + return false + } + + const tryResolve = () => { + if (!checkUserType()) { + setTimeout(tryResolve, 30) + } + } + + tryResolve() + }) + }, +}) diff --git a/src/components/calendar/core.js b/src/components/calendar/core.js new file mode 100644 index 0000000..d71c4e4 --- /dev/null +++ b/src/components/calendar/core.js @@ -0,0 +1,144 @@ +import { dateUtil, getCalendarConfig } from './utils/index' + +/** + * 计算当前月份前后两月应占的格子 + * @param {number} year 年份 + * @param {number} month 月份 + */ +function calculateEmptyGrids(year, month, config) { + const prevMonthGrids = calculatePrevMonthGrids(year, month, config) + const nextMonthGrids = calculateNextMonthGrids(year, month, config) + return { + prevMonthGrids, + nextMonthGrids + } +} + +/** + * 计算上月应占的格子 + * @param {number} year 年份 + * @param {number} month 月份 + */ +function calculatePrevMonthGrids(year, month, config) { + let emptyGrids = [] + const prevMonthDays = dateUtil.getDatesCountOfMonth(year, month - 1) + let firstDayOfWeek = dateUtil.firstDayOfWeek(year, month) + if (config.firstDayOfWeek === 'Mon') { + if (firstDayOfWeek === 0) { + firstDayOfWeek = 6 + } else { + firstDayOfWeek -= 1 + } + } + if (firstDayOfWeek > 0) { + const len = prevMonthDays - firstDayOfWeek + const { onlyShowCurrentMonth } = config + const YMInfo = dateUtil.getPrevMonthInfo({ year, month }) + for (let i = prevMonthDays; i > len; i--) { + if (onlyShowCurrentMonth) { + emptyGrids.push('') + } else { + const week = dateUtil.getDayOfWeek(+year, +month, i) + emptyGrids.push({ + ...YMInfo, + date: i, + week + }) + } + } + emptyGrids.reverse() + } + return emptyGrids +} +/** + * 计算下一月日期是否需要多展示的日期 + * 某些月份日期为5排,某些月份6排,统一为6排 + * @param {number} year + * @param {number} month + * @param {object} config + */ +function calculateExtraEmptyDate(year, month, config) { + let extDate = 0 + if (+month === 2) { + extDate += 7 + let firstDayofMonth = dateUtil.getDayOfWeek(year, month, 1) + if (config.firstDayOfWeek === 'Mon') { + if (+firstDayofMonth === 1) extDate += 7 + } else { + if (+firstDayofMonth === 0) extDate += 7 + } + } else { + let firstDayofMonth = dateUtil.getDayOfWeek(year, month, 1) + if (config.firstDayOfWeek === 'Mon') { + if (firstDayofMonth !== 0 && firstDayofMonth < 6) { + extDate += 7 + } + } else { + if (firstDayofMonth <= 5) { + extDate += 7 + } + } + } + return extDate +} +/** + * 计算下月应占的格子 + * @param {number} year 年份 + * @param {number} month 月份 + */ +function calculateNextMonthGrids(year, month, config) { + let emptyGrids = [] + const datesCount = dateUtil.getDatesCountOfMonth(year, month) + let lastDayWeek = dateUtil.getDayOfWeek(year, month, datesCount) + if (config.firstDayOfWeek === 'Mon') { + if (lastDayWeek === 0) { + lastDayWeek = 6 + } else { + lastDayWeek -= 1 + } + } + let len = 7 - (lastDayWeek + 1) + const { onlyShowCurrentMonth } = config + if (!onlyShowCurrentMonth) { + len = len + calculateExtraEmptyDate(year, month, config) + } + const YMInfo = dateUtil.getNextMonthInfo({ year, month }) + for (let i = 1; i <= len; i++) { + const week = dateUtil.getDayOfWeek(+year, +month, i) + if (onlyShowCurrentMonth) { + emptyGrids.push('') + } else { + emptyGrids.push({ + id: i - 1, + ...YMInfo, + date: i, + week: week || 7 + }) + } + } + return emptyGrids +} +/** + * 设置日历面板数据 + * @param {number} year 年份 + * @param {number} month 月份 + * @param {number} curDate 日期 + */ +function calculateCurrentMonthDates(year, month) { + return dateUtil.calcDates(year, month) +} + +export function calcJumpData({ dateInfo, config, component }) { + dateInfo = dateInfo || dateUtil.todayFMD() + const { year, month, date } = dateInfo + const calendarConfig = config || getCalendarConfig(component) + const emptyGrids = calculateEmptyGrids(year, month, calendarConfig) + const calendar = { + curYear: year, + curMonth: month, + curDate: date, + dates: calculateCurrentMonthDates(year, month), + ...emptyGrids + } + return calendar +} diff --git a/src/components/calendar/helper.js b/src/components/calendar/helper.js new file mode 100644 index 0000000..981c452 --- /dev/null +++ b/src/components/calendar/helper.js @@ -0,0 +1,12 @@ +import { dateUtil } from './utils/index' + +export function calcTargetYMInfo() { + return { + right: dateUtil.getPrevMonthInfo, + left: dateUtil.getNextMonthInfo, + prev_month: dateUtil.getPrevMonthInfo, + next_month: dateUtil.getNextMonthInfo, + prev_year: dateUtil.getPrevYearInfo, + next_year: dateUtil.getNextYearInfo + } +} diff --git a/src/components/calendar/index.d.ts b/src/components/calendar/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/components/calendar/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/components/calendar/index.js b/src/components/calendar/index.js new file mode 100644 index 0000000..1d4cad6 --- /dev/null +++ b/src/components/calendar/index.js @@ -0,0 +1,258 @@ +import plugins from './plugins/index' +import { calcJumpData } from './core' +import { renderCalendar } from './render' +import { calcTargetYMInfo } from './helper' +import { dateUtil, calendarGesture, logger } from './utils/index' + +Component({ + options: { + styleIsolation: 'apply-shared', + multipleSlots: true // 在组件定义时的选项中启用多slot支持 + }, + properties: { + config: { + type: Object, + value: {} + } + }, + lifetimes: { + attached: function() { + this.initComp() + } + }, + methods: { + initComp() { + const calendarConfig = this.setDefaultDisableDate() + this.setConfig(calendarConfig) + }, + // 禁用某天日期配置默认为今天 + setDefaultDisableDate() { + const calendarConfig = this.properties.config || {} + if (calendarConfig.disableMode && !calendarConfig.disableMode.date) { + calendarConfig.disableMode.date = dateUtil.toTimeStr( + dateUtil.todayFMD() + ) + } + return calendarConfig + }, + initCalendar(config) { + const { defaultDate } = config + let date = dateUtil.todayFMD() + if (defaultDate && typeof defaultDate === 'string') { + const dateInfo = defaultDate.split('-') + if (dateInfo.length < 3) { + return logger.warn('defaultDate配置格式应为: 2018-4-2 或 2018-04-02') + } else { + date = { + year: +dateInfo[0], + month: +dateInfo[1], + date: +dateInfo[2] + } + } + } + const waitRenderData = calcJumpData({ + dateInfo: date, + config + }) + const timestamp = dateUtil.todayTimestamp() + if (config.autoChoosedWhenJump) { + const target = waitRenderData.dates.filter( + item => dateUtil.toTimeStr(item) === dateUtil.toTimeStr(date) + ) + if (target && target.length) { + if (!waitRenderData.selectedDates) { + waitRenderData.selectedDates = target + } else { + waitRenderData.selectedDates.push(target[0]) + } + } + } + return { + ...waitRenderData, + todayTimestamp: timestamp, + weeksCh: dateUtil.getWeekHeader(config.firstDayOfWeek) + } + }, + setConfig(config) { + if (config.markToday && typeof config.markToday === 'string') { + config.highlightToday = true + } + config.theme = config.theme || 'default' + this.setData( + { + config + }, + () => { + for (let plugin of plugins.installed) { + const [, p] = plugin + if (typeof p.install === 'function') { + p.install(this) + } + if (typeof p.methods === 'function') { + const methods = p.methods(this) + for (let fnName in methods) { + if (fnName.startsWith('__')) continue + const fn = methods[fnName] + if (typeof fn === 'function') { + if (!this.calendar) this.calendar = {} + this.calendar[fnName] = fn + } + } + } + } + const initData = this.initCalendar(config) + renderCalendar.call(this, initData, config) + } + ) + }, + tapDate(e) { + const { info } = e.currentTarget.dataset + const { date, disable } = info || {} + if (disable || !date) return + const { calendar, config } = this.data + let calendarData = calendar + let calendarConfig = config + if (config.takeoverTap) { + return this.triggerEvent('takeoverTap', info) + } + for (let plugin of plugins.installed) { + const [, p] = plugin + if (typeof p.onTapDate === 'function') { + const { + calendarData: __calendarData, + calendarConfig: __calendarConfig + } = p.onTapDate(info, calendarData, calendarConfig) + calendarData = __calendarData + calendarConfig = __calendarConfig + } + } + renderCalendar.call(this, calendarData, calendarConfig).then(() => { + this.triggerEvent('afterTapDate', info) + }) + }, + /** + * 日历滑动开始 + * @param {object} e + */ + calendarTouchstart(e) { + const t = e.touches[0] + const startX = t.clientX + const startY = t.clientY + this.swipeLock = true + this.setData({ + 'gesture.startX': startX, + 'gesture.startY': startY + }) + }, + /** + * 日历滑动中 + * @param {object} e + */ + calendarTouchmove(e) { + const { gesture } = this.data + const { preventSwipe } = this.properties.config + if (!this.swipeLock || preventSwipe) return + if (calendarGesture.isLeft(gesture, e.touches[0])) { + this.handleSwipe('left') + this.swipeLock = false + } + if (calendarGesture.isRight(gesture, e.touches[0])) { + this.handleSwipe('right') + this.swipeLock = false + } + }, + calendarTouchend(e) { + this.setData({ + 'calendar.leftSwipe': 0, + 'calendar.rightSwipe': 0 + }) + }, + handleSwipe(direction) { + let swipeKey = 'calendar.leftSwipe' + if (direction === 'right') { + swipeKey = 'calendar.rightSwipe' + } + this.setData({ + [swipeKey]: 1 + }) + const { calendar } = this.data + let calendarData = calendar + const { curYear, curMonth } = calendarData + const getMonthInfo = calcTargetYMInfo()[direction] + const target = getMonthInfo({ + year: +curYear, + month: +curMonth + }) + target.direction = direction + this.renderCalendar(target) + }, + changeDate(e) { + const { type } = e.currentTarget.dataset + const { calendar: calendarData } = this.data + const { curYear, curMonth } = calendarData + const getMonthInfo = calcTargetYMInfo()[type] + const target = getMonthInfo({ + year: +curYear, + month: +curMonth + }) + target.direction = type + this.renderCalendar(target) + }, + renderCalendar(target) { + let { calendar: calendarData, config } = this.data + const { curYear, curMonth } = calendarData || {} + for (let plugin of plugins.installed) { + const [, p] = plugin + if (typeof p.onSwitchCalendar === 'function') { + calendarData = p.onSwitchCalendar(target, calendarData, this) + } + } + return renderCalendar.call(this, calendarData, config).then(() => { + let triggerEventName = 'whenChangeMonth' + if (config.weekMode) { + triggerEventName = 'whenChangeWeek' + } + this.triggerEvent(triggerEventName, { + current: { + year: +curYear, + month: +curMonth + }, + next: target + }) + this.triggerEvent('onSwipe', { + current: { + year: +curYear, + month: +curMonth + }, + next: target, + type: triggerEventName + }) + }) + }, + doubleClickJumpToToday() { + const { multi, weekMode } = this.calendar.getCalendarConfig() || {} + if (multi || weekMode) return + if (this.count === undefined) { + this.count = 1 + } else { + this.count += 1 + } + if (this.lastClick) { + const difference = new Date().getTime() - this.lastClick + if ( + difference < 500 && + this.count >= 2 && + typeof this.calendar.jump === 'function' + ) { + const today = dateUtil.todayFMD() + this.calendar.jump(today) + } + this.count = undefined + this.lastClick = undefined + } else { + this.lastClick = new Date().getTime() + } + this.triggerEvent('jumpToToday') + } + } +}) diff --git a/src/components/calendar/index.json b/src/components/calendar/index.json new file mode 100644 index 0000000..32640e0 --- /dev/null +++ b/src/components/calendar/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} \ No newline at end of file diff --git a/src/components/calendar/index.wxml b/src/components/calendar/index.wxml new file mode 100644 index 0000000..3bf1244 --- /dev/null +++ b/src/components/calendar/index.wxml @@ -0,0 +1,116 @@ + + + + + + + + + {{calendar.curYear || "--"}} 年 {{calendar.curMonth || "--"}} 月 + + + + + + + + + {{item}} + + + + + + + + + {{item.date}} + + + + + + + + {{config.markToday && item.isToday ? config.markToday : item.date}} + + {{item.label || item.lunar.Term || item.lunar.IDayCn}} + + + + {{item.todoText}} + + + + + + + + + + {{item.date}} + + + + + + diff --git a/src/components/calendar/index.wxss b/src/components/calendar/index.wxss new file mode 100644 index 0000000..4264f01 --- /dev/null +++ b/src/components/calendar/index.wxss @@ -0,0 +1,247 @@ +@import "./theme/iconfont.wxss"; +@import "./theme/theme-default.wxss"; +@import "./theme/theme-elegant.wxss"; +@import "./theme/theme-nuohe.wxss"; + +.blod { + font-weight: bold; +} + +.b { + display: flex; +} + +.lr { + flex-direction: row; +} + +.tb { + flex-direction: column; +} + +.pc { + justify-content: center; +} + +.ac { + align-items: center; +} + +.cc { + align-items: center; + justify-content: center; +} + +.wrap { + flex-wrap: wrap; +} + +.flex { + flex-grow: 1; +} + +.bg { + background-image: linear-gradient(to bottom, #faefe7, #ffcbd7); + overflow: hidden; +} + +.white-color { + color: #fff; +} + +.fs24 { + font-size: 24rpx; +} + +.fs28 { + font-size: 28rpx; +} + +.fs32 { + font-size: 32rpx; +} + +.fs36 { + font-size: 36rpx; +} + +.calendar { + width: 100%; + box-sizing: border-box; +} + +/* 日历操作栏 */ + +.handle { + height: 80rpx; +} + +.prev-handle, +.next-handle { + padding: 20rpx; +} + +.date-in-handle { + height: 80rpx; +} + +/* 星期栏 */ + +.weeks { + height: 50rpx; + line-height: 50rpx; + opacity: 0.5; +} + +.week { + text-align: center; +} + +.grid, +.week { + width: 14.286014285714286%; +} + +.date-wrap { + width: 100%; + height: 80rpx; + position: relative; + left: 0; + top: 0; +} + +.date { + position: relative; + left: 0; + top: 0; + width: 55rpx; + height: 55rpx; + text-align: center; + line-height: 55rpx; + font-size: 28rpx; + font-weight: 200; + border-radius: 50%; + transition: all 0.3s; + font-weight: bold; + + animation-name: choosed; + + animation-duration: 0.5s; + + animation-timing-function: linear; + + animation-iteration-count: 1; +} + +.date-area-mode { + width: 100%; + + border-radius: 0; +} + +.date-desc { + width: 150%; + + height: 32rpx; + + font-size: 20rpx; + + line-height: 32rpx; + + position: absolute; + + left: 50%; + + transform: translateX(-50%); + + overflow: hidden; + + word-break: break-all; + + text-overflow: ellipsis; + + white-space: nowrap; + + -webkit-line-clamp: 1; + + text-align: center; +} + +@keyframes choosed { + from { + transform: scale(1); + } + + 50% { + transform: scale(0.9); + } + + to { + transform: scale(1); + } +} + +/* 日期圆圈标记 */ + +.todo-circle { + border-width: 1rpx; + + border-style: solid; + + box-sizing: border-box; +} + +/* 待办点标记相关样式 */ + +.todo-dot { + width: 16rpx; + + height: 16rpx; + + border-radius: 50%; + + position: absolute; + + left: 50%; + bottom: -10rpx !important; + + transform: translateX(-50%); +} + +.todo-dot-top { + top: 3rpx; +} + +.todo-dot.todo-dot-top-always { + top: -8rpx; +} + +.todo-dot.todo-dot-bottom { + bottom: 0; +} + +.todo-dot.todo-dot-bottom-always { + bottom: -10rpx; +} + +/* 日期描述文字(待办文字/农历)相关样式 */ + +.date-desc.date-desc-top { + top: -6rpx; +} + +.date-desc.date-desc-top-always { + top: -20rpx; +} + +.date-desc.date-desc-bottom { + bottom: -14rpx; +} + +.todo-circle .date-desc.date-desc-bottom { + bottom: -30rpx; +} + +.date-desc.date-desc-bottom-always { + bottom: -28rpx; +} diff --git a/src/components/calendar/plugins/holidays/holidays-map.js b/src/components/calendar/plugins/holidays/holidays-map.js new file mode 100644 index 0000000..0bc5e04 --- /dev/null +++ b/src/components/calendar/plugins/holidays/holidays-map.js @@ -0,0 +1,212 @@ +/* * + @Author: drfu* + @Description: 数据来源于国务院办公厅关于2020年部分节假日安排的通知(国办发明电〔2019〕16号)_政府信息公开专栏,http://www.gov.cn/zhengce/content/2019-11/21/content_5454164.htm + @Date: 2020-10-12 14:29:45* + * @Last Modified by: drfu + * @Last Modified time: 2020-10-16 17:38:08 +*/ + +// 节日列表 +export const festival = { + // 农历固定日期节日 + lunar: { + 1: { + 1: { + type: 'festival', + name: '春节', + label: '春节' + }, + 8: { + type: 'festival', + name: '腊八节', + label: '腊八' + }, + 15: { + type: 'festival', + name: '元宵节', + label: '元宵' + } + }, + 7: { + 7: { + type: 'festival', + name: '七夕节', + label: '七夕' + }, + 15: { + type: 'festival', + name: '中元节', + label: '中元节' + } + }, + 9: { + 9: { + type: 'festival', + name: '重阳节', + label: '重阳节' + } + } + }, + // 阳历固定日期节日 + solar: { + 2: { + 14: { + type: 'festival', + name: '情人节', + label: '情人节' + } + }, + 3: { + 12: { + type: 'festival', + name: '植树节', + label: '植树节' + } + }, + 4: { + 1: { + type: 'festival', + name: '愚人节', + label: '愚人节' + }, + 5: { + type: 'festival', + name: '清明节', + label: '清明节' + } + }, + 5: { + 1: { + type: 'festival', + name: '劳动节', + label: '劳动节' + } + }, + 6: { + 1: { + type: 'festival', + name: '儿童节', + label: '儿童节' + } + }, + 7: { + 1: { + type: 'festival', + name: '建党节', + label: '建党节' + } + }, + 8: { + 1: { + type: 'festival', + name: '建军节', + label: '建军节' + } + }, + 9: { + 10: { + type: 'festival', + name: '教师节', + label: '教师节' + } + }, + 10: { + 1: { + type: 'festival', + name: '国庆节', + label: '国庆节' + } + }, + 12: { + 25: { + type: 'festival', + name: '圣诞节', + label: '圣诞节' + } + } + } +} + +export const holidays = { + 2020: { + 1: { + 1: { + type: 'holiday', + name: '元旦', + label: '休' + }, + 19: { + type: 'work', + name: '调班', + label: '班' + }, + '24-30': { + type: 'holiday', + name: '春节', + label: '休' + } + }, + 2: { + 1: { + type: 'work', + name: '调班', + label: '班' + } + }, + 4: { + '4-6': { + type: 'holiday', + name: '清明节', + label: '休' + }, + 26: { + type: 'work', + name: '调班', + label: '班' + } + }, + 5: { + '1-5': { + type: 'holiday', + name: '劳动节', + label: '休' + }, + 9: { + type: 'work', + name: '调班', + label: '班' + } + }, + 6: { + '25-27': { + type: 'holiday', + name: '端午节', + label: '休' + }, + 28: { + type: 'work', + name: '调班', + label: '班' + } + }, + 9: { + 27: { + type: 'work', + name: '调班', + label: '班' + } + }, + 10: { + '1-8': { + type: 'holiday', + name: '国庆节/中秋节', + label: '休' + }, + 10: { + type: 'work', + name: '调班', + label: '班' + } + } + } +} diff --git a/src/components/calendar/plugins/holidays/index.d.ts b/src/components/calendar/plugins/holidays/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/components/calendar/plugins/holidays/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/components/calendar/plugins/holidays/index.js b/src/components/calendar/plugins/holidays/index.js new file mode 100644 index 0000000..ee4ae77 --- /dev/null +++ b/src/components/calendar/plugins/holidays/index.js @@ -0,0 +1,201 @@ +/* * + @Author: drfu* + @Description: 显示法定节假日班/休情况 + @Date: 2020-10-12 14:29:45* + * @Last Modified by: drfu + * @Last Modified time: 2020-10-16 17:34:13 +*/ + +import { holidays, festival } from './holidays-map' +import { dateUtil, getCalendarData, logger } from '../../utils/index' + +/** + * 当前是否在休假期内 + * @param {object} { year, month } + * @param {object} { start, end, current } + * @returns + */ +function inHolidays({ year, month }, { start, end, current }) { + const getTimeStamp = dateUtil.getTimeStamp + const startTimestamp = getTimeStamp({ + year, + month, + date: start + }) + const endTimestamp = getTimeStamp({ + year, + month, + date: end + }) + const currentDateTimestamp = getTimeStamp({ + year, + month, + date: current + }) + if ( + currentDateTimestamp >= startTimestamp && + currentDateTimestamp <= endTimestamp + ) { + return true + } + return false +} + +function addSpecialFestival(date, component) { + const { convertlLunar2Solar, convertSolarLunar } = component.calendar || {} + const lunarDateInfo = convertSolarLunar(date) + const { lYear, lMonth } = lunarDateInfo || {} + // 春节 + const info = { + type: 'festival', + name: '除夕', + label: '除夕' + } + if (lMonth === 12) { + if (!festival.lunar['12']) festival.lunar['12'] = {} + if (convertlLunar2Solar(`${lYear}-12-30`) === -1) { + festival.lunar['12']['29'] = info + } else { + festival.lunar['12']['30'] = info + } + } +} + +/** + * 是否匹配到节日 + * @param {object} [dateInfo={}] + * @param {object} [component={}] + * @returns {object|boolean} 匹配到的节日数据或者false + */ +function hasFestivalDate(dateInfo = {}, component = {}) { + const { month, date } = dateInfo + let festivalDate = festival.solar[month] && festival.solar[month][date] + if (!festivalDate) { + const { convertSolarLunar } = component.calendar || {} + const lunarDateInfo = convertSolarLunar(dateInfo) + const { lMonth, lDay } = lunarDateInfo + festivalDate = festival.lunar[lMonth] && festival.lunar[lMonth][lDay] + if (!festivalDate) { + const festivalOfMonth = festival.lunar[lMonth] || {} + const festivalDateKey = Object.keys(festivalOfMonth).find(item => + item.match(new RegExp(`\\b${lDay}\\b`)) + ) + if (!festivalDateKey) { + festivalDate = false + } else { + const festivalInfo = festival.lunar[lMonth][festivalDateKey] + if (!festivalInfo) { + festivalDate = false + } else { + const { condition } = festivalInfo + if (typeof condition === 'function') { + festivalDate = condition(lunarDateInfo) + } else { + festivalDate = false + } + } + } + } + } + return festivalDate +} + +export default () => { + return { + name: 'holidays', + beforeRender(calendarData = {}, calendarConfig = {}, component) { + let { dates = [] } = calendarData + if (calendarConfig.showHolidays || calendarConfig.showFestival) { + dates = dates.map(d => { + let item = { ...d } + const { year, month, date } = item + const holidaysOfMonth = + (holidays[year] && holidays[year][month]) || {} + const holidayDate = holidaysOfMonth[date] + if (holidayDate) { + item = { + ...item, + ...holidayDate + } + } else { + const holidayKeys = Object.keys(holidaysOfMonth).filter(item => + item.includes('-') + ) + let target = '' + for (let v of holidayKeys) { + const [start, end] = v.split('-') + if (+d.date >= +start && +d.date <= +end) { + target = v + break + } + } + const [start, end] = target.split('-') + const isInHolidays = inHolidays( + { + year, + month + }, + { + start, + end, + current: date + } + ) + if (isInHolidays) { + item = { + ...item, + ...holidaysOfMonth[target] + } + } else if (calendarConfig.showFestival) { + const { convertSolarLunar, convertlLunar2Solar } = + component.calendar || {} + if ( + typeof convertSolarLunar !== 'function' || + typeof convertlLunar2Solar !== 'function' + ) { + return logger.warn( + '农历节日显示需要引入农历插件(/component/v2/plugins/solarLunar)' + ) + } + addSpecialFestival(item, component) + const festivalDate = hasFestivalDate(item, component) + if (festivalDate) { + item = { + ...item, + ...festivalDate + } + } + } + } + return item + }) + } + return { + calendarData: { + ...calendarData, + dates: dates + }, + calendarConfig + } + }, + methods(component) { + return { + getHolidaysOfCurrentYear() { + const calendar = getCalendarData('calendar', component) + const { curYear } = calendar + return this.methods(component).getHolidaysOfYear(curYear) + }, + getHolidaysOfYear(year) { + if (!year) return logger.warn('getHolidaysOfCurrentYear() 入参错误') + if (!holidays[year]) { + logger.warn('未匹配到当前年份节假日信息,请自行补充') + return { + err: 'not match' + } + } + return holidays[year] + } + } + } + } +} diff --git a/src/components/calendar/plugins/index.d.ts b/src/components/calendar/plugins/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/components/calendar/plugins/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/components/calendar/plugins/index.js b/src/components/calendar/plugins/index.js new file mode 100644 index 0000000..238425d --- /dev/null +++ b/src/components/calendar/plugins/index.js @@ -0,0 +1,18 @@ +import preset from './preset/index' + +export default { + installed: [...preset], + use(plugin) { + if (typeof plugin !== 'function') return + const info = plugin() || {} + const { name } = info + if ( + name && + name !== 'methods' && + !this.installed.some(p => p[0] === name) + ) { + this.installed.unshift([name, info]) + } + return this + } +} diff --git a/src/components/calendar/plugins/preset/base.js b/src/components/calendar/plugins/preset/base.js new file mode 100644 index 0000000..3be7d51 --- /dev/null +++ b/src/components/calendar/plugins/preset/base.js @@ -0,0 +1,277 @@ +/** + * @Author: drfu* + * @Description: 基础功能 + * @Date: 2020-10-08 21:22:09* + * @Last Modified by: drfu + * @Last Modified time: 2020-10-11 13:28:52 + * */ + +import { calcJumpData } from '../../core' +import { renderCalendar } from '../../render' +import { + dateUtil, + getCalendarData, + setCalendarData, + getCalendarConfig +} from '../../utils/index' + +export default () => { + return { + name: 'base', + beforeRender(calendarData = {}, calendarConfig) { + const calendar = calendarData + const { selectedDates = [], dates } = calendar + let _dates = [...dates] + if (selectedDates.length) { + const selectedDatesStr = selectedDates.map(date => + dateUtil.toTimeStr(date) + ) + _dates.forEach(date => { + const dateStr = dateUtil.toTimeStr(date) + if (selectedDatesStr.includes(dateStr)) { + date.choosed = true + } + }) + } + return { + calendarData: { + ...calendarData, + dates: _dates + }, + calendarConfig + } + }, + onTapDate(tapedDate, calendarData = {}, calendarConfig = {}) { + const calendar = { + ...calendarData + } + const dateIndex = dateUtil.findDateIndexInArray( + tapedDate, + calendarData.dates + ) + const { multi, inverse } = calendarConfig + let dates = [...calendar.dates] + const { selectedDates = [] } = calendar + if (!multi) { + let preSelectedDate = {} + if (selectedDates.length) { + preSelectedDate = [...selectedDates].pop() || {} + } + const timeStr = dateUtil.toTimeStr + if (!inverse && timeStr(preSelectedDate) === timeStr(tapedDate)) { + return calendar + } + let _tapedDate = { ...tapedDate, choosed: !tapedDate.choosed } + + dates[dateIndex] = _tapedDate + if (preSelectedDate.date) { + const idx = dateUtil.findDateIndexInArray(preSelectedDate, dates) + const date = dates[idx] + if (date) { + date.choosed = false + } + } + if (dates[dateIndex].choosed) { + calendar.selectedDates = [dates[dateIndex]] + } else { + calendar.selectedDates = [] + } + } else { + dates[dateIndex] = { + ...dates[dateIndex], + choosed: !dates[dateIndex].choosed + } + if (!calendar.selectedDates) { + calendar.selectedDates = [] + } + if (dates[dateIndex].choosed) { + calendar.selectedDates.push(dates[dateIndex]) + } else { + calendar.selectedDates = calendar.selectedDates.filter( + date => + dateUtil.toTimeStr(date) !== dateUtil.toTimeStr(dates[dateIndex]) + ) + } + } + return { + calendarData: { + ...calendar, + dates + }, + calendarConfig + } + }, + onSwitchCalendar(date, calendarData = {}, component) { + const calendarConfig = getCalendarConfig(component) + if (calendarConfig.weekMode) { + return calendarData + } + const updatedRenderData = calcJumpData({ + dateInfo: date, + config: calendarConfig + }) + return { + ...calendarData, + ...updatedRenderData + } + }, + methods(component) { + return { + jump: dateInfo => { + if (Object.prototype.toString.call(dateInfo) !== '[object Object]') + return + const updatedRenderData = calcJumpData({ + dateInfo, + component + }) + const existCalendarData = getCalendarData('calendar', component) + const config = getCalendarConfig(component) + if (config.autoChoosedWhenJump) { + const target = updatedRenderData.dates[dateInfo.date - 1] + if (!updatedRenderData.selectedDates) { + updatedRenderData.selectedDates = [target] + } else { + updatedRenderData.selectedDates.push(target) + } + } + return renderCalendar.call(component, { + ...existCalendarData, + ...updatedRenderData + }) + }, + getCalendarConfig() { + return getCalendarConfig(component) + }, + setCalendarConfig(config) { + return new Promise((resolve, reject) => { + if (!component || !component.data.config) { + reject('异常:未找到组件配置信息') + return + } + let conf = { ...component.config, ...config } + component.config = conf + setCalendarData({ config: conf }, component) + .then(resolve) + .catch(reject) + }) + }, + cancelSelectedDates(cancelDates = []) { + const existCalendarData = getCalendarData('calendar', component) || {} + const { dates = [], selectedDates = [] } = existCalendarData + let updatedRenderData = {} + const config = getCalendarConfig(component) + let chooseAreaData = {} + if (config.chooseAreaMode) { + chooseAreaData = { + chooseAreaTimestamp: [], + tempChooseAreaTimestamp: [] + } + } + if (!cancelDates.length) { + dates.forEach(item => { + item.choosed = false + }) + updatedRenderData = { + dates, + selectedDates: [] + } + } else { + const cancelDatesStr = cancelDates.map(date => + dateUtil.toTimeStr(date) + ) + const filterSelectedDates = selectedDates.filter( + date => !cancelDatesStr.includes(dateUtil.toTimeStr(date)) + ) + dates.forEach(date => { + if (cancelDatesStr.includes(dateUtil.toTimeStr(date))) { + date.choosed = false + } + }) + updatedRenderData = { + dates, + selectedDates: filterSelectedDates + } + } + + return renderCalendar.call(component, { + ...existCalendarData, + ...updatedRenderData, + ...chooseAreaData + }) + }, + setSelectedDates: targetDates => { + const existCalendarData = getCalendarData('calendar', component) + let { dates, selectedDates = [] } = existCalendarData || {} + let __selectedDates = [] + let __dates = dates + if (!targetDates) { + __dates = dates.map(item => { + const date = { ...item } + date.choosed = true + if (existCalendarData.showLabelAlways && date.showTodoLabel) { + date.showTodoLabel = true + } else { + date.showTodoLabel = false + } + return date + }) + __selectedDates = dates + } else if (targetDates && targetDates.length) { + const allSelected = dateUtil.uniqueArrayByDate( + selectedDates.concat(targetDates) + ) + const allSelectedDateStr = allSelected.map(d => + dateUtil.toTimeStr(d) + ) + __dates = dates.map(item => { + const date = { ...item } + if (allSelectedDateStr.includes(dateUtil.toTimeStr(date))) { + date.choosed = true + __selectedDates.push(date) + } + if (existCalendarData.showLabelAlways && date.showTodoLabel) { + date.showTodoLabel = true + } else { + date.showTodoLabel = false + } + return date + }) + } + return renderCalendar.call(component, { + ...existCalendarData, + dates: __dates, + selectedDates: __selectedDates + }) + }, + setDateStyle: toSetDates => { + if (!Array.isArray(toSetDates)) return Promise.reject() + const existCalendarData = getCalendarData('calendar', component) + const { dates = [], specialStyleDates } = existCalendarData || {} + if (Array.isArray(specialStyleDates)) { + toSetDates = dateUtil.uniqueArrayByDate([ + ...specialStyleDates, + ...toSetDates + ]) + } + const toSetDatesStr = toSetDates.map(item => dateUtil.toTimeStr(item)) + const _dates = dates.map(item => { + const idx = toSetDatesStr.indexOf(dateUtil.toTimeStr(item)) + if (idx > -1) { + return { + ...item, + class: toSetDates[idx].class + } + } else { + return item + } + }) + return renderCalendar.call(component, { + ...existCalendarData, + dates: _dates, + specialStyleDates: toSetDates + }) + } + } + } + } +} diff --git a/src/components/calendar/plugins/preset/get-calendar-data.js b/src/components/calendar/plugins/preset/get-calendar-data.js new file mode 100644 index 0000000..463082a --- /dev/null +++ b/src/components/calendar/plugins/preset/get-calendar-data.js @@ -0,0 +1,69 @@ +/** + * @Author: drfu* + * @Description: 获取日历数据 + * @Date: 2020-10-08 21:22:09* + * @Last Modified by: drfu + * @Last Modified time: 2020-10-11 13:42:37 + * */ + +import { getCalendarData, logger, getCalendarConfig } from '../../utils/index' + +function wrapDateWithLunar(dates = [], convertFn) { + const datesWithLunar = JSON.parse(JSON.stringify(dates)).map(date => ({ + ...date, + lunar: convertFn(date) + })) + return datesWithLunar +} + +export default () => { + return { + name: 'getData', + methods(component) { + return { + getCurrentYM: () => { + const { curYear, curMonth } = getCalendarData('calendar', component) + return { + year: curYear, + month: curMonth + } + }, + getSelectedDates: (options = {}) => { + const dates = + getCalendarData('calendar.selectedDates', component) || [] + const config = getCalendarConfig(component) || {} + if (options.lunar && !config.showLunar) { + const injectedFns = component.calendar || {} + if (typeof injectedFns.convertSolarLunar === 'function') { + return wrapDateWithLunar(dates, injectedFns.convertSolarLunar) + } else { + logger.warn('获取农历信息需引入农历插件') + } + } else { + return dates + } + }, + getCalendarDates: (options = {}) => { + const config = getCalendarConfig(component) || {} + const dates = getCalendarData('calendar.dates', component) + if (options.lunar && !config.showLunar) { + const injectedFns = component.calendar || {} + if (typeof injectedFns.convertSolarLunar === 'function') { + return wrapDateWithLunar(dates, injectedFns.convertSolarLunar) + } else { + logger.warn('获取农历信息需引入农历插件') + } + } else { + return dates + } + }, + getCalendarAllData: () => { + return { + data: getCalendarData('calendar', component) || {}, + config: getCalendarConfig(component) || {} + } + } + } + } + } +} diff --git a/src/components/calendar/plugins/preset/index.d.ts b/src/components/calendar/plugins/preset/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/components/calendar/plugins/preset/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/components/calendar/plugins/preset/index.js b/src/components/calendar/plugins/preset/index.js new file mode 100644 index 0000000..70cde39 --- /dev/null +++ b/src/components/calendar/plugins/preset/index.js @@ -0,0 +1,9 @@ +import base from './base' +import getCalendarData from './get-calendar-data' + +const preset = [ + ['base', base()], + ['get-calendar-data', getCalendarData()] +] + +export default preset diff --git a/src/components/calendar/plugins/selectable.d.ts b/src/components/calendar/plugins/selectable.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/components/calendar/plugins/selectable.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/components/calendar/plugins/selectable.js b/src/components/calendar/plugins/selectable.js new file mode 100644 index 0000000..3734983 --- /dev/null +++ b/src/components/calendar/plugins/selectable.js @@ -0,0 +1,221 @@ +/** + * @Author: drfu* + * @Description: 禁用、启用日期选择 + * @Date: 2020-10-08 21:22:09* + * @Last Modified by: drfu + * @Last Modified time: 2020-10-08 21:25:00 + * */ + +import { getCalendarData, dateUtil, logger } from '../utils/index' +import { renderCalendar } from '../render' + +function convertEnableAreaToTimestamp(timearea = []) { + const start = timearea[0].split('-') + const end = timearea[1].split('-') + if (start.length !== 3 || end.length !== 3) { + logger.warn('enableArea() 参数格式为: ["2018-2-1", "2018-3-1"]') + return {} + } + const startTimestamp = dateUtil + .newDate(start[0], start[1], start[2]) + .getTime() + const endTimestamp = dateUtil.newDate(end[0], end[1], end[2]).getTime() + return { + start, + end, + startTimestamp, + endTimestamp + } +} + +function isValiditeOfDateArea(dateArea) { + const { + start, + end, + startTimestamp, + endTimestamp + } = convertEnableAreaToTimestamp(dateArea) + if (!start || !end) return + const datesCountOfStart = dateUtil.getDatesCountOfMonth(start[0], start[1]) + const datesCountOfEnd = dateUtil.getDatesCountOfMonth(end[0], end[1]) + if (start[2] > datesCountOfStart || start[2] < 1) { + logger.warn('enableArea() 开始日期错误,指定日期不在指定月份天数范围内') + return false + } else if (start[1] > 12 || start[1] < 1) { + logger.warn('enableArea() 开始日期错误,月份超出1-12月份') + return false + } else if (end[2] > datesCountOfEnd || end[2] < 1) { + logger.warn('enableArea() 截止日期错误,指定日期不在指定月份天数范围内') + return false + } else if (end[1] > 12 || end[1] < 1) { + logger.warn('enableArea() 截止日期错误,月份超出1-12月份') + return false + } else if (startTimestamp > endTimestamp) { + logger.warn('enableArea()参数最小日期大于了最大日期') + return false + } else { + return true + } +} + +function handleDisableMode(calendarConfig) { + const { disableMode } = calendarConfig + if (!disableMode) return {} + const disableBound = + dateUtil.getTimeStamp(disableMode.date) || dateUtil.todayTimestamp() + return { + disableBound, + disableType: disableMode.type + } +} + +function disabledByConfig(dateInfo, currentDate, calendarConfig) { + const date = { ...dateInfo } + const { disableType, disableBound } = handleDisableMode(calendarConfig) + if ( + (disableType === 'before' && disableBound && currentDate < disableBound) || + (disableType === 'after' && disableBound && currentDate > disableBound) + ) { + date.disable = true + } else { + date.disable = false + } + return date +} + +export default () => { + return { + name: 'enable', + beforeRender(calendarData = {}, calendarConfig = {}) { + const { + dates, + enableArea, + enableDates, + disableDates, + renderCausedBy + } = calendarData + const _dates = [...dates].map(date => { + let item = { ...date } + const timeStr = dateUtil.toTimeStr(date) + const timestamp = +dateUtil.getTimeStamp(item) + if (renderCausedBy === 'enableDates') { + if (enableDates && enableDates.length) { + if (enableDates.includes(timeStr)) { + item.disable = false + } else { + item.disable = true + } + return item + } + } else if (renderCausedBy === 'enableArea') { + if (enableArea && enableArea.length) { + const [startTimestamp, endTimestamp] = enableArea || [] + const ifOutofArea = + +startTimestamp > timestamp || timestamp > +endTimestamp + item.disable = ifOutofArea + return item + } + } else if (renderCausedBy === 'disableDates') { + if (disableDates && disableDates.length) { + if (disableDates && disableDates.includes(timeStr)) { + item.disable = true + } else { + item.disable = false + } + return item + } + } + return disabledByConfig(item, timestamp, calendarConfig) + }) + + return { + calendarData: { + ...calendarData, + dates: _dates + }, + calendarConfig + } + }, + methods(component) { + return { + enableArea: (dateArea = []) => { + if (dateArea.length === 2) { + const validate = isValiditeOfDateArea(dateArea) + if (validate) { + const existCalendarData = getCalendarData('calendar', component) + const { + startTimestamp, + endTimestamp + } = convertEnableAreaToTimestamp(dateArea) + + return renderCalendar.call(component, { + ...existCalendarData, + renderCausedBy: 'enableArea', + enableArea: [startTimestamp, endTimestamp] + }) + } + } else { + return Promise.inject( + 'enableArea()参数需为时间范围数组,形如:["2018-8-4" , "2018-8-24"]' + ) + } + }, + enableDates: (toSet = []) => { + if (!toSet.length) return + const existCalendarData = getCalendarData('calendar', component) + const { enableDates = [] } = existCalendarData || {} + let toSetDates = toSet.map(item => { + if (typeof item === 'string') { + return dateUtil.transformDateRow2Dict(item) + } + return item + }) + if (enableDates.length) { + toSetDates = dateUtil.uniqueArrayByDate([ + ...toSetDates, + ...enableDates.map(d => dateUtil.transformDateRow2Dict(d)) + ]) + } + return renderCalendar.call(component, { + ...existCalendarData, + renderCausedBy: 'enableDates', + enableDates: toSetDates.map(date => { + if (typeof date !== 'string') { + return dateUtil.toTimeStr(date) + } + return date + }) + }) + }, + disableDates: toSet => { + const existCalendarData = getCalendarData('calendar', component) + const { disableDates = [], dates = [] } = existCalendarData || {} + let toSetDates = toSet.map(item => { + let date = { ...item } + if (typeof date === 'string') { + return dateUtil.transformDateRow2Dict(item) + } + return item + }) + if (disableDates && disableDates.length) { + toSetDates = dateUtil.uniqueArrayByDate([ + ...toSetDates, + ...disableDates.map(d => dateUtil.transformDateRow2Dict(d)) + ]) + } + return renderCalendar.call(component, { + ...existCalendarData, + renderCausedBy: 'disableDates', + dates, + disableDates: toSetDates.map(date => { + if (typeof date !== 'string') { + return dateUtil.toTimeStr(date) + } + return date + }) + }) + } + } + } + } +} diff --git a/src/components/calendar/plugins/solarLunar/convertSolarLunar.js b/src/components/calendar/plugins/solarLunar/convertSolarLunar.js new file mode 100644 index 0000000..4ee3d8e --- /dev/null +++ b/src/components/calendar/plugins/solarLunar/convertSolarLunar.js @@ -0,0 +1,1036 @@ +/** + * @1900-2100区间内的公历、农历互转 + * @Version 1.0.3 + * @公历转农历:calendar.solar2lunar(1987,11,01); //[you can ignore params of prefix 0] + * @农历转公历:calendar.lunar2solar(1987,09,10); //[you can ignore params of prefix 0] + */ +/* 公历年月日转农历数据 返回json */ +// calendar.solar2lunar(1987,11,01); +/** 农历年月日转公历年月日 **/ +// calendar.lunar2solar(1987,9,10); +// 调用以上方法后返回类似如下object(json)具体以上就不需要解释了吧! +// c开头的是公历各属性值 l开头的自然就是农历咯 gz开头的就是天干地支纪年的数据啦~ +// { +// Animal: "兔", +// IDayCn: "初十", +// IMonthCn: "九月", +// Term: null, +// astro: "天蝎座", +// cDay: 1, +// cMonth: 11, +// cYear: 1987, +// gzDay: "甲寅", +// gzMonth: "庚戌", +// gzYear: "丁卯", +// isLeap: false, +// isTerm: false, +// isToday: false, +// lDay: 10, +// lMonth: 9, +// lYear: 1987, +// nWeek: 7, +// ncWeek: "星期日" +// } +// 该代码还有其它可以调用的方法,请自己查看代码中的详细注释 +const calendar = { + /** + * 农历1900-2100的润大小信息表 + * @Array Of Property + * @return Hex + */ + lunarInfo: [ + 0x04bd8, + 0x04ae0, + 0x0a570, + 0x054d5, + 0x0d260, + 0x0d950, + 0x16554, + 0x056a0, + 0x09ad0, + 0x055d2, // 1900-1909 + 0x04ae0, + 0x0a5b6, + 0x0a4d0, + 0x0d250, + 0x1d255, + 0x0b540, + 0x0d6a0, + 0x0ada2, + 0x095b0, + 0x14977, // 1910-1919 + 0x04970, + 0x0a4b0, + 0x0b4b5, + 0x06a50, + 0x06d40, + 0x1ab54, + 0x02b60, + 0x09570, + 0x052f2, + 0x04970, // 1920-1929 + 0x06566, + 0x0d4a0, + 0x0ea50, + 0x06e95, + 0x05ad0, + 0x02b60, + 0x186e3, + 0x092e0, + 0x1c8d7, + 0x0c950, // 1930-1939 + 0x0d4a0, + 0x1d8a6, + 0x0b550, + 0x056a0, + 0x1a5b4, + 0x025d0, + 0x092d0, + 0x0d2b2, + 0x0a950, + 0x0b557, // 1940-1949 + 0x06ca0, + 0x0b550, + 0x15355, + 0x04da0, + 0x0a5b0, + 0x14573, + 0x052b0, + 0x0a9a8, + 0x0e950, + 0x06aa0, // 1950-1959 + 0x0aea6, + 0x0ab50, + 0x04b60, + 0x0aae4, + 0x0a570, + 0x05260, + 0x0f263, + 0x0d950, + 0x05b57, + 0x056a0, // 1960-1969 + 0x096d0, + 0x04dd5, + 0x04ad0, + 0x0a4d0, + 0x0d4d4, + 0x0d250, + 0x0d558, + 0x0b540, + 0x0b6a0, + 0x195a6, // 1970-1979 + 0x095b0, + 0x049b0, + 0x0a974, + 0x0a4b0, + 0x0b27a, + 0x06a50, + 0x06d40, + 0x0af46, + 0x0ab60, + 0x09570, // 1980-1989 + 0x04af5, + 0x04970, + 0x064b0, + 0x074a3, + 0x0ea50, + 0x06b58, + 0x055c0, + 0x0ab60, + 0x096d5, + 0x092e0, // 1990-1999 + 0x0c960, + 0x0d954, + 0x0d4a0, + 0x0da50, + 0x07552, + 0x056a0, + 0x0abb7, + 0x025d0, + 0x092d0, + 0x0cab5, // 2000-2009 + 0x0a950, + 0x0b4a0, + 0x0baa4, + 0x0ad50, + 0x055d9, + 0x04ba0, + 0x0a5b0, + 0x15176, + 0x052b0, + 0x0a930, // 2010-2019 + 0x07954, + 0x06aa0, + 0x0ad50, + 0x05b52, + 0x04b60, + 0x0a6e6, + 0x0a4e0, + 0x0d260, + 0x0ea65, + 0x0d530, // 2020-2029 + 0x05aa0, + 0x076a3, + 0x096d0, + 0x04afb, + 0x04ad0, + 0x0a4d0, + 0x1d0b6, + 0x0d250, + 0x0d520, + 0x0dd45, // 2030-2039 + 0x0b5a0, + 0x056d0, + 0x055b2, + 0x049b0, + 0x0a577, + 0x0a4b0, + 0x0aa50, + 0x1b255, + 0x06d20, + 0x0ada0, // 2040-2049 + /** Add By JJonline@JJonline.Cn **/ + 0x14b63, + 0x09370, + 0x049f8, + 0x04970, + 0x064b0, + 0x168a6, + 0x0ea50, + 0x06b20, + 0x1a6c4, + 0x0aae0, // 2050-2059 + 0x0a2e0, + 0x0d2e3, + 0x0c960, + 0x0d557, + 0x0d4a0, + 0x0da50, + 0x05d55, + 0x056a0, + 0x0a6d0, + 0x055d4, // 2060-2069 + 0x052d0, + 0x0a9b8, + 0x0a950, + 0x0b4a0, + 0x0b6a6, + 0x0ad50, + 0x055a0, + 0x0aba4, + 0x0a5b0, + 0x052b0, // 2070-2079 + 0x0b273, + 0x06930, + 0x07337, + 0x06aa0, + 0x0ad50, + 0x14b55, + 0x04b60, + 0x0a570, + 0x054e4, + 0x0d160, // 2080-2089 + 0x0e968, + 0x0d520, + 0x0daa0, + 0x16aa6, + 0x056d0, + 0x04ae0, + 0x0a9d4, + 0x0a2d0, + 0x0d150, + 0x0f252, // 2090-2099 + 0x0d520 + ], // 2100 + + /** + * 公历每个月份的天数普通表 + * @Array Of Property + * @return Number + */ + solarMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], + + /** + * 天干地支之天干速查表 + * @Array Of Property trans["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"] + * @return Cn string + */ + Gan: [ + '\u7532', + '\u4e59', + '\u4e19', + '\u4e01', + '\u620a', + '\u5df1', + '\u5e9a', + '\u8f9b', + '\u58ec', + '\u7678' + ], + + /** + * 天干地支之地支速查表 + * @Array Of Property + * @trans["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"] + * @return Cn string + */ + Zhi: [ + '\u5b50', + '\u4e11', + '\u5bc5', + '\u536f', + '\u8fb0', + '\u5df3', + '\u5348', + '\u672a', + '\u7533', + '\u9149', + '\u620c', + '\u4ea5' + ], + + /** + * 天干地支之地支速查表<=>生肖 + * @Array Of Property + * @trans["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"] + * @return Cn string + */ + Animals: [ + '\u9f20', + '\u725b', + '\u864e', + '\u5154', + '\u9f99', + '\u86c7', + '\u9a6c', + '\u7f8a', + '\u7334', + '\u9e21', + '\u72d7', + '\u732a' + ], + + /** + * 24节气速查表 + * @Array Of Property + * @trans["小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至"] + * @return Cn string + */ + solarTerm: [ + '\u5c0f\u5bd2', + '\u5927\u5bd2', + '\u7acb\u6625', + '\u96e8\u6c34', + '\u60ca\u86f0', + '\u6625\u5206', + '\u6e05\u660e', + '\u8c37\u96e8', + '\u7acb\u590f', + '\u5c0f\u6ee1', + '\u8292\u79cd', + '\u590f\u81f3', + '\u5c0f\u6691', + '\u5927\u6691', + '\u7acb\u79cb', + '\u5904\u6691', + '\u767d\u9732', + '\u79cb\u5206', + '\u5bd2\u9732', + '\u971c\u964d', + '\u7acb\u51ac', + '\u5c0f\u96ea', + '\u5927\u96ea', + '\u51ac\u81f3' + ], + + /** + * 1900-2100各年的24节气日期速查表 + * @Array Of Property + * @return 0x string For splice + */ + sTermInfo: [ + '9778397bd097c36b0b6fc9274c91aa', + '97b6b97bd19801ec9210c965cc920e', + '97bcf97c3598082c95f8c965cc920f', + '97bd0b06bdb0722c965ce1cfcc920f', + 'b027097bd097c36b0b6fc9274c91aa', + '97b6b97bd19801ec9210c965cc920e', + '97bcf97c359801ec95f8c965cc920f', + '97bd0b06bdb0722c965ce1cfcc920f', + 'b027097bd097c36b0b6fc9274c91aa', + '97b6b97bd19801ec9210c965cc920e', + '97bcf97c359801ec95f8c965cc920f', + '97bd0b06bdb0722c965ce1cfcc920f', + 'b027097bd097c36b0b6fc9274c91aa', + '9778397bd19801ec9210c965cc920e', + '97b6b97bd19801ec95f8c965cc920f', + '97bd09801d98082c95f8e1cfcc920f', + '97bd097bd097c36b0b6fc9210c8dc2', + '9778397bd197c36c9210c9274c91aa', + '97b6b97bd19801ec95f8c965cc920e', + '97bd09801d98082c95f8e1cfcc920f', + '97bd097bd097c36b0b6fc9210c8dc2', + '9778397bd097c36c9210c9274c91aa', + '97b6b97bd19801ec95f8c965cc920e', + '97bcf97c3598082c95f8e1cfcc920f', + '97bd097bd097c36b0b6fc9210c8dc2', + '9778397bd097c36c9210c9274c91aa', + '97b6b97bd19801ec9210c965cc920e', + '97bcf97c3598082c95f8c965cc920f', + '97bd097bd097c35b0b6fc920fb0722', + '9778397bd097c36b0b6fc9274c91aa', + '97b6b97bd19801ec9210c965cc920e', + '97bcf97c3598082c95f8c965cc920f', + '97bd097bd097c35b0b6fc920fb0722', + '9778397bd097c36b0b6fc9274c91aa', + '97b6b97bd19801ec9210c965cc920e', + '97bcf97c359801ec95f8c965cc920f', + '97bd097bd097c35b0b6fc920fb0722', + '9778397bd097c36b0b6fc9274c91aa', + '97b6b97bd19801ec9210c965cc920e', + '97bcf97c359801ec95f8c965cc920f', + '97bd097bd097c35b0b6fc920fb0722', + '9778397bd097c36b0b6fc9274c91aa', + '97b6b97bd19801ec9210c965cc920e', + '97bcf97c359801ec95f8c965cc920f', + '97bd097bd07f595b0b6fc920fb0722', + '9778397bd097c36b0b6fc9210c8dc2', + '9778397bd19801ec9210c9274c920e', + '97b6b97bd19801ec95f8c965cc920f', + '97bd07f5307f595b0b0bc920fb0722', + '7f0e397bd097c36b0b6fc9210c8dc2', + '9778397bd097c36c9210c9274c920e', + '97b6b97bd19801ec95f8c965cc920f', + '97bd07f5307f595b0b0bc920fb0722', + '7f0e397bd097c36b0b6fc9210c8dc2', + '9778397bd097c36c9210c9274c91aa', + '97b6b97bd19801ec9210c965cc920e', + '97bd07f1487f595b0b0bc920fb0722', + '7f0e397bd097c36b0b6fc9210c8dc2', + '9778397bd097c36b0b6fc9274c91aa', + '97b6b97bd19801ec9210c965cc920e', + '97bcf7f1487f595b0b0bb0b6fb0722', + '7f0e397bd097c35b0b6fc920fb0722', + '9778397bd097c36b0b6fc9274c91aa', + '97b6b97bd19801ec9210c965cc920e', + '97bcf7f1487f595b0b0bb0b6fb0722', + '7f0e397bd097c35b0b6fc920fb0722', + '9778397bd097c36b0b6fc9274c91aa', + '97b6b97bd19801ec9210c965cc920e', + '97bcf7f1487f531b0b0bb0b6fb0722', + '7f0e397bd097c35b0b6fc920fb0722', + '9778397bd097c36b0b6fc9274c91aa', + '97b6b97bd19801ec9210c965cc920e', + '97bcf7f1487f531b0b0bb0b6fb0722', + '7f0e397bd07f595b0b6fc920fb0722', + '9778397bd097c36b0b6fc9274c91aa', + '97b6b97bd19801ec9210c9274c920e', + '97bcf7f0e47f531b0b0bb0b6fb0722', + '7f0e397bd07f595b0b0bc920fb0722', + '9778397bd097c36b0b6fc9210c91aa', + '97b6b97bd197c36c9210c9274c920e', + '97bcf7f0e47f531b0b0bb0b6fb0722', + '7f0e397bd07f595b0b0bc920fb0722', + '9778397bd097c36b0b6fc9210c8dc2', + '9778397bd097c36c9210c9274c920e', + '97b6b7f0e47f531b0723b0b6fb0722', + '7f0e37f5307f595b0b0bc920fb0722', + '7f0e397bd097c36b0b6fc9210c8dc2', + '9778397bd097c36b0b70c9274c91aa', + '97b6b7f0e47f531b0723b0b6fb0721', + '7f0e37f1487f595b0b0bb0b6fb0722', + '7f0e397bd097c35b0b6fc9210c8dc2', + '9778397bd097c36b0b6fc9274c91aa', + '97b6b7f0e47f531b0723b0b6fb0721', + '7f0e27f1487f595b0b0bb0b6fb0722', + '7f0e397bd097c35b0b6fc920fb0722', + '9778397bd097c36b0b6fc9274c91aa', + '97b6b7f0e47f531b0723b0b6fb0721', + '7f0e27f1487f531b0b0bb0b6fb0722', + '7f0e397bd097c35b0b6fc920fb0722', + '9778397bd097c36b0b6fc9274c91aa', + '97b6b7f0e47f531b0723b0b6fb0721', + '7f0e27f1487f531b0b0bb0b6fb0722', + '7f0e397bd097c35b0b6fc920fb0722', + '9778397bd097c36b0b6fc9274c91aa', + '97b6b7f0e47f531b0723b0b6fb0721', + '7f0e27f1487f531b0b0bb0b6fb0722', + '7f0e397bd07f595b0b0bc920fb0722', + '9778397bd097c36b0b6fc9274c91aa', + '97b6b7f0e47f531b0723b0787b0721', + '7f0e27f0e47f531b0b0bb0b6fb0722', + '7f0e397bd07f595b0b0bc920fb0722', + '9778397bd097c36b0b6fc9210c91aa', + '97b6b7f0e47f149b0723b0787b0721', + '7f0e27f0e47f531b0723b0b6fb0722', + '7f0e397bd07f595b0b0bc920fb0722', + '9778397bd097c36b0b6fc9210c8dc2', + '977837f0e37f149b0723b0787b0721', + '7f07e7f0e47f531b0723b0b6fb0722', + '7f0e37f5307f595b0b0bc920fb0722', + '7f0e397bd097c35b0b6fc9210c8dc2', + '977837f0e37f14998082b0787b0721', + '7f07e7f0e47f531b0723b0b6fb0721', + '7f0e37f1487f595b0b0bb0b6fb0722', + '7f0e397bd097c35b0b6fc9210c8dc2', + '977837f0e37f14998082b0787b06bd', + '7f07e7f0e47f531b0723b0b6fb0721', + '7f0e27f1487f531b0b0bb0b6fb0722', + '7f0e397bd097c35b0b6fc920fb0722', + '977837f0e37f14998082b0787b06bd', + '7f07e7f0e47f531b0723b0b6fb0721', + '7f0e27f1487f531b0b0bb0b6fb0722', + '7f0e397bd097c35b0b6fc920fb0722', + '977837f0e37f14998082b0787b06bd', + '7f07e7f0e47f531b0723b0b6fb0721', + '7f0e27f1487f531b0b0bb0b6fb0722', + '7f0e397bd07f595b0b0bc920fb0722', + '977837f0e37f14998082b0787b06bd', + '7f07e7f0e47f531b0723b0b6fb0721', + '7f0e27f1487f531b0b0bb0b6fb0722', + '7f0e397bd07f595b0b0bc920fb0722', + '977837f0e37f14998082b0787b06bd', + '7f07e7f0e47f149b0723b0787b0721', + '7f0e27f0e47f531b0b0bb0b6fb0722', + '7f0e397bd07f595b0b0bc920fb0722', + '977837f0e37f14998082b0723b06bd', + '7f07e7f0e37f149b0723b0787b0721', + '7f0e27f0e47f531b0723b0b6fb0722', + '7f0e397bd07f595b0b0bc920fb0722', + '977837f0e37f14898082b0723b02d5', + '7ec967f0e37f14998082b0787b0721', + '7f07e7f0e47f531b0723b0b6fb0722', + '7f0e37f1487f595b0b0bb0b6fb0722', + '7f0e37f0e37f14898082b0723b02d5', + '7ec967f0e37f14998082b0787b0721', + '7f07e7f0e47f531b0723b0b6fb0722', + '7f0e37f1487f531b0b0bb0b6fb0722', + '7f0e37f0e37f14898082b0723b02d5', + '7ec967f0e37f14998082b0787b06bd', + '7f07e7f0e47f531b0723b0b6fb0721', + '7f0e37f1487f531b0b0bb0b6fb0722', + '7f0e37f0e37f14898082b072297c35', + '7ec967f0e37f14998082b0787b06bd', + '7f07e7f0e47f531b0723b0b6fb0721', + '7f0e27f1487f531b0b0bb0b6fb0722', + '7f0e37f0e37f14898082b072297c35', + '7ec967f0e37f14998082b0787b06bd', + '7f07e7f0e47f531b0723b0b6fb0721', + '7f0e27f1487f531b0b0bb0b6fb0722', + '7f0e37f0e366aa89801eb072297c35', + '7ec967f0e37f14998082b0787b06bd', + '7f07e7f0e47f149b0723b0787b0721', + '7f0e27f1487f531b0b0bb0b6fb0722', + '7f0e37f0e366aa89801eb072297c35', + '7ec967f0e37f14998082b0723b06bd', + '7f07e7f0e47f149b0723b0787b0721', + '7f0e27f0e47f531b0723b0b6fb0722', + '7f0e37f0e366aa89801eb072297c35', + '7ec967f0e37f14998082b0723b06bd', + '7f07e7f0e37f14998083b0787b0721', + '7f0e27f0e47f531b0723b0b6fb0722', + '7f0e37f0e366aa89801eb072297c35', + '7ec967f0e37f14898082b0723b02d5', + '7f07e7f0e37f14998082b0787b0721', + '7f07e7f0e47f531b0723b0b6fb0722', + '7f0e36665b66aa89801e9808297c35', + '665f67f0e37f14898082b0723b02d5', + '7ec967f0e37f14998082b0787b0721', + '7f07e7f0e47f531b0723b0b6fb0722', + '7f0e36665b66a449801e9808297c35', + '665f67f0e37f14898082b0723b02d5', + '7ec967f0e37f14998082b0787b06bd', + '7f07e7f0e47f531b0723b0b6fb0721', + '7f0e36665b66a449801e9808297c35', + '665f67f0e37f14898082b072297c35', + '7ec967f0e37f14998082b0787b06bd', + '7f07e7f0e47f531b0723b0b6fb0721', + '7f0e26665b66a449801e9808297c35', + '665f67f0e37f1489801eb072297c35', + '7ec967f0e37f14998082b0787b06bd', + '7f07e7f0e47f531b0723b0b6fb0721', + '7f0e27f1487f531b0b0bb0b6fb0722' + ], + + /** + * 数字转中文速查表 + * @Array Of Property + * @trans ['日','一','二','三','四','五','六','七','八','九','十'] + * @return Cn string + */ + nStr1: [ + '\u65e5', + '\u4e00', + '\u4e8c', + '\u4e09', + '\u56db', + '\u4e94', + '\u516d', + '\u4e03', + '\u516b', + '\u4e5d', + '\u5341' + ], + + /** + * 日期转农历称呼速查表 + * @Array Of Property + * @trans ['初','十','廿','卅'] + * @return Cn string + */ + nStr2: ['\u521d', '\u5341', '\u5eff', '\u5345'], + + /** + * 月份转农历称呼速查表 + * @Array Of Property + * @trans ['正','一','二','三','四','五','六','七','八','九','十','冬','腊'] + * @return Cn string + */ + nStr3: [ + '\u6b63', + '\u4e8c', + '\u4e09', + '\u56db', + '\u4e94', + '\u516d', + '\u4e03', + '\u516b', + '\u4e5d', + '\u5341', + '\u51ac', + '\u814a' + ], + + /** + * 返回农历y年一整年的总天数 + * @param lunar Year + * @return Number + * @eg:var count = calendar.lYearDays(1987) ;//count=387 + */ + lYearDays: function(y) { + let i + let sum = 348 + for (i = 0x8000; i > 0x8; i >>= 1) { + sum += calendar.lunarInfo[y - 1900] & i ? 1 : 0 + } + return sum + calendar.leapDays(y) + }, + + /** + * 返回农历y年闰月是哪个月;若y年没有闰月 则返回0 + * @param lunar Year + * @return Number (0-12) + * @eg:var leapMonth = calendar.leapMonth(1987) ;//leapMonth=6 + */ + leapMonth: function(y) { + // 闰字编码 \u95f0 + return calendar.lunarInfo[y - 1900] & 0xf + }, + + /** + * 返回农历y年闰月的天数 若该年没有闰月则返回0 + * @param lunar Year + * @return Number (0、29、30) + * @eg:var leapMonthDay = calendar.leapDays(1987) ;//leapMonthDay=29 + */ + leapDays: function(y) { + if (calendar.leapMonth(y)) { + return calendar.lunarInfo[y - 1900] & 0x10000 ? 30 : 29 + } + return 0 + }, + + /** + * 返回农历y年m月(非闰月)的总天数,计算m为闰月时的天数请使用leapDays方法 + * @param lunar Year + * @return Number (-1、29、30) + * @eg:var MonthDay = calendar.monthDays(1987,9) ;//MonthDay=29 + */ + monthDays: function(y, m) { + if (m > 12 || m < 1) return -1 // 月份参数从1至12,参数错误返回-1 + return calendar.lunarInfo[y - 1900] & (0x10000 >> m) ? 30 : 29 + }, + + /** + * 返回公历(!)y年m月的天数 + * @param solar Year + * @return Number (-1、28、29、30、31) + * @eg:var solarMonthDay = calendar.leapDays(1987) ;//solarMonthDay=30 + */ + solarDays: function(y, m) { + if (m > 12 || m < 1) return -1 // 若参数错误 返回-1 + const ms = m - 1 + if (+ms === 1) { + // 2月份的闰平规律测算后确认返回28或29 + return (y % 4 === 0 && y % 100 !== 0) || y % 400 === 0 ? 29 : 28 + } else { + return calendar.solarMonth[ms] + } + }, + + /** + * 农历年份转换为干支纪年 + * @param lYear 农历年的年份数 + * @return Cn string + */ + toGanZhiYear: function(lYear) { + let ganKey = (lYear - 3) % 10 + let zhiKey = (lYear - 3) % 12 + if (+ganKey === 0) ganKey = 10 // 如果余数为0则为最后一个天干 + if (+zhiKey === 0) zhiKey = 12 // 如果余数为0则为最后一个地支 + return calendar.Gan[ganKey - 1] + calendar.Zhi[zhiKey - 1] + }, + + /** + * 公历月、日判断所属星座 + * @param cMonth [description] + * @param cDay [description] + * @return Cn string + */ + toAstro: function(cMonth, cDay) { + const s = + '\u9b54\u7faf\u6c34\u74f6\u53cc\u9c7c\u767d\u7f8a\u91d1\u725b\u53cc\u5b50\u5de8\u87f9\u72ee\u5b50\u5904\u5973\u5929\u79e4\u5929\u874e\u5c04\u624b\u9b54\u7faf' + const arr = [20, 19, 21, 21, 21, 22, 23, 23, 23, 23, 22, 22] + return s.substr(cMonth * 2 - (cDay < arr[cMonth - 1] ? 2 : 0), 2) + '\u5ea7' // 座 + }, + + /** + * 传入offset偏移量返回干支 + * @param offset 相对甲子的偏移量 + * @return Cn string + */ + toGanZhi: function(offset) { + return calendar.Gan[offset % 10] + calendar.Zhi[offset % 12] + }, + + /** + * 传入公历(!)y年获得该年第n个节气的公历日期 + * @param y公历年(1900-2100);n二十四节气中的第几个节气(1~24);从n=1(小寒)算起 + * @return day Number + * @eg:var _24 = calendar.getTerm(1987,3) ;//_24=4;意即1987年2月4日立春 + */ + getTerm: function(y, n) { + if (y < 1900 || y > 2100) return -1 + if (n < 1 || n > 24) return -1 + const _table = calendar.sTermInfo[y - 1900] + const _info = [ + parseInt('0x' + _table.substr(0, 5)).toString(), + parseInt('0x' + _table.substr(5, 5)).toString(), + parseInt('0x' + _table.substr(10, 5)).toString(), + parseInt('0x' + _table.substr(15, 5)).toString(), + parseInt('0x' + _table.substr(20, 5)).toString(), + parseInt('0x' + _table.substr(25, 5)).toString() + ] + const _calday = [ + _info[0].substr(0, 1), + _info[0].substr(1, 2), + _info[0].substr(3, 1), + _info[0].substr(4, 2), + + _info[1].substr(0, 1), + _info[1].substr(1, 2), + _info[1].substr(3, 1), + _info[1].substr(4, 2), + + _info[2].substr(0, 1), + _info[2].substr(1, 2), + _info[2].substr(3, 1), + _info[2].substr(4, 2), + + _info[3].substr(0, 1), + _info[3].substr(1, 2), + _info[3].substr(3, 1), + _info[3].substr(4, 2), + + _info[4].substr(0, 1), + _info[4].substr(1, 2), + _info[4].substr(3, 1), + _info[4].substr(4, 2), + + _info[5].substr(0, 1), + _info[5].substr(1, 2), + _info[5].substr(3, 1), + _info[5].substr(4, 2) + ] + return parseInt(_calday[n - 1]) + }, + + /** + * 传入农历数字月份返回汉语通俗表示法 + * @param lunar month + * @return Cn string + * @eg:var cnMonth = calendar.toChinaMonth(12) ;//cnMonth='腊月' + */ + toChinaMonth: function(m) { + // 月 => \u6708 + if (m > 12 || m < 1) return -1 // 若参数错误 返回-1 + let s = calendar.nStr3[m - 1] + s += '\u6708' // 加上月字 + return s + }, + + /** + * 传入农历日期数字返回汉字表示法 + * @param lunar day + * @return Cn string + * @eg:var cnDay = calendar.toChinaDay(21) ;//cnMonth='廿一' + */ + toChinaDay: function(d) { + // 日 => \u65e5 + let s + switch (d) { + case 10: + s = '\u521d\u5341' + break + case 20: + s = '\u4e8c\u5341' + break + case 30: + s = '\u4e09\u5341' + break + default: + s = calendar.nStr2[Math.floor(d / 10)] + s += calendar.nStr1[d % 10] + } + return s + }, + + /** + * 年份转生肖[!仅能大致转换] => 精确划分生肖分界线是“立春” + * @param y year + * @return Cn string + * @eg:var animal = calendar.getAnimal(1987) ;//animal='兔' + */ + getAnimal: function(y) { + return calendar.Animals[(y - 4) % 12] + }, + + /** + * 传入阳历年月日获得详细的公历、农历object信息 <=>JSON + * @param y solar year + * @param m solar month + * @param d solar day + * @return JSON object + * @eg:console.log(calendar.solar2lunar(1987,11,01)); + */ + solar2lunar: function(y, m, d) { + // 参数区间1900.1.31~2100.12.31 + // 年份限定、上限 + if (y < 1900 || y > 2100) { + return -1 // undefined转换为数字变为NaN + } + // 公历传参最下限 + if (+y === 1900 && +m === 1 && +d < 31) { + return -1 + } + // 未传参 获得当天 + let objDate + if (!y) { + objDate = new Date() + } else { + objDate = new Date(y, parseInt(m) - 1, d) + } + let i + let leap = 0 + let temp = 0 + // 修正ymd参数 + y = objDate.getFullYear() + m = objDate.getMonth() + 1 + d = objDate.getDate() + let offset = + (Date.UTC(objDate.getFullYear(), objDate.getMonth(), objDate.getDate()) - + Date.UTC(1900, 0, 31)) / + 86400000 + for (i = 1900; i < 2101 && offset > 0; i++) { + temp = calendar.lYearDays(i) + offset -= temp + } + if (offset < 0) { + offset += temp + i-- + } + + // 是否今天 + const isTodayObj = new Date() + let isToday = false + if ( + isTodayObj.getFullYear() === +y && + isTodayObj.getMonth() + 1 === +m && + isTodayObj.getDate() === +d + ) { + isToday = true + } + // 星期几 + let nWeek = objDate.getDay() + const cWeek = calendar.nStr1[nWeek] + // 数字表示周几顺应天朝周一开始的惯例 + if (+nWeek === 0) { + nWeek = 7 + } + // 农历年 + const year = i + leap = calendar.leapMonth(i) // 闰哪个月 + let isLeap = false + + // 效验闰月 + for (i = 1; i < 13 && offset > 0; i++) { + // 闰月 + if (leap > 0 && i === leap + 1 && isLeap === false) { + --i + isLeap = true + temp = calendar.leapDays(year) // 计算农历闰月天数 + } else { + temp = calendar.monthDays(year, i) // 计算农历普通月天数 + } + // 解除闰月 + if (isLeap === true && i === leap + 1) isLeap = false + offset -= temp + } + // 闰月导致数组下标重叠取反 + if (offset === 0 && leap > 0 && i === leap + 1) { + if (isLeap) { + isLeap = false + } else { + isLeap = true + --i + } + } + if (offset < 0) { + offset += temp + --i + } + // 农历月 + const month = i + // 农历日 + const day = offset + 1 + // 天干地支处理 + const sm = m - 1 + const gzY = calendar.toGanZhiYear(year) + + // 当月的两个节气 + // bugfix-2017-7-24 11:03:38 use lunar Year Param `y` Not `year` + const firstNode = calendar.getTerm(y, m * 2 - 1) // 返回当月「节」为几日开始 + const secondNode = calendar.getTerm(y, m * 2) // 返回当月「节」为几日开始 + + // 依据12节气修正干支月 + let gzM = calendar.toGanZhi((y - 1900) * 12 + m + 11) + if (d >= firstNode) { + gzM = calendar.toGanZhi((y - 1900) * 12 + m + 12) + } + + // 传入的日期的节气与否 + let isTerm = false + let Term = null + if (+firstNode === d) { + isTerm = true + Term = calendar.solarTerm[m * 2 - 2] + } + if (+secondNode === d) { + isTerm = true + Term = calendar.solarTerm[m * 2 - 1] + } + // 日柱 当月一日与 1900/1/1 相差天数 + const dayCyclical = Date.UTC(y, sm, 1, 0, 0, 0, 0) / 86400000 + 25567 + 10 + const gzD = calendar.toGanZhi(dayCyclical + d - 1) + // 该日期所属的星座 + const astro = calendar.toAstro(m, d) + + return { + lYear: year, + lMonth: month, + lDay: day, + Animal: calendar.getAnimal(year), + IMonthCn: (isLeap ? '\u95f0' : '') + calendar.toChinaMonth(month), + IDayCn: calendar.toChinaDay(day), + cYear: y, + cMonth: m, + cDay: d, + gzYear: gzY, + gzMonth: gzM, + gzDay: gzD, + isToday: isToday, + isLeap: isLeap, + nWeek: nWeek, + ncWeek: '\u661f\u671f' + cWeek, + isTerm: isTerm, + Term: Term, + astro: astro + } + }, + + /** + * 传入农历年月日以及传入的月份是否闰月获得详细的公历、农历object信息 <=>JSON + * @param y lunar year + * @param m lunar month + * @param d lunar day + * @param isLeapMonth lunar month is leap or not.[如果是农历闰月第四个参数赋值true即可] + * @return JSON object + * @eg:console.log(calendar.lunar2solar(1987,9,10)); + */ + lunar2solar: function(y, m, d, isLeapMonth) { + // 参数区间1900.1.31~2100.12.1 + isLeapMonth = !!isLeapMonth + // let leapOffset = 0; + const leapMonth = calendar.leapMonth(y) + // let leapDay = calendar.leapDays(y); + if (isLeapMonth && leapMonth !== m) return -1 // 传参要求计算该闰月公历 但该年得出的闰月与传参的月份并不同 + if ( + (+y === 2100 && +m === 12 && +d > 1) || + (+y === 1900 && +m === 1 && +d < 31) + ) + return -1 // 超出了最大极限值 + const day = calendar.monthDays(y, m) + let _day = day + // bugFix 2016-9-25 + // if month is leap, _day use leapDays method + if (isLeapMonth) { + _day = calendar.leapDays(y, m) + } + if (y < 1900 || y > 2100 || d > _day) return -1 // 参数合法性效验 + + // 计算农历的时间差 + let offset = 0 + for (let i = 1900; i < y; i++) { + offset += calendar.lYearDays(i) + } + let leap = 0 + let isAdd = false + for (let i = 1; i < m; i++) { + leap = calendar.leapMonth(y) + if (!isAdd) { + // 处理闰月 + if (leap <= i && leap > 0) { + offset += calendar.leapDays(y) + isAdd = true + } + } + offset += calendar.monthDays(y, i) + } + // 转换闰月农历 需补充该年闰月的前一个月的时差 + if (isLeapMonth) offset += day + // 1900年农历正月一日的公历时间为1900年1月30日0时0分0秒(该时间也是本农历的最开始起始点) + const stmap = Date.UTC(1900, 1, 30, 0, 0, 0) + const calObj = new Date((offset + d - 31) * 86400000 + stmap) + const cY = calObj.getUTCFullYear() + const cM = calObj.getUTCMonth() + 1 + const cD = calObj.getUTCDate() + + return calendar.solar2lunar(cY, cM, cD) + } +} + +const { + Gan, + Zhi, + nStr1, + nStr2, + nStr3, + Animals, + solarTerm, + lunarInfo, + sTermInfo, + solarMonth, + ...rest +} = calendar + +export default rest diff --git a/src/components/calendar/plugins/solarLunar/index.d.ts b/src/components/calendar/plugins/solarLunar/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/components/calendar/plugins/solarLunar/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/components/calendar/plugins/solarLunar/index.js b/src/components/calendar/plugins/solarLunar/index.js new file mode 100644 index 0000000..79ffbfd --- /dev/null +++ b/src/components/calendar/plugins/solarLunar/index.js @@ -0,0 +1,59 @@ +import { dateUtil } from '../../utils/index' +import convertSolarLunar from './convertSolarLunar' + +function getDateRow2Dict(dateInfo) { + if (!dateInfo) return dateInfo + if (typeof dateInfo === 'string' && dateInfo.includes('-')) { + dateInfo = dateUtil.transformDateRow2Dict(dateInfo) + } + return dateInfo +} + +export default () => { + return { + name: 'convertSolarLunar', + beforeRender(calendarData = {}, calendarConfig = {}) { + let { dates = [], selectedDates = [] } = calendarData + if (calendarConfig.showLunar) { + dates = dates.map(dataInfo => { + const { year, month, date } = dataInfo + return { + ...dataInfo, + lunar: convertSolarLunar.solar2lunar(year, month, date) + } + }) + selectedDates = selectedDates.map(dataInfo => { + const { year, month, date } = dataInfo + return { + ...dataInfo, + lunar: convertSolarLunar.solar2lunar(year, month, date) + } + }) + } + return { + calendarData: { + ...calendarData, + dates: dates, + selectedDates: selectedDates + }, + calendarConfig + } + }, + methods() { + return { + convertSolarLunar: dateInfo => { + dateInfo = getDateRow2Dict(dateInfo) + if (!dateInfo) return dateInfo + const { year, month, date } = dateInfo + return convertSolarLunar.solar2lunar(year, month, date) + }, + convertlLunar2Solar: (dateInfo, isLeapMonth) => { + dateInfo = getDateRow2Dict(dateInfo) + if (!dateInfo) return dateInfo + const { year, month, date } = dateInfo + return convertSolarLunar.lunar2solar(year, month, date, isLeapMonth) + } + } + } + } +} diff --git a/src/components/calendar/plugins/time-range.js b/src/components/calendar/plugins/time-range.js new file mode 100644 index 0000000..ef4dd41 --- /dev/null +++ b/src/components/calendar/plugins/time-range.js @@ -0,0 +1,305 @@ +/** + * @Author: drfu* + * @Description: 时间区域选择 + * @Date: 2020-10-08 21:22:09* + * @Last Modified by: drfu + * @Last Modified time: 2020-10-11 13:56:32 + * */ + +import { renderCalendar } from '../render' +import { + logger, + dateUtil, + getCalendarConfig, + getCalendarData +} from '../utils/index' + +function pusheNextMonthDateArea( + dateInfo = {}, + startTimestamp, + endTimestamp, + selectedDates = [] +) { + let tempOfSelectedDate = [...selectedDates] + const dates = dateUtil.calcDates(dateInfo.year, dateInfo.month) + let datesLen = dates.length + for (let i = 0; i < datesLen; i++) { + const date = dates[i] + const timeStamp = dateUtil.getTimeStamp(date) + if (timeStamp <= endTimestamp && timeStamp >= startTimestamp) { + tempOfSelectedDate.push({ + ...date, + choosed: true + }) + } + if (i === datesLen - 1 && timeStamp < endTimestamp) { + pusheNextMonthDateArea( + dateUtil.getNextMonthInfo(date), + startTimestamp, + endTimestamp, + tempOfSelectedDate + ) + } + } + return tempOfSelectedDate +} +function pushPrevMonthDateArea( + dateInfo = {}, + startTimestamp, + endTimestamp, + selectedDates = [] +) { + let tempOfSelectedDate = [...selectedDates] + const dates = dateUtil.sortDatesByTime( + dateUtil.calcDates(dateInfo.year, dateInfo.month), + 'desc' + ) + let datesLen = dates.length + let firstDate = dateUtil.getTimeStamp(dates[0]) + for (let i = 0; i < datesLen; i++) { + const date = dates[i] + const timeStamp = dateUtil.getTimeStamp(date) + if (timeStamp >= startTimestamp && timeStamp <= endTimestamp) { + tempOfSelectedDate.push({ + ...date, + choosed: true + }) + } + if (i === datesLen - 1 && firstDate > startTimestamp) { + pushPrevMonthDateArea( + dateUtil.getPrevMonthInfo(date), + startTimestamp, + endTimestamp, + tempOfSelectedDate + ) + } + } + return tempOfSelectedDate +} +/** + * 当设置日期区域非当前时保存其它月份的日期至已选日期数组 + * @param {object} info + */ +function calcDateWhenNotInOneMonth(info) { + const { firstDate, lastDate, startTimestamp, endTimestamp } = info + let { selectedDate } = info + if (dateUtil.getTimeStamp(firstDate) > startTimestamp) { + selectedDate = pushPrevMonthDateArea( + dateUtil.getPrevMonthInfo(firstDate), + startTimestamp, + endTimestamp, + selectedDate + ) + } + if (dateUtil.getTimeStamp(lastDate) < endTimestamp) { + selectedDate = pusheNextMonthDateArea( + dateUtil.getNextMonthInfo(lastDate), + startTimestamp, + endTimestamp, + selectedDate + ) + } + return [...selectedDate] +} + +/** + * 指定日期区域转时间戳 + * @param {array} timearea 时间区域 + */ +export function convertTimeRangeToTimestamp(timearea = []) { + const start = timearea[0].split('-') + const end = timearea[1].split('-') + if (start.length !== 3 || end.length !== 3) { + logger.warn('enableArea() 参数格式为: ["2018-2-1", "2018-3-1"]') + return {} + } + const startTimestamp = dateUtil + .newDate(start[0], start[1], start[2]) + .getTime() + const endTimestamp = dateUtil.newDate(end[0], end[1], end[2]).getTime() + return { + start, + end, + startTimestamp, + endTimestamp + } +} + +/** + * 校验时间区域是否合法 + * @param {array} dateArea 时间区域 + */ +function validateTimeRange(dateArea) { + const { + start, + end, + startTimestamp, + endTimestamp + } = convertTimeRangeToTimestamp(dateArea) + if (!start || !end) return + const startMonthDays = dateUtil.getDatesCountOfMonth(start[0], start[1]) + const endMonthDays = dateUtil.getDatesCountOfMonth(end[0], end[1]) + if (start[2] > startMonthDays || start[2] < 1) { + logger.warn('enableArea() 开始日期错误,指定日期不在当前月份天数范围内') + return false + } else if (start[1] > 12 || start[1] < 1) { + logger.warn('enableArea() 开始日期错误,月份超出1-12月份') + return false + } else if (end[2] > endMonthDays || end[2] < 1) { + logger.warn('enableArea() 截止日期错误,指定日期不在当前月份天数范围内') + return false + } else if (end[1] > 12 || end[1] < 1) { + logger.warn('enableArea() 截止日期错误,月份超出1-12月份') + return false + } else if (startTimestamp > endTimestamp) { + logger.warn('enableArea()参数最小日期大于了最大日期') + return false + } else { + return true + } +} + +export default () => { + return { + name: 'timeRange', + beforeRender(calendarData = {}, calendarConfig = {}) { + const { + chooseAreaTimestamp = [], + dates = [], + selectedDates = [] + } = calendarData + let __dates = dates + let __selectedDates = selectedDates + const [startDateTimestamp, endDateTimestamp] = chooseAreaTimestamp + if (chooseAreaTimestamp.length === 2) { + __selectedDates = [] + __dates = dates.map(d => { + const date = { ...d } + const dateTimeStamp = dateUtil.getTimeStamp(date) + if ( + dateTimeStamp >= startDateTimestamp && + endDateTimestamp >= dateTimeStamp + ) { + date.choosed = true + __selectedDates.push(date) + } else { + date.choosed = false + __selectedDates = __selectedDates.filter( + item => dateUtil.getTimeStamp(item) !== dateTimeStamp + ) + } + return date + }) + const monthOfStartDate = new Date(startDateTimestamp).getMonth() + const monthOfEndDate = new Date(endDateTimestamp).getMonth() + if (monthOfStartDate !== monthOfEndDate) { + __selectedDates = calcDateWhenNotInOneMonth({ + firstDate: __dates[0], + lastDate: __dates[__dates.length - 1], + startTimestamp: startDateTimestamp, + endTimestamp: endDateTimestamp, + selectedDate: __selectedDates + }) + } + } + return { + calendarData: { + ...calendarData, + dates: __dates, + selectedDates: dateUtil.sortDatesByTime( + dateUtil.uniqueArrayByDate(__selectedDates) + ) + }, + calendarConfig + } + }, + onTapDate(tapedDate, calendarData = {}, calendarConfig = {}) { + if (!calendarConfig.chooseAreaMode) { + return { + calendarData, + calendarConfig + } + } + let { + tempChooseAreaTimestamp = [], + chooseAreaTimestamp: existChooseAreaTimestamp = [], + selectedDates = [], + dates = [] + } = calendarData + const timestamp = dateUtil.getTimeStamp(tapedDate) + let __dates = [...dates] + let __selectedDates = [...selectedDates] + if ( + tempChooseAreaTimestamp.length === 2 || + existChooseAreaTimestamp.length === 2 + ) { + tempChooseAreaTimestamp = [tapedDate] + __selectedDates = [] + __dates.forEach(d => (d.choosed = false)) + } else if (tempChooseAreaTimestamp.length === 1) { + const preChoosedDate = tempChooseAreaTimestamp[0] + const preTimestamp = dateUtil.getTimeStamp(preChoosedDate) + if (preTimestamp <= timestamp) { + tempChooseAreaTimestamp.push(tapedDate) + } else if (preTimestamp > timestamp) { + tempChooseAreaTimestamp.unshift(tapedDate) + } + } else { + tempChooseAreaTimestamp = [tapedDate] + } + let chooseAreaTimestamp = [] + if (tempChooseAreaTimestamp.length === 2) { + const [startDate, endDate] = tempChooseAreaTimestamp + const startDateTimestamp = dateUtil.getTimeStamp(startDate) + const endDateTimestamp = dateUtil.getTimeStamp(endDate) + chooseAreaTimestamp = [startDateTimestamp, endDateTimestamp] + } + return { + calendarData: { + ...calendarData, + chooseAreaTimestamp, + tempChooseAreaTimestamp, + dates: __dates, + selectedDates: __selectedDates + }, + calendarConfig: { + ...calendarConfig, + multi: true + } + } + }, + methods(component) { + return { + /** + * 设置连续日期选择区域 + * @param {array} dateArea 区域开始结束日期数组 + */ + chooseDateArea: (dateArea = []) => { + if (dateArea.length === 1) { + dateArea = dateArea.concat(dateArea) + } + if (dateArea.length !== 2) return + const isRight = validateTimeRange(dateArea) + if (!isRight) return + const config = getCalendarConfig(component) || {} + const { startTimestamp, endTimestamp } = convertTimeRangeToTimestamp( + dateArea + ) + const existCalendarData = getCalendarData('calendar', component) + return renderCalendar.call( + component, + { + ...existCalendarData, + chooseAreaTimestamp: [startTimestamp, endTimestamp] + }, + { + ...config, + multi: true, + chooseAreaMode: true + } + ) + } + } + } + } +} diff --git a/src/components/calendar/plugins/todo.d.ts b/src/components/calendar/plugins/todo.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/components/calendar/plugins/todo.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/components/calendar/plugins/todo.js b/src/components/calendar/plugins/todo.js new file mode 100644 index 0000000..1559c6c --- /dev/null +++ b/src/components/calendar/plugins/todo.js @@ -0,0 +1,135 @@ +/** + * @Author: drfu* + * @Description: 代办事项 + * @Date: 2020-10-08 21:22:09* + * @Last Modified by: drfu + * @Last Modified time: 2020-10-11 14:23:02 + * */ + +import { getCalendarData, dateUtil } from '../utils/index' +import { renderCalendar } from '../render' + +function updateDatePropertyOfTodoLabel(todos, dates, showLabelAlways) { + const datesInfo = [...dates] + for (let todo of todos) { + let targetIdx = datesInfo.findIndex( + item => dateUtil.toTimeStr(item) === dateUtil.toTimeStr(todo) + ) + let target = datesInfo[targetIdx] + if (!target) continue + if (showLabelAlways) { + target.showTodoLabel = true + } else { + target.showTodoLabel = !target.choosed + } + if (target.showTodoLabel) { + target.todoText = todo.todoText + } + target.color = todo.color + } + return datesInfo +} + +export default () => { + return { + name: 'todo', + beforeRender(calendarData = {}, calendarConfig = {}, component) { + const { todos = [], dates = [], showLabelAlways } = calendarData + const dateWithTodoInfo = updateDatePropertyOfTodoLabel( + todos, + dates, + showLabelAlways + ) + return { + calendarData: { + ...calendarData, + dates: dateWithTodoInfo + }, + calendarConfig + } + }, + methods(component) { + return { + setTodos: (options = {}) => { + const calendar = getCalendarData('calendar', component) + if (!calendar || !calendar.dates) { + return Promise.reject('请等待日历初始化完成后再调用该方法') + } + const { + circle, + dotColor = '', + pos = 'bottom', + showLabelAlways, + dates: todoDates = [] + } = options + const { todos = [] } = calendar + const tranformStr2NumOfTodo = todoDates.map(date => + dateUtil.tranformStr2NumOfDate(date) + ) + const calendarData = { + dates: calendar.dates, + todos: dateUtil.uniqueArrayByDate( + todos.concat(tranformStr2NumOfTodo) + ) + } + if (!circle) { + calendarData.todoLabelPos = pos + calendarData.todoLabelColor = dotColor + } + calendarData.todoLabelCircle = circle || false + calendarData.showLabelAlways = showLabelAlways || false + const existCalendarData = getCalendarData('calendar', component) + return renderCalendar.call(component, { + ...existCalendarData, + ...calendarData + }) + }, + deleteTodos(todos = []) { + if (!(todos instanceof Array) || !todos.length) + return Promise.reject('deleteTodos()应为入参为非空数组') + const existCalendarData = getCalendarData('calendar', component) + const allTodos = existCalendarData.todos || [] + const toDeleteTodos = todos.map(item => dateUtil.toTimeStr(item)) + const remainTodos = allTodos.filter( + item => !toDeleteTodos.includes(dateUtil.toTimeStr(item)) + ) + const { dates, curYear, curMonth } = existCalendarData + const _dates = [...dates] + const currentMonthTodos = dateUtil.filterDatesByYM( + { + year: curYear, + month: curMonth + }, + remainTodos + ) + _dates.forEach(item => { + item.showTodoLabel = false + }) + currentMonthTodos.forEach(item => { + _dates[item.date - 1].showTodoLabel = !_dates[item.date - 1].choosed + }) + return renderCalendar.call(component, { + ...existCalendarData, + dates: _dates, + todos: remainTodos + }) + }, + clearTodos() { + const existCalendarData = getCalendarData('calendar', component) + const _dates = [...existCalendarData.dates] + _dates.forEach(item => { + item.showTodoLabel = false + }) + return renderCalendar.call(component, { + ...existCalendarData, + dates: _dates, + todos: [] + }) + }, + getTodos() { + return getCalendarData('calendar.todos', component) || [] + } + } + } + } +} diff --git a/src/components/calendar/plugins/week.js b/src/components/calendar/plugins/week.js new file mode 100644 index 0000000..673fb7e --- /dev/null +++ b/src/components/calendar/plugins/week.js @@ -0,0 +1,432 @@ +/** + * @Author: drfu* + * @Description: 周视图 + * @Date: 2020-10-08 21:22:09* + * @Last Modified by: drfu + * @Last Modified time: 2020-10-12 14:39:45 + * */ + +import { renderCalendar } from '../render' +import { + getCalendarConfig, + getCalendarData, + logger, + dateUtil +} from '../utils/index' +import { calcJumpData } from '../core' + +/** + * 当月第一周所有日期 + */ +function firstWeekInMonth( + target = {}, + calendarDates = [], + calendarConfig = {} +) { + const { firstDayOfWeek } = calendarConfig + const firstDayOfWeekIsMon = firstDayOfWeek === 'Mon' + const { year, month } = target + let firstDay = dateUtil.getDayOfWeek(year, month, 1) + if (firstDayOfWeekIsMon && firstDay === 0) { + firstDay = 7 + } + const [, end] = [0, 7 - firstDay] + return calendarDates.slice(0, firstDayOfWeekIsMon ? end + 1 : end) +} + +/** + * 当月最后一周所有日期 + */ +function lastWeekInMonth(target = {}, calendarDates = [], calendarConfig = {}) { + const { firstDayOfWeek } = calendarConfig + const firstDayOfWeekIsMon = firstDayOfWeek === 'Mon' + const { year, month } = target + const lastDay = dateUtil.getDatesCountOfMonth(year, month) + let lastDayWeek = dateUtil.getDayOfWeek(year, month, lastDay) + if (firstDayOfWeekIsMon && lastDayWeek === 0) { + lastDayWeek = 7 + } + const [start, end] = [lastDay - lastDayWeek, lastDay] + return calendarDates.slice(firstDayOfWeekIsMon ? start : start - 1, end) +} + +/** + * 判断目标日期是否在某些指定日历内 + */ +function dateIsInDatesRange(target, dates) { + if (!target || !dates || !dates.length) return false + const targetDateStr = dateUtil.toTimeStr(target) + let rst = false + for (let date of dates) { + const dateStr = dateUtil.toTimeStr(date) + if (dateStr === targetDateStr) { + rst = true + return rst + } + rst = false + } + return rst +} + +function getDatesWhenTargetInFirstWeek(target, firstWeekDates) { + const { year, month } = target + const prevMonthInfo = dateUtil.getPrevMonthInfo({ year, month }) + let lastMonthDatesCount = dateUtil.getDatesCountOfMonth( + prevMonthInfo.year, + prevMonthInfo.month + ) + let dates = firstWeekDates + let firstWeekCount = firstWeekDates.length + for (let i = 0; i < 7 - firstWeekCount; i++) { + const week = dateUtil.getDayOfWeek(+year, +month, lastMonthDatesCount) + dates.unshift({ + year: prevMonthInfo.year, + month: prevMonthInfo.month, + date: lastMonthDatesCount, + week + }) + lastMonthDatesCount -= 1 + } + return dates +} + +function getDatesWhenTargetInLastWeek(target, lastWeekDates) { + const { year, month } = target + const prevMonthInfo = dateUtil.getNextMonthInfo({ year, month }) + let dates = lastWeekDates + let lastWeekCount = lastWeekDates.length + for (let i = 0; i < 7 - lastWeekCount; i++) { + const week = dateUtil.getDayOfWeek(+year, +month, i + 1) + dates.push({ + year: prevMonthInfo.year, + month: prevMonthInfo.month, + date: i + 1, + week + }) + } + return dates +} + +function getDates(target, calendarDates = [], calendarConfig = {}) { + const { year, month, date } = target + const targetDay = dateUtil.getDayOfWeek(year, month, date) + const { firstDayOfWeek } = calendarConfig + const firstDayOfWeekIsMon = firstDayOfWeek === 'Mon' + if (firstDayOfWeekIsMon) { + const startIdx = date - (targetDay || 7) + return calendarDates.splice(startIdx, 7) + } else { + const startIdx = date - targetDay - 1 + return calendarDates.splice(startIdx, 7) + } +} + +function getTargetWeekDates(target, calendarConfig) { + if (!target) return + const { year, month } = target + const calendarDates = dateUtil.calcDates(year, month) + const firstWeekDates = firstWeekInMonth(target, calendarDates, calendarConfig) + const lastWeekDates = lastWeekInMonth(target, calendarDates, calendarConfig) + if (dateIsInDatesRange(target, firstWeekDates)) { + return getDatesWhenTargetInFirstWeek(target, firstWeekDates) + } else if (dateIsInDatesRange(target, lastWeekDates)) { + return getDatesWhenTargetInLastWeek(target, lastWeekDates) + } else { + return getDates(target, calendarDates, calendarConfig) + } +} + +/** + * 计算周视图下当前这一周最后一天 + */ +function calculateLastDateOfCurrentWeek(calendarData = {}) { + const { dates = [] } = calendarData + return dates[dates.length - 1] +} +/** + * 计算周视图下当前这一周第一天 + */ +function calculateFirstDateOfCurrentWeek(calendarData = {}) { + const { dates } = calendarData + return dates[0] +} + +/** + * 计算下一周的日期 + */ +function calculateNextWeekDates(calendarData = {}) { + let { curYear, curMonth } = calendarData + let calendarDates = [] + let lastDateInThisWeek = calculateLastDateOfCurrentWeek(calendarData) + const { year: LYear, month: LMonth } = lastDateInThisWeek + if (curYear !== LYear || curMonth !== LMonth) { + calendarDates = dateUtil.calcDates(LYear, LMonth) + curYear = LYear + curMonth = LMonth + } else { + calendarDates = dateUtil.calcDates(curYear, curMonth) + } + const lastDateInThisMonth = dateUtil.getDatesCountOfMonth(curYear, curMonth) + const count = lastDateInThisMonth - lastDateInThisWeek.date + const lastDateIdx = calendarDates.findIndex( + date => dateUtil.toTimeStr(date) === dateUtil.toTimeStr(lastDateInThisWeek) + ) + const startIdx = lastDateIdx + 1 + if (count >= 7) { + return { + dates: calendarDates.splice(startIdx, 7), + year: curYear, + month: curMonth + } + } else { + const nextMonth = dateUtil.getNextMonthInfo({ + year: curYear, + month: curMonth + }) + const { year, month } = nextMonth || {} + const calendarDatesOfNextMonth = dateUtil.calcDates(year, month) + const remainDatesOfThisMonth = calendarDates.splice(startIdx) + const patchDatesOfNextMonth = calendarDatesOfNextMonth.splice( + 0, + 7 - remainDatesOfThisMonth.length + ) + return { + dates: [...remainDatesOfThisMonth, ...patchDatesOfNextMonth], + ...nextMonth + } + } +} + +/** + * 计算上一周的日期 + */ +function calculatePrevWeekDates(calendarData = {}) { + let { curYear, curMonth } = calendarData + let firstDateInThisWeek = calculateFirstDateOfCurrentWeek(calendarData) + let calendarDates = [] + const { year: FYear, month: FMonth } = firstDateInThisWeek + if (curYear !== FYear || curMonth !== FMonth) { + calendarDates = dateUtil.calcDates(FYear, FMonth) + curYear = FYear + curMonth = FMonth + } else { + calendarDates = dateUtil.calcDates(curYear, curMonth) + } + const firstDateIdx = calendarDates.findIndex( + date => dateUtil.toTimeStr(date) === dateUtil.toTimeStr(firstDateInThisWeek) + ) + if (firstDateIdx - 7 >= 0) { + const startIdx = firstDateIdx - 7 + return { + dates: calendarDates.splice(startIdx, 7), + year: curYear, + month: curMonth + } + } else { + const prevMonth = dateUtil.getPrevMonthInfo({ + year: curYear, + month: curMonth + }) + const { year, month } = prevMonth || {} + const calendarDatesOfPrevMonth = dateUtil.calcDates(year, month) + const remainDatesOfThisMonth = calendarDates.splice( + 0, + firstDateInThisWeek.date - 1 + ) + const patchDatesOfPrevMonth = calendarDatesOfPrevMonth.splice( + -(7 - remainDatesOfThisMonth.length) + ) + return { + dates: [...patchDatesOfPrevMonth, ...remainDatesOfThisMonth], + ...prevMonth + } + } +} + +export default () => { + return { + name: 'week', + beforeRender(calendarData = {}, calendarConfig = {}, component) { + const { initializedWeekMode, selectedDates } = calendarData + if (calendarConfig.weekMode && !initializedWeekMode) { + const { defaultDate } = calendarConfig + const target = + (selectedDates && selectedDates[0]) || + (defaultDate && dateUtil.transformDateRow2Dict(defaultDate)) || + dateUtil.todayFMD() + const waitRenderData = this.methods( + component + ).__calcDatesWhenSwitchView('week', target) + const { data, config } = waitRenderData || {} + const setSelectDates = this.methods( + component + ).__selectTargetDateWhenJump(target, data.dates, config) + return { + calendarData: { + ...data, + ...setSelectDates, + weeksCh: dateUtil.getWeekHeader(calendarConfig.firstDayOfWeek), + initializedWeekMode: true + }, + calendarConfig + } + } + return { + calendarData, + calendarConfig + } + }, + onSwitchCalendar(target = {}, calendarData = {}, component) { + const { direction } = target + const { curYear, curMonth } = calendarData + const calendarConfig = getCalendarConfig(component) + let waitRenderData = {} + if (calendarConfig.weekMode) { + if (direction === 'left') { + waitRenderData = calculateNextWeekDates(calendarData) + } else { + waitRenderData = calculatePrevWeekDates(calendarData) + } + const { dates, year, month } = waitRenderData + return { + ...calendarData, + dates, + curYear: year || curYear, + curMonth: month || curMonth + } + } + return calendarData + }, + methods(component) { + return { + __selectTargetDateWhenJump: (target = {}, dates = [], config = {}) => { + let selectedDate = target + const weekDates = dates.map((date, idx) => { + const tmp = { ...date } + tmp.id = idx + const isTarget = + dateUtil.toTimeStr(target) === dateUtil.toTimeStr(tmp) + if (isTarget && !target.choosed && config.autoChoosedWhenJump) { + tmp.choosed = true + selectedDate = tmp + } + return tmp + }) + return { + dates: weekDates, + selectedDates: [selectedDate] + } + }, + __calcDatesForWeekMode(target, config = {}, calendarData = {}) { + const { year, month } = target || {} + const weekDates = getTargetWeekDates(target, config) + weekDates.forEach((date, idx) => (date.id = idx)) + return { + data: { + ...calendarData, + prevMonthGrids: null, + nextMonthGrids: null, + dates: weekDates, + curYear: year, + curMonth: month + }, + config: { + ...config, + weekMode: true + } + } + }, + __calcDatesForMonthMode(target, config = {}, calendarData = {}) { + const { year, month } = target || {} + const waitRenderData = calcJumpData({ + dateInfo: target, + config + }) + return { + data: { + ...calendarData, + ...waitRenderData, + curYear: year, + curMonth: month + }, + config: { + ...config, + weekMode: false + } + } + }, + /** + * 周、月视图切换 + * @param {string} view 视图 [week, month] + * @param {object} target + */ + __calcDatesWhenSwitchView: (view, target) => { + const calendarConfig = getCalendarConfig(component) + if (calendarConfig.multi) + return logger.warn('多选模式不能切换周月视图') + const existCalendarData = getCalendarData('calendar', component) || {} + const { + selectedDates = [], + dates = [], + curYear, + curMonth + } = existCalendarData + const currentMonthSelected = selectedDates.filter( + item => curYear === +item.year || curMonth === +item.month + ) + let jumpTarget = {} + if (target) { + jumpTarget = target + } else { + if (currentMonthSelected.length) { + jumpTarget = currentMonthSelected.pop() + } else { + jumpTarget = dates[0] + } + } + if (view === 'week') { + return this.methods(component).__calcDatesForWeekMode( + jumpTarget, + calendarConfig, + existCalendarData + ) + } else { + return this.methods(component).__calcDatesForMonthMode( + jumpTarget, + calendarConfig, + existCalendarData + ) + } + }, + weekModeJump: dateInfo => { + const target = dateInfo || dateUtil.todayFMD() + const existCalendarData = getCalendarData('calendar', component) || {} + const waitRenderData = this.methods( + component + ).__calcDatesWhenSwitchView('week', target) + const { data, config } = waitRenderData || {} + const setSelectDates = this.methods( + component + ).__selectTargetDateWhenJump(target, data.dates, config) + return renderCalendar.call( + component, + { + ...existCalendarData, + ...data, + ...setSelectDates + }, + config + ) + }, + switchView: (view, target) => { + const waitRenderData = this.methods( + component + ).__calcDatesWhenSwitchView(view, target) + const { data, config } = waitRenderData || {} + if (!data) return logger.warn('当前状态不能切换为周视图') + return renderCalendar.call(component, data, config) + } + } + } + } +} diff --git a/src/components/calendar/render.js b/src/components/calendar/render.js new file mode 100644 index 0000000..ea5a1fa --- /dev/null +++ b/src/components/calendar/render.js @@ -0,0 +1,49 @@ +import plugins from "./plugins/index"; +import { getCalendarConfig } from "./utils/index"; + +/** + * 渲染日历 + */ +export function renderCalendar(calendarData, calendarConfig) { + return new Promise((resolve) => { + const Component = this; + if (Component.firstRender === void 0) { + Component.firstRender = true; + } else { + Component.firstRender = false; + } + const exitData = Component.data.calendar || {}; + for (let plugin of plugins.installed) { + const [, p] = plugin; + if (typeof p.beforeRender === "function") { + const { calendarData: newData, calendarConfig: newConfig } = + p.beforeRender( + { ...exitData, ...calendarData }, + calendarConfig || getCalendarConfig(Component), + Component + ); + calendarData = newData; + calendarConfig = newConfig; + } + } + + Component.setData( + { + config: calendarConfig, + calendar: calendarData, + }, + () => { + const rst = { + calendar: calendarData, + config: calendarConfig, + firstRender: Component.firstRender, + }; + resolve(rst); + if (Component.firstRender) { + Component.triggerEvent("afterCalendarRender", rst); + Component.firstRender = false; + } + } + ); + }); +} diff --git a/src/components/calendar/theme/iconfont.wxss b/src/components/calendar/theme/iconfont.wxss new file mode 100644 index 0000000..9b909a8 --- /dev/null +++ b/src/components/calendar/theme/iconfont.wxss @@ -0,0 +1,29 @@ +@font-face { + font-family: 'iconfont'; + src: url(data:font/truetype;charset=utf-8;base64,AAEAAAANAIAAAwBQRkZUTYda3jUAAAfEAAAAHEdERUYAKQANAAAHpAAAAB5PUy8yPllJ4AAAAVgAAABWY21hcAAP65kAAAHIAAABQmdhc3D//wADAAAHnAAAAAhnbHlmLotR3AAAAxwAAAGkaGVhZBTU+ykAAADcAAAANmhoZWEHKwOFAAABFAAAACRobXR4DasB4gAAAbAAAAAWbG9jYQC0AR4AAAMMAAAAEG1heHABEwAyAAABOAAAACBuYW1lKeYRVQAABMAAAAKIcG9zdEoLnOYAAAdIAAAAUgABAAAAAQAAiPM8al8PPPUACwQAAAAAANjbW5YAAAAA2NtblgCzAAQDTQL8AAAACAACAAAAAAAAAAEAAAOA/4AAXAQAAAAAAANNAAEAAAAAAAAAAAAAAAAAAAAEAAEAAAAHACYAAgAAAAAAAgAAAAoACgAAAP8AAAAAAAAAAQQAAZAABQAAAokCzAAAAI8CiQLMAAAB6wAyAQgAAAIABQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUGZFZABA5+vn7gOA/4AAXAOAAIAAAAABAAAAAAAABAAAAAAAAAAEAAAABAABLgD4ALQAswAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAA5+7//wAA5+v//xgYAAEAAAAAAAABBgAAAQAAAAAAAAABAgAAAAIAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJgBMAI4A0gABAS4ABAMKAvwAEgAACQEmBh0BFBcJAQYdARQWNwE2NAL+/j0ECQYBaP6YBgkEAcMMAZkBYAMEBU0IBf7n/ucFCE0FBAMBYAoeAAAAAQD4AAQC1AL8ABIAAAE1NCYHAQYUFwEWNj0BNCcJATYC1AkE/j0MDAHDBAkG/pgBaAYCpk0FBAP+oAoeCv6gAwQFTQgFARkBGQUAAAIAtAAgA00C4AASACUAAAkBNiYrASIHAwYUFwEWOwEyNicTATYmKwEiBwMGFBcBFjsBMjYnAREBCQMEBU0IBf8HBwD/BQhNBQQDJwEJAwQFTQgF/wcHAP8FCE0FBAMBgAFTBAkG/roJFgn+ugYJBAFTAVMECQb+ugkWCf66BgkEAAAAAAIAswAgA0wC4AASACUAAAEDJisBIgYXCQEGFjsBMjcBNjQlAyYrASIGFwkBBhY7ATI3ATY0AhX/BQhNBQQDAQn+9wMEBU0IBQD/BwEp/wUITQUEAwEJ/vcDBAVNCAUA/wcBlAFGBgkE/q3+rQQJBgFGCRYJAUYGCQT+rf6tBAkGAUYJFgAAAAAAABIA3gABAAAAAAAAABUALAABAAAAAAABAAgAVAABAAAAAAACAAcAbQABAAAAAAADAAgAhwABAAAAAAAEAAgAogABAAAAAAAFAAsAwwABAAAAAAAGAAgA4QABAAAAAAAKACsBQgABAAAAAAALABMBlgADAAEECQAAACoAAAADAAEECQABABAAQgADAAEECQACAA4AXQADAAEECQADABAAdQADAAEECQAEABAAkAADAAEECQAFABYAqwADAAEECQAGABAAzwADAAEECQAKAFYA6gADAAEECQALACYBbgAKAEMAcgBlAGEAdABlAGQAIABiAHkAIABpAGMAbwBuAGYAbwBuAHQACgAACkNyZWF0ZWQgYnkgaWNvbmZvbnQKAABpAGMAbwBuAGYAbwBuAHQAAGljb25mb250AABSAGUAZwB1AGwAYQByAABSZWd1bGFyAABpAGMAbwBuAGYAbwBuAHQAAGljb25mb250AABpAGMAbwBuAGYAbwBuAHQAAGljb25mb250AABWAGUAcgBzAGkAbwBuACAAMQAuADAAAFZlcnNpb24gMS4wAABpAGMAbwBuAGYAbwBuAHQAAGljb25mb250AABHAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAHMAdgBnADIAdAB0AGYAIABmAHIAbwBtACAARgBvAG4AdABlAGwAbABvACAAcAByAG8AagBlAGMAdAAuAABHZW5lcmF0ZWQgYnkgc3ZnMnR0ZiBmcm9tIEZvbnRlbGxvIHByb2plY3QuAABoAHQAdABwADoALwAvAGYAbwBuAHQAZQBsAGwAbwAuAGMAbwBtAABodHRwOi8vZm9udGVsbG8uY29tAAACAAAAAAAAAAoAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAcAAAABAAIBAgEDAQQBBQVyaWdodARsZWZ0CmRvdWJsZWxlZnQLZG91YmxlcmlnaHQAAAAAAAH//wACAAEAAAAMAAAAFgAAAAIAAQADAAYAAQAEAAAAAgAAAAAAAAABAAAAANWkJwgAAAAA2NtblgAAAADY21uW) format('truetype'); + font-weight: normal; + font-style: normal; +} + +.iconfont { + font-family: "iconfont" !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; +} + +.icon-right::before { + content: "\e7eb"; +} + +.icon-left::before { + content: "\e7ec"; +} + +.icon-doubleleft::before { + content: "\e7ed"; +} + +.icon-doubleright::before { + content: "\e7ee"; +} diff --git a/src/components/calendar/theme/theme-default.wxss b/src/components/calendar/theme/theme-default.wxss new file mode 100644 index 0000000..08de663 --- /dev/null +++ b/src/components/calendar/theme/theme-default.wxss @@ -0,0 +1,61 @@ + +/* 日历主要颜色相关样式 */ + +.default_color, +.default_weekend-color, +.default_handle-color, +.default_week-color { + color: #ff629a; +} + +.default_today { + color: #fff; + background-color: #874fb4; +} + +.default_choosed { + color: #fff; + background-color: #ff629a; +} + +.default_date-disable { + color: #c7c7c7; +} + +.default_choosed.default_date-disable { + color: #e2e2e2; + background-color: #c2afb6; +} + +.default_prev-month-date, +.default_next-month-date { + color: #e2e2e2; +} + +.default_normal-date { + color: #88d2ac; +} + +.default_todo-circle { + border-color: #88d2ac; +} + +.default_todo-dot { + background-color: #e54d42; +} + +.default_date-desc { + color: #c2c2c2; +} + +.default_date-desc-lunar { + color: #e54d42; +} + +.default_date-desc-disable { + color: #e2e2e2; +} + +.default_festival { + color: #c2c2c2; +} diff --git a/src/components/calendar/theme/theme-elegant.wxss b/src/components/calendar/theme/theme-elegant.wxss new file mode 100644 index 0000000..6296701 --- /dev/null +++ b/src/components/calendar/theme/theme-elegant.wxss @@ -0,0 +1,58 @@ +.elegant_color, +.elegant_weekend-color, +.elegant_handle-color, +.elegant_week-color { + color: #333; +} + +.elegant_today { + color: #000; + background-color: #e1e7f5; +} + +.elegant_choosed { + color: #000; + background-color: #e2e2e2; +} + +.elegant_date-disable { + color: #c7c7c7; +} + +.elegant_choosed.elegant_date-disable { + color: #999; + background-color: #ebebeb; +} + +.elegant_prev-month-date, +.elegant_next-month-date { + color: #e2e2e2; +} + +.elegant_normal-date { + color: #777; +} + +.elegant_todo-circle { + border-color: #161035; +} + +.elegant_todo-dot { + background-color: #161035; +} + +.elegant_date-desc { + color: #c2c2c2; +} + +.elegant_date-desc-lunar { + color: #161035; +} + +.elegant_date-desc-disable { + color: #e2e2e2; +} + +.elegant_festival { + color: #c2c2c2; +} diff --git a/src/components/calendar/theme/theme-nuohe.wxss b/src/components/calendar/theme/theme-nuohe.wxss new file mode 100644 index 0000000..57489a4 --- /dev/null +++ b/src/components/calendar/theme/theme-nuohe.wxss @@ -0,0 +1,90 @@ +/* 日历主要颜色相关样式 */ + +.nuohe_color, +.nuohe_weekend-color, +.nuohe_handle-color, +.nuohe_week-color { + color: rgba(51, 51, 51, 1); +} + +.nuohe_today { + color: #fff; + background-color: #874fb4; +} + +.nuohe_choosed { + color: rgba(51, 51, 51, 1); + background-color: rgba(189, 189, 189, 0.3); +} + +.nuohe_date-disable { + color: #c7c7c7; +} + +.nuohe_choosed.nuohe_date-disable { + color: #e2e2e2; + background-color: #c2afb6; +} + +.nuohe_prev-month-date, +.nuohe_next-month-date { + color: #e2e2e2; +} + +.nuohe_normal-date { + color: rgba(51, 51, 51, 1); +} + +.nuohe_todo-circle { + border-color: #88d2ac; +} + +.nuohe_todo-dot { + background-color: #e54d42; +} + +.nuohe_date-desc { + color: #c2c2c2; +} + +.nuohe_date-desc-lunar { + color: #e54d42; +} + +.nuohe_date-desc-disable { + color: #e2e2e2; +} + +.nuohe_festival { + color: #c2c2c2; +} + +.date.doc { + position: relative; + background-color: #e5e5e5; +} + +.date.doc::after { + position: absolute; + z-index: 1; + top: -5rpx; + right: -5rpx; + content: ""; + width: 17rpx; + height: 24rpx; + background-repeat: no-repeat; + background-size: cover; + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAABACAYAAABhspUgAAAAAXNSR0IArs4c6QAACAVJREFUaEPtmltsHFcZx/9nZu92bMdJSMitzoWkoXVKUrVV8wKk4gHxgJTwgKA8lhfgCZBoUJEqUYGA0AhRQUSpFJQIHlyqogZFIipUoKiAKJAYQkp9qR1ir9fe6+zuXM4FfWf2MrOJY+/aS0zlkRxZzsw5v/nP/3znO+c7DItcl4vFTWVl/7wg5EctKSK2knCVBFcKcrGH7vL3MvfwVnYeGbsaustgAAODCSDCDLU1Hp/Ym+o7fnrvB9+9U3NssT5ezWe+k5X8qwvCQ0FwVKSEswJg6sfmHH+cm2l0SZ3Tj8F84ChjiDID+1I9ly4ceuTjbQFfyM2MpDk/meEu8oKjJIUG9khh1YHEtUeupgPAWl3AAENEwzLEmIGd8dToq8OPDbcF/OLCrZFZ7p5Mcxc5wVEUAmQLT8mOLFHvfCwzF7ZEC3CcGdiRSIxeHD7WHvDZhZsjM56ngbMELDlsWVO4c4ExOd8E9i1R969vhzhj2BFPjv76cJvApPCtkMK8YYkVOALLUXh7PNE+8M/Iw553MiN8S1ii6eGVAI+mZ0PfhzHoAWfWBlyMMWyPJ0dfG368PUu8nJ8bWRD8ZPYOUWIlwH+YmQ4Dg8FoAPu22J5Ijb7ywKPtAV8uZZ/LC36qIH11q7UIIZRCp8CW5+Ly7M3bgVkzUlC0ONC74VcvHTj6ybaiBN38RmVhV9YxTBs2nrl08VTRrjy1gvEGZRh+HGu5epOp808ceehMFFEkDYN/f++Df1+sn0UnjtYHjB9+63tQ6ssrAV70WcZOyy8+/ZXltL0o8Hfzk3u4jc94Bh7nSm0uOZWNruvFozBMkzEG+iF3KGm5XJTAZFVIxRXCjnGkNB0pIwXPTWYcu6/MeYLAgh1HozHeE48VE6Y5vyFiXknFoufO73/4nWVZ4kwmc9BG5QVLiONcKSYYEFU0z/vd1P3rQaEiBYiwnSvr2Jgo5mFxTz9Gcbj+AjTjmczPKbbF41fej9jnzz5w9J/B9kMKP58e/1xO4ayjZNKlwaUUkqYJJZsDjRKfBcH1dN3pRa3dKpUwX61oqRs5RS1amLWpOmWYzv5k7xfO3X/0p/W+GsBnMtNPLQjvx1UlDUcKQDEkDKanYRJR6W+tMM0dzPPOYYMvmauWkStXfOBA1kYxWecWMJAwDHV/T9+Xzh088kLDSmfmpx9b8Lw3qpDxqv7MCilmaFBJ/9aMmZYcY05VK78aFw2DrGXBdp2AymSLQDIEAynD9B4c3PKRnwwduqIV/ubc5N+Kgj9EnqQEhxIQ+iwyEHPJIm+WSxBMj7TV4NX+lVIiXyzURGCg/NjP3ijdNEAzH/FsjcX/dWn42CH2g+zMJ9Ju5bWyFDrnFQB6GMGSur4N6Bpzq5hwnVUBbW2kWq3CcXyV6QoMvgZwghk43Dtwgn17burlrHBPaGAlEQFDnN68Bku41NDvrQLsVVK2FZhzAcsqNYCpP/rCZA2tsGGAgIeSvRfZs3Pj0wUhdpZr028vo/cj4OaHJ+WvVIpdUbfeaKHg26KpMoU3P7cgaALeHIun2TPpcaskeE9ZSp0v9DPTjwoB4Cytx+xyV4FLxSKE9FeL9TDnZ3D+KoSA+yIRm52aGVOWEiBLVKXEoBHRdtDRoXbNcQ9XuwxMliBrhIBr8VgDGwxJZoI9TcCSo6wkHCmxUQOHV8Zz3MVVu9JVha2SBR6YjCjlrK/1tCUMwwf+WgDYrQGLlsC1VoDJFiHgoMLBSLsWgClSJOvAJdncd6hbYi0B08DzLVFTeB24g+F5t0G3rnAHgt72yLrC93LieO952ARHVDWXQQVuYbqaWQ2rLtrGVJmhEljR6pyRFqS1fIKS+LjB/JmuNQ7vlrMYUs1dxp3udRwrvdJV4GedJ3BDbl6yj1UFdgsJVNMbQp0mt5UQ67OXBLknwOO/OILi2KYQXN++Bez99F/XJvA75x+G9e7GEFzvfTnsf/Iv68CNKhFla50OujWtsD3fA2tyMPSpM3/eBSebCv0tPljBlkfCm9i9Q1kkNofXiF0fdJO/HEb++tYlvXmnGwYOpTF04lrov7oOPDFyGIUb7+sIuP9gBns+Fd6zXgdunen+7xT+z28OIPOn3R1ZYsujU9jxsbf/tx6m3pQMVxzGLhyFNdUycezOYd9n3wrBMeP23c+ue/hO0q7pOLwOfC/Sy1uvfwDZa9tC4g8Oz2L78X8vOTjviYeXpLrLDSsC3qqy2KZyjeYH3EnsKf92JTxLPvti9UOYkv233eefWKEqE52rWGSJFNx9pxbu9Wbge2/VvOYVru/Ar+UN7cb+8FosGTRrz35RpulhE+zrs1TjoKKMf5BuIzN1cTFYRcpwD6NOd2scxRIVZZqbN/q0la7sN6tIumTwjdlxXUWqCAIW6KeiTMtxxXnh4boTPoK4ZJxq84ZssQgvAEwl3HpVXyusK0kG2HNzk/mSEP0VJfS5NCosKjq7USuAU15lKYkbXa4i3czlwOkUQe0KAtfrzf2RqMVOZ6Z+VxD8w1RUJEtElV9JDx4Ipd8nXFtX+btxOULg7ay/d9eohDL/tFX9PCZB70qk3mQ/ys0M5T3nWlXKXqrYcyaRpFtrRw7qiPQyRa3Aso8JLevdqAg/mptHwW1uZ9XPYxIwiUc/GyLRyuH+LcO6d4KuCv5SRYojrpQDFIcjMLTp60dcdMJel6D1YM+y0MI3uUIg57n4RyGLoueGE/xar2SLHsO0NsXi13b1DDz5/H0Hxv8Lo3UyF0Y2DrcAAAAASUVORK5CYII="); +} + +.date.error { + background-color: rgba(207, 83, 117, 1); + border-radius: 50%; + color: #fff; +} + +.date.primary { + background-color: rgba(37, 217, 200, 1); + color: #fff; + border-radius: 50%; +} diff --git a/src/components/calendar/utils/index.js b/src/components/calendar/utils/index.js new file mode 100644 index 0000000..5d5da50 --- /dev/null +++ b/src/components/calendar/utils/index.js @@ -0,0 +1,275 @@ +import Logger from "./logger"; +import WxData from "./wxData"; + +let systemInfo; +export function getSystemInfo() { + if (systemInfo) return systemInfo; + systemInfo = wx.getSystemInfoSync(); + return systemInfo; +} + +export function isIos() { + const sys = getSystemInfo(); + return /iphone|ios/i.test(sys.platform); +} + +class Gesture { + /** + * 左滑 + * @param {object} e 事件对象 + * @returns {boolean} 布尔值 + */ + isLeft(gesture = {}, touche = {}) { + const { startX, startY } = gesture; + const deltaX = touche.clientX - startX; + const deltaY = touche.clientY - startY; + if (deltaX < -60 && deltaY < 20 && deltaY > -20) { + return true; + } else { + return false; + } + } + /** + * 右滑 + * @param {object} e 事件对象 + * @returns {boolean} 布尔值 + */ + isRight(gesture = {}, touche = {}) { + const { startX, startY } = gesture; + const deltaX = touche.clientX - startX; + const deltaY = touche.clientY - startY; + + if (deltaX > 60 && deltaY < 20 && deltaY > -20) { + return true; + } else { + return false; + } + } +} + +class DateUtil { + newDate(year, month, date) { + let cur = `${+year}-${+month}-${+date}`; + if (isIos()) { + cur = `${+year}/${+month}/${+date}`; + } + return new Date(cur); + } + /** + * 计算指定日期时间戳 + * @param {object} date + */ + getTimeStamp(dateInfo) { + if (typeof dateInfo === "string") { + dateInfo = this.transformDateRow2Dict(dateInfo); + } + if (Object.prototype.toString.call(dateInfo) !== "[object Object]") return; + const dateUtil = new DateUtil(); + return dateUtil.newDate(dateInfo.year, dateInfo.month, dateInfo.date).getTime(); + } + /** + * 计算指定月份共多少天 + * @param {number} year 年份 + * @param {number} month 月份 + */ + getDatesCountOfMonth(year, month) { + return new Date(Date.UTC(year, month, 0)).getUTCDate(); + } + /** + * 计算指定月份第一天星期几 + * @param {number} year 年份 + * @param {number} month 月份 + */ + firstDayOfWeek(year, month) { + return new Date(Date.UTC(year, month - 1, 1)).getUTCDay(); + } + /** + * 计算指定日期星期几 + * @param {number} year 年份 + * @param {number} month 月份 + * @param {number} date 日期 + */ + getDayOfWeek(year, month, date) { + return new Date(Date.UTC(year, month - 1, date)).getUTCDay(); + } + todayFMD() { + const _date = new Date(); + const year = _date.getFullYear(); + const month = _date.getMonth() + 1; + const date = _date.getDate(); + return { + year: +year, + month: +month, + date: +date, + }; + } + todayTimestamp() { + const { year, month, date } = this.todayFMD(); + const timestamp = this.newDate(year, month, date).getTime(); + return timestamp; + } + toTimeStr(dateInfo = {}) { + return `${+dateInfo.year}-${+dateInfo.month}-${+dateInfo.date}`; + } + transformDateRow2Dict(dateStr) { + if (typeof dateStr === "string" && dateStr.includes("-")) { + const [year, month, date] = dateStr.split("-"); + return this.tranformStr2NumOfDate({ + year, + month, + date, + }); + } + return {}; + } + tranformStr2NumOfDate(date = {}) { + const target = { ...date }; + // 可能传入字符串 + target.year = +target.year; + target.month = +target.month; + target.date = +target.date; + return target; + } + sortDatesByTime(dates = [], sortType) { + return dates.sort((a, b) => { + const at = this.getTimeStamp(a); + const bt = this.getTimeStamp(b); + if (at < bt && sortType !== "desc") { + return -1; + } else { + return 1; + } + }); + } + getPrevMonthInfo(date = {}) { + const prevMonthInfo = + Number(date.month) > 1 + ? { + year: +date.year, + month: Number(date.month) - 1, + } + : { + year: Number(date.year) - 1, + month: 12, + }; + return prevMonthInfo; + } + getNextMonthInfo(date = {}) { + const nextMonthInfo = + Number(date.month) < 12 + ? { + year: +date.year, + month: Number(date.month) + 1, + } + : { + year: Number(date.year) + 1, + month: 1, + }; + return nextMonthInfo; + } + getPrevYearInfo(date = {}) { + return { + year: Number(date.year) - 1, + month: +date.month, + }; + } + getNextYearInfo(date = {}) { + return { + year: Number(date.year) + 1, + month: +date.month, + }; + } + findDateIndexInArray(target, dates) { + return dates.findIndex((item) => dateUtil.toTimeStr(item) === dateUtil.toTimeStr(target)); + } + calcDates(year, month) { + const datesCount = this.getDatesCountOfMonth(year, month); + const dates = []; + const today = dateUtil.todayFMD(); + for (let i = 1; i <= datesCount; i++) { + const week = dateUtil.getDayOfWeek(+year, +month, i); + const date = { + year: +year, + id: i - 1, + month: +month, + date: i, + week, + isToday: +today.year === +year && +today.month === +month && i === +today.date, + }; + dates.push(date); + } + return dates; + } + /** + * 日期数组根据日期去重 + * @param {array} array 数组 + */ + uniqueArrayByDate(array = []) { + let uniqueObject = {}; + let uniqueArray = []; + array.forEach((item) => { + uniqueObject[dateUtil.toTimeStr(item)] = item; + }); + for (let i in uniqueObject) { + uniqueArray.push(uniqueObject[i]); + } + return uniqueArray; + } + /** + * 筛选指定年月日期 + * @param {object} target 指定年月 + * @param {array} dates 待筛选日期 + */ + filterDatesByYM(target, dates) { + if (target) { + const { year, month } = target; + const _dates = dates.filter((item) => +item.year === +year && +item.month === +month); + return _dates; + } + return dates; + } + getWeekHeader(firstDayOfWeek) { + let weeksCh = ["日", "一", "二", "三", "四", "五", "六"]; + if (firstDayOfWeek === "Mon") { + weeksCh = ["一", "二", "三", "四", "五", "六", "日"]; + } + return weeksCh; + } +} + +/** + * 获取当前页面实例 + */ +export function getCurrentPage() { + const pages = getCurrentPages() || []; + const last = pages.length - 1; + return pages[last] || {}; +} + +export function getComponentById(componentId) { + const logger = new Logger(); + let page = getCurrentPage() || {}; + if (page.selectComponent && typeof page.selectComponent === "function") { + if (componentId) { + return page.selectComponent(componentId); + } else { + logger.warn("请传入组件ID"); + } + } else { + logger.warn("该基础库暂不支持多个小程序日历组件"); + } +} + +export const logger = new Logger(); +export const calendarGesture = new Gesture(); +export const dateUtil = new DateUtil(); +export const getCalendarData = (key, component) => new WxData(component).getData(key); +export const setCalendarData = (data, component) => new WxData(component).setData(data); +export const getCalendarConfig = (component) => getCalendarData("config", component); +export const setCalendarConfig = (config, component) => + setCalendarData( + { + config, + }, + component, + ); diff --git a/src/components/calendar/utils/logger.js b/src/components/calendar/utils/logger.js new file mode 100644 index 0000000..b440ba6 --- /dev/null +++ b/src/components/calendar/utils/logger.js @@ -0,0 +1,23 @@ +export default class Logger { + info(msg) { + console.log( + '%cInfo: %c' + msg, + 'color:#FF0080;font-weight:bold', + 'color: #FF509B' + ) + } + warn(msg) { + console.log( + '%cWarn: %c' + msg, + 'color:#FF6600;font-weight:bold', + 'color: #FF9933' + ) + } + tips(msg) { + console.log( + '%cTips: %c' + msg, + 'color:#00B200;font-weight:bold', + 'color: #00CC33' + ) + } +} diff --git a/src/components/calendar/utils/wxData.js b/src/components/calendar/utils/wxData.js new file mode 100644 index 0000000..43b254d --- /dev/null +++ b/src/components/calendar/utils/wxData.js @@ -0,0 +1,30 @@ +class WxData { + constructor(component) { + this.Component = component + } + getData(key) { + const data = this.Component.data + if (!key) return data + if (key.includes('.')) { + let keys = key.split('.') + const tmp = keys.reduce((prev, next) => { + return prev[next] + }, data) + return tmp + } else { + return this.Component.data[key] + } + } + setData(data) { + return new Promise((resolve, reject) => { + if (!data) return reject('no data to set') + if (typeof data === 'object') { + this.Component.setData(data, () => { + resolve(data) + }) + } + }) + } +} + +export default WxData diff --git a/src/components/customPoster/README.md b/src/components/customPoster/README.md new file mode 100644 index 0000000..7fed6ab --- /dev/null +++ b/src/components/customPoster/README.md @@ -0,0 +1,160 @@ +# 海报插件 + +## 基于[wxml2canvas](https://github.com/wg-front/wxml2canvas)插件 + +### 插件引入 + +```json +{ + "customPoster": "/components/customPoster/index" +} +``` + +```wxml + +``` + +### 参数示例 + +```js +const data = { + params: { + info: { id: 'circle-note_mp', title: '动态页', desc: '指定动态的页面,mp' }, + body: { + bgImg: + 'https://picsissiok-10049618.cos.ap-shanghai.myqcloud.com/a74018e725861534f1644cff04780f4e_16273677601587.png', + width: '750', + height: '1254', + }, + elements: [ + { + id: 'circle-name', + desc: '圈名称', + type: 1, + text: '治疗讨论', + font: '宋体', + 'font-size': '42', + color: '#FFFFFF', + 'single-line': true, + halign: 'center', + top: '106', + }, + { + id: 'master-name', + desc: '专家名称', + type: 1, + text: '健康小贴士', + font: '宋体', + 'font-size': '38', + color: '#FFFFFF', + 'single-line': true, + halign: 'center', + top: '237', + }, + { + id: 'master-avatar', + desc: '专家头像', + type: 0, + picType: 'avatar', + src: 'https://picsissiok-10049618.cos.ap-shanghai.myqcloud.com/ceb31ac6137e873225b8cc826389a267_16655329078962.jpg', + width: '120', + height: '120', + halign: 'center', + shape: 'circle', + top: '328', + }, + { + id: 'note-content', + desc: '动态内容', + type: 1, + text: '11月5日上海组织进口博览会CIIE大会,邀请大家来我们的展馆现场交流。', + font: '宋体', + 'font-size': '45', + color: '#18191A', + width: '630', + height: '348', + left: '60', + top: '495', + }, + { + id: 'note-title', + desc: '长文标题', + type: 1, + text: '', + font: '宋体', + 'font-size': '42', + color: '#18191A', + width: '659', + height: '116', + left: '46', + top: '495', + 'font-weight': 'bold', + }, + { + id: 'note-summary', + desc: '长文摘要 ', + type: 1, + text: '', + font: '宋体', + 'font-size': '42', + color: '#18191A', + width: '672', + height: '232', + left: '39', + top: '646', + }, + { + id: 'note-more', + desc: '还有', + type: 1, + text: '还有3条精彩附件>', + font: '宋体', + 'font-size': '31', + color: '#666666', + 'single-line': true, + width: '292', + height: '46', + left: '60', + top: '1024', + }, + { + id: 'scanText', + desc: '扫描二维码查看详情', + type: 1, + text: '扫描二维码查看详情', + font: '宋体', + 'font-size': '31', + color: '#666666', + 'single-line': true, + width: '279', + height: '43', + left: '60', + top: '1087', + }, + { + id: 'note-qrcode', + desc: '专家列表的二维码', + type: 0, + picType: 'qrcode', + src: 'https://family.devred.hbraas.com/proxy/mp.weixin.qq.com/cgi-bin/showqrcode?ticket=gQHJ8TwAAAAAAAAAAS5odHRwOi8vd2VpeGluLnFxLmNvbS9xLzAyUWhDdGhTWVNlTjMxMDAwMDAwN3gAAgSonPxjAwQAAAAA', + width: '130', + height: '130', + left: '554', + top: '1012', + }, + { + id: 'brand', + desc: 'brand×华秉科技', + type: 1, + text: '做企业数字化转型的亲密伙伴×华秉科技', + font: '宋体', + 'font-size': '24', + color: '#B2B3B4', + 'single-line': true, + halign: 'center', + top: '1192', + }, + ], + }, +} +``` diff --git a/src/components/customPoster/index.js b/src/components/customPoster/index.js new file mode 100644 index 0000000..25b1011 --- /dev/null +++ b/src/components/customPoster/index.js @@ -0,0 +1,101 @@ +import Wxml2Canvas from "./wxml2canvas/index.js"; // 根据具体路径修改,node_modules会被忽略 + +Component({ + properties: { + params: { + type: Object, + observer(newVal, _olVal) { + if (Object.keys(newVal).length > 0) { + this.paramsFormat(newVal); + this.setData({ + width: newVal.body.width, + height: newVal.body.height, + bgImg: newVal.body.bgImg, + elementsMp: newVal.elements, + }); + this.drawImage(); + } + }, + }, + }, + data: { + imgUrl: "", + width: "", + height: "", + imgheight: "", + bgImg: "", + elementsMp: [], + }, + lifetimes: { + attached() {}, + }, + methods: { + paramsFormat(params) { + params.elements.forEach((item) => { + if (item.type === 0) { + // 图片居中 + if (item.halign === "center") { + item.left = (params.body.width - item.width) / 2; + } + } else { + item.text = item.text.replace(/[\r\n]/g, ""); + // 文字居中(使文字标签宽度等于画布宽度,文字加上居中的className) + if (item.halign === "center") { + item.width = item.width || params.body.width; + item.left = (params.body.width - item.width) / 2; + } + if (item.halign === "right") { + item.width = params.body.width; + } + if (item.id === "shareText" && item.text.length > 30) { + item.text = item.text.slice(0, 30) + "..."; + } + if (item.id === "note-title" && item.text.length > 28) { + item.text = item.text.slice(0, 28) + "..."; + } + if (item.id === "note-content" && item.text.length > 90) { + item.text = item.text.slice(0, 90) + "..."; + } + let len = params.elements.some((x) => x.id === "note-title" && x.text.length); + if (len && item.id === "note-summary" && item.text.length > 62) { + item.text = item.text.slice(0, 62) + "..."; + } else if (item.id === "note-summary" && item.text.length > 76) { + item.text = item.text.slice(0, 76) + "..."; + } + } + }); + }, + drawImage() { + let self = this; + this.drawImage1 = new Wxml2Canvas({ + obj: self, + width: this.data.width, // 宽, 以iphone6为基准,传具体数值,其它机型自动适配 + height: this.data.height, // 高 + element: "canvas1", + background: "transparent", + progress(percent) {}, + finish(url) { + self.setData({ + imgUrl: url, + }); + self.triggerEvent("finish", url); + }, + error(res) {}, + }); + + let data = { + list: [ + { + type: "wxml", + class: "#canvas-bill-body-mp .draw_canvas", + limit: "#canvas-bill-body-mp", + x: 0, + y: 0, + }, + ], + }; + + this.drawImage1.draw(data); + }, + }, +}); diff --git a/src/components/customPoster/index.json b/src/components/customPoster/index.json new file mode 100644 index 0000000..a97367d --- /dev/null +++ b/src/components/customPoster/index.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} diff --git a/src/components/customPoster/index.scss b/src/components/customPoster/index.scss new file mode 100644 index 0000000..5dce05f --- /dev/null +++ b/src/components/customPoster/index.scss @@ -0,0 +1,53 @@ +.canvas-box { + position: fixed; + left: 1000000rpx; + top: -1000000rpx; +} +.canvas-body { + background-position: center; + background-repeat: no-repeat; + background-size: cover; + background-color: #fff; +} +.draw_canvas { + position: absolute; +} +.canvas-bill { + position: fixed; + width: 750rpx; + left: 1000000rpx; + top: -1000000rpx; + visibility: hidden; +} +.lineOne { + // overflow: hidden; + // text-overflow: ellipsis; + // white-space: nowrap; +} +.textCenter { + text-align: center; +} +.textRight { + text-align: right; +} +.billImg-box { + position: fixed; + left: 0; + top: 0; + z-index: 10; + width: 750rpx; + height: 100vh; + display: flex; + justify-content: center; + align-items: center; + background-color: rgba(0, 0, 0, 0.75); +} +.image-load-text { + width: 750rpx; + text-align: center; + color: #fff; + line-height: 50rpx; + margin-top: 20rpx; + font-size: 28rpx; + letter-spacing: 2rpx; +} diff --git a/src/components/customPoster/index.wxml b/src/components/customPoster/index.wxml new file mode 100644 index 0000000..511c91a --- /dev/null +++ b/src/components/customPoster/index.wxml @@ -0,0 +1,43 @@ + + + + + + {{item.text}} + + + + + + + + + + + + + + diff --git a/src/components/customPoster/wxml2canvas/README.md b/src/components/customPoster/wxml2canvas/README.md new file mode 100644 index 0000000..e69de29 diff --git a/src/components/customPoster/wxml2canvas/index.js b/src/components/customPoster/wxml2canvas/index.js new file mode 100644 index 0000000..97b0ab6 --- /dev/null +++ b/src/components/customPoster/wxml2canvas/index.js @@ -0,0 +1,1692 @@ +module.exports = (function () { + var __MODS__ = {}; + var __DEFINE__ = function (modId, func, req) { + var m = { exports: {}, _tempexports: {} }; + __MODS__[modId] = { status: 0, func: func, req: req, m: m }; + }; + var __REQUIRE__ = function (modId, source) { + if (!__MODS__[modId]) return require(source); + if (!__MODS__[modId].status) { + var m = __MODS__[modId].m; + m._exports = m._tempexports; + var desp = Object.getOwnPropertyDescriptor(m, "exports"); + if (desp && desp.configurable) + Object.defineProperty(m, "exports", { + set: function (val) { + if (typeof val === "object" && val !== m._exports) { + m._exports.__proto__ = val.__proto__; + Object.keys(val).forEach(function (k) { + m._exports[k] = val[k]; + }); + } + m._tempexports = val; + }, + get: function () { + return m._tempexports; + }, + }); + __MODS__[modId].status = 1; + __MODS__[modId].func(__MODS__[modId].req, m, m.exports); + } + return __MODS__[modId].m.exports; + }; + var __REQUIRE_WILDCARD__ = function (obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + if (obj != null) { + for (var k in obj) { + if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; + } + } + newObj.default = obj; + return newObj; + } + }; + var __REQUIRE_DEFAULT__ = function (obj) { + return obj && obj.__esModule ? obj.default : obj; + }; + __DEFINE__( + 1685064731946, + function (require, module, exports) { + var __TEMP__ = require("./src/index"); + var Wxml2Canvas = __REQUIRE_DEFAULT__(__TEMP__); + + if (!exports.__esModule) Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = Wxml2Canvas; + }, + function (modId) { + var map = { "./src/index": 1685064731947 }; + return __REQUIRE__(map[modId], modId); + }, + ); + __DEFINE__( + 1685064731947, + function (require, module, exports) { + var __TEMP__ = require("./util"); + var Util = __REQUIRE_DEFAULT__(__TEMP__); + + const imageMode = [ + "scaleToFill", + "aspectFit", + "aspectFill", + "widthFix", + "top", + "bottom", + "center", + "left", + "right", + "top left", + "top right", + "bottom left", + "bottom right", + ]; + + class Wxml2Canvas { + constructor(options = {}) { + this.device = (wx.getSystemInfoSync && wx.getSystemInfoSync()) || {}; + + if (!options.zoom) { + this.zoom = this.device.windowWidth / 375; + } else { + this.zoom = options.zoom || 1; + } + + this.element = options.element; + this.object = options.obj; + this.width = options.width * this.zoom || 0; + this.height = options.height * this.zoom || 0; + this.destZoom = options.destZoom || 3; + this.destWidth = this.width * this.destZoom; + this.destHeight = this.height * this.destZoom; + this.translateX = options.translateX * this.zoom || 0; + this.translateY = options.translateY * this.zoom || 0; + this.gradientBackground = options.gradientBackground || null; + this.background = options.background || "#ffffff"; + this.finishDraw = options.finish || function finish(params) {}; + this.errorHandler = options.error || function error(params) {}; + this.progress = options.progress || function progress(params) {}; + this.textAlign = options.textAlign || "left"; + this.fullText = options.fullText || false; + this.font = options.font || "14px PingFang SC"; + + this._init(); + } + + draw(data = {}, that) { + let self = this; + this.data = data; + this.fef = that; + + this.progress(10); + this._preloadImage(data.list) + .then((result) => { + this.progress(30); + self._draw(); + }) + .catch((res) => { + self.errorHandler(res); + }); + } + + measureWidth(text, font) { + if (font) { + this.ctx.font = font; + } + let res = this.ctx.measureText(text) || {}; + return res.width || 0; + } + + _init() { + this.progressPercent = 0; // 绘制进度百分比 + this.data = null; + this.ref = null; + this.allPic = []; + this.screenList = []; + this.asyncList = []; + this.imgUrl = ""; + this.progressPercent = 0; + this.distance = 0; + this.progress(0); + + this.ctx = wx.createCanvasContext(this.element, this.object); + this.ctx.font = this.font; + this.ctx.setTextBaseline("top"); + this.ctx.setStrokeStyle("white"); + + this.debug = this.device.platform === "devtools" ? true : false; + + this._drawBakcground(); + } + + _drawBakcground() { + if (this.gradientBackground) { + let line = this.gradientBackground.line || [0, 0, 0, this.height]; + let color = this.gradientBackground.color || ["#fff", "#fff"]; + let style = { fill: { line, color } }; + this._drawRectToCanvas(0, 0, this.width, this.height, style); + } else { + let style = { fill: this.background }; + this._drawRectToCanvas(0, 0, this.width, this.height, style); + } + } + + _draw() { + let self = this; + let list = this.data.list || []; + let index = 0; + let all = []; + let count = 0; + + list.forEach((item) => { + if (item.type === "wxml") { + count += 3; + } else { + count += 1; + } + }); + + this.distance = 60 / (count || 1); // 进度条的间距 + this.progressPercent = 30; + this.asyncList = list.filter((item) => item.delay == true); + list = list.filter((item) => item.delay != true); + drawList(list); + + Promise.all(all) + .then((results) => { + index = 0; + drawList(self.asyncList, true); + + Promise.all(all).then((results) => { + self.progress(90); + self._saveCanvasToImage(); + }); + }) + .catch((e) => { + console.log(e); + self.errorHandler(e); + }); + + function drawList(list = [], noDelay) { + list.forEach((item, i) => { + all[index++] = new Promise((resolve, reject) => { + let attr = item.style; + item.progress = self.distance; + if (noDelay) { + item.delay = 0; + } + if (item.type === "radius-image") { + self._drawCircle(item, attr, resolve, reject, "image"); + } else if (item.type === "text") { + self._drawText(item, attr, resolve, reject); + } else if (item.type === "line") { + self._drawLine(item, attr, resolve, reject); + } else if (item.type === "circle") { + self._drawCircle(item, attr, resolve, reject); + } else if (item.type === "rect") { + self._drawRect(item, attr, resolve, reject); + } else if (item.type === "image") { + self._drawRect(item, attr, resolve, reject, "image"); + } else if (item.type === "wxml") { + self._drawWxml(item, attr, resolve, reject); + } else { + resolve(); + } + }); + }); + } + } + + _saveCanvasToImage() { + let self = this; + + // 延时保存有两个原因,一个是等待绘制delay的元素,另一个是安卓上样式会错乱 + setTimeout( + () => { + self.progress(95); + + let obj = { + x: 0, + y: 0, + width: self.width, + height: self.height, + canvasId: self.element, + success: function (res) { + self.progress(100); + self.imgUrl = res.tempFilePath; + self.finishDraw(self.imgUrl); + }, + fail: function (res) { + self.errorHandler({ errcode: 1000, errmsg: "save canvas error", e: res }); + }, + }; + + if (self.destZoom !== 3) { + obj.destWidth = self.destWidth; + obj.destHeight = self.destHeight; + } + + wx.canvasToTempFilePath(obj, self.object); + }, + self.device.system.indexOf("iOS") === -1 ? 300 : 100, + ); + } + + _preloadImage(list = []) { + let self = this; + let all = []; + let count = 0; + + list.forEach((item, i) => { + if (item.url && self._findPicIndex(item.url) === -1) { + // 避免重复下载同一图片 + self.allPic.push({ + url: item.url, + local: "", + }); + all[count++] = new Promise((resolve, reject) => { + // 非http(s)域名的就不下载了 + if ( + !/^http/.test(item.url) || + /^http:\/\/(tmp)|(usr)\//.test(item.url) || + /^http:\/\/127\.0\.0\.1/.test(item.url) + ) { + if (item.isBase64) { + let fileManager = wx.getFileSystemManager(); + + fileManager.writeFile({ + filePath: item.url, + data: item.isBase64.replace(/data:image\/(.*);base64,/, ""), + encoding: "base64", + success(res) { + imageInfo(item.url); + }, + fail(res) { + reject(res); + }, + }); + } else { + imageInfo(item.url); + } + + function imageInfo(url) { + wx.getImageInfo({ + src: url, + success(res) { + let index = self._findPicIndex(url); + if (index > -1) { + self.allPic[index].local = url; + self.allPic[index].width = res.width; + self.allPic[index].height = res.height; + } + resolve({ tempFilePath: url }); + }, + fail(res) { + reject(res); + }, + }); + } + } else { + wx.downloadFile({ + url: item.url.replace(/^https?/, "https"), + success: function (res) { + wx.getImageInfo({ + src: res.tempFilePath, + success(img) { + let index = self._findPicIndex(item.url); + if (index > -1) { + self.allPic[index].local = res.tempFilePath; + self.allPic[index].width = img.width; + self.allPic[index].height = img.height; + } + resolve(res); + }, + fail(res) { + reject(res); + }, + }); + }, + fail: (res) => { + reject({ errcode: 1001, errmsg: "download pic error" }); + }, + }); + } + }); + } + }); + + return Promise.all(all) + .then((results) => { + return new Promise((resolve) => { + resolve(); + }); + }) + .catch((results) => { + return new Promise((resolve, reject) => { + reject(results); + }); + }); + } + + _findPicIndex(url) { + let index = this.allPic.findIndex((pic) => pic.url === url); + return index; + } + + _drawRect(item, style, resolve, reject, isImage, isWxml) { + let zoom = this.zoom; + let leftOffset = 0; + let topOffset = 0; + let width = style.width; + let height = style.height; + let imgWidth = style.width; + let imgHeight = style.height; + let mode = null; + + try { + item.x = this._resetPositionX(item, style); + item.y = this._resetPositionY(item, style); + + let url; + if (isImage) { + let index = this._findPicIndex(item.url); + if (index > -1) { + url = this.allPic[index].local; + imgWidth = this.allPic[index].width; + imgHeight = this.allPic[index].height; + } else { + url = item.url; + } + } + + style.padding = style.padding || []; + if (isWxml === "inline-wxml") { + item.x = item.x + ((style.padding[3] && style.padding[3]) || 0); + item.y = item.y + ((style.padding[0] && style.padding[0]) || 0); + } + + leftOffset = item.x + style.width + ((style.padding[1] && style.padding[1]) || 0); + + if (!isWxml) { + width = width * zoom; + height = height * zoom; + } + + if (style.dataset && style.dataset.mode && imageMode.indexOf(style.dataset.mode) > -1) { + mode = { + type: style.dataset.mode, + width: imgWidth, + height: imgHeight, + }; + } + + this._drawRectToCanvas(item.x, item.y, width, height, style, url, mode); + this._updateProgress(item.progress); + + if (resolve) { + resolve(); + } else { + return { + leftOffset, + topOffset, + }; + } + } catch (e) { + reject && + reject({ errcode: isImage ? 1003 : 1002, errmsg: isImage ? "drawImage error" : "drawRect error", e }); + } + } + + _drawRectToCanvas(x, y, width, height, style, url, mode) { + let { fill, border, boxShadow } = style; + this.ctx.save(); + this._drawBoxShadow(boxShadow, (res) => { + // 真机上填充渐变色时,没有阴影,先画个相等大小的纯色矩形来实现阴影 + if (fill && typeof fill !== "string" && !this.debug) { + this.ctx.setFillStyle(res.color || "#ffffff"); + this.ctx.fillRect(x, y, width, height); + } + }); + + if (url) { + // 开发者工具有bug,先不裁剪 + if (mode) { + this._resetImageByMode(url, x, y, width, height, mode); + } else { + this.ctx.drawImage(url, x, y, width, height); + } + } else { + this._setFill(fill, () => { + this.ctx.fillRect(x, y, width, height); + }); + } + + this._drawBorder(border, style, (border) => { + let fixBorder = border.width; + this.ctx.strokeRect(x - fixBorder / 2, y - fixBorder / 2, width + fixBorder, height + fixBorder); + }); + + this.ctx.draw(true); + this.ctx.restore(); + this.ctx.strokeStyle = "#fff"; + } + + _resetImageByMode(url, x, y, width, height, mode) { + let self = this; + let offsetX = 0; + let offsetY = 0; + let imgWidth = mode.width; + let imgHeight = mode.height; + + switch (mode.type) { + case "scaleToFill": + imgWidth = width; + imgHeight = height; + self.ctx.drawImage(url, x, y, width, height); + break; + case "widthFix": + height = width / ((imgWidth || 1) / (imgHeight || 1)); + self.ctx.drawImage(url, x, y, width, height); + break; + case "aspectFit": + if (imgWidth > imgHeight) { + let realHeight = width / ((imgWidth || 1) / (imgHeight || 1)); + offsetY = -(height - realHeight) / 2; + imgWidth = width; + imgHeight = realHeight; + } else { + let realWidth = height / ((imgHeight || 1) / (imgWidth || 1)); + offsetX = -(width - realWidth) / 2; + imgWidth = realWidth; + imgHeight = height; + } + + _clip(); + break; + case "aspectFill": + if (imgWidth > imgHeight) { + let realWidth = imgWidth / ((imgHeight || 1) / (height || 1)); + offsetX = (realWidth - width) / 2; + imgWidth = realWidth; + imgHeight = height; + } else { + let realHeight = imgHeight / ((imgWidth || 1) / (width || 1)); + offsetY = (realHeight - height) / 2; + imgWidth = width; + imgHeight = realHeight; + } + + _clip(); + break; + case "top left": + _clip(); + break; + case "top": + offsetX = (mode.width - width) / 2; + _clip(); + break; + case "top right": + offsetX = mode.width - width; + _clip(); + break; + case "left": + offsetY = (mode.height - height) / 2; + _clip(); + break; + case "center": + offsetX = (mode.width - width) / 2; + offsetY = (mode.height - height) / 2; + _clip(); + break; + case "right": + offsetX = mode.width - width; + offsetY = (mode.height - height) / 2; + _clip(); + break; + case "bottom left": + offsetY = mode.height - height; + _clip(); + break; + case "bottom": + offsetX = (mode.width - width) / 2; + offsetY = mode.height - height; + _clip(); + break; + case "bottom right": + offsetX = mode.width - width; + offsetY = mode.height - height; + _clip(); + break; + default: + imgWidth = width; + imgHeight = height; + break; + } + + function _clip() { + self.ctx.save(); + self.ctx.beginPath(); + self.ctx.rect(x, y, width, height); + self.ctx.clip(); + self.ctx.drawImage(url, x - offsetX, y - offsetY, imgWidth, imgHeight); + self.ctx.closePath(); + self.ctx.restore(); + } + } + + _drawText(item, style, resolve, reject, type, isWxml) { + let zoom = this.zoom; + let leftOffset = 0; + let topOffset = 0; + + try { + style.fontSize = this._parseNumber(style.fontSize); + let fontSize = Math.ceil((style.fontSize || 14) * zoom); + this.ctx.setTextBaseline("top"); + this.ctx.font = `${style.fontWeight ? style.fontWeight : "normal"} ${fontSize}px ${ + style.fontFamily || "PingFang SC" + }`; + this.ctx.setFillStyle(style.color || "#454545"); + + let text = item.text || ""; + let textWidth = Math.floor(this.measureWidth(text, style.font || this.ctx.font)); + let lineHeight = this._getLineHeight(style); + let textHeight = Math.ceil(textWidth / (style.width || textWidth)) * lineHeight; + let width = Math.ceil((style.width || textWidth) * (!isWxml ? zoom : 1)); + let whiteSpace = style.whiteSpace || "wrap"; + let x = 0; + let y = 0; + + if (typeof style.padding === "string") { + style.padding = Util.transferPadding(style.padding); + } + item.x = this._resetPositionX(item, style); + item.y = this._resetPositionY(item, style, textHeight); + this._drawBoxShadow(style.boxShadow); + + if (style.background || style.border) { + this._drawTextBackgroud(item, style, textWidth, textHeight, isWxml); + } + + // 行内文本 + if (type === "inline-text") { + width = item.maxWidth; + if (item.leftOffset + textWidth > width) { + // 如果上一个行内元素换行了,这个元素要继续在后面补足一行 + let lineNum = Math.max(Math.floor(textWidth / width), 1); + let length = text.length; + let singleLength = Math.floor(length / lineNum); + let widthOffset = item.leftOffset ? item.leftOffset - item.originX : 0; + let { + endIndex: currentIndex, + single, + singleWidth, + } = this._getTextSingleLine(text, width, singleLength, 0, widthOffset); + x = this._resetTextPositionX(item, style, singleWidth); + y = this._resetTextPositionY(item, style); + this.ctx.fillText(single, x, y); + leftOffset = x + singleWidth; + topOffset = y; + + // 去除第一行补的内容,然后重置 + text = text.substring(currentIndex, text.length); + currentIndex = 0; + lineNum = Math.max(Math.floor(textWidth / width), 1); + textWidth = Math.floor(this.measureWidth(text, style.font || this.ctx.font)); + item.x = item.originX; // 还原换行后的x + for (let i = 0; i < lineNum; i++) { + let { endIndex, single, singleWidth } = this._getTextSingleLine( + text, + width, + singleLength, + currentIndex, + ); + currentIndex = endIndex; + if (single) { + x = this._resetTextPositionX(item, style, singleWidth, width); + y = this._resetTextPositionY(item, style, i + 1); + this.ctx.fillText(single, x, y); + if (i === lineNum - 1) { + leftOffset = x + singleWidth; + topOffset = lineHeight * lineNum; + } + } + } + + let last = text.substring(currentIndex, length); + let lastWidth = this.measureWidth(last); + + if (last) { + x = this._resetTextPositionX(item, style, lastWidth, width); + y = this._resetTextPositionY(item, style, lineNum + 1); + this.ctx.fillText(last, x, y); + leftOffset = x + lastWidth; + topOffset = lineHeight * (lineNum + 1); + } + } else { + x = this._resetTextPositionX(item, style, textWidth, width); + y = this._resetTextPositionY(item, style); + this.ctx.fillText(item.text, x, y); + leftOffset = x + textWidth; + topOffset = lineHeight; + } + } else { + // block文本,如果文本长度超过宽度换行 + if (width && textWidth > width && whiteSpace !== "nowrap") { + let lineNum = Math.max(Math.floor(textWidth / width), 1); + let length = text.length; + let singleLength = Math.floor(length / lineNum); + let currentIndex = 0; + + // lineClamp参数限制最多行数 + if (style.lineClamp && lineNum + 1 > style.lineClamp) { + lineNum = style.lineClamp - 1; + } + + for (let i = 0; i < lineNum; i++) { + let { endIndex, single, singleWidth } = this._getTextSingleLine( + text, + width, + singleLength, + currentIndex, + ); + currentIndex = endIndex; + x = this._resetTextPositionX(item, style, singleWidth, width); + y = this._resetTextPositionY(item, style, i); + this.ctx.fillText(single, x, y); + } + + // 换行后剩余的文字,超过一行则截断增加省略号 + let last = text.substring(currentIndex, length); + let lastWidth = this.measureWidth(last); + if (lastWidth > width) { + let { single, singleWidth } = this._getTextSingleLine(last, width, singleLength); + lastWidth = singleWidth; + last = single.substring(0, single.length - 1) + "..."; + } + + x = this._resetTextPositionX(item, style, lastWidth, width); + y = this._resetTextPositionY(item, style, lineNum); + this.ctx.fillText(last, x, y); + } else { + x = this._resetTextPositionX(item, style, textWidth, width); + y = this._resetTextPositionY(item, style); + this.ctx.fillText(item.text, x, y); + } + } + + this.ctx.draw(true); + + this._updateProgress(item.progress); + + if (resolve) { + resolve(); + } else { + return { + leftOffset, + topOffset, + }; + } + } catch (e) { + reject && reject({ errcode: 1004, errmsg: "drawText error", e: e }); + } + } + + _drawTextBackgroud(item, style, textWidth, textHeight, isWxml) { + if (!style.width) return; + let zoom = isWxml ? 1 : this.zoom; + let width = style.width || textWidth; + let height = style.height || textHeight; + let rectStyle = { + fill: style.background, + border: style.border, + }; + style.padding = style.padding || [0, 0, 0, 0]; + width += (style.padding[1] || 0) + (style.padding[3] || 0); + height += (style.padding[0] || 0) + (style.padding[2] || 0); + width = width * zoom; + height = height * zoom; + this._drawRectToCanvas(item.x, item.y, width, height, rectStyle); + } + + _drawCircle(item, style, resolve, reject, isImage, isWxml) { + let zoom = this.zoom; + let r = style.r; + try { + item.x = this._resetPositionX(item, style); + item.y = this._resetPositionY(item, style); + + let url; + if (isImage) { + let index = this._findPicIndex(item.url); + if (index > -1) { + url = this.allPic[index].local; + } else { + url = item.url; + } + } + + if (!isWxml) { + r = r * zoom; + } + + this._drawCircleToCanvas(item.x, item.y, r, style, url); + + this._updateProgress(item.progress); + resolve && resolve(); + } catch (e) { + reject && + reject({ + errcode: isImage ? 1006 : 1005, + errmsg: isImage ? "drawCircleImage error" : "drawCircle error", + e, + }); + } + } + + _drawCircleToCanvas(x, y, r, style, url) { + let { fill, border, boxShadow } = style; + + this.ctx.save(); + + this._drawBoxShadow(boxShadow, (res) => { + // 真机上填充渐变色时,没有阴影,先画个相等大小的纯色矩形来实现阴影 + if ((fill && typeof fill !== "string") || (url && res.color)) { + this.ctx.setFillStyle(res.color || "#ffffff"); + this.ctx.beginPath(); + this.ctx.arc(x + r, y + r, r, 0, 2 * Math.PI); + this.ctx.closePath(); + this.ctx.fill(); + } + }); + + if (url) { + this.ctx.save(); + this.ctx.beginPath(); + this.ctx.arc(x + r, y + r, r, 0, 2 * Math.PI); + this.ctx.clip(); + this.ctx.drawImage(url, x, y, r * 2, r * 2); + this.ctx.closePath(); + this.ctx.restore(); + } else { + this._setFill(fill, () => { + this.ctx.beginPath(); + this.ctx.arc(x + r, y + r, r, 0, 2 * Math.PI); + this.ctx.closePath(); + this.ctx.fill(); + }); + } + + this._drawBorder(border, style, (border) => { + this.ctx.beginPath(); + this.ctx.arc(x + r, y + r, r + border.width / 2, 0, 2 * Math.PI); + this.ctx.stroke(); + this.ctx.closePath(); + }); + + this.ctx.draw(true); + this.ctx.restore(); + } + + _drawLine(item, style, resolve, reject, isWxml) { + let zoom = this.zoom; + try { + let x1 = item.x * zoom + this.translateX; + let y1 = item.y * zoom + this.translateY; + let x2 = item.x2 * zoom + this.translateX; + let y2 = item.y2 * zoom + this.translateY; + this._drawLineToCanvas(x1, y1, x2, y2, style); + + this._updateProgress(item.progress); + resolve && resolve(); + } catch (e) { + reject && reject({ errcode: 1007, errmsg: "drawLine error", e }); + } + } + + _drawLineToCanvas(x1, y1, x2, y2, style) { + let { stroke, dash, boxShadow } = style; + + this.ctx.save(); + if (stroke) { + this._setStroke(stroke); + } + + this._drawBoxShadow(boxShadow); + + if (dash) { + let dash = [style.dash[0] || 5, style.dash[1] || 5]; + let offset = style.dash[2] || 0; + this.ctx.setLineDash(dash, offset || 0); + } + + this.ctx.moveTo(x1, y1); + this.ctx.setLineWidth((style.width || 1) * this.zoom); + this.ctx.lineTo(x2, y2); + this.ctx.stroke(); + this.ctx.draw(true); + this.ctx.restore(); + } + + // 废弃,合并到_drawRect + _drawImage(item, style, resolve, reject, isWxml) { + let zoom = this.zoom; + try { + item.x = this._resetPositionX(item, style); + item.y = this._resetPositionY(item, style); + item.x = item.x + (style.padding[3] || 0); + item.y = item.y + (style.padding[0] || 0); + + let index = this._findPicIndex(item.url); + let url = index > -1 ? this.allPic[index].local : item.url; + this._drawImageToCanvas(url, item.x, item.y, style.width * zoom, style.height * zoom, style); + + this._updateProgress(item.progress); + resolve && resolve(); + } catch (e) { + reject && reject({ errcode: 1012, errmsg: "drawRect error", e }); + } + } + + // 废弃,合并到_drawRect + _drawImageToCanvas(url, x, y, width, height, style) { + let { fill, border, boxShadow } = style; + this.ctx.save(); + + this._drawBoxShadow(boxShadow); + this.ctx.drawImage(url, x, y, width, height); + + this._drawBorder(border, style, (border) => { + let fixBorder = border.width; + this.ctx.strokeRect(x - fixBorder / 2, y - fixBorder / 2, width + fixBorder, height + fixBorder); + }); + this.ctx.draw(true); + this.ctx.restore(); + } + + _drawWxml(item, style, resolve, reject) { + let self = this; + let all = []; + try { + this._getWxml(item, style).then((results) => { + // 上 -> 下 + let sorted = self._sortListByTop(results[0]); + let count = 0; + let progress = 0; + Object.keys(sorted).forEach((item) => { + count += sorted[item].length; + }); + progress = (this.distance * 3) / (count || 1); + + all = this._drawWxmlBlock(item, sorted, all, progress, results[1]); + all = this._drawWxmlInline(item, sorted, all, progress, results[1]); + + Promise.all(all) + .then((results) => { + resolve && resolve(); + }) + .catch((e) => { + reject && reject(e); + }); + }); + } catch (e) { + reject && reject({ errcode: 1008, errmsg: "drawWxml error" }); + } + } + + _drawWxmlBlock(item, sorted, all, progress, results) { + let self = this; + // 用来限定位置范围,取相对位置 + let limitLeft = results ? results.left : 0; + let limitTop = results ? results.top : 0; + Object.keys(sorted).forEach((top, topIndex) => { + // 左 -> 右 + let list = sorted[top].sort((a, b) => { + return a.left - b.left; + }); + + list = list.filter((sub) => sub.dataset.type && sub.dataset.type.indexOf("inline") === -1); + + list.forEach((sub, index) => { + all[index] = new Promise((resolve2, reject2) => { + sub = self._transferWxmlStyle(sub, item, limitLeft, limitTop); + sub.progress = progress; + let type = sub.dataset.type; + if (sub.dataset.delay) { + setTimeout(() => { + drawWxmlItem(); + }, sub.dataset.delay); + } else { + drawWxmlItem(); + } + function drawWxmlItem() { + if (type === "text") { + self._drawWxmlText(sub, resolve2, reject2); + } else if (type === "image") { + self._drawWxmlImage(sub, resolve2, reject2); + } else if (type === "radius-image") { + self._drawWxmlCircleImage(sub, resolve2, reject2); + } else if (type === "background-image") { + self._drawWxmlBackgroundImage(sub, resolve2, reject2); + } + } + }); + }); + }); + + return all; + } + + _drawWxmlInline(item, sorted, all, progress, results) { + let self = this; + let topOffset = 0; + let leftOffset = 0; + let lastTop = 0; + let limitLeft = results ? results.left : 0; + let limitTop = results ? results.top : 0; + let p = new Promise((resolve2, reject2) => { + let maxWidth = 0; + let minLeft = Infinity; + let maxRight = 0; + + // 找出同一top下的最小left和最大right,得到最大的宽度,用于换行 + Object.keys(sorted).forEach((top) => { + let inlineList = sorted[top].filter((sub) => sub.dataset.type && sub.dataset.type.indexOf("inline") > -1); + inlineList.forEach((sub) => { + if (sub.left < minLeft) { + minLeft = sub.left; + } + if (sub.right > maxRight) { + maxRight = sub.right; + } + }); + }); + maxWidth = Math.ceil(maxRight - minLeft || self.width); + + Object.keys(sorted).forEach((top, topIndex) => { + // 左 -> 右 + let list = sorted[top].sort((a, b) => { + return a.left - b.left; + }); + + // 换行的行内元素left放到后面,version2.0.6后无法获取高度,改用bottom值来判断是否换行了 + let position = -1; + for (let i = 0, len = list.length; i < len; i++) { + if (list[i] && list[i + 1]) { + if (list[i].bottom > list[i + 1].bottom) { + position = i; + break; + } + } + } + + if (position > -1) { + list.push(list.splice(position, 1)[0]); + } + + let inlineList = list.filter((sub) => sub.dataset.type && sub.dataset.type.indexOf("inline") > -1); + let originLeft = inlineList[0] ? inlineList[0].left : 0; + // 换行后和top不相等时,认为是换行了,要清除左边距;当左偏移量大于最大宽度时,也要清除左边距; 当左偏移小于左边距时,也要清除 + if ( + Math.abs(topOffset + lastTop - top) > 2 || + leftOffset - originLeft - limitLeft >= maxWidth || + leftOffset <= originLeft - limitLeft - 2 + ) { + leftOffset = 0; + } + + lastTop = +top; + topOffset = 0; + + inlineList.forEach((sub, index) => { + sub = self._transferWxmlStyle(sub, item, limitLeft, limitTop); + sub.progress = progress; + let type = sub.dataset.type; + if (type === "inline-text") { + let drawRes = self._drawWxmlInlineText(sub, leftOffset, maxWidth); + leftOffset = drawRes.leftOffset; + topOffset = drawRes.topOffset; + } else if (type === "inline-image") { + let drawRes = self._drawWxmlImage(sub) || {}; + leftOffset = drawRes.leftOffset || 0; + topOffset = drawRes.topOffset || 0; + } + }); + }); + resolve2(); + }); + + all.push(p); + return all; + } + + _drawWxmlInlineText(sub, leftOffset = 0, maxWidth) { + let text = sub.dataset.text || ""; + if (sub.dataset.maxlength && text.length > sub.dataset.maxlength) { + text = text.substring(0, sub.dataset.maxlength) + "..."; + } + + let textData = { + text, + originX: sub.left, + x: leftOffset ? leftOffset : sub.left, + y: sub.top, + progress: sub.progress, + leftOffset: leftOffset, + maxWidth: maxWidth, // 行内元素的最大宽度,取决于limit的宽度 + }; + + if (sub.backgroundColor !== "rgba(0, 0, 0, 0)") { + sub.background = sub.backgroundColor; + } else { + sub.background = "rgba(0, 0, 0, 0)"; + } + + if (sub.dataset.background) { + sub.background = sub.dataset.background; + } + + let res = this._drawText(textData, sub, null, null, "inline-text", "wxml"); + + return res; + } + + _drawWxmlText(sub, resolve, reject) { + let text = sub.dataset.text || ""; + if (sub.dataset.maxlength && text.length > sub.dataset.maxlength) { + text = text.substring(0, sub.dataset.maxlength) + "..."; + } + + let textData = { + text, + x: sub.left, + y: sub.top, + progress: sub.progress, + }; + if (sub.backgroundColor !== "rgba(0, 0, 0, 0)") { + sub.background = sub.backgroundColor; + } else { + sub.background = "rgba(0, 0, 0, 0)"; + } + + if (sub.dataset.background) { + sub.background = sub.dataset.background; + } + + this._drawText(textData, sub, resolve, reject, "text", "wxml"); + } + + _drawWxmlImage(sub, resolve, reject) { + let imageData = { + url: sub.dataset.url, + x: sub.left, + y: sub.top, + progress: sub.progress, + }; + + let res = this._drawRect(imageData, sub, resolve, reject, "image", "inline-wxml"); + + return res; + } + + _drawWxmlCircleImage(sub, resolve, reject) { + let imageData = { + url: sub.dataset.url, + x: sub.left, + y: sub.top, + progress: sub.progress, + }; + sub.r = sub.width / 2; + + this._drawCircle(imageData, sub, resolve, reject, true, "wxml"); + } + + _drawWxmlBackgroundImage(sub, resolve, reject) { + let url = sub.dataset.url; + let index = this._findPicIndex(url); + url = index > -1 ? this.allPic[index].local : url; + let size = sub.backgroundSize.replace(/px/g, "").split(" "); + + let imageData = { + url: url, + x: sub.left, + y: sub.top, + progress: sub.progress, + }; + + this._drawRect(imageData, sub, resolve, reject, "image", "wxml"); + } + + _getWxml(item, style) { + let self = this; + let query; + // if (this.obj) { + // query = wx.createSelectorQuery().in(this.obj); + // } else { + // query = wx.createSelectorQuery(); + // } + if (this.object) { + query = wx.createSelectorQuery().in(this.object); + } else { + query = wx.createSelectorQuery(); + } + + let p1 = new Promise((resolve, reject) => { + // 会触发两次,要限制 + let count = 0; + query + .selectAll(`${item.class}`) + .fields( + { + dataset: true, + size: true, + rect: true, + computedStyle: [ + "width", + "height", + "font", + "fontSize", + "fontFamily", + "fontWeight", + "fontStyle", + "textAlign", + "color", + "lineHeight", + "border", + "borderColor", + "borderStyle", + "borderWidth", + "verticalAlign", + "boxShadow", + "background", + "backgroundColor", + "backgroundImage", + "backgroundPosition", + "backgroundSize", + "paddingLeft", + "paddingTop", + "paddingRight", + "paddingBottom", + ], + }, + (res) => { + if (count++ === 0) { + let formated = self._formatImage(res); + let list = formated.list; + res = formated.res; + + self + ._preloadImage(list) + .then((result) => { + resolve(res); + }) + .catch((res) => { + reject && reject({ errcode: 1009, errmsg: "drawWxml preLoadImage error" }); + }); + } + }, + ) + .exec(); + }); + + let p2 = new Promise((resolve, reject) => { + if (!item.limit) { + resolve({ top: 0, width: self.width / self.zoom }); + } + + query + .select(`${item.limit}`) + .fields( + { + dataset: true, + size: true, + rect: true, + }, + (res) => { + resolve(res); + }, + ) + .exec(); + }); + + return Promise.all([p1, p2]); + } + + _getLineHeight(style) { + let zoom = this.zoom; + if (style.dataset && style.dataset.type) { + zoom = 1; + } + let lineHeight; + if (!isNaN(style.lineHeight) && style.lineHeight > style.fontSize) { + lineHeight = style.lineHeight; + } else { + style.lineHeight = (style.lineHeight || "") + ""; + lineHeight = +style.lineHeight.replace("px", ""); + lineHeight = lineHeight ? lineHeight : (style.fontSize || 14) * 1.2; + } + return lineHeight * zoom; + } + + _formatImage(res = []) { + let list = []; + res.forEach((item, index) => { + let dataset = item.dataset; + let uid = Util.getUid(); + let filename = `${wx.env.USER_DATA_PATH}/${uid}.png`; + if ((dataset.type === "image" || dataset.type === "radius-image") && dataset.url) { + let sub = { + url: dataset.base64 ? filename : dataset.url, + isBase64: dataset.base64 ? dataset.url : false, + }; + + res[index].dataset = Object.assign(res[index].dataset, sub); + list.push(sub); + } else if (dataset.type === "background-image" && item.backgroundImage.indexOf("url") > -1) { + let url = item.backgroundImage.replace(/url\((\"|\')?/, "").replace(/(\"|\')?\)$/, ""); + let sub = { + url: dataset.base64 ? filename : url, + isBase64: dataset.base64 ? url : false, + }; + res[index].dataset = Object.assign(res[index].dataset, sub); + list.push(sub); + } + }); + + return { list, res }; + } + + _updateProgress(distance) { + this.progressPercent += distance; + this.progress(this.progressPercent); + } + + _sortListByTop(list = []) { + let sorted = {}; + + // 粗略地认为2px相差的元素在同一行 + list.forEach((item, index) => { + let top = item.top; + if (!sorted[top]) { + if (sorted[top - 2]) { + top = top - 2; + } else if (sorted[top - 1]) { + top = top - 1; + } else if (sorted[top + 1]) { + top = top + 1; + } else if (sorted[top + 2]) { + top = top + 2; + } else { + sorted[top] = []; + } + } + sorted[top].push(item); + }); + + return sorted; + } + + _parseNumber(number) { + return isNaN(number) ? +(number || "").replace("px", "") : number; + } + + _transferWxmlStyle(sub, item, limitLeft, limitTop) { + let leftFix = +sub.dataset.left || 0; + let topFix = +sub.dataset.top || 0; + + sub.width = this._parseNumber(sub.width); + sub.height = this._parseNumber(sub.height); + sub.left = this._parseNumber(sub.left) - limitLeft + (leftFix + (item.x || 0)) * this.zoom; + sub.top = this._parseNumber(sub.top) - limitTop + (topFix + (item.y || 0)) * this.zoom; + + let padding = sub.dataset.padding || "0 0 0 0"; + if (typeof padding === "string") { + padding = Util.transferPadding(padding); + } + let paddingTop = Number(sub.paddingTop.replace("px", "")) + Number(padding[0]); + let paddingRight = Number(sub.paddingRight.replace("px", "")) + Number(padding[1]); + let paddingBottom = Number(sub.paddingBottom.replace("px", "")) + Number(padding[2]); + let paddingLeft = Number(sub.paddingLeft.replace("px", "")) + Number(padding[3]); + sub.padding = [paddingTop, paddingRight, paddingBottom, paddingLeft]; + + return sub; + } + + /** + * 支持负值绘制,从右边计算 + * @param {*} item + * @param {*} style + */ + _resetPositionX(item, style) { + let zoom = this.zoom; + let x = 0; + + if (style.dataset && style.dataset.type) { + zoom = 1; + } + + // 通过wxml获取的不需要重置坐标 + if (item.x < 0 && item.type) { + x = this.width + item.x * zoom - style.width * zoom; + } else { + x = item.x * zoom; + } + + if (parseInt(style.borderWidth)) { + x += parseInt(style.borderWidth); + } + + return x + this.translateX; + } + + /** + * 支持负值绘制,从底部计算 + * @param {*} item + * @param {*} style + */ + _resetPositionY(item, style, textHeight) { + let zoom = this.zoom; + let y = 0; + + if (style.dataset && style.dataset.type) { + zoom = 1; + } + + if (item.y < 0) { + y = this.height + item.y * zoom - (textHeight ? textHeight : style.height * zoom); + } else { + y = item.y * zoom; + } + + if (parseInt(style.borderWidth)) { + y += parseInt(style.borderWidth); + } + + return y + this.translateY; + } + + /** + * 文字的padding、text-align + * @param {*} item + * @param {*} style + * @param {*} textWidth + */ + _resetTextPositionX(item, style, textWidth, width) { + let textAlign = style.textAlign || "left"; + let x = item.x; + if (textAlign === "center") { + x = (width - textWidth) / 2 + item.x; + } else if (textAlign === "right") { + x = width - textWidth + item.x; + } + + let left = style.padding ? style.padding[3] || 0 : 0; + + return x + left + this.translateX; + } + + /** + * 文字的padding、text-align + * @param {*} item + * @param {*} style + * @param {*} textWidth + */ + _resetTextPositionY(item, style, lineNum = 0) { + let zoom = this.zoom; + if (style.dataset && style.dataset.type) { + zoom = 1; + } + + let lineHeight = this._getLineHeight(style); + let fontSize = Math.ceil((style.fontSize || 14) * zoom); + + let blockLineHeightFix = + ((style.dataset && style.dataset.type) || "").indexOf("inline") > -1 ? 0 : (lineHeight - fontSize) / 2; + + let top = style.padding ? style.padding[0] || 0 : 0; + + // y + lineheight偏移 + 行数 + paddingTop + 整体画布位移 + return item.y + blockLineHeightFix + lineNum * lineHeight + top + this.translateY; + } + + /** + * 当文本超过宽度时,计算每一行应该绘制的文本 + * @param {*} text + * @param {*} width + * @param {*} singleLength + * @param {*} currentIndex + * @param {*} widthOffset + */ + _getTextSingleLine(text, width, singleLength, currentIndex = 0, widthOffset = 0) { + let offset = 0; + let endIndex = currentIndex + singleLength + offset; + let single = text.substring(currentIndex, endIndex); + let singleWidth = this.measureWidth(single); + + while (Math.round(widthOffset + singleWidth) > width) { + offset--; + endIndex = currentIndex + singleLength + offset; + single = text.substring(currentIndex, endIndex); + singleWidth = this.measureWidth(single); + } + + return { + endIndex, + single, + singleWidth, + }; + } + + _drawBorder(border, style, callback) { + let zoom = this.zoom; + if (style.dataset && style.dataset.type) { + zoom = 1; + } + border = Util.transferBorder(border); + + if (border && border.width) { + // 空白阴影,清空掉边框的阴影 + this._drawBoxShadow(); + if (border) { + this.ctx.setLineWidth(border.width * zoom); + + if (border.style === "dashed") { + let dash = style.dash || [5, 5, 0]; + let offset = dash[2] || 0; + let array = [dash[0] || 5, dash[1] || 5]; + this.ctx.setLineDash(array, offset); + } + this.ctx.setStrokeStyle(border.color); + } + callback && callback(border); + } + } + + _drawBoxShadow(boxShadow, callback) { + boxShadow = Util.transferBoxShadow(boxShadow); + if (boxShadow) { + this.ctx.setShadow(boxShadow.offsetX, boxShadow.offsetY, boxShadow.blur, boxShadow.color); + } else { + this.ctx.setShadow(0, 0, 0, "#ffffff"); + } + + callback && callback(boxShadow || {}); + } + + _setFill(fill, callback) { + if (fill) { + if (typeof fill === "string") { + this.ctx.setFillStyle(fill); + } else { + let line = fill.line; + let color = fill.color; + let grd = this.ctx.createLinearGradient(line[0], line[1], line[2], line[3]); + grd.addColorStop(0, color[0]); + grd.addColorStop(1, color[1]); + this.ctx.setFillStyle(grd); + } + callback && callback(); + } + } + + _setStroke(stroke, callback) { + if (stroke) { + if (typeof stroke === "string") { + this.ctx.setStrokeStyle(stroke); + } else { + let line = stroke.line; + let color = stroke.color; + let grd = this.ctx.createLinearGradient(line[0], line[1], line[2], line[3]); + grd.addColorStop(0, color[0]); + grd.addColorStop(1, color[1]); + this.ctx.setStrokeStyle(grd); + } + + callback && callback(); + } + } + } + + if (!exports.__esModule) Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = Wxml2Canvas; + }, + function (modId) { + var map = { "./util": 1685064731948 }; + return __REQUIRE__(map[modId], modId); + }, + ); + __DEFINE__( + 1685064731948, + function (require, module, exports) { + /** + * 获取字符的长度,full为true时,一个汉字算两个长度 + * @param {String} str + * @param {Boolean} full + */ + + function getTextLength(str, full) { + let len = 0; + for (let i = 0; i < str.length; i++) { + let c = str.charCodeAt(i); + //单字节加1 + if ((c >= 0x0001 && c <= 0x007e) || (0xff60 <= c && c <= 0xff9f)) { + len++; + } else { + len += full ? 2 : 1; + } + } + return len; + } + + /** + * rgba(255, 255, 255, 1) => #ffffff + * @param {String} color + */ + function transferColor(color = "") { + let res = "#"; + color = color.replace(/^rgba?\(/, "").replace(/\)$/, ""); + color = color.split(", "); + + color.length > 3 ? (color.length = 3) : ""; + for (let item of color) { + item = parseInt(item || 0); + if (item < 10) { + res += "0" + item; + } else { + res += item.toString(16); + } + } + + return res; + } + + function transferBorder(border = "") { + let res = border.match(/(\w+)px\s(\w+)\s(.*)/); + let obj = {}; + + if (res) { + obj = { + width: +res[1], + style: res[2], + color: res[3], + }; + } + + return res ? obj : null; + } + + /** + * 内边距,依次为上右下左 + * @param {*} padding + */ + function transferPadding(padding = "0 0 0 0") { + padding = padding.split(" "); + for (let i = 0, len = padding.length; i < len; i++) { + padding[i] = +padding[i].replace("px", ""); + } + + return padding; + } + /** + * type1: 0, 25, 17, rgba(0, 0, 0, 0.3) + * type2: rgba(0, 0, 0, 0.3) 0px 25px 17px 0px => (0, 25, 17, rgba(0, 0, 0, 0.3)) + * @param {*} shadow + */ + function transferBoxShadow(shadow = "", type) { + if (!shadow || shadow === "none") return; + let color; + let split; + + split = shadow.match(/(\w+)\s(\w+)\s(\w+)\s(rgb.*)/); + + if (split) { + split.shift(); + shadow = split; + color = split[3] || "#ffffff"; + } else { + split = shadow.split(") "); + color = split[0] + ")"; + shadow = split[1].split("px "); + } + + return { + offsetX: +shadow[0] || 0, + offsetY: +shadow[1] || 0, + blur: +shadow[2] || 0, + color, + }; + } + + function getUid(prefix) { + prefix = prefix || ""; + + return ( + prefix + + "xxyxxyxx".replace(/[xy]/g, (c) => { + let r = (Math.random() * 16) | 0; + let v = c === "x" ? r : (r & 0x3) | 0x8; + return v.toString(16); + }) + ); + } + + if (!exports.__esModule) Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = { + getTextLength, + transferBorder, + transferColor, + transferPadding, + transferBoxShadow, + getUid, + }; + }, + function (modId) { + var map = {}; + return __REQUIRE__(map[modId], modId); + }, + ); + return __REQUIRE__(1685064731946); +})(); +//miniprogram-npm-outsideDeps=[] +//# sourceMappingURL=index.js.map diff --git a/src/components/customPoster/wxml2canvas/index.js.map b/src/components/customPoster/wxml2canvas/index.js.map new file mode 100644 index 0000000..68e773e --- /dev/null +++ b/src/components/customPoster/wxml2canvas/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["index.js","src/index.js","src/util.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;ACFA;AACA;AACA;AACA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["var __TEMP__ = require('./src/index');var Wxml2Canvas = __REQUIRE_DEFAULT__(__TEMP__);\n\nif (!exports.__esModule) Object.defineProperty(exports, \"__esModule\", { value: true });exports.default = Wxml2Canvas;","var __TEMP__ = require('./util');var Util = __REQUIRE_DEFAULT__(__TEMP__);\n\nconst imageMode = ['scaleToFill', 'aspectFit', 'aspectFill', 'widthFix', 'top', 'bottom', 'center', 'left', 'right', 'top left', 'top right', 'bottom left', 'bottom right']\n\nclass Wxml2Canvas {\n constructor (options = {}) {\n this.device = wx.getSystemInfoSync && wx.getSystemInfoSync() || {};\n \n if (!options.zoom) {\n this.zoom = this.device.windowWidth / 375;\n } else {\n this.zoom = options.zoom || 1;\n } \n \n this.element = options.element;\n this.object = options.obj;\n this.width = options.width * this.zoom || 0;\n this.height = options.height * this.zoom || 0;\n this.destZoom = options.destZoom || 3;\n this.destWidth = this.width * this.destZoom;\n this.destHeight = this.height * this.destZoom;\n this.translateX = options.translateX * this.zoom || 0;\n this.translateY = options.translateY * this.zoom || 0;\n this.gradientBackground = options.gradientBackground || null;\n this.background = options.background || '#ffffff';\n this.finishDraw = options.finish || function finish(params) {}\n this.errorHandler = options.error || function error(params) {}\n this.progress = options.progress || function progress(params) {}\n this.textAlign = options.textAlign || 'left';\n this.fullText = options.fullText || false;\n this.font = options.font || '14px PingFang SC';\n\n this._init();\n }\n\n draw (data = {}, that) {\n let self = this;\n this.data = data;\n this.fef = that;\n\n this.progress(10);\n this._preloadImage(data.list).then((result) => {\n this.progress(30);\n self._draw();\n }).catch((res) => {\n self.errorHandler(res);\n })\n }\n\n measureWidth (text, font) {\n if(font) {\n this.ctx.font = font;\n }\n let res = this.ctx.measureText(text) || {};\n return res.width || 0;\n }\n\n _init () {\n this.progressPercent = 0; // 绘制进度百分比\n this.data = null;\n this.ref = null;\n this.allPic = [];\n this.screenList = []; \n this.asyncList = [];\n this.imgUrl = '';\n this.progressPercent = 0;\n this.distance = 0;\n this.progress(0);\n\n this.ctx = wx.createCanvasContext(this.element, this.obj);\n this.ctx.font = this.font;\n this.ctx.setTextBaseline('top');\n this.ctx.setStrokeStyle('white');\n\n this.debug = this.device.platform === 'devtools' ? true : false;\n\n this._drawBakcground();\n }\n\n _drawBakcground () {\n if (this.gradientBackground) {\n let line = this.gradientBackground.line || [0, 0, 0, this.height];\n let color = this.gradientBackground.color || ['#fff', '#fff'];\n let style = { fill: { line, color } }\n this._drawRectToCanvas(0, 0, this.width, this.height, style);\n } else {\n let style = { fill: this.background }\n this._drawRectToCanvas(0, 0, this.width, this.height, style);\n }\n }\n\n _draw () {\n let self = this;\n let list = this.data.list || [];\n let index = 0;\n let all = [];\n let count = 0;\n\n list.forEach(item => {\n if(item.type === 'wxml') {\n count += 3;\n } else {\n count += 1;\n }\n })\n\n this.distance = 60 / (count || 1); // 进度条的间距\n this.progressPercent = 30;\n this.asyncList = list.filter( item => item.delay == true );\n list = list.filter( item => item.delay != true );\n drawList(list);\n\n Promise.all(all).then(results => {\n index = 0;\n drawList(self.asyncList, true);\n\n Promise.all(all).then(results => {\n self.progress(90);\n self._saveCanvasToImage();\n });\n }).catch (e => {\n console.log(e)\n self.errorHandler(e);\n });\n\n function drawList(list = [], noDelay) {\n list.forEach((item, i) => {\n all[index++] = new Promise((resolve, reject) => {\n let attr = item.style;\n item.progress = self.distance;\n if (noDelay) {\n item.delay = 0;\n }\n if (item.type === 'radius-image') {\n self._drawCircle(item, attr, resolve, reject, 'image');\n } else if (item.type === 'text') {\n self._drawText(item, attr, resolve, reject);\n } else if (item.type === 'line') {\n self._drawLine(item, attr, resolve, reject);\n } else if (item.type === 'circle') {\n self._drawCircle(item, attr, resolve, reject);\n } else if (item.type === 'rect') {\n self._drawRect(item, attr, resolve, reject);\n } else if (item.type === 'image') {\n self._drawRect(item, attr, resolve, reject, 'image');\n } else if (item.type === 'wxml') {\n self._drawWxml(item, attr, resolve, reject);\n }else {\n resolve();\n }\n });\n });\n }\n }\n\n _saveCanvasToImage () {\n let self = this; \n\n // 延时保存有两个原因,一个是等待绘制delay的元素,另一个是安卓上样式会错乱\n setTimeout(() => {\n self.progress(95);\n\n let obj = {\n x: 0,\n y: 0,\n width: self.width,\n height: self.height,\n canvasId: self.element,\n success: function (res) {\n\n self.progress(100);\n self.imgUrl = res.tempFilePath;\n self.finishDraw(self.imgUrl);\n },\n fail: function (res) {\n\n self.errorHandler({errcode: 1000, errmsg: 'save canvas error', e: res});\n }\n }\n\n if(self.destZoom !== 3) {\n obj.destWidth = self.destWidth;\n obj.destHeight = self.destHeight;\n }\n\n wx.canvasToTempFilePath(obj, self.object);\n }, self.device.system.indexOf('iOS') === -1 ? 300 : 100);\n }\n\n _preloadImage (list = []) {\n let self = this;\n let all = [];\n let count = 0;\n\n list.forEach((item, i) => {\n if (item.url && self._findPicIndex(item.url) === -1) {\n \n // 避免重复下载同一图片\n self.allPic.push({\n url: item.url,\n local: ''\n });\n all[count++] = new Promise((resolve, reject) => {\n // 非http(s)域名的就不下载了\n if (!/^http/.test(item.url) || /^http:\\/\\/(tmp)|(usr)\\//.test(item.url) || /^http:\\/\\/127\\.0\\.0\\.1/.test(item.url)) {\n if(item.isBase64) {\n let fileManager = wx.getFileSystemManager();\n\n fileManager.writeFile({\n filePath: item.url,\n data: item.isBase64.replace(/data:image\\/(.*);base64,/, ''),\n encoding: 'base64',\n success (res) {\n imageInfo(item.url);\n },\n fail (res) {\n reject(res);\n },\n })\n \n }else {\n imageInfo(item.url);\n }\n\n function imageInfo (url) {\n wx.getImageInfo({\n src: url,\n success (res) {\n let index = self._findPicIndex(url);\n if(index > -1) {\n self.allPic[index].local = url;\n self.allPic[index].width = res.width;\n self.allPic[index].height = res.height;\n }\n resolve({ tempFilePath: url });\n }, \n fail (res) {\n reject(res);\n }\n })\n }\n } else {\n wx.downloadFile({\n url: item.url.replace(/^https?/, 'https'),\n success: function (res) {\n wx.getImageInfo({\n src: res.tempFilePath,\n success (img) {\n let index = self._findPicIndex(item.url);\n if (index > -1) {\n self.allPic[index].local = res.tempFilePath;\n self.allPic[index].width = img.width;\n self.allPic[index].height = img.height;\n }\n resolve(res);\n },\n fail (res) {\n reject(res);\n }\n })\n },\n fail: (res) => {\n reject({errcode: 1001, errmsg: 'download pic error'});\n }\n })\n }\n }) \n }\n });\n\n return Promise.all(all).then(results => {\n return new Promise(resolve => { resolve() })\n }).catch((results) => {\n return new Promise((resolve, reject) => { reject(results) })\n })\n }\n\n _findPicIndex (url) {\n let index = this.allPic.findIndex(pic => pic.url === url);\n return index;\n }\n\n _drawRect (item, style, resolve, reject, isImage, isWxml) {\n let zoom = this.zoom;\n let leftOffset = 0;\n let topOffset = 0;\n let width = style.width;\n let height = style.height;\n let imgWidth = style.width;\n let imgHeight = style.height;\n let mode = null;\n\n try {\n item.x = this._resetPositionX(item, style);\n item.y = this._resetPositionY(item, style);\n \n let url;\n if(isImage) {\n let index = this._findPicIndex(item.url);\n if(index > -1) {\n url = this.allPic[index].local\n imgWidth = this.allPic[index].width\n imgHeight = this.allPic[index].height\n }else {\n url = item.url;\n }\n }\n\n style.padding = style.padding || [];\n if(isWxml === 'inline-wxml') {\n item.x = item.x + (style.padding[3] && style.padding[3] || 0)\n item.y = item.y + (style.padding[0] && style.padding[0] || 0)\n }\n\n leftOffset = item.x + style.width + (style.padding[1] && style.padding[1] || 0);\n\n if(!isWxml) {\n width = width * zoom;\n height = height * zoom;\n }\n\n if(style.dataset && style.dataset.mode && imageMode.indexOf(style.dataset.mode) > -1) {\n mode = {\n type: style.dataset.mode,\n width: imgWidth,\n height: imgHeight\n };\n }\n\n this._drawRectToCanvas(item.x, item.y, width, height, style, url, mode);\n this._updateProgress(item.progress);\n\n if(resolve) {\n resolve();\n }else {\n return {\n leftOffset,\n topOffset\n }\n }\n } catch (e) {\n reject && reject({ errcode: (isImage ? 1003 : 1002), errmsg: (isImage ? 'drawImage error' : 'drawRect error'), e });\n }\n }\n\n _drawRectToCanvas (x, y, width, height, style, url, mode) {\n let { fill, border, boxShadow } = style;\n this.ctx.save();\n this._drawBoxShadow(boxShadow, (res) => {\n // 真机上填充渐变色时,没有阴影,先画个相等大小的纯色矩形来实现阴影\n if(fill && typeof fill !== 'string' && !this.debug) {\n this.ctx.setFillStyle(res.color || '#ffffff');\n this.ctx.fillRect(x, y, width, height);\n }\n });\n \n if(url) {\n // 开发者工具有bug,先不裁剪\n if(mode) {\n this._resetImageByMode(url, x, y, width, height, mode);\n }else {\n this.ctx.drawImage(url, x, y, width, height)\n }\n }else {\n this._setFill(fill, () => {\n this.ctx.fillRect(x, y, width, height);\n });\n }\n\n this._drawBorder(border, style, (border) => {\n let fixBorder = border.width;\n this.ctx.strokeRect(x - fixBorder / 2, y - fixBorder / 2, width + fixBorder, height + fixBorder);\n });\n\n this.ctx.draw(true);\n this.ctx.restore();\n }\n\n _resetImageByMode (url, x, y, width, height, mode) {\n let self = this;\n let offsetX = 0;\n let offsetY = 0;\n let imgWidth = mode.width;\n let imgHeight = mode.height;\n\n switch (mode.type) {\n case 'scaleToFill': \n imgWidth = width;\n imgHeight = height;\n self.ctx.drawImage(url, x, y, width, height)\n break;\n case 'widthFix': \n height = width / ((imgWidth || 1) / (imgHeight || 1))\n self.ctx.drawImage(url, x, y, width, height)\n break; \n case 'aspectFit': \n if(imgWidth > imgHeight) {\n let realHeight = width / ((imgWidth || 1) / (imgHeight || 1))\n offsetY = -(height - realHeight) / 2\n imgWidth = width;\n imgHeight = realHeight;\n }else {\n let realWidth = height / ((imgHeight || 1) / (imgWidth || 1))\n offsetX = -(width - realWidth) / 2\n imgWidth = realWidth;\n imgHeight = height;\n }\n\n _clip();\n break;\n case 'aspectFill': \n if(imgWidth > imgHeight) {\n let realWidth = imgWidth / ((imgHeight || 1) / (height || 1))\n offsetX = (realWidth - width) / 2\n imgWidth = realWidth;\n imgHeight = height;\n }else {\n let realHeight = imgHeight / ((imgWidth || 1) / (width || 1))\n offsetY = (realHeight - height) / 2\n imgWidth = width;\n imgHeight = realHeight;\n }\n\n _clip();\n break;\n case 'top left': \n _clip();\n break;\n case 'top': \n offsetX = (mode.width - width) / 2;\n _clip();\n break;\n case 'top right': \n offsetX = (mode.width - width);\n _clip();\n break;\n case 'left': \n offsetY = (mode.height - height) / 2;\n _clip();\n break;\n case 'center': \n offsetX = (mode.width - width) / 2;\n offsetY = (mode.height - height) / 2;\n _clip();\n break;\n case 'right': \n offsetX = (mode.width - width);\n offsetY = (mode.height - height) / 2;\n _clip();\n break;\n case 'bottom left': \n offsetY = (mode.height - height)\n _clip();\n break;\n case 'bottom': \n offsetX = (mode.width - width) / 2;\n offsetY = (mode.height - height)\n _clip();\n break;\n case 'bottom right': \n offsetX = (mode.width - width);\n offsetY = (mode.height - height)\n _clip();\n break;\n default: \n imgWidth = width;\n imgHeight = height;\n break; \n }\n\n function _clip () {\n self.ctx.save();\n self.ctx.beginPath()\n self.ctx.rect(x, y, width, height)\n self.ctx.clip();\n self.ctx.drawImage(url, x - offsetX, y - offsetY, imgWidth, imgHeight)\n self.ctx.closePath();\n self.ctx.restore();\n }\n }\n\n _drawText (item, style, resolve, reject, type, isWxml) {\n let zoom = this.zoom;\n let leftOffset = 0;\n let topOffset = 0;\n\n try {\n style.fontSize = this._parseNumber(style.fontSize);\n let fontSize = Math.ceil((style.fontSize || 14) * zoom)\n this.ctx.setTextBaseline('top');\n this.ctx.font = (`${style.fontWeight ? (style.fontWeight) : 'normal'} ${ fontSize }px ${ style.fontFamily || 'PingFang SC' }`);\n this.ctx.setFillStyle(style.color || '#454545');\n\n let text = item.text || '';\n let textWidth = Math.floor(this.measureWidth(text, style.font || this.ctx.font));\n let lineHeight = this._getLineHeight(style);\n let textHeight = Math.ceil(textWidth / (style.width || textWidth)) * lineHeight;\n let width = Math.ceil((style.width || textWidth) * (!isWxml ? zoom : 1));\n let whiteSpace = style.whiteSpace || 'wrap';\n let x = 0;\n let y = 0; \n\n if(typeof style.padding === 'string') {\n style.padding = Util.transferPadding(style.padding);\n }\n item.x = this._resetPositionX(item, style);\n item.y = this._resetPositionY(item, style, textHeight);\n this._drawBoxShadow(style.boxShadow);\n\n if(style.background || style.border) {\n this._drawTextBackgroud(item, style, textWidth, textHeight, isWxml);\n }\n \n // 行内文本\n if(type === 'inline-text') {\n width = item.maxWidth;\n if(item.leftOffset + textWidth > width) {\n // 如果上一个行内元素换行了,这个元素要继续在后面补足一行\n let lineNum = Math.max(Math.floor(textWidth / width), 1);\n let length = text.length;\n let singleLength = Math.floor(length / lineNum);\n let widthOffset = item.leftOffset ? item.leftOffset - item.originX : 0;\n let { endIndex: currentIndex, single, singleWidth } = this._getTextSingleLine(text, width, singleLength, 0, widthOffset)\n x = this._resetTextPositionX(item, style, singleWidth);\n y = this._resetTextPositionY(item, style);\n this.ctx.fillText(single, x, y);\n leftOffset = x + singleWidth;\n topOffset = y;\n\n // 去除第一行补的内容,然后重置\n text = text.substring(currentIndex, text.length);\n currentIndex = 0;\n lineNum = Math.max(Math.floor(textWidth / width), 1);\n textWidth = Math.floor(this.measureWidth(text, style.font || this.ctx.font));\n item.x = item.originX; // 还原换行后的x\n for (let i = 0; i < lineNum; i++) {\n let { endIndex, single, singleWidth } = this._getTextSingleLine(text, width, singleLength, currentIndex);\n currentIndex = endIndex;\n if(single) {\n x = this._resetTextPositionX(item, style, singleWidth, width);\n y = this._resetTextPositionY(item, style, i + 1);\n this.ctx.fillText(single, x, y);\n if(i === lineNum - 1) {\n leftOffset = x + singleWidth;\n topOffset = lineHeight * lineNum;\n }\n }\n }\n\n let last = text.substring(currentIndex, length);\n let lastWidth = this.measureWidth(last);\n\n if(last) {\n x = this._resetTextPositionX(item, style, lastWidth, width);\n y = this._resetTextPositionY(item, style, lineNum + 1);\n this.ctx.fillText(last, x, y);\n leftOffset = x + lastWidth;\n topOffset = lineHeight * (lineNum + 1);\n }\n }else {\n x = this._resetTextPositionX(item, style, textWidth, width);\n y = this._resetTextPositionY(item, style);\n this.ctx.fillText(item.text, x, y);\n leftOffset = x + textWidth;\n topOffset = lineHeight;\n }\n }else {\n // block文本,如果文本长度超过宽度换行\n if (width && textWidth > width && whiteSpace !== 'nowrap') {\n let lineNum = Math.max(Math.floor(textWidth / width), 1);\n let length = text.length;\n let singleLength = Math.floor(length / lineNum);\n let currentIndex = 0;\n\n // lineClamp参数限制最多行数\n if (style.lineClamp && lineNum + 1 > style.lineClamp) {\n lineNum = style.lineClamp - 1;\n }\n\n for (let i = 0; i < lineNum; i++) {\n let { endIndex, single, singleWidth } = this._getTextSingleLine(text, width, singleLength, currentIndex);\n currentIndex = endIndex;\n x = this._resetTextPositionX(item, style, singleWidth, width);\n y = this._resetTextPositionY(item, style, i);\n this.ctx.fillText(single, x, y);\n\n }\n\n // 换行后剩余的文字,超过一行则截断增加省略号\n let last = text.substring(currentIndex, length);\n let lastWidth = this.measureWidth(last);\n if(lastWidth > width) {\n let { single, singleWidth } = this._getTextSingleLine(last, width, singleLength);\n lastWidth = singleWidth;\n last = single.substring(0, single.length - 1) + '...';\n }\n\n x = this._resetTextPositionX(item, style, lastWidth, width);\n y = this._resetTextPositionY(item, style, lineNum);\n this.ctx.fillText(last, x, y);\n\n }else {\n x = this._resetTextPositionX(item, style, textWidth, width);\n y = this._resetTextPositionY(item, style);\n this.ctx.fillText(item.text, x, y);\n }\n }\n \n this.ctx.draw(true);\n \n this._updateProgress(item.progress);\n\n if(resolve) {\n resolve();\n }else {\n return {\n leftOffset,\n topOffset\n }\n }\n } catch(e) {\n reject && reject({ errcode: 1004, errmsg: 'drawText error', e: e });\n }\n }\n\n _drawTextBackgroud (item, style, textWidth, textHeight, isWxml) {\n if(!style.width) return;\n let zoom = isWxml ? 1 : this.zoom;\n let width = style.width || textWidth;\n let height = style.height || textHeight;\n let rectStyle = {\n fill: style.background,\n border: style.border\n }\n style.padding = style.padding || [0, 0, 0, 0];\n width += (style.padding[1] || 0) + (style.padding[3] || 0);\n height += (style.padding[0] || 0) + (style.padding[2] || 0);\n width = width * zoom\n height = height * zoom\n this._drawRectToCanvas(item.x, item.y, width, height, rectStyle);\n }\n\n _drawCircle (item, style, resolve, reject, isImage, isWxml) {\n let zoom = this.zoom;\n let r = style.r;\n try {\n \n item.x = this._resetPositionX(item, style);\n item.y = this._resetPositionY(item, style);\n\n let url;\n if(isImage) {\n let index = this._findPicIndex(item.url);\n if (index > -1) {\n url = this.allPic[index].local;\n } else {\n url = item.url;\n }\n }\n\n if(!isWxml) {\n r = r * zoom;\n }\n\n this._drawCircleToCanvas(item.x, item.y, r, style, url);\n \n this._updateProgress(item.progress);\n resolve && resolve();\n } catch (e) {\n reject && reject({ errcode: (isImage ? 1006 : 1005), errmsg: (isImage ? 'drawCircleImage error' : 'drawCircle error'), e });\n }\n }\n\n _drawCircleToCanvas (x, y, r, style, url) {\n let { fill, border, boxShadow } = style;\n\n this.ctx.save();\n\n this._drawBoxShadow(boxShadow, (res) => {\n // 真机上填充渐变色时,没有阴影,先画个相等大小的纯色矩形来实现阴影\n if((fill && typeof fill !== 'string') || (url && res.color)) {\n this.ctx.setFillStyle(res.color || '#ffffff');\n this.ctx.beginPath();\n this.ctx.arc(x + r, y + r, r, 0, 2 * Math.PI);\n this.ctx.closePath();\n this.ctx.fill();\n }\n });\n\n if(url) {\n this.ctx.save();\n this.ctx.beginPath();\n this.ctx.arc(x + r, y + r, r, 0, 2 * Math.PI);\n this.ctx.clip();\n this.ctx.drawImage(url, x, y, r * 2, r * 2);\n this.ctx.closePath();\n this.ctx.restore();\n }else {\n this._setFill(fill, () => {\n this.ctx.beginPath();\n this.ctx.arc(x + r, y + r, r, 0, 2 * Math.PI);\n this.ctx.closePath();\n this.ctx.fill();\n });\n }\n\n this._drawBorder(border, style, (border) => {\n this.ctx.beginPath()\n this.ctx.arc(x + r, y + r, r + border.width / 2, 0, 2 * Math.PI)\n this.ctx.stroke()\n this.ctx.closePath();\n });\n\n this.ctx.draw(true);\n this.ctx.restore();\n }\n\n _drawLine (item, style, resolve, reject, isWxml) {\n let zoom = this.zoom;\n try {\n let x1 = item.x * zoom + this.translateX;\n let y1 = item.y * zoom + this.translateY;\n let x2 = item.x2 * zoom + this.translateX;\n let y2 = item.y2 * zoom + this.translateY;\n this._drawLineToCanvas(x1, y1, x2, y2, style);\n\n this._updateProgress(item.progress);\n resolve && resolve();\n } catch (e) {\n reject && reject({ errcode: 1007, errmsg: 'drawLine error', e });\n }\n }\n\n _drawLineToCanvas (x1, y1, x2, y2, style) {\n let { stroke, dash, boxShadow } = style;\n\n this.ctx.save();\n if(stroke) {\n this._setStroke(stroke);\n }\n\n this._drawBoxShadow(boxShadow);\n\n if(dash) {\n let dash = [style.dash[0] || 5, style.dash[1] || 5];\n let offset = style.dash[2] || 0;\n this.ctx.setLineDash(dash, offset || 0);\n }\n\n this.ctx.moveTo(x1, y1);\n this.ctx.setLineWidth((style.width || 1) * this.zoom);\n this.ctx.lineTo(x2, y2);\n this.ctx.stroke();\n this.ctx.draw(true);\n this.ctx.restore();\n }\n\n // 废弃,合并到_drawRect\n _drawImage (item, style, resolve, reject, isWxml) {\n let zoom = this.zoom;\n try {\n \n item.x = this._resetPositionX(item, style);\n item.y = this._resetPositionY(item, style);\n item.x = item.x + (style.padding[3] || 0);\n item.y = item.y + (style.padding[0] || 0);\n\n let index = this._findPicIndex(item.url);\n let url = index > -1 ? this.allPic[index].local : item.url;\n this._drawImageToCanvas(url, item.x, item.y, style.width * zoom, style.height * zoom, style);\n\n this._updateProgress(item.progress);\n resolve && resolve();\n } catch (e) {\n reject && reject({ errcode: 1012, errmsg: 'drawRect error', e });\n }\n }\n\n // 废弃,合并到_drawRect\n _drawImageToCanvas (url, x, y, width, height, style) {\n let { fill, border, boxShadow } = style;\n this.ctx.save();\n\n this._drawBoxShadow(boxShadow);\n this.ctx.drawImage(url, x, y, width, height);\n\n this._drawBorder(border, style, (border) => {\n let fixBorder = border.width;\n this.ctx.strokeRect(x - fixBorder / 2, y - fixBorder / 2, width + fixBorder, height + fixBorder);\n });\n this.ctx.draw(true);\n this.ctx.restore();\n }\n\n _drawWxml (item, style, resolve, reject) {\n let self = this;\n let all = [];\n try {\n this._getWxml(item, style).then((results) => {\n \n // 上 -> 下\n let sorted = self._sortListByTop(results[0]);\n let count = 0;\n let progress = 0;\n Object.keys(sorted).forEach(item => {\n count += sorted[item].length;\n })\n progress = this.distance * 3 / (count || 1);\n\n all = this._drawWxmlBlock(item, sorted, all, progress, results[1]);\n all = this._drawWxmlInline(item, sorted, all, progress, results[1]);\n\n Promise.all(all).then(results => {\n resolve && resolve();\n }).catch (e => {\n reject && reject(e);\n });\n });\n } catch (e) {\n reject && reject({ errcode: 1008, errmsg: 'drawWxml error' });\n }\n }\n\n _drawWxmlBlock (item, sorted, all, progress, results) {\n let self = this;\n // 用来限定位置范围,取相对位置\n let limitLeft = (results ? results.left : 0);\n let limitTop = (results ? results.top : 0);\n Object.keys(sorted).forEach((top, topIndex) => {\n // 左 -> 右\n let list = sorted[top].sort((a, b) => {\n return (a.left - b.left);\n });\n\n list = list.filter(sub => sub.dataset.type && sub.dataset.type.indexOf('inline') === -1);\n\n list.forEach((sub, index) => {\n all[index] = new Promise((resolve2, reject2) => {\n sub = self._transferWxmlStyle(sub, item, limitLeft, limitTop);\n sub.progress = progress;\n let type = sub.dataset.type;\n if(sub.dataset.delay) {\n setTimeout(() => {\n drawWxmlItem();\n }, sub.dataset.delay)\n } else {\n drawWxmlItem();\n }\n function drawWxmlItem () {\n if (type === 'text') {\n self._drawWxmlText(sub, resolve2, reject2);\n } else if (type === 'image') {\n self._drawWxmlImage(sub, resolve2, reject2);\n } else if (type === 'radius-image') {\n self._drawWxmlCircleImage(sub, resolve2, reject2);\n } else if (type === 'background-image') {\n self._drawWxmlBackgroundImage(sub, resolve2, reject2);\n }\n }\n });\n });\n });\n\n return all;\n\n }\n\n _drawWxmlInline (item, sorted, all, progress, results) {\n let self = this;\n let topOffset = 0;\n let leftOffset = 0;\n let lastTop = 0;\n let limitLeft = (results ? results.left : 0);\n let limitTop = (results ? results.top : 0);\n let p = new Promise((resolve2, reject2) => {\n let maxWidth = 0;\n let minLeft = Infinity;\n let maxRight = 0;\n\n // 找出同一top下的最小left和最大right,得到最大的宽度,用于换行\n Object.keys(sorted).forEach(top => {\n let inlineList = sorted[top].filter(sub => sub.dataset.type && sub.dataset.type.indexOf('inline') > -1);\n inlineList.forEach(sub => {\n if(sub.left < minLeft) {\n minLeft = sub.left\n }\n if(sub.right > maxRight) {\n maxRight = sub.right;\n }\n })\n });\n maxWidth = Math.ceil((maxRight - minLeft) || self.width);\n\n Object.keys(sorted).forEach((top, topIndex) => {\n // 左 -> 右\n let list = sorted[top].sort((a, b) => {\n return (a.left - b.left);\n });\n\n // 换行的行内元素left放到后面,version2.0.6后无法获取高度,改用bottom值来判断是否换行了\n let position = -1;\n for(let i = 0, len = list.length; i < len; i++) {\n if(list[i] && list[i + 1]) {\n if(list[i].bottom > list[i + 1].bottom) {\n position = i;\n break;\n }\n }\n }\n\n if(position > -1) {\n list.push(list.splice(position, 1)[0]);\n }\n\n let inlineList = list.filter(sub => sub.dataset.type && sub.dataset.type.indexOf('inline') > -1);\n let originLeft = (inlineList[0] ? inlineList[0].left : 0);\n // 换行后和top不相等时,认为是换行了,要清除左边距;当左偏移量大于最大宽度时,也要清除左边距; 当左偏移小于左边距时,也要清除\n if (Math.abs(topOffset + lastTop - top) > 2 || leftOffset - originLeft - limitLeft >= maxWidth || leftOffset <= originLeft - limitLeft - 2) {\n leftOffset = 0;\n }\n\n lastTop = +top;\n topOffset = 0;\n \n inlineList.forEach((sub, index) => {\n sub = self._transferWxmlStyle(sub, item, limitLeft, limitTop);\n sub.progress = progress;\n let type = sub.dataset.type;\n if (type === 'inline-text') {\n let drawRes = self._drawWxmlInlineText(sub, leftOffset, maxWidth);\n leftOffset = drawRes.leftOffset;\n topOffset = drawRes.topOffset;\n } else if (type === 'inline-image') {\n let drawRes = self._drawWxmlImage(sub) || {};\n leftOffset = drawRes.leftOffset || 0;\n topOffset = drawRes.topOffset || 0;\n }\n });\n });\n resolve2();\n })\n\n all.push(p); \n return all;\n }\n\n _drawWxmlInlineText (sub, leftOffset = 0, maxWidth) {\n let text = sub.dataset.text || '';\n if(sub.dataset.maxlength && text.length > sub.dataset.maxlength) {\n text = text.substring(0, sub.dataset.maxlength) + '...';\n }\n \n let textData = {\n text,\n originX: sub.left,\n x: leftOffset ? leftOffset : sub.left,\n y: sub.top,\n progress: sub.progress,\n leftOffset: leftOffset,\n maxWidth: maxWidth // 行内元素的最大宽度,取决于limit的宽度\n }\n\n if (sub.backgroundColor !== 'rgba(0, 0, 0, 0)') {\n sub.background = sub.backgroundColor;\n }else {\n sub.background = 'rgba(0, 0, 0, 0)';\n }\n\n if(sub.dataset.background) {\n sub.background = sub.dataset.background;\n }\n\n let res = this._drawText(textData, sub, null, null, 'inline-text', 'wxml');\n\n return res\n }\n\n _drawWxmlText (sub, resolve, reject) {\n let text = sub.dataset.text || '';\n if(sub.dataset.maxlength && text.length > sub.dataset.maxlength) {\n text = text.substring(0, sub.dataset.maxlength) + '...';\n }\n \n let textData = {\n text,\n x: sub.left,\n y: sub.top,\n progress: sub.progress\n }\n if (sub.backgroundColor !== 'rgba(0, 0, 0, 0)') {\n sub.background = sub.backgroundColor;\n }else {\n sub.background = 'rgba(0, 0, 0, 0)';\n }\n\n if(sub.dataset.background) {\n sub.background = sub.dataset.background;\n }\n\n this._drawText(textData, sub, resolve, reject, 'text', 'wxml');\n }\n\n _drawWxmlImage (sub, resolve, reject) {\n let imageData = {\n url: sub.dataset.url,\n x: sub.left,\n y: sub.top,\n progress: sub.progress\n }\n\n let res = this._drawRect(imageData, sub, resolve, reject, 'image', 'inline-wxml');\n\n return res\n }\n\n _drawWxmlCircleImage (sub, resolve, reject) {\n let imageData = {\n url: sub.dataset.url,\n x: sub.left,\n y: sub.top,\n progress: sub.progress\n }\n sub.r = sub.width / 2;\n\n this._drawCircle(imageData, sub, resolve, reject, true, 'wxml');\n }\n\n _drawWxmlBackgroundImage (sub, resolve, reject) {\n let url = sub.dataset.url;\n let index = this._findPicIndex(url);\n url = index > -1 ? this.allPic[index].local : url;\n let size = sub.backgroundSize.replace(/px/g, '').split(' ');\n\n let imageData = {\n url: url,\n x: sub.left,\n y: sub.top,\n progress: sub.progress\n }\n\n this._drawRect(imageData, sub, resolve, reject, 'image', 'wxml');\n }\n\n _getWxml (item, style) {\n let self = this;\n let query;\n if(this.obj) {\n query = wx.createSelectorQuery().in(this.obj);\n }else {\n query = wx.createSelectorQuery();\n }\n\n let p1 = new Promise((resolve, reject) => {\n // 会触发两次,要限制\n let count = 0;\n query.selectAll(`${item.class}`).fields({\n dataset: true,\n size: true,\n rect: true,\n computedStyle: ['width', 'height', 'font', 'fontSize', 'fontFamily', 'fontWeight', 'fontStyle', 'textAlign', \n 'color', 'lineHeight', 'border', 'borderColor', 'borderStyle', 'borderWidth', 'verticalAlign', 'boxShadow',\n 'background', 'backgroundColor', 'backgroundImage', 'backgroundPosition', 'backgroundSize', 'paddingLeft', 'paddingTop',\n 'paddingRight', 'paddingBottom'\n ]\n }, (res) => {\n if(count++ === 0) {\n let formated = self._formatImage(res);\n let list = formated.list;\n res = formated.res;\n\n self._preloadImage(list).then(result => {\n resolve(res);\n }).catch((res) => {\n reject && reject({ errcode: 1009, errmsg: 'drawWxml preLoadImage error' });\n });\n }\n }).exec();\n });\n\n let p2 = new Promise((resolve, reject) => {\n if (!item.limit) {\n resolve({ top: 0, width: self.width / self.zoom });\n }\n\n query.select(`${item.limit}`).fields({\n dataset: true,\n size: true,\n rect: true,\n }, (res) => {\n resolve(res);\n }).exec();\n });\n\n return Promise.all([p1, p2]);\n }\n\n _getLineHeight (style) {\n let zoom = this.zoom;\n if(style.dataset && style.dataset.type) {\n zoom = 1;\n }\n let lineHeight;\n if(!isNaN(style.lineHeight) && style.lineHeight > style.fontSize) {\n lineHeight = style.lineHeight;\n }else {\n style.lineHeight = (style.lineHeight || '') + '';\n lineHeight = +style.lineHeight.replace('px', '');\n lineHeight = lineHeight ? lineHeight : (style.fontSize || 14) * 1.2;\n }\n return lineHeight * zoom;\n }\n\n _formatImage (res = []) {\n let list = [];\n res.forEach((item, index) => {\n let dataset = item.dataset;\n let uid = Util.getUid();\n let filename = `${wx.env.USER_DATA_PATH}/${uid}.png`;\n if ((dataset.type === \"image\" || dataset.type === \"radius-image\") && dataset.url) {\n let sub = {\n url: dataset.base64 ? filename : dataset.url,\n isBase64: dataset.base64 ? dataset.url : false\n }\n\n res[index].dataset = Object.assign(res[index].dataset, sub);\n list.push(sub)\n } else if (dataset.type === 'background-image' && item.backgroundImage.indexOf('url') > -1) {\n let url = item.backgroundImage.replace(/url\\((\\\"|\\')?/, '').replace(/(\\\"|\\')?\\)$/, '');\n let sub = {\n url: dataset.base64 ? filename : url,\n isBase64: dataset.base64 ? url : false\n }\n res[index].dataset = Object.assign(res[index].dataset, sub);\n list.push(sub)\n }\n });\n\n return { list, res };\n }\n\n _updateProgress (distance) {\n this.progressPercent += distance;\n this.progress(this.progressPercent);\n }\n\n _sortListByTop (list = []) {\n let sorted = {};\n\n // 粗略地认为2px相差的元素在同一行\n list.forEach((item, index) => {\n let top = item.top;\n if (!sorted[top]) {\n if (sorted[top - 2]) {\n top = top - 2;\n }else if (sorted[top - 1]) {\n top = top - 1;\n } else if (sorted[top + 1]) {\n top = top + 1;\n } else if (sorted[top + 2]) {\n top = top + 2;\n } else {\n sorted[top] = [];\n }\n }\n sorted[top].push(item);\n });\n\n return sorted;\n }\n\n _parseNumber (number) {\n return isNaN(number) ? +(number || '').replace('px', '') : number;\n }\n\n _transferWxmlStyle (sub, item, limitLeft, limitTop) {\n let leftFix = (+sub.dataset.left || 0);\n let topFix = (+sub.dataset.top || 0);\n\n sub.width = this._parseNumber(sub.width);\n sub.height = this._parseNumber(sub.height);\n sub.left = this._parseNumber(sub.left) - limitLeft + (leftFix + (item.x || 0)) * this.zoom;\n sub.top = this._parseNumber(sub.top) - limitTop + (topFix + (item.y || 0)) * this.zoom;\n\n let padding = sub.dataset.padding || '0 0 0 0';\n if (typeof padding === 'string') {\n padding = Util.transferPadding(padding);\n }\n let paddingTop = Number(sub.paddingTop.replace('px', '')) + Number(padding[0]);\n let paddingRight = Number(sub.paddingRight.replace('px', '')) + Number(padding[1]);\n let paddingBottom = Number(sub.paddingBottom.replace('px', '')) + Number(padding[2]);\n let paddingLeft = Number(sub.paddingLeft.replace('px', '')) + Number(padding[3]);\n sub.padding = [paddingTop, paddingRight, paddingBottom, paddingLeft];\n \n return sub;\n }\n\n /**\n * 支持负值绘制,从右边计算\n * @param {*} item \n * @param {*} style \n */\n _resetPositionX (item, style) {\n let zoom = this.zoom;\n let x = 0;\n\n if(style.dataset && style.dataset.type) {\n zoom = 1;\n }\n\n // 通过wxml获取的不需要重置坐标\n if (item.x < 0 && item.type) {\n x = this.width + item.x * zoom - style.width * zoom;\n } else {\n x = item.x * zoom;\n }\n\n if (parseInt(style.borderWidth)) {\n x += parseInt(style.borderWidth)\n }\n\n return x + this.translateX;\n }\n\n /**\n * 支持负值绘制,从底部计算\n * @param {*} item \n * @param {*} style \n */\n _resetPositionY (item, style, textHeight) {\n let zoom = this.zoom;\n let y = 0;\n\n if(style.dataset && style.dataset.type) {\n zoom = 1;\n }\n\n if (item.y < 0) {\n y = this.height + item.y * zoom - (textHeight ? textHeight : style.height * zoom)\n } else {\n y = item.y * zoom;\n }\n\n if (parseInt(style.borderWidth)) {\n y += parseInt(style.borderWidth)\n }\n \n return y + this.translateY;\n }\n\n /**\n * 文字的padding、text-align\n * @param {*} item \n * @param {*} style \n * @param {*} textWidth\n */\n _resetTextPositionX (item, style, textWidth, width) {\n let textAlign = style.textAlign || 'left';\n let x = item.x;\n if (textAlign === 'center') {\n x = (width - textWidth) / 2 + item.x;\n } else if (textAlign === 'right') {\n x = width - textWidth + item.x;\n }\n\n let left = style.padding ? (style.padding[3] || 0) : 0;\n\n return x + left + this.translateX;\n }\n\n /**\n * 文字的padding、text-align\n * @param {*} item \n * @param {*} style \n * @param {*} textWidth\n */\n _resetTextPositionY (item, style, lineNum = 0) {\n let zoom = this.zoom;\n if(style.dataset && style.dataset.type) {\n zoom = 1;\n }\n\n let lineHeight = this._getLineHeight(style);\n let fontSize = Math.ceil((style.fontSize || 14) * zoom)\n\n let blockLineHeightFix = (style.dataset && style.dataset.type || '').indexOf('inline') > -1 ? 0 : (lineHeight - fontSize) / 2\n\n let top = style.padding ? (style.padding[0] || 0) : 0;\n\n // y + lineheight偏移 + 行数 + paddingTop + 整体画布位移\n return item.y + blockLineHeightFix + lineNum * lineHeight + top + this.translateY;\n }\n\n /**\n * 当文本超过宽度时,计算每一行应该绘制的文本\n * @param {*} text \n * @param {*} width \n * @param {*} singleLength \n * @param {*} currentIndex \n * @param {*} widthOffset\n */\n _getTextSingleLine(text, width, singleLength, currentIndex = 0, widthOffset = 0) {\n let offset = 0;\n let endIndex = currentIndex + singleLength + offset;\n let single = text.substring(currentIndex, endIndex);\n let singleWidth = this.measureWidth(single);\n\n while (Math.round(widthOffset + singleWidth) > width) {\n offset--;\n endIndex = currentIndex + singleLength + offset;\n single = text.substring(currentIndex, endIndex);\n singleWidth = this.measureWidth(single);\n }\n\n return {\n endIndex, \n single, \n singleWidth\n }\n }\n\n _drawBorder (border, style, callback) {\n let zoom = this.zoom;\n if(style.dataset && style.dataset.type) {\n zoom = 1;\n }\n border = Util.transferBorder(border);\n\n if (border && border.width) {\n // 空白阴影,清空掉边框的阴影\n this._drawBoxShadow();\n if (border) {\n \n this.ctx.setLineWidth(border.width * zoom);\n\n if (border.style === 'dashed') {\n let dash = style.dash || [5, 5, 0];\n let offset = dash[2] || 0;\n let array = [dash[0] || 5, dash[1] || 5];\n this.ctx.setLineDash(array, offset);\n }\n this.ctx.setStrokeStyle(border.color);\n }\n callback && callback(border);\n }\n } \n\n _drawBoxShadow (boxShadow, callback) {\n boxShadow = Util.transferBoxShadow(boxShadow);\n if (boxShadow) {\n this.ctx.setShadow(boxShadow.offsetX, boxShadow.offsetY, boxShadow.blur, boxShadow.color);\n }else {\n this.ctx.setShadow(0, 0, 0, '#ffffff');\n }\n\n callback && callback(boxShadow || {});\n }\n\n _setFill (fill, callback) {\n if(fill) {\n if (typeof fill === 'string') {\n this.ctx.setFillStyle(fill);\n } else {\n let line = fill.line;\n let color = fill.color;\n let grd = this.ctx.createLinearGradient(line[0], line[1], line[2], line[3]);\n grd.addColorStop(0, color[0]);\n grd.addColorStop(1, color[1]);\n this.ctx.setFillStyle(grd);\n }\n callback && callback();\n }\n }\n\n _setStroke (stroke, callback) {\n if(stroke) {\n if (typeof stroke === 'string') {\n this.ctx.setStrokeStyle(stroke);\n } else {\n let line = stroke.line;\n let color = stroke.color;\n let grd = this.ctx.createLinearGradient(line[0], line[1], line[2], line[3]);\n grd.addColorStop(0, color[0]);\n grd.addColorStop(1, color[1]);\n this.ctx.setStrokeStyle(grd);\n }\n\n callback && callback();\n }\n }\n}\n\nif (!exports.__esModule) Object.defineProperty(exports, \"__esModule\", { value: true });exports.default = Wxml2Canvas;","/**\n * 获取字符的长度,full为true时,一个汉字算两个长度\n * @param {String} str \n * @param {Boolean} full \n */\n\nfunction getTextLength (str, full) {\n let len = 0;\n for (let i = 0; i < str.length; i++) {\n let c = str.charCodeAt(i);\n //单字节加1 \n if ((c >= 0x0001 && c <= 0x007e) || (0xff60 <= c && c <= 0xff9f)) {\n len++;\n }\n else {\n len += (full ? 2 : 1);\n }\n }\n return len;\n}\n\n/**\n * rgba(255, 255, 255, 1) => #ffffff\n * @param {String} color \n */\nfunction transferColor (color = '') {\n let res = '#';\n color = color.replace(/^rgba?\\(/, '').replace(/\\)$/, '');\n color = color.split(', ');\n \n color.length > 3 ? color.length = 3 : '';\n for(let item of color) {\n item = parseInt(item || 0);\n if(item < 10) {\n res += ('0' + item)\n }else {\n res += (item.toString(16))\n }\n }\n\n return res;\n}\n\nfunction transferBorder (border = '') {\n let res = border.match(/(\\w+)px\\s(\\w+)\\s(.*)/);\n let obj = {};\n\n if(res) {\n obj = {\n width: +res[1],\n style: res[2],\n color: res[3]\n }\n }\n \n return res ? obj : null;\n}\n\n\n/**\n * 内边距,依次为上右下左\n * @param {*} padding \n */\nfunction transferPadding (padding = '0 0 0 0') {\n padding = padding.split(' ');\n for(let i = 0, len = padding.length; i < len; i++) {\n padding[i] = +padding[i].replace('px', '');\n }\n\n return padding;\n}\n/**\n * type1: 0, 25, 17, rgba(0, 0, 0, 0.3)\n * type2: rgba(0, 0, 0, 0.3) 0px 25px 17px 0px => (0, 25, 17, rgba(0, 0, 0, 0.3))\n * @param {*} shadow \n */\nfunction transferBoxShadow(shadow = '', type) {\n if(!shadow || shadow === 'none') return;\n let color;\n let split;\n\n split = shadow.match(/(\\w+)\\s(\\w+)\\s(\\w+)\\s(rgb.*)/);\n\n if (split) {\n split.shift();\n shadow = split;\n color = split[3] || '#ffffff';\n } else {\n split = shadow.split(') ');\n color = split[0] + ')'\n shadow = split[1].split('px ');\n }\n\n return {\n offsetX: +shadow[0] || 0,\n offsetY: +shadow[1] || 0,\n blur: +shadow[2] || 0,\n color\n }\n}\n\nfunction getUid(prefix) {\n prefix = prefix || '';\n\n return (\n prefix +\n 'xxyxxyxx'.replace(/[xy]/g, c => {\n let r = (Math.random() * 16) | 0;\n let v = c === 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n })\n );\n}\n\nif (!exports.__esModule) Object.defineProperty(exports, \"__esModule\", { value: true });exports.default = {\n getTextLength,\n transferBorder,\n transferColor,\n transferPadding,\n transferBoxShadow,\n getUid\n};"]} diff --git a/src/components/customTable/README.md b/src/components/customTable/README.md new file mode 100644 index 0000000..7fed6ab --- /dev/null +++ b/src/components/customTable/README.md @@ -0,0 +1,160 @@ +# 海报插件 + +## 基于[wxml2canvas](https://github.com/wg-front/wxml2canvas)插件 + +### 插件引入 + +```json +{ + "customPoster": "/components/customPoster/index" +} +``` + +```wxml + +``` + +### 参数示例 + +```js +const data = { + params: { + info: { id: 'circle-note_mp', title: '动态页', desc: '指定动态的页面,mp' }, + body: { + bgImg: + 'https://picsissiok-10049618.cos.ap-shanghai.myqcloud.com/a74018e725861534f1644cff04780f4e_16273677601587.png', + width: '750', + height: '1254', + }, + elements: [ + { + id: 'circle-name', + desc: '圈名称', + type: 1, + text: '治疗讨论', + font: '宋体', + 'font-size': '42', + color: '#FFFFFF', + 'single-line': true, + halign: 'center', + top: '106', + }, + { + id: 'master-name', + desc: '专家名称', + type: 1, + text: '健康小贴士', + font: '宋体', + 'font-size': '38', + color: '#FFFFFF', + 'single-line': true, + halign: 'center', + top: '237', + }, + { + id: 'master-avatar', + desc: '专家头像', + type: 0, + picType: 'avatar', + src: 'https://picsissiok-10049618.cos.ap-shanghai.myqcloud.com/ceb31ac6137e873225b8cc826389a267_16655329078962.jpg', + width: '120', + height: '120', + halign: 'center', + shape: 'circle', + top: '328', + }, + { + id: 'note-content', + desc: '动态内容', + type: 1, + text: '11月5日上海组织进口博览会CIIE大会,邀请大家来我们的展馆现场交流。', + font: '宋体', + 'font-size': '45', + color: '#18191A', + width: '630', + height: '348', + left: '60', + top: '495', + }, + { + id: 'note-title', + desc: '长文标题', + type: 1, + text: '', + font: '宋体', + 'font-size': '42', + color: '#18191A', + width: '659', + height: '116', + left: '46', + top: '495', + 'font-weight': 'bold', + }, + { + id: 'note-summary', + desc: '长文摘要 ', + type: 1, + text: '', + font: '宋体', + 'font-size': '42', + color: '#18191A', + width: '672', + height: '232', + left: '39', + top: '646', + }, + { + id: 'note-more', + desc: '还有', + type: 1, + text: '还有3条精彩附件>', + font: '宋体', + 'font-size': '31', + color: '#666666', + 'single-line': true, + width: '292', + height: '46', + left: '60', + top: '1024', + }, + { + id: 'scanText', + desc: '扫描二维码查看详情', + type: 1, + text: '扫描二维码查看详情', + font: '宋体', + 'font-size': '31', + color: '#666666', + 'single-line': true, + width: '279', + height: '43', + left: '60', + top: '1087', + }, + { + id: 'note-qrcode', + desc: '专家列表的二维码', + type: 0, + picType: 'qrcode', + src: 'https://family.devred.hbraas.com/proxy/mp.weixin.qq.com/cgi-bin/showqrcode?ticket=gQHJ8TwAAAAAAAAAAS5odHRwOi8vd2VpeGluLnFxLmNvbS9xLzAyUWhDdGhTWVNlTjMxMDAwMDAwN3gAAgSonPxjAwQAAAAA', + width: '130', + height: '130', + left: '554', + top: '1012', + }, + { + id: 'brand', + desc: 'brand×华秉科技', + type: 1, + text: '做企业数字化转型的亲密伙伴×华秉科技', + font: '宋体', + 'font-size': '24', + color: '#B2B3B4', + 'single-line': true, + halign: 'center', + top: '1192', + }, + ], + }, +} +``` diff --git a/src/components/customTable/index.js b/src/components/customTable/index.js new file mode 100644 index 0000000..300ac18 --- /dev/null +++ b/src/components/customTable/index.js @@ -0,0 +1,240 @@ +const app = getApp(); +import Wxml2Canvas from "./wxml2canvas/index.js"; // 根据具体路径修改,node_modules会被忽略 + +Component({ + properties: { + params: { + type: Object, + observer(newVal, _olVal) { + if (Object.keys(newVal).length > 0) { + this.drawImage(); + } + }, + }, + }, + data: { + imageUrl: app.globalData.imageUrl, + imgUrl: "", + width: "626", + height: "980", + imgheight: "", + bgImg: "", + elementsMp: [], + tableData: [ + { + title: "说话", + key: "TalkingScore", + list: [ + { + id: "1", + title: "正常", + }, + { + id: "2", + title: "间或有点含糊或有鼻音", + }, + { + id: "3", + title: "经常含糊不清或者有鼻音,但是别人还能听懂", + }, + { + id: "4", + title: "别人听不太懂", + }, + ], + }, + { + title: "咀嚼", + key: "ChewScore", + list: [ + { + id: "1", + title: "正常", + }, + { + id: "2", + title: "咀嚼固体食物会感到疲劳", + }, + { + id: "3", + title: "咀嚼松软食物会感到疲劳", + }, + { + id: "4", + title: "使用喂食管进食,如鼻胃管胃肠管等", + }, + ], + }, + { + title: "吞咽", + key: "SwallowScore", + list: [ + { + id: "1", + title: "正常", + }, + { + id: "2", + title: "偶尔会噎到", + }, + { + id: "3", + title: "经常会噎到,因而需要改变饮食习惯", + }, + { + id: "4", + title: "使用喂食管进食,如鼻胃管胃肠管等", + }, + ], + }, + { + title: "呼吸", + key: "BreathScore", + list: [ + { + id: "1", + title: "正常", + }, + { + id: "2", + title: "劳累后感到气促或呼吸不畅", + }, + { + id: "3", + title: "静止时感到气促或呼吸不畅", + }, + { + id: "4", + title: "依赖呼吸机", + }, + ], + }, + { + title: "刷牙梳头能力受损", + key: "BrushTeethAndCombHairScore", + list: [ + { + id: "1", + title: "正常", + }, + { + id: "2", + title: "需要多费些力气但是不需要停下来", + }, + { + id: "3", + title: "需要停下来休息才能完成", + }, + { + id: "4", + title: "无法自己完成", + }, + ], + }, + { + title: "从椅子上起身能力受损", + key: "GetUpFromChairScore", + list: [ + { + id: "1", + title: "正常", + }, + { + id: "2", + title: "轻度受损,有时需要用手帮忙", + }, + { + id: "3", + title: "中度受损,总是需要用手帮忙", + }, + { + id: "4", + title: "严重受损,需要他人帮助", + }, + ], + }, + { + title: "复视/重影", + key: "DoubleVisionScore", + list: [ + { + id: "1", + title: "正常", + }, + { + id: "2", + title: "有,但不是每天", + }, + { + id: "3", + title: "每天,但不是持续一整天", + }, + { + id: "4", + title: "持续有", + }, + ], + }, + { + title: "眼睑下垂", + key: "DroopyEyelidsScore", + list: [ + { + id: "1", + title: "正常", + }, + { + id: "2", + title: "有,但不是每天", + }, + { + id: "3", + title: "每天,但不是持续一整天", + }, + { + id: "4", + title: "持续有", + }, + ], + }, + ], + }, + lifetimes: { + attached() {}, + }, + methods: { + drawImage() { + let self = this; + // destZoom: 10, + this.drawImage1 = new Wxml2Canvas({ + obj: self, + width: this.data.width, // 宽, 以iphone6为基准,传具体数值,其它机型自动适配 + height: this.data.height, // 高 + element: "canvas1", + background: "#ffffff", + progress(_percent) {}, + finish(url) { + self.setData({ + imgUrl: url, + }); + self.triggerEvent("finish", url); + }, + error(_res) {}, + }); + + let data = { + list: [ + { + type: "wxml", + class: "#canvas-bill-body-mp .draw_canvas", + limit: "#canvas-bill-body-mp", + x: 0, + y: 0, + }, + ], + }; + + this.drawImage1.draw(data); + }, + }, +}); diff --git a/src/components/customTable/index.json b/src/components/customTable/index.json new file mode 100644 index 0000000..a97367d --- /dev/null +++ b/src/components/customTable/index.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} diff --git a/src/components/customTable/index.scss b/src/components/customTable/index.scss new file mode 100644 index 0000000..7e03bb2 --- /dev/null +++ b/src/components/customTable/index.scss @@ -0,0 +1,141 @@ +.canvas-box { + position: fixed; + left: 1000000rpx; + top: -1000000rpx; +} +.canvas-body { + background-position: center; + background-repeat: no-repeat; + background-size: cover; + background-color: #fff; + .detail { + width: 622rpx; + border: 1rpx solid rgba(0, 0, 0, 0.1); + background-color: rgba(0, 0, 0, 0.08); + .d-header { + display: flex; + height: 40rpx; + .none { + flex-shrink: 0; + width: 150rpx; + background-color: rgba(228, 228, 228, 1); + } + .bar { + flex: 1; + display: flex; + .num-normal { + width: 64rpx; + text-align: center; + font-size: 24rpx; + color: #fff; + line-height: 40rpx; + } + .num { + flex: 1; + text-align: center; + font-size: 24rpx; + color: #fff; + line-height: 40rpx; + } + } + } + .d-body { + display: flex; + .d-aside { + width: 28rpx; + flex-shrink: 0; + .da-item { + text-align: center; + font-size: 18rpx; + color: rgba(102, 102, 102, 1); + line-height: 1; + background-color: #e5e5e5; + } + .da-item1 { + padding-top: 150rpx; + display: flex; + height: 200rpx; + margin-bottom: 1px; + } + .da-item2 { + padding-top: 43rpx; + height: 75rpx; + margin-bottom: 1px; + } + .da-item3 { + padding-top: 100rpx; + height: 135rpx; + margin-bottom: 1px; + } + .da-item4 { + padding-top: 100rpx; + height: 135rpx; + } + } + .d-container { + flex: 1; + .dc-row { + display: flex; + height: 117rpx; + line-height: 24rpx; + margin-bottom: 1px; + .dc-title { + padding: 12rpx 12rpx 0; + width: 100rpx; + font-size: 18rpx; + color: rgba(102, 102, 102, 1); + } + .dc-sub-title { + width: 64rpx; + text-align: center; + font-size: 18rpx; + color: rgba(102, 102, 102, 1); + padding: 12rpx 0; + margin-left: 1px; + } + .dc-col { + margin-left: 1px; + padding: 12rpx; + flex: 1; + font-size: 18rpx; + color: rgba(102, 102, 102, 1); + } + .active { + color: #fff !important; + background-color: rgba(207, 83, 117, 1) !important; + } + } + .dc-row:nth-of-type(2n-1) { + .dc-title { + background-color: #f6f6f6; + } + .dc-sub-title { + background-color: #f6f6f6; + } + .dc-col { + background-color: #f6f6f6; + } + } + .dc-row:nth-of-type(2n-2) { + .dc-title { + background-color: #fff; + } + .dc-sub-title { + background-color: #fff; + } + .dc-col { + background-color: #fff; + } + } + } + } + } +} + +.canvas-bill { + position: fixed; + width: 750rpx; + left: 1000000rpx; + top: -1000000rpx; + visibility: hidden; +} diff --git a/src/components/customTable/index.wxml b/src/components/customTable/index.wxml new file mode 100644 index 0000000..83ea374 --- /dev/null +++ b/src/components/customTable/index.wxml @@ -0,0 +1,55 @@ + + + + + + + 0分 + 1分 + 2分 + 3分 + + + + + 延髓 + 呼吸 + 四肢 + 眼肌 + + + + {{item.title}} + + + {{lItem.title}} + + + + + + + + + + + + + diff --git a/src/components/customTable/wxml2canvas/README.md b/src/components/customTable/wxml2canvas/README.md new file mode 100644 index 0000000..e69de29 diff --git a/src/components/customTable/wxml2canvas/index.js b/src/components/customTable/wxml2canvas/index.js new file mode 100644 index 0000000..ed94943 --- /dev/null +++ b/src/components/customTable/wxml2canvas/index.js @@ -0,0 +1,1691 @@ +module.exports = (function () { + var __MODS__ = {}; + var __DEFINE__ = function (modId, func, req) { + var m = { exports: {}, _tempexports: {} }; + __MODS__[modId] = { status: 0, func: func, req: req, m: m }; + }; + var __REQUIRE__ = function (modId, source) { + if (!__MODS__[modId]) return require(source); + if (!__MODS__[modId].status) { + var m = __MODS__[modId].m; + m._exports = m._tempexports; + var desp = Object.getOwnPropertyDescriptor(m, "exports"); + if (desp && desp.configurable) + Object.defineProperty(m, "exports", { + set: function (val) { + if (typeof val === "object" && val !== m._exports) { + m._exports.__proto__ = val.__proto__; + Object.keys(val).forEach(function (k) { + m._exports[k] = val[k]; + }); + } + m._tempexports = val; + }, + get: function () { + return m._tempexports; + }, + }); + __MODS__[modId].status = 1; + __MODS__[modId].func(__MODS__[modId].req, m, m.exports); + } + return __MODS__[modId].m.exports; + }; + var __REQUIRE_WILDCARD__ = function (obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + if (obj != null) { + for (var k in obj) { + if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; + } + } + newObj.default = obj; + return newObj; + } + }; + var __REQUIRE_DEFAULT__ = function (obj) { + return obj && obj.__esModule ? obj.default : obj; + }; + __DEFINE__( + 1685064731946, + function (require, module, exports) { + var __TEMP__ = require("./src/index"); + var Wxml2Canvas = __REQUIRE_DEFAULT__(__TEMP__); + + if (!exports.__esModule) Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = Wxml2Canvas; + }, + function (modId) { + var map = { "./src/index": 1685064731947 }; + return __REQUIRE__(map[modId], modId); + }, + ); + __DEFINE__( + 1685064731947, + function (require, module, exports) { + var __TEMP__ = require("./util"); + var Util = __REQUIRE_DEFAULT__(__TEMP__); + + const imageMode = [ + "scaleToFill", + "aspectFit", + "aspectFill", + "widthFix", + "top", + "bottom", + "center", + "left", + "right", + "top left", + "top right", + "bottom left", + "bottom right", + ]; + + class Wxml2Canvas { + constructor(options = {}) { + this.device = (wx.getSystemInfoSync && wx.getSystemInfoSync()) || {}; + + if (!options.zoom) { + this.zoom = this.device.windowWidth / 375; + } else { + this.zoom = options.zoom || 1; + } + + this.element = options.element; + this.object = options.obj; + this.width = options.width * this.zoom || 0; + this.height = options.height * this.zoom || 0; + this.destZoom = options.destZoom || 3; + this.destWidth = this.width * this.destZoom; + this.destHeight = this.height * this.destZoom; + this.translateX = options.translateX * this.zoom || 0; + this.translateY = options.translateY * this.zoom || 0; + this.gradientBackground = options.gradientBackground || null; + this.background = options.background || "#ffffff"; + this.finishDraw = options.finish || function finish(params) {}; + this.errorHandler = options.error || function error(params) {}; + this.progress = options.progress || function progress(params) {}; + this.textAlign = options.textAlign || "left"; + this.fullText = options.fullText || false; + this.font = options.font || "14px PingFang SC"; + + this._init(); + } + + draw(data = {}, that) { + let self = this; + this.data = data; + this.fef = that; + + this.progress(10); + this._preloadImage(data.list) + .then((result) => { + this.progress(30); + self._draw(); + }) + .catch((res) => { + self.errorHandler(res); + }); + } + + measureWidth(text, font) { + if (font) { + this.ctx.font = font; + } + let res = this.ctx.measureText(text) || {}; + return res.width || 0; + } + + _init() { + this.progressPercent = 0; // 绘制进度百分比 + this.data = null; + this.ref = null; + this.allPic = []; + this.screenList = []; + this.asyncList = []; + this.imgUrl = ""; + this.progressPercent = 0; + this.distance = 0; + this.progress(0); + + this.ctx = wx.createCanvasContext(this.element, this.object); + this.ctx.font = this.font; + this.ctx.setTextBaseline("top"); + this.ctx.setStrokeStyle("white"); + + this.debug = this.device.platform === "devtools" ? true : false; + + this._drawBakcground(); + } + + _drawBakcground() { + if (this.gradientBackground) { + let line = this.gradientBackground.line || [0, 0, 0, this.height]; + let color = this.gradientBackground.color || ["#fff", "#fff"]; + let style = { fill: { line, color } }; + this._drawRectToCanvas(0, 0, this.width, this.height, style); + } else { + let style = { fill: this.background }; + this._drawRectToCanvas(0, 0, this.width, this.height, style); + } + } + + _draw() { + let self = this; + let list = this.data.list || []; + let index = 0; + let all = []; + let count = 0; + + list.forEach((item) => { + if (item.type === "wxml") { + count += 3; + } else { + count += 1; + } + }); + + this.distance = 60 / (count || 1); // 进度条的间距 + this.progressPercent = 30; + this.asyncList = list.filter((item) => item.delay == true); + list = list.filter((item) => item.delay != true); + drawList(list); + + Promise.all(all) + .then((results) => { + index = 0; + drawList(self.asyncList, true); + + Promise.all(all).then((results) => { + self.progress(90); + self._saveCanvasToImage(); + }); + }) + .catch((e) => { + console.log(e); + self.errorHandler(e); + }); + + function drawList(list = [], noDelay) { + list.forEach((item, i) => { + all[index++] = new Promise((resolve, reject) => { + let attr = item.style; + item.progress = self.distance; + if (noDelay) { + item.delay = 0; + } + if (item.type === "radius-image") { + self._drawCircle(item, attr, resolve, reject, "image"); + } else if (item.type === "text") { + self._drawText(item, attr, resolve, reject); + } else if (item.type === "line") { + self._drawLine(item, attr, resolve, reject); + } else if (item.type === "circle") { + self._drawCircle(item, attr, resolve, reject); + } else if (item.type === "rect") { + self._drawRect(item, attr, resolve, reject); + } else if (item.type === "image") { + self._drawRect(item, attr, resolve, reject, "image"); + } else if (item.type === "wxml") { + self._drawWxml(item, attr, resolve, reject); + } else { + resolve(); + } + }); + }); + } + } + + _saveCanvasToImage() { + let self = this; + + // 延时保存有两个原因,一个是等待绘制delay的元素,另一个是安卓上样式会错乱 + setTimeout( + () => { + self.progress(95); + + let obj = { + x: 0, + y: 0, + width: self.width, + height: self.height, + canvasId: self.element, + success: function (res) { + self.progress(100); + self.imgUrl = res.tempFilePath; + self.finishDraw(self.imgUrl); + }, + fail: function (res) { + self.errorHandler({ errcode: 1000, errmsg: "save canvas error", e: res }); + }, + }; + + if (self.destZoom !== 3) { + obj.destWidth = self.destWidth; + obj.destHeight = self.destHeight; + } + + wx.canvasToTempFilePath(obj, self.object); + }, + self.device.system.indexOf("iOS") === -1 ? 300 : 100, + ); + } + + _preloadImage(list = []) { + let self = this; + let all = []; + let count = 0; + + list.forEach((item, i) => { + if (item.url && self._findPicIndex(item.url) === -1) { + // 避免重复下载同一图片 + self.allPic.push({ + url: item.url, + local: "", + }); + all[count++] = new Promise((resolve, reject) => { + // 非http(s)域名的就不下载了 + if ( + !/^http/.test(item.url) || + /^http:\/\/(tmp)|(usr)\//.test(item.url) || + /^http:\/\/127\.0\.0\.1/.test(item.url) + ) { + if (item.isBase64) { + let fileManager = wx.getFileSystemManager(); + + fileManager.writeFile({ + filePath: item.url, + data: item.isBase64.replace(/data:image\/(.*);base64,/, ""), + encoding: "base64", + success(res) { + imageInfo(item.url); + }, + fail(res) { + reject(res); + }, + }); + } else { + imageInfo(item.url); + } + + function imageInfo(url) { + wx.getImageInfo({ + src: url, + success(res) { + let index = self._findPicIndex(url); + if (index > -1) { + self.allPic[index].local = url; + self.allPic[index].width = res.width; + self.allPic[index].height = res.height; + } + resolve({ tempFilePath: url }); + }, + fail(res) { + reject(res); + }, + }); + } + } else { + wx.downloadFile({ + url: item.url.replace(/^https?/, "https"), + success: function (res) { + wx.getImageInfo({ + src: res.tempFilePath, + success(img) { + let index = self._findPicIndex(item.url); + if (index > -1) { + self.allPic[index].local = res.tempFilePath; + self.allPic[index].width = img.width; + self.allPic[index].height = img.height; + } + resolve(res); + }, + fail(res) { + reject(res); + }, + }); + }, + fail: (res) => { + reject({ errcode: 1001, errmsg: "download pic error" }); + }, + }); + } + }); + } + }); + + return Promise.all(all) + .then((results) => { + return new Promise((resolve) => { + resolve(); + }); + }) + .catch((results) => { + return new Promise((resolve, reject) => { + reject(results); + }); + }); + } + + _findPicIndex(url) { + let index = this.allPic.findIndex((pic) => pic.url === url); + return index; + } + + _drawRect(item, style, resolve, reject, isImage, isWxml) { + let zoom = this.zoom; + let leftOffset = 0; + let topOffset = 0; + let width = style.width; + let height = style.height; + let imgWidth = style.width; + let imgHeight = style.height; + let mode = null; + + try { + item.x = this._resetPositionX(item, style); + item.y = this._resetPositionY(item, style); + + let url; + if (isImage) { + let index = this._findPicIndex(item.url); + if (index > -1) { + url = this.allPic[index].local; + imgWidth = this.allPic[index].width; + imgHeight = this.allPic[index].height; + } else { + url = item.url; + } + } + + style.padding = style.padding || []; + if (isWxml === "inline-wxml") { + item.x = item.x + ((style.padding[3] && style.padding[3]) || 0); + item.y = item.y + ((style.padding[0] && style.padding[0]) || 0); + } + + leftOffset = item.x + style.width + ((style.padding[1] && style.padding[1]) || 0); + + if (!isWxml) { + width = width * zoom; + height = height * zoom; + } + + if (style.dataset && style.dataset.mode && imageMode.indexOf(style.dataset.mode) > -1) { + mode = { + type: style.dataset.mode, + width: imgWidth, + height: imgHeight, + }; + } + + this._drawRectToCanvas(item.x, item.y, width, height, style, url, mode); + this._updateProgress(item.progress); + + if (resolve) { + resolve(); + } else { + return { + leftOffset, + topOffset, + }; + } + } catch (e) { + reject && + reject({ errcode: isImage ? 1003 : 1002, errmsg: isImage ? "drawImage error" : "drawRect error", e }); + } + } + + _drawRectToCanvas(x, y, width, height, style, url, mode) { + let { fill, border, boxShadow } = style; + this.ctx.save(); + this._drawBoxShadow(boxShadow, (res) => { + // 真机上填充渐变色时,没有阴影,先画个相等大小的纯色矩形来实现阴影 + if (fill && typeof fill !== "string" && !this.debug) { + this.ctx.setFillStyle(res.color || "#ffffff"); + this.ctx.fillRect(x, y, width, height); + } + }); + + if (url) { + // 开发者工具有bug,先不裁剪 + if (mode) { + this._resetImageByMode(url, x, y, width, height, mode); + } else { + this.ctx.drawImage(url, x, y, width, height); + } + } else { + this._setFill(fill, () => { + this.ctx.fillRect(x, y, width, height); + }); + } + + this._drawBorder(border, style, (border) => { + let fixBorder = border.width; + this.ctx.strokeRect(x - fixBorder / 2, y - fixBorder / 2, width + fixBorder, height + fixBorder); + }); + + this.ctx.draw(true); + this.ctx.restore(); + } + + _resetImageByMode(url, x, y, width, height, mode) { + let self = this; + let offsetX = 0; + let offsetY = 0; + let imgWidth = mode.width; + let imgHeight = mode.height; + + switch (mode.type) { + case "scaleToFill": + imgWidth = width; + imgHeight = height; + self.ctx.drawImage(url, x, y, width, height); + break; + case "widthFix": + height = width / ((imgWidth || 1) / (imgHeight || 1)); + self.ctx.drawImage(url, x, y, width, height); + break; + case "aspectFit": + if (imgWidth > imgHeight) { + let realHeight = width / ((imgWidth || 1) / (imgHeight || 1)); + offsetY = -(height - realHeight) / 2; + imgWidth = width; + imgHeight = realHeight; + } else { + let realWidth = height / ((imgHeight || 1) / (imgWidth || 1)); + offsetX = -(width - realWidth) / 2; + imgWidth = realWidth; + imgHeight = height; + } + + _clip(); + break; + case "aspectFill": + if (imgWidth > imgHeight) { + let realWidth = imgWidth / ((imgHeight || 1) / (height || 1)); + offsetX = (realWidth - width) / 2; + imgWidth = realWidth; + imgHeight = height; + } else { + let realHeight = imgHeight / ((imgWidth || 1) / (width || 1)); + offsetY = (realHeight - height) / 2; + imgWidth = width; + imgHeight = realHeight; + } + + _clip(); + break; + case "top left": + _clip(); + break; + case "top": + offsetX = (mode.width - width) / 2; + _clip(); + break; + case "top right": + offsetX = mode.width - width; + _clip(); + break; + case "left": + offsetY = (mode.height - height) / 2; + _clip(); + break; + case "center": + offsetX = (mode.width - width) / 2; + offsetY = (mode.height - height) / 2; + _clip(); + break; + case "right": + offsetX = mode.width - width; + offsetY = (mode.height - height) / 2; + _clip(); + break; + case "bottom left": + offsetY = mode.height - height; + _clip(); + break; + case "bottom": + offsetX = (mode.width - width) / 2; + offsetY = mode.height - height; + _clip(); + break; + case "bottom right": + offsetX = mode.width - width; + offsetY = mode.height - height; + _clip(); + break; + default: + imgWidth = width; + imgHeight = height; + break; + } + + function _clip() { + self.ctx.save(); + self.ctx.beginPath(); + self.ctx.rect(x, y, width, height); + self.ctx.clip(); + self.ctx.drawImage(url, x - offsetX, y - offsetY, imgWidth, imgHeight); + self.ctx.closePath(); + self.ctx.restore(); + } + } + + _drawText(item, style, resolve, reject, type, isWxml) { + let zoom = this.zoom; + let leftOffset = 0; + let topOffset = 0; + + try { + style.fontSize = this._parseNumber(style.fontSize); + let fontSize = Math.ceil((style.fontSize || 14) * zoom); + this.ctx.setTextBaseline("top"); + this.ctx.font = `${style.fontWeight ? style.fontWeight : "normal"} ${fontSize}px ${ + style.fontFamily || "PingFang SC" + }`; + this.ctx.setFillStyle(style.color || "#454545"); + + let text = item.text || ""; + let textWidth = Math.floor(this.measureWidth(text, style.font || this.ctx.font)); + let lineHeight = this._getLineHeight(style); + let textHeight = Math.ceil(textWidth / (style.width || textWidth)) * lineHeight; + let width = Math.ceil((style.width || textWidth) * (!isWxml ? zoom : 1)); + let whiteSpace = style.whiteSpace || "wrap"; + let x = 0; + let y = 0; + + if (typeof style.padding === "string") { + style.padding = Util.transferPadding(style.padding); + } + item.x = this._resetPositionX(item, style); + item.y = this._resetPositionY(item, style, textHeight); + this._drawBoxShadow(style.boxShadow); + + if (style.background || style.border) { + this._drawTextBackgroud(item, style, textWidth, textHeight, isWxml); + } + + // 行内文本 + if (type === "inline-text") { + width = item.maxWidth; + if (item.leftOffset + textWidth > width) { + // 如果上一个行内元素换行了,这个元素要继续在后面补足一行 + let lineNum = Math.max(Math.floor(textWidth / width), 1); + let length = text.length; + let singleLength = Math.floor(length / lineNum); + let widthOffset = item.leftOffset ? item.leftOffset - item.originX : 0; + let { + endIndex: currentIndex, + single, + singleWidth, + } = this._getTextSingleLine(text, width, singleLength, 0, widthOffset); + x = this._resetTextPositionX(item, style, singleWidth); + y = this._resetTextPositionY(item, style); + this.ctx.fillText(single, x, y); + leftOffset = x + singleWidth; + topOffset = y; + + // 去除第一行补的内容,然后重置 + text = text.substring(currentIndex, text.length); + currentIndex = 0; + lineNum = Math.max(Math.floor(textWidth / width), 1); + textWidth = Math.floor(this.measureWidth(text, style.font || this.ctx.font)); + item.x = item.originX; // 还原换行后的x + for (let i = 0; i < lineNum; i++) { + let { endIndex, single, singleWidth } = this._getTextSingleLine( + text, + width, + singleLength, + currentIndex, + ); + currentIndex = endIndex; + if (single) { + x = this._resetTextPositionX(item, style, singleWidth, width); + y = this._resetTextPositionY(item, style, i + 1); + this.ctx.fillText(single, x, y); + if (i === lineNum - 1) { + leftOffset = x + singleWidth; + topOffset = lineHeight * lineNum; + } + } + } + + let last = text.substring(currentIndex, length); + let lastWidth = this.measureWidth(last); + + if (last) { + x = this._resetTextPositionX(item, style, lastWidth, width); + y = this._resetTextPositionY(item, style, lineNum + 1); + this.ctx.fillText(last, x, y); + leftOffset = x + lastWidth; + topOffset = lineHeight * (lineNum + 1); + } + } else { + x = this._resetTextPositionX(item, style, textWidth, width); + y = this._resetTextPositionY(item, style); + this.ctx.fillText(item.text, x, y); + leftOffset = x + textWidth; + topOffset = lineHeight; + } + } else { + // block文本,如果文本长度超过宽度换行 + if (width && textWidth > width && whiteSpace !== "nowrap") { + let lineNum = Math.max(Math.floor(textWidth / width), 1); + let length = text.length; + let singleLength = Math.floor(length / lineNum); + let currentIndex = 0; + + // lineClamp参数限制最多行数 + if (style.lineClamp && lineNum + 1 > style.lineClamp) { + lineNum = style.lineClamp - 1; + } + + for (let i = 0; i < lineNum; i++) { + let { endIndex, single, singleWidth } = this._getTextSingleLine( + text, + width, + singleLength, + currentIndex, + ); + currentIndex = endIndex; + x = this._resetTextPositionX(item, style, singleWidth, width); + y = this._resetTextPositionY(item, style, i); + this.ctx.fillText(single, x, y); + } + + // 换行后剩余的文字,超过一行则截断增加省略号 + let last = text.substring(currentIndex, length); + let lastWidth = this.measureWidth(last); + if (lastWidth > width) { + let { single, singleWidth } = this._getTextSingleLine(last, width, singleLength); + lastWidth = singleWidth; + last = single.substring(0, single.length - 1) + "..."; + } + + x = this._resetTextPositionX(item, style, lastWidth, width); + y = this._resetTextPositionY(item, style, lineNum); + this.ctx.fillText(last, x, y); + } else { + x = this._resetTextPositionX(item, style, textWidth, width); + y = this._resetTextPositionY(item, style); + this.ctx.fillText(item.text, x, y); + } + } + + this.ctx.draw(true); + + this._updateProgress(item.progress); + + if (resolve) { + resolve(); + } else { + return { + leftOffset, + topOffset, + }; + } + } catch (e) { + reject && reject({ errcode: 1004, errmsg: "drawText error", e: e }); + } + } + + _drawTextBackgroud(item, style, textWidth, textHeight, isWxml) { + if (!style.width) return; + let zoom = isWxml ? 1 : this.zoom; + let width = style.width || textWidth; + let height = style.height || textHeight; + let rectStyle = { + fill: style.background, + border: style.border, + }; + style.padding = style.padding || [0, 0, 0, 0]; + width += (style.padding[1] || 0) + (style.padding[3] || 0); + height += (style.padding[0] || 0) + (style.padding[2] || 0); + width = width * zoom; + height = height * zoom; + this._drawRectToCanvas(item.x, item.y, width, height, rectStyle); + } + + _drawCircle(item, style, resolve, reject, isImage, isWxml) { + let zoom = this.zoom; + let r = style.r; + try { + item.x = this._resetPositionX(item, style); + item.y = this._resetPositionY(item, style); + + let url; + if (isImage) { + let index = this._findPicIndex(item.url); + if (index > -1) { + url = this.allPic[index].local; + } else { + url = item.url; + } + } + + if (!isWxml) { + r = r * zoom; + } + + this._drawCircleToCanvas(item.x, item.y, r, style, url); + + this._updateProgress(item.progress); + resolve && resolve(); + } catch (e) { + reject && + reject({ + errcode: isImage ? 1006 : 1005, + errmsg: isImage ? "drawCircleImage error" : "drawCircle error", + e, + }); + } + } + + _drawCircleToCanvas(x, y, r, style, url) { + let { fill, border, boxShadow } = style; + + this.ctx.save(); + + this._drawBoxShadow(boxShadow, (res) => { + // 真机上填充渐变色时,没有阴影,先画个相等大小的纯色矩形来实现阴影 + if ((fill && typeof fill !== "string") || (url && res.color)) { + this.ctx.setFillStyle(res.color || "#ffffff"); + this.ctx.beginPath(); + this.ctx.arc(x + r, y + r, r, 0, 2 * Math.PI); + this.ctx.closePath(); + this.ctx.fill(); + } + }); + + if (url) { + this.ctx.save(); + this.ctx.beginPath(); + this.ctx.arc(x + r, y + r, r, 0, 2 * Math.PI); + this.ctx.clip(); + this.ctx.drawImage(url, x, y, r * 2, r * 2); + this.ctx.closePath(); + this.ctx.restore(); + } else { + this._setFill(fill, () => { + this.ctx.beginPath(); + this.ctx.arc(x + r, y + r, r, 0, 2 * Math.PI); + this.ctx.closePath(); + this.ctx.fill(); + }); + } + + this._drawBorder(border, style, (border) => { + this.ctx.beginPath(); + this.ctx.arc(x + r, y + r, r + border.width / 2, 0, 2 * Math.PI); + this.ctx.stroke(); + this.ctx.closePath(); + }); + + this.ctx.draw(true); + this.ctx.restore(); + } + + _drawLine(item, style, resolve, reject, isWxml) { + let zoom = this.zoom; + try { + let x1 = item.x * zoom + this.translateX; + let y1 = item.y * zoom + this.translateY; + let x2 = item.x2 * zoom + this.translateX; + let y2 = item.y2 * zoom + this.translateY; + this._drawLineToCanvas(x1, y1, x2, y2, style); + + this._updateProgress(item.progress); + resolve && resolve(); + } catch (e) { + reject && reject({ errcode: 1007, errmsg: "drawLine error", e }); + } + } + + _drawLineToCanvas(x1, y1, x2, y2, style) { + let { stroke, dash, boxShadow } = style; + + this.ctx.save(); + if (stroke) { + this._setStroke(stroke); + } + + this._drawBoxShadow(boxShadow); + + if (dash) { + let dash = [style.dash[0] || 5, style.dash[1] || 5]; + let offset = style.dash[2] || 0; + this.ctx.setLineDash(dash, offset || 0); + } + + this.ctx.moveTo(x1, y1); + this.ctx.setLineWidth((style.width || 1) * this.zoom); + this.ctx.lineTo(x2, y2); + this.ctx.stroke(); + this.ctx.draw(true); + this.ctx.restore(); + } + + // 废弃,合并到_drawRect + _drawImage(item, style, resolve, reject, isWxml) { + let zoom = this.zoom; + try { + item.x = this._resetPositionX(item, style); + item.y = this._resetPositionY(item, style); + item.x = item.x + (style.padding[3] || 0); + item.y = item.y + (style.padding[0] || 0); + + let index = this._findPicIndex(item.url); + let url = index > -1 ? this.allPic[index].local : item.url; + this._drawImageToCanvas(url, item.x, item.y, style.width * zoom, style.height * zoom, style); + + this._updateProgress(item.progress); + resolve && resolve(); + } catch (e) { + reject && reject({ errcode: 1012, errmsg: "drawRect error", e }); + } + } + + // 废弃,合并到_drawRect + _drawImageToCanvas(url, x, y, width, height, style) { + let { fill, border, boxShadow } = style; + this.ctx.save(); + + this._drawBoxShadow(boxShadow); + this.ctx.drawImage(url, x, y, width, height); + + this._drawBorder(border, style, (border) => { + let fixBorder = border.width; + this.ctx.strokeRect(x - fixBorder / 2, y - fixBorder / 2, width + fixBorder, height + fixBorder); + }); + this.ctx.draw(true); + this.ctx.restore(); + } + + _drawWxml(item, style, resolve, reject) { + let self = this; + let all = []; + try { + this._getWxml(item, style).then((results) => { + // 上 -> 下 + let sorted = self._sortListByTop(results[0]); + let count = 0; + let progress = 0; + Object.keys(sorted).forEach((item) => { + count += sorted[item].length; + }); + progress = (this.distance * 3) / (count || 1); + + all = this._drawWxmlBlock(item, sorted, all, progress, results[1]); + all = this._drawWxmlInline(item, sorted, all, progress, results[1]); + + Promise.all(all) + .then((results) => { + resolve && resolve(); + }) + .catch((e) => { + reject && reject(e); + }); + }); + } catch (e) { + reject && reject({ errcode: 1008, errmsg: "drawWxml error" }); + } + } + + _drawWxmlBlock(item, sorted, all, progress, results) { + let self = this; + // 用来限定位置范围,取相对位置 + let limitLeft = results ? results.left : 0; + let limitTop = results ? results.top : 0; + Object.keys(sorted).forEach((top, topIndex) => { + // 左 -> 右 + let list = sorted[top].sort((a, b) => { + return a.left - b.left; + }); + + list = list.filter((sub) => sub.dataset.type && sub.dataset.type.indexOf("inline") === -1); + + list.forEach((sub, index) => { + all[index] = new Promise((resolve2, reject2) => { + sub = self._transferWxmlStyle(sub, item, limitLeft, limitTop); + sub.progress = progress; + let type = sub.dataset.type; + if (sub.dataset.delay) { + setTimeout(() => { + drawWxmlItem(); + }, sub.dataset.delay); + } else { + drawWxmlItem(); + } + function drawWxmlItem() { + if (type === "text") { + self._drawWxmlText(sub, resolve2, reject2); + } else if (type === "image") { + self._drawWxmlImage(sub, resolve2, reject2); + } else if (type === "radius-image") { + self._drawWxmlCircleImage(sub, resolve2, reject2); + } else if (type === "background-image") { + self._drawWxmlBackgroundImage(sub, resolve2, reject2); + } + } + }); + }); + }); + + return all; + } + + _drawWxmlInline(item, sorted, all, progress, results) { + let self = this; + let topOffset = 0; + let leftOffset = 0; + let lastTop = 0; + let limitLeft = results ? results.left : 0; + let limitTop = results ? results.top : 0; + let p = new Promise((resolve2, reject2) => { + let maxWidth = 0; + let minLeft = Infinity; + let maxRight = 0; + + // 找出同一top下的最小left和最大right,得到最大的宽度,用于换行 + Object.keys(sorted).forEach((top) => { + let inlineList = sorted[top].filter((sub) => sub.dataset.type && sub.dataset.type.indexOf("inline") > -1); + inlineList.forEach((sub) => { + if (sub.left < minLeft) { + minLeft = sub.left; + } + if (sub.right > maxRight) { + maxRight = sub.right; + } + }); + }); + maxWidth = Math.ceil(maxRight - minLeft || self.width); + + Object.keys(sorted).forEach((top, topIndex) => { + // 左 -> 右 + let list = sorted[top].sort((a, b) => { + return a.left - b.left; + }); + + // 换行的行内元素left放到后面,version2.0.6后无法获取高度,改用bottom值来判断是否换行了 + let position = -1; + for (let i = 0, len = list.length; i < len; i++) { + if (list[i] && list[i + 1]) { + if (list[i].bottom > list[i + 1].bottom) { + position = i; + break; + } + } + } + + if (position > -1) { + list.push(list.splice(position, 1)[0]); + } + + let inlineList = list.filter((sub) => sub.dataset.type && sub.dataset.type.indexOf("inline") > -1); + let originLeft = inlineList[0] ? inlineList[0].left : 0; + // 换行后和top不相等时,认为是换行了,要清除左边距;当左偏移量大于最大宽度时,也要清除左边距; 当左偏移小于左边距时,也要清除 + if ( + Math.abs(topOffset + lastTop - top) > 2 || + leftOffset - originLeft - limitLeft >= maxWidth || + leftOffset <= originLeft - limitLeft - 2 + ) { + leftOffset = 0; + } + + lastTop = +top; + topOffset = 0; + + inlineList.forEach((sub, index) => { + sub = self._transferWxmlStyle(sub, item, limitLeft, limitTop); + sub.progress = progress; + let type = sub.dataset.type; + if (type === "inline-text") { + let drawRes = self._drawWxmlInlineText(sub, leftOffset, maxWidth); + leftOffset = drawRes.leftOffset; + topOffset = drawRes.topOffset; + } else if (type === "inline-image") { + let drawRes = self._drawWxmlImage(sub) || {}; + leftOffset = drawRes.leftOffset || 0; + topOffset = drawRes.topOffset || 0; + } + }); + }); + resolve2(); + }); + + all.push(p); + return all; + } + + _drawWxmlInlineText(sub, leftOffset = 0, maxWidth) { + let text = sub.dataset.text || ""; + if (sub.dataset.maxlength && text.length > sub.dataset.maxlength) { + text = text.substring(0, sub.dataset.maxlength) + "..."; + } + + let textData = { + text, + originX: sub.left, + x: leftOffset ? leftOffset : sub.left, + y: sub.top, + progress: sub.progress, + leftOffset: leftOffset, + maxWidth: maxWidth, // 行内元素的最大宽度,取决于limit的宽度 + }; + + if (sub.backgroundColor !== "rgba(0, 0, 0, 0)") { + sub.background = sub.backgroundColor; + } else { + sub.background = "rgba(0, 0, 0, 0)"; + } + + if (sub.dataset.background) { + sub.background = sub.dataset.background; + } + + let res = this._drawText(textData, sub, null, null, "inline-text", "wxml"); + + return res; + } + + _drawWxmlText(sub, resolve, reject) { + let text = sub.dataset.text || ""; + if (sub.dataset.maxlength && text.length > sub.dataset.maxlength) { + text = text.substring(0, sub.dataset.maxlength) + "..."; + } + + let textData = { + text, + x: sub.left, + y: sub.top, + progress: sub.progress, + }; + if (sub.backgroundColor !== "rgba(0, 0, 0, 0)") { + sub.background = sub.backgroundColor; + } else { + sub.background = "rgba(0, 0, 0, 0)"; + } + + if (sub.dataset.background) { + sub.background = sub.dataset.background; + } + + this._drawText(textData, sub, resolve, reject, "text", "wxml"); + } + + _drawWxmlImage(sub, resolve, reject) { + let imageData = { + url: sub.dataset.url, + x: sub.left, + y: sub.top, + progress: sub.progress, + }; + + let res = this._drawRect(imageData, sub, resolve, reject, "image", "inline-wxml"); + + return res; + } + + _drawWxmlCircleImage(sub, resolve, reject) { + let imageData = { + url: sub.dataset.url, + x: sub.left, + y: sub.top, + progress: sub.progress, + }; + sub.r = sub.width / 2; + + this._drawCircle(imageData, sub, resolve, reject, true, "wxml"); + } + + _drawWxmlBackgroundImage(sub, resolve, reject) { + let url = sub.dataset.url; + let index = this._findPicIndex(url); + url = index > -1 ? this.allPic[index].local : url; + let size = sub.backgroundSize.replace(/px/g, "").split(" "); + + let imageData = { + url: url, + x: sub.left, + y: sub.top, + progress: sub.progress, + }; + + this._drawRect(imageData, sub, resolve, reject, "image", "wxml"); + } + + _getWxml(item, style) { + let self = this; + let query; + // if (this.obj) { + // query = wx.createSelectorQuery().in(this.obj); + // } else { + // query = wx.createSelectorQuery(); + // } + if (this.object) { + query = wx.createSelectorQuery().in(this.object); + } else { + query = wx.createSelectorQuery(); + } + + let p1 = new Promise((resolve, reject) => { + // 会触发两次,要限制 + let count = 0; + query + .selectAll(`${item.class}`) + .fields( + { + dataset: true, + size: true, + rect: true, + computedStyle: [ + "width", + "height", + "font", + "fontSize", + "fontFamily", + "fontWeight", + "fontStyle", + "textAlign", + "color", + "lineHeight", + "border", + "borderColor", + "borderStyle", + "borderWidth", + "verticalAlign", + "boxShadow", + "background", + "backgroundColor", + "backgroundImage", + "backgroundPosition", + "backgroundSize", + "paddingLeft", + "paddingTop", + "paddingRight", + "paddingBottom", + ], + }, + (res) => { + if (count++ === 0) { + let formated = self._formatImage(res); + let list = formated.list; + res = formated.res; + + self + ._preloadImage(list) + .then((result) => { + resolve(res); + }) + .catch((res) => { + reject && reject({ errcode: 1009, errmsg: "drawWxml preLoadImage error" }); + }); + } + }, + ) + .exec(); + }); + + let p2 = new Promise((resolve, reject) => { + if (!item.limit) { + resolve({ top: 0, width: self.width / self.zoom }); + } + + query + .select(`${item.limit}`) + .fields( + { + dataset: true, + size: true, + rect: true, + }, + (res) => { + resolve(res); + }, + ) + .exec(); + }); + + return Promise.all([p1, p2]); + } + + _getLineHeight(style) { + let zoom = this.zoom; + if (style.dataset && style.dataset.type) { + zoom = 1; + } + let lineHeight; + if (!isNaN(style.lineHeight) && style.lineHeight > style.fontSize) { + lineHeight = style.lineHeight; + } else { + style.lineHeight = (style.lineHeight || "") + ""; + lineHeight = +style.lineHeight.replace("px", ""); + lineHeight = lineHeight ? lineHeight : (style.fontSize || 14) * 1.2; + } + return lineHeight * zoom; + } + + _formatImage(res = []) { + let list = []; + res.forEach((item, index) => { + let dataset = item.dataset; + let uid = Util.getUid(); + let filename = `${wx.env.USER_DATA_PATH}/${uid}.png`; + if ((dataset.type === "image" || dataset.type === "radius-image") && dataset.url) { + let sub = { + url: dataset.base64 ? filename : dataset.url, + isBase64: dataset.base64 ? dataset.url : false, + }; + + res[index].dataset = Object.assign(res[index].dataset, sub); + list.push(sub); + } else if (dataset.type === "background-image" && item.backgroundImage.indexOf("url") > -1) { + let url = item.backgroundImage.replace(/url\((\"|\')?/, "").replace(/(\"|\')?\)$/, ""); + let sub = { + url: dataset.base64 ? filename : url, + isBase64: dataset.base64 ? url : false, + }; + res[index].dataset = Object.assign(res[index].dataset, sub); + list.push(sub); + } + }); + + return { list, res }; + } + + _updateProgress(distance) { + this.progressPercent += distance; + this.progress(this.progressPercent); + } + + _sortListByTop(list = []) { + let sorted = {}; + + // 粗略地认为2px相差的元素在同一行 + list.forEach((item, index) => { + let top = item.top; + if (!sorted[top]) { + if (sorted[top - 2]) { + top = top - 2; + } else if (sorted[top - 1]) { + top = top - 1; + } else if (sorted[top + 1]) { + top = top + 1; + } else if (sorted[top + 2]) { + top = top + 2; + } else { + sorted[top] = []; + } + } + sorted[top].push(item); + }); + + return sorted; + } + + _parseNumber(number) { + return isNaN(number) ? +(number || "").replace("px", "") : number; + } + + _transferWxmlStyle(sub, item, limitLeft, limitTop) { + let leftFix = +sub.dataset.left || 0; + let topFix = +sub.dataset.top || 0; + + sub.width = this._parseNumber(sub.width); + sub.height = this._parseNumber(sub.height); + sub.left = this._parseNumber(sub.left) - limitLeft + (leftFix + (item.x || 0)) * this.zoom; + sub.top = this._parseNumber(sub.top) - limitTop + (topFix + (item.y || 0)) * this.zoom; + + let padding = sub.dataset.padding || "0 0 0 0"; + if (typeof padding === "string") { + padding = Util.transferPadding(padding); + } + let paddingTop = Number(sub.paddingTop.replace("px", "")) + Number(padding[0]); + let paddingRight = Number(sub.paddingRight.replace("px", "")) + Number(padding[1]); + let paddingBottom = Number(sub.paddingBottom.replace("px", "")) + Number(padding[2]); + let paddingLeft = Number(sub.paddingLeft.replace("px", "")) + Number(padding[3]); + sub.padding = [paddingTop, paddingRight, paddingBottom, paddingLeft]; + + return sub; + } + + /** + * 支持负值绘制,从右边计算 + * @param {*} item + * @param {*} style + */ + _resetPositionX(item, style) { + let zoom = this.zoom; + let x = 0; + + if (style.dataset && style.dataset.type) { + zoom = 1; + } + + // 通过wxml获取的不需要重置坐标 + if (item.x < 0 && item.type) { + x = this.width + item.x * zoom - style.width * zoom; + } else { + x = item.x * zoom; + } + + if (parseInt(style.borderWidth)) { + x += parseInt(style.borderWidth); + } + + return x + this.translateX; + } + + /** + * 支持负值绘制,从底部计算 + * @param {*} item + * @param {*} style + */ + _resetPositionY(item, style, textHeight) { + let zoom = this.zoom; + let y = 0; + + if (style.dataset && style.dataset.type) { + zoom = 1; + } + + if (item.y < 0) { + y = this.height + item.y * zoom - (textHeight ? textHeight : style.height * zoom); + } else { + y = item.y * zoom; + } + + if (parseInt(style.borderWidth)) { + y += parseInt(style.borderWidth); + } + + return y + this.translateY; + } + + /** + * 文字的padding、text-align + * @param {*} item + * @param {*} style + * @param {*} textWidth + */ + _resetTextPositionX(item, style, textWidth, width) { + let textAlign = style.textAlign || "left"; + let x = item.x; + if (textAlign === "center") { + x = (width - textWidth) / 2 + item.x; + } else if (textAlign === "right") { + x = width - textWidth + item.x; + } + + let left = style.padding ? style.padding[3] || 0 : 0; + + return x + left + this.translateX; + } + + /** + * 文字的padding、text-align + * @param {*} item + * @param {*} style + * @param {*} textWidth + */ + _resetTextPositionY(item, style, lineNum = 0) { + let zoom = this.zoom; + if (style.dataset && style.dataset.type) { + zoom = 1; + } + + let lineHeight = this._getLineHeight(style); + let fontSize = Math.ceil((style.fontSize || 14) * zoom); + + let blockLineHeightFix = + ((style.dataset && style.dataset.type) || "").indexOf("inline") > -1 ? 0 : (lineHeight - fontSize) / 2; + + let top = style.padding ? style.padding[0] || 0 : 0; + + // y + lineheight偏移 + 行数 + paddingTop + 整体画布位移 + return item.y + blockLineHeightFix + lineNum * lineHeight + top + this.translateY; + } + + /** + * 当文本超过宽度时,计算每一行应该绘制的文本 + * @param {*} text + * @param {*} width + * @param {*} singleLength + * @param {*} currentIndex + * @param {*} widthOffset + */ + _getTextSingleLine(text, width, singleLength, currentIndex = 0, widthOffset = 0) { + let offset = 0; + let endIndex = currentIndex + singleLength + offset; + let single = text.substring(currentIndex, endIndex); + let singleWidth = this.measureWidth(single); + + while (Math.round(widthOffset + singleWidth) > width) { + offset--; + endIndex = currentIndex + singleLength + offset; + single = text.substring(currentIndex, endIndex); + singleWidth = this.measureWidth(single); + } + + return { + endIndex, + single, + singleWidth, + }; + } + + _drawBorder(border, style, callback) { + let zoom = this.zoom; + if (style.dataset && style.dataset.type) { + zoom = 1; + } + border = Util.transferBorder(border); + + if (border && border.width) { + // 空白阴影,清空掉边框的阴影 + this._drawBoxShadow(); + if (border) { + this.ctx.setLineWidth(border.width * zoom); + + if (border.style === "dashed") { + let dash = style.dash || [5, 5, 0]; + let offset = dash[2] || 0; + let array = [dash[0] || 5, dash[1] || 5]; + this.ctx.setLineDash(array, offset); + } + this.ctx.setStrokeStyle(border.color); + } + callback && callback(border); + } + } + + _drawBoxShadow(boxShadow, callback) { + boxShadow = Util.transferBoxShadow(boxShadow); + if (boxShadow) { + this.ctx.setShadow(boxShadow.offsetX, boxShadow.offsetY, boxShadow.blur, boxShadow.color); + } else { + this.ctx.setShadow(0, 0, 0, "#ffffff"); + } + + callback && callback(boxShadow || {}); + } + + _setFill(fill, callback) { + if (fill) { + if (typeof fill === "string") { + this.ctx.setFillStyle(fill); + } else { + let line = fill.line; + let color = fill.color; + let grd = this.ctx.createLinearGradient(line[0], line[1], line[2], line[3]); + grd.addColorStop(0, color[0]); + grd.addColorStop(1, color[1]); + this.ctx.setFillStyle(grd); + } + callback && callback(); + } + } + + _setStroke(stroke, callback) { + if (stroke) { + if (typeof stroke === "string") { + this.ctx.setStrokeStyle(stroke); + } else { + let line = stroke.line; + let color = stroke.color; + let grd = this.ctx.createLinearGradient(line[0], line[1], line[2], line[3]); + grd.addColorStop(0, color[0]); + grd.addColorStop(1, color[1]); + this.ctx.setStrokeStyle(grd); + } + + callback && callback(); + } + } + } + + if (!exports.__esModule) Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = Wxml2Canvas; + }, + function (modId) { + var map = { "./util": 1685064731948 }; + return __REQUIRE__(map[modId], modId); + }, + ); + __DEFINE__( + 1685064731948, + function (require, module, exports) { + /** + * 获取字符的长度,full为true时,一个汉字算两个长度 + * @param {String} str + * @param {Boolean} full + */ + + function getTextLength(str, full) { + let len = 0; + for (let i = 0; i < str.length; i++) { + let c = str.charCodeAt(i); + //单字节加1 + if ((c >= 0x0001 && c <= 0x007e) || (0xff60 <= c && c <= 0xff9f)) { + len++; + } else { + len += full ? 2 : 1; + } + } + return len; + } + + /** + * rgba(255, 255, 255, 1) => #ffffff + * @param {String} color + */ + function transferColor(color = "") { + let res = "#"; + color = color.replace(/^rgba?\(/, "").replace(/\)$/, ""); + color = color.split(", "); + + color.length > 3 ? (color.length = 3) : ""; + for (let item of color) { + item = parseInt(item || 0); + if (item < 10) { + res += "0" + item; + } else { + res += item.toString(16); + } + } + + return res; + } + + function transferBorder(border = "") { + let res = border.match(/(\w+)px\s(\w+)\s(.*)/); + let obj = {}; + + if (res) { + obj = { + width: +res[1], + style: res[2], + color: res[3], + }; + } + + return res ? obj : null; + } + + /** + * 内边距,依次为上右下左 + * @param {*} padding + */ + function transferPadding(padding = "0 0 0 0") { + padding = padding.split(" "); + for (let i = 0, len = padding.length; i < len; i++) { + padding[i] = +padding[i].replace("px", ""); + } + + return padding; + } + /** + * type1: 0, 25, 17, rgba(0, 0, 0, 0.3) + * type2: rgba(0, 0, 0, 0.3) 0px 25px 17px 0px => (0, 25, 17, rgba(0, 0, 0, 0.3)) + * @param {*} shadow + */ + function transferBoxShadow(shadow = "", type) { + if (!shadow || shadow === "none") return; + let color; + let split; + + split = shadow.match(/(\w+)\s(\w+)\s(\w+)\s(rgb.*)/); + + if (split) { + split.shift(); + shadow = split; + color = split[3] || "#ffffff"; + } else { + split = shadow.split(") "); + color = split[0] + ")"; + shadow = split[1].split("px "); + } + + return { + offsetX: +shadow[0] || 0, + offsetY: +shadow[1] || 0, + blur: +shadow[2] || 0, + color, + }; + } + + function getUid(prefix) { + prefix = prefix || ""; + + return ( + prefix + + "xxyxxyxx".replace(/[xy]/g, (c) => { + let r = (Math.random() * 16) | 0; + let v = c === "x" ? r : (r & 0x3) | 0x8; + return v.toString(16); + }) + ); + } + + if (!exports.__esModule) Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = { + getTextLength, + transferBorder, + transferColor, + transferPadding, + transferBoxShadow, + getUid, + }; + }, + function (modId) { + var map = {}; + return __REQUIRE__(map[modId], modId); + }, + ); + return __REQUIRE__(1685064731946); +})(); +//miniprogram-npm-outsideDeps=[] +//# sourceMappingURL=index.js.map diff --git a/src/components/customTable/wxml2canvas/index.js.map b/src/components/customTable/wxml2canvas/index.js.map new file mode 100644 index 0000000..68e773e --- /dev/null +++ b/src/components/customTable/wxml2canvas/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["index.js","src/index.js","src/util.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;ACFA;AACA;AACA;AACA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["var __TEMP__ = require('./src/index');var Wxml2Canvas = __REQUIRE_DEFAULT__(__TEMP__);\n\nif (!exports.__esModule) Object.defineProperty(exports, \"__esModule\", { value: true });exports.default = Wxml2Canvas;","var __TEMP__ = require('./util');var Util = __REQUIRE_DEFAULT__(__TEMP__);\n\nconst imageMode = ['scaleToFill', 'aspectFit', 'aspectFill', 'widthFix', 'top', 'bottom', 'center', 'left', 'right', 'top left', 'top right', 'bottom left', 'bottom right']\n\nclass Wxml2Canvas {\n constructor (options = {}) {\n this.device = wx.getSystemInfoSync && wx.getSystemInfoSync() || {};\n \n if (!options.zoom) {\n this.zoom = this.device.windowWidth / 375;\n } else {\n this.zoom = options.zoom || 1;\n } \n \n this.element = options.element;\n this.object = options.obj;\n this.width = options.width * this.zoom || 0;\n this.height = options.height * this.zoom || 0;\n this.destZoom = options.destZoom || 3;\n this.destWidth = this.width * this.destZoom;\n this.destHeight = this.height * this.destZoom;\n this.translateX = options.translateX * this.zoom || 0;\n this.translateY = options.translateY * this.zoom || 0;\n this.gradientBackground = options.gradientBackground || null;\n this.background = options.background || '#ffffff';\n this.finishDraw = options.finish || function finish(params) {}\n this.errorHandler = options.error || function error(params) {}\n this.progress = options.progress || function progress(params) {}\n this.textAlign = options.textAlign || 'left';\n this.fullText = options.fullText || false;\n this.font = options.font || '14px PingFang SC';\n\n this._init();\n }\n\n draw (data = {}, that) {\n let self = this;\n this.data = data;\n this.fef = that;\n\n this.progress(10);\n this._preloadImage(data.list).then((result) => {\n this.progress(30);\n self._draw();\n }).catch((res) => {\n self.errorHandler(res);\n })\n }\n\n measureWidth (text, font) {\n if(font) {\n this.ctx.font = font;\n }\n let res = this.ctx.measureText(text) || {};\n return res.width || 0;\n }\n\n _init () {\n this.progressPercent = 0; // 绘制进度百分比\n this.data = null;\n this.ref = null;\n this.allPic = [];\n this.screenList = []; \n this.asyncList = [];\n this.imgUrl = '';\n this.progressPercent = 0;\n this.distance = 0;\n this.progress(0);\n\n this.ctx = wx.createCanvasContext(this.element, this.obj);\n this.ctx.font = this.font;\n this.ctx.setTextBaseline('top');\n this.ctx.setStrokeStyle('white');\n\n this.debug = this.device.platform === 'devtools' ? true : false;\n\n this._drawBakcground();\n }\n\n _drawBakcground () {\n if (this.gradientBackground) {\n let line = this.gradientBackground.line || [0, 0, 0, this.height];\n let color = this.gradientBackground.color || ['#fff', '#fff'];\n let style = { fill: { line, color } }\n this._drawRectToCanvas(0, 0, this.width, this.height, style);\n } else {\n let style = { fill: this.background }\n this._drawRectToCanvas(0, 0, this.width, this.height, style);\n }\n }\n\n _draw () {\n let self = this;\n let list = this.data.list || [];\n let index = 0;\n let all = [];\n let count = 0;\n\n list.forEach(item => {\n if(item.type === 'wxml') {\n count += 3;\n } else {\n count += 1;\n }\n })\n\n this.distance = 60 / (count || 1); // 进度条的间距\n this.progressPercent = 30;\n this.asyncList = list.filter( item => item.delay == true );\n list = list.filter( item => item.delay != true );\n drawList(list);\n\n Promise.all(all).then(results => {\n index = 0;\n drawList(self.asyncList, true);\n\n Promise.all(all).then(results => {\n self.progress(90);\n self._saveCanvasToImage();\n });\n }).catch (e => {\n console.log(e)\n self.errorHandler(e);\n });\n\n function drawList(list = [], noDelay) {\n list.forEach((item, i) => {\n all[index++] = new Promise((resolve, reject) => {\n let attr = item.style;\n item.progress = self.distance;\n if (noDelay) {\n item.delay = 0;\n }\n if (item.type === 'radius-image') {\n self._drawCircle(item, attr, resolve, reject, 'image');\n } else if (item.type === 'text') {\n self._drawText(item, attr, resolve, reject);\n } else if (item.type === 'line') {\n self._drawLine(item, attr, resolve, reject);\n } else if (item.type === 'circle') {\n self._drawCircle(item, attr, resolve, reject);\n } else if (item.type === 'rect') {\n self._drawRect(item, attr, resolve, reject);\n } else if (item.type === 'image') {\n self._drawRect(item, attr, resolve, reject, 'image');\n } else if (item.type === 'wxml') {\n self._drawWxml(item, attr, resolve, reject);\n }else {\n resolve();\n }\n });\n });\n }\n }\n\n _saveCanvasToImage () {\n let self = this; \n\n // 延时保存有两个原因,一个是等待绘制delay的元素,另一个是安卓上样式会错乱\n setTimeout(() => {\n self.progress(95);\n\n let obj = {\n x: 0,\n y: 0,\n width: self.width,\n height: self.height,\n canvasId: self.element,\n success: function (res) {\n\n self.progress(100);\n self.imgUrl = res.tempFilePath;\n self.finishDraw(self.imgUrl);\n },\n fail: function (res) {\n\n self.errorHandler({errcode: 1000, errmsg: 'save canvas error', e: res});\n }\n }\n\n if(self.destZoom !== 3) {\n obj.destWidth = self.destWidth;\n obj.destHeight = self.destHeight;\n }\n\n wx.canvasToTempFilePath(obj, self.object);\n }, self.device.system.indexOf('iOS') === -1 ? 300 : 100);\n }\n\n _preloadImage (list = []) {\n let self = this;\n let all = [];\n let count = 0;\n\n list.forEach((item, i) => {\n if (item.url && self._findPicIndex(item.url) === -1) {\n \n // 避免重复下载同一图片\n self.allPic.push({\n url: item.url,\n local: ''\n });\n all[count++] = new Promise((resolve, reject) => {\n // 非http(s)域名的就不下载了\n if (!/^http/.test(item.url) || /^http:\\/\\/(tmp)|(usr)\\//.test(item.url) || /^http:\\/\\/127\\.0\\.0\\.1/.test(item.url)) {\n if(item.isBase64) {\n let fileManager = wx.getFileSystemManager();\n\n fileManager.writeFile({\n filePath: item.url,\n data: item.isBase64.replace(/data:image\\/(.*);base64,/, ''),\n encoding: 'base64',\n success (res) {\n imageInfo(item.url);\n },\n fail (res) {\n reject(res);\n },\n })\n \n }else {\n imageInfo(item.url);\n }\n\n function imageInfo (url) {\n wx.getImageInfo({\n src: url,\n success (res) {\n let index = self._findPicIndex(url);\n if(index > -1) {\n self.allPic[index].local = url;\n self.allPic[index].width = res.width;\n self.allPic[index].height = res.height;\n }\n resolve({ tempFilePath: url });\n }, \n fail (res) {\n reject(res);\n }\n })\n }\n } else {\n wx.downloadFile({\n url: item.url.replace(/^https?/, 'https'),\n success: function (res) {\n wx.getImageInfo({\n src: res.tempFilePath,\n success (img) {\n let index = self._findPicIndex(item.url);\n if (index > -1) {\n self.allPic[index].local = res.tempFilePath;\n self.allPic[index].width = img.width;\n self.allPic[index].height = img.height;\n }\n resolve(res);\n },\n fail (res) {\n reject(res);\n }\n })\n },\n fail: (res) => {\n reject({errcode: 1001, errmsg: 'download pic error'});\n }\n })\n }\n }) \n }\n });\n\n return Promise.all(all).then(results => {\n return new Promise(resolve => { resolve() })\n }).catch((results) => {\n return new Promise((resolve, reject) => { reject(results) })\n })\n }\n\n _findPicIndex (url) {\n let index = this.allPic.findIndex(pic => pic.url === url);\n return index;\n }\n\n _drawRect (item, style, resolve, reject, isImage, isWxml) {\n let zoom = this.zoom;\n let leftOffset = 0;\n let topOffset = 0;\n let width = style.width;\n let height = style.height;\n let imgWidth = style.width;\n let imgHeight = style.height;\n let mode = null;\n\n try {\n item.x = this._resetPositionX(item, style);\n item.y = this._resetPositionY(item, style);\n \n let url;\n if(isImage) {\n let index = this._findPicIndex(item.url);\n if(index > -1) {\n url = this.allPic[index].local\n imgWidth = this.allPic[index].width\n imgHeight = this.allPic[index].height\n }else {\n url = item.url;\n }\n }\n\n style.padding = style.padding || [];\n if(isWxml === 'inline-wxml') {\n item.x = item.x + (style.padding[3] && style.padding[3] || 0)\n item.y = item.y + (style.padding[0] && style.padding[0] || 0)\n }\n\n leftOffset = item.x + style.width + (style.padding[1] && style.padding[1] || 0);\n\n if(!isWxml) {\n width = width * zoom;\n height = height * zoom;\n }\n\n if(style.dataset && style.dataset.mode && imageMode.indexOf(style.dataset.mode) > -1) {\n mode = {\n type: style.dataset.mode,\n width: imgWidth,\n height: imgHeight\n };\n }\n\n this._drawRectToCanvas(item.x, item.y, width, height, style, url, mode);\n this._updateProgress(item.progress);\n\n if(resolve) {\n resolve();\n }else {\n return {\n leftOffset,\n topOffset\n }\n }\n } catch (e) {\n reject && reject({ errcode: (isImage ? 1003 : 1002), errmsg: (isImage ? 'drawImage error' : 'drawRect error'), e });\n }\n }\n\n _drawRectToCanvas (x, y, width, height, style, url, mode) {\n let { fill, border, boxShadow } = style;\n this.ctx.save();\n this._drawBoxShadow(boxShadow, (res) => {\n // 真机上填充渐变色时,没有阴影,先画个相等大小的纯色矩形来实现阴影\n if(fill && typeof fill !== 'string' && !this.debug) {\n this.ctx.setFillStyle(res.color || '#ffffff');\n this.ctx.fillRect(x, y, width, height);\n }\n });\n \n if(url) {\n // 开发者工具有bug,先不裁剪\n if(mode) {\n this._resetImageByMode(url, x, y, width, height, mode);\n }else {\n this.ctx.drawImage(url, x, y, width, height)\n }\n }else {\n this._setFill(fill, () => {\n this.ctx.fillRect(x, y, width, height);\n });\n }\n\n this._drawBorder(border, style, (border) => {\n let fixBorder = border.width;\n this.ctx.strokeRect(x - fixBorder / 2, y - fixBorder / 2, width + fixBorder, height + fixBorder);\n });\n\n this.ctx.draw(true);\n this.ctx.restore();\n }\n\n _resetImageByMode (url, x, y, width, height, mode) {\n let self = this;\n let offsetX = 0;\n let offsetY = 0;\n let imgWidth = mode.width;\n let imgHeight = mode.height;\n\n switch (mode.type) {\n case 'scaleToFill': \n imgWidth = width;\n imgHeight = height;\n self.ctx.drawImage(url, x, y, width, height)\n break;\n case 'widthFix': \n height = width / ((imgWidth || 1) / (imgHeight || 1))\n self.ctx.drawImage(url, x, y, width, height)\n break; \n case 'aspectFit': \n if(imgWidth > imgHeight) {\n let realHeight = width / ((imgWidth || 1) / (imgHeight || 1))\n offsetY = -(height - realHeight) / 2\n imgWidth = width;\n imgHeight = realHeight;\n }else {\n let realWidth = height / ((imgHeight || 1) / (imgWidth || 1))\n offsetX = -(width - realWidth) / 2\n imgWidth = realWidth;\n imgHeight = height;\n }\n\n _clip();\n break;\n case 'aspectFill': \n if(imgWidth > imgHeight) {\n let realWidth = imgWidth / ((imgHeight || 1) / (height || 1))\n offsetX = (realWidth - width) / 2\n imgWidth = realWidth;\n imgHeight = height;\n }else {\n let realHeight = imgHeight / ((imgWidth || 1) / (width || 1))\n offsetY = (realHeight - height) / 2\n imgWidth = width;\n imgHeight = realHeight;\n }\n\n _clip();\n break;\n case 'top left': \n _clip();\n break;\n case 'top': \n offsetX = (mode.width - width) / 2;\n _clip();\n break;\n case 'top right': \n offsetX = (mode.width - width);\n _clip();\n break;\n case 'left': \n offsetY = (mode.height - height) / 2;\n _clip();\n break;\n case 'center': \n offsetX = (mode.width - width) / 2;\n offsetY = (mode.height - height) / 2;\n _clip();\n break;\n case 'right': \n offsetX = (mode.width - width);\n offsetY = (mode.height - height) / 2;\n _clip();\n break;\n case 'bottom left': \n offsetY = (mode.height - height)\n _clip();\n break;\n case 'bottom': \n offsetX = (mode.width - width) / 2;\n offsetY = (mode.height - height)\n _clip();\n break;\n case 'bottom right': \n offsetX = (mode.width - width);\n offsetY = (mode.height - height)\n _clip();\n break;\n default: \n imgWidth = width;\n imgHeight = height;\n break; \n }\n\n function _clip () {\n self.ctx.save();\n self.ctx.beginPath()\n self.ctx.rect(x, y, width, height)\n self.ctx.clip();\n self.ctx.drawImage(url, x - offsetX, y - offsetY, imgWidth, imgHeight)\n self.ctx.closePath();\n self.ctx.restore();\n }\n }\n\n _drawText (item, style, resolve, reject, type, isWxml) {\n let zoom = this.zoom;\n let leftOffset = 0;\n let topOffset = 0;\n\n try {\n style.fontSize = this._parseNumber(style.fontSize);\n let fontSize = Math.ceil((style.fontSize || 14) * zoom)\n this.ctx.setTextBaseline('top');\n this.ctx.font = (`${style.fontWeight ? (style.fontWeight) : 'normal'} ${ fontSize }px ${ style.fontFamily || 'PingFang SC' }`);\n this.ctx.setFillStyle(style.color || '#454545');\n\n let text = item.text || '';\n let textWidth = Math.floor(this.measureWidth(text, style.font || this.ctx.font));\n let lineHeight = this._getLineHeight(style);\n let textHeight = Math.ceil(textWidth / (style.width || textWidth)) * lineHeight;\n let width = Math.ceil((style.width || textWidth) * (!isWxml ? zoom : 1));\n let whiteSpace = style.whiteSpace || 'wrap';\n let x = 0;\n let y = 0; \n\n if(typeof style.padding === 'string') {\n style.padding = Util.transferPadding(style.padding);\n }\n item.x = this._resetPositionX(item, style);\n item.y = this._resetPositionY(item, style, textHeight);\n this._drawBoxShadow(style.boxShadow);\n\n if(style.background || style.border) {\n this._drawTextBackgroud(item, style, textWidth, textHeight, isWxml);\n }\n \n // 行内文本\n if(type === 'inline-text') {\n width = item.maxWidth;\n if(item.leftOffset + textWidth > width) {\n // 如果上一个行内元素换行了,这个元素要继续在后面补足一行\n let lineNum = Math.max(Math.floor(textWidth / width), 1);\n let length = text.length;\n let singleLength = Math.floor(length / lineNum);\n let widthOffset = item.leftOffset ? item.leftOffset - item.originX : 0;\n let { endIndex: currentIndex, single, singleWidth } = this._getTextSingleLine(text, width, singleLength, 0, widthOffset)\n x = this._resetTextPositionX(item, style, singleWidth);\n y = this._resetTextPositionY(item, style);\n this.ctx.fillText(single, x, y);\n leftOffset = x + singleWidth;\n topOffset = y;\n\n // 去除第一行补的内容,然后重置\n text = text.substring(currentIndex, text.length);\n currentIndex = 0;\n lineNum = Math.max(Math.floor(textWidth / width), 1);\n textWidth = Math.floor(this.measureWidth(text, style.font || this.ctx.font));\n item.x = item.originX; // 还原换行后的x\n for (let i = 0; i < lineNum; i++) {\n let { endIndex, single, singleWidth } = this._getTextSingleLine(text, width, singleLength, currentIndex);\n currentIndex = endIndex;\n if(single) {\n x = this._resetTextPositionX(item, style, singleWidth, width);\n y = this._resetTextPositionY(item, style, i + 1);\n this.ctx.fillText(single, x, y);\n if(i === lineNum - 1) {\n leftOffset = x + singleWidth;\n topOffset = lineHeight * lineNum;\n }\n }\n }\n\n let last = text.substring(currentIndex, length);\n let lastWidth = this.measureWidth(last);\n\n if(last) {\n x = this._resetTextPositionX(item, style, lastWidth, width);\n y = this._resetTextPositionY(item, style, lineNum + 1);\n this.ctx.fillText(last, x, y);\n leftOffset = x + lastWidth;\n topOffset = lineHeight * (lineNum + 1);\n }\n }else {\n x = this._resetTextPositionX(item, style, textWidth, width);\n y = this._resetTextPositionY(item, style);\n this.ctx.fillText(item.text, x, y);\n leftOffset = x + textWidth;\n topOffset = lineHeight;\n }\n }else {\n // block文本,如果文本长度超过宽度换行\n if (width && textWidth > width && whiteSpace !== 'nowrap') {\n let lineNum = Math.max(Math.floor(textWidth / width), 1);\n let length = text.length;\n let singleLength = Math.floor(length / lineNum);\n let currentIndex = 0;\n\n // lineClamp参数限制最多行数\n if (style.lineClamp && lineNum + 1 > style.lineClamp) {\n lineNum = style.lineClamp - 1;\n }\n\n for (let i = 0; i < lineNum; i++) {\n let { endIndex, single, singleWidth } = this._getTextSingleLine(text, width, singleLength, currentIndex);\n currentIndex = endIndex;\n x = this._resetTextPositionX(item, style, singleWidth, width);\n y = this._resetTextPositionY(item, style, i);\n this.ctx.fillText(single, x, y);\n\n }\n\n // 换行后剩余的文字,超过一行则截断增加省略号\n let last = text.substring(currentIndex, length);\n let lastWidth = this.measureWidth(last);\n if(lastWidth > width) {\n let { single, singleWidth } = this._getTextSingleLine(last, width, singleLength);\n lastWidth = singleWidth;\n last = single.substring(0, single.length - 1) + '...';\n }\n\n x = this._resetTextPositionX(item, style, lastWidth, width);\n y = this._resetTextPositionY(item, style, lineNum);\n this.ctx.fillText(last, x, y);\n\n }else {\n x = this._resetTextPositionX(item, style, textWidth, width);\n y = this._resetTextPositionY(item, style);\n this.ctx.fillText(item.text, x, y);\n }\n }\n \n this.ctx.draw(true);\n \n this._updateProgress(item.progress);\n\n if(resolve) {\n resolve();\n }else {\n return {\n leftOffset,\n topOffset\n }\n }\n } catch(e) {\n reject && reject({ errcode: 1004, errmsg: 'drawText error', e: e });\n }\n }\n\n _drawTextBackgroud (item, style, textWidth, textHeight, isWxml) {\n if(!style.width) return;\n let zoom = isWxml ? 1 : this.zoom;\n let width = style.width || textWidth;\n let height = style.height || textHeight;\n let rectStyle = {\n fill: style.background,\n border: style.border\n }\n style.padding = style.padding || [0, 0, 0, 0];\n width += (style.padding[1] || 0) + (style.padding[3] || 0);\n height += (style.padding[0] || 0) + (style.padding[2] || 0);\n width = width * zoom\n height = height * zoom\n this._drawRectToCanvas(item.x, item.y, width, height, rectStyle);\n }\n\n _drawCircle (item, style, resolve, reject, isImage, isWxml) {\n let zoom = this.zoom;\n let r = style.r;\n try {\n \n item.x = this._resetPositionX(item, style);\n item.y = this._resetPositionY(item, style);\n\n let url;\n if(isImage) {\n let index = this._findPicIndex(item.url);\n if (index > -1) {\n url = this.allPic[index].local;\n } else {\n url = item.url;\n }\n }\n\n if(!isWxml) {\n r = r * zoom;\n }\n\n this._drawCircleToCanvas(item.x, item.y, r, style, url);\n \n this._updateProgress(item.progress);\n resolve && resolve();\n } catch (e) {\n reject && reject({ errcode: (isImage ? 1006 : 1005), errmsg: (isImage ? 'drawCircleImage error' : 'drawCircle error'), e });\n }\n }\n\n _drawCircleToCanvas (x, y, r, style, url) {\n let { fill, border, boxShadow } = style;\n\n this.ctx.save();\n\n this._drawBoxShadow(boxShadow, (res) => {\n // 真机上填充渐变色时,没有阴影,先画个相等大小的纯色矩形来实现阴影\n if((fill && typeof fill !== 'string') || (url && res.color)) {\n this.ctx.setFillStyle(res.color || '#ffffff');\n this.ctx.beginPath();\n this.ctx.arc(x + r, y + r, r, 0, 2 * Math.PI);\n this.ctx.closePath();\n this.ctx.fill();\n }\n });\n\n if(url) {\n this.ctx.save();\n this.ctx.beginPath();\n this.ctx.arc(x + r, y + r, r, 0, 2 * Math.PI);\n this.ctx.clip();\n this.ctx.drawImage(url, x, y, r * 2, r * 2);\n this.ctx.closePath();\n this.ctx.restore();\n }else {\n this._setFill(fill, () => {\n this.ctx.beginPath();\n this.ctx.arc(x + r, y + r, r, 0, 2 * Math.PI);\n this.ctx.closePath();\n this.ctx.fill();\n });\n }\n\n this._drawBorder(border, style, (border) => {\n this.ctx.beginPath()\n this.ctx.arc(x + r, y + r, r + border.width / 2, 0, 2 * Math.PI)\n this.ctx.stroke()\n this.ctx.closePath();\n });\n\n this.ctx.draw(true);\n this.ctx.restore();\n }\n\n _drawLine (item, style, resolve, reject, isWxml) {\n let zoom = this.zoom;\n try {\n let x1 = item.x * zoom + this.translateX;\n let y1 = item.y * zoom + this.translateY;\n let x2 = item.x2 * zoom + this.translateX;\n let y2 = item.y2 * zoom + this.translateY;\n this._drawLineToCanvas(x1, y1, x2, y2, style);\n\n this._updateProgress(item.progress);\n resolve && resolve();\n } catch (e) {\n reject && reject({ errcode: 1007, errmsg: 'drawLine error', e });\n }\n }\n\n _drawLineToCanvas (x1, y1, x2, y2, style) {\n let { stroke, dash, boxShadow } = style;\n\n this.ctx.save();\n if(stroke) {\n this._setStroke(stroke);\n }\n\n this._drawBoxShadow(boxShadow);\n\n if(dash) {\n let dash = [style.dash[0] || 5, style.dash[1] || 5];\n let offset = style.dash[2] || 0;\n this.ctx.setLineDash(dash, offset || 0);\n }\n\n this.ctx.moveTo(x1, y1);\n this.ctx.setLineWidth((style.width || 1) * this.zoom);\n this.ctx.lineTo(x2, y2);\n this.ctx.stroke();\n this.ctx.draw(true);\n this.ctx.restore();\n }\n\n // 废弃,合并到_drawRect\n _drawImage (item, style, resolve, reject, isWxml) {\n let zoom = this.zoom;\n try {\n \n item.x = this._resetPositionX(item, style);\n item.y = this._resetPositionY(item, style);\n item.x = item.x + (style.padding[3] || 0);\n item.y = item.y + (style.padding[0] || 0);\n\n let index = this._findPicIndex(item.url);\n let url = index > -1 ? this.allPic[index].local : item.url;\n this._drawImageToCanvas(url, item.x, item.y, style.width * zoom, style.height * zoom, style);\n\n this._updateProgress(item.progress);\n resolve && resolve();\n } catch (e) {\n reject && reject({ errcode: 1012, errmsg: 'drawRect error', e });\n }\n }\n\n // 废弃,合并到_drawRect\n _drawImageToCanvas (url, x, y, width, height, style) {\n let { fill, border, boxShadow } = style;\n this.ctx.save();\n\n this._drawBoxShadow(boxShadow);\n this.ctx.drawImage(url, x, y, width, height);\n\n this._drawBorder(border, style, (border) => {\n let fixBorder = border.width;\n this.ctx.strokeRect(x - fixBorder / 2, y - fixBorder / 2, width + fixBorder, height + fixBorder);\n });\n this.ctx.draw(true);\n this.ctx.restore();\n }\n\n _drawWxml (item, style, resolve, reject) {\n let self = this;\n let all = [];\n try {\n this._getWxml(item, style).then((results) => {\n \n // 上 -> 下\n let sorted = self._sortListByTop(results[0]);\n let count = 0;\n let progress = 0;\n Object.keys(sorted).forEach(item => {\n count += sorted[item].length;\n })\n progress = this.distance * 3 / (count || 1);\n\n all = this._drawWxmlBlock(item, sorted, all, progress, results[1]);\n all = this._drawWxmlInline(item, sorted, all, progress, results[1]);\n\n Promise.all(all).then(results => {\n resolve && resolve();\n }).catch (e => {\n reject && reject(e);\n });\n });\n } catch (e) {\n reject && reject({ errcode: 1008, errmsg: 'drawWxml error' });\n }\n }\n\n _drawWxmlBlock (item, sorted, all, progress, results) {\n let self = this;\n // 用来限定位置范围,取相对位置\n let limitLeft = (results ? results.left : 0);\n let limitTop = (results ? results.top : 0);\n Object.keys(sorted).forEach((top, topIndex) => {\n // 左 -> 右\n let list = sorted[top].sort((a, b) => {\n return (a.left - b.left);\n });\n\n list = list.filter(sub => sub.dataset.type && sub.dataset.type.indexOf('inline') === -1);\n\n list.forEach((sub, index) => {\n all[index] = new Promise((resolve2, reject2) => {\n sub = self._transferWxmlStyle(sub, item, limitLeft, limitTop);\n sub.progress = progress;\n let type = sub.dataset.type;\n if(sub.dataset.delay) {\n setTimeout(() => {\n drawWxmlItem();\n }, sub.dataset.delay)\n } else {\n drawWxmlItem();\n }\n function drawWxmlItem () {\n if (type === 'text') {\n self._drawWxmlText(sub, resolve2, reject2);\n } else if (type === 'image') {\n self._drawWxmlImage(sub, resolve2, reject2);\n } else if (type === 'radius-image') {\n self._drawWxmlCircleImage(sub, resolve2, reject2);\n } else if (type === 'background-image') {\n self._drawWxmlBackgroundImage(sub, resolve2, reject2);\n }\n }\n });\n });\n });\n\n return all;\n\n }\n\n _drawWxmlInline (item, sorted, all, progress, results) {\n let self = this;\n let topOffset = 0;\n let leftOffset = 0;\n let lastTop = 0;\n let limitLeft = (results ? results.left : 0);\n let limitTop = (results ? results.top : 0);\n let p = new Promise((resolve2, reject2) => {\n let maxWidth = 0;\n let minLeft = Infinity;\n let maxRight = 0;\n\n // 找出同一top下的最小left和最大right,得到最大的宽度,用于换行\n Object.keys(sorted).forEach(top => {\n let inlineList = sorted[top].filter(sub => sub.dataset.type && sub.dataset.type.indexOf('inline') > -1);\n inlineList.forEach(sub => {\n if(sub.left < minLeft) {\n minLeft = sub.left\n }\n if(sub.right > maxRight) {\n maxRight = sub.right;\n }\n })\n });\n maxWidth = Math.ceil((maxRight - minLeft) || self.width);\n\n Object.keys(sorted).forEach((top, topIndex) => {\n // 左 -> 右\n let list = sorted[top].sort((a, b) => {\n return (a.left - b.left);\n });\n\n // 换行的行内元素left放到后面,version2.0.6后无法获取高度,改用bottom值来判断是否换行了\n let position = -1;\n for(let i = 0, len = list.length; i < len; i++) {\n if(list[i] && list[i + 1]) {\n if(list[i].bottom > list[i + 1].bottom) {\n position = i;\n break;\n }\n }\n }\n\n if(position > -1) {\n list.push(list.splice(position, 1)[0]);\n }\n\n let inlineList = list.filter(sub => sub.dataset.type && sub.dataset.type.indexOf('inline') > -1);\n let originLeft = (inlineList[0] ? inlineList[0].left : 0);\n // 换行后和top不相等时,认为是换行了,要清除左边距;当左偏移量大于最大宽度时,也要清除左边距; 当左偏移小于左边距时,也要清除\n if (Math.abs(topOffset + lastTop - top) > 2 || leftOffset - originLeft - limitLeft >= maxWidth || leftOffset <= originLeft - limitLeft - 2) {\n leftOffset = 0;\n }\n\n lastTop = +top;\n topOffset = 0;\n \n inlineList.forEach((sub, index) => {\n sub = self._transferWxmlStyle(sub, item, limitLeft, limitTop);\n sub.progress = progress;\n let type = sub.dataset.type;\n if (type === 'inline-text') {\n let drawRes = self._drawWxmlInlineText(sub, leftOffset, maxWidth);\n leftOffset = drawRes.leftOffset;\n topOffset = drawRes.topOffset;\n } else if (type === 'inline-image') {\n let drawRes = self._drawWxmlImage(sub) || {};\n leftOffset = drawRes.leftOffset || 0;\n topOffset = drawRes.topOffset || 0;\n }\n });\n });\n resolve2();\n })\n\n all.push(p); \n return all;\n }\n\n _drawWxmlInlineText (sub, leftOffset = 0, maxWidth) {\n let text = sub.dataset.text || '';\n if(sub.dataset.maxlength && text.length > sub.dataset.maxlength) {\n text = text.substring(0, sub.dataset.maxlength) + '...';\n }\n \n let textData = {\n text,\n originX: sub.left,\n x: leftOffset ? leftOffset : sub.left,\n y: sub.top,\n progress: sub.progress,\n leftOffset: leftOffset,\n maxWidth: maxWidth // 行内元素的最大宽度,取决于limit的宽度\n }\n\n if (sub.backgroundColor !== 'rgba(0, 0, 0, 0)') {\n sub.background = sub.backgroundColor;\n }else {\n sub.background = 'rgba(0, 0, 0, 0)';\n }\n\n if(sub.dataset.background) {\n sub.background = sub.dataset.background;\n }\n\n let res = this._drawText(textData, sub, null, null, 'inline-text', 'wxml');\n\n return res\n }\n\n _drawWxmlText (sub, resolve, reject) {\n let text = sub.dataset.text || '';\n if(sub.dataset.maxlength && text.length > sub.dataset.maxlength) {\n text = text.substring(0, sub.dataset.maxlength) + '...';\n }\n \n let textData = {\n text,\n x: sub.left,\n y: sub.top,\n progress: sub.progress\n }\n if (sub.backgroundColor !== 'rgba(0, 0, 0, 0)') {\n sub.background = sub.backgroundColor;\n }else {\n sub.background = 'rgba(0, 0, 0, 0)';\n }\n\n if(sub.dataset.background) {\n sub.background = sub.dataset.background;\n }\n\n this._drawText(textData, sub, resolve, reject, 'text', 'wxml');\n }\n\n _drawWxmlImage (sub, resolve, reject) {\n let imageData = {\n url: sub.dataset.url,\n x: sub.left,\n y: sub.top,\n progress: sub.progress\n }\n\n let res = this._drawRect(imageData, sub, resolve, reject, 'image', 'inline-wxml');\n\n return res\n }\n\n _drawWxmlCircleImage (sub, resolve, reject) {\n let imageData = {\n url: sub.dataset.url,\n x: sub.left,\n y: sub.top,\n progress: sub.progress\n }\n sub.r = sub.width / 2;\n\n this._drawCircle(imageData, sub, resolve, reject, true, 'wxml');\n }\n\n _drawWxmlBackgroundImage (sub, resolve, reject) {\n let url = sub.dataset.url;\n let index = this._findPicIndex(url);\n url = index > -1 ? this.allPic[index].local : url;\n let size = sub.backgroundSize.replace(/px/g, '').split(' ');\n\n let imageData = {\n url: url,\n x: sub.left,\n y: sub.top,\n progress: sub.progress\n }\n\n this._drawRect(imageData, sub, resolve, reject, 'image', 'wxml');\n }\n\n _getWxml (item, style) {\n let self = this;\n let query;\n if(this.obj) {\n query = wx.createSelectorQuery().in(this.obj);\n }else {\n query = wx.createSelectorQuery();\n }\n\n let p1 = new Promise((resolve, reject) => {\n // 会触发两次,要限制\n let count = 0;\n query.selectAll(`${item.class}`).fields({\n dataset: true,\n size: true,\n rect: true,\n computedStyle: ['width', 'height', 'font', 'fontSize', 'fontFamily', 'fontWeight', 'fontStyle', 'textAlign', \n 'color', 'lineHeight', 'border', 'borderColor', 'borderStyle', 'borderWidth', 'verticalAlign', 'boxShadow',\n 'background', 'backgroundColor', 'backgroundImage', 'backgroundPosition', 'backgroundSize', 'paddingLeft', 'paddingTop',\n 'paddingRight', 'paddingBottom'\n ]\n }, (res) => {\n if(count++ === 0) {\n let formated = self._formatImage(res);\n let list = formated.list;\n res = formated.res;\n\n self._preloadImage(list).then(result => {\n resolve(res);\n }).catch((res) => {\n reject && reject({ errcode: 1009, errmsg: 'drawWxml preLoadImage error' });\n });\n }\n }).exec();\n });\n\n let p2 = new Promise((resolve, reject) => {\n if (!item.limit) {\n resolve({ top: 0, width: self.width / self.zoom });\n }\n\n query.select(`${item.limit}`).fields({\n dataset: true,\n size: true,\n rect: true,\n }, (res) => {\n resolve(res);\n }).exec();\n });\n\n return Promise.all([p1, p2]);\n }\n\n _getLineHeight (style) {\n let zoom = this.zoom;\n if(style.dataset && style.dataset.type) {\n zoom = 1;\n }\n let lineHeight;\n if(!isNaN(style.lineHeight) && style.lineHeight > style.fontSize) {\n lineHeight = style.lineHeight;\n }else {\n style.lineHeight = (style.lineHeight || '') + '';\n lineHeight = +style.lineHeight.replace('px', '');\n lineHeight = lineHeight ? lineHeight : (style.fontSize || 14) * 1.2;\n }\n return lineHeight * zoom;\n }\n\n _formatImage (res = []) {\n let list = [];\n res.forEach((item, index) => {\n let dataset = item.dataset;\n let uid = Util.getUid();\n let filename = `${wx.env.USER_DATA_PATH}/${uid}.png`;\n if ((dataset.type === \"image\" || dataset.type === \"radius-image\") && dataset.url) {\n let sub = {\n url: dataset.base64 ? filename : dataset.url,\n isBase64: dataset.base64 ? dataset.url : false\n }\n\n res[index].dataset = Object.assign(res[index].dataset, sub);\n list.push(sub)\n } else if (dataset.type === 'background-image' && item.backgroundImage.indexOf('url') > -1) {\n let url = item.backgroundImage.replace(/url\\((\\\"|\\')?/, '').replace(/(\\\"|\\')?\\)$/, '');\n let sub = {\n url: dataset.base64 ? filename : url,\n isBase64: dataset.base64 ? url : false\n }\n res[index].dataset = Object.assign(res[index].dataset, sub);\n list.push(sub)\n }\n });\n\n return { list, res };\n }\n\n _updateProgress (distance) {\n this.progressPercent += distance;\n this.progress(this.progressPercent);\n }\n\n _sortListByTop (list = []) {\n let sorted = {};\n\n // 粗略地认为2px相差的元素在同一行\n list.forEach((item, index) => {\n let top = item.top;\n if (!sorted[top]) {\n if (sorted[top - 2]) {\n top = top - 2;\n }else if (sorted[top - 1]) {\n top = top - 1;\n } else if (sorted[top + 1]) {\n top = top + 1;\n } else if (sorted[top + 2]) {\n top = top + 2;\n } else {\n sorted[top] = [];\n }\n }\n sorted[top].push(item);\n });\n\n return sorted;\n }\n\n _parseNumber (number) {\n return isNaN(number) ? +(number || '').replace('px', '') : number;\n }\n\n _transferWxmlStyle (sub, item, limitLeft, limitTop) {\n let leftFix = (+sub.dataset.left || 0);\n let topFix = (+sub.dataset.top || 0);\n\n sub.width = this._parseNumber(sub.width);\n sub.height = this._parseNumber(sub.height);\n sub.left = this._parseNumber(sub.left) - limitLeft + (leftFix + (item.x || 0)) * this.zoom;\n sub.top = this._parseNumber(sub.top) - limitTop + (topFix + (item.y || 0)) * this.zoom;\n\n let padding = sub.dataset.padding || '0 0 0 0';\n if (typeof padding === 'string') {\n padding = Util.transferPadding(padding);\n }\n let paddingTop = Number(sub.paddingTop.replace('px', '')) + Number(padding[0]);\n let paddingRight = Number(sub.paddingRight.replace('px', '')) + Number(padding[1]);\n let paddingBottom = Number(sub.paddingBottom.replace('px', '')) + Number(padding[2]);\n let paddingLeft = Number(sub.paddingLeft.replace('px', '')) + Number(padding[3]);\n sub.padding = [paddingTop, paddingRight, paddingBottom, paddingLeft];\n \n return sub;\n }\n\n /**\n * 支持负值绘制,从右边计算\n * @param {*} item \n * @param {*} style \n */\n _resetPositionX (item, style) {\n let zoom = this.zoom;\n let x = 0;\n\n if(style.dataset && style.dataset.type) {\n zoom = 1;\n }\n\n // 通过wxml获取的不需要重置坐标\n if (item.x < 0 && item.type) {\n x = this.width + item.x * zoom - style.width * zoom;\n } else {\n x = item.x * zoom;\n }\n\n if (parseInt(style.borderWidth)) {\n x += parseInt(style.borderWidth)\n }\n\n return x + this.translateX;\n }\n\n /**\n * 支持负值绘制,从底部计算\n * @param {*} item \n * @param {*} style \n */\n _resetPositionY (item, style, textHeight) {\n let zoom = this.zoom;\n let y = 0;\n\n if(style.dataset && style.dataset.type) {\n zoom = 1;\n }\n\n if (item.y < 0) {\n y = this.height + item.y * zoom - (textHeight ? textHeight : style.height * zoom)\n } else {\n y = item.y * zoom;\n }\n\n if (parseInt(style.borderWidth)) {\n y += parseInt(style.borderWidth)\n }\n \n return y + this.translateY;\n }\n\n /**\n * 文字的padding、text-align\n * @param {*} item \n * @param {*} style \n * @param {*} textWidth\n */\n _resetTextPositionX (item, style, textWidth, width) {\n let textAlign = style.textAlign || 'left';\n let x = item.x;\n if (textAlign === 'center') {\n x = (width - textWidth) / 2 + item.x;\n } else if (textAlign === 'right') {\n x = width - textWidth + item.x;\n }\n\n let left = style.padding ? (style.padding[3] || 0) : 0;\n\n return x + left + this.translateX;\n }\n\n /**\n * 文字的padding、text-align\n * @param {*} item \n * @param {*} style \n * @param {*} textWidth\n */\n _resetTextPositionY (item, style, lineNum = 0) {\n let zoom = this.zoom;\n if(style.dataset && style.dataset.type) {\n zoom = 1;\n }\n\n let lineHeight = this._getLineHeight(style);\n let fontSize = Math.ceil((style.fontSize || 14) * zoom)\n\n let blockLineHeightFix = (style.dataset && style.dataset.type || '').indexOf('inline') > -1 ? 0 : (lineHeight - fontSize) / 2\n\n let top = style.padding ? (style.padding[0] || 0) : 0;\n\n // y + lineheight偏移 + 行数 + paddingTop + 整体画布位移\n return item.y + blockLineHeightFix + lineNum * lineHeight + top + this.translateY;\n }\n\n /**\n * 当文本超过宽度时,计算每一行应该绘制的文本\n * @param {*} text \n * @param {*} width \n * @param {*} singleLength \n * @param {*} currentIndex \n * @param {*} widthOffset\n */\n _getTextSingleLine(text, width, singleLength, currentIndex = 0, widthOffset = 0) {\n let offset = 0;\n let endIndex = currentIndex + singleLength + offset;\n let single = text.substring(currentIndex, endIndex);\n let singleWidth = this.measureWidth(single);\n\n while (Math.round(widthOffset + singleWidth) > width) {\n offset--;\n endIndex = currentIndex + singleLength + offset;\n single = text.substring(currentIndex, endIndex);\n singleWidth = this.measureWidth(single);\n }\n\n return {\n endIndex, \n single, \n singleWidth\n }\n }\n\n _drawBorder (border, style, callback) {\n let zoom = this.zoom;\n if(style.dataset && style.dataset.type) {\n zoom = 1;\n }\n border = Util.transferBorder(border);\n\n if (border && border.width) {\n // 空白阴影,清空掉边框的阴影\n this._drawBoxShadow();\n if (border) {\n \n this.ctx.setLineWidth(border.width * zoom);\n\n if (border.style === 'dashed') {\n let dash = style.dash || [5, 5, 0];\n let offset = dash[2] || 0;\n let array = [dash[0] || 5, dash[1] || 5];\n this.ctx.setLineDash(array, offset);\n }\n this.ctx.setStrokeStyle(border.color);\n }\n callback && callback(border);\n }\n } \n\n _drawBoxShadow (boxShadow, callback) {\n boxShadow = Util.transferBoxShadow(boxShadow);\n if (boxShadow) {\n this.ctx.setShadow(boxShadow.offsetX, boxShadow.offsetY, boxShadow.blur, boxShadow.color);\n }else {\n this.ctx.setShadow(0, 0, 0, '#ffffff');\n }\n\n callback && callback(boxShadow || {});\n }\n\n _setFill (fill, callback) {\n if(fill) {\n if (typeof fill === 'string') {\n this.ctx.setFillStyle(fill);\n } else {\n let line = fill.line;\n let color = fill.color;\n let grd = this.ctx.createLinearGradient(line[0], line[1], line[2], line[3]);\n grd.addColorStop(0, color[0]);\n grd.addColorStop(1, color[1]);\n this.ctx.setFillStyle(grd);\n }\n callback && callback();\n }\n }\n\n _setStroke (stroke, callback) {\n if(stroke) {\n if (typeof stroke === 'string') {\n this.ctx.setStrokeStyle(stroke);\n } else {\n let line = stroke.line;\n let color = stroke.color;\n let grd = this.ctx.createLinearGradient(line[0], line[1], line[2], line[3]);\n grd.addColorStop(0, color[0]);\n grd.addColorStop(1, color[1]);\n this.ctx.setStrokeStyle(grd);\n }\n\n callback && callback();\n }\n }\n}\n\nif (!exports.__esModule) Object.defineProperty(exports, \"__esModule\", { value: true });exports.default = Wxml2Canvas;","/**\n * 获取字符的长度,full为true时,一个汉字算两个长度\n * @param {String} str \n * @param {Boolean} full \n */\n\nfunction getTextLength (str, full) {\n let len = 0;\n for (let i = 0; i < str.length; i++) {\n let c = str.charCodeAt(i);\n //单字节加1 \n if ((c >= 0x0001 && c <= 0x007e) || (0xff60 <= c && c <= 0xff9f)) {\n len++;\n }\n else {\n len += (full ? 2 : 1);\n }\n }\n return len;\n}\n\n/**\n * rgba(255, 255, 255, 1) => #ffffff\n * @param {String} color \n */\nfunction transferColor (color = '') {\n let res = '#';\n color = color.replace(/^rgba?\\(/, '').replace(/\\)$/, '');\n color = color.split(', ');\n \n color.length > 3 ? color.length = 3 : '';\n for(let item of color) {\n item = parseInt(item || 0);\n if(item < 10) {\n res += ('0' + item)\n }else {\n res += (item.toString(16))\n }\n }\n\n return res;\n}\n\nfunction transferBorder (border = '') {\n let res = border.match(/(\\w+)px\\s(\\w+)\\s(.*)/);\n let obj = {};\n\n if(res) {\n obj = {\n width: +res[1],\n style: res[2],\n color: res[3]\n }\n }\n \n return res ? obj : null;\n}\n\n\n/**\n * 内边距,依次为上右下左\n * @param {*} padding \n */\nfunction transferPadding (padding = '0 0 0 0') {\n padding = padding.split(' ');\n for(let i = 0, len = padding.length; i < len; i++) {\n padding[i] = +padding[i].replace('px', '');\n }\n\n return padding;\n}\n/**\n * type1: 0, 25, 17, rgba(0, 0, 0, 0.3)\n * type2: rgba(0, 0, 0, 0.3) 0px 25px 17px 0px => (0, 25, 17, rgba(0, 0, 0, 0.3))\n * @param {*} shadow \n */\nfunction transferBoxShadow(shadow = '', type) {\n if(!shadow || shadow === 'none') return;\n let color;\n let split;\n\n split = shadow.match(/(\\w+)\\s(\\w+)\\s(\\w+)\\s(rgb.*)/);\n\n if (split) {\n split.shift();\n shadow = split;\n color = split[3] || '#ffffff';\n } else {\n split = shadow.split(') ');\n color = split[0] + ')'\n shadow = split[1].split('px ');\n }\n\n return {\n offsetX: +shadow[0] || 0,\n offsetY: +shadow[1] || 0,\n blur: +shadow[2] || 0,\n color\n }\n}\n\nfunction getUid(prefix) {\n prefix = prefix || '';\n\n return (\n prefix +\n 'xxyxxyxx'.replace(/[xy]/g, c => {\n let r = (Math.random() * 16) | 0;\n let v = c === 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n })\n );\n}\n\nif (!exports.__esModule) Object.defineProperty(exports, \"__esModule\", { value: true });exports.default = {\n getTextLength,\n transferBorder,\n transferColor,\n transferPadding,\n transferBoxShadow,\n getUid\n};"]} diff --git a/src/components/ec-canvas/ec-canvas.js b/src/components/ec-canvas/ec-canvas.js new file mode 100644 index 0000000..c97c3f9 --- /dev/null +++ b/src/components/ec-canvas/ec-canvas.js @@ -0,0 +1,267 @@ +import WxCanvas from './wx-canvas'; + +let ctx; +let echarts + +function compareVersion(v1, v2) { + v1 = v1.split('.') + v2 = v2.split('.') + const len = Math.max(v1.length, v2.length) + + while (v1.length < len) { + v1.push('0') + } + while (v2.length < len) { + v2.push('0') + } + + for (let i = 0; i < len; i++) { + const num1 = parseInt(v1[i]) + const num2 = parseInt(v2[i]) + + if (num1 > num2) { + return 1 + } else if (num1 < num2) { + return -1 + } + } + return 0 +} + +Component({ + properties: { + canvasId: { + type: String, + value: 'ec-canvas' + }, + + ec: { + type: Object + }, + + forceUseOldCanvas: { + type: Boolean, + value: false + } + }, + + data: { + isUseNewCanvas: false + }, + + ready:async function () { + echarts = await require.async('../../resource/components/echart/echarts.js') + // Disable prograssive because drawImage doesn't support DOM as parameter + // See https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.drawImage.html + echarts.registerPreprocessor(option => { + if (option && option.series) { + if (option.series.length > 0) { + option.series.forEach(series => { + series.progressive = 0; + }); + } + else if (typeof option.series === 'object') { + option.series.progressive = 0; + } + } + }); + + if (!this.data.ec) { + console.warn('组件需绑定 ec 变量,例:'); + return; + } + + if (!this.data.ec.lazyLoad) { + this.init(); + } + }, + + methods: { + init: async function (callback) { + echarts = await require.async('../../resource/components/echart/echarts.js') + const version = wx.getSystemInfoSync().SDKVersion + + const canUseNewCanvas = compareVersion(version, '2.9.0') >= 0; + const forceUseOldCanvas = this.data.forceUseOldCanvas; + const isUseNewCanvas = canUseNewCanvas && !forceUseOldCanvas; + this.setData({ isUseNewCanvas }); + + if (forceUseOldCanvas && canUseNewCanvas) { + console.warn('开发者强制使用旧canvas,建议关闭'); + } + + if (isUseNewCanvas) { + // console.log('微信基础库版本大于2.9.0,开始使用'); + // 2.9.0 可以使用 + this.initByNewWay(callback); + } else { + const isValid = compareVersion(version, '1.9.91') >= 0 + if (!isValid) { + console.error('微信基础库版本过低,需大于等于 1.9.91。' + + '参见:https://github.com/ecomfe/echarts-for-weixin' + + '#%E5%BE%AE%E4%BF%A1%E7%89%88%E6%9C%AC%E8%A6%81%E6%B1%82'); + return; + } else { + console.warn('建议将微信基础库调整大于等于2.9.0版本。升级后绘图将有更好性能'); + this.initByOldWay(callback); + } + } + }, + + initByOldWay(callback) { + // 1.9.91 <= version < 2.9.0:原来的方式初始化 + ctx = wx.createCanvasContext(this.data.canvasId, this); + const canvas = new WxCanvas(ctx, this.data.canvasId, false); + + echarts.setCanvasCreator(() => { + return canvas; + }); + // const canvasDpr = wx.getSystemInfoSync().pixelRatio // 微信旧的canvas不能传入dpr + const canvasDpr = 1 + var query = wx.createSelectorQuery().in(this); + query.select('.ec-canvas').boundingClientRect(res => { + if (typeof callback === 'function') { + this.chart = callback(canvas, res.width, res.height, canvasDpr); + } + else if (this.data.ec && typeof this.data.ec.onInit === 'function') { + this.chart = this.data.ec.onInit(canvas, res.width, res.height, canvasDpr); + } + else { + this.triggerEvent('init', { + canvas: canvas, + width: res.width, + height: res.height, + canvasDpr: canvasDpr // 增加了dpr,可方便外面echarts.init + }); + } + }).exec(); + }, + + initByNewWay(callback) { + // version >= 2.9.0:使用新的方式初始化 + const query = wx.createSelectorQuery().in(this) + query + .select('.ec-canvas') + .fields({ node: true, size: true }) + .exec(res => { + const canvasNode = res[0].node + this.canvasNode = canvasNode + + const canvasDpr = wx.getSystemInfoSync().pixelRatio + const canvasWidth = res[0].width + const canvasHeight = res[0].height + + const ctx = canvasNode.getContext('2d') + + const canvas = new WxCanvas(ctx, this.data.canvasId, true, canvasNode) + echarts.setCanvasCreator(() => { + return canvas + }) + + if (typeof callback === 'function') { + this.chart = callback(canvas, canvasWidth, canvasHeight, canvasDpr) + } else if (this.data.ec && typeof this.data.ec.onInit === 'function') { + this.chart = this.data.ec.onInit(canvas, canvasWidth, canvasHeight, canvasDpr) + } else { + this.triggerEvent('init', { + canvas: canvas, + width: canvasWidth, + height: canvasHeight, + dpr: canvasDpr + }) + } + }) + }, + canvasToTempFilePath(opt) { + if (this.data.isUseNewCanvas) { + // 新版 + const query = wx.createSelectorQuery().in(this) + query + .select('.ec-canvas') + .fields({ node: true, size: true }) + .exec(res => { + const canvasNode = res[0].node + opt.canvas = canvasNode + wx.canvasToTempFilePath(opt) + }) + } else { + // 旧的 + if (!opt.canvasId) { + opt.canvasId = this.data.canvasId; + } + ctx.draw(true, () => { + wx.canvasToTempFilePath(opt, this); + }); + } + }, + + touchStart(e) { + if (this.chart && e.touches.length > 0) { + var touch = e.touches[0]; + var handler = this.chart.getZr().handler; + handler.dispatch('mousedown', { + zrX: touch.x, + zrY: touch.y, + preventDefault: () => {}, + stopImmediatePropagation: () => {}, + stopPropagation: () => {} + }); + handler.dispatch('mousemove', { + zrX: touch.x, + zrY: touch.y, + preventDefault: () => {}, + stopImmediatePropagation: () => {}, + stopPropagation: () => {} + }); + handler.processGesture(wrapTouch(e), 'start'); + } + }, + + touchMove(e) { + if (this.chart && e.touches.length > 0) { + var touch = e.touches[0]; + var handler = this.chart.getZr().handler; + handler.dispatch('mousemove', { + zrX: touch.x, + zrY: touch.y, + preventDefault: () => {}, + stopImmediatePropagation: () => {}, + stopPropagation: () => {} + }); + handler.processGesture(wrapTouch(e), 'change'); + } + }, + + touchEnd(e) { + if (this.chart) { + const touch = e.changedTouches ? e.changedTouches[0] : {}; + var handler = this.chart.getZr().handler; + handler.dispatch('mouseup', { + zrX: touch.x, + zrY: touch.y, + preventDefault: () => {}, + stopImmediatePropagation: () => {}, + stopPropagation: () => {} + }); + handler.dispatch('click', { + zrX: touch.x, + zrY: touch.y, + preventDefault: () => {}, + stopImmediatePropagation: () => {}, + stopPropagation: () => {} + }); + handler.processGesture(wrapTouch(e), 'end'); + } + } + } +}); + +function wrapTouch(event) { + for (let i = 0; i < event.touches.length; ++i) { + const touch = event.touches[i]; + touch.offsetX = touch.x; + touch.offsetY = touch.y; + } + return event; +} diff --git a/src/components/ec-canvas/ec-canvas.json b/src/components/ec-canvas/ec-canvas.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/src/components/ec-canvas/ec-canvas.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/src/components/ec-canvas/ec-canvas.wxml b/src/components/ec-canvas/ec-canvas.wxml new file mode 100644 index 0000000..88826d9 --- /dev/null +++ b/src/components/ec-canvas/ec-canvas.wxml @@ -0,0 +1,4 @@ + + + + diff --git a/src/components/ec-canvas/ec-canvas.wxss b/src/components/ec-canvas/ec-canvas.wxss new file mode 100644 index 0000000..5307021 --- /dev/null +++ b/src/components/ec-canvas/ec-canvas.wxss @@ -0,0 +1,5 @@ +.ec-canvas { + width: 100%; + height: 100%; + z-index: 1; +} diff --git a/src/components/ec-canvas/wx-canvas.js b/src/components/ec-canvas/wx-canvas.js new file mode 100644 index 0000000..6c7c90b --- /dev/null +++ b/src/components/ec-canvas/wx-canvas.js @@ -0,0 +1,111 @@ +export default class WxCanvas { + constructor(ctx, canvasId, isNew, canvasNode) { + this.ctx = ctx; + this.canvasId = canvasId; + this.chart = null; + this.isNew = isNew + if (isNew) { + this.canvasNode = canvasNode; + } + else { + this._initStyle(ctx); + } + + // this._initCanvas(zrender, ctx); + + this._initEvent(); + } + + getContext(contextType) { + if (contextType === '2d') { + return this.ctx; + } + } + + // canvasToTempFilePath(opt) { + // if (!opt.canvasId) { + // opt.canvasId = this.canvasId; + // } + // return wx.canvasToTempFilePath(opt, this); + // } + + setChart(chart) { + this.chart = chart; + } + + addEventListener() { + // noop + } + + attachEvent() { + // noop + } + + detachEvent() { + // noop + } + + _initCanvas(zrender, ctx) { + zrender.util.getContext = function () { + return ctx; + }; + + zrender.util.$override('measureText', function (text, font) { + ctx.font = font || '12px sans-serif'; + return ctx.measureText(text); + }); + } + + _initStyle(ctx) { + ctx.createRadialGradient = () => { + return ctx.createCircularGradient(arguments); + }; + } + + _initEvent() { + this.event = {}; + const eventNames = [{ + wxName: 'touchStart', + ecName: 'mousedown' + }, { + wxName: 'touchMove', + ecName: 'mousemove' + }, { + wxName: 'touchEnd', + ecName: 'mouseup' + }, { + wxName: 'touchEnd', + ecName: 'click' + }]; + eventNames.forEach(name => { + this.event[name.wxName] = e => { + const touch = e.touches[0]; + this.chart.getZr().handler.dispatch(name.ecName, { + zrX: name.wxName === 'tap' ? touch.clientX : touch.x, + zrY: name.wxName === 'tap' ? touch.clientY : touch.y, + preventDefault: () => {}, + stopImmediatePropagation: () => {}, + stopPropagation: () => {} + }); + }; + }); + } + + set width(w) { + if (this.canvasNode) this.canvasNode.width = w + } + set height(h) { + if (this.canvasNode) this.canvasNode.height = h + } + + get width() { + if (this.canvasNode) + return this.canvasNode.width + return 0 + } + get height() { + if (this.canvasNode) + return this.canvasNode.height + return 0 + } +} diff --git a/src/components/freeAudio/free-audio.vue b/src/components/freeAudio/free-audio.vue new file mode 100644 index 0000000..25a3dd3 --- /dev/null +++ b/src/components/freeAudio/free-audio.vue @@ -0,0 +1,158 @@ + + + + + diff --git a/src/components/freeAudio/index.js b/src/components/freeAudio/index.js new file mode 100644 index 0000000..042cfd5 --- /dev/null +++ b/src/components/freeAudio/index.js @@ -0,0 +1,176 @@ +const app = getApp(); +import dayjs from "dayjs"; +Component({ + behaviors: [], + properties: { + audio: { + type: Object, + observer(val) { + if (this.audioContext) { + const { play } = this.data; + if (play) { + this.audioContext.pause(); + this.setData({ + play: false, + progress: 0, + time: "00", + }); + } + this.audioContext.destroy(); + } + if (val) { + this.audioAddEventListener(val); + } + }, + }, + }, + data: { + Timestamp: app.globalData.Timestamp, + progress: 0, + time: "00", + duration: "00", + play: false, + loading: true, + + imageUrl: app.globalData.imageUrl, + progressimg: true, + }, + lifetimes: { + created() {}, + async attached() {}, + moved() {}, + detached() { + if (this.audioContext) { + const { play } = this.data; + if (play) { + this.audioContext.pause(); + } + this.audioContext.destroy(); + } + this.audioAddEventListener = null; + this.setData({ + play: false, + progress: 0, + time: "00", + }); + }, + }, + pageLifetimes: { + // 组件所在页面的生命周期函数 + show: function () {}, + hide: function () { + const { play } = this.data; + if (play) { + this.audioContext.pause(); + } + }, + resize: function () {}, + }, + methods: { + togglePlay() { + const { play, loading } = this.data; + if (loading) { + wx.showToast({ + title: "音频加载中", + icon: "none", + }); + return; + } + if (play) { + this.audioContext.pause(); + } else { + this.audioContext.play(); + } + }, + formatTime(time) { + let m = parseInt(time / 60); + let s = parseInt(time % 60); + return this.towNum(m) + ":" + this.towNum(s); + }, + towNum(num) { + if (num >= 10) { + return num; + } else { + return "0" + num; + } + }, + audioAddEventListener(val) { + const that = this; + this.setData({ + duration: this.formatTime(val.size), + }); + that.audioContext = wx.createInnerAudioContext(); + that.audioContext.src = val.url; + that.setData({ + loading: false, + }); + that.audioContext.onError(({ errCode, ...reset }) => { + console.log("reset: ", reset); + console.log("errCode: ", errCode); + if (errCode === 10004 || errCode == 10001 || errCode == -1) { + that.audioContext.destroy(); + that.setData({ + loading: true, + }); + setTimeout(() => { + that.audioAddEventListener(val); + }, 300); + } + }); + that.audioContext.onPlay(() => { + that.setData({ + play: true, + }); + }); + that.audioContext.onPause(() => { + console.log(1111111); + that.setData({ + play: false, + }); + }); + that.audioContext.onEnded(() => { + that.audioContext.seek(0); + that.setData({ + play: false, + progress: 0, + time: "00", + }); + }); + that.audioContext.onTimeUpdate(() => { + const duration = that.audioContext.duration || 0; + const currentTime = that.audioContext.currentTime || 0; + const progress = (currentTime / duration) * 100; + if (duration == Infinity) { + return; + } + that.setData({ + play: true, + duration: that.formatTime(duration), + time: that.formatTime(currentTime), + }); + if (that.data.progressimg) { + this.setData({ + progress: progress, + }); + } + }); + }, + handleAuthChangeimg() { + console.log(11111); + this.setData({ + progressimg: false, + }); + }, + handleAuthChange(e) { + console.log(22222222222); + let { duration } = this.data; + const secods = this.audioContext.duration || duration.split(":")[0] * 60 + duration.split(":")[1] * 1; + const progress = e.detail.value; + let seek = ((secods / 100) * progress).toFixed(3) * 1; + this.audioContext.seek(seek); + this.setData({ + progressimg: true, + }); + }, + }, +}); diff --git a/src/components/freeAudio/index.json b/src/components/freeAudio/index.json new file mode 100644 index 0000000..80041fb --- /dev/null +++ b/src/components/freeAudio/index.json @@ -0,0 +1,5 @@ +{ + "navigationBarTitleText": "", + "component": true, + "usingComponents": {} +} diff --git a/src/components/freeAudio/index.scss b/src/components/freeAudio/index.scss new file mode 100644 index 0000000..584eaa5 --- /dev/null +++ b/src/components/freeAudio/index.scss @@ -0,0 +1,54 @@ +.audio { + width: 100%; + height: 86rpx; + position: relative; + .audio-bg { + margin: 0 120rpx 0 80rpx; + height: 100%; + width: calc(100% - 200rpx); + } + .card-auth { + position: absolute; + left: 0; + top: 0; + width: 100%; + padding: 14rpx 26rpx 12rpx; + display: flex; + align-items: center; + justify-content: space-between; + box-sizing: border-box; + background: rgba(174, 182, 205, 0.1); + border-radius: 50rpx 50rpx 50rpx 50rpx; + border: 1rpx solid rgba(181, 205, 255, 0.1); + .icon { + width: 60rpx; + height: 60rpx; + flex-shrink: 0; + } + .center { + position: relative; + width: 100%; + margin: 0 30rpx; + display: flex; + align-items: center; + .progress-bg { + width: 100%; + height: 60rpx; + } + + .progress { + position: absolute; + left: 0; + top: 50%; + transform: translateY(-50%); + width: 100%; + margin: 0; + } + } + .time { + flex-shrink: 0; + font-size: 24rpx; + color: #e04775; + } + } +} diff --git a/src/components/freeAudio/index.wxml b/src/components/freeAudio/index.wxml new file mode 100644 index 0000000..cdc5e3e --- /dev/null +++ b/src/components/freeAudio/index.wxml @@ -0,0 +1,26 @@ + + + + + + + + {{duration}} + + diff --git a/src/components/loginNavbar/index.json b/src/components/loginNavbar/index.json new file mode 100644 index 0000000..cbc30f3 --- /dev/null +++ b/src/components/loginNavbar/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": { + "van-nav-bar": "@vant/weapp/nav-bar/index", + "van-icon": "@vant/weapp/icon/index" + } +} diff --git a/src/components/loginNavbar/index.scss b/src/components/loginNavbar/index.scss new file mode 100644 index 0000000..12b7cd3 --- /dev/null +++ b/src/components/loginNavbar/index.scss @@ -0,0 +1,24 @@ +.navbar { + padding: 0 20rpx 0 0; + display: flex; + align-items: center; + .back-icon { + margin-right: 40rpx; + } + .num { + width: 64rpx; + height: 64rpx; + border-radius: 50%; + border: 3rpx solid #e04876; + text-align: center; + line-height: 64rpx; + margin-right: 24rpx; + font-size: 40rpx; + color: #e04876; + font-weight: bold; + &.active { + background-color: #e04876; + color: #fff; + } + } +} diff --git a/src/components/loginNavbar/index.ts b/src/components/loginNavbar/index.ts new file mode 100644 index 0000000..2c1f763 --- /dev/null +++ b/src/components/loginNavbar/index.ts @@ -0,0 +1,23 @@ +const app = getApp(); + +Component({ + properties: { + num: { + type: Number, + value: 0, + }, + back: { + type: Boolean, + value: false, + }, + }, + data: { + imageUrl: app.globalData.imageUrl, + Timestamp: app.globalData.Timestamp, + }, + methods: { + handleBack() { + this.triggerEvent("back"); + }, + }, +}); diff --git a/src/components/loginNavbar/index.wxml b/src/components/loginNavbar/index.wxml new file mode 100644 index 0000000..62d2b7c --- /dev/null +++ b/src/components/loginNavbar/index.wxml @@ -0,0 +1,7 @@ + + + + 1 + 2 + + diff --git a/src/components/navBar/navBar.js b/src/components/navBar/navBar.js new file mode 100644 index 0000000..14fdecb --- /dev/null +++ b/src/components/navBar/navBar.js @@ -0,0 +1,250 @@ +const app = getApp(); +Component({ + options: { + multipleSlots: true, + addGlobalClass: true, + }, + properties: { + slotLeft:{ + type:Boolean, + value:false, + }, + extClass: { + type: String, + value: "", + }, + background: { + type: String, + value: "transparent", + observer: "_showChange", + }, + backgroundColorTop: { + type: String, + value: "transparent", + observer: "_showChangeBackgroundColorTop", + }, + color: { + type: String, + value: "#000000", + }, + title: { + type: String, + value: "", + }, + back: { + type: Boolean, + value: false, + }, + home: { + type: Boolean, + value: true, + }, + iconTheme: { + type: String, + value: "nuohe", + }, + /* animated: { + type: Boolean, + value: true + }, + show: { + type: Boolean, + value: true, + observer: '_showChange' + }, */ + delta: { + type: Number, + value: 1, + }, + fixed: { + type: Boolean, + value: false, + }, + }, + created: function () { + this.getSystemInfo(); + }, + attached: function () { + this.setStyle(); //设置样式 + }, + data: { + imageUrl: app.globalData.imageUrl, + Timestamp: app.globalData.Timestamp, + isHome: false, + }, + pageLifetimes: { + show: function () { + if (getApp().globalSystemInfo.ios) { + this.getSystemInfo(); + this.setStyle(); //设置样式1 + } + let pages = getCurrentPages(); + this.setData({ + isHome: !pages[pages.length - 2], + }); + }, + hide: function () {}, + }, + methods: { + setStyle: function (life) { + const { statusBarHeight, navBarHeight, capsulePosition, navBarExtendHeight, ios, windowWidth } = + getApp().globalSystemInfo; + const { back, home, title } = this.data; + let rightDistance = windowWidth - capsulePosition.right; //胶囊按钮右侧到屏幕右侧的边距 + let leftWidth = windowWidth - capsulePosition.left; //胶囊按钮左侧到屏幕右侧的边距 + this.setData({ + leftWidth: leftWidth, + }); + + let navigationbarinnerStyle = [ + `color: ${this.data.color}`, + `background: ${this.data.background}`, + `height:${navBarHeight + navBarExtendHeight}px`, + `padding-top:${statusBarHeight}px`, + `padding-right:${leftWidth}px`, + `padding-bottom:${navBarExtendHeight}px`, + ].join(";"); + let navBarLeft = []; + if ((back && !home) || (!back && home)) { + navBarLeft = [`width:${capsulePosition.width}px`, `height:${capsulePosition.height}px`].join(";"); + } else if ((back && home) || title) { + navBarLeft = [ + `width:${capsulePosition.width}px`, + `height:${capsulePosition.height}px`, + `margin-left:${rightDistance}px`, + ].join(";"); + } else { + navBarLeft = [`width:auto`, `margin-left:0px`].join(";"); + } + if (life === "created") { + this.data = { + navigationbarinnerStyle, + navBarLeft, + navBarHeight, + capsulePosition, + navBarExtendHeight, + ios, + }; + } else { + this.setData({ + navigationbarinnerStyle, + navBarLeft, + navBarHeight, + capsulePosition, + navBarExtendHeight, + ios, + }); + } + }, + _showChange: function (value) { + this.setStyle(); + }, + // 返回事件 + back: function () { + let pages = getCurrentPages(); + if (app.globalData.backPage) { + wx.reLaunch({ + url: app.globalData.backPage, + }); + app.globalData.backPage = null; + return; + } + if (!pages[pages.length - 2] && !app.globalData.anyWhere) { + wx.reLaunch({ + url: "/pages/index/index", + }); + return; + } + this.triggerEvent("back", { delta: this.data.delta }); + }, + home: function () { + wx.reLaunch({ + url: "/pages/start/index", + }); + }, + search: function () { + this.triggerEvent("search", {}); + }, + getSystemInfo() { + var app = getApp(); + if (app.globalSystemInfo && !app.globalSystemInfo.ios) { + return app.globalSystemInfo; + } else { + let systemInfo = wx.getSystemInfoSync(); + let ios = !!(systemInfo.system.toLowerCase().search("ios") + 1); + let rect; + try { + rect = wx.getMenuButtonBoundingClientRect ? wx.getMenuButtonBoundingClientRect() : null; + if (rect === null) { + throw "getMenuButtonBoundingClientRect error"; + } + //取值为0的情况 有可能width不为0 top为0的情况 + if (!rect.width || !rect.top || !rect.left || !rect.height) { + throw "getMenuButtonBoundingClientRect error"; + } + } catch (error) { + let gap = ""; //胶囊按钮上下间距 使导航内容居中 + let width = 96; //胶囊的宽度 + if (systemInfo.platform === "android") { + gap = 8; + width = 96; + } else if (systemInfo.platform === "devtools") { + if (ios) { + gap = 5.5; //开发工具中ios手机 + } else { + gap = 7.5; //开发工具中android和其它手机 + } + } else { + gap = 4; + width = 88; + } + if (!systemInfo.statusBarHeight) { + //开启wifi的情况下修复statusBarHeight值获取不到 + systemInfo.statusBarHeight = systemInfo.screenHeight - systemInfo.windowHeight - 20; + } + rect = { + //获取不到胶囊信息就自定义重置一个 + bottom: systemInfo.statusBarHeight + gap + 32, + height: 32, + left: systemInfo.windowWidth - width - 10, + right: systemInfo.windowWidth - 10, + top: systemInfo.statusBarHeight + gap, + width: width, + }; + console.log("error", error); + console.log("rect", rect); + } + + let navBarHeight = ""; + if (!systemInfo.statusBarHeight) { + systemInfo.statusBarHeight = systemInfo.screenHeight - systemInfo.windowHeight - 20; + navBarHeight = (function () { + let gap = rect.top - systemInfo.statusBarHeight; + return 2 * gap + rect.height; + })(); + + systemInfo.statusBarHeight = 0; + systemInfo.navBarExtendHeight = 0; //下方扩展4像素高度 防止下方边距太小 + } else { + navBarHeight = (function () { + let gap = rect.top - systemInfo.statusBarHeight; + return systemInfo.statusBarHeight + 2 * gap + rect.height; + })(); + if (ios) { + systemInfo.navBarExtendHeight = 4; //下方扩展4像素高度 防止下方边距太小 + } else { + systemInfo.navBarExtendHeight = 0; + } + } + systemInfo.navBarHeight = navBarHeight; //导航栏高度不包括statusBarHeight + systemInfo.capsulePosition = rect; //右上角胶囊按钮信息bottom: 58 height: 32 left: 317 right: 404 top: 26 width: 87 目前发现在大多机型都是固定值 为防止不一样所以会使用动态值来计算nav元素大小 + systemInfo.ios = ios; //是否ios + + app.globalSystemInfo = systemInfo; //将信息保存到全局变量中,后边再用就不用重新异步获取了 + + //console.log('systemInfo', systemInfo); + return systemInfo; + } + }, + }, +}); diff --git a/src/components/navBar/navBar.json b/src/components/navBar/navBar.json new file mode 100644 index 0000000..a89ef4d --- /dev/null +++ b/src/components/navBar/navBar.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} diff --git a/src/components/navBar/navBar.scss b/src/components/navBar/navBar.scss new file mode 100644 index 0000000..0eb85a4 --- /dev/null +++ b/src/components/navBar/navBar.scss @@ -0,0 +1,185 @@ +page { + --height: 44px; /* 4*2+32 */ + --right: 40px; /* 10+87 */ + --navBarExtendHeight: 4px; + box-sizing: border-box; +} + +.lxy-nav-bar { + view, + text, + scroll-view, + input, + button, + image, + cover-view { + box-sizing: border-box; + } +} + +.lxy-nav-bar_fixed { + position: fixed; + top: 0; + z-index: 1000; +} + +.lxy-nav-bar .ios { + --height: 44px; /* 4*2+32 */ + --right: 40px; /* 10+87 */ + --navBarExtendHeight: 4px; + box-sizing: border-box; +} +.lxy-nav-bar .android { + --height: 48px; /* 8*2+32 */ + --right: 40px; /* 10+87 */ + --navBarExtendHeight: 4px; + box-sizing: border-box; +} +.lxy-nav-bar .devtools { + --height: 42px; /* 5*2+32 */ + --right: 40px; /* 10+87 */ + --navBarExtendHeight: 4px; + box-sizing: border-box; +} +.lxy-nav-bar__inner { + position: fixed; + top: 0; + left: 0; + z-index: 5001; + height: var(--height); + display: flex; + align-items: center; + padding-right: var(--right); + width: 100%; + padding-bottom: var(--navBarExtendHeight); +} +.lxy-nav-bar__inner .lxy-nav-bar__left { + position: relative; + width: var(--right); + height: 32px; + /* padding-left: 10px; */ + display: flex; + align-items: center; +} +.lxy-nav-bar__buttons { + height: 100%; + width: 100%; + display: flex; + align-items: center; + border-radius: 16px; + border: 1rpx solid rgba(204, 204, 204, 0.6); + position: relative; +} +.lxy-nav-bar__buttons.android { + border: 1rpx solid rgba(234, 234, 234, 0.6); +} +.lxy-nav-bar__buttons::after { + position: absolute; + content: ""; + width: 1rpx; + height: 18.4px; + background: rgba(204, 204, 204, 0.6); + left: 50%; + top: 50%; + transform: translate(-50%, -50%); +} +.lxy-nav-bar__buttons.android::after { + background: rgba(234, 234, 234, 0.6); +} +.lxy-nav-bar__button { + width: 100%; + height: 100%; + display: flex; + font-size: 12px; + background-repeat: no-repeat; + background-position: center center; + background-size: 1em 2em; +} + +.lxy-nav-bar__inner .lxy-nav-bar__left .lxy-nav-bar__btn_goback:active, +.lxy-nav-bar__inner .lxy-nav-bar__left .lxy-nav-bar__btn_gohome:active { + opacity: 0.5; +} +.lxy-nav-bar__inner .lxy-nav-bar__center { + font-size: 17px; + line-height: 17px; + text-align: center; + position: relative; + flex: 1; + display: -webkit-box; + display: -webkit-flex; + display: flex; + align-items: center; + justify-content: center; + padding-left: 10px; +} +.lxy-nav-bar__inner .lxy-nav-bar__center .lxy-nav-bar__center-title { + margin-top: -2px; + font-weight: bold; + white-space: nowrap; +} +.lxy-nav-bar__inner .lxy-nav-bar__loading { + font-size: 0; +} +.lxy-nav-bar__inner .lxy-nav-bar__loading .lxy-loading { + margin-left: 0; +} +.lxy-nav-bar__inner .lxy-nav-bar__right { + margin-right: 10px; +} +.lxy-nav-bar__placeholder { + height: var(--height); + background: #f8f8f8; + position: relative; + z-index: 50; +} + +.lxy-nav-bar-search { + width: 100%; + height: 100%; + display: flex; + justify-content: center; + align-items: center; + width: 100%; + height: 32px; + border-radius: 16px; + position: relative; + background: #f6f6f6; +} + +.lxy-nav-bar-search__input { + height: 100%; + display: flex; + align-items: center; + color: #999; + font-size: 15px; + line-height: 15px; +} +.lxy-nav-bar__inner .lxy-nav-bar__left .lxy-nav-bar__btn_goback { + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z'/%3E%3C/svg%3E"); + background-position: 30rpx center; +} +.lxy-nav-bar__inner .lxy-nav-bar__left .lxy-nav-bar__btn_goback.nuohe { + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z'/%3E%3C/svg%3E"); +} +.lxy-nav-bar__inner .lxy-nav-bar__left .lxy-nav-bar__btn_goback.white { + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z' fill='%23ffffff'/%3E%3C/svg%3E"); +} +.lxy-nav-bar__inner .lxy-nav-bar__left .lxy-nav-bar__btn_gohome { + background-image: url("data:image/svg+xml,%3Csvg t='1565752242401' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='4326' width='48' height='48'%3E%3Cpath d='M931.148 451.25L591.505 97.654c-21.106-21.953-49.313-34.034-79.551-34.034-30.235 0-58.448 12.081-79.554 34.034L92.76 451.25c-35.049 36.498-30.536 68.044-24.742 81.222 4.13 9.35 18.07 35.05 58.231 35.05h49.78v272.016c0 61.756 44.342 119.906 107.357 119.906h144.587v-287.87c0-30.866-4.675-48.062 26.848-48.062h114.268c31.52 0 26.845 17.196 26.845 48.061v287.872h144.588c63.013 0 107.358-58.15 107.358-119.906V567.523h49.782c40.16 0 54.1-25.7 58.229-35.05 5.793-13.18 10.306-44.726-24.743-81.224z m-33.486 60.28h-105.77v328.007c0 30.865-19.877 63.917-51.37 63.917h-88.6V671.572c0-61.761-19.79-104.05-82.832-104.05H454.821c-63.045 0-82.836 42.289-82.836 104.05v231.883h-88.599c-31.495 0-51.37-33.052-51.37-63.917V511.529H126.25c-0.984 0-1.888-3.852-2.708-3.907 1.94-3.388 5.276-11.975 10.825-17.743l339.671-353.35c10.142-10.578 24.467-17.057 38.353-16.924 13.888-0.133 27.342 6.346 37.483 16.923L889.54 489.88c5.549 5.768 8.885 14.355 10.825 17.743-0.818 0.055-1.72 3.907-2.704 3.907z' fill='%23000000' p-id='4327'%3E%3C/path%3E%3C/svg%3E"); + background-size: 22px 22px; +} +.lxy-nav-bar__inner .lxy-nav-bar__left .lxy-nav-bar__btn_gohome.white { + background-image: url("data:image/svg+xml,%3Csvg t='1565752242401' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='4326' width='48' height='48'%3E%3Cpath d='M931.148 451.25L591.505 97.654c-21.106-21.953-49.313-34.034-79.551-34.034-30.235 0-58.448 12.081-79.554 34.034L92.76 451.25c-35.049 36.498-30.536 68.044-24.742 81.222 4.13 9.35 18.07 35.05 58.231 35.05h49.78v272.016c0 61.756 44.342 119.906 107.357 119.906h144.587v-287.87c0-30.866-4.675-48.062 26.848-48.062h114.268c31.52 0 26.845 17.196 26.845 48.061v287.872h144.588c63.013 0 107.358-58.15 107.358-119.906V567.523h49.782c40.16 0 54.1-25.7 58.229-35.05 5.793-13.18 10.306-44.726-24.743-81.224z m-33.486 60.28h-105.77v328.007c0 30.865-19.877 63.917-51.37 63.917h-88.6V671.572c0-61.761-19.79-104.05-82.832-104.05H454.821c-63.045 0-82.836 42.289-82.836 104.05v231.883h-88.599c-31.495 0-51.37-33.052-51.37-63.917V511.529H126.25c-0.984 0-1.888-3.852-2.708-3.907 1.94-3.388 5.276-11.975 10.825-17.743l339.671-353.35c10.142-10.578 24.467-17.057 38.353-16.924 13.888-0.133 27.342 6.346 37.483 16.923L889.54 489.88c5.549 5.768 8.885 14.355 10.825 17.743-0.818 0.055-1.72 3.907-2.704 3.907z' fill='%23ffffff' p-id='4327'%3E%3C/path%3E%3C/svg%3E"); + background-size: 22px 22px; +} +.lxy-nav-bar-search__icon { + width: 22px; + height: 22px; + display: flex; + align-items: center; + justify-content: center; + background-image: url("data:image/svg+xml,%3Csvg t='1565691512239' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='1240' width='48' height='48'%3E%3Cpath d='M819.2 798.254545L674.909091 653.963636c46.545455-48.872727 74.472727-114.036364 74.472727-186.181818 0-151.272727-123.345455-274.618182-274.618182-274.618182-151.272727 0-274.618182 123.345455-274.618181 274.618182 0 151.272727 123.345455 274.618182 274.618181 274.618182 65.163636 0 128-23.272727 174.545455-62.836364l144.290909 144.290909c2.327273 2.327273 6.981818 4.654545 11.636364 4.654546s9.309091-2.327273 11.636363-4.654546c6.981818-6.981818 6.981818-18.618182 2.327273-25.6zM235.054545 467.781818c0-132.654545 107.054545-239.709091 239.709091-239.709091 132.654545 0 239.709091 107.054545 239.709091 239.709091 0 132.654545-107.054545 239.709091-239.709091 239.709091-132.654545 0-239.709091-107.054545-239.709091-239.709091z' fill='%23999999' p-id='1241'%3E%3C/path%3E%3C/svg%3E"); + background-repeat: no-repeat; + background-size: cover; +} diff --git a/src/components/navBar/navBar.wxml b/src/components/navBar/navBar.wxml new file mode 100644 index 0000000..6010110 --- /dev/null +++ b/src/components/navBar/navBar.wxml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + {{title}} + + + + + + + + + + diff --git a/src/components/pageNavbar/index.json b/src/components/pageNavbar/index.json new file mode 100644 index 0000000..cbc30f3 --- /dev/null +++ b/src/components/pageNavbar/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": { + "van-nav-bar": "@vant/weapp/nav-bar/index", + "van-icon": "@vant/weapp/icon/index" + } +} diff --git a/src/components/pageNavbar/index.scss b/src/components/pageNavbar/index.scss new file mode 100644 index 0000000..8096c10 --- /dev/null +++ b/src/components/pageNavbar/index.scss @@ -0,0 +1,16 @@ +.navbar { + padding: 0 20rpx 0 0; + display: flex; + align-items: center; + .back-icon { + margin-right: 40rpx; + } + .nav-img { + width: 356rpx; + height: 46rpx; + } + .drug-nav-img { + width: 199rpx; + height: 36rpx; + } +} diff --git a/src/components/pageNavbar/index.ts b/src/components/pageNavbar/index.ts new file mode 100644 index 0000000..aea3e23 --- /dev/null +++ b/src/components/pageNavbar/index.ts @@ -0,0 +1,23 @@ +const app = getApp(); + +Component({ + properties: { + back: { + type: Boolean, + value: false, + }, + drug: { + type: Boolean, + value: false, + }, + }, + data: { + imageUrl: app.globalData.imageUrl, + Timestamp: app.globalData.Timestamp, + }, + methods: { + handleBack() { + wx.navigateBack(); + }, + }, +}); diff --git a/src/components/pageNavbar/index.wxml b/src/components/pageNavbar/index.wxml new file mode 100644 index 0000000..863c010 --- /dev/null +++ b/src/components/pageNavbar/index.wxml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/components/pagination/index.js b/src/components/pagination/index.js new file mode 100644 index 0000000..a106770 --- /dev/null +++ b/src/components/pagination/index.js @@ -0,0 +1,28 @@ +const app = getApp() + +Component({ + properties: { + pagination: { + type: Object, + value() { + return {} + }, + }, + customEmpty: { + type: Boolean, + value: false, + }, + emptyTitle: { + type: String, + value: '', + }, + }, + data: { + imageUrl: app.globalData.imageUrl, + }, + methods: { + handleTouchmove() { + return false + }, + }, +}) diff --git a/src/components/pagination/index.json b/src/components/pagination/index.json new file mode 100644 index 0000000..24029b0 --- /dev/null +++ b/src/components/pagination/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-divider": "@vant/weapp/divider/index" + } +} diff --git a/src/components/pagination/index.scss b/src/components/pagination/index.scss new file mode 100644 index 0000000..f91c1fa --- /dev/null +++ b/src/components/pagination/index.scss @@ -0,0 +1,11 @@ +/* components/pagination/index.wxss */ +.none { + display: block; + margin: 30rpx auto; + width: 80%; +} +.empty-title { + text-align: center; + font-size: 32rpx; + color: #b0b0b0; +} diff --git a/src/components/pagination/index.wxml b/src/components/pagination/index.wxml new file mode 100644 index 0000000..41ac37e --- /dev/null +++ b/src/components/pagination/index.wxml @@ -0,0 +1,12 @@ + + + + + {{emptyTitle}} + + + + + 加载中... + +没有更多了 diff --git a/src/components/pickerArea/index.json b/src/components/pickerArea/index.json new file mode 100644 index 0000000..cf286db --- /dev/null +++ b/src/components/pickerArea/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": { + "van-popup": "@vant/weapp/popup/index", + "van-icon": "@vant/weapp/icon/index" + } +} diff --git a/src/components/pickerArea/index.scss b/src/components/pickerArea/index.scss new file mode 100644 index 0000000..ef037ef --- /dev/null +++ b/src/components/pickerArea/index.scss @@ -0,0 +1,144 @@ +.aside-share { + position: fixed; + right: 22rpx; + bottom: 120rpx; + width: 136rpx; + height: 136rpx; +} + +.popup { + position: relative; + background-color: #fff; + .close { + position: absolute; + top: 52rpx; + right: 32rpx; + color: rgba(72, 72, 72, 1); + font-size: 34rpx; + } + .p-header { + padding: 46rpx 30rpx 0; + .title { + text-align: center; + font-size: 36rpx; + color: rgba(72, 72, 72, 1); + font-weight: bold; + } + .tip { + text-align: center; + margin-top: 16rpx; + font-size: 32rpx; + color: rgba(72, 72, 72, 1); + } + .area { + margin-top: 48rpx; + display: flex; + align-items: center; + justify-content: space-between; + gap: 14rpx; + .item { + flex: 1; + padding: 18rpx 30rpx; + box-shadow: 0rpx 4rpx 12rpx 0rpx rgba(0, 0, 0, 0.11); + border-radius: 12rpx 12rpx 12rpx 12rpx; + border: 2rpx solid var(--color); + display: flex; + align-items: center; + justify-content: space-between; + .content { + font-size: 32rpx; + color: rgba(72, 72, 72, 1); + max-width: 5em; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } + .icon { + width: 32rpx; + height: 32rpx; + } + .tril { + margin-top: 5rpx; + width: 0; + height: 0; + border-style: solid; + border-width: 12rpx 12rpx 0 12rpx; + border-color: var(--color) transparent transparent transparent; + } + } + .picker { + flex: 1; + } + .btn { + width: 126rpx; + height: 76rpx; + font-size: 32rpx; + color: rgba(255, 255, 255, 1); + display: flex; + align-items: center; + justify-content: center; + background: var(--color); + border-radius: 12rpx 12rpx 12rpx 12rpx; + } + } + } + .select { + margin-top: 44rpx; + padding: 0 30rpx 0; + display: grid; + grid-template-columns: repeat(auto-fit, 68rpx); + gap: 26rpx 20rpx; + .s-item { + width: 68rpx; + height: 68rpx; + text-align: center; + line-height: 68rpx; + font-size: 28rpx; + color: rgba(158, 158, 158, 1); + border-radius: 50%; + background: #f7f8f9; + &.active { + color: #fff; + background-color: var(--color); + } + } + } + .scroll { + padding: 0 30rpx; + height: 45vh; + box-sizing: border-box; + .item { + padding: 32rpx 0; + font-size: 28rpx; + color: rgba(72, 72, 72, 1); + border-bottom: 2px solid #fbfbfb; + display: flex; + align-items: center; + justify-content: space-between; + .word { + margin-right: 24rpx; + display: inline-block; + width: 1em; + color: rgba(158, 158, 158, 1); + } + .icon { + width: 36rpx; + height: 36rpx; + } + &.active { + color: var(--color); + .word { + color: var(--color); + } + } + } + } +} + +.theme1 { + --color: rgba(224, 71, 117, 1); +} + +.theme2 { + --color: #67baca; +} diff --git a/src/components/pickerArea/index.ts b/src/components/pickerArea/index.ts new file mode 100644 index 0000000..1bb1e4f --- /dev/null +++ b/src/components/pickerArea/index.ts @@ -0,0 +1,325 @@ +const app = getApp() + +Component({ + properties: { + // 省份名称 + pname: { + type: String, + value: '', + }, + // 省份ID + pid: { + type: String, + value: '', + }, + // 城市名称 + cname: { + type: String, + value: '', + }, + // 城市ID + cid: { + type: String, + value: '', + }, + theme: { + type: String, + value: 'theme1', + }, + }, + observers: { + show(newVal: boolean) { + this.triggerEvent('show', newVal) + }, + }, + data: { + show: false, + word: '', + imageUrl: app.globalData.imageUrl, + Timestamp: app.globalData.Timestamp, + + active: 0, + ProvinceName: '', + ProvinceId: '', + CityName: '', + CityId: '', + proList: { + A: [ + { + name: '安徽省', + code: '340000', + }, + { + name: '澳门特别行政区', + code: '820000', + }, + ], + B: [ + { + name: '北京市', + code: '110000', + }, + ], + C: [ + { + name: '重庆市', + code: '500000', + }, + ], + F: [ + { + name: '福建省', + code: '350000', + }, + ], + G: [ + { + name: '甘肃省', + code: '620000', + }, + { + name: '广东省', + code: '440000', + }, + { + name: '广西壮族自治区', + code: '450000', + }, + { + name: '贵州省', + code: '520000', + }, + ], + H: [ + { + name: '海南省', + code: '460000', + }, + { + name: '河北省', + code: '130000', + }, + { + name: '河南省', + code: '410000', + }, + { + name: '黑龙江省', + code: '230000', + }, + { + name: '湖北省', + code: '420000', + }, + { + name: '湖南省', + code: '430000', + }, + ], + J: [ + { + name: '吉林省', + code: '220000', + }, + { + name: '江苏省', + code: '320000', + }, + { + name: '江西省', + code: '360000', + }, + ], + L: [ + { + name: '辽宁省', + code: '210000', + }, + ], + N: [ + { + name: '宁夏回族自治区', + code: '640000', + }, + { + name: '内蒙古自治区', + code: '150000', + }, + ], + Q: [ + { + name: '青海省', + code: '630000', + }, + ], + S: [ + { + name: '山东省', + code: '370000', + }, + { + name: '山西省', + code: '140000', + }, + { + name: '陕西省', + code: '610000', + }, + { + name: '上海市', + code: '310000', + }, + { + name: '四川省', + code: '510000', + }, + ], + T: [ + { + name: '天津市', + code: '120000', + }, + { + name: '台湾省', + code: '710000', + }, + ], + X: [ + { + name: '西藏自治区', + code: '540000', + }, + { + name: '新疆维吾尔自治区', + code: '650000', + }, + { + name: '香港特别行政区', + code: '810000', + }, + ], + Y: [ + { + name: '云南省', + code: '530000', + }, + ], + Z: [ + { + name: '浙江省', + code: '330000', + }, + ], + }, + area: [] as any, + range: [], + + scrollIntoView0: '', + scrollIntoView1: '', + }, + methods: { + handleShow() { + let { active, pid } = this.data + if (!pid) { + active = 0 + } + this.setData({ + show: true, + ProvinceName: this.data.pname || '', + ProvinceId: this.data.pid || '', + CityName: this.data.cname || '', + CityId: this.data.cid || '', + + scrollIntoView0: this.data.pid || '', + scrollIntoView1: this.data.cid || '', + active, + }) + this.getArea() + }, + getArea() { + if (this.data.area.length) { + this.getRangeList() + return + } + wx.ajax({ + method: 'GET', + url: '/js/area.json', + isJSON: true, + }).then((res) => { + this.setData({ + area: res, + }) + this.getRangeList() + }) + }, + handleItem(e: any) { + const { code, name } = e.currentTarget.dataset + this.setData({ + ProvinceId: code, + ProvinceName: name, + CityId: '', + CityName: '', + }) + this.getRangeList() + }, + handleChangeCity(e: any) { + const { code, name } = e.currentTarget.dataset + this.setData({ + CityId: code, + CityName: name, + }) + }, + handleShare() { + this.setData({ + show: false, + }) + this.triggerEvent('ok', { + ProvinceName: this.data.ProvinceName, + ProvinceId: this.data.ProvinceId, + CityName: this.data.CityName, + CityId: this.data.CityId, + }) + }, + handleSelect(e) { + const { id } = e.currentTarget.dataset + this.setData({ + word: id, + scrollIntoView0: id, + }) + }, + getRangeList() { + const { area, ProvinceId } = this.data + if (!ProvinceId) return + const range = area.filter((item: any) => item.value == ProvinceId)[0].children + this.setData({ + range, + active: 1, + scrollIntoView0: '', + scrollIntoView1: `id${this.data.CityId}`, + }) + }, + handleProvince() { + this.setData({ + active: 0, + scrollIntoView0: this.data.word || `id${this.data.ProvinceId}`, + scrollIntoView1: '', + }) + }, + handleCity() { + const { ProvinceId } = this.data + if (!ProvinceId) { + wx.showToast({ + title: '请先选择省份', + icon: 'none', + }) + return + } + this.getRangeList() + }, + handleClose() { + this.setData({ + show: false, + }) + }, + }, +}) diff --git a/src/components/pickerArea/index.wxml b/src/components/pickerArea/index.wxml new file mode 100644 index 0000000..c5b3a53 --- /dev/null +++ b/src/components/pickerArea/index.wxml @@ -0,0 +1,87 @@ + + + + + + + 选您地区 + + + + {{ProvinceName || '请选择省份'}} + + + + {{CityName || '请选择城市'}} + + + 确定 + + + + + + {{item.label}} + + + + + + + + {{index}} + + + + + + + + + {{index===0 ? key : ''}} + {{item.name}} + + + + + + + + + diff --git a/src/components/referralFrom/index.json b/src/components/referralFrom/index.json new file mode 100644 index 0000000..074f50b --- /dev/null +++ b/src/components/referralFrom/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-popup": "@vant/weapp/popup/index" + } +} diff --git a/src/components/referralFrom/index.scss b/src/components/referralFrom/index.scss new file mode 100644 index 0000000..9561175 --- /dev/null +++ b/src/components/referralFrom/index.scss @@ -0,0 +1,95 @@ +.from { + padding: 48rpx 40rpx; + width: 650rpx; + box-sizing: border-box; + background: linear-gradient(349deg, #ffffff 0%, #e2f1f4 100%); + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2rpx solid #ffffff; + .title { + font-size: 32rpx; + color: #283031; + font-weight: bold; + } + .date { + margin-top: 24rpx; + padding: 14rpx 32rpx; + display: flex; + align-items: center; + justify-content: space-between; + background-color: #f2f4f5; + border-radius: 16rpx; + + .conetent { + font-size: 32rpx; + color: #283031; + } + .tril { + width: 0; + height: 0; + border-style: solid; + border-width: 10rpx 10rpx 0 10rpx; + border-color: #aeb3b4 transparent transparent transparent; + } + } + .select-title { + margin-top: 48rpx; + font-size: 32rpx; + color: #283031; + font-weight: bold; + .sub { + font-weight: normal; + } + } + .list { + margin-top: 26rpx; + max-height: 55vh; + overflow-y: auto; + &::-webkit-scrollbar{ + display: none; + } + .item { + margin-bottom: 16rpx; + padding: 14rpx 32rpx; + font-size: 32rpx; + color: #283031; + line-height: 48rpx; + background-color: #f2f4f5; + border: 1px solid #f2f4f5; + border-radius: 16rpx; + &.active { + border-color: #67baca; + background-color: #e7f5f8; + color: #67baca; + } + } + } + .footer { + margin-top: 32rpx; + display: flex; + justify-content: space-between; + align-items: center; + gap: 26rpx; + text-align: center; + .cancel { + flex: 1; + height: 80rpx; + font-size: 36rpx; + color: #67BACA; + line-height: 80rpx; + background: #ffffff; + border-radius: 98rpx 98rpx 98rpx 98rpx; + border: 2rpx solid #67baca; + } + + .submit { + flex: 1; + height: 80rpx; + font-size: 36rpx; + color: #FFFFFF; + line-height: 80rpx; + background: #67baca; + border-radius: 98rpx 98rpx 98rpx 98rpx; + border: 2rpx solid #67baca; + } + } +} diff --git a/src/components/referralFrom/index.ts b/src/components/referralFrom/index.ts new file mode 100644 index 0000000..16ff776 --- /dev/null +++ b/src/components/referralFrom/index.ts @@ -0,0 +1,139 @@ +import dayjs from 'dayjs' + +const _app = getApp() + +// pages/story/a.ts +Component({ + /** + * 组件的属性列表 + */ + properties: { + show: { + type: Boolean, + value: false, + }, + params: { + type: Object, + value: undefined, + }, + }, + + observers: { + show() { + if (this.data.params) { + this.setData({ + ...this.data.params, + }) + this.handleDateChange() + } else { + this.setData({ + visitDateName: '', + visitDate: '', + hormone: 2, + traditionalInhibitor: 2, + gammaGlobulin: 2, + plasmaExchange: 2, + bCellInhibitor: 2, + fcRnAntagonists: 2, + c5ComplementInhibitor: 2, + chineseMedicine: 2, + other: 2, + recordId: '', + }) + } + }, + }, + data: { + currentDate: dayjs().format('YYYY-MM-DD'), + + visitDateName: '', + visitDate: '', + hormone: 2, + traditionalInhibitor: 2, + gammaGlobulin: 2, + plasmaExchange: 2, + bCellInhibitor: 2, + fcRnAntagonists: 2, + c5ComplementInhibitor: 2, + chineseMedicine: 2, + other: 2, + recordId: '', + }, + + methods: { + handleDateChange() { + this.setData({ + visitDateName: dayjs(this.data.visitDate).format('YYYY年MM月DD日'), + }) + }, + handleSelect(e) { + const { name } = e.currentTarget.dataset + const value = this.data[name] + this.setData({ + [name]: value === 2 ? 1 : 2, + }) + }, + submit() { + const { visitDate, recordId } = this.data + const params = { + visitDate, + recordId, + } + if(!visitDate){ + wx.showToast({ + title: '请选择复诊日期', + icon: 'none', + }) + return + } + const selectKeys = [ + 'hormone', + 'traditionalInhibitor', + 'gammaGlobulin', + 'plasmaExchange', + 'bCellInhibitor', + 'fcRnAntagonists', + 'c5ComplementInhibitor', + 'chineseMedicine', + 'other', + ] + selectKeys.forEach((item) => { + params[item] = this.data[item] + }) + const onlySelect = selectKeys.some((item) => { + return this.data[item] === 1 + }) + if (!onlySelect) { + wx.showToast({ + title: '请至少选择一种复诊后的方案', + icon: 'none', + }) + return + } + wx.ajax({ + method: 'POST', + url: '?r=igg4/re-visit/save-record', + data: params, + }).then(() => { + if (recordId) { + wx.showToast({ + icon: 'none', + title: '编辑成功', + }) + } else { + wx.showToast({ + icon: 'none', + title: '添加成功', + }) + } + this.handleCancel() + this.triggerEvent('refresh', params) + }) + }, + handleCancel() { + this.setData({ + show: false, + }) + }, + }, +}) diff --git a/src/components/referralFrom/index.wxml b/src/components/referralFrom/index.wxml new file mode 100644 index 0000000..0bc0b42 --- /dev/null +++ b/src/components/referralFrom/index.wxml @@ -0,0 +1,52 @@ + + + 您上一次复诊时间? + + + {{visitDateName||'请选择'}} + + + + + 您复诊后的方案是? + (多选) + + + 1.激素 + + 2.传统免疫抑制剂(如他克莫司、吗 替麦考酚酯等) + + + 3.静脉输注丙种球蛋白 + + + 4.血浆置换 + + + 5.B细胞抑制剂(如:利妥昔单抗、泰 它西普、伊奈利珠单抗) + + + 6.FcRn拮抗剂(如:艾加莫德) + + + 7.C5补体抑制剂(如:依库珠单抗) + + + 8.中药或中成药 + + 9.其他 + + + 取消 + 确定 + + + diff --git a/src/components/star/index.json b/src/components/star/index.json new file mode 100644 index 0000000..a89ef4d --- /dev/null +++ b/src/components/star/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} diff --git a/src/components/star/index.scss b/src/components/star/index.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/components/star/index.ts b/src/components/star/index.ts new file mode 100644 index 0000000..427bee1 --- /dev/null +++ b/src/components/star/index.ts @@ -0,0 +1,204 @@ +const app = getApp(); +/** + * >=min && <=max + * @param min + * @param max + */ +function getRandom(min, max) { + return min + Math.floor(Math.random() * (max - min + 1)); +} +Component({ + options: {}, + lifetimes: { + attached() { + const query = wx.createSelectorQuery().in(this); + query + .select("#thumsCanvas") + .fields({ node: true, size: true }) + .exec((res) => { + const canvas = res[0].node; + const context = canvas.getContext("2d"); + this.setData({ + context: context, + }); + + const dpr = wx.getSystemInfoSync().pixelRatio; + canvas.width = res[0].width * dpr; + canvas.height = res[0].height * dpr; + this.data.width = res[0].width * dpr; + this.data.height = res[0].height * dpr; + // context.fillStyle = "rgba(255, 255, 255, 0)"; + const images = [ + "star/icon1.png", + "star/icon2.png", + "star/icon3.png", + "star/icon4.png", + "star/icon5.png", + "star/icon6.png", + "star/icon7.png", + "star/icon8.png", + ]; + const promiseAll = [] as Array>; + images.forEach((src) => { + const p = new Promise(function (resolve) { + const img = canvas.createImage(); + img.onerror = img.onload = resolve.bind(null, img); + img.src = app.globalData.imageUrl + src; + }); + promiseAll.push(p); + }); + Promise.all(promiseAll).then((imgsList) => { + const imgsLists = imgsList.filter((d) => { + if (d && d.width > 0) return true; + return false; + }); + this.setData({ + imgsList: imgsLists, + }); + if (this.data.imgsList.length == 0) { + // logger.error("imgsList load all error"); + wx.showToast({ + icon: "none", + title: "imgsList load all error", + }); + return; + } + }); + }); + }, + }, + properties: {}, + data: { + imgsList: [] as WechatMiniprogram.ImageData[], + width: 0, + height: 0, + context: null as any, + scanning: false, + renderList: [], + scaleTime: 0.1, // 百分比 + }, + methods: { + handleTap() { + this.start(); + }, + createRender() { + if (this.data.imgsList.length == 0) return null; + const basicScale = [0.6, 0.9, 1.2][getRandom(0, 2)]; + + const getScale = (diffTime) => { + if (diffTime < this.data.scaleTime) { + return +(diffTime / this.data.scaleTime).toFixed(2) * basicScale; + } else { + return basicScale; + } + }; + const context = this.data.context; + // 随机读取一个图片来渲染 + const image: any = this.data.imgsList[getRandom(0, this.data.imgsList.length - 1)]; + const offset = 20; + const basicX = this.data.width / 2 + getRandom(-offset, offset); + const angle = getRandom(2, 10); + let ratio = getRandom(10, 30) * (getRandom(0, 1) ? 1 : -1); + const getTranslateX = (diffTime) => { + if (diffTime < this.data.scaleTime) { + // 放大期间,不进行摇摆位移 + return basicX; + } else { + return basicX + ratio * Math.sin(angle * (diffTime - this.data.scaleTime)); + } + }; + + const getTranslateY = (diffTime) => { + return image.height / 2 + (this.data.height - image.height / 2) * (1 - diffTime); + }; + + const fadeOutStage = getRandom(14, 18) / 100; + const getAlpha = (diffTime) => { + let left = 1 - +diffTime; + if (left > fadeOutStage) { + return 1; + } else { + return 1 - +((fadeOutStage - left) / fadeOutStage).toFixed(2); + } + }; + + return (diffTime) => { + // 差值满了,即结束了 0 ---》 1 + if (diffTime >= 1) return true; + context.save(); + const scale = getScale(diffTime); + // const rotate = getRotate(); + const translateX = getTranslateX(diffTime); + const translateY = getTranslateY(diffTime); + context.translate(translateX, translateY); + context.scale(scale, scale); + // context.rotate(rotate * Math.PI / 180); + context.globalAlpha = getAlpha(diffTime); + context.drawImage(image, -image.width / 2, -image.height / 2, image.width, image.height); + context.restore(); + }; + }, + scan() { + this.data.context.clearRect(0, 0, this.data.width, this.data.height); + this.data.context.fillStyle = "rgba(255, 255, 255, 0)"; + this.data.context.fillRect(0, 0, 200, 400); + let index = 0; + let length = this.data.renderList.length; + if (length > 0) { + this.requestFrame(this.scan.bind(this)); + this.setData({ + scanning: true, + }); + } else { + this.setData({ + scanning: false, + }); + } + while (index < length) { + const child = this.data.renderList[index]; + if (!child || !child.render || child.render.call(null, (Date.now() - child.timestamp) / child.duration)) { + // 结束了,删除该动画 + this.setData({ + renderList: [...this.data.renderList].filter((_item, fIndex) => fIndex != index), + }); + length--; + } else { + // continue + index++; + } + } + }, + start() { + const render = this.createRender(); + const duration = getRandom(1500, 3000); + this.setData({ + renderList: [ + ...this.data.renderList, + { + render, + duration, + timestamp: Date.now(), + }, + ], + }); + + if (!this.data.scanning) { + this.setData({ + scanning: true, + }); + + this.requestFrame(this.scan.bind(this)); + // this.scan.bind(this)(); + } + return this; + }, + requestFrame(cb) { + return ( + this.data.context.requestAnimationFrame || + (function (callback) { + setTimeout(callback, 1000 / 60); + })(cb) + ); + }, + }, +}); diff --git a/src/components/star/index.wxml b/src/components/star/index.wxml new file mode 100644 index 0000000..e056d7b --- /dev/null +++ b/src/components/star/index.wxml @@ -0,0 +1 @@ + diff --git a/src/components/text-expandsion/index.json b/src/components/text-expandsion/index.json new file mode 100644 index 0000000..a89ef4d --- /dev/null +++ b/src/components/text-expandsion/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} diff --git a/src/components/text-expandsion/index.scss b/src/components/text-expandsion/index.scss new file mode 100644 index 0000000..3fa0914 --- /dev/null +++ b/src/components/text-expandsion/index.scss @@ -0,0 +1,62 @@ +.text-expansion { + display: flex; + &__text { + position: relative; + width: 100%; + font-size: 28rpx; + color: var(--color); + overflow: hidden; + line-height: 1.5; + max-height: 9em; + text-align: justify; + &::before { + content: ""; + float: right; + height: 100%; + margin-bottom: -40rpx; + } + &::after { + content: ""; + width: 100vw; + height: 100vh; + position: absolute; + box-shadow: inset calc(120rpx - 100vw) calc(1.45em - 100vh) 0 0 #fff; + margin-left: -120rpx; + } + } + &__button { + position: relative; + font-size: 24rpx; + font-weight: bold; + float: right; + clear: both; + line-height: 42rpx; + &::before { + content: "..."; + margin-right: 8rpx; + } + &::after { + content: ""; + display: inline-block; + margin-bottom: 2rpx; + margin-left: 4rpx; + transition: transform 0.3s; + border-top: 10rpx solid var(--color); + border-left: 8rpx solid transparent; + border-right: 8rpx solid transparent; + } + } +} + +.text-expansion__text--expand { + max-height: none; + &::after { + visibility: hidden; + } + .text-expansion__button::before { + visibility: hidden; + } + .text-expansion__button::after { + transform: rotate(180deg); + } +} diff --git a/src/components/text-expandsion/index.ts b/src/components/text-expandsion/index.ts new file mode 100644 index 0000000..7882886 --- /dev/null +++ b/src/components/text-expandsion/index.ts @@ -0,0 +1,34 @@ +Component({ + properties: { + text: { + type: String, + value: '', + }, + expandText: { + type: String, + value: '展开', + }, + collapseText: { + type: String, + value: '收起', + }, + color: { + type: String, + value: '#000', + }, + expendColor: { + type: String, + value: '#e04775', + }, + }, + data: { + isExpand: false, + }, + methods: { + onClick() { + this.setData({ + isExpand: !this.data.isExpand, + }) + }, + }, +}) diff --git a/src/components/text-expandsion/index.wxml b/src/components/text-expandsion/index.wxml new file mode 100644 index 0000000..fba81eb --- /dev/null +++ b/src/components/text-expandsion/index.wxml @@ -0,0 +1,6 @@ + + + {{ isExpand ? collapseText : expandText }} + {{ text }} + + diff --git a/src/components/timeOut/index.json b/src/components/timeOut/index.json new file mode 100644 index 0000000..a89ef4d --- /dev/null +++ b/src/components/timeOut/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} diff --git a/src/components/timeOut/index.scss b/src/components/timeOut/index.scss new file mode 100644 index 0000000..ce22160 --- /dev/null +++ b/src/components/timeOut/index.scss @@ -0,0 +1,154 @@ +.movearea { + position: fixed; + right: 0; + top: 100rpx; + height: calc(100vh - 200rpx); + width: 0; + .moveview { + position: relative; + width: 0; + height: 0; + .move-container { + perspective: 1000px; + position: absolute; + left: -20rpx; + top: 50%; + width: 112rpx; + height: 112rpx; + transform: translate(-100%, -50%); + .aside-out { + width: 100%; + height: 100%; + position: relative; + transition: 1.5s; + transition-timing-function: cubic-bezier(0.075, 0.82, 0.165, 1); + transform-style: preserve-3d; + transform-origin: center; + .front { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + .progress { + width: inherit; + height: inherit; + background: conic-gradient(#e04775 var(--progress), #fff 0%); + border-radius: 50%; + position: relative; + box-sizing: border-box; + box-shadow: + 0rpx 8rpx 18rpx 0rpx rgba(0, 0, 0, 0.12), + -6rpx 0rpx 18rpx 0rpx rgba(0, 0, 0, 0.09); + .progress-wrpa { + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + width: 92rpx; + height: 92rpx; + background-color: #fff; + border-radius: 50%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + .icon { + width: 56rpx; + height: 56rpx; + } + .content { + margin-top: -12rpx; + width: 68rpx; + height: 26rpx; + text-align: center; + line-height: 26rpx; + font-size: 20rpx; + color: #eaeded; + background: linear-gradient(180deg, #fddd39 0%, #f5ad1d 100%); + border-radius: 16rpx; + text-shadow: 0px 0px 6px #ba7000; + } + } + } + } + .back { + position: absolute; + width: 100%; + height: 100%; + background-color: darkseagreen; + transform: rotateY(180deg); + backface-visibility: hidden; + box-sizing: border-box; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + background-color: #fff; + border-radius: 50%; + // border: 7rpx solid #e04775; + .icon { + width: 56rpx; + height: 56rpx; + } + .sub-icon { + position: absolute; + top: 40rpx; + right: 16rpx; + width: 20rpx; + height: 20rpx; + } + .content { + margin-top: -12rpx; + width: 80rpx; + height: 26rpx; + text-align: center; + line-height: 26rpx; + font-size: 16rpx; + color: #eaeded; + background: linear-gradient(180deg, #fddd39 0%, #f5ad1d 100%); + border-radius: 16rpx; + text-shadow: 0px 0px 6px #ba7000; + } + } + &.perspective { + transform: rotateY(180deg); + .front { + .progress { + background: conic-gradient(#fff var(--progress), #fff 0%); + } + } + } + } + } + } +} + +.toast { + padding: 50rpx; + position: fixed; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + background-color: rgba(0, 0, 0, 0.74); + border-radius: 32rpx; + max-width: 80vw; + .icon { + display: block; + margin: 0 auto; + width: 80rpx; + height: 80rpx; + } + .content { + margin-top: 24rpx; + text-align: center; + font-size: 32rpx; + color: #ffffff; + .p { + white-space: nowrap; + } + .num { + color: #f5ad1d; + } + } +} diff --git a/src/components/timeOut/index.ts b/src/components/timeOut/index.ts new file mode 100644 index 0000000..a313c47 --- /dev/null +++ b/src/components/timeOut/index.ts @@ -0,0 +1,101 @@ +const app = getApp(); + +// pages/story/a.ts +Component({ + /** + * 组件的属性列表 + */ + properties: { + detailId: { + type: String, + value: "0", + }, + asideOut: { + type: Boolean, + value: false, + }, + asideType: { + type: String, + value: "", + }, + timeToast: { + type: Boolean, + value: false, + }, + timeToastType: { + type: String, + value: "", + }, + timeToastParams: { + type: Object, + value() { + return {}; + }, + }, + }, + observers: { + asideOut: function (asideOut) { + if (asideOut) { + setTimeout(() => { + this.countDown(); + }, 1000); + } + }, + }, + lifetimes: { + attached() { + let systemInfo = wx.getSystemInfoSync(); + this.setData({ + sliderTop: systemInfo.screenHeight - 250, + }); + }, + detached() { + if (this.timer) clearInterval(this.timer); + }, + }, + data: { + imageUrl: app.globalData.imageUrl, + Timestamp: app.globalData.Timestamp, + + rewardScore: 0, + + circleVal: 100, + centerVal: 9, + sliderTop: 450, + }, + methods: { + timer: null as any, + countDown() { + const that = this; + if (that.timer) return; + let circle = 100; + that.timer = setInterval(() => { + circle--; + that.setData({ + circleVal: circle, + centerVal: Math.floor(circle / 10), + }); + if (circle <= 0) { + clearInterval(that.timer); + this.handleAsideOut(); + } + }, 100); + }, + handleAsideOut() { + wx.ajax({ + method: "POST", + url: "?r=igg4/score/send-score", + data: { + Type: this.data.asideType, + Id: this.data.detailId, + }, + }).then((res) => { + if (!Array.isArray(res)) { + this.setData({ + rewardScore: res.rewardScore, + }); + } + }); + }, + }, +}); diff --git a/src/components/timeOut/index.wxml b/src/components/timeOut/index.wxml new file mode 100644 index 0000000..78dc0d7 --- /dev/null +++ b/src/components/timeOut/index.wxml @@ -0,0 +1,117 @@ + + + + + + + + + {{centerVal}}秒 + + + + + + + +{{rewardScore}}能量 + + + + + + + + + + 与病友同行 + 治病路上你不再孤独 + + +{{timeToastParams.rewardScore}} + 能量 + + + + 点赞,也是一种力量! + 愿你的每一天都充满阳光 + + +{{timeToastParams.rewardScore}} + 能量 + + + + 感谢您的分享 + 让我们一起传递爱与温暖 + + +{{timeToastParams.rewardScore}} + 能量 + + + + 今天又学到一个健康知识啦 + 掌握健康,从学习知识开始获得 + + +{{timeToastParams.rewardScore}} + 能量 + + + + 点赞,也是一种力量! + 愿你的每一天都充满阳光 + + +{{timeToastParams.rewardScore}} + 能量 + + + + 感谢您的分享 + 让我们一起传递知识与智慧 + + +{{timeToastParams.rewardScore}} + 能量 + + + + 收藏知识,构建属于你的知识库 + + +{{timeToastParams.rewardScore}} + 能量 + + + + 了解医保知识 享受健康保障 + + +{{timeToastParams.rewardScore}} + 能量 + + + + 今天又学到一个医保知识啦~ + 学习医保知识,为您的治疗减负 + + +{{timeToastParams.rewardScore}} + 能量 + + + + 使用就诊地图 + 为您的健康保驾护航 + + +{{timeToastParams.rewardScore}} + 能量 + + + + 今天又认识一个医院啦~ + 了解更多医院,让您的治疗更方便 + + +{{timeToastParams.rewardScore}} + 能量 + + + + + +{{timeToastParams.rewardScore}} + 能量 + + + diff --git a/src/components/toast/index.json b/src/components/toast/index.json new file mode 100644 index 0000000..7266f8c --- /dev/null +++ b/src/components/toast/index.json @@ -0,0 +1,9 @@ +{ + "component": true, + "usingComponents": { + "van-popup": "@vant/weapp/popup/index", + "mp-html": "mp-html", + "van-icon": "@vant/weapp/icon/index", + "van-checkbox": "@vant/weapp/checkbox/index" + } +} diff --git a/src/components/toast/index.scss b/src/components/toast/index.scss new file mode 100644 index 0000000..a0a2b94 --- /dev/null +++ b/src/components/toast/index.scss @@ -0,0 +1,2811 @@ +.row-close { + margin-top: 44rpx; + display: flex; + justify-content: center; +} + +.popup { + position: relative; + z-index: 9999999999; + .badge { + position: relative; + display: block; + margin: 0 auto 0; + width: 350rpx; + height: 350rpx; + z-index: 1; + } + + .popup-container { + margin-top: -200rpx; + width: 90vw; + border-radius: 24rpx; + padding: 164rpx 50rpx 62rpx; + box-sizing: border-box; + text-align: center; + background: linear-gradient(180deg, #82a4f7 0%, #fbfcff 30%, #ffffff 100%); + + .title { + margin-top: 38rpx; + font-size: 36rpx; + color: #3b4f98; + font-weight: bold; + } + + .content { + margin-top: 20rpx; + font-size: 32rpx; + color: #afb7cb; + line-height: 52rpx; + + .num { + color: #ee9d1f; + font-size: 48rpx; + font-weight: bold; + } + .beg { + .b-title { + font-size: 32rpx; + color: #ee9d1f; + } + } + .operate-one { + .o-title { + font-size: 32rpx; + color: #afb7cb; + .o-num { + font-size: 48rpx; + } + } + .o-content { + font-size: 40rpx; + color: #ee9d1f; + } + } + } + + .footer { + margin-top: 37rpx; + display: flex; + justify-content: space-between; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 33rpx; + } + + .cancel, + .submit { + flex: 1; + height: 80rpx; + box-sizing: border-box; + line-height: 78rpx; + border: 1rpx solid #1241b3; + border-radius: 48rpx; + color: #fff; + font-size: 32rpx; + font-weight: bold; + } + + .cancel { + color: #1241b3; + } + + .submit { + background-color: #1241b3; + } + } + } +} + +.popup-medicine { + .badge { + position: relative; + display: block; + margin: 0 auto 0; + width: 304rpx; + height: 299rpx; + z-index: 1; + } + + .popup-container { + margin-top: -250rpx; + width: 90vw; + border-radius: 24rpx; + padding: 255rpx 50rpx 50rpx; + box-sizing: border-box; + text-align: center; + background-color: #fff; + + .label { + margin-top: 7rpx; + font-size: 36rpx; + color: #afb7cb; + margin-bottom: 10rpx; + } + + .name { + font-size: 32rpx; + color: #3b4f98; + font-weight: bold; + } + } +} + +.popup-scan { + width: 90vw; + position: relative; + + .bg { + width: 100%; + } + + .popup-container { + position: absolute; + bottom: 0; + left: 0; + width: 100%; + box-sizing: border-box; + margin-top: 255rpx; + padding: 40rpx 50rpx 62rpx; + border-radius: 19rpx; + background-color: #fff; + text-align: center; + + .title { + margin-top: 38rpx; + font-size: 48rpx; + color: #3b4f98; + font-weight: bold; + } + + .content { + margin-top: 20rpx; + font-size: 36rpx; + color: #3b4f98; + line-height: 62rpx; + + .num { + color: #ee9d1f; + font-size: 36rpx; + font-weight: bold; + } + } + + .label { + margin-top: 7rpx; + font-size: 36rpx; + color: #afb7cb; + } + + .name { + font-size: 36rpx; + color: #3b4f98; + font-weight: bold; + } + } +} + +.popup-record-success { + .badge { + position: relative; + display: block; + margin: 0 auto 0; + width: 350rpx; + height: 350rpx; + z-index: 1; + } + .popup-container { + margin-top: -200rpx; + width: 80vw; + box-sizing: border-box; + padding: 204rpx 50rpx 62rpx; + border-radius: 19rpx; + background-color: #fff; + text-align: center; + background: linear-gradient(180deg, #82a4f7 0%, #fbfcff 30%, #ffffff 100%); + + .tip { + font-size: 36rpx; + color: #3b4f98; + line-height: 67rpx; + font-weight: bold; + } + .beginner { + font-size: 32rpx; + color: #ee9d1f; + margin-top: 10rpx; + } + } +} + +.popup-class { + position: relative; + width: 100vw; + padding: 304rpx 0; + + .bg { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + } + + .popup-container { + position: relative; + margin: 0 auto; + z-index: 1; + width: 600rpx; + padding: 0 40rpx 62rpx; + border-radius: 19rpx; + box-sizing: border-box; + background-color: #fff; + text-align: center; + background: linear-gradient(180deg, #c6d6fa 0%, #f8fafe 30%, #ffffff 100%); + + .badge { + margin-top: -80rpx; + width: 376rpx; + height: 350rpx; + } + + .op { + .op-tip { + margin-top: 40rpx; + font-size: 40rpx; + color: #3b4f98; + font-weight: bold; + } + .title { + margin-top: 20rpx; + font-size: 32rpx; + color: #ee9d1f; + } + .price { + margin-top: 16rpx; + font-size: 32rpx; + color: #afb7cb; + .p-num { + font-size: 48rpx; + color: #ee9d1f; + } + } + } + + .tip { + margin-top: 40rpx; + font-size: 36rpx; + color: #3b4f98; + font-weight: bold; + } + .ml { + margin-top: 20rpx; + font-size: 32rpx; + color: #afb7cb; + .num { + font-size: 48rpx; + color: #ee9d1f; + } + } + + .done { + margin-top: 56rpx; + height: 80rpx; + text-align: center; + line-height: 80rpx; + font-size: 32rpx; + font-weight: bold; + color: #ffffff; + background: #1241b3; + border-radius: 49px; + } + } +} + +.popup-class-inject { + .badge { + position: relative; + z-index: 1; + display: block; + margin: 0 auto; + width: 364rpx; + height: 380rpx; + } + + .popup-container { + margin-top: -277rpx; + width: 90vw; + padding: 248rpx 50rpx 62rpx; + border-radius: 19rpx; + box-sizing: border-box; + background-color: #fff; + text-align: center; + + .content { + font-size: 40rpx; + color: #3b4f98; + line-height: 60rpx; + } + + .footer { + margin-top: 37rpx; + display: flex; + justify-content: space-between; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 33rpx; + } + + .cancel, + .submit { + flex: 1; + height: 80rpx; + box-sizing: border-box; + line-height: 78rpx; + border: 1rpx solid #1241b3; + border-radius: 48rpx; + color: #fff; + font-size: 32rpx; + font-weight: bold; + } + + .cancel { + color: #fff; + border-color: #afb7cb; + background-color: #afb7cb; + } + + .submit { + background-color: #1241b3; + } + } + } +} + +.popup-unbind { + .badge { + position: relative; + z-index: 1; + display: block; + margin: 0 auto; + width: 256rpx; + height: 256rpx; + } + + .popup-container { + margin-top: -177rpx; + width: 90vw; + padding: 220rpx 50rpx 62rpx; + border-radius: 19rpx; + box-sizing: border-box; + background-color: #fff; + text-align: center; + + .content { + font-size: 36rpx; + color: #cf5375; + line-height: 60rpx; + font-weight: bold; + } + + .footer { + margin-top: 37rpx; + display: flex; + justify-content: space-between; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 33rpx; + } + + .cancel, + .submit { + flex: 1; + height: 80rpx; + box-sizing: border-box; + line-height: 78rpx; + border: 1rpx solid #cf5375; + border-radius: 48rpx; + color: #fff; + font-size: 32rpx; + font-weight: bold; + } + + .cancel { + color: #fff; + border-color: #afb7cb; + background-color: #afb7cb; + } + + .submit { + background-color: #cf5375; + } + } + } +} + +.popup-withdraw { + .badge { + position: relative; + z-index: 1; + display: block; + margin: 0 auto; + width: 204rpx; + height: 278rpx; + } + + .popup-container { + margin-top: -206rpx; + width: 626rpx; + padding: 220rpx 50rpx 62rpx; + border-radius: 19rpx; + box-sizing: border-box; + background-color: #fff; + text-align: center; + + .content { + font-size: 32rpx; + color: #484848; + font-weight: bold; + line-height: 50rpx; + } + + .footer { + margin-top: 37rpx; + display: flex; + justify-content: space-between; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 33rpx; + } + + .cancel, + .submit { + flex: 1; + height: 80rpx; + box-sizing: border-box; + line-height: 78rpx; + border-radius: 48rpx; + color: #fff; + font-size: 32rpx; + font-weight: bold; + } + + .cancel { + color: #e04775; + border: 2rpx solid #f0b8c9; + } + + .submit { + background: #e04775; + } + } + } +} + +.popup-home-inhibitor { + text-align: center; + .badge { + width: 481rpx; + height: 476rpx; + } + .popup-container { + margin-top: -310rpx; + border-top: 129rpx solid #023ebb; + width: 90vw; + border-radius: 19rpx; + box-sizing: border-box; + text-align: center; + background-color: #023ebb; + .container { + position: relative; + z-index: 10; + background-color: #fff; + border-radius: 19rpx; + padding: 69rpx 42rpx 62rpx; + .title { + font-size: 36rpx; + color: #023eba; + font-weight: bold; + } + .day { + font-size: 28rpx; + color: #aeb7cd; + .num { + font-size: 42rpx; + color: #fa7b7e; + } + } + + .content { + margin-top: 29rpx; + padding: 38rpx 16rpx; + font-size: 28rpx; + color: #9ba5bd; + line-height: 42rpx; + border-radius: 12rpx; + background-color: #f7f8fb; + .c-title { + color: #3b4f98; + font-weight: bold; + margin-bottom: 30rpx; + } + } + + .footer { + margin-top: 43rpx; + display: flex; + justify-content: space-between; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 33rpx; + } + + .cancel, + .submit { + flex: 1; + height: 80rpx; + box-sizing: border-box; + line-height: 78rpx; + border: 1rpx solid #1241b3; + border-radius: 48rpx; + color: #fff; + font-size: 32rpx; + font-weight: bold; + } + + .cancel { + color: #fff; + border-color: #afb7cb; + background-color: #afb7cb; + } + + .submit { + background-color: #1241b3; + } + } + } + } +} + +.popup-my-health-record { + .badge { + position: relative; + display: block; + margin: 0 auto 0; + width: 285rpx; + height: 282rpx; + z-index: 1; + } + + .popup-container { + margin-top: -170rpx; + width: 90vw; + border-radius: 24rpx; + padding: 164rpx 50rpx 62rpx; + box-sizing: border-box; + text-align: center; + background-color: #fff; + + .title { + margin-top: 28rpx; + font-size: 44rpx; + color: #3b4f98; + font-weight: bold; + line-height: 62rpx; + } + .week { + margin-top: 19rpx; + font-size: 44rpx; + color: #3b4f98; + font-weight: bold; + line-height: 62rpx; + } + + .content { + font-size: 32rpx; + color: #afb7cb; + line-height: 52rpx; + + .num { + color: #ee9d1f; + font-size: 48rpx; + font-weight: bold; + } + } + + .footer { + margin-top: 37rpx; + display: flex; + justify-content: space-between; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 33rpx; + } + + .cancel, + .submit { + flex: 1; + height: 80rpx; + box-sizing: border-box; + line-height: 78rpx; + border: 1rpx solid #1241b3; + border-radius: 48rpx; + color: #fff; + font-size: 32rpx; + font-weight: bold; + } + + .cancel { + color: #1241b3; + } + + .submit { + background-color: #1241b3; + } + } + } +} + +.popup-doc { + .popup-container { + width: 90vw; + border-radius: 24rpx; + padding: 62rpx 50rpx 62rpx; + box-sizing: border-box; + text-align: center; + background-color: #fff; + + .title { + margin-top: 28rpx; + font-size: 44rpx; + color: #3b4f98; + font-weight: bold; + line-height: 62rpx; + } + + .content { + margin-top: 20rpx; + font-size: 28rpx; + height: 50vh; + overflow-y: scroll; + text-align: left; + .h1 { + text-indent: 2em; + color: #919191; + line-height: 52rpx; + } + } + + .footer { + margin-top: 37rpx; + display: flex; + justify-content: space-between; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 33rpx; + } + + .cancel, + .submit { + flex: 1; + height: 80rpx; + box-sizing: border-box; + line-height: 78rpx; + border: 1rpx solid #1241b3; + border-radius: 48rpx; + color: #fff; + font-size: 32rpx; + font-weight: bold; + } + + .cancel { + color: #1241b3; + } + + .submit { + background-color: #1241b3; + } + } + } +} + +.popup-reg-protocol { + text-align: center; + .popup-container { + width: 90vw; + border-radius: 19rpx; + box-sizing: border-box; + text-align: center; + background-color: #023ebb; + .container { + position: relative; + z-index: 10; + background-color: #fff; + border-radius: 19rpx; + padding: 69rpx 42rpx 62rpx; + .title { + font-size: 40rpx; + color: #495069; + font-weight: bold; + } + + .content { + margin-top: 29rpx; + padding: 38rpx 16rpx; + font-size: 32rpx; + color: #9ba5bd; + border-radius: 12rpx; + line-height: 54rpx; + } + + .footer { + margin-top: 42rpx; + + .cancel, + .submit { + flex: 1; + height: 80rpx; + box-sizing: border-box; + line-height: 78rpx; + border: 1rpx solid #1241b3; + border-radius: 48rpx; + color: #fff; + font-size: 32rpx; + font-weight: bold; + } + + .cancel { + color: #fff; + border-color: #afb7cb; + background-color: #afb7cb; + } + + .submit { + background-color: #1241b3; + } + .protocol { + display: flex; + justify-content: center; + align-items: center; + margin-top: 30rpx; + font-size: 24rpx; + color: #9ba5bd; + .checkbox { + display: inline; + width: 32rpx; + height: 32rpx; + } + .a { + color: #1241b3; + } + } + } + } + } +} + +.popup-class-detail-once { + text-align: center; + .popup-container { + width: 90vw; + border-radius: 19rpx; + box-sizing: border-box; + text-align: center; + background-color: #023ebb; + .container { + position: relative; + z-index: 10; + background-color: #fff; + border-radius: 19rpx; + padding: 69rpx 42rpx 62rpx; + .title { + font-size: 36rpx; + color: #023eba; + font-weight: bold; + } + + .content { + margin-top: 29rpx; + padding: 38rpx 16rpx; + font-size: 28rpx; + color: #9ba5bd; + line-height: 42rpx; + border-radius: 12rpx; + background-color: #f7f8fb; + text-align: justify; + } + + .footer { + margin-top: 43rpx; + display: flex; + justify-content: space-between; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 33rpx; + } + + .cancel, + .submit { + flex: 1; + height: 80rpx; + box-sizing: border-box; + line-height: 78rpx; + border: 1rpx solid #1241b3; + border-radius: 48rpx; + color: #fff; + font-size: 32rpx; + font-weight: bold; + } + + .cancel { + color: #fff; + border-color: #afb7cb; + background-color: #afb7cb; + } + + .submit { + background-color: #1241b3; + } + } + } + } +} + +.popup-soory-enter { + text-align: center; + .popup-container { + width: 90vw; + border-radius: 19rpx; + box-sizing: border-box; + text-align: center; + background-color: #023ebb; + .container { + position: relative; + z-index: 10; + background-color: #fff; + background-size: 100% 100%; + background-repeat: no-repeat; + border-radius: 19rpx; + padding: 69rpx 42rpx 62rpx; + .badge { + display: block; + margin: 0 auto; + width: 110rpx; + height: 138rpx; + } + + .content { + max-height: 35vh; + overflow-y: scroll; + font-size: 26rpx; + color: #495069; + text-align: justify; + line-height: 44rpx; + .br { + padding: 12rpx 0; + } + } + + .protocol { + margin-top: 32rpx; + font-size: 24rpx; + color: #495069; + .p-header { + display: flex; + justify-content: center; + .checkbox { + margin-right: 12rpx; + width: 32rpx; + height: 32rpx; + display: inline; + overflow: hidden; + } + .a { + color: #1241b3; + } + } + .tip { + margin-top: 24rpx; + text-align: justify; + color: #b6b7ba; + } + } + + .footer { + margin-top: 43rpx; + display: flex; + justify-content: space-between; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 33rpx; + } + + .cancel, + .submit { + flex: 1; + height: 84rpx; + box-sizing: border-box; + line-height: 84rpx; + border-radius: 48rpx; + color: #fff; + font-size: 32rpx; + } + + .cancel { + color: #fff; + border-color: #afb7cb; + background-color: #afb7cb; + } + + .submit { + background-color: #e04775; + } + } + } + } +} + +.popup-story-lead { + padding-top: 20rpx; + text-align: center; + .popup-header { + position: relative; + padding: 43rpx 0 60rpx 54rpx; + font-size: 28rpx; + background: #1241b3; + border-radius: 24rpx 93rpx 24rpx 24rpx; + .content { + font-size: 28rpx; + line-height: 46rpx; + color: #fff; + text-align-last: left; + .num { + font-size: 36rpx; + } + } + .bg { + position: absolute; + right: 0; + top: 0; + width: 196rpx; + height: 181rpx; + } + } + .popup-container { + position: relative; + margin-top: -20rpx; + width: 90vw; + border-radius: 19rpx; + box-sizing: border-box; + text-align: center; + .bg { + width: 100%; + height: 600rpx; + } + .container { + position: absolute; + top: 0; + left: 0; + width: 100%; + box-sizing: border-box; + // background-color: #fff; + border-radius: 19rpx; + padding: 69rpx 42rpx 62rpx; + + .content { + font-size: 42rpx; + color: #023eba; + font-weight: bold; + text-align: justify; + line-height: 60rpx; + } + .sub-content { + margin-top: 21rpx; + font-size: 28rpx; + text-align: justify; + line-height: 44rpx; + color: #aeb7cd; + } + + .footer { + margin-top: 43rpx; + display: flex; + justify-content: center; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 33rpx; + } + + .cancel, + .submit { + flex: 1; + max-width: 312rpx; + height: 80rpx; + box-sizing: border-box; + line-height: 78rpx; + border: 1rpx solid #1241b3; + border-radius: 48rpx; + color: #fff; + font-size: 32rpx; + font-weight: bold; + } + + .cancel { + color: #fff; + border-color: #afb7cb; + background-color: #afb7cb; + } + + .submit { + background-color: #1241b3; + } + } + } + } +} + +.popup-story-star { + text-align: center; + .badge { + position: relative; + z-index: 2; + display: block; + width: 306rpx; + height: 233rpx; + margin: 0 auto; + } + .popup-container { + position: relative; + z-index: 1; + margin-top: -156rpx; + width: 624rpx; + border-radius: 19rpx; + box-sizing: border-box; + text-align: center; + height: 600rpx; + background-color: #fff; + .bg { + width: 100%; + } + .container { + position: absolute; + top: 0; + left: 0; + width: 100%; + box-sizing: border-box; + border-radius: 19rpx; + padding: 163rpx 42rpx 62rpx; + + .content { + font-size: 42rpx; + color: #023eba; + font-weight: bold; + text-align: justify; + text-align: center; + } + .sub-content { + text-align: center; + margin-top: 21rpx; + font-size: 28rpx; + text-align: justify; + line-height: 52rpx; + color: #023eba; + view { + text-align: center; + } + } + + .footer { + margin-top: 43rpx; + display: flex; + justify-content: center; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 33rpx; + } + + .cancel, + .submit { + flex: 1; + max-width: 312rpx; + height: 80rpx; + box-sizing: border-box; + line-height: 78rpx; + border: 1rpx solid #1241b3; + border-radius: 48rpx; + color: #fff; + font-size: 32rpx; + font-weight: bold; + } + + .cancel { + color: #fff; + border-color: #afb7cb; + background-color: #afb7cb; + } + + .submit { + background-color: #1241b3; + } + } + .tip { + margin-top: 30rpx; + font-size: 28rpx; + color: #aeb7cd; + } + } + } +} + +.popup-story-share { + text-align: center; + .badge { + position: relative; + z-index: 2; + width: 325rpx; + height: 335rpx; + } + .popup-container { + margin-top: -250rpx; + position: relative; + z-index: 1; + width: 604rpx; + border-radius: 19rpx; + box-sizing: border-box; + text-align: center; + height: 652rpx; + padding-right: 20rpx; + margin-left: 10rpx; + .bg { + width: 100%; + height: 100%; + } + .container { + position: absolute; + left: 0; + top: 0; + width: 100%; + box-sizing: border-box; + border-radius: 19rpx; + padding: 251rpx 42rpx 62rpx; + .satellite1 { + width: 62rpx; + height: 62rpx; + position: absolute; + top: 133rpx; + left: 19px; + } + .satellite2 { + width: 52rpx; + height: 52rpx; + position: absolute; + top: 370rpx; + right: 0; + } + .sub-content { + padding: 23rpx 0 39rpx; + margin: 36rpx 15rpx 0; + text-align: center; + font-size: 28rpx; + text-align: justify; + line-height: 44rpx; + color: #495069; + background-color: #fff; + border-radius: 22rpx; + view { + text-align: center; + text { + color: #ee9d1f; + font-size: 28rpx; + font-weight: bold; + } + } + } + + .footer { + margin-top: 43rpx; + display: flex; + justify-content: center; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 33rpx; + } + + .cancel, + .submit { + flex: 1; + max-width: 312rpx; + height: 80rpx; + box-sizing: border-box; + line-height: 78rpx; + border: 1rpx solid #1241b3; + border-radius: 48rpx; + color: #fff; + font-size: 32rpx; + font-weight: bold; + } + + .cancel { + color: #fff; + border-color: #afb7cb; + background-color: #afb7cb; + } + + .submit { + background-color: #1241b3; + } + } + .tip { + margin-top: 30rpx; + font-size: 28rpx; + color: #aeb7cd; + } + } + } +} + +.popup-beginner-guide { + text-align: center; + .popup-container { + width: 604rpx; + border-radius: 19rpx; + box-sizing: border-box; + text-align: center; + padding-right: 20rpx; + margin-left: 10rpx; + .container { + box-sizing: border-box; + border-radius: 19rpx; + padding: 0 42rpx 62rpx; + background-color: #fff; + .badge { + width: 320rpx; + height: 320rpx; + } + .content { + margin-top: 28rpx; + font-size: 36rpx; + color: #023eba; + line-height: 48rpx; + font-weight: bold; + } + .tip { + margin-top: 20rpx; + font-size: 28rpx; + color: #364e9e; + font-weight: bold; + .num { + color: #fc7c7c; + } + } + .submit { + margin-top: 56rpx; + width: 100%; + height: 80rpx; + font-size: 32rpx; + color: #ffffff; + text-align: center; + line-height: 80rpx; + background: #023eba; + border-radius: 100rpx 100rpx 100rpx 100rpx; + } + } + } +} + +.popup-tfb-success { + .badge { + position: relative; + display: block; + margin: 0 auto 0; + width: 350rpx; + height: 350rpx; + z-index: 1; + } + .popup-container { + margin-top: -200rpx; + width: 80vw; + box-sizing: border-box; + padding: 204rpx 50rpx 62rpx; + border-radius: 19rpx; + background-color: #fff; + text-align: center; + background: linear-gradient(180deg, #82a4f7 0%, #fbfcff 30%, #ffffff 100%); + + .tip { + font-size: 40rpx; + color: #3b4f98; + line-height: 67rpx; + font-weight: bold; + } + .beginner { + font-size: 32rpx; + color: #afb7cb; + margin-top: 10rpx; + line-height: 44rpx; + .num { + font-size: 48rpx; + color: #ee9d1f; + } + } + } +} + +.popup-adl-alert { + text-align: center; + .popup-container { + width: 604rpx; + border-radius: 19rpx; + box-sizing: border-box; + text-align: center; + padding-right: 20rpx; + margin-left: 10rpx; + .badge { + width: 430rpx; + height: 304rpx; + } + .container { + margin-top: -184rpx; + box-sizing: border-box; + border-radius: 19rpx; + padding: 184rpx 42rpx 62rpx; + background: linear-gradient(180deg, #edcfd8 0%, #ffffff 40%, #ffffff 100%); + .content { + font-size: 40rpx; + color: #484848; + line-height: 48rpx; + font-weight: bold; + } + .tip { + margin-top: 16rpx; + font-size: 32rpx; + color: #484848; + .num { + color: #fc7c7c; + } + } + .warn { + margin-top: 44rpx; + display: inline-flex; + align-items: center; + padding: 0 14rpx; + height: 48rpx; + background: #ededed; + border-radius: 24rpx; + font-size: 28rpx; + color: #484848; + line-height: 48rpx; + .icon { + width: 32rpx; + height: 32rpx; + margin-right: 8rpx; + } + } + .c-footer { + margin: 32rpx 0 0; + display: flex; + justify-content: space-between; + .cancel { + margin-right: 30rpx; + flex: 1; + height: 88rpx; + font-size: 32rpx; + color: #cf5375; + text-align: center; + line-height: 84rpx; + border-radius: 24rpx; + box-sizing: border-box; + border: 2rpx solid #f0b8c9; + } + .submit { + flex: 1; + height: 88rpx; + font-size: 34rpx; + color: #ffffff; + text-align: center; + line-height: 88rpx; + background: #cf5375; + border-radius: 24rpx; + } + } + } + } + &.popup-adl-alert-drug { + .container { + background: linear-gradient(180deg, #dffffc 0%, #ffffff 40%, #ffffff 100%); + .c-footer { + .cancel { + border-color: #25d9c8; + color: #25d9c8; + } + .submit { + background-color: #4cebdc; + } + } + } + } +} + +.popup-adl-alert-test { + text-align: center; + .popup-container { + width: 604rpx; + border-radius: 19rpx; + box-sizing: border-box; + text-align: center; + padding-right: 20rpx; + margin-left: 10rpx; + .badge { + width: 274rpx; + height: 230rpx; + } + .container { + margin-top: -184rpx; + box-sizing: border-box; + border-radius: 19rpx; + padding: 184rpx 42rpx 20rpx; + background: linear-gradient(180deg, #edcfd8 0%, #ffffff 40%, #ffffff 100%); + .content { + font-size: 40rpx; + color: #484848; + line-height: 48rpx; + font-weight: bold; + } + .tip { + margin-top: 16rpx; + font-size: 32rpx; + color: #484848; + .num { + color: #fc7c7c; + } + } + .warn { + margin-top: 44rpx; + display: inline-flex; + align-items: center; + padding: 0 14rpx; + height: 48rpx; + background: #ededed; + border-radius: 24rpx; + font-size: 28rpx; + color: #484848; + line-height: 48rpx; + .icon { + width: 32rpx; + height: 32rpx; + margin-right: 8rpx; + } + } + .c-footer { + margin: 32rpx 0 0; + .submit { + height: 88rpx; + font-size: 34rpx; + color: #ffffff; + text-align: center; + line-height: 88rpx; + background: #cf5375; + border-radius: 24rpx; + } + .cancel { + margin-top: 10rpx; + height: 88rpx; + font-size: 34rpx; + color: #484848; + line-height: 88rpx; + } + } + } + } + &.popup-adl-alert-test-drug { + .container { + background: linear-gradient(180deg, #dffffc 0%, #ffffff 40%, #ffffff 100%); + .c-footer { + .submit { + background-color: #4cebdc; + } + } + } + } +} + +.popup-vip { + text-align: center; + .popup-container { + width: 604rpx; + border-radius: 19rpx; + box-sizing: border-box; + text-align: center; + padding-right: 20rpx; + margin-left: 10rpx; + .container { + box-sizing: border-box; + border-radius: 19rpx; + padding: 48rpx 42rpx 62rpx; + background: linear-gradient(180deg, #edcfd8 0%, #ffffff 40%, #ffffff 100%); + .badge { + width: 166rpx; + height: 170rpx; + } + .content { + margin-top: 24rpx; + font-size: 40rpx; + color: #484848; + line-height: 48rpx; + font-weight: bold; + } + .tip { + margin-top: 32rpx; + font-size: 32rpx; + color: #cf5375; + .icon { + width: 32rpx; + height: 22rpx; + } + } + .warn { + margin-top: 44rpx; + display: inline-flex; + align-items: center; + padding: 0 14rpx; + height: 48rpx; + background: #ededed; + border-radius: 24rpx; + font-size: 28rpx; + color: #484848; + line-height: 48rpx; + .icon { + width: 32rpx; + height: 32rpx; + margin-right: 8rpx; + } + } + .c-footer { + margin: 32rpx 0 0; + .submit { + height: 88rpx; + font-size: 34rpx; + color: #ffffff; + text-align: center; + line-height: 88rpx; + background: #cf5375; + border-radius: 24rpx; + } + } + } + } +} + +.popup-task-model { + text-align: center; + .popup-container { + width: 604rpx; + border-radius: 19rpx; + box-sizing: border-box; + text-align: center; + padding-right: 20rpx; + margin-left: 10rpx; + .badge { + width: 430rpx; + height: 304rpx; + } + .container { + margin-top: -184rpx; + box-sizing: border-box; + border-radius: 19rpx; + padding: 184rpx 42rpx 62rpx; + background: linear-gradient(180deg, #edcfd8 0%, #ffffff 40%, #ffffff 100%); + .content { + font-size: 36rpx; + color: #484848; + line-height: 48rpx; + font-weight: bold; + } + .tip { + margin-top: 16rpx; + font-size: 28rpx; + color: #484848; + .num { + color: #fc7c7c; + } + } + .warn { + margin-top: 44rpx; + display: inline-flex; + align-items: center; + padding: 0 14rpx; + height: 48rpx; + background: #ededed; + border-radius: 24rpx; + font-size: 28rpx; + color: #484848; + line-height: 48rpx; + .icon { + width: 32rpx; + height: 32rpx; + margin-right: 8rpx; + } + .link { + color: #cf5375; + } + } + .c-footer { + margin: 32rpx 0 0; + display: flex; + justify-content: space-between; + .cancel { + margin-right: 30rpx; + flex: 1; + height: 88rpx; + font-size: 32rpx; + color: #cf5375; + text-align: center; + line-height: 84rpx; + border-radius: 24rpx; + box-sizing: border-box; + border: 2rpx solid #f0b8c9; + } + .submit { + flex: 1; + height: 88rpx; + font-size: 34rpx; + color: #ffffff; + text-align: center; + line-height: 88rpx; + background: #cf5375; + border-radius: 24rpx; + } + } + } + } + &.popup-task-model-drug { + .container { + background: linear-gradient(180deg, #dffffc 0%, #ffffff 40%, #ffffff 100%); + .warn { + .link { + color: #25d9c8; + } + } + .c-footer { + .cancel { + border-color: #25d9c8; + color: #25d9c8; + } + .submit { + background-color: #4cebdc; + } + } + } + } +} + +.popup-health-care { + text-align: center; + .popup-container { + width: 604rpx; + border-radius: 19rpx; + box-sizing: border-box; + text-align: center; + padding-right: 20rpx; + margin-left: 10rpx; + .badge { + width: 430rpx; + height: 304rpx; + } + .container { + margin-top: -184rpx; + box-sizing: border-box; + border-radius: 19rpx; + padding: 184rpx 42rpx 62rpx; + background: linear-gradient(180deg, #edcfd8 0%, #ffffff 40%, #ffffff 100%); + .content { + font-size: 40rpx; + color: #484848; + line-height: 48rpx; + font-weight: bold; + } + .tip { + margin-top: 16rpx; + font-size: 32rpx; + color: #484848; + .num { + color: #fc7c7c; + } + } + .warn { + margin-top: 44rpx; + display: inline-flex; + align-items: center; + padding: 0 14rpx; + height: 48rpx; + background: #ededed; + border-radius: 24rpx; + font-size: 28rpx; + color: #484848; + line-height: 48rpx; + .icon { + width: 32rpx; + height: 32rpx; + margin-right: 8rpx; + } + } + .c-footer { + margin: 32rpx 0 0; + display: flex; + justify-content: space-between; + .cancel { + margin-right: 30rpx; + flex: 1; + height: 88rpx; + font-size: 32rpx; + color: #cf5375; + text-align: center; + line-height: 84rpx; + border-radius: 24rpx; + box-sizing: border-box; + border: 2rpx solid #f0b8c9; + } + .submit { + flex: 1; + height: 88rpx; + font-size: 34rpx; + color: #ffffff; + text-align: center; + line-height: 88rpx; + background: #cf5375; + border-radius: 24rpx; + } + } + } + } + &.popup-health-care-drug { + .container { + background: linear-gradient(180deg, #dffffc 0%, #ffffff 40%, #ffffff 100%); + .c-footer { + .cancel { + border-color: #25d9c8; + color: #25d9c8; + } + .submit { + background-color: #4cebdc; + } + } + } + } +} + +.popup-ndrl-adl-alert { + text-align: center; + .popup-container { + width: 604rpx; + border-radius: 19rpx; + box-sizing: border-box; + text-align: center; + padding-right: 20rpx; + margin-left: 10rpx; + .badge { + width: 430rpx; + height: 304rpx; + } + .container { + margin-top: -184rpx; + box-sizing: border-box; + border-radius: 19rpx; + padding: 184rpx 42rpx 62rpx; + background: linear-gradient(180deg, #edcfd8 0%, #ffffff 40%, #ffffff 100%); + .content { + font-size: 40rpx; + color: #484848; + line-height: 48rpx; + font-weight: bold; + } + .tip { + margin-top: 16rpx; + font-size: 32rpx; + color: #484848; + .num { + color: #fc7c7c; + } + } + .warn { + margin-top: 44rpx; + display: inline-flex; + align-items: center; + padding: 0 14rpx; + height: 48rpx; + background: #ededed; + border-radius: 24rpx; + font-size: 28rpx; + color: #484848; + line-height: 48rpx; + .icon { + width: 32rpx; + height: 32rpx; + margin-right: 8rpx; + } + } + .c-footer { + margin: 32rpx 0 0; + display: flex; + justify-content: space-between; + .cancel { + margin-right: 30rpx; + flex: 1; + height: 88rpx; + font-size: 32rpx; + color: #cf5375; + text-align: center; + line-height: 84rpx; + border-radius: 24rpx; + box-sizing: border-box; + border: 2rpx solid #f0b8c9; + } + .submit { + flex: 1; + height: 88rpx; + font-size: 34rpx; + color: #ffffff; + text-align: center; + line-height: 88rpx; + background: #cf5375; + border-radius: 24rpx; + } + } + } + } + &.popup-ndrl-adl-alert-drug { + .container { + background: linear-gradient(180deg, #dffffc 0%, #ffffff 40%, #ffffff 100%); + .c-footer { + .cancel { + border-color: #25d9c8; + color: #25d9c8; + } + .submit { + background-color: #4cebdc; + } + } + } + } +} + +.popup-ndrl-follow { + position: relative; + z-index: 9999999999; + .badge { + position: relative; + display: block; + margin: 0 0 0 205rpx; + width: 231rpx; + height: 207rpx; + z-index: 1; + } + + .popup-container { + width: calc(100vw - 160rpx); + border-radius: 24rpx; + box-sizing: border-box; + text-align: center; + .container { + margin-top: -80rpx; + padding: 53rpx 40rpx 58rpx; + background: linear-gradient(180deg, #ffe0ea 0%, #fff 50%, #ffffff 100%); + border-radius: 24rpx; + .title { + margin-top: 38rpx; + font-size: 40rpx; + color: #cd355f; + font-weight: bold; + } + .price { + margin: 10rpx auto 0; + font-size: 56rpx; + color: #f5ad1d; + display: flex; + justify-content: center; + align-items: baseline; + font-weight: bold; + .sub { + font-size: 36rpx; + color: #484848; + } + } + + .content { + margin-top: 16rpx; + font-size: 32rpx; + color: #333333; + line-height: 45rpx; + } + .code { + display: block; + margin: 28rpx auto 0; + width: 238rpx; + height: 238rpx; + } + .tip { + margin-top: 14rpx; + font-size: 28rpx; + color: #666666; + } + } + + .footer { + margin-top: 37rpx; + display: flex; + justify-content: space-between; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 33rpx; + } + + .cancel, + .submit { + flex: 1; + height: 80rpx; + box-sizing: border-box; + line-height: 78rpx; + border: 1rpx solid #1241b3; + border-radius: 48rpx; + color: #fff; + font-size: 32rpx; + font-weight: bold; + } + + .cancel { + color: #1241b3; + } + + .submit { + background-color: #1241b3; + } + } + } +} + +.popup-adl-progress { + position: relative; + text-align: center; + .close { + position: absolute; + top: 224rpx; + right: 40rpx; + width: 28rpx; + height: 26rpx; + } + .popup-container { + padding: 342rpx 0 0; + width: 632rpx; + height: 944rpx; + box-sizing: border-box; + background-size: 100% 100%; + .container { + width: 100%; + height: 100%; + .title { + font-size: 36rpx; + font-weight: bold; + color: #484848; + line-height: 50rpx; + } + .content { + margin-top: 32rpx; + display: flex; + justify-content: center; + align-items: baseline; + font-weight: bold; + .price { + font-size: 56rpx; + color: #f5ad1d; + } + .sub { + text-indent: 5rpx; + font-size: 36rpx; + color: #484848; + } + } + .progress { + margin-top: 10px; + position: relative; + padding: 0 80rpx; + box-sizing: border-box; + height: 142rpx; + .progress-bar { + padding: 60rpx 0 0; + } + .wrap { + position: absolute; + top: 0; + left: 80rpx; + display: flex; + justify-content: space-between; + width: calc(100% - 160rpx); + box-sizing: border-box; + .item { + text-align: center; + width: 48rpx; + .name { + font-size: 24rpx; + color: #3f3f3f; + line-height: 34rpx; + white-space: nowrap; + } + .el { + margin-top: 10rpx; + position: relative; + width: 48rpx; + height: 46rpx; + .icon { + width: 100%; + height: 100%; + } + .status { + position: absolute; + bottom: 0; + right: 0; + width: 20rpx; + height: 20rpx; + background-color: #eaeaea; + border-radius: 50%; + border: 2rpx solid #fff; + display: flex; + align-items: center; + justify-content: center; + .mini { + width: 12rpx; + height: 8rpx; + } + } + } + .num { + white-space: nowrap; + margin-top: 10rpx; + font-size: 24rpx; + color: #e7e7e7; + font-weight: bold; + &.more { + text-indent: -20rpx; + } + } + &.active { + .name { + color: #3f3f3f; + } + .el { + .status { + background-color: #e04775; + } + } + .num { + color: #e04775; + } + } + } + } + } + .tip { + margin-top: 24rpx; + font-size: 24rpx; + height: 34rpx; + color: #9e9e9e; + } + .footer { + margin-top: 22rpx; + .submit { + margin: 0 auto; + width: 350rpx; + height: 96rpx; + background: linear-gradient(180deg, #f27dad 0%, #e04775 100%); + box-shadow: 0rpx 10rpx 28rpx 0rpx rgba(207, 83, 117, 0.44); + border-radius: 48rpx; + border: 3rpx solid #ffffff; + font-size: 36rpx; + color: #ffffff; + line-height: 96rpx; + } + } + } + } + &.popup-adl-progress-drug { + .popup-container { + .container { + .progress { + .wrap { + .item { + &.active { + .status { + background: #25d9c8; + } + .num { + color: #24d8c8; + } + } + .num { + color: #e7e7e7; + } + } + } + } + .footer { + .submit { + background: linear-gradient(157deg, #4cebdc 0%, #25d9c8 100%); + box-shadow: 0rpx 10rpx 28rpx 0rpx rgba(36, 216, 200, 0.43); + } + } + } + } + } +} + +.popup-adl-progress-end { + position: relative; + text-align: center; + .close { + position: absolute; + top: 224rpx; + right: 40rpx; + width: 28rpx; + height: 26rpx; + } + .popup-container { + padding: 342rpx 0 0; + width: 630rpx; + height: 640rpx; + box-sizing: border-box; + background-size: 100% 100%; + .container { + width: 100%; + height: 100%; + .title { + font-size: 36rpx; + font-weight: bold; + color: #484848; + line-height: 50rpx; + } + .footer { + margin-top: 22rpx; + .submit { + margin: 0 auto; + width: 350rpx; + height: 96rpx; + background: linear-gradient(180deg, #f27dad 0%, #e04775 100%); + box-shadow: 0rpx 10rpx 28rpx 0rpx rgba(207, 83, 117, 0.44); + border-radius: 48rpx; + border: 3rpx solid #ffffff; + font-size: 36rpx; + color: #ffffff; + line-height: 96rpx; + } + } + } + } + &.popup-adl-progress-end-drug { + .popup-container { + .container { + .footer { + .submit { + background: linear-gradient(157deg, #4cebdc 0%, #25d9c8 100%); + box-shadow: 0rpx 10rpx 28rpx 0rpx rgba(36, 216, 200, 0.43); + } + } + } + } + } +} + +.popup-dtp-drup { + position: relative; + .popup-container { + padding: 56rpx 48rpx 48rpx; + width: 630rpx; + box-sizing: border-box; + background-size: 100% 100%; + background-color: #fff; + .container { + width: 100%; + height: 100%; + .title { + width: 384rpx; + max-height: 50rpx; + } + .content { + margin-top: 24rpx; + font-size: 32rpx; + color: #9e9e9e; + } + .footer { + margin-top: 48rpx; + .submit { + margin: 0 auto; + height: 96rpx; + text-align: center; + background: #e04775; + border-radius: 48rpx; + font-size: 36rpx; + color: #ffffff; + line-height: 96rpx; + } + } + } + } +} + +.popup-double-standards { + text-align: center; + .popup-container { + width: 604rpx; + border-radius: 19rpx; + box-sizing: border-box; + text-align: center; + padding-right: 20rpx; + margin-left: 10rpx; + .badge { + width: 435rpx; + height: 266rpx; + } + .container { + margin-top: -180rpx; + box-sizing: border-box; + border-radius: 19rpx; + padding: 166rpx 42rpx 62rpx; + background: linear-gradient(180deg, #edcfd8 0%, #ffffff 40%, #ffffff 100%); + .content { + margin-top: 24rpx; + font-size: 40rpx; + color: #484848; + line-height: 48rpx; + font-weight: bold; + } + .tip { + margin-top: 30rpx; + font-size: 28rpx; + color: #cccccc; + .icon { + width: 32rpx; + height: 22rpx; + } + } + .warn { + margin-top: 44rpx; + display: inline-flex; + align-items: center; + padding: 0 14rpx; + height: 48rpx; + background: #ededed; + border-radius: 24rpx; + font-size: 28rpx; + color: #484848; + line-height: 48rpx; + .icon { + width: 32rpx; + height: 32rpx; + margin-right: 8rpx; + } + } + .c-footer { + margin: 32rpx 0 0; + .submit { + height: 88rpx; + font-size: 34rpx; + color: #ffffff; + text-align: center; + line-height: 88rpx; + background: #cf5375; + border-radius: 24rpx; + } + } + } + } + &.popup-double-standards-drug { + .popup-container { + .container { + background: #fff linear-gradient(180deg, rgba(38, 218, 200, 0.3) 0%, #fff 40%, #ffffff 100%); + .c-footer { + .submit { + background-color: #24d8c8; + } + } + } + } + } +} + +.popup-dedicated-doctor { + .popup-container { + position: relative; + padding: 392rpx 40rpx 0; + width: 670rpx; + height: 496rpx; + box-sizing: border-box; + .content { + position: absolute; + top: 78rpx; + right: 20rpx; + width: 462rpx; + height: 122rpx; + animation: hu__hu__ infinite 2s ease-in-out; + @keyframes hu__hu__ { + 50% { + transform: translateY(20rpx); + } + } + } + .btn { + width: 610rpx; + height: 80rpx; + font-size: 32rpx; + color: rgba(255, 255, 255, 1); + text-align: center; + line-height: 80rpx; + background: #cf5375; + border-radius: 24rpx 24rpx 24rpx 24rpx; + } + } + .close { + margin: 68rpx auto 0; + display: block; + width: 64rpx; + height: 64rpx; + } + &.popup-dedicated-doctor-drug { + .popup-container { + .btn { + background-color: rgba(37, 217, 200, 1); + } + } + } +} + +.popup-export-loading-doctor { + .badge { + position: relative; + z-index: 1; + display: block; + margin: 0 auto; + width: 240rpx; + height: 402rpx; + } + .popup-container { + padding: 188rpx 30rpx 48rpx; + margin-top: -170rpx; + width: 650rpx; + height: 460rpx; + box-sizing: border-box; + background-color: #fff; + border-radius: 24rpx; + text-align: center; + .title { + font-size: 40rpx; + color: #283031; + line-height: 48rpx; + } + .content { + margin-top: 20rpx; + font-size: 32rpx; + color: #9aa1a2; + line-height: 40rpx; + } + .btn { + margin-top: 32rpx; + font-size: 36rpx; + color: #3464d4; + text-align: center; + line-height: 84rpx; + } + } +} + +.popup-referral-toast { + .popup-container { + position: relative; + padding: 504rpx 120rpx 0; + width: 532rpx; + height: 654rpx; + box-sizing: border-box; + .btn { + width: 296rpx; + height: 84rpx; + font-size: 36rpx; + color: rgba(255, 255, 255, 1); + text-align: center; + line-height: 80rpx; + background: #67baca; + border-radius: 48rpx; + } + } + .close { + margin: 68rpx auto 0; + display: block; + width: 64rpx; + height: 64rpx; + } +} + +.popup-patient-detail-safe-doctor { + .popup-container { + position: relative; + padding: 228rpx 50rpx 0; + width: 670rpx; + height: 566rpx; + box-sizing: border-box; + .content { + font-size: 32rpx; + color: #283031; + line-height: 48rpx; + } + .btn { + margin: 32rpx auto 0; + width: 364rpx; + height: 84rpx; + font-size: 36rpx; + color: rgba(255, 255, 255, 1); + text-align: center; + line-height: 80rpx; + background: linear-gradient(345deg, #d76c6c 0%, #fb7474 100%); + border-radius: 48rpx; + } + } + .close { + margin: 68rpx auto 0; + display: block; + width: 64rpx; + height: 64rpx; + } +} +.popup-public-toast { + .popup-container { + position: relative; + padding: 360rpx 146rpx 0; + width: 590rpx; + height: 880rpx; + box-sizing: border-box; + .code { + width: 286rpx; + height: 286rpx; + } + } + .close { + margin: 68rpx auto 0; + display: block; + width: 64rpx; + height: 64rpx; + } +} + +.popup-site-conform { + .badge { + position: relative; + z-index: 1; + display: block; + margin: 0 auto; + width: 263rpx; + height: 198rpx; + } + .popup-container { + margin-top: -138rpx; + width: 622rpx; + padding: 160rpx 34rpx 48rpx; + box-sizing: border-box; + border-radius: 24rpx; + background: linear-gradient(180deg, #ffedf3 0%, #ffffff 40%, #ffffff 100%); + .title { + text-align: center; + font-size: 32rpx; + color: rgba(72, 72, 72, 1); + line-height: 56rpx; + } + .content { + text-align: center; + font-size: 44rpx; + color: rgba(224, 71, 117, 1); + line-height: 56rpx; + font-weight: bold; + } + .footer { + margin-top: 32rpx; + display: flex; + justify-content: space-between; + align-items: center; + text-align: center; + + .cancel, + .submit { + flex: 1; + height: 80rpx; + box-sizing: border-box; + line-height: 78rpx; + border: 1rpx solid #cf5375; + border-radius: 48rpx; + color: #fff; + font-size: 32rpx; + font-weight: bold; + } + + .cancel { + margin-right: 33rpx; + color: #cf5375; + } + + .submit { + background-color: #cf5375; + padding: 0; + margin: 0; + } + } + } + .close { + margin: 68rpx auto 0; + display: block; + width: 64rpx; + height: 64rpx; + } +} + +.popup-level-up { + .popup-container { + position: relative; + width: 650rpx; + height: 538rpx; + padding: 328rpx 0 0 284rpx; + box-sizing: border-box; + border-radius: 24rpx; + background: linear-gradient(180deg, #ffedf3 0%, #ffffff 40%, #ffffff 100%); + .close { + position: absolute; + top: 20rpx; + right: 20rpx; + width: 60rpx; + height: 60rpx; + } + .btn { + width: 316rpx; + height: 88rpx; + } + } +} + +.popup-transfer-code { + .popup-container { + padding-top: 108rpx; + box-sizing: border-box; + width: 630rpx; + height: 948rpx; + .user { + padding: 0 66rpx; + display: flex; + gap: 10rpx; + .avatar { + flex-shrink: 0; + width: 108rpx; + height: 108rpx; + border-radius: 50%; + } + .wrap { + height: 180rpx; + .name { + font-size: 40rpx; + color: #ffffff; + line-height: 52rpx; + max-height: 104rpx; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + word-break: break-all; + } + .content { + margin-top: 12rpx; + font-size: 28rpx; + line-height: 32rpx; + height: 64rpx; + color: #ffffff; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + word-break: break-all; + } + } + } + .code { + margin: 4rpx auto 0; + display: block; + width: 350rpx; + height: 350rpx; + border-radius: 30rpx; + } + } +} + +.popup-recommend-doctor { + .popup-container { + padding: 178rpx 32rpx 0; + box-sizing: border-box; + width: 630rpx; + height: 574rpx; + .user { + padding: 32rpx 32rpx; + display: flex; + gap: 10rpx; + border-radius: 24rpx; + background-color: #fff; + .avatar { + width: 108rpx; + height: 108rpx; + border-radius: 50%; + } + .wrap { + flex: 1; + .name { + max-width: 10em; + font-size: 40rpx; + color: #d64969; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + word-break: break-all; + } + .content { + margin-top: 8rpx; + font-size: 28rpx; + color: #9e9e9e; + word-break: break-all; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + } + } + } + .tip { + margin-top: 20rpx; + font-size: 28rpx; + line-height: 36rpx; + color: #e04775; + text-align: center; + } + .btn { + margin: 32rpx auto 0; + padding: 20rpx 0; + font-size: 36rpx; + color: #d64969; + width: 332rpx; + line-height: 1; + text-align: center; + border-radius: 98rpx 98rpx 98rpx 98rpx; + border: 2rpx solid #d64969; + } + } +} + +.popup-recommend-bind-doctor { + .popup-container { + padding: 188rpx 32rpx 0; + box-sizing: border-box; + width: 630rpx; + height: 574rpx; + .user { + padding: 32rpx 32rpx; + display: flex; + gap: 10rpx; + border-radius: 24rpx; + background-color: #fff; + .avatar { + width: 108rpx; + height: 108rpx; + border-radius: 50%; + } + .wrap { + flex: 1; + .name { + max-width: 10em; + font-size: 40rpx; + color: #d64969; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + word-break: break-all; + } + .content { + margin-top: 8rpx; + font-size: 28rpx; + color: #9e9e9e; + word-break: break-all; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + } + } + } + .tip { + margin-top: 20rpx; + font-size: 28rpx; + line-height: 36rpx; + color: #e04775; + text-align: center; + } + .btn { + margin: 32rpx auto 0; + padding: 20rpx 0; + font-size: 36rpx; + color: #d64969; + width: 332rpx; + line-height: 1; + text-align: center; + border-radius: 98rpx 98rpx 98rpx 98rpx; + border: 2rpx solid #d64969; + } + } +} + +.popup-fuel-pack { + .popup-container { + position: relative; + padding: 382rpx 40rpx 0; + box-sizing: border-box; + width: 650rpx; + height: 584rpx; + .close { + position: absolute; + top: 32rpx; + right: 32rpx; + width: 60rpx; + height: 60rpx; + } + .btn { + width: 286rpx; + height: 88rpx; + display: flex; + align-items: center; + justify-content: center; + line-height: 1; + background: linear-gradient(90deg, #fbd270 0%, #eab553 100%); + border-radius: 24rpx 24rpx 24rpx 24rpx; + font-size: 40rpx; + color: #9f6700; + font-weight: bold; + } + } +} + +.popup-weiyi-confirm { + .popup-container { + width: 590rpx; + height: 312rpx; + background: #ffffff; + border-radius: 24rpx 24rpx 24rpx 24rpx; + .content { + padding: 40rpx 40rpx 28rpx; + font-size: 36rpx; + color: #323333; + line-height: 52rpx; + text-align: center; + } + .footer { + padding: 20rpx; + font-size: 36rpx; + color: #cf5375; + line-height: 48rpx; + text-align: center; + border-top: 1px solid rgba(221, 221, 221, 0.27); + } + } +} diff --git a/src/components/toast/index.ts b/src/components/toast/index.ts new file mode 100644 index 0000000..b98247b --- /dev/null +++ b/src/components/toast/index.ts @@ -0,0 +1,139 @@ +const app = getApp() +Component({ + properties: { + show: { + type: Boolean, + value: false, + }, + type: String, + params: { + type: Object, + value() { + return {} + }, + }, + }, + observers: { + show(val) { + if (val) { + app.getTheme().then((res) => { + this.setData({ + theme: res, + }) + }) + if (this.data.params.timeOut) { + let time = this.data.params.timeOut + const timerFunc = () => { + if (time <= 0) { + this.setData({ + timeOut: '', + }) + clearInterval(this.timer) + return + } + this.setData({ + timeOut: `${time}s`, + }) + --time + } + timerFunc() + this.timer = setInterval(timerFunc, 1000) + } + if (['storyLead', 'storyStar', 'storyShare'].includes(this.data.type)) { + this.getSettingInfo() + } + } + this.setData({ + userInfo: app.globalData.userInfo, + }) + }, + type(val) { + if (val === 'healthCare') { + this.getOpenPatientList() + } + }, + }, + data: { + imageUrl: '', + protocol: true, + timeOut: '', + settingsInfo: {}, + userInfo: {}, + openPatientList: {}, + }, + lifetimes: { + attached() { + this.setData({ + imageUrl: app.globalData.imageUrl, + Timestamp: app.globalData.Timestamp, + }) + }, + }, + methods: { + timer: null as any, + handleOk() { + if (this.data.timeOut) { + return + } + this.triggerEvent('ok', { protocol: this.data.protocol }) + }, + handleCancel(e = { currentTarget: { dataset: { key: '' } } }) { + const { key } = e.currentTarget.dataset + if (this.timer) { + clearInterval(this.timer) + this.setData({ + timeOut: '', + }) + } + this.triggerEvent('cancel', { key }) + }, + handleTaskCancel() { + this.triggerEvent('taskCancel') + }, + handleJump() { + this.triggerEvent('jump') + }, + handleDel() { + this.triggerEvent('del') + }, + routerTo(e) { + const { path } = e.currentTarget.dataset + wx.navigateTo({ + url: path, + }) + this.handleCancel() + }, + getSettingInfo() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/drugs/setting-info', + data: {}, + }).then((res) => { + this.setData({ + settingsInfo: res, + }) + }) + }, + getOpenPatientList() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/nrdl/open-patient-list', + data: {}, + }).then((res) => { + this.setData({ + openPatientList: res, + }) + }) + }, + handleProtocolChange() { + this.setData({ + protocol: !this.data.protocol, + }) + }, + handleAdlQuestion() { + wx.navigateTo({ + url: '/pages/repositoryDetail/index?id=9', + }) + }, + }, +}) diff --git a/src/components/toast/index.wxml b/src/components/toast/index.wxml new file mode 100644 index 0000000..451d756 --- /dev/null +++ b/src/components/toast/index.wxml @@ -0,0 +1,827 @@ + + + + + + + 训练完成 + + 完成会员日活动,已获取 + {{params.MemberDayRehabilitationScore}} + 倍能量 + + + 已获取 + {{params.MemberDayScore}} + 能量 + + + + 您已完成第{{params.CompleteTimes + 1}}次训练! + + 获取 + {{params.SendScore}} + 能量能量 + + + 完成 + + + + + + + 该亲友号解绑后 + + 将无法查看ID:{{params.PatientId}}的 + + 所有健康数据,是否继续解绑? + + + 取消 + 确认 + + + + + + + + 删除代表您将放弃发布此条内容 + 删除后无法恢复且不可见 + 确认删除? + + + 确认撤回 + 取消 + + + + + + + 您是希望继续投稿吗? + + 提交 + 取消 + + + + + + + + 删除代表您将放弃发布此条内容 + + 删除后无法恢复且不可见 + + 确认删除? + + + 删除后将从平台同步撤下 + + 您将无法查看和管理 + + 确认删除? + + + 删除 + 取消 + + + + + + + + 抑制物检测提醒 + + {{params.PatientName}}已经有 + {{params.ExposureDays}}个 + 暴露日 + + + 建议做抑制物检测 + {{params.Content}} + + + 我知道了 + + + + + + + + {{params.date}} + {{params.week}} + 请选择您的要添加的记录 + + 录入出血 + 录入治疗 + + + + + + 用户须知 + + + + + {{timeOut || '同意'}} + + + + + + + 康复训练提示 + + (1)因个人体质、病情等不同,本康复训练视频仅供参考; + + (2)不满14岁儿童请或行动不便者,请在监护人、监护人委托的照管人或其它照管人的照看下进行适量训练; + + (3)建议在专业医护人员的指导下进行适量训练并由专业医生评估康复训练前的预防治疗剂量; + + (4)建议遵循说明书指引进行适量训练; + + (5)训练时请按确保您的训练环境安全; + + (6)若训练过程中有任何不适,请立即停止并立刻向医疗卫生专业人士咨询和就诊。 + + + 我已知晓 + + + + + + + + + + (1)您的故事中可能会涉及您、您的孩子或其它人的个人信息甚至敏感个人信息,如个人影像、个人健康信息及生活经历。建议您不要在故事中提及真实身份信息。请您谨慎考虑是否在此公开发布您的故事。您确认并承诺您已经向有关个人进行充分的告知并征得同意。如果有关个人未满14周岁,您确认并承诺您为该儿童的监护人并且同意公开发表该儿童的个人信息。 + + (2)若您上传图片,请您确保享有版权或已经获得第三方的合法授权有权使用,且不侵犯任何其它第三人的合法权益(包括但不限于肖像权、隐私权等)。 + + (3)您故事提交后,由运营人员进行审核、校正和编辑后,才会被发布;您的故事内容将长期发布在“我的故事”版块内。您可以随时从“我的-我的故事”撤回为仅本人查看的非公开模式。 + + + + + 同意审核和编辑后公开发布 + + 您可以随时从“我的-我的故事”撤回为仅本人查看的非公开模式。 + + + 提交我的故事 + + + + + + + + 邀请您分享本人故事 + 发布后获取 + {{settingsInfo.PublishStoryScore}} + 能量激励 + + + + + + + + 你知道吗? + 你的经历 + 可以帮助更多人 + + + 您是否有不一样的故事? + 您的经历或许能给他人带来希望和能量! + 诺和关怀邀请您分享自己的故事。 + + + + 去看看 + + + + + + + + + + + 感谢加油! + + 您的故事或许也能为他人带来能量 + 期待您的故事 + + + + 看看我能做些什么 + + + 审核发布后获取{{settingsInfo.PublishStoryScore}}能量 + + + + + + + + + + + + + 分享您的经验或故事 + 审核发布后 + + 获取 + {{settingsInfo.PublishStoryScore}} + 能量 + + + + + 看看我能做些什么 + + + + + + + + + + + + Hi,{{params.patientName}} + Hi,{{params.patientName}}妈妈 + Hi,{{params.patientName}}爸爸 + Hi,{{params.patientName}}亲友 + + 一分钟探索诺和服务 + + + 领取 + {{params.countIntegralNum}}能量 + 免费兑换礼品 + + 去领取 + + + + + + + + + 自在生活“双达标”测评提醒 + + 建议您每次用药7天后做1次“双达标”测评,更好了解身体变化 + + + + + + 取消 + 立即去做 + + + + + + + + + + + 完成您的MG-ADL评测 + 即可申请项目 + + + + 每周1次MG-ADL记录 + 身体变化有序记录 + + + 1分钟完成MG-ADL + 取消 + + + + + + + + + + + 一步认证成为 + 艾加莫德用药患友 + + + + 专属服务用户登记 + + + + 立即认证 + + + + + + + + + + 给力加油站电话随访服务启动 + + + 随访专员定期和您电话沟通 + 提醒您健康管理 + + + + 《电话随访知情同意书》 + + + 不接受随访 + 接受随访 + + + + + + + + + + 艾加莫德进入医保 + 如何报销立即查看 + + + + 立即查看 + + {{openPatientList.PatientNum}}位用户正在关注 + + + + + + + + + + 完成ADL评分 + 查阅您的专属医保报销解读 + + + + + 什么是MG-ADL? + + + 立即去做 + + + + + + + + + + + + + + + + 同意《用户须知》 + + + + 确定 + + + + + + + + + + 恭喜您完成本周测评,坚持每周评估 + 赚取能量积分拥抱有力人生 + + + +{{params.RewardScore}} + 能量 + + + + + + 第{{index+1}}周 + + + + + + + {{params.Records[index].RewardScore}} + + {{params.PatientScore}}+{{params.PatientScoreExtra}} + + + + + {{params.PatientScore}} + + + + + + + 可用能量积分兑换礼品 + + 我知道了 + + + + + + + + + + 您已完成本周测评 + 坚持每周评估,敏锐识别症状变化 + + + 我知道了 + + + + + + + + + + 恭喜您完成本周用药记录 + 记录后可生成您的专属健康报告 + + + +{{params.RewardScore}} + 能量 + + + + + + 第{{index+1}}周 + + + + + + + {{params.Records[index].RewardScore}} + + {{params.PatientScore}}+{{params.PatientScoreExtra}} + + + {{params.PatientScore}}+{{params.PatientScoreExtra2}} + + {{params.PatientScore}} + + + + 连续2周完成用药还可获得额外奖励 + 连续4周完成用药还可获得额外奖励 + + + 我知道了 + + + + + + + + + + 恭喜您完成本周用药记录 + 记录后可生成您的专属健康报告 + + + 我知道了 + + + + + + + + + 双通道药店是指可购买医保药品并支持医保支付(报销)的药店 + + 已了解 + + + + + + + + + + 点击开始ADL评分 + 识别症状波动 + + 已有{{params.adlUserNum}}人体验 + + 立即体验 + + + + + + + + 立即体验 + + + + + + + 正在生成您的ADL报告 + 导出可能需要一些时间,请您耐心等待 + 取消 + + + + + 确定 + + + + + + + 以下内容涉及患者个人信息,仅用于{{params.HospitalName}}{{params.Name}}医生进行患者随访管理,请在安全环境下查看,不截图,不转发 + + 确定 + + + + + + + + + + + + + 您已选择 + {{params.ProvinceName}}{{params.CityName ? '—' + params.CityName : ''}} + + 取消 + + + + + + + + + + + + + + + + {{params.doctorName}} + {{params.hospitalName}} + + + + + + + + + + + {{params.doctorName}} + {{params.hospitalName}} + + + 建议您2周内及时复诊 + 去看看 + + + + + + + + {{params.DoctorName}} + {{params.HospitalName}} + + + 我知道了 + + + + + + + 立即参加 + + + + + + + + 您即将跳转到微医平台 + + 申请给力加油包2.0升级版 + + 2026关爱项目 + + 跳转中 {{params.time}}s + + + diff --git a/src/components/uploadFile/index.js b/src/components/uploadFile/index.js new file mode 100644 index 0000000..f53cdc2 --- /dev/null +++ b/src/components/uploadFile/index.js @@ -0,0 +1,231 @@ +// components/uploadFile/index.js +const app = getApp(); +Component({ + /** + * 组件的属性列表 + */ + properties: { + // 是否可以上传 + upload: { + type: Boolean, + value: true, + }, + // 附件data + fileList: { + type: Array, + value: [], + }, + accept: { + type: String, + value: "media", + }, + fileTypes: { + // 上传类型 + type: Array, + value: ["image", "video"], + }, + // 拍照和相机 + sourceType: { + type: Array, + value: ["album", "camera"], + }, + // 是否可以删除 + canDelete: { + type: Boolean, + value: true, + }, + // 是否可以下载 + // canDownLoad: { + // type: Boolean, + // value: true + // }, + // 最大上传数量, -1为不限制 + maxNum: { + type: Number, + value: -1, + }, + isSlot: { + type: Boolean, + value: false, + }, + count: { + type: Number, + value: 0, + }, + }, + + /** + * 组件的初始数据 + */ + data: { + Timestamp: app.globalData.Timestamp, + imageUrl: app.globalData.imageUrl, + }, + + /** + * 组件的方法列表 + */ + methods: { + viewFile(e) { + const { index } = e.currentTarget.dataset; + const { fileList } = this.properties; + let sources = []; + + fileList.map((e) => { + const obj = { + url: e.fileUrl, + type: e.type, // image video + poster: e.imgUrl, + }; + sources.push(obj); + }); + wx.previewMedia({ + current: index, + sources: sources, + }); + }, + deleteFile(e) { + const { index, item } = e.currentTarget.dataset; + this.triggerEvent("deleteFile", { + index, + item, + }); + }, + downFile(e) { + const { item } = e.currentTarget.dataset; + wx.showToast({ + title: "正在下载,请稍后...", + icon: "none", + }); + wx.downloadFile({ + url: item.fileUrl, + success(res) { + if (item.type === "image") { + wx.saveImageToPhotosAlbum({ + filePath: res.tempFilePath, + success: () => { + wx.showToast({ + title: "下载成功", + }); + }, + }); + } else if (item.type === "video") { + wx.saveVideoToPhotosAlbum({ + filePath: res.tempFilePath, + success: () => { + wx.showToast({ + title: "下载成功", + }); + }, + }); + } else { + wx.showToast({ + title: "附件请到pc端下载!", + icon: "none", + }); + // wx.saveFile({ + // tempFilePath: res.tempFilePath, + // success: () => { + // wx.showToast({ + // title: '下载成功', + // }) + // }, + // fail(err){ + // console.log(err) + // }, + // }) + } + }, + }); + }, + uploadFile(item) { + return new Promise((resolve, resject) => { + let url = `${app.globalData.upFileUrl}?r=file-service/upload-`; + if (item.fileType === "image") { + url += "img"; + } + if (item.fileType === "video") { + url += "video"; + } + let that = this; + wx.uploadFile({ + filePath: item.tempFilePath, + name: "file", + url: url, + success(res) { + let data = JSON.parse(res.data); + let expandJson = { + fileId: "", + name: data.data.Url, + size: (item.size / 1024).toFixed(2), + fileUrl: data.data.Url, + suffix: that.GetExtensionFileName(data.data.Url), + type: item.fileType, + }; + if (item.fileType === "image") { + expandJson.imgUrl = data.data.Url; + } + if (item.fileType === "video") { + expandJson.imgUrl = data.data.SnapshotUrl; + } + resolve(expandJson); + }, + fail() { + resject(); + }, + }); + }); + }, + GetExtensionFileName(pathfilename) { + var reg = /(\\+)/g; + var pString = pathfilename.replace(reg, "#"); //用正则表达式来将\或\\替换成# + var arr = pString.split("#"); // 以“#”为分隔符,将字符分解为数组 例如 D Program Files bg.png + var lastString = arr[arr.length - 1]; //取最后一个字符 + var arr2 = lastString.split("."); // 再以"."作为分隔符 + return arr2[arr2.length - 1]; //将后缀名返回出来 + }, + upFile(data) { + wx.showLoading({ + title: "正在上传", + }); + let apiArr = []; + data.map((e) => { + apiArr.push(this.uploadFile(e)); + }); + Promise.all(apiArr) + .then((res) => { + wx.hideLoading({ + success: () => { + this.triggerEvent("setData", res); + }, + }); + }) + .catch(() => { + wx.showToast({ + title: "上传失败", + icon: "error", + }); + }); + }, + selectFile() { + let { fileList, maxNum, sourceType, fileTypes, count = 0 } = this.properties; + var that = this; + if (maxNum >= 0 && count == 0) { + count = maxNum - fileList.length; + } + this.triggerEvent("choose"); + wx.chooseMedia({ + mediaType: fileTypes, + count: count, + sourceType: sourceType, + sizeType: ["original"], + success(res) { + res.tempFiles.map((e) => { + e.fileType = e.fileType || res.type; + }); + that.upFile(res.tempFiles); + }, + }); + }, + }, +}); diff --git a/src/components/uploadFile/index.json b/src/components/uploadFile/index.json new file mode 100644 index 0000000..af551e7 --- /dev/null +++ b/src/components/uploadFile/index.json @@ -0,0 +1,8 @@ +{ + "component": true, + "usingComponents": { + "van-icon": "@vant/weapp/icon/index", + "van-image": "@vant/weapp/image/index", + "viewFile": "/components/viewFile/index" + } +} diff --git a/src/components/uploadFile/index.wxml b/src/components/uploadFile/index.wxml new file mode 100644 index 0000000..9443cff --- /dev/null +++ b/src/components/uploadFile/index.wxml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/src/components/uploadFile/index.wxss b/src/components/uploadFile/index.wxss new file mode 100644 index 0000000..177743a --- /dev/null +++ b/src/components/uploadFile/index.wxss @@ -0,0 +1,77 @@ +/* components/uploadFile/index.wxss */ +.page { + display: flex; + flex-wrap: wrap; +} + +.btn { + width: 180rpx; + height: 180rpx; + background: #fff; + border-radius: 12rpx; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + background-color: #F8F8F8; +} + +.btn .text { + color: #9E9999; + font-size: 24rpx; + line-height: 34prx; + margin-top: 16rpx; +} + +.item { + width: 180rpx; + height: 180rpx; + position: relative; + line-height: 0; +} + +.item .image { + width: 100%; + height: 100%; + border-radius: 12rpx; +} + +.clearBox { + position: absolute; + right: -22rpx; + top: -28rpx; + padding: 10rpx; + z-index: 9; +} + +.clear { + width: 100%; + height: 100%; + background: #fff; + border-radius: 100%; + overflow: hidden; + font-size: 0; +} + +.mar { + margin-right: 18rpx; + margin-bottom: 26rpx; +} + +.item_mask { + position: absolute; + width: 100%; + height: 100%; + left: 0; + top: 0; + display: flex; + justify-content: center; + align-items: center; +} + +.item_mask_icon { + border-radius: 100%; + overflow: hidden; + background: #fff; + font-size: 0; +} diff --git a/src/components/viewFile/index.js b/src/components/viewFile/index.js new file mode 100644 index 0000000..d5a8037 --- /dev/null +++ b/src/components/viewFile/index.js @@ -0,0 +1,61 @@ +// components/viewFile/index.js +const app = getApp(); +Component({ + /** + * 组件的属性列表 + */ + properties: { + fileList: { + type: Array, + value: [], + }, + // 是否可以删除 + canDelete: { + type: Boolean, + value: false, + }, + // 是否可以下载 + canDownLoad: { + type: Boolean, + value: false, + }, + }, + + /** + * 组件的初始数据 + */ + data: { + Timestamp: app.globalData.Timestamp, + imageUrl: app.globalData.imageUrl, + }, + + /** + * 组件的方法列表 + */ + methods: { + deleteFile(e) { + const { index, item } = e.currentTarget.dataset; + this.triggerEvent("deleteFile", { + index, + item, + }); + }, + viewFile(e) { + const { index } = e.currentTarget.dataset; + const { fileList } = this.properties; + let sources = []; + fileList.map((e) => { + const obj = { + url: e.fileUrl, + type: e.type, // image video + poster: e.imgUrl, + }; + sources.push(obj); + }); + wx.previewMedia({ + current: index, + sources: sources, + }); + }, + }, +}); diff --git a/src/components/viewFile/index.json b/src/components/viewFile/index.json new file mode 100644 index 0000000..6f50345 --- /dev/null +++ b/src/components/viewFile/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-icon": "@vant/weapp/icon/index" + } +} \ No newline at end of file diff --git a/src/components/viewFile/index.wxml b/src/components/viewFile/index.wxml new file mode 100644 index 0000000..046448f --- /dev/null +++ b/src/components/viewFile/index.wxml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/components/viewFile/index.wxss b/src/components/viewFile/index.wxss new file mode 100644 index 0000000..30e5df2 --- /dev/null +++ b/src/components/viewFile/index.wxss @@ -0,0 +1,48 @@ +/* components/viewFile/index.wxss */ +.page{ + display: flex; + flex-wrap: wrap; +} +.item{ + width: 144rpx; + height: 144rpx; + position: relative; +} +.item .image{ + width: 100%; + height: 100%; + border-radius: 12rpx; +} +.clear{ + width: 32rpx; + height: 32rpx; + background: #fff; + position: absolute; + right: -16rpx; + top: -16rpx; + border-radius: 100%; + overflow: hidden; + font-size: 0; +} +.mar{ + margin-right: 16rpx; + margin-bottom: 16rpx; +} + +.item_mask { + position: absolute; + width: 100%; + height: 100%; + left: 0; + top: 0; + display: flex; + justify-content: center; + align-items: center; +} + +.item_mask_icon { + border-radius: 100%; + overflow: hidden; + background: #fff; + font-size: 0; +} diff --git a/src/components/viewVideo/index.js b/src/components/viewVideo/index.js new file mode 100644 index 0000000..05ea32b --- /dev/null +++ b/src/components/viewVideo/index.js @@ -0,0 +1,66 @@ +/* eslint-disable */ +const app = getApp(); +Component({ + behaviors: ["wx://form-field"], + externalClasses: ["my-class"], + properties: { + src: { + type: String, + value: "", + }, + poster: { + type: String, + value: "", + }, + ViewNum: { + type: Number, + value: "", + }, + autoplay: { + type: Boolean, + value: false, + }, + }, + observers: { + autoplay(val) { + if (val) { + this.setData({ + play: true, + }); + } + }, + }, + relations: {}, + data: { + Timestamp: app.globalData.Timestamp, + play: false, + imageUrl: app.globalData.imageUrl, + }, + lifetimes: { + created() {}, + attached() {}, + detached() {}, + error() {}, + }, + pageLifetimes: { + show() {}, + hide() {}, + resize() {}, + }, + methods: { + hanldePlay() { + console.log(1111111111); + const videoContext = wx.createVideoContext("video", this); + videoContext.play(); + this.setData({ + play: true, + }); + }, + handlePause() { + console.log(11111111); + this.setData({ + play: false, + }); + }, + }, +}); diff --git a/src/components/viewVideo/index.json b/src/components/viewVideo/index.json new file mode 100644 index 0000000..a89ef4d --- /dev/null +++ b/src/components/viewVideo/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} diff --git a/src/components/viewVideo/index.scss b/src/components/viewVideo/index.scss new file mode 100644 index 0000000..7d8e50a --- /dev/null +++ b/src/components/viewVideo/index.scss @@ -0,0 +1,46 @@ +.video { + height: 388rpx; + position: relative; + overflow: hidden; + .video-context { + width: 100%; + height: 100%; + } + .play { + position: absolute; + left: 50%; + top: 50%; + z-index: 10; + transform: translate(-50%, -50%); + width: 96rpx; + height: 96rpx; + } + .status-bar { + position: absolute; + bottom: 0; + left: 0; + width: 100%; + padding: 0 48rpx; + box-sizing: border-box; + height: 78rpx; + display: flex; + align-items: center; + flex-direction: row-reverse; + background: linear-gradient(180deg, rgba(0, 0, 0, 0.02) 0%, #000000 100%); + >view,>image{ + margin-right: 32rpx; +}; + transition: all 0.8s; + .time { + font-size: 24rpx; + color: #ffffff; + } + .start { + font-size: 24rpx; + color: #ffffff; + } + } + .hide { + transform: translateY(100%); + } +} diff --git a/src/components/viewVideo/index.wxml b/src/components/viewVideo/index.wxml new file mode 100644 index 0000000..cd64e06 --- /dev/null +++ b/src/components/viewVideo/index.wxml @@ -0,0 +1,21 @@ + + + + + + diff --git a/src/components/viewVideo/index.wxss b/src/components/viewVideo/index.wxss new file mode 100644 index 0000000..9ad1160 --- /dev/null +++ b/src/components/viewVideo/index.wxss @@ -0,0 +1,46 @@ +.video { + height: 388rpx; + position: relative; + overflow: hidden; +} +.video .video-context { + width: 100%; + height: 100%; +} +.video .play { + position: absolute; + left: 50%; + top: 50%; + z-index: 10; + transform: translate(-50%, -50%); + width: 96rpx; + height: 96rpx; +} +.video .status-bar { + position: absolute; + bottom: 0; + left: 0; + width: 100%; + padding: 0 48rpx; + box-sizing: border-box; + height: 78rpx; + display: flex; + align-items: center; + flex-direction: row-reverse; + background: linear-gradient(180deg, rgba(0, 0, 0, 0.02) 0%, #000000 100%); + >view,>image{ + margin-right: 32rpx; +}; + transition: all 0.8s; +} +.video .status-bar .time { + font-size: 24rpx; + color: #ffffff; +} +.video .status-bar .start { + font-size: 24rpx; + color: #ffffff; +} +.video .hide { + transform: translateY(100%); +} diff --git a/src/custom-tab-bar/index.json b/src/custom-tab-bar/index.json new file mode 100644 index 0000000..4573acb --- /dev/null +++ b/src/custom-tab-bar/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": { + "van-tabbar": "@vant/weapp/tabbar/index", + "van-tabbar-item": "@vant/weapp/tabbar-item/index" + } +} diff --git a/src/custom-tab-bar/index.scss b/src/custom-tab-bar/index.scss new file mode 100644 index 0000000..bad5962 --- /dev/null +++ b/src/custom-tab-bar/index.scss @@ -0,0 +1,19 @@ +/* custom-tab-bar/index.wxss */ + + +.tab-item { + .icon { + width: 50rpx; + height: 50rpx; + } + .name { + font-size: 24rpx; + color: #CCCCCC; + &.active{ + color: #CF5375; + } + &.drug-active{ + color: #25D9C8; + } + } +} diff --git a/src/custom-tab-bar/index.ts b/src/custom-tab-bar/index.ts new file mode 100644 index 0000000..b7b6f46 --- /dev/null +++ b/src/custom-tab-bar/index.ts @@ -0,0 +1,113 @@ +import { getCurrentPageUrl } from '@/utils/util' +const app = getApp() + +Component({ + properties: {}, + data: { + imageUrl: app.globalData.imageUrl, + isChild: 0, + active: 0, + list: [ + { + pagePath: '/pages/index/index', + text: '首页', + icon: 'home', + iconActive: 'home-active', + }, + { + pagePath: '/pages/repository/index', + text: 'MG全知道', + icon: 'story', + iconActive: 'story-active', + }, + { + pagePath: '/pages/live/index', + text: '周三大咖说', + icon: 'gift', + iconActive: 'gift-active', + }, + { + pagePath: '/pages/story/index', + text: '向往的生活', + icon: 'class', + iconActive: 'class-active', + }, + { + pagePath: '/pages/my/index', + text: '我的', + icon: 'my', + iconActive: 'my-active', + }, + ], + userInfo: {}, + showRed: false, + anyWhere: false, + + config: {} as any, + }, + observers: {}, + lifetimes: { + ready() { + app.getTheme().then((res) => { + this.setData({ + theme: res, + }) + }) + + const pagePath = getCurrentPageUrl() + const active = this.data.list.findIndex((item) => item.pagePath === pagePath) + this.setData({ + active, + anyWhere: app.globalData.anyWhere, + }) + this.setData({ + showRed: app.globalData.showRed, + }) + getApp().registerListener(() => { + this.setData({ + anyWhere: app.globalData.anyWhere, + }) + wx.ajax({ + method: 'GET', + url: '?r=igg4/common/get-config', + }).then((res) => { + this.setData({ + config: res, + }) + }) + }) + }, + }, + methods: { + onChange() {}, + handleNav(e) { + const { index } = e.currentTarget.dataset + const { list, config } = this.data + const pagePath = list[index].pagePath + app.globalData.BeginnerCardId = '' + this.setData({ + anyWhere: app.globalData.anyWhere, + }) + if (pagePath == '/pages/my/index') { + app.permissionVerification(2, 0, `/pages/index/index`).then(() => { + wx.switchTab({ + url: pagePath, + }) + }) + } else if (pagePath == '/pages/repository/index' && config.picTextEbookStatus == 1) { + app.permissionVerification(2, 0, `/pages/repository/index`).then(() => { + const webviewUrl = encodeURIComponent( + `${app.globalData.url}/zdcare/#/cover?loginState=${app.globalData.loginState}`, + ) + wx.navigateTo({ + url: `/pages/webview/index?url=${webviewUrl}`, + }) + }) + } else { + wx.switchTab({ + url: pagePath, + }) + } + }, + }, +}) diff --git a/src/custom-tab-bar/index.wxml b/src/custom-tab-bar/index.wxml new file mode 100644 index 0000000..23d9a92 --- /dev/null +++ b/src/custom-tab-bar/index.wxml @@ -0,0 +1,16 @@ + + + + + + {{item.text}} + + + + diff --git a/src/doc/pages/doc1/index.json b/src/doc/pages/doc1/index.json new file mode 100644 index 0000000..0af6714 --- /dev/null +++ b/src/doc/pages/doc1/index.json @@ -0,0 +1,6 @@ +{ + "navigationBarTitleText": "个人信息及隐私保护政策", + "usingComponents": { + "mp-html": "mp-html" + } +} diff --git a/src/doc/pages/doc1/index.scss b/src/doc/pages/doc1/index.scss new file mode 100644 index 0000000..0b69ddc --- /dev/null +++ b/src/doc/pages/doc1/index.scss @@ -0,0 +1,3 @@ +.page{ + padding: 0 40rpx; +} diff --git a/src/doc/pages/doc1/index.ts b/src/doc/pages/doc1/index.ts new file mode 100644 index 0000000..5785479 --- /dev/null +++ b/src/doc/pages/doc1/index.ts @@ -0,0 +1,10 @@ +const _app = getApp() + +Page({ + data: { + doc: `


生效日期:2025年4月

给力加油站(以下简称“我们”)非常注重保护用户(“您”)的个人信息及隐私。我们希望通过本《个人信息及隐私保护政策》(以下简称本“隐私政策”或本“政策”)向您清晰地介绍在使用我们的产品/服务时,我们如何处理您的个人信息的方式。

我们提供的服务包括给力加油站医生端小程序、微信公众号向您提供的各项服务(以下简称“本服务”),适用本隐私政策。

请您在使用本服务前,务必仔细阅读并充分理解本隐私政策。我们将逐一说明我们收集您的个人信息的类型及其对应的用途,以便您了解我们针对某一特定功能或服务所收集的具体个人信息的类别、使用理由及收集方式。

本隐私政策将帮您了解以下信息:

1. 我们如何收集和使用您的个人信息

2. 我们基于何种目的或场景,收集和使用您的个人信息

3. 我们如何使用Cookie等同类技术

4. 我们如何委托处理、共享、转让、公开披露您的个人信息

5. 我们如何保存、保护您的个人信息

6. 您查阅、更正、删除、注销个人信息的权利

7. 未成年人保护

8. 本隐私政策变更及通知

9. 如何联系我们

10. 名词定义和解释

一、 我们如何收集和使用您的个人信息

(一) 我们会根据本隐私政策的约定,为实现本平台服务而对所收集的个人信息进行使用。

(二) 我们深知个人信息对您的重要性,并会尽全力保护您的个人信息安全可靠。我们致力于维持您对我们的信任,恪守以下原则,保护您的个人信息:合法、正当、必要和诚信原则,目的明确和直接相关原则,公开透明原则、准确性原则、问责性原则、数据安全原则等。同时,我们承诺采取必要的措施保障您的个人信息的安全。

二、 我们基于何种目的或场景,收集和使用您的个人信息

出于本隐私政策所描述的目的或场景,当您使用本平台服务时,我们可能会收集有关您的如下个人信息。若您不同意提供下列信息,有权拒绝提供或撤回同意,但您可能无法继续使用本平台的全部或部分服务:

(一) 注册登录账号

1. 当您关注给力加油站微信公众号时,我们会收集您的微信openID以及您关注、取消关注本公众号的行为数据,以便我们识别用户身份。

2. 当您登录使用给力加油站小程序时,您需要输入您的手机号码,通过手机号码加短信验证码的方式进行登录;或通过您的微信openID获取手机号进行手机号快捷登录。

(二) 向您提供本平台服务

您仅能查看本人管理患者的信息和数据。

1. 数据看板

当您在给力加油站平台登录后,您可以查看关键统计数据及图表看板;

2. 患者ADL评分查看

您可以查看患者的ADL测评评分;包括具体评分数和得分变化情况;

3. 互动

您可以查看用户通过系统标准问答库内选择点击后发送给您的问题,您可以从标准问答库内选择合适文本内容进行应答;

4. 就诊地图

就诊地图为全国患者提供就医信息的检索,查询全国的就诊信息,我们会收集并在就诊地图内展示您所在医院、您的出诊时间及个人介绍。我们会向您本人收集,并通过就诊地图功能公开展示您提供的此类个人信息;关于医生个人简介和门诊信息,平台将收集医院公示的信息作为参考,并由您本人确认。

(三) 如果您对我们收集和使用您的个人信息的法律依据有任何疑问或需要提供进一步的信息,请通过本隐私政策第九章节「如何联系我们」提供的联系方式与我们联系。

(四) 本平台向您提供的服务可能将不断更新和发展,如果您选择使用本隐私政策中尚未列明的其他功能或服务时,我们会在收集您的个人信息前通过推送通知、更为显著的弹窗等方式向您详细说明信息收集的目的、方式、范围并征求您的同意。

三、 我们如何使用小程序原生能力技术

(一) 依托于微信小程序提供的原生能力

为了帮助提升您的产品体验,我们会使用微信提供的账号体系能力来避免您重复登录。所有的信息获取都会经过您的授权同意才会使用。

四、 我们如何委托处理、共享、转让、公开披露您的个人信息

(一) 委托处理

我们会聘请服务提供商来协助我们提供客户支持。对我们委托的公司、组织和个人,我们会要求他们按照本个人信息保护政策来处理您的个人信息。

(二) 共享

我们不会将任何个人信息出售给第三方。我们不会向给力加油站小程序、微信公众号运营公司以外的任何公司、组织和个人提供您的个人信息,但以下情况除外:

a) 在向您进行明确告知并获取您的单独同意的情况下共享:获得您的单独同意后,我们会与我们所披露的有关个人信息处理者共享您的相关个人信息;

(三) 转让

我们不会将您的个人信息转让给任何公司、组织和个人,但以下情况除外:

a) 在向您进行明确告知并获取您的单独同意的情况下转让:获得您的单独同意后,我们会向我们所披露的有关个人信息处理者转让您的相关个人信息;

(四) 公开披露

我们仅会在获得您明确同意后,公开披露您的个人信息。

五、 我们如何保存、保护您的个人信息

(一) 保存地点

我们依照法律法规的规定,将在境内运营过程中收集和产生的您的个人信息存储于中华人民共和国境内。目前,我们不会将上述信息传输至其他地区。

(二) 保存时间

我们会采取一切合理可行的措施,确保未收集无关的个人信息。 给力加油站小程序、微信公众号中个人信息储存必要期限是给力加油站小程序、微信公众号为您终止服务后3年。超出必要期限后,我们将对您的个人信息进行删除或匿名化处理,但法律法规另有规定的除外。

(三) 保护措施

我们已使用符合业界标准的安全防护措施保护您提供的个人信息,防止数据遭到未经授权访问、公开披露、使用、修改、损坏或丢失。我们会采取一切合理可行的措施,保护您的个人信息。我们会部署访问控制机制,确保只有授权人员才可访问个人信息。

(四) 安全事件处理

在发生个人信息安全事件后,我们将按照法律法规的要求,及时向您告知:安全事件的基本情况和可能的影响、我们已采取或将要采取的处置措施、您可自主防范和降低风险的建议、对您的补救措施等。我们将及时将事件相关情况以邮件、信函、电话、推送通知等方式告知您。

六、 您查阅、更正、删除、注销个人信息的权利

我们非常重视并保护您对于个人信息处理活动中的知情权、决定权、限制权、拒绝权等权利,并为您提供了行使在个人信息处理活动中相关权利的方法。

(一) 查阅权和更正权

除法律法规规定的情形除外,您有权随时查阅和更正您的个人信息,您可以通过在本平台的【我的】-【个人信息】查阅或更正您的个人信息,包括手机号、姓名、头像、医院、门诊时间、个人简介等信息。

(二) 删除权

1. 您可通过微信的缓存清理功能,删除您在本平台的缓存记录提供的相关个人信息。

2. 如果您需要删除您在使用本平台过程中产生的其他个人信息,在您的合理要求并经验证核实您的身份后,我们会处理您的请求。您可以通过本隐私政策「第九章节、如何联系我们」方式向我们进行反馈。

3. 在以下情形中,您可以向我们提出删除个人信息的请求:

(1) 我们永久不再为您提供产品或服务;

(2) 您撤回对我们收集、使用您的个人信息的同意;

(3) 我们处理个人信息的行为违反法律、行政法规;

(4) 我们处理个人信息的行为违反了与您的约定;

(5) 您注销了用户帐号;

(6) 法律、行政法规规定的其他情形。

4. 您同意并理解,您删除某些您已提交的个人信息可能导致您无法使用本平台的部分或者全部服务。

(三) 注销权

如您希望注销本平台及服务,您可以通过发送邮件到supportpr@hbraas.com进行账号的注销。

一旦您注销账户,我们将停止为您提供服务。请您谨慎操作,否则,因注销账号产生的数据丢失问题均由您自行承担。当您选择注销账户后,我们将停止为您提供服务,并依据您的要求,删除您的个人信息。

七、 未成年人保护

我们非常重视对未成年人个人信息的保护,本平台的注册用户仅包括供医疗卫生专业人士。不涉及18周岁以下的未成年人注册为本平台账户。若您是未成年人,不得予以注册。

八、 本隐私政策变更及通知

(一) 为了向您提供更好的功能与/或服务,我们的产品/服务将不时更新与变化,因此,我们将适时修订及变更隐私政策。

(二) 未经您明确同意,我们不会削减您按照本隐私政策所应享有的权利。我们会在本页面上发布对本政策所做的任何变更。

(三) 对于重大变更,我们可能还会提供本平台公告、推送通知或更为显著的弹窗等方式,向您发送隐私政策的最新版本。

九、 如何联系我们

若您对本服务有任何疑问、意见或建议,您可以通过以下方式与我们联系:

邮箱:supportpr@hbraas.com

一般情况下,我们将在7天内回复。

十、 名词定义与解释

本平台:通过电子化信息平台运营和提供的数字化产品和服务,电子化信息平台包括但不限于 给力加油站小程序、微信公众号提供数字化产品和服务的系统或平台等,具体以用户实际注册、访问或使用为准(对于该等数字化产品和服务,本协议统称为“电子化信息平台”或“平台”或“本平台”)

个人信息:以电子或者其他方式记录的与已识别或可识别的自然人有关的各种信息,不包括匿名化处理后的信息。如姓名等;

OPENID:OPENID是微信用户在注册公众号后的唯一独立加密用户身份标识,此处OPENID是指本平台用户注册后的唯一加密用户身份标识。

`, + }, + onLoad() {}, +}) + +export {} diff --git a/src/doc/pages/doc1/index.wxml b/src/doc/pages/doc1/index.wxml new file mode 100644 index 0000000..68e15cb --- /dev/null +++ b/src/doc/pages/doc1/index.wxml @@ -0,0 +1,3 @@ + + + diff --git a/src/doc/pages/doc2/index.json b/src/doc/pages/doc2/index.json new file mode 100644 index 0000000..0af6714 --- /dev/null +++ b/src/doc/pages/doc2/index.json @@ -0,0 +1,6 @@ +{ + "navigationBarTitleText": "个人信息及隐私保护政策", + "usingComponents": { + "mp-html": "mp-html" + } +} diff --git a/src/doc/pages/doc2/index.scss b/src/doc/pages/doc2/index.scss new file mode 100644 index 0000000..0b69ddc --- /dev/null +++ b/src/doc/pages/doc2/index.scss @@ -0,0 +1,3 @@ +.page{ + padding: 0 40rpx; +} diff --git a/src/doc/pages/doc2/index.ts b/src/doc/pages/doc2/index.ts new file mode 100644 index 0000000..2c4fa68 --- /dev/null +++ b/src/doc/pages/doc2/index.ts @@ -0,0 +1,10 @@ +const _app = getApp() + +Page({ + data: { + doc: `


生效日期:2025年4月

【重症肌无力患者支持“gMG给力加油站”项目】(以下简称“我们”)非常注重保护用户(“您”)的个人信息及隐私。我们希望通过本《个人信息及隐私保护政策》(以下简称本“隐私政策”或本“政策”)向您清晰地介绍在使用我们的产品/服务时,我们如何处理您的个人信息的方式。

我们提供的服务包括给力加油站患者端小程序、微信公众号向您提供的各项服务(以下简称“本服务”),适用本隐私政策。

请您在使用本服务前,务必仔细阅读并充分理解本隐私政策。我们将逐一说明我们收集您的个人信息的类型及其对应的用途,以便您了解我们针对某一特定功能或服务所收集的具体个人信息的类别、使用理由及收集方式。

本隐私政策将帮您了解以下信息:

1. 我们如何收集和使用您的个人信息

2. 我们基于何种目的或场景,收集和使用您的个人信息

3. 我们如何使用Cookie等同类技术

4. 我们如何委托处理、共享、转让、公开披露您的个人信息

5. 我们如何保存、保护您的个人信息

6. 您查阅、更正、删除、注销个人信息的权利

7. 未成年人保护

8. 本隐私政策变更及通知

9. 如何联系我们

10. 名词定义和解释

一、 我们如何收集和使用您的个人信息

(一) 我们会根据本隐私政策的约定,为实现本平台服务而对所收集的个人信息进行使用。

(二) 我们深知个人信息对您的重要性,并会尽全力保护您的个人信息安全可靠。我们致力于维持您对我们的信任,恪守以下原则,保护您的个人信息:合法、正当、必要和诚信原则,目的明确和直接相关原则,公开透明原则、准确性原则、问责性原则、数据安全原则等。同时,我们承诺采取必要的措施保障您的个人信息的安全。

二、 我们基于何种目的或场景,收集和使用您的个人信息

出于本隐私政策所描述的目的或场景,当您使用本平台服务时,我们可能会收集有关您的如下个人信息。若您不同意提供下列信息,有权拒绝提供或撤回同意,但您可能无法继续使用本平台的全部或部分服务:

(一) 注册登录账号

1. 当您关注给力加油站微信公众号时,我们会收集您的微信openID以及您关注、取消关注本公众号的行为数据,以便我们识别用户身份。

2. 当您登录使用给力加油站小程序时,您需要输入您的手机号码,通过手机号码加短信验证码的方式进行登录;或通过您的微信openID获取手机号进行手机号快捷登录。

(二) 向您提供本平台服务

1.注册成为用户:

为完成创建账号,您需提供您的姓名、手机号码,年龄,性别,完成账号注册,您后续可以自主在【我的】-【个人信息】中填写或更正您的信息;

2.ADL测评工具:

您可使用ADL双达标测评服务评估您的症状变化,我们将记录您在使用本服务期间的所有测评结果,并为您生成健康报告。

3.周三大咖说:

我们为您提供大咖说活动报名服务,报名完成后我们将记录您的userID、报名时间,我们基于此信息更新您的活动报名状态;

4.MG全知道:教育服务:

我们为您提供疾病知识服务,我们将记录您在使用本服务期间的内容浏览状态;

5.互动服务:

您在绑定专属医生后,您可使用医患互动服务。您可以从统提供的标准问答库内选择问题发送给医生,并接收医生从标准问答库内选择的问答回复;

6.就诊地图

为了您可以在就诊地图模块快速查看附近处的医院及就诊医生信息,我们会我们将请您授权我们获取您设备的地理位置权限,您可在开启权限后使用该功能。若未开启不影响您的功能的使用。

(三) 如果您对我们收集和使用您的个人信息的法律依据有任何疑问或需要提供进一步的信息,请通过本隐私政策第九章节「如何联系我们」提供的联系方式与我们联系。

(四) 本平台向您提供的服务可能将不断更新和发展,如果您选择使用本隐私政策中尚未列明的其他功能或服务时,我们会在收集您的个人信息前通过推送通知、更为显著的弹窗等方式向您详细说明信息收集的目的、方式、范围并征求您的同意。

三、 我们如何使用小程序原生能力技术

(一) 依托于微信小程序提供的原生能力

为了帮助提升您的产品体验,我们会使用微信提供的账号体系能力来避免您重复登录。所有的信息获取都会经过您的授权同意才会使用。

四、 我们如何委托处理、共享、转让、公开披露您的个人信息

(一) 委托处理

我们会聘请服务提供商来协助我们提供客户支持。对我们委托的公司、组织和个人,我们会要求他们按照本个人信息保护政策来处理您的个人信息。

(二) 共享

我们不会将任何个人信息出售给第三方。我们不会向给力加油站小程序、微信公众号运营公司以外的任何公司、组织和个人提供您的个人信息,但以下情况除外:

a) 在向您进行明确告知并获取您的单独同意的情况下共享:获得您的单独同意后,我们会与我们所披露的有关个人信息处理者共享您的相关个人信息;

(三) 转让

我们不会将您的个人信息转让给任何公司、组织和个人,但以下情况除外:

a) 在向您进行明确告知并获取您的单独同意的情况下转让:获得您的单独同意后,我们会向我们所披露的有关个人信息处理者转让您的相关个人信息;

(四) 公开披露

我们仅会在获得您明确同意后,公开披露您的个人信息。

五、 我们如何保存、保护您的个人信息

(一) 保存地点

我们依照法律法规的规定,将在境内运营过程中收集和产生的您的个人信息存储于中华人民共和国境内。目前,我们不会将上述信息传输至其他地区。

(二) 保存时间

我们会采取一切合理可行的措施,确保未收集无关的个人信息。 给力加油站小程序、微信公众号中个人信息储存必要期限是给力加油站小程序、微信公众号为您终止服务后3年。超出必要期限后,我们将对您的个人信息进行删除或匿名化处理,但法律法规另有规定的除外。

(三) 保护措施

我们已使用符合业界标准的安全防护措施保护您提供的个人信息,防止数据遭到未经授权访问、公开披露、使用、修改、损坏或丢失。我们会采取一切合理可行的措施,保护您的个人信息。我们会部署访问控制机制,确保只有授权人员才可访问个人信息。

(四) 安全事件处理

在发生个人信息安全事件后,我们将按照法律法规的要求,及时向您告知:安全事件的基本情况和可能的影响、我们已采取或将要采取的处置措施、您可自主防范和降低风险的建议、对您的补救措施等。我们将及时将事件相关情况以邮件、信函、电话、推送通知等方式告知您。

六、 您查阅、更正、删除、注销个人信息的权利

我们非常重视并保护您对于个人信息处理活动中的知情权、决定权、限制权、拒绝权等权利,并为您提供了行使在个人信息处理活动中相关权利的方法。

(一) 查阅权和更正权

除法律法规规定的情形除外,您有权随时查阅和更正您的个人信息,您可以通过在本平台的【我的】-【个人信息】查阅或更正您的个人信息,包括手机号、姓名、头像、医院、门诊时间、个人简介等信息。

(二) 删除权

1. 您可通过微信的缓存清理功能,删除您在本平台的缓存记录提供的相关个人信息。

2. 如果您需要删除您在使用本平台过程中产生的其他个人信息,在您的合理要求并经验证核实您的身份后,我们会处理您的请求。您可以通过本隐私政策「第九章节、如何联系我们方式向我们进行反馈。

3. 在以下情形中,您可以向我们提出删除个人信息的请求:

(1) 我们永久不再为您提供产品或服务;

(2) 您撤回对我们收集、使用您的个人信息的同意;

(3) 我们处理个人信息的行为违反法律、行政法规;

(4) 我们处理个人信息的行为违反了与您的约定;

(5) 您注销了用户帐号;

(6) 法律、行政法规规定的其他情形。

4. 您同意并理解,您删除某些您已提交的个人信息可能导致您无法使用本平台的部分或者全部服务。

(三) 注销权

如您希望注销本平台及服务,您可以通过发送邮件到supportpr@hbraas.com进行账号的注销。

一旦您注销账户,我们将停止为您提供服务。请您谨慎操作,否则,因注销账号产生的数据丢失问题均由您自行承担。当您选择注销账户后,我们将停止为您提供服务,并依据您的要求,删除您的个人信息。

七、 未成年人保护

我们非常重视对未成年人个人信息的保护,本平台的注册用户仅包括供医疗卫生专业人士。不涉及18周岁以下的未成年人注册为本平台账户。若您是未成年人,不得予以注册。

八、 本隐私政策变更及通知

(一) 为了向您提供更好的功能与/或服务,我们的产品/服务将不时更新与变化,因此,我们将适时修订及变更隐私政策。

(二) 未经您明确同意,我们不会削减您按照本隐私政策所应享有的权利。我们会在本页面上发布对本政策所做的任何变更。

(三) 对于重大变更,我们可能还会提供本平台公告、推送通知或更为显著的弹窗等方式,向您发送隐私政策的最新版本。

九、 如何联系我们

若您对本服务有任何疑问、意见或建议,您可以通过以下方式与我们联系:

邮箱:supportpr@hbraas.com

一般情况下,我们将在7天内回复。

十、 名词定义与解释

本平台:通过电子化信息平台运营和提供的数字化产品和服务,电子化信息平台包括但不限于 给力加油站小程序、微信公众号提供数字化产品和服务的系统或平台等,具体以用户实际注册、访问或使用为准(对于该等数字化产品和服务,本协议统称为“电子化信息平台”或“平台”或“本平台”)

个人信息:以电子或者其他方式记录的与已识别或可识别的自然人有关的各种信息,不包括匿名化处理后的信息。如姓名等;

OPENID:OPENID是微信用户在注册公众号后的唯一独立加密用户身份标识,此处OPENID是指本平台用户注册后的唯一加密用户身份标识。


`, + }, + onLoad() {}, +}) + +export {} diff --git a/src/doc/pages/doc2/index.wxml b/src/doc/pages/doc2/index.wxml new file mode 100644 index 0000000..68e15cb --- /dev/null +++ b/src/doc/pages/doc2/index.wxml @@ -0,0 +1,3 @@ + + + diff --git a/src/doctor/components/tabbar/index.json b/src/doctor/components/tabbar/index.json new file mode 100644 index 0000000..4573acb --- /dev/null +++ b/src/doctor/components/tabbar/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": { + "van-tabbar": "@vant/weapp/tabbar/index", + "van-tabbar-item": "@vant/weapp/tabbar-item/index" + } +} diff --git a/src/doctor/components/tabbar/index.scss b/src/doctor/components/tabbar/index.scss new file mode 100644 index 0000000..0810680 --- /dev/null +++ b/src/doctor/components/tabbar/index.scss @@ -0,0 +1,9 @@ +.tabbar-item { + width: 25%; + font-size: 20rpx; + color: rgba(103, 113, 114, 1); + .icon { + width: 45rpx; + height: 45rpx; + } +} diff --git a/src/doctor/components/tabbar/index.ts b/src/doctor/components/tabbar/index.ts new file mode 100644 index 0000000..fa011b3 --- /dev/null +++ b/src/doctor/components/tabbar/index.ts @@ -0,0 +1,73 @@ +const app = getApp() + +// pages/story/a.ts +Component({ + /** + * 组件的属性列表 + */ + properties: { + active: { + type: Number, + value: 1000, + }, + }, + + /** + * 组件的初始数据 + */ + data: { + imageUrl: app.globalData.imageUrl, + Timestamp: app.globalData.Timestamp, + + unReadCount: 0, + + tablist: [ + { + name: '首页', + path: '/doctor/pages/d_home/index', + }, + { + name: '患者', + path: '/doctor/pages/d_patient/index', + }, + { + name: '互动', + path: '/doctor/pages/d_interactive/index', + }, + { + name: '我的', + path: '/doctor/pages/d_my/index', + }, + ], + }, + lifetimes: { + attached() { + // app.waitLogin().then((_res) => { + // this.getList() + // }) + }, + }, + /** + * 组件的方法列表 + */ + methods: { + onChange(e) { + if (e.detail === this.data.active) return + const index = e.detail + const path = this.data.tablist[index].path + wx.reLaunch({ + url: path, + }) + }, + getList() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/message-interact/get-interact-patient-list', + }).then((res) => { + this.setData({ + unReadCount: res.unReadCount, + }) + }) + }, + }, +}) diff --git a/src/doctor/components/tabbar/index.wxml b/src/doctor/components/tabbar/index.wxml new file mode 100644 index 0000000..c520070 --- /dev/null +++ b/src/doctor/components/tabbar/index.wxml @@ -0,0 +1,22 @@ + + + + + {{item.name}} + + diff --git a/src/doctor/pages/d_changeDoctor/index.json b/src/doctor/pages/d_changeDoctor/index.json new file mode 100644 index 0000000..f1fd05e --- /dev/null +++ b/src/doctor/pages/d_changeDoctor/index.json @@ -0,0 +1,8 @@ +{ + "navigationBarTitleText": "登录", + "navigationStyle": "custom", + "usingComponents": { + "van-divider": "@vant/weapp/divider/index", + "navBar": "/components/navBar/navBar" + } +} diff --git a/src/doctor/pages/d_changeDoctor/index.scss b/src/doctor/pages/d_changeDoctor/index.scss new file mode 100644 index 0000000..1c03f55 --- /dev/null +++ b/src/doctor/pages/d_changeDoctor/index.scss @@ -0,0 +1,113 @@ +.page { + min-height: 100vh; + padding: 460rpx 0 80rpx 0; + box-sizing: border-box; + .container { + padding: 0 60rpx; + .c-title { + font-size: 36rpx; + color: rgba(32, 33, 33, 1); + font-weight: bold; + } + .content { + margin-top: 30rpx; + font-size: 32rpx; + color: rgba(32, 33, 33, 1); + line-height: 56rpx; + .link { + color: rgba(67, 168, 188, 1); + } + } + } + .form { + margin-top: 58rpx; + padding: 0 60rpx; + .row { + margin-bottom: 32rpx; + display: flex; + justify-content: space-between; + border-radius: 64rpx; + background: rgba(247, 247, 247, 1); + border: 1rpx solid rgba(237, 239, 240, 1); + .input { + flex: 1; + padding: 20rpx 32rpx; + height: 40rpx; + font-size: 32rpx; + color: #999999; + } + .input-placeholade { + color: rgba(194, 201, 202, 1); + } + .code { + margin-left: 24rpx; + flex-shrink: 0; + width: 262rpx; + border-radius: 24rpx; + font-size: 32rpx; + color: rgba(103, 186, 202, 1); + display: flex; + align-items: center; + justify-content: center; + } + } + .submit { + margin-top: 32px; + padding: 24rpx 20rpx; + width: 622rpx; + background: rgba(103, 186, 202, 1); + border-radius: 64rpx; + font-size: 36rpx; + color: #ffffff; + font-weight: bold; + text-align: center; + line-height: 1; + } + } + .divider { + margin: 36rpx auto 0; + width: 338rpx; + } + .phone { + margin: 0 48rpx; + padding: 24rpx 20rpx; + border-radius: 64rpx; + background: #eeeeee; + font-size: 36rpx; + color: rgba(103, 186, 202, 1); + line-height: 1; + &::after { + border: none; + outline: none; + } + } + .partient { + margin-top: 58rpx; + font-size: 36rpx; + color: rgba(103, 186, 202, 1); + display: flex; + gap: 10rpx; + align-items: center; + justify-content: center; + .arrow { + width: 23rpx; + height: 19rpx; + } + } + .check { + margin: 50rpx 0 0; + display: flex; + line-height: 60rpx; + color: rgba(32, 33, 33, 1); + .icon { + margin-top: 12rpx; + margin-right: 10rpx; + flex-shrink: 0; + width: 32rpx; + height: 32rpx; + } + .link { + color: rgba(67, 168, 188, 1); + } + } +} diff --git a/src/doctor/pages/d_changeDoctor/index.ts b/src/doctor/pages/d_changeDoctor/index.ts new file mode 100644 index 0000000..273c7cf --- /dev/null +++ b/src/doctor/pages/d_changeDoctor/index.ts @@ -0,0 +1,109 @@ +const app = getApp() +let timer = null as null | number + +Page({ + data: { + mobile: '', + code: '', + codeText: '发送验证码', + check: false, + }, + onLoad() {}, + getCode() { + if (timer) return + const mobile = this.data.mobile + if (!mobile) { + wx.showToast({ + title: '手机号不能为空', + icon: 'none', + }) + return + } + // 验证手机号 + if (!/^1[3-9,]\d{9}$/.test(mobile)) { + wx.showToast({ + title: '手机号格式不正确', + icon: 'none', + }) + return + } + wx.ajax({ + method: 'POST', + url: '?r=igg4/login/send-verify-code', + data: { + mobile, + }, + }).then((_res) => { + wx.showToast({ + icon: 'none', + title: '验证码已发送~', + }) + let time = 60 + timer = setInterval(() => { + time-- + this.setData({ + codeText: `${time}s后重新发送`, + }) + if (time <= 0) { + clearInterval(timer as number) + timer = null + this.setData({ + codeText: '发送验证码', + }) + } + }, 1000) + }) + }, + handleSubmit() { + if (!this.data.mobile) { + wx.showToast({ + icon: 'none', + title: '请输入手机号', + }) + return + } + if (!this.data.code) { + wx.showToast({ + icon: 'none', + title: '请输入验证码', + }) + return + } + if (!this.data.check) { + wx.showToast({ + icon: 'none', + title: '请同意用户协议', + }) + return + } + wx.ajax({ + method: 'POST', + url: '?r=igg4/doctor/login/change-doctor-login', + data: { + mobile: this.data.mobile, + code: this.data.code, + }, + }).then((_res) => { + this.submitCallback() + }) + }, + submitCallback() { + app.getUserInfo() + wx.reLaunch({ + url: '/doctor/pages/d_home/index', + }) + }, + handleLink() { + wx.navigateTo({ + url: '/doc/pages/doc1/index', + }) + }, + handleCheck() { + this.setData({ + check: !this.data.check, + }) + }, + handleBack() { + wx.navigateBack() + }, +}) diff --git a/src/doctor/pages/d_changeDoctor/index.wxml b/src/doctor/pages/d_changeDoctor/index.wxml new file mode 100644 index 0000000..c7f4b58 --- /dev/null +++ b/src/doctor/pages/d_changeDoctor/index.wxml @@ -0,0 +1,45 @@ + + + + 尊敬的医生您好 + gMG 给力加油站是中国罕见病联盟/北京罕见病诊疗与保障学会发起的gMG患者健康全程管理平台; + + 在您加入gMG 给力加油站平台之前,请您阅读并充分理解 + 《隐私协议保护政策》 + ,了解您的权益及相关数据处理方法,我们将严格按照法律法规及 + 《隐私协议保护政策》 + 的相关规定,保证您的个人信息不受侵犯。 + + + + + + + + + {{codeText}} + + 切换医生 + + + + + 我特此同意依照此 + 《隐私协议保护政策》 + 规定收集我的个人敏感信息 + + + + diff --git a/src/doctor/pages/d_changePhone/index.json b/src/doctor/pages/d_changePhone/index.json new file mode 100644 index 0000000..421afc5 --- /dev/null +++ b/src/doctor/pages/d_changePhone/index.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "更换手机号", + "usingComponents": {} +} diff --git a/src/doctor/pages/d_changePhone/index.scss b/src/doctor/pages/d_changePhone/index.scss new file mode 100644 index 0000000..6d60fce --- /dev/null +++ b/src/doctor/pages/d_changePhone/index.scss @@ -0,0 +1,45 @@ +.page { + padding: 88rpx 60rpx; + .row { + margin-bottom: 32rpx; + padding: 18rpx 48rpx; + background: #f2f4f5; + border-radius: 64rpx 64rpx 64rpx 64rpx; + border: 1rpx solid #edeff0; + display: flex; + .place-input { + color: rgba(194, 201, 202, 1); + } + .input { + flex: 1; + font-size: 32rpx; + line-height: 40rpx; + color: rgba(40, 48, 49, 1); + } + .btn { + flex-shrink: 0; + font-size: 32rpx; + color: rgba(103, 186, 202, 1); + } + } + .submit { + margin-top: 64rpx; + height: 84rpx; + display: flex; + align-items: center; + justify-content: center; + font-size: 36rpx; + color: rgba(255, 255, 255, 1); + background: #67baca; + border-radius: 64rpx 64rpx 64rpx 64rpx; + } + .tip { + margin-top: 88rpx; + font-size: 28rpx; + color: rgba(154, 161, 162, 1); + .emphasis { + font-size: 28rpx; + color: rgba(103, 186, 202, 1); + } + } +} diff --git a/src/doctor/pages/d_changePhone/index.ts b/src/doctor/pages/d_changePhone/index.ts new file mode 100644 index 0000000..6ea7958 --- /dev/null +++ b/src/doctor/pages/d_changePhone/index.ts @@ -0,0 +1,98 @@ +const app = getApp() +let timer = null as null | number + +Page({ + data: { + mobile: '', + code: '', + codeText: '发送验证码', + }, + onLoad() { + app.waitLogin().then((_res) => { + this.getDetail() + }) + }, + getDetail() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/account/info', + data: {}, + }).then((res) => { + this.setData({ + doctor: res.doctor, + hospital: res.hospital, + }) + }) + }, + getCode() { + if (timer) return + const mobile = this.data.mobile + if (!mobile) { + wx.showToast({ + title: '手机号不能为空', + icon: 'none', + }) + return + } + // 验证手机号 + if (!/^1[3-9,]\d{9}$/.test(mobile)) { + wx.showToast({ + title: '手机号格式不正确', + icon: 'none', + }) + return + } + wx.ajax({ + method: 'POST', + url: '?r=igg4/login/send-verify-code', + data: { + mobile, + }, + }).then((_res) => { + wx.showToast({ + icon: 'none', + title: '验证码已发送~', + }) + let time = 60 + timer = setInterval(() => { + time-- + this.setData({ + codeText: `${time}s后重新发送`, + }) + if (time <= 0) { + clearInterval(timer as number) + timer = null + this.setData({ + codeText: '发送验证码', + }) + } + }, 1000) + }) + }, + handleSubmit() { + if (!this.data.mobile) { + wx.showToast({ + icon: 'none', + title: '请输入手机号', + }) + return + } + if (!this.data.code) { + wx.showToast({ + icon: 'none', + title: '请输入验证码', + }) + return + } + wx.ajax({ + method: 'POST', + url: '?r=igg4/doctor/account/update-telephone', + data: { + mobile: this.data.mobile, + code: this.data.code, + }, + }).then((_res) => { + wx.navigateBack() + }) + }, +}) diff --git a/src/doctor/pages/d_changePhone/index.wxml b/src/doctor/pages/d_changePhone/index.wxml new file mode 100644 index 0000000..d533251 --- /dev/null +++ b/src/doctor/pages/d_changePhone/index.wxml @@ -0,0 +1,26 @@ + + + + + + + {{codeText}} + + 确定 + + 注意: + 更换手机号后,您当前的账号{{'{'+doctor.Name+'}'}}将与最新手机号绑定,原有手机号将不可用。请您谨慎更换! + + diff --git a/src/doctor/pages/d_createTask/index.json b/src/doctor/pages/d_createTask/index.json new file mode 100644 index 0000000..d0fc987 --- /dev/null +++ b/src/doctor/pages/d_createTask/index.json @@ -0,0 +1,7 @@ +{ + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/navBar/navBar", + "van-icon": "@vant/weapp/icon/index" + } +} diff --git a/src/doctor/pages/d_createTask/index.scss b/src/doctor/pages/d_createTask/index.scss new file mode 100644 index 0000000..5ac22ae --- /dev/null +++ b/src/doctor/pages/d_createTask/index.scss @@ -0,0 +1,415 @@ +page { + background: #f2f4f5; + padding-bottom: calc(200rpx + env(safe-area-inset-bottom)); +} +.page { + min-height: 100vh; + .page-header { + padding: 50rpx 64rpx 0; + display: flex; + justify-content: space-between; + .item { + flex-shrink: 0; + display: flex; + flex-direction: column; + align-items: center; + .order { + width: 48rpx; + height: 48rpx; + text-align: center; + font-size: 32rpx; + color: rgba(103, 186, 202, 1); + line-height: 48rpx; + border: 8rpx solid #85d4d5; + border-radius: 50%; + background-color: #85d4d5; + } + .order-end { + width: 48rpx; + height: 48rpx; + } + .name { + margin-top: 4rpx; + font-size: 28rpx; + color: rgba(255, 255, 255, 0.6); + } + &.active { + .order { + background-color: #fff; + } + .name { + color: rgba(255, 255, 255, 1); + } + } + } + .line { + margin: 30rpx -10rpx 0; + flex: 1; + border-top: 1px dashed #a3d6d7; + &.active { + border-color: #fff; + } + } + } + .page-tip { + margin-top: 24rpx; + text-align: center; + font-size: 28rpx; + color: #ffffff; + line-height: 40rpx; + } + .step1 { + margin: 32rpx 30rpx; + padding: 30rpx; + border-radius: 24rpx; + background-color: #fff; + .form { + .form-item { + margin-bottom: 48rpx; + .f-title { + font-size: 36rpx; + color: rgba(40, 48, 49, 1); + font-weight: bold; + } + .select { + margin-top: 24rpx; + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 16rpx; + .s-item { + padding: 18rpx 0; + text-align: center; + border-radius: 12rpx; + font-size: 28rpx; + color: rgba(103, 113, 114, 1); + background: #f2f4f5; + &.active { + color: #fff; + background-color: rgba(103, 186, 202, 1); + } + } + } + .custom { + margin-top: 16rpx; + display: flex; + align-items: center; + gap: 12rpx; + .c-item { + padding: 18rpx 24rpx; + display: flex; + font-size: 32rpx; + color: rgba(103, 113, 114, 1); + border-radius: 12rpx; + background-color: rgba(242, 244, 245, 1); + .input { + width: 3em; + font-size: 32rpx; + } + .input-place { + color: rgba(194, 201, 202, 1); + } + } + } + + .date { + margin-top: 24rpx; + display: flex; + align-items: center; + justify-content: space-between; + + .picker { + flex: 1; + + .d-item { + flex: 1; + display: flex; + align-items: center; + justify-content: space-between; + padding: 18rpx 32rpx; + background: #f7f8f9; + border-radius: 12rpx 12rpx 12rpx 12rpx; + + .icon { + width: 32rpx; + height: 32rpx; + } + + .content { + font-size: 32rpx; + color: #677172; + + &:empty::after { + content: attr(data-place); + color: rgba(194, 201, 202, 1); + } + } + } + } + + .sion { + flex-shrink: 0; + margin: 0 14rpx; + font-size: 32rpx; + color: #677172; + } + } + } + } + } + + .step2 { + .banner-date { + padding: 30rpx; + margin: 32rpx 30rpx; + border-radius: 24rpx; + background: #fff; + border-radius: 24rpx; + .b-header { + display: flex; + align-items: baseline; + .title { + font-size: 36rpx; + color: #283031; + font-weight: bold; + } + .tip { + margin-left: 18rpx; + font-size: 28rpx; + color: #c2c9ca; + } + } + .radios { + margin-top: 42rpx; + display: flex; + align-items: center; + gap: 48rpx; + .radio-item { + display: flex; + align-items: center; + gap: 16rpx; + font-size: 32rpx; + color: #283031; + line-height: 1; + .circle { + flex-shrink: 0; + width: 32rpx; + height: 32rpx; + background: #ffffff; + border-radius: 50%; + border: 2rpx solid #d4d9da; + &.active { + position: relative; + border-color: #62bed0; + &::after { + content: ''; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 18rpx; + height: 18rpx; + border-radius: 50%; + background-color: #62bed0; + } + } + } + } + } + .date-btns { + margin-top: 44rpx; + display: flex; + align-items: center; + gap: 26rpx; + .btn { + flex: 1; + padding: 18rpx; + font-size: 32rpx; + color: #677172; + text-align: center; + background: #f7f8f9; + border-radius: 12rpx 12rpx 12rpx 12rpx; + border: 2rpx solid rgba(207, 212, 213, 0.56); + font-weight: bold; + &.active { + color: #67baca; + border-color: #67baca; + background: rgba(103, 186, 202, 0.1); + } + } + } + .date-range { + margin-top: 24rpx; + padding: 0 30rpx; + border-radius: 12rpx; + background-color: #f7f8f9; + display: flex; + align-items: center; + justify-content: space-between; + .dr-item { + flex: 1; + .content { + padding: 22rpx 0; + font-size: 32rpx; + text-align: center; + &:empty::after { + content: attr(data-place); + color: #c2c9ca; + } + } + } + .sion { + font-size: 30rpx; + color: #677172; + } + .icon { + width: 32rpx; + height: 32rpx; + } + } + } + .card { + padding: 30rpx; + margin: 32rpx 30rpx; + border-radius: 24rpx; + background: #fff; + border-radius: 24rpx; + .switch { + padding-bottom: 20rpx; + display: flex; + justify-content: space-between; + align-items: center; + overflow-x: auto; + gap: 64rpx; + &::-webkit-scrollbar { + display: none; + } + .switch-item { + position: relative; + text-align: center; + font-size: 32rpx; + color: rgba(103, 113, 114, 1); + white-space: nowrap; + &.active { + color: rgba(98, 190, 208, 1); + &::after { + position: absolute; + bottom: -14rpx; + left: 50%; + transform: translateX(-50%); + content: ''; + width: 54rpx; + height: 8rpx; + border-radius: 12rpx 12rpx 0 0; + background: #62bed0; + } + } + } + } + .list { + .list-item { + margin-top: 20rpx; + display: flex; + justify-content: space-between; + align-items: center; + .radio { + transform: scale(0.8); + } + .wrap { + margin-left: 14rpx; + padding: 30rpx; + box-shadow: 0rpx 8rpx 32rpx 0rpx rgba(40, 48, 49, 0.08); + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2rpx solid #f8f9f9; + .content { + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + } + .rows { + .row { + margin-top: 30rpx; + display: flex; + .label { + flex-shrink: 0; + font-size: 32rpx; + color: rgba(173, 179, 180, 1); + width: 5em; + } + .r-content { + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + } + } + } + } + } + } + } + } + + .page-footer { + padding: 30rpx 30rpx calc(40rpx + env(safe-area-inset-bottom)); + position: fixed; + z-index: 1; + bottom: 0; + width: 100%; + box-sizing: border-box; + background-color: #fff; + .total-line { + display: flex; + justify-content: space-between; + align-items: center; + .total { + display: flex; + align-items: center; + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + .resource { + margin-left: 26rpx; + color: rgba(103, 186, 202, 1); + } + } + .clear { + display: flex; + align-items: center; + font-size: 32rpx; + color: rgba(103, 186, 202, 1); + gap: 12rpx; + .icon { + width: 36rpx; + height: 36rpx; + } + } + } + .btns { + margin-top: 32rpx; + display: flex; + justify-content: space-between; + align-items: center; + gap: 26rpx; + .cancel { + flex: 1; + height: 84rpx; + font-size: 36rpx; + color: rgba(103, 186, 202, 1); + display: flex; + align-items: center; + justify-content: center; + background: #ffffff; + border-radius: 98rpx 98rpx 98rpx 98rpx; + border: 2rpx solid #67baca; + } + .submit { + flex: 1; + height: 84rpx; + font-size: 36rpx; + color: #fff; + display: flex; + align-items: center; + justify-content: center; + background: rgba(103, 186, 202, 1); + border-radius: 98rpx 98rpx 98rpx 98rpx; + border: 2rpx solid #67baca; + } + } + } +} diff --git a/src/doctor/pages/d_createTask/index.ts b/src/doctor/pages/d_createTask/index.ts new file mode 100644 index 0000000..9decce2 --- /dev/null +++ b/src/doctor/pages/d_createTask/index.ts @@ -0,0 +1,417 @@ +import dayjs from 'dayjs' +import { filterColumns } from '@/utils/doctorPatientTask' +const licia = require('miniprogram-licia') +const app = getApp() + +Page({ + data: { + step: 1, + + TemplateType: 1, + templates: [] as any, + TemplateList: [], + + start: dayjs().format('HH:mm'), + end: '19:00', + disabledTime: Number(dayjs().format('HH')) * 1 > 19, + sendDay: 0, // 0 今天 1 明天 + + PushTemplateId: 0, //推送模板 + IsSendNow: 0, //是否立即发送 0-定时,1-立即 + time: '', + SendTime: '2024-11-23 16:00', //定时 发送时间 + PatientNum: 0, //患者人数 + + // form + Search: '', + HasAdl: 0, + DoubleStandard: 0, + AdlTime: 0, + AdlScore: [] as any, + AdlScoreChange: [], + AdlScoreChangeType: 0, + AdlScoreChangeMax: '', + AdlScoreChangeMin: '', + SteroidDailyDose: [] as any, + SteroidDailyDoseChange: [] as any, + IsThisWeekAdl: 0, + PharyngealSymptoms: 0, + AntibodyType: 0, + ThyroidAbnormal: 0, + PreviousConvulsion: 0, + TraditionalImmunosuppressant: 0, + MedicalInsuranceType: 0, + BindStartDate: '', + BindEndDate: '', + + ...filterColumns, + }, + onLoad() { + const SystemInfo = app.globalSystemInfo + if (SystemInfo) { + const { top, bottom } = SystemInfo.capsulePosition + this.setData({ + top, + bottom, + }) + } + + const eventChannel = this.getOpenerEventChannel() + eventChannel?.on('FilterCondition', (data) => { + this.setData({ + ...data, + step: 2, + }) + }) + + app.waitLogin().then(() => { + if (this.data.step === 2) { + this.getTaskNum() + } + this.getTemplate() + }) + }, + onShow() { + this.handleViewMp() + this.setData({ + time: Number(dayjs().format('HH')) * 1 >= 12 ? dayjs().format('HH:mm') : '12:00', + }) + }, + getTemplate() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/task/get-template', + data: {}, + }).then((res) => { + this.setData({ + templates: res, + TemplateType: res[0]?.TemplateType, + TemplateList: res[0]?.TemplateList, + }) + }) + }, + handleTemplateNav(e) { + const { index } = e.currentTarget.dataset + const { templates } = this.data + this.setData({ + TemplateType: templates[index]?.TemplateType, + TemplateList: templates[index]?.TemplateList, + PushTemplateId: 0, + }) + }, + getTaskNum(e?: any) { + let btn = 0 + if (typeof e === 'object') { + btn = e?.currentTarget?.dataset?.btn + } + if (btn == 1) { + app.mpBehavior({ doctor: true, PageName: 'BTN_NEWMESSAGEPAGE1_REFRESH' }) + } + + return wx + .ajax({ + method: 'GET', + url: '?r=igg4/doctor/task/filter-patient-num', + data: { + Search: this.data.Search, + HasAdl: this.data.HasAdl, + DoubleStandard: this.data.DoubleStandard, + AdlTime: this.data.AdlTime, + AdlScore: this.data.AdlScore.join('-'), + AdlScoreChange: this.data.AdlScoreChange.join('-'), + AdlScoreChangeType: this.data.AdlScoreChangeType, + AdlScoreChangeMax: this.data.AdlScoreChangeMax, + AdlScoreChangeMin: this.data.AdlScoreChangeMin, + SteroidDailyDose: this.data.SteroidDailyDose.join('-'), + SteroidDailyDoseChange: this.data.SteroidDailyDoseChange.join('-'), + IsThisWeekAdl: this.data.IsThisWeekAdl, + PharyngealSymptoms: this.data.PharyngealSymptoms, + AntibodyType: this.data.AntibodyType, + ThyroidAbnormal: this.data.ThyroidAbnormal, + PreviousConvulsion: this.data.PreviousConvulsion, + TraditionalImmunosuppressant: this.data.TraditionalImmunosuppressant, + MedicalInsuranceType: this.data.MedicalInsuranceType, + BindStartDate: this.data.BindStartDate, + BindEndDate: this.data.BindEndDate, + }, + loading: true, + }) + .then((res) => { + this.setData({ + PatientNum: res.PatientNum, + }) + }) + }, + handleReset() { + app.mpBehavior({ doctor: true, PageName: 'BTN_NEWMESSAGEPAGE1_CLEAR' }) + wx.showModal({ + title: '确认清空选项吗', + confirmColor: '#62bed0', + success: (res) => { + if (res.confirm) { + this.setData({ + Search: '', + HasAdl: 0, + DoubleStandard: 0, + AdlTime: 0, + AdlScore: [] as any, + AdlScoreChange: [], + AdlScoreChangeType: 0, + AdlScoreChangeMax: '', + AdlScoreChangeMin: '', + SteroidDailyDose: [] as any, + SteroidDailyDoseChange: [] as any, + IsThisWeekAdl: 0, + PharyngealSymptoms: 0, + AntibodyType: 0, + ThyroidAbnormal: 0, + PreviousConvulsion: 0, + TraditionalImmunosuppressant: 0, + MedicalInsuranceType: 0, + BindStartDate: '', + BindEndDate: '', + }) + this.getTaskNum() + } + }, + }) + }, + handleRadio(e: any) { + const { key, index } = e.currentTarget.dataset + const data = this.data[`${key}Column`] + this.setData({ + [`${key}`]: data[index].id, + }) + }, + handleCheckbox(e: any) { + const { index, key } = e.currentTarget.dataset + const data = this.data[`${key}Column`] + const oldValue = this.data[`${key}`] + const value = oldValue.includes(data[index].id) + ? oldValue.filter((item: any) => item !== data[index].id) + : [...oldValue, data[index].id] + + this.setData({ + [`${key}`]: data[index].id ? value : [], + }) + }, + handleDay(e) { + const { value } = e.currentTarget.dataset + const currentTime = Number(dayjs().format('HH')) * 1 >= 12 ? dayjs().format('HH:mm') : '12:00' + this.setData({ + time: value === 0 ? currentTime : '12:00', + sendDay: value, + start: value === 0 ? dayjs().format('HH:mm') : '08:00', + disabledTime: value === 0 ? Number(dayjs().format('HH')) * 1 > 19 : false, + }) + }, + handleDateToast() { + const { disabledTime } = this.data + if (disabledTime) { + wx.showToast({ + title: '已超过发送时间', + icon: 'none', + }) + } + }, + handleSendDay(e) { + const { value } = e.currentTarget.dataset + this.setData({ + IsSendNow: value, + }) + }, + handlePushTemplate(e) { + const { id } = e.currentTarget.dataset + this.setData({ + PushTemplateId: id, + }) + }, + handleRouter(e) { + const { url } = e.currentTarget.dataset + wx.navigateTo({ + url, + }) + }, + handleCancel() { + app.mpBehavior({ doctor: true, PageName: 'BTN_NEWMESSAGEPAGE1_CANCEL' }) + wx.navigateBack() + }, + async handleNext() { + app.mpBehavior({ doctor: true, PageName: 'BTN_NEWMESSAGEPAGE1_NEXT' }) + const anyValueKeys = [ + 'Search', + 'HasAdl', + 'DoubleStandard', + 'AdlTime', + 'AdlScore', + 'AdlScoreChange', + 'AdlScoreChangeType', + 'AdlScoreChangeMax', + 'AdlScoreChangeMin', + 'SteroidDailyDose', + 'SteroidDailyDoseChange', + 'IsThisWeekAdl', + 'PharyngealSymptoms', + 'AntibodyType', + 'ThyroidAbnormal', + 'PreviousConvulsion', + 'TraditionalImmunosuppressant', + 'MedicalInsuranceType', + 'BindStartDate', + 'BindEndDate', + ] + const empty = anyValueKeys.every((item) => + Array.isArray(this.data[item]) ? licia.isEmpty(this.data[item]) : !this.data[item], + ) + + if (empty) { + wx.showToast({ + icon: 'none', + title: '请至少选择一个筛选条件', + }) + return + } + + await this.getTaskNum() + + if (this.data.PatientNum * 1 === 0) { + wx.showToast({ + icon: 'none', + title: '还没有选择发送人哦~', + }) + return + } + + this.setData({ + step: 2, + }) + this.handleViewMp() + wx.pageScrollTo({ + scrollTop: 0, + }) + }, + handlePrevStep() { + app.mpBehavior({ doctor: true, PageName: 'BTN_NEWMESSAGEPAGE2_PREV' }) + this.setData({ step: 1 }) + this.handleViewMp() + }, + handleSubmit() { + app.mpBehavior({ doctor: true, PageName: 'BTN_NEWMESSAGEPAGE2_SUBMIT' }) + const { + Search, + HasAdl, + DoubleStandard, + AdlTime, + AdlScore, + AdlScoreChange, + AdlScoreChangeType, + AdlScoreChangeMax, + AdlScoreChangeMin, + SteroidDailyDose, + SteroidDailyDoseChange, + IsThisWeekAdl, + PharyngealSymptoms, + AntibodyType, + ThyroidAbnormal, + PreviousConvulsion, + TraditionalImmunosuppressant, + MedicalInsuranceType, + BindStartDate, + BindEndDate, + + PushTemplateId, + IsSendNow, + time, + PatientNum, + sendDay, + } = this.data + + // if (!PatientNum) { + // wx.showToast({ + // icon: 'none', + // title: '患者人数不能为0', + // }) + // return + // } + if (IsSendNow === 0 && !time) { + wx.showToast({ + icon: 'none', + title: '请选择发送时间', + }) + return + } + if (!PushTemplateId) { + wx.showToast({ + icon: 'none', + title: '请选择推送模板', + }) + return + } + + const SendTime = `${dayjs().add(sendDay, 'day').format('YYYY-MM-DD')} ${time}` + + wx.showModal({ + title: '确认创建群发任务', + content: '将会按您创建的规则给所有符合条件患者发送消息', + confirmColor: '#62bed0', + success: (res) => { + if (res.confirm) { + const params = { + FilterCondition: { + Search, + HasAdl, + DoubleStandard, + AdlTime, + AdlScore: AdlScore.join('-'), + AdlScoreChange: AdlScoreChange.join('-'), + AdlScoreChangeType, + AdlScoreChangeMax, + AdlScoreChangeMin, + SteroidDailyDose: SteroidDailyDose.join('-'), + SteroidDailyDoseChange: SteroidDailyDoseChange.join('-'), + IsThisWeekAdl, + PharyngealSymptoms, + AntibodyType, + ThyroidAbnormal, + PreviousConvulsion, + TraditionalImmunosuppressant, + MedicalInsuranceType, + BindStartDate, + BindEndDate, + }, + PushTemplateId, + IsSendNow, + SendTime, + PatientNum, + } + wx.ajax({ + method: 'POST', + url: '?r=igg4/doctor/task/create', + data: params, + loading: true, + }).then(() => { + wx.showToast({ + title: '您的群发任务已创建成功', + icon: 'none', + }) + setTimeout(() => { + wx.redirectTo({ + url: '/doctor/pages/d_taskList/index', + }) + }, 2000) + }) + } + }, + }) + }, + handleBack() { + wx.navigateBack() + }, + handleViewMp() { + if (this.data.step === 2) { + app.mpBehavior({ doctor: true, PageName: 'PG_NEWMESSAGEPAGE1' }) + } else if (this.data.step === 2) { + app.mpBehavior({ doctor: true, PageName: 'PG_NEWMESSAGEPAGE2' }) + } + }, +}) diff --git a/src/doctor/pages/d_createTask/index.wxml b/src/doctor/pages/d_createTask/index.wxml new file mode 100644 index 0000000..356fb05 --- /dev/null +++ b/src/doctor/pages/d_createTask/index.wxml @@ -0,0 +1,387 @@ + + + + + + 1 + 1 + 筛选患者 + + + + 2 + 发送时间 + + + 您配置的内容会通过对话列表及公众号提醒通知患者 + + + + 绑定时间 + + + + {{BindStartDate}} + + + + - + + + {{BindEndDate}} + + + + + + + 本周ADL测评 + + + {{item.value}} + + + + + 是否有ADL测评 + + + {{item.value}} + + + + + ADL测评间隔时长 + + + {{item.value}} + + + + + 是否双达标 + + + {{item.value}} + + + + + ADL评分(多选) + + + {{item.value}} + + + + + ADL分数变化(多选) + + + {{item.value}} + + + + + {{item.value}} + + + + + + 分 + + - + + + 分 + + + + + 激素用量(多选) + + + {{item.value}} + + + + + 激素变化(多选) + + + {{item.value}} + + + + + 延髓症状 + + + {{item.value}} + + + + + 抗体类型 + + + {{item.value}} + + + + + 胸腺异常 + + + {{item.value}} + + + + + 既往发生危象 + + + {{item.value}} + + + + + 传统免疫抑制剂 + + + {{item.value}} + + + + + 医保类型 + + + {{item.value}} + + + + + + + + + + + {{item.TemplateTypeText}} + + + + + + + + + {{item.InteractMsgContent}} + + + + + + + + + + + 共筛选出 {{PatientNum}}人 + 刷新 + + + + 清空选项 + + + + 取消 + 下一步 + + + + + 上一步 + 提交 + + + diff --git a/src/doctor/pages/d_customExport/index.json b/src/doctor/pages/d_customExport/index.json new file mode 100644 index 0000000..24b90dd --- /dev/null +++ b/src/doctor/pages/d_customExport/index.json @@ -0,0 +1,8 @@ +{ + "navigationBarTitleText": "数据报告", + "pageOrientation": "landscape", + "usingComponents": { + "toast": "/components/toast/index", + "van-popup": "@vant/weapp/popup/index" + } +} diff --git a/src/doctor/pages/d_customExport/index.scss b/src/doctor/pages/d_customExport/index.scss new file mode 100644 index 0000000..2740353 --- /dev/null +++ b/src/doctor/pages/d_customExport/index.scss @@ -0,0 +1,49 @@ +page { + background-color: #f2f4f5; +} + +.page { + .table-wrap { + width: 100vw; + padding-left: var(--left); + box-sizing: border-box; + height: 100vh; + .table { + display: grid; + grid-template-columns: repeat(13, 1fr); + &::-webkit-scrollbar { + display: none; + } + .th { + position: sticky; + top: 0; + padding: 12rpx; + font-size: 12rpx; + color: #ffffff; + white-space: nowrap; + text-align: center; + border-right: 1px solid #fff; + background-color: #3d6bd6; + &.th-red { + background-color: #fc3232; + } + } + .td { + padding: 12rpx; + font-size: 12rpx; + color: #000000; + border-right: 1px solid #f2f4f5; + border-bottom: 1px solid #f2f4f5; + background-color: #ffffff; + white-space: nowrap; + &.red{ + color: #fc3232; + } + } + .th:nth-child(13n), + .td:nth-child(13n) { + border-right: none; + } + } + } +} diff --git a/src/doctor/pages/d_customExport/index.ts b/src/doctor/pages/d_customExport/index.ts new file mode 100644 index 0000000..359cb8c --- /dev/null +++ b/src/doctor/pages/d_customExport/index.ts @@ -0,0 +1,46 @@ +import dayjs from 'dayjs' +const app = getApp() + +Page({ + data: { + id: '', + list: [], + safeAreaInsetLeft: 0, + }, + onLoad(options) { + const windowsInfo = wx.getWindowInfo() + this.setData({ + safeAreaInsetLeft: windowsInfo.safeArea?.left || 0, + }) + this.setData({ + id: options.id, + }) + app.waitLogin().then(() => { + app.mpBehavior({ doctor: true, PageName: 'PAGE_DOCTORADLREPORT' }) + this.getList() + }) + }, + getList() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/doctor-stat/get-week-record-list', + data: { + statId: this.data.id, + count: 0, + pageSize: 0, + }, + }).then((res) => { + this.setData({ + list: res.list, + }) + }) + }, + handleDetail(e) { + const { id } = e.currentTarget.dataset + wx.navigateTo({ + url: `/doctor/pages/d_customExportMiddle/index?id=${id}`, + }) + }, +}) + +export {} diff --git a/src/doctor/pages/d_customExport/index.wxml b/src/doctor/pages/d_customExport/index.wxml new file mode 100644 index 0000000..2fb3988 --- /dev/null +++ b/src/doctor/pages/d_customExport/index.wxml @@ -0,0 +1,45 @@ + + + + 姓名 + 性别 + 年龄 + ADL总分 + 延髓评分 + 呼吸评分 + 四肢评分 + 眼睛评分 + + 疾病波动 + (ADL增加≥2分) + + ADL≥5分 + + 球部症状 + (ADL2-4分且延髓+呼吸≥2分) + + + 激素 + + ≥20mg/d + + 测评日期 + + + {{item.PatientName}} + {{item.GenderName}} + {{item.AgeRangeName}} + {{item.TotalScore}} + {{item.MedullaTypeScore}} + {{item.BreathTypeScore}} + {{item.LimbsTypeScore}} + {{item.EyeTypeScore}} + {{item.AdlIncreaseScoreName}} + {{item.TotalScoreG5Name}} + {{item.bulbTypeScoreName}} + {{item.SteroidDailyDoseG20Name}} + {{item.CreateTime}} + + + + diff --git a/src/doctor/pages/d_customExportMiddle/index.json b/src/doctor/pages/d_customExportMiddle/index.json new file mode 100644 index 0000000..24b90dd --- /dev/null +++ b/src/doctor/pages/d_customExportMiddle/index.json @@ -0,0 +1,8 @@ +{ + "navigationBarTitleText": "数据报告", + "pageOrientation": "landscape", + "usingComponents": { + "toast": "/components/toast/index", + "van-popup": "@vant/weapp/popup/index" + } +} diff --git a/src/doctor/pages/d_customExportMiddle/index.scss b/src/doctor/pages/d_customExportMiddle/index.scss new file mode 100644 index 0000000..2740353 --- /dev/null +++ b/src/doctor/pages/d_customExportMiddle/index.scss @@ -0,0 +1,49 @@ +page { + background-color: #f2f4f5; +} + +.page { + .table-wrap { + width: 100vw; + padding-left: var(--left); + box-sizing: border-box; + height: 100vh; + .table { + display: grid; + grid-template-columns: repeat(13, 1fr); + &::-webkit-scrollbar { + display: none; + } + .th { + position: sticky; + top: 0; + padding: 12rpx; + font-size: 12rpx; + color: #ffffff; + white-space: nowrap; + text-align: center; + border-right: 1px solid #fff; + background-color: #3d6bd6; + &.th-red { + background-color: #fc3232; + } + } + .td { + padding: 12rpx; + font-size: 12rpx; + color: #000000; + border-right: 1px solid #f2f4f5; + border-bottom: 1px solid #f2f4f5; + background-color: #ffffff; + white-space: nowrap; + &.red{ + color: #fc3232; + } + } + .th:nth-child(13n), + .td:nth-child(13n) { + border-right: none; + } + } + } +} diff --git a/src/doctor/pages/d_customExportMiddle/index.ts b/src/doctor/pages/d_customExportMiddle/index.ts new file mode 100644 index 0000000..c985eaf --- /dev/null +++ b/src/doctor/pages/d_customExportMiddle/index.ts @@ -0,0 +1,10 @@ +Page({ + data: {}, + onLoad(options) { + wx.redirectTo({ + url: `/doctor/pages/d_patientDetail/index?id=${options.id}`, + }) + }, +}) + +export {} diff --git a/src/doctor/pages/d_customExportMiddle/index.wxml b/src/doctor/pages/d_customExportMiddle/index.wxml new file mode 100644 index 0000000..e69de29 diff --git a/src/doctor/pages/d_exportList/index.json b/src/doctor/pages/d_exportList/index.json new file mode 100644 index 0000000..e29234f --- /dev/null +++ b/src/doctor/pages/d_exportList/index.json @@ -0,0 +1,8 @@ +{ + "navigationBarTitleText": "报告中心", + "usingComponents": { + "van-icon": "@vant/weapp/icon/index", + "toast": "/components/toast/index", + "van-popup": "@vant/weapp/popup/index" + } +} diff --git a/src/doctor/pages/d_exportList/index.scss b/src/doctor/pages/d_exportList/index.scss new file mode 100644 index 0000000..822b1d6 --- /dev/null +++ b/src/doctor/pages/d_exportList/index.scss @@ -0,0 +1,88 @@ +page { + background-color: #f2f4f5; +} +.page { + padding: 32rpx 30rpx 80rpx; + .list { + .list-item { + position: relative; + margin-bottom: 24rpx; + padding: 20rpx 30rpx; + background: linear-gradient(to top, #ffffff 0%, #ffffff 56%, #e8f0f2 100%); + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2rpx solid #ffffff; + .new { + position: absolute; + top: -14rpx; + left: -18rpx; + width: 96rpx; + height: 98rpx; + } + .list-item-header { + display: flex; + justify-content: space-between; + align-items: center; + .date { + font-size: 36rpx; + color: #283031; + } + .btn { + width: 190rpx; + height: 64rpx; + font-size: 32rpx; + color: #ffffff; + display: flex; + align-items: center; + justify-content: center; + background: #62bed0; + border-radius: 62rpx 62rpx 62rpx 62rpx; + } + } + .list-item-container { + margin-top: 20rpx; + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 16rpx; + .item { + padding: 20rpx; + background: #ffffff; + box-shadow: 0rpx 4rpx 24rpx 0rpx rgba(40, 48, 49, 0.07); + border-radius: 12rpx 12rpx 12rpx 12rpx; + border: 1rpx solid #f2f4f5; + text-align: center; + .name { + font-size: 24rpx; + color: #9aa1a2; + line-height: 40rpx; + } + .num { + margin-top: 16rpx; + font-size: 44rpx; + color: #283031; + line-height: 48rpx; + } + } + } + } + } +} + +.guide { + position: relative; + width: 750rpx; + height: 996rpx; + .btn { + position: absolute; + bottom: 88rpx; + left: 60rpx; + width: 630rpx; + height: 84rpx; + font-size: 36rpx; + color: #ffffff; + text-align: center; + line-height: 84rpx; + background: #67baca; + border-radius: 98rpx 98rpx 98rpx 98rpx; + border: 2rpx solid #67baca; + } +} diff --git a/src/doctor/pages/d_exportList/index.ts b/src/doctor/pages/d_exportList/index.ts new file mode 100644 index 0000000..3ab79f7 --- /dev/null +++ b/src/doctor/pages/d_exportList/index.ts @@ -0,0 +1,139 @@ +import dayjs from 'dayjs' + +const app = getApp() + +Page({ + data: { + toastShow: false, + toastType: 'exportLoadingDoctor', + toastParams: {} as any, + + guideShow: false, + fileParams: {} as any, + + list: [] as any[], + total: 0, + pagination: { + page: 1, + pages: 1, + count: 1, + }, + }, + download: null as null | WechatMiniprogram.DownloadTask, + onLoad() { + app.waitLogin().then((_res) => { + app.mpBehavior({ doctor: true, PageName: 'PAGE_DOCTORADLREPORTLIST' }) + this.getList() + }) + }, + getList(newPage = 1) { + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/doctor-stat/get-week-list', + data: { + page: newPage, + }, + }).then((res) => { + const list = res.page === 1 ? res.list : [...this.data.list, ...res.list] + list.forEach((item) => { + item.year = dayjs(item.statDate.replace('.', '-')).format('YYYY') + }) + this.setData({ + total: res.count, + list, + pagination: { + page: res.page, + pages: res.pages, + count: res.count, + }, + }) + }) + }, + onReachBottom() { + const { page, pages } = this.data.pagination + if (pages > page) { + this.getList(page + 1) + } + }, + handleCustomExport(e) { + const { id } = e.currentTarget.dataset + app.mpBehavior({ doctor: true, PageName: 'BTN_DOCTORADLREPORTLIST' }) + wx.navigateTo({ + url: `/doctor/pages/d_customExport/index?id=${id}`, + }) + }, + handleDownload(e) { + const { id } = e.currentTarget.dataset + const d_export_list_guide = wx.getStorageSync('d_export_list_guide') === '1' || false + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/adl-stat/download', + data: { + statId: id, + }, + }).then((res) => { + const url = res.linkUrl + const fileName = res.fileName + this.toggleExportLoading(true) + this.download = wx.downloadFile({ + url, + success: (res) => { + this.toggleExportLoading() + if (d_export_list_guide) { + this.handleExport(res.tempFilePath, fileName) + } else { + wx.setStorageSync('d_export_list_guide', '1') + this.setData({ + guideShow: true, + fileParams: { + tempFilePath: res.tempFilePath, + fileName, + }, + }) + } + }, + fail: () => { + this.toggleExportLoading() + wx.showToast({ + title: '下载失败!', + icon: 'none', + }) + }, + }) + }) + }, + handleExport(tempFilePath: string, fileName: string) { + wx.shareFileMessage({ + fileName, + filePath: tempFilePath, + success() {}, + fail() { + wx.showToast({ + title: '分享失败', + icon: 'none', + }) + }, + }) + }, + toggleExportLoading(bol = false) { + this.setData({ + toastShow: bol, + toastType: 'exportLoadingDoctor', + }) + }, + handleToastCancel() { + this.download?.abort() + this.setData({ + toastShow: false, + }) + }, + handleCloseGuide() { + const { fileParams } = this.data + this.setData({ + guideShow: false, + }) + this.handleExport(fileParams.tempFilePath, fileParams.fileName) + }, +}) + +export {} diff --git a/src/doctor/pages/d_exportList/index.wxml b/src/doctor/pages/d_exportList/index.wxml new file mode 100644 index 0000000..c465729 --- /dev/null +++ b/src/doctor/pages/d_exportList/index.wxml @@ -0,0 +1,34 @@ + + + + + + 截至 {{item.statDate}} + 查看明细 + + + + 累计邀约 + {{item.InvitePCount}} + + + {{item.year}}激活 + {{item.YearActivePCount}} + + + 本月新加入 + {{item.MonthInvitePCount}} + + + 本月ADL评估 + {{item.MonthActivePCount}} + + + 需随访 + {{item.YearNeedFollowPCount}} + + + + + + diff --git a/src/doctor/pages/d_home/index.json b/src/doctor/pages/d_home/index.json new file mode 100644 index 0000000..50a6a3f --- /dev/null +++ b/src/doctor/pages/d_home/index.json @@ -0,0 +1,12 @@ +{ + "navigationStyle": "custom", + "navigationBarTitleText": "首页", + "usingComponents": { + "van-sticky": "@vant/weapp/sticky/index", + "navBar": "/components/navBar/navBar", + "ec-canvas": "/components/ec-canvas/ec-canvas", + "van-icon": "@vant/weapp/icon/index", + "van-dialog": "@vant/weapp/dialog/index", + "tabbar": "../../components/tabbar/index" + } +} diff --git a/src/doctor/pages/d_home/index.scss b/src/doctor/pages/d_home/index.scss new file mode 100644 index 0000000..ecc4c8f --- /dev/null +++ b/src/doctor/pages/d_home/index.scss @@ -0,0 +1,545 @@ +page { + background-color: rgba(242, 244, 245, 1); + padding-bottom: calc(140rpx + env(safe-area-inset-bottom)); +} +.page { + .page-title { + margin-left: 34rpx; + position: absolute; + display: block; + width: 346rpx !important; + height: 43.77rpx; + } + .user { + padding: 72rpx 30rpx 0; + display: flex; + gap: 20rpx; + .avatar { + flex-shrink: 0; + width: 104rpx; + height: 104rpx; + border-radius: 50%; + } + .wrap { + flex: 1; + .name { + font-size: 40rpx; + color: rgba(40, 48, 49, 1); + font-weight: bold; + } + .site { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 8rpx; + font-size: 24rpx; + color: rgba(154, 161, 162, 1); + .tag { + padding: 0 12rpx; + font-size: 22rpx; + color: rgba(229, 154, 41, 1); + border-radius: 8rpx; + line-height: 28rpx; + white-space: nowrap; + background-color: rgba(229, 154, 41, 0.29); + } + } + } + .export { + flex-shrink: 0; + .btn { + padding: 12rpx 24rpx; + font-size: 32rpx; + color: #ffffff; + background: #67baca; + border-radius: 48rpx 48rpx 48rpx 48rpx; + line-height: 1; + display: flex; + align-items: center; + gap: 12rpx; + box-shadow: 0rpx 4rpx 32rpx 0rpx rgba(40, 48, 49, 0.1); + .icon { + width: 32rpx; + height: 32rpx; + } + } + .tip { + position: relative; + text-align: right; + margin-top: 14rpx; + margin-right: 17rpx; + font-size: 24rpx; + color: #9aa1a2; + .hover { + position: absolute; + bottom: -30rpx; + right: 0; + z-index: 10; + white-space: nowrap; + font-size: 28rpx; + line-height: 1; + color: #ffffff; + padding: 14rpx 32rpx; + background: linear-gradient(180deg, #ffc137 0%, #e6a004 100%); + border-radius: 32rpx; + box-shadow: -10rpx 6rpx 12rpx rgba(94, 65, 0, 0.3); + &::before { + position: absolute; + top: -10rpx; + right: 30rpx; + content: ''; + width: 0; + height: 0; + border-style: solid; + border-width: 0 36rpx 19rpx 36rpx; + border-color: transparent transparent #f4bb38 transparent; + } + } + } + } + } + .transfer { + position: relative; + margin: 36rpx 30rpx 0; + padding: 20rpx 32rpx; + display: flex; + align-items: center; + justify-content: space-between; + gap: 10rpx; + background: linear-gradient(341deg, #ffffff 0%, #ffffff 42%, #e8f0f2 100%); + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2rpx solid #ffffff; + .icon { + width: 44rpx; + height: 44rpx; + } + .name { + flex: 1; + font-size: 32rpx; + color: #283031; + } + .more { + width: 36rpx; + height: 36rpx; + } + + .hover { + position: absolute; + bottom: -50rpx; + right: 30%; + z-index: 10; + white-space: nowrap; + font-size: 28rpx; + line-height: 1; + color: #ffffff; + padding: 14rpx 32rpx; + background: linear-gradient(180deg, #ffc137 0%, #e6a004 100%); + border-radius: 32rpx; + box-shadow: -10rpx 6rpx 12rpx rgba(94, 65, 0, 0.3); + .num { + font-size: 36rpx; + } + &::before { + position: absolute; + top: -10rpx; + right: 70rpx; + content: ''; + width: 0; + height: 0; + border-style: solid; + border-width: 0 20rpx 19rpx 20rpx; + border-color: transparent transparent #f4bb38 transparent; + } + } + } + .data-tip { + padding-top: 20rpx; + padding-left: 32rpx; + font-size: 24rpx; + color: rgba(154, 161, 162, 1); + } + .new-banner { + margin: 12rpx 30rpx 0; + padding: 32rpx; + background: linear-gradient(10deg, #ffffff 0%, #eaf1f3 100%); + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2rpx solid #ffffff; + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 24rpx 26rpx; + .item { + display: flex; + gap: 16rpx; + padding: 30rpx; + background-color: #62bed0; + border-radius: 16rpx; + .icon { + width: 84rpx; + height: 84rpx; + } + .wrap { + .title { + font-size: 24rpx; + color: #ffffff; + line-height: 28rpx; + .question { + margin-left: 8rpx; + width: 20rpx; + height: 20rpx; + } + } + .num { + margin-top: 14rpx; + font-size: 38rpx; + color: #ffffff; + line-height: 1; + font-weight: bold; + .sub { + font-size: 24rpx; + } + } + } + } + } + .new-sub-banner { + margin: 48rpx 30rpx 0; + padding: 32rpx 32rpx 32rpx; + background: linear-gradient(10deg, #ffffff 0%, #eaf1f3 100%); + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2rpx solid #ffffff; + position: relative; + .year { + position: absolute; + width: 156rpx; + height: 40rpx; + left: 50%; + top: -16rpx; + transform: translateX(-50%); + font-size: 28rpx; + color: #ffffff; + text-align: center; + line-height: 40rpx; + } + .n-container { + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 24rpx 26rpx; + .item { + gap: 16rpx; + padding: 30rpx; + background-color: #ffffff; + box-shadow: 0rpx 4rpx 24rpx 0rpx rgba(40, 48, 49, 0.07); + border-radius: 16rpx 16rpx 16rpx 16rpx; + border: 1rpx solid #f2f4f5; + .wrap { + .title { + font-size: 24rpx; + color: #9aa1a2; + line-height: 28rpx; + .question { + margin-left: 8rpx; + width: 20rpx; + height: 20rpx; + } + } + .num { + margin-top: 14rpx; + font-size: 38rpx; + color: #283031; + line-height: 1; + font-weight: bold; + .sub { + font-size: 24rpx; + } + } + } + } + } + .tip { + position: relative; + margin-top: 26rpx; + margin-bottom: -30rpx; + padding: 14rpx 32rpx; + display: inline-block; + border-radius: 48rpx; + font-size: 28rpx; + color: #ffffff; + line-height: 1; + background: linear-gradient(180deg, #ffc137 0%, #e6a004 100%); + &::after { + position: absolute; + top: -16rpx; + left: 40rpx; + content: ''; + width: 0; + height: 0; + border-style: solid; + border-width: 0 19rpx 19rpx 19rpx; + border-color: transparent transparent #f7bf3c transparent; + } + } + } + .banner { + margin: 48rpx 30rpx 0; + box-shadow: 0rpx 4rpx 32rpx 0rpx rgba(40, 48, 49, 0.1); + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2rpx solid #ffffff; + .header { + padding: 32rpx 48rpx; + display: flex; + justify-content: space-between; + align-items: center; + background: linear-gradient(81deg, #67baca 0%, #43a8bc 100%); + border-radius: 24rpx 24rpx 24rpx 0; + .h-item { + .name { + font-size: 22rpx; + color: rgba(255, 255, 255, 1); + display: flex; + align-items: center; + .icon { + margin-left: 10rpx; + width: 24rpx; + height: 24rpx; + } + } + .num { + margin-top: 16rpx; + font-size: 56rpx; + color: rgba(255, 255, 255, 1); + font-weight: bold; + line-height: 1; + } + } + } + .container { + position: relative; + z-index: 1; + padding: 32rpx 0 20rpx; + box-shadow: 0rpx 4rpx 14rpx 0rpx rgba(40, 48, 49, 0.1); + border-radius: 0 0 24rpx 24rpx; + .c-row { + display: flex; + align-items: center; + justify-content: space-between; + .item { + flex: 1; + text-align: center; + .name { + font-size: 22rpx; + color: rgba(154, 161, 162, 1); + display: flex; + align-items: center; + justify-content: center; + gap: 8rpx; + .icon { + width: 20rpx; + height: 20rpx; + } + } + .num { + margin-top: 12rpx; + font-size: 44rpx; + color: rgba(40, 48, 49, 1); + font-weight: bold; + line-height: 1; + } + } + .line { + height: 66rpx; + border-right: 2px dotted rgba(194, 201, 202, 1); + } + } + .c-row-line { + margin: 32rpx 20rpx; + width: 650rpx; + border-top: 1rpx dashed #d4d9da; + } + } + } + + .page-container { + margin: 0 30rpx; + .van-sticky-wrap--fixed { + background-color: #fff; + } + .card { + margin: 24rpx 0 0; + padding-top: 15px; + background: #fff linear-gradient(to top, #ffffff 0%, #ffffff 89%, #e8f0f2 100%) no-repeat top center / 100% 752rpx; + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2rpx solid #ffffff; + .card-title { + padding: 15rpx 30rpx 30rpx 0; + display: flex; + align-items: center; + justify-content: space-between; + .wrap { + display: flex; + align-items: center; + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + font-weight: bold; + .icon { + width: 24rpx; + height: 30rpx; + } + } + .fold { + font-size: 28rpx; + color: rgba(154, 161, 162, 1); + display: flex; + align-items: center; + gap: 10rpx; + .icon { + width: 24rpx; + height: 24rpx; + } + } + } + .fold-container { + max-height: 0; + overflow: hidden; + transition: max-height 0.3s; + &.unfold-container { + max-height: 1800rpx; + } + } + .navbar { + display: flex; + padding: 12rpx 0; + .nav { + flex: 1; + text-align: center; + font-size: 32rpx; + color: rgba(103, 113, 114, 1); + &.active { + color: rgba(98, 190, 208, 1); + font-weight: bold; + &::after { + margin: 4rpx auto 0; + display: block; + content: ''; + width: 54rpx; + height: 8rpx; + border-radius: 8rpx 8rpx 0 0; + background-color: rgba(98, 190, 208, 1); + } + } + } + } + .switch { + margin: 15rpx 30rpx; + padding: 8rpx; + display: flex; + justify-content: space-between; + align-items: center; + background: #f2f4f5; + border-radius: 98rpx 98rpx 98rpx 98rpx; + .switch-item { + flex: 1; + padding: 14rpx; + font-size: 28rpx; + color: rgba(103, 113, 114, 1); + text-align: center; + border-radius: 62rpx; + &.active { + color: #fff; + background-color: rgba(98, 190, 208, 1); + } + } + } + .chart { + .chart-header { + padding: 15rpx 30rpx; + display: flex; + justify-content: space-between; + align-items: center; + .select-year { + padding: 10rpx 28rpx; + border-radius: 34rpx; + background-color: #f2f4f5; + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + .icon { + width: 24rpx; + height: 24rpx; + } + } + .tip { + font-size: 24rpx; + color: rgba(154, 161, 162, 1); + } + } + .chat-data-panel { + padding: 15rpx 30rpx; + gap: 14rpx; + display: grid; + grid-template-columns: repeat(auto-fill, minmax(200rpx, 1fr)); + .panel { + flex: 1; + padding: 28rpx 0 18rpx; + text-align: center; + background: #ffffff; + box-shadow: 0rpx 4rpx 24rpx 0rpx rgba(40, 48, 49, 0.07); + border-radius: 12rpx 12rpx 12rpx 12rpx; + border: 1rpx solid #f2f4f5; + .name { + font-size: 24rpx; + color: rgba(154, 161, 162, 1); + .icon { + width: 20rpx; + height: 20rpx; + } + } + .num { + margin-top: 8rpx; + font-size: 40rpx; + font-weight: bold; + color: rgba(40, 48, 49, 1); + line-height: 1; + } + } + } + .chart-title { + padding: 15rpx 30rpx 15rpx 0; + display: flex; + align-items: center; + gap: 4rpx; + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + font-weight: bold; + .icon { + width: 24rpx; + height: 30rpx; + } + .q-icon { + width: 24rpx; + height: 24rpx; + } + &.no-top { + margin-top: 0; + } + } + .chart-tip { + padding: 0 30rpx; + font-size: 24rpx; + color: rgba(154, 161, 162, 1); + } + .chart-container { + padding: 15rpx 30rpx; + width: 100%; + height: 546rpx; + box-sizing: border-box; + } + .tip { + padding: 20rpx; + text-align: center; + font-size: 20rpx; + color: #677172; + line-height: 32rpx; + } + } + } + } +} diff --git a/src/doctor/pages/d_home/index.ts b/src/doctor/pages/d_home/index.ts new file mode 100644 index 0000000..88b2242 --- /dev/null +++ b/src/doctor/pages/d_home/index.ts @@ -0,0 +1,1097 @@ +import dayjs from 'dayjs' +import Dialog from '@vant/weapp/dialog/dialog' + +const app = getApp() +let echarts: any = null + +Page({ + data: { + fold4: false, + fold5: false, + top: 0, + bottom: 0, + ec: { + lazyLoad: true, + }, + + startData: dayjs('2025').format('YYYY'), + endDate: dayjs().format('YYYY'), + + doctor: {}, + hospital: {}, + detail: {}, + + tab1: 0, + tab2: 0, + tab3: 0, + + year1: dayjs().format('YYYY'), + year2: dayjs().format('YYYY'), + year3: dayjs().format('YYYY'), + + adlReadStatus: false, + statDate: '', + }, + ecDataTrendComponent1_1: null as any, + ecDataTrendComponent1_2: null as any, + ecDataTrendComponent2_1: null as any, + ecDataTrendComponent2_2: null as any, + ecDataTrendComponent3_1: null as any, + ecDataTrendComponent3_2: null as any, + ecDataTrendComponent4_1: null as any, + ecDataTrendComponent5_1: null as any, + async onLoad() { + const SystemInfo = app.globalSystemInfo + if (SystemInfo) { + const { top, bottom } = SystemInfo.capsulePosition + this.setData({ + top, + bottom, + }) + } + echarts = await require.async('../../../resource/components/echart/echarts.js') + app.waitLogin().then((_res) => { + app.mpBehavior({ doctor: true, PageName: 'PG_DOCTORHOME' }) + this.getDoctorInfo() + this.getDetail() + this.getList1_1() + this.getList2_1() + this.getList3_1() + this.getList4_1() + this.getList5_1() + this.getAdlStatus() + }) + }, + getDoctorInfo() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/account/info', + data: {}, + }).then((res) => { + this.setData({ + hospital: res.hospital, + doctor: res.doctor, + }) + }) + }, + getDetail() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/doctor-stat/get-last-month', + data: {}, + }).then((res) => { + this.setData({ + detail: { + ...res, + year: dayjs(res.StatMonth).format('YYYY'), + yr: dayjs(res.StatMonth).format('YY'), + }, + }) + }) + }, + handleTab1(e) { + const { index } = e.currentTarget.dataset + this.setData({ + tab1: index, + }) + if (index === 0) { + this.getList1_1() + } else if (index === 1) { + this.getList1_2() + } + }, + handleSelectYear1() { + this.handleTab1({ + currentTarget: { + dataset: { + index: this.data.tab1, + }, + }, + }) + }, + getList1_1() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/doctor-stat/get-month-list', + data: { + statYear: this.data.year1, + }, + }).then(async (res) => { + this.initChart1_1(res.list) + }) + }, + getList1_2() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/doctor-stat/get-month-list', + data: { + statYear: this.data.year1, + }, + }).then((res) => { + this.initChart1_2(res.list) + }) + }, + initChart1_1(list: any[]) { + return new Promise((reslove) => { + this.ecDataTrendComponent1_1 = this.selectComponent('#chart1_1') + this.ecDataTrendComponent1_1.init((canvas, width, height, dpr) => { + const chart = echarts.init(canvas, null, { + width, + height, + devicePixelRatio: dpr, // new + }) + canvas.setChart(chart) + const x: string[] = [] + const y1: string[] = [] + list.forEach((item) => { + x.push(item.StatMonth) + y1.push(item.MonthInvitePCount) + }) + + const option = { + legend: { + bottom: 0, + itemWidth: 8, + itemHeight: 8, + icon: 'circle', + lineStyle: { + width: '0', + }, + textStyle: { + color: 'rgba(103, 113, 114, 1)', + fontSize: '12', + }, + data: [], + }, + grid: { + top: '10%', + left: '3%', + right: '4%', + bottom: '30', + containLabel: true, + }, + xAxis: [ + { + type: 'category', + axisTick: { + show: false, + }, + axisLabel: { + fontSize: 10, + color: 'rgba(40, 48, 49, 1)', + }, + data: x, + }, + ], + yAxis: [ + { + type: 'value', + minInterval: 1, + axisLabel: { + fontSize: 10, + color: 'rgba(40, 48, 49, 1)', + formatter(value) { + return Math.abs(value) + }, + }, + }, + ], + series: [ + { + name: '患者数', + type: 'bar', + stack: 'a', + label: { + show: true, + color: '#000', + fontSize: 10, + overflow: 'truncate', + width: 30, + position: 'top', + }, + color: 'rgba(103, 186, 202, 1)', + data: y1, + }, + ], + dataZoom: { + type: 'inside', // 有type这个属性,滚动条在最下面,也可以不行,写y:36,这表示距离顶端36px,一般就是在图上面。 + startValue: x.length - 6, + endValue: x.length - 1, + filterMode: 'none', + }, + } + + chart.setOption(option) + reslove(chart) + return chart + }) + }) + }, + initChart1_2(list: any[]) { + this.ecDataTrendComponent1_2 = this.selectComponent('#chart1_2') + this.ecDataTrendComponent1_2.init((canvas, width, height, dpr) => { + const chart = echarts.init(canvas, null, { + width, + height, + devicePixelRatio: dpr, // new + }) + canvas.setChart(chart) + const x: string[] = [] + const y1: string[] = [] + list.forEach((item) => { + x.push(item.StatMonth) + y1.push(item.InvitePCount) + }) + + const option = { + legend: { + bottom: 0, + itemWidth: 8, + itemHeight: 8, + icon: 'circle', + lineStyle: { + width: '0', + }, + textStyle: { + color: 'rgba(103, 113, 114, 1)', + fontSize: '12', + }, + data: [], + }, + grid: { + top: '10%', + left: '3%', + right: '4%', + bottom: '30', + containLabel: true, + }, + xAxis: [ + { + type: 'category', + axisTick: { + show: false, + }, + axisLabel: { + fontSize: 10, + color: 'rgba(40, 48, 49, 1)', + }, + data: x, + }, + ], + yAxis: [ + { + type: 'value', + minInterval: 1, + axisLabel: { + fontSize: 10, + color: 'rgba(40, 48, 49, 1)', + formatter(value) { + return Math.abs(value) + }, + }, + }, + ], + series: [ + { + name: '患者数', + type: 'bar', + stack: 'a', + label: { + show: true, + color: '#000', + fontSize: 10, + overflow: 'truncate', + width: 30, + position: 'top', + }, + color: 'rgba(103, 186, 202, 1)', + data: y1, + }, + ], + dataZoom: { + type: 'inside', // 有type这个属性,滚动条在最下面,也可以不行,写y:36,这表示距离顶端36px,一般就是在图上面。 + startValue: x.length - 6, + endValue: x.length - 1, + filterMode: 'none', + }, + } + + chart.setOption(option) + return chart + }) + }, + + handleTab2(e) { + const { index } = e.currentTarget.dataset + this.setData({ + tab2: index, + }) + if (index === 0) { + this.getList2_1() + } else if (index === 1) { + this.getList2_2() + } + }, + handleSelectYear2() { + this.handleTab2({ + currentTarget: { + dataset: { + index: this.data.tab2, + }, + }, + }) + }, + getList2_1() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/doctor-stat/get-month-list', + data: { + statYear: this.data.year2, + }, + }).then(async (res) => { + this.initChart2_1(res.list) + }) + }, + getList2_2() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/doctor-stat/get-month-list', + data: { + statYear: this.data.year2, + }, + }).then((res) => { + this.initChart2_2(res.list) + }) + }, + initChart2_1(list: any[]) { + return new Promise((reslove) => { + this.ecDataTrendComponent2_1 = this.selectComponent('#chart2_1') + this.ecDataTrendComponent2_1.init((canvas, width, height, dpr) => { + const chart = echarts.init(canvas, null, { + width, + height, + devicePixelRatio: dpr, // new + }) + canvas.setChart(chart) + const x: string[] = [] + const y1: string[] = [] + list.forEach((item) => { + x.push(item.StatMonth) + y1.push(item.MonthActivePCount) + }) + + const option = { + legend: { + bottom: 0, + itemWidth: 8, + itemHeight: 8, + icon: 'circle', + lineStyle: { + width: '0', + }, + textStyle: { + color: 'rgba(103, 113, 114, 1)', + fontSize: '12', + }, + data: [], + }, + grid: { + top: '10%', + left: '3%', + right: '4%', + bottom: '30', + containLabel: true, + }, + xAxis: [ + { + type: 'category', + axisTick: { + show: false, + }, + axisLabel: { + fontSize: 10, + color: 'rgba(40, 48, 49, 1)', + }, + data: x, + }, + ], + yAxis: [ + { + type: 'value', + minInterval: 1, + axisLabel: { + fontSize: 10, + color: 'rgba(40, 48, 49, 1)', + formatter(value) { + return Math.abs(value) + }, + }, + }, + ], + series: [ + { + name: '患者数', + type: 'bar', + stack: 'a', + label: { + show: true, + color: '#000', + fontSize: 10, + overflow: 'truncate', + width: 30, + position: 'top', + }, + color: 'rgba(103, 186, 202, 1)', + data: y1, + }, + ], + dataZoom: { + type: 'inside', // 有type这个属性,滚动条在最下面,也可以不行,写y:36,这表示距离顶端36px,一般就是在图上面。 + startValue: x.length - 6, + endValue: x.length - 1, + filterMode: 'none', + }, + } + + chart.setOption(option) + reslove(chart) + return chart + }) + }) + }, + initChart2_2(list: any[]) { + this.ecDataTrendComponent2_2 = this.selectComponent('#chart2_2') + this.ecDataTrendComponent2_2.init((canvas, width, height, dpr) => { + const chart = echarts.init(canvas, null, { + width, + height, + devicePixelRatio: dpr, // new + }) + canvas.setChart(chart) + const x: string[] = [] + const y1: string[] = [] + list.forEach((item) => { + x.push(item.StatMonth) + y1.push(item.YearActivePCount) + }) + + const option = { + legend: { + bottom: 0, + itemWidth: 8, + itemHeight: 8, + icon: 'circle', + lineStyle: { + width: '0', + }, + textStyle: { + color: 'rgba(103, 113, 114, 1)', + fontSize: '12', + }, + data: [], + }, + grid: { + top: '10%', + left: '3%', + right: '4%', + bottom: '30', + containLabel: true, + }, + xAxis: [ + { + type: 'category', + axisTick: { + show: false, + }, + axisLabel: { + fontSize: 10, + color: 'rgba(40, 48, 49, 1)', + }, + data: x, + }, + ], + yAxis: [ + { + type: 'value', + minInterval: 1, + axisLabel: { + fontSize: 10, + color: 'rgba(40, 48, 49, 1)', + formatter(value) { + return Math.abs(value) + }, + }, + }, + ], + series: [ + { + name: '患者数', + type: 'bar', + stack: 'a', + label: { + show: true, + color: '#000', + fontSize: 10, + overflow: 'truncate', + width: 30, + position: 'top', + }, + color: 'rgba(103, 186, 202, 1)', + data: y1, + }, + ], + dataZoom: { + type: 'inside', // 有type这个属性,滚动条在最下面,也可以不行,写y:36,这表示距离顶端36px,一般就是在图上面。 + startValue: x.length - 6, + endValue: x.length - 1, + filterMode: 'none', + }, + } + + chart.setOption(option) + return chart + }) + }, + + handleTab3(e) { + const { index } = e.currentTarget.dataset + this.setData({ + tab3: index, + }) + if (index === 0) { + this.getList3_1() + } else if (index === 1) { + this.getList3_2() + } + }, + handleSelectYear3() { + this.handleTab3({ + currentTarget: { + dataset: { + index: this.data.tab3, + }, + }, + }) + }, + getList3_1() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/doctor-stat/get-month-list', + data: { + statYear: this.data.year3, + }, + }).then(async (res) => { + this.initChart3_1(res.list) + }) + }, + getList3_2() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/doctor-stat/get-month-list', + data: { + statYear: this.data.year3, + }, + }).then((res) => { + this.initChart3_2(res.list) + }) + }, + initChart3_1(list: any[]) { + return new Promise((reslove) => { + this.ecDataTrendComponent3_1 = this.selectComponent('#chart3_1') + this.ecDataTrendComponent3_1.init((canvas, width, height, dpr) => { + const chart = echarts.init(canvas, null, { + width, + height, + devicePixelRatio: dpr, // new + }) + canvas.setChart(chart) + const x: string[] = [] + const y1: string[] = [] + list.forEach((item) => { + x.push(item.StatMonth) + y1.push(item.MonthRegularAssessPCount) + }) + + const option = { + legend: { + bottom: 0, + itemWidth: 8, + itemHeight: 8, + icon: 'circle', + lineStyle: { + width: '0', + }, + textStyle: { + color: 'rgba(103, 113, 114, 1)', + fontSize: '12', + }, + data: [], + }, + grid: { + top: '10%', + left: '3%', + right: '4%', + bottom: '30', + containLabel: true, + }, + xAxis: [ + { + type: 'category', + axisTick: { + show: false, + }, + axisLabel: { + fontSize: 10, + color: 'rgba(40, 48, 49, 1)', + }, + data: x, + }, + ], + yAxis: [ + { + type: 'value', + minInterval: 1, + axisLabel: { + fontSize: 10, + color: 'rgba(40, 48, 49, 1)', + formatter(value) { + return Math.abs(value) + }, + }, + }, + ], + series: [ + { + name: '患者数', + type: 'bar', + stack: 'a', + label: { + show: true, + color: '#000', + fontSize: 10, + overflow: 'truncate', + width: 30, + position: 'top', + }, + color: 'rgba(103, 186, 202, 1)', + data: y1, + }, + ], + dataZoom: { + type: 'inside', // 有type这个属性,滚动条在最下面,也可以不行,写y:36,这表示距离顶端36px,一般就是在图上面。 + startValue: x.length - 6, + endValue: x.length - 1, + filterMode: 'none', + }, + } + + chart.setOption(option) + reslove(chart) + return chart + }) + }) + }, + initChart3_2(list: any[]) { + this.ecDataTrendComponent3_2 = this.selectComponent('#chart3_2') + this.ecDataTrendComponent3_2.init((canvas, width, height, dpr) => { + const chart = echarts.init(canvas, null, { + width, + height, + devicePixelRatio: dpr, // new + }) + canvas.setChart(chart) + const x: string[] = [] + const y1: string[] = [] + list.forEach((item) => { + x.push(item.StatMonth) + y1.push(item.RegularAssessPCount) + }) + + const option = { + legend: { + bottom: 0, + itemWidth: 8, + itemHeight: 8, + icon: 'circle', + lineStyle: { + width: '0', + }, + textStyle: { + color: 'rgba(103, 113, 114, 1)', + fontSize: '12', + }, + data: [], + }, + grid: { + top: '10%', + left: '3%', + right: '4%', + bottom: '30', + containLabel: true, + }, + xAxis: [ + { + type: 'category', + axisTick: { + show: false, + }, + axisLabel: { + fontSize: 10, + color: 'rgba(40, 48, 49, 1)', + }, + data: x, + }, + ], + yAxis: [ + { + type: 'value', + minInterval: 1, + axisLabel: { + fontSize: 10, + color: 'rgba(40, 48, 49, 1)', + formatter(value) { + return Math.abs(value) + }, + }, + }, + ], + series: [ + { + name: '患者数', + type: 'bar', + stack: 'a', + label: { + show: true, + color: '#000', + fontSize: 10, + overflow: 'truncate', + width: 30, + position: 'top', + }, + color: 'rgba(103, 186, 202, 1)', + data: y1, + }, + ], + dataZoom: { + type: 'inside', // 有type这个属性,滚动条在最下面,也可以不行,写y:36,这表示距离顶端36px,一般就是在图上面。 + startValue: x.length - 6, + endValue: x.length - 1, + filterMode: 'none', + }, + } + + chart.setOption(option) + return chart + }) + }, + + getList4_1() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/doctor-stat/get-month-list', + data: {}, + }).then((res) => { + this.initChart4_1(res.list) + }) + }, + initChart4_1(list: any[]) { + this.ecDataTrendComponent4_1 = this.selectComponent('#chart4_1') + this.ecDataTrendComponent4_1.init((canvas, width, height, dpr) => { + const chart = echarts.init(canvas, null, { + width, + height, + devicePixelRatio: dpr, // new + }) + canvas.setChart(chart) + const x: string[] = [] + const y1: string[] = [] + list.forEach((item) => { + x.push(item.StatMonth) + y1.push(item.YearAdlStandardRate) + }) + + const option = { + legend: { + bottom: 0, + itemWidth: 8, + itemHeight: 8, + icon: 'circle', + lineStyle: { + width: '0', + }, + textStyle: { + color: '#283031', + fontSize: '12', + fontWeight: 'bold', + }, + data: [ + { + name: '疗效达标率', + }, + ], + }, + grid: { + top: '10%', + left: '3%', + right: '4%', + bottom: '30', + containLabel: true, + }, + xAxis: [ + { + type: 'category', + axisTick: { + show: false, + }, + axisLabel: { + fontSize: 10, + color: 'rgba(40, 48, 49, 1)', + }, + data: x, + }, + ], + yAxis: [ + { + type: 'value', + minInterval: 1, + splitNumber: 5, + axisLabel: { + fontSize: 10, + color: 'rgba(40, 48, 49, 1)', + formatter(value) { + return `${Math.abs(value)}%` + }, + }, + }, + ], + series: [ + { + name: '疗效达标率', + type: 'line', + stack: '', + color: 'rgba(226, 219, 65, 1)', + label: { + normal: { + show: true, + position: 'top', + color: 'rgba(40, 48, 49, 1)', + fontSize: 10, + formatter: '{c}%', + }, + }, + barGap: '-100%', + data: y1, + }, + ], + dataZoom: { + type: 'inside', // 有type这个属性,滚动条在最下面,也可以不行,写y:36,这表示距离顶端36px,一般就是在图上面。 + startValue: x.length - 6, + endValue: x.length - 1, + filterMode: 'none', + }, + } + + chart.setOption(option) + return chart + }) + }, + + getList5_1() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/doctor-stat/get-month-list', + data: {}, + }).then((res) => { + this.initChart5_1(res.list) + }) + }, + initChart5_1(list: any[]) { + this.ecDataTrendComponent5_1 = this.selectComponent('#chart5_1') + this.ecDataTrendComponent5_1.init((canvas, width, height, dpr) => { + const chart = echarts.init(canvas, null, { + width, + height, + devicePixelRatio: dpr, // new + }) + canvas.setChart(chart) + const x: string[] = [] + const y1: string[] = [] + list.forEach((item) => { + x.push(item.StatMonth) + y1.push(item.YearDoubleStandardRate) + }) + + const option = { + legend: { + bottom: 0, + itemWidth: 8, + itemHeight: 8, + icon: 'circle', + lineStyle: { + width: '0', + }, + textStyle: { + color: '#283031', + fontSize: '12', + fontWeight: 'bold', + }, + data: [ + { + name: '双达标率', + }, + ], + }, + grid: { + top: '10%', + left: '3%', + right: '4%', + bottom: '30', + containLabel: true, + }, + xAxis: [ + { + type: 'category', + axisTick: { + show: false, + }, + axisLabel: { + fontSize: 10, + color: 'rgba(40, 48, 49, 1)', + }, + data: x, + }, + ], + yAxis: [ + { + type: 'value', + minInterval: 1, + splitNumber: 5, + axisLabel: { + fontSize: 10, + color: 'rgba(40, 48, 49, 1)', + formatter(value) { + return `${Math.abs(value)}%` + }, + }, + }, + ], + series: [ + { + name: '双达标率', + type: 'line', + stack: '', + color: 'rgba(226, 219, 65, 1)', + label: { + normal: { + show: true, + position: 'top', + color: 'rgba(40, 48, 49, 1)', + fontSize: 10, + formatter: '{c}%', + }, + }, + barGap: '-100%', + data: y1, + }, + ], + dataZoom: { + type: 'inside', // 有type这个属性,滚动条在最下面,也可以不行,写y:36,这表示距离顶端36px,一般就是在图上面。 + startValue: x.length - 6, + endValue: x.length - 1, + filterMode: 'none', + }, + } + + chart.setOption(option) + return chart + }) + }, + + handleQuestion(e) { + const { id } = e.currentTarget.dataset + const toastParams = { + 1: { + content: `累计邀约患者数`, + title: '累计邀约', + }, + 2: { + content: `今年至少完成 1 次ADL 测评的患者数`, + title: `${dayjs().format('YY')}年激活`, + }, + 3: { + content: `本月新邀约患者数`, + title: '本月新增', + }, + 4: { + content: `今年末次ADL评估:\n①ADL增加≥2分;\n②ADL总分≥5分;\n③ADL总分2-4分,延髓评分+呼吸评分≥2分;\n④激素≥20mg/d,以上条件任意满足一条的患者数;`, + title: '需随访', + }, + 5: { + content: `1.数据统计截至到上月月底 \n 2.近 3 个月内完成ADL 测评≥3 次患者数/今年激活患者数`, + title: 'ADL规律评估率', + }, + 6: { + content: `单月复诊患者数/今年需随访患者数`, + title: '复诊率', + }, + 7: { + content: `今年末次ADL测评为 0 或1 患者数/今年激活患者数`, + title: '疗效达标率', + }, + 8: { + content: `今年末次ADL 测评为 0 或 1 且激素用量≤5mg/d患者数/今年激活患者数`, + title: '双达标率', + }, + }[id] + Dialog.alert({ + title: toastParams.title || '提示说明', + messageAlign: 'left', + message: toastParams.content, + zIndex: 10000, + confirmButtonColor: '#62bed0', + } as any) + }, + handleFoldToggle4() { + this.setData({ + fold4: !this.data.fold4, + }) + }, + handleFoldToggle5() { + this.setData({ + fold5: !this.data.fold5, + }) + }, + handleExport() { + app.mpBehavior({ doctor: true, PageName: 'BTN_DOCTORADLREPORTENTRY' }) + wx.navigateTo({ + url: '/doctor/pages/d_exportList/index', + }) + }, + getAdlStatus() { + wx.ajax({ method: 'GET', url: '?r=igg4/doctor/doctor-stat/get-last-week', data: {} }).then((res) => { + if (!res) return + this.setData({ + adlReadStatus: res.readStatus == 0, + statDate: res.statDate, + }) + }) + }, + handlePatient(e) { + const { type, name } = e.currentTarget.dataset + + wx.navigateTo({ + url: `/doctor/pages/d_patientList/index?type=${type}&name=${name}`, + }) + }, + handleTransfer() { + app.mpBehavior({ doctor: true, PageName: 'BTN_DOCTORHOMEPAGERECOMMENDEDREFERRAL' }) + wx.navigateTo({ + url: '/doctor/pages/d_transfer/index', + }) + }, + handleTransferLog() { + wx.navigateTo({ + url: '/doctor/pages/d_transferLog/index', + }) + }, +}) diff --git a/src/doctor/pages/d_home/index.wxml b/src/doctor/pages/d_home/index.wxml new file mode 100644 index 0000000..8c925ed --- /dev/null +++ b/src/doctor/pages/d_home/index.wxml @@ -0,0 +1,345 @@ + + + + + + + + {{doctor.Name}} + + {{hospital.Name}} + {{hospital.HospitalClassificationName}}{{hospital.HospitalLevelName}} + + + + + + 报告中心 + + + 每周五报告更新 + 您的ADL报告(截至 {{statDate}})已生成 + + + + + + 推荐转诊 + + 您推荐的医生有患者复诊 + + 统计数据截止到昨天 + + + + + + 累计邀约 + + + + {{detail.InvitePCount}} + + + + + + + + + {{detail.yr}}年激活 + + + + {{detail.YearActivePCount}} + + + + + + + + + 本月新增 + + + + {{detail.MonthInvitePCount}} + + + + + + + + + 需随访 + + + + {{detail.YearNeedFollowPCount}} + + + + + + + + {{detail.year}}年 + + + + + + ADL规律评估率 + + + + {{detail.MonthRegularAssessRate}} + % + + + + + + + 复诊率 + + + + {{detail.MonthReVisitRate}} + % + + + + + + + 疗效达标率 + + + + {{detail.YearAdlStandardRate}} + % + + + + + + + 双达标率 + + + + {{detail.YearDoubleStandardRate}} + % + + + + + + 您已超过全国{{detail.YearAdlStandardSortRate}}%的医生 + + + + + + + 月度邀约患者数 + + + 累计邀约患者数 + + + + + + {{year1}}年 + + + 统计数据截止昨天 + + + + + + + + + + + + + + + + + 月度激活患者数 + + + 累计激活患者数 + + + + + + {{year2}}年 + + + 统计数据截止昨天 + + + + + + + + + + + + + + + + + 月度规律评估患者数 + + + 累计规律评估患者数 + + + + + + {{year3}}年 + + + 统计数据截止昨天 + + + + + + + + + + + + + + + + + + + 疗效达标率 + + + {{ fold4? '展开' : '收起' }} + + + + + + + + + 未次ADL 0或1的患者数/年激活患者数 + + + + + + + + 双达标率 + + + {{ fold5? '展开' : '收起' }} + + + + + + + + + 未次ADL 0或1且激素≤5mg/天的患者数/年激活患者数 + + + + + + + + + diff --git a/src/doctor/pages/d_interactive/index.json b/src/doctor/pages/d_interactive/index.json new file mode 100644 index 0000000..15fca3b --- /dev/null +++ b/src/doctor/pages/d_interactive/index.json @@ -0,0 +1,9 @@ +{ + "navigationStyle": "custom", + "usingComponents": { + "tabbar": "../../components/tabbar/index", + "navBar": "/components/navBar/navBar", + "van-icon": "@vant/weapp/icon/index", + "van-popup": "@vant/weapp/popup/index" + } +} diff --git a/src/doctor/pages/d_interactive/index.scss b/src/doctor/pages/d_interactive/index.scss new file mode 100644 index 0000000..b6ae878 --- /dev/null +++ b/src/doctor/pages/d_interactive/index.scss @@ -0,0 +1,161 @@ +page { + background-color: rgba(242, 244, 245, 1); + padding-bottom: calc(140rpx + env(safe-area-inset-bottom)); +} +.page { + min-height: 100vh; + .page-header { + position: sticky; + top: 0; + padding: 30rpx; + box-shadow: 0rpx 8rpx 16rpx 0rpx rgba(40, 48, 49, 0.04); + z-index: 10; + .wrap { + display: flex; + align-items: center; + .search { + flex: 1; + padding: 18rpx 32rpx; + display: flex; + align-items: center; + gap: 16rpx; + background: linear-gradient(to top, #ffffff 0%, #ebf3f4 100%); + box-shadow: 0rpx 8rpx 8rpx 0rpx rgba(40, 48, 49, 0.04); + border-radius: 140rpx 140rpx 140rpx 140rpx; + border: 2rpx solid #ffffff; + .icon { + width: 40rpx; + height: 40rpx; + } + .input { + flex: 1; + font-size: 28rpx; + } + .input-place { + color: rgba(173, 179, 180, 1); + } + } + .clear { + margin-left: 32rpx; + width: 44rpx; + height: 44rpx; + } + } + .navbar { + margin-top: 32rpx; + display: flex; + justify-content: space-between; + align-items: center; + .nav { + position: relative; + flex: 1; + text-align: center; + font-size: 32rpx; + color: rgba(103, 113, 114, 1); + transition: all 0.3s; + .dot { + padding: 0 4rpx; + position: absolute; + left: 50%; + transform: translateX(35rpx); + top: 0; + min-width: 18rpx; + height: 26rpx; + font-size: 18rpx; + line-height: 26rpx; + color: rgba(255, 255, 255, 1); + border-radius: 50%; + background: rgba(215, 108, 108, 1); + } + &.active { + font-size: 32rpx; + color: rgba(98, 190, 208, 1); + font-weight: bold; + &::after { + position: absolute; + bottom: -30rpx; + left: 50%; + transform: translateX(-50%); + content: ''; + width: 52rpx; + height: 8rpx; + border-radius: 24rpx 24rpx 0 0; + background: #62bed0; + } + } + } + } + } + .list { + margin: 30rpx; + .list-item { + margin-bottom: 24rpx; + padding: 30rpx; + border-radius: 24rpx; + background-color: #fff; + display: flex; + .avatar { + flex-shrink: 0; + position: relative; + width: 92rpx; + height: 92rpx; + .a-img { + width: 100%; + height: 100%; + border-radius: 50%; + } + .dot { + position: absolute; + top: 0; + right: 0; + width: 18rpx; + height: 18rpx; + border: 2rpx solid #ffffff; + border-radius: 50%; + background: #d76c6c; + } + } + .wrap { + flex: 1; + padding-left: 24rpx; + .w-header { + display: flex; + align-items: center; + justify-content: space-between; + .name { + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + font-weight: bold; + } + .date { + font-size: 24rpx; + color: rgba(154, 161, 162, 1); + } + } + .tags { + margin-top: 12rpx; + display: flex; + flex-wrap: wrap; + gap: 12rpx; + .tag { + padding: 4rpx 16rpx; + border-radius: 8rpx; + border-color: rgba(242, 244, 245, 1); + font-size: 22rpx; + color: rgba(103, 113, 114, 1); + background-color: rgba(242, 244, 245, 1); + } + } + .content { + margin-top: 20rpx; + max-width: 18em; + font-size: 28rpx; + color: rgba(154, 161, 162, 1); + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } + } + } + } +} diff --git a/src/doctor/pages/d_interactive/index.ts b/src/doctor/pages/d_interactive/index.ts new file mode 100644 index 0000000..601c838 --- /dev/null +++ b/src/doctor/pages/d_interactive/index.ts @@ -0,0 +1,126 @@ +const app = getApp() + +Page({ + data: { + list: [] as any, + unReadCount: 0, + pagination: { + page: 1, + pages: 1, + count: 1, + }, + active: '', + search: '', + }, + onShow() { + app.waitLogin().then((_res) => { + this.getList() + }) + }, + handleTapSearch() { + app.mpBehavior({ doctor:true, PageName: 'BTN_DOCTORINTERACTIONSEARCH' }) + }, + handleSearch() { + this.setData({ + list: [], + pagination: { + page: 1, + pages: 1, + count: 1, + }, + }) + this.getList() + }, + handleNav(e) { + const { active } = e.currentTarget.dataset + this.setData({ + active, + }) + this.getList() + }, + getList(newPage = 1) { + const { active } = this.data + if (active == '' && newPage == 1) { + app.mpBehavior({ doctor:true, PageName: 'PG_DOCTORINTERACTIONALL' }) + } + if (active == '1' && newPage == 1) { + app.mpBehavior({ doctor:true, PageName: 'PG_DOCTORINTERACTIONREAD' }) + } + if (active == '2' && newPage == 1) { + app.mpBehavior({ doctor:true, PageName: 'PG_DOCTORINTERACTIONUNREAD' }) + } + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/message-interact/get-interact-patient-list', + data: { + page: newPage, + search: this.data.search, + readStatus: this.data.active, + }, + }).then((res) => { + const list = res.page === 1 ? res.list : [...this.data.list, ...res.list] + this.setData({ + list, + unReadCount: res.unReadCount, + pagination: { + page: res.page, + pages: res.pages, + count: res.count, + }, + }) + + const header = this.selectComponent('#tabbar') + header.getList() //子组件的方法 + }) + }, + onReachBottom() { + const { page, pages } = this.data.pagination + if (pages > page) { + this.getList(page + 1) + } + }, + handleDetail(e) { + app.mpBehavior({ doctor:true, PageName: 'BTN_DOCTORINTERACTIONVIEW' }) + const { index } = e.currentTarget.dataset + const { list } = this.data + const listItem: any = list[index] + wx.navigateTo({ + url: `/doctor/pages/d_interactiveDoctor/index?patientId=${listItem.patientId}`, + }) + }, + hancleClaer() { + if (Number(this.data.unReadCount) === 0) { + wx.showToast({ + title: '暂无未读消息', + icon: 'none', + }) + return + } + wx.showModal({ + title: '提示', + content: '确认清空消息吗?', + confirmColor: '#62bed0', + success: (res) => { + if (res.confirm) { + wx.ajax({ + method: 'POST', + url: '?r=igg4/doctor/message-interact/read-history', + data: {}, + }).then((_res) => { + this.setData({ + unReadCount: 0, + list: this.data.list.map((item: any) => { + return { + ...item, + msgReadStatus: '1', + } + }), + }) + const header = this.selectComponent('#tabbar') + header.getList() //子组件的方法 + }) + } + }, + }) + }, +}) diff --git a/src/doctor/pages/d_interactive/index.wxml b/src/doctor/pages/d_interactive/index.wxml new file mode 100644 index 0000000..951960e --- /dev/null +++ b/src/doctor/pages/d_interactive/index.wxml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{item.patientName}} + {{item.Telephone}} + {{item.msgCreateTime}} + + + + {{tag}} + + + {{item.msgContent}} + + + + + + diff --git a/src/doctor/pages/d_interactiveDoctor/index.json b/src/doctor/pages/d_interactiveDoctor/index.json new file mode 100644 index 0000000..a2aaccb --- /dev/null +++ b/src/doctor/pages/d_interactiveDoctor/index.json @@ -0,0 +1,7 @@ +{ + "navigationBarTitleText": "互动", + "usingComponents": { + "van-icon": "@vant/weapp/icon/index", + "van-popup": "@vant/weapp/popup/index" + } +} diff --git a/src/doctor/pages/d_interactiveDoctor/index.scss b/src/doctor/pages/d_interactiveDoctor/index.scss new file mode 100644 index 0000000..398bf38 --- /dev/null +++ b/src/doctor/pages/d_interactiveDoctor/index.scss @@ -0,0 +1,681 @@ +page { + background-color: rgba(242, 244, 245, 1); +} +.page { + height: 100vh; + overflow: hidden; + display: flex; + flex-direction: column; + justify-content: space-between; + .page-header { + padding-bottom: 30rpx; + border-radius: 0 0 24rpx 24rpx; + background-color: #fff; + .user { + flex-shrink: 0; + padding: 36rpx 30rpx 0; + display: flex; + align-items: center; + justify-content: space-between; + .avatar { + width: 104rpx; + height: 104rpx; + border-radius: 50%; + } + .wrap { + flex: 1; + padding: 0 20rpx; + .name { + display: flex; + justify-content: space-between; + align-items: center; + font-size: 40rpx; + color: rgba(40, 48, 49, 1); + font-weight: bold; + .tip { + display: block; + padding: 2rpx 16rpx; + font-size: 24rpx; + color: #fff; + border-radius: 0 30rpx 30rpx 30rpx; + background-color: #67baca; + } + .detail { + flex-shrink: 0; + font-size: 28rpx; + color: rgba(103, 186, 202, 1); + font-weight: normal; + } + } + .tags { + margin-top: 20rpx; + display: flex; + flex-wrap: wrap; + gap: 12rpx; + .tag { + padding: 4rpx 16rpx; + font-size: 22rpx; + color: rgba(103, 113, 114, 1); + border-radius: 8rpx; + background-color: rgba(242, 244, 245, 1); + } + } + } + } + .adl { + margin: 32rpx 30rpx 0; + background: #ffffff; + box-shadow: 0rpx 8rpx 32rpx 0rpx rgba(40, 48, 49, 0.04); + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2rpx solid #f8f9f9; + .a-header { + display: flex; + align-items: flex-start; + flex-direction: column; + .content { + border-radius: 24rpx 0 24rpx 0; + padding: 14rpx 28rpx; + font-size: 28rpx; + line-height: 1; + color: rgba(98, 190, 208, 1); + background-color: rgba(242, 248, 249, 1); + } + .box { + width: 40rpx; + height: 40rpx; + background-color: rgba(242, 248, 249, 1); + } + } + .a-content { + position: relative; + z-index: 1; + margin-top: -40rpx; + padding: 32rpx 30rpx; + background-color: #fff; + border-radius: 24rpx; + .row { + display: flex; + align-items: center; + gap: 20rpx; + &:first-of-type { + margin-bottom: 24rpx; + } + .label { + flex-shrink: 0; + font-size: 28rpx; + color: rgba(154, 161, 162, 1); + } + .num { + min-width: 3em; + font-size: 28rpx; + color: rgba(40, 48, 49, 1); + } + .tag { + display: flex; + align-items: center; + background-color: rgba(232, 245, 248, 1); + border-radius: 12rpx; + .t-label { + padding: 8rpx 12rpx; + font-size: 24rpx; + color: rgba(255, 255, 255, 1); + background-color: rgba(103, 186, 202, 1); + border-radius: 12rpx; + display: flex; + align-items: center; + gap: 8rpx; + flex-shrink: 0; + .icon { + width: 24rpx; + height: 24rpx; + } + } + .t-content { + padding: 0 16rpx 0 8rpx; + display: flex; + align-items: center; + font-size: 28rpx; + color: rgba(103, 186, 202, 1); + display: flex; + align-items: center; + gap: 4rpx; + flex-shrink: 0; + .icon { + width: 24rpx; + height: 28rpx; + } + } + &.tag-warn { + background-color: rgba(227, 220, 64, 0.1); + .t-label { + background-color: rgba(225, 217, 45, 1); + } + .t-content { + color: rgba(225, 217, 45, 1); + } + } + &.tag-error { + background-color: rgba(248, 234, 234, 1); + .t-label { + background-color: rgba(215, 108, 108, 1); + } + .t-content { + color: rgba(215, 108, 108, 1); + } + } + } + } + } + } + } + .page-container { + flex: 1; + overflow: hidden; + .scroll-view { + height: 100%; + .date { + padding-top: 20rpx; + font-size: 28rpx; + color: rgba(173, 179, 180, 1); + text-align: center; + } + .patient { + padding: 15rpx 30rpx; + display: flex; + .avatar { + padding-right: 16rpx; + flex-shrink: 0; + .a-img { + width: 80rpx; + height: 80rpx; + border-radius: 50%; + } + } + .p-container { + flex: 1; + margin-right: 74rpx; + display: flex; + flex-direction: column; + align-items: start; + .guide { + margin-bottom: 32rpx; + padding: 32rpx 30rpx; + border-radius: 0 32rpx 32rpx; + background: linear-gradient(13deg, #ffffff 8%, #e8f0f1 100%); + border: 2rpx solid #ffffff; + .title { + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + font-weight: bold; + } + .sub-title { + font-size: 28rpx; + color: rgba(154, 161, 162, 1); + margin-bottom: 30rpx; + } + .list { + .l-item { + display: flex; + align-items: center; + gap: 16rpx; + margin-bottom: 30rpx; + .order { + flex-shrink: 0; + width: 28rpx; + height: 28rpx; + font-size: 24rpx; + display: flex; + align-items: center; + justify-content: center; + color: rgba(255, 255, 255, 1); + border-radius: 6rpx; + background: #67baca; + } + .content { + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + } + } + } + .tip { + font-size: 28rpx; + color: rgba(103, 113, 114, 1); + display: flex; + align-items: center; + .icon { + width: 44rpx; + height: 44rpx; + } + } + } + .message { + margin-bottom: 32rpx; + padding: 26rpx 32rpx; + background-color: #fff; + border-radius: 0 32rpx 32rpx; + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + white-space: pre-line; + } + .referral-replay { + margin-bottom: 32rpx; + padding: 18rpx 32rpx; + border-radius: 32rpx; + background-color: #fff; + .title { + font-size: 32rpx; + color: #283031; + line-height: 48rpx; + } + .sub-title { + margin-top: 32rpx; + font-size: 32rpx; + color: #67baca; + font-weight: bold; + display: flex; + align-items: center; + &::before { + margin-right: 8rpx; + content: ''; + width: 6rpx; + height: 32rpx; + background-color: #67baca; + border-radius: 84rpx; + } + } + .r-list { + margin-top: 12rpx; + .item { + padding: 24rpx 0; + font-size: 32rpx; + color: #283031; + line-height: 36rpx; + border-bottom: 1px solid #eaeced; + &:last-of-type { + border: none; + } + } + } + } + } + } + .doctor { + padding: 15rpx 30rpx; + display: flex; + justify-content: flex-end; + .avatar { + padding-left: 16rpx; + flex-shrink: 0; + .a-img { + width: 80rpx; + height: 80rpx; + border-radius: 50%; + } + } + .d-container { + flex: 1; + margin-left: 74rpx; + display: flex; + flex-direction: column; + align-items: flex-end; + .guide { + margin-bottom: 32rpx; + padding: 32rpx 30rpx; + border-radius: 32rpx 0 32rpx 32rpx; + background: linear-gradient(13deg, #ffffff 8%, #e8f0f1 100%); + border: 2rpx solid #ffffff; + .title { + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + font-weight: bold; + } + .sub-title { + font-size: 28rpx; + color: rgba(154, 161, 162, 1); + margin-bottom: 30rpx; + } + .list { + .l-item { + display: flex; + align-items: center; + gap: 16rpx; + margin-bottom: 30rpx; + .order { + flex-shrink: 0; + width: 28rpx; + height: 28rpx; + font-size: 24rpx; + display: flex; + align-items: center; + justify-content: center; + color: rgba(255, 255, 255, 1); + border-radius: 6rpx; + background: #67baca; + } + .content { + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + } + } + } + .tip { + font-size: 28rpx; + color: rgba(103, 113, 114, 1); + display: flex; + align-items: center; + .icon { + width: 44rpx; + height: 44rpx; + } + } + } + .message { + margin-bottom: 32rpx; + padding: 26rpx 32rpx; + background: #67baca; + border-radius: 32rpx 0 32rpx 32rpx; + font-size: 32rpx; + color: #fff; + white-space: pre-line; + } + .week { + margin-bottom: 32rpx; + padding: 26rpx 32rpx; + background-color: #fff; + border-radius: 32rpx 0 32rpx 32rpx; + .w-title { + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + text-align: right; + } + .w-container { + margin-top: 24rpx; + .w-content { + padding: 32rpx; + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + line-height: 48rpx; + border-radius: 24rpx; + background-color: rgba(247, 248, 249, 1); + } + .row { + display: flex; + .label { + width: 156rpx; + height: 76rpx; + display: flex; + align-items: center; + justify-content: center; + font-size: 32rpx; + color: rgba(255, 255, 255, 1); + background-color: rgba(103, 186, 202, 1); + } + .content { + width: 156rpx; + height: 76rpx; + display: flex; + align-items: center; + justify-content: center; + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + background-color: rgba(242, 244, 245, 1); + } + &:first-of-type { + .label { + border-radius: 24rpx 0 0 0; + } + .content { + border-radius: 0 24rpx 0 0; + } + } + &:last-of-type { + .label { + border-radius: 0 0 0 24rpx; + } + .content { + border-radius: 0 0 24rpx 0; + } + } + &:not(:last-of-type) { + border-bottom: 2rpx solid #fff; + } + } + } + } + .adl { + margin-bottom: 32rpx; + padding: 32rpx 156rpx 34rpx 30rpx; + border-radius: 0 32rpx 32rpx; + background: linear-gradient(141deg, #edfcff 0%, #d4f3f9 100%); + border: 2rpx solid #fff; + .title { + width: 324rpx; + height: 40rpx; + } + .sub-title { + margin-top: 18rpx; + line-height: 1; + font-size: 28rpx; + color: rgba(255, 255, 255, 0.8); + } + .btn { + margin-top: 20rpx; + width: 220rpx; + height: 56rpx; + text-align: center; + line-height: 56rpx; + font-size: 28rpx; + color: #e04775; + background: #ffffff; + border-radius: 102rpx 102rpx 102rpx 102rpx; + } + .tip { + margin-top: 10rpx; + font-size: 24rpx; + color: #fff; + } + } + .audio { + margin-bottom: 32rpx; + padding: 22rpx 24rpx; + border-radius: 32rpx 0 32rpx 32rpx; + background: #67baca; + min-width: 218rpx; + font-size: 32rpx; + color: #fff; + display: flex; + align-items: center; + justify-content: flex-end; + gap: 12rpx; + box-sizing: border-box; + .icon { + width: 32rpx; + height: 40rpx; + } + } + .info { + margin-bottom: 32rpx; + padding: 26rpx 32rpx; + background-color: #fff; + border-radius: 32rpx 0 32rpx 32rpx; + .content { + font-size: 28rpx; + color: #283031; + } + .btn { + margin-top: 24rpx; + padding: 22rpx; + font-size: 32rpx; + color: #283031; + line-height: 40rpx; + text-align: center; + background: #67baca; + color: #ffffff; + border-radius: 104rpx 104rpx 104rpx 104rpx; + border: 1rpx solid #f8f9f9; + } + } + .referral { + margin-bottom: 32rpx; + width: 502rpx; + height: 262rpx; + background: linear-gradient(223deg, #59b0c2 0%, #94e2f1 100%); + box-shadow: 0rpx 4rpx 24rpx 0rpx rgba(0, 0, 0, 0.07); + border-radius: 24rpx 24rpx 24rpx 24rpx; + .r-header { + padding: 20rpx 24rpx 0 32rpx; + display: flex; + .title { + font-size: 32rpx; + color: #ffffff; + line-height: 48rpx; + } + .icon { + flex-shrink: 0; + width: 138rpx; + height: 122rpx; + } + } + .r-footer { + padding: 32rpx; + background: linear-gradient(11deg, #ffffff 8%, rgba(255, 255, 255, 0.79) 100%); + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2rpx solid #ffffff; + .btn { + width: 438rpx; + height: 64rpx; + font-size: 32rpx; + color: #fff; + text-align: center; + line-height: 64rpx; + background: #67baca; + border-radius: 104rpx 104rpx 104rpx 104rpx; + } + } + } + .trans { + margin-bottom: 32rpx; + padding: 32rpx; + width: 508rpx; + box-sizing: border-box; + background: linear-gradient(223deg, #59b0c2 0%, #94e2f1 100%); + box-shadow: 0rpx 4rpx 24rpx 0rpx rgba(0, 0, 0, 0.07); + border-radius: 24rpx 24rpx 24rpx 24rpx; + .user { + padding: 24rpx 32rpx; + display: flex; + gap: 24rpx; + border-radius: 24rpx; + background-color: #fff; + .u-avatar { + width: 112rpx; + height: 112rpx; + flex-shrink: 0; + border-radius: 50%; + } + .wrap { + .name { + font-size: 40rpx; + color: #283031; + } + .content { + margin-top: 12rpx; + font-size: 28rpx; + color: #9aa1a2; + line-height: 36rpx; + } + } + } + .tip { + margin-top: 24rpx; + font-size: 32rpx; + color: #ffffff; + } + } + } + } + .place { + height: 200rpx; + } + } + } + .page-footer { + padding: 32rpx 30rpx calc(32rpx + env(safe-area-inset-bottom)); + box-sizing: border-box; + display: flex; + gap: 28rpx; + border-radius: 32rpx 32rpx 0 0; + box-shadow: 0rpx 8rpx 16rpx 0rpx rgba(40, 48, 49, 0.04); + border: 2rpx solid #ffffff; + background-color: #fff; + .send { + flex: 1; + display: flex; + align-items: center; + justify-content: center; + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + height: 76rpx; + background: #ffffff; + box-shadow: 0rpx 8rpx 16rpx 0rpx rgba(40, 48, 49, 0.04); + border-radius: 140rpx 140rpx 140rpx 140rpx; + border: 2rpx solid #f2f4f5; + .icon { + width: 36rpx; + height: 36rpx; + } + } + .send-date { + flex-shrink: 0; + font-size: 24rpx; + color: #283031; + text-align: center; + .icon { + width: 40rpx; + height: 40rpx; + } + } + } +} + +.popup-message { + padding: 30rpx; + background-color: rgba(242, 244, 245, 1); + .title { + padding: 0 32rpx 32rpx; + font-size: 36rpx; + color: rgba(40, 48, 49, 1); + font-weight: bold; + text-align: center; + } + .list { + max-height: 50vh; + overflow-y: auto; + overflow-x: hidden; + .l-item { + margin-bottom: 24rpx; + padding: 30rpx; + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + border-radius: 24rpx; + background-color: #fff; + &.active { + color: #fff; + background-color: rgba(103, 186, 202, 1); + } + } + } + .submit { + margin-top: 24rpx; + width: 690rpx; + height: 84rpx; + font-size: 36rpx; + color: rgba(255, 255, 255, 1); + font-weight: bold; + background: #67baca; + display: flex; + align-items: center; + justify-content: center; + border-radius: 64rpx 64rpx 64rpx 64rpx; + } +} diff --git a/src/doctor/pages/d_interactiveDoctor/index.ts b/src/doctor/pages/d_interactiveDoctor/index.ts new file mode 100644 index 0000000..5431005 --- /dev/null +++ b/src/doctor/pages/d_interactiveDoctor/index.ts @@ -0,0 +1,446 @@ +import dayjs from 'dayjs' + +const app = getApp() + +interface IMessageItem { + msgId: string + msgContentType: '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' // 1:文本 2: 出诊时间 3: adl卡片 4: 语音 5: 欢迎语 6:补充真实姓名 7: 提醒完善信息 8: 复诊卡片 9:患者恢复复诊消息 + msgContent: any + msgVisitTime: string + msgVisitTimeType?: string + msgFromType: '1' | '2' // 1: 患者 2: 医生 + isPlay?: boolean + msgCreateTime: string // 消息创建时间 + msgCreateTimeName?: string // 消息创建时间 + showTime?: boolean +} + +interface Item { + wordId: string + word: string +} + +Page({ + data: { + doctor: {} as any, + + patientId: '', + messageListShow: false, + patientDetail: {}, + + isLoad: false, + isFinish: false, + scrollTop: 0, + scrollIntoView: '', + messageList: [] as IMessageItem[], + nextMsgId: '', + + wordIndex: 0, + wordList: [] as Item[], + + week: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'], + timeDay: { 1: '上午', 2: '下午' }, + }, + + innerAudioContext: null as WechatMiniprogram.InnerAudioContext | null, + + onLoad(options) { + this.innerAudioContext = wx.createInnerAudioContext({ + useWebAudioImplement: true, + }) + this.setData({ + patientId: options.patientId, + }) + }, + onShow() { + app.waitLogin().then((_res) => { + app.mpBehavior({ doctor: true, PageName: 'PG_DOCTORINTERACTIONDETAIL' }) + this.getDoctorDetail() + this.getPatientDetail() + this.getMessageList() + this.getWordList() + }) + }, + onUnload() { + if (this.innerAudioContext) { + this.innerAudioContext.stop() + } + }, + getDoctorDetail() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/account/info', + data: {}, + }).then((res) => { + this.setData({ + doctor: res.doctor, + }) + }) + }, + getPatientDetail() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/message-interact/get-patient-info', + data: { + patientId: this.data.patientId, + }, + }).then((res) => { + if (res.LastAdlTime) { + res.LastAdlTimeName = dayjs(res.LastAdlTime).from(dayjs().format('YYYY-MM-DD')).replace(' ', '') + } + this.setData({ + patientDetail: res, + }) + }) + }, + getMessageList() { + if (this.data.isLoad || this.data.isFinish) return + this.setData({ + isLoad: true, + }) + const nextMsgId = this.data.nextMsgId + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/message-interact/doctor-get-message-list', + data: { + nextMsgId, + patientId: this.data.patientId, + }, + }).then((res) => { + res.messageList.map((item) => { + if (item.msgContentType === '4') { + item.msgContent = JSON.parse(item.msgContent) + } + if (item.msgContentType === '2') { + item.msgVisitTime = item.msgVisitTimeType == 2 ? item.msgVisitTime : JSON.parse(item.msgVisitTime) + } + if (item.msgContentType === '5') { + item.welcomeMsg = JSON.parse(item.welcomeMsg) + } + if (item.msgContentType === '9') { + item.ReVisitInfo = JSON.parse(item.ReVisitInfo) + item.ReVisitInfo.visitDateName = dayjs(item.ReVisitInfo.visitDate).format('YYYY年M月DD日') + } + if (item.msgContentType === '10') { + item.msgContentInfo = JSON.parse(item.msgContentInfo) + } + + return item + }) + if (!this.data.nextMsgId && !res.messageList.length) { + res.messageList = [ + { + msgId: '0', + msgContentType: '0', + msgContent: '', + msgVisitTime: '', + msgFromType: '2', + }, + ] + } + this.setData({ + messageList: [...res.messageList.reverse(), ...this.data.messageList], + nextMsgId: res.nextMsgId, + unReadCount: res.unReadCount, + firstNotReadMsgId: res.firstNotReadMsgId, + isVisitAdl: res.isVisitAdl, + adlMsgId: res.adlMsgId, + isLoad: false, + isFinish: nextMsgId === res.nextMsgId, + }) + this.filterCreateTime() + if (!nextMsgId) { + this.handleView() + } + }) + }, + scrolltoupper(e) { + if (e.detail.direction === 'top') { + this.getMessageList() + } + }, + getWordList() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/message-interact/get-common-word-list', + data: {}, + }).then((res) => { + this.setData({ + wordList: res, + }) + }) + }, + handleSendDate() { + app.mpBehavior({ doctor: true, PageName: 'BTN_DOCTORINTERACTIONDETAILMYCLINICTIME' }) + const { + messageList, + doctor: { Clinic }, + } = this.data + if (!Clinic || (Array.isArray(Clinic) && !Clinic.length)) { + wx.showModal({ + title: '完善出诊时间?', + content: '您还没有录入出诊时间', + confirmText: '录入', + confirmColor: '#62bed0', + success: (res) => { + if (res.confirm) { + wx.navigateTo({ + url: '/doctor/pages/d_userInfo/index', + }) + } + }, + }) + return + } + wx.showModal({ + title: '提示', + content: '将您的出诊时间发送给患者?', + confirmColor: '#62bed0', + success: (res) => { + if (res.confirm) { + this.setData({ + messageList: [ + ...messageList, + { + msgId: '', + msgContentType: '2', + msgContent: '', + msgVisitTime: this.data.doctor.Clinic, + msgVisitTimeType: this.data.doctor.ClinicType, + msgFromType: '2', + msgCreateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'), + }, + ], + }) + this.filterCreateTime() + wx.ajax({ + method: 'POST', + url: '?r=igg4/doctor/message-interact/send-visit-time', + data: { + patientId: this.data.patientId, + }, + }) + this.handleView() + } + }, + }) + }, + handleSendShow() { + app.mpBehavior({ doctor: true, PageName: 'BTN_DOCTORINTERACTIONDETAILSENDMESSAGE' }) + this.setData({ + messageListShow: true, + }) + }, + handlePopupMessageClose() { + this.setData({ + messageListShow: false, + }) + }, + handleWord(e) { + const { index } = e.currentTarget.dataset + this.setData({ + wordIndex: index, + }) + }, + handleSendWord() { + const { messageList, wordList, wordIndex } = this.data + const { wordId, word } = wordList[wordIndex] + this.setData({ + messageList: [ + ...messageList, + { + msgId: '', + msgContentType: '1', + msgContent: word, + msgVisitTime: '', + msgFromType: '2', + msgCreateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'), + }, + ], + }) + this.filterCreateTime() + this.handlePopupMessageClose() + this.handleView() + wx.ajax({ + method: 'POST', + url: '?r=igg4/doctor/message-interact/send-word-message', + data: { + patientId: this.data.patientId, + wordId, + }, + }) + }, + handleSendUserConform(e) { + const { id } = e.currentTarget.dataset + const title = { + 6: '发送后患者将收到补充姓名通知', + 7: '发送后患者将收到完善信息通知', + }[id] + wx.showModal({ + title, + confirmColor: '#62bed0', + success: (res) => { + if (res.confirm) { + this.handleSendUser(id) + } + }, + }) + }, + handleSendUser(id) { + const { messageList } = this.data + const content = { + 6: '请完善您的真实姓名,以便我清楚了解您的病情', + 7: '请完善您的个人信息,以便我清楚了解您的病情', + }[id] + this.setData({ + messageList: [ + ...messageList, + { + msgId: '', + msgContentType: id, + msgContent: content, + msgVisitTime: '', + msgFromType: '2', + msgCreateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'), + }, + ], + }) + this.filterCreateTime() + this.handlePopupMessageClose() + this.handleView() + const url = { + 6: '?r=igg4/doctor/message-interact/send-remind-name', + 7: '?r=igg4/doctor/message-interact/send-remind-init', + }[id] + wx.ajax({ + method: 'POST', + url, + data: { + patientId: this.data.patientId, + }, + }) + }, + + formatTime(date: string) { + let msgCreateTimeName = '' + if (dayjs().format('YYYY-MM-DD') === dayjs(date).format('YYYY-MM-DD')) { + msgCreateTimeName = dayjs(date).format('HH:mm') + } else if (dayjs().format('YYYY-MM-DD') === dayjs(date).add(1, 'day').format('YYYY-MM-DD')) { + msgCreateTimeName = `昨天 ${dayjs(date).format('HH:mm')}` + } else if (dayjs().diff(date, 'day') < 7) { + msgCreateTimeName = dayjs(date).format(`dddd HH:mm`) + } else { + msgCreateTimeName = dayjs(date).format('YYYY-MM-DD HH:mm') + } + return msgCreateTimeName + }, + filterCreateTime() { + const gapTime = 5 * 60 * 1000 + const { messageList } = this.data + + let preTime = 0 + messageList.forEach((item, index) => { + if (index === 0) { + item.showTime = true + preTime = dayjs(item.msgCreateTime).valueOf() + item.msgCreateTimeName = this.formatTime(item.msgCreateTime) + } else { + const curTime = dayjs(item.msgCreateTime).valueOf() + if (curTime - preTime > gapTime) { + item.showTime = true + item.msgCreateTimeName = this.formatTime(item.msgCreateTime) + preTime = dayjs(item.msgCreateTime).valueOf() + } + } + }) + this.setData({ + messageList, + }) + }, + handleView(index = -1) { + this.setData({ + scrollIntoView: index > -1 ? `view${index}` : `place`, + }) + }, + handlePatientDetail() { + app.mpBehavior({ doctor: true, PageName: 'BTN_DOCTORINTERACTIONDETAILPATIENTFILE' }) + wx.navigateTo({ + url: `/doctor/pages/d_patientDetail/index?id=${this.data.patientId}`, + }) + }, + handleAudio(e) { + const { index } = e.currentTarget.dataset + const { messageList } = this.data + const messageItem = messageList[index] + const { url } = messageItem.msgContent[0] + if (this.innerAudioContext) { + if (messageItem.isPlay) { + this.innerAudioContext.stop() + messageItem.isPlay = false + this.setData({ + messageList, + }) + return + } + this.innerAudioContext.stop() + this.innerAudioContext.src = url + this.innerAudioContext.play() + messageItem.isPlay = true + this.innerAudioContext.onEnded(() => { + messageItem.isPlay = false + this.setData({ + messageList, + }) + }) + this.innerAudioContext.onStop(() => { + messageItem.isPlay = false + this.setData({ + messageList, + }) + }) + this.setData({ + messageList, + }) + } + }, + handleAdl() { + wx.showToast({ + title: '患者点击此按钮可进入ADL测评页面', + icon: 'none', + }) + }, + handleReferral() { + wx.showModal({ + title: '', + content: '您将给患者发送复诊时间填写卡片?', + confirmText: '发送', + confirmColor: '#62bed0', + success: (res) => { + if (res.confirm) { + wx.ajax({ + method: 'POST', + url: '?r=igg4/doctor/message-interact/send-re-visit', + data: { + patientId: this.data.patientId, + }, + }).then(() => { + this.setData({ + messageList: [ + ...this.data.messageList, + { + msgId: '', + msgContentType: '8', + msgVisitTime: '', + msgContent: '', + msgFromType: '2', + msgCreateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'), + }, + ], + }) + this.handleView() + }) + } + }, + }) + }, +}) diff --git a/src/doctor/pages/d_interactiveDoctor/index.wxml b/src/doctor/pages/d_interactiveDoctor/index.wxml new file mode 100644 index 0000000..b1dc9e4 --- /dev/null +++ b/src/doctor/pages/d_interactiveDoctor/index.wxml @@ -0,0 +1,309 @@ + + + + + + + + {{patientDetail.patientName}} + + 提醒补充真实姓名 + + + + 患者档案 + + + + + + {{tag}} + + + + + + + 最近一次测评:{{patientDetail.LastAdlTimeName}} + + + + + 最新ADL评分 + {{patientDetail.AdlScore}} + + + + 已达标 + + + + + {{patientDetail.TotalScoreChange}} + + + + + + 接近达标 + + + + + {{patientDetail.TotalScoreChange}} + + + + + + 待达标 + + + + + {{patientDetail.TotalScoreChange}} + + + + + 最新激素用量 + {{patientDetail.SteroidDailyDose}}mg + + + + 已达标 + + + + + {{patientDetail.SteroidDailyDoseChange}}mg + + + + + + 待达标 + + + + + {{patientDetail.SteroidDailyDoseChange}}mg + + + + + + + + + + + {{message.msgCreateTimeName}} + + + + + + {{message.msgContent}} + + 我最近一次复诊时间是{{message.ReVisitInfo.visitDateName}} + 我的方案是 + + 1.激素 + + 2.传统免疫抑制剂(如他克莫司、吗 替麦考酚酯等) + + 3.静脉输注丙种球蛋白 + 4.血浆置换 + + 5.B细胞抑制剂(如:利妥昔单抗、泰 它西普、伊奈利珠单抗) + + 6.FcRn拮抗剂(如:艾加莫德) + + 7.C5补体抑制剂(如:依库珠单抗) + + 8.中药或中成药 + 9.其他 + + + + + + + + {{message.welcomeMsg.title}} + {{message.welcomeMsg.questionDes}} + + + {{index+1}} + {{item.question}} + + + + {{message.welcomeMsg.guideClick}} + + + + {{message.msgContent}} + + 以下是我的出诊时间 + + {{message.msgVisitTime}} + + + {{week[item.weekday-1]}} + {{timeDay[item.timeType]}} + + + + + + + ADL+激素双达标 + 点击进入ADL + 建议您定期做ADL测评 + + + {{message.msgContent[0].duration}}'' + + + + + {{message.msgContent}} + 提交您的真实姓名 + + + {{message.msgContent}} + 完善个人信息 + + + + 您最近有按照医生的 提醒,定期复诊吗? + + + + 已复诊 + + + + + + + {{message.msgContentInfo.doctorName}} + {{message.msgContentInfo.hospitalName}} + + + 推荐好医生给你,建议2周内复诊 + + + + + + + + + + + + 发送消息 + + + 完善个人信息 + + + + 我的出诊时间 + + + + 复诊提醒 + + + + + + + 发送消息 + + + {{item.word}} + + + 发送 + + diff --git a/src/doctor/pages/d_invite/index.json b/src/doctor/pages/d_invite/index.json new file mode 100644 index 0000000..377ffcf --- /dev/null +++ b/src/doctor/pages/d_invite/index.json @@ -0,0 +1,7 @@ +{ + "navigationBarTitleText": "重症肌无力医生端", + "usingComponents": { + "navBar": "/components/navBar/navBar", + "customPoster": "/components/customPoster/index" + } +} diff --git a/src/doctor/pages/d_invite/index.scss b/src/doctor/pages/d_invite/index.scss new file mode 100644 index 0000000..446a9ba --- /dev/null +++ b/src/doctor/pages/d_invite/index.scss @@ -0,0 +1,29 @@ +page{ + background-color: #c65174; +} +.page { + position: relative; + height: 1448rpx; + .poster { + width: 100%; + height: 100%; + } + .btn { + position: absolute; + bottom: 88rpx; + left: 50%; + transform: translateX(-50%); + margin: 36rpx auto; + padding: 18rpx 44rpx; + font-size: 36rpx; + line-height: 48rpx; + font-weight: bold; + display: flex; + align-items: center; + justify-content: center; + color: rgba(255, 255, 255, 1); + border-radius: 64rpx 64rpx 64rpx 64rpx; + border: 1px solid rgba(255, 255, 255, 1); + box-sizing: border-box; + } +} diff --git a/src/doctor/pages/d_invite/index.ts b/src/doctor/pages/d_invite/index.ts new file mode 100644 index 0000000..7f027a6 --- /dev/null +++ b/src/doctor/pages/d_invite/index.ts @@ -0,0 +1,114 @@ +const app = getApp() + +Page({ + data: { + doctor: {}, + hospital: {}, + qrCode: '', + + posterUrl: '', + params: {}, + }, + onLoad() { + const SystemInfo = app.globalSystemInfo + if (SystemInfo) { + const { bottom } = SystemInfo.capsulePosition + this.setData({ + bottom, + }) + } + app.waitLogin().then((_res) => { + wx.showLoading({ + title: '加载中', + }) + app.mpBehavior({ doctor: true, PageName: 'PG_DOCTORINVITEPATIENT' }) + this.getDetail() + }) + }, + getDetail() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/account/info', + data: {}, + }).then((res) => { + this.setData({ + doctor: res.doctor, + hospital: res.hospital, + }) + this.getPrepare(res.doctor.Id) + }) + }, + getPrepare(id) { + wx.ajax({ + method: 'POST', + url: '?r=poster/prepare', + data: { + posterId: 'doctor_mini', + doctorId: id, + }, + }).then((res) => { + this.setData({ + params: res, + }) + }) + }, + getQrCode() { + this.setData({ + qrCode: `${app.globalData.url}?r=igg4/doctor/account/mp-info&loginState=${app.globalData.loginState}`, + }) + }, + handleDownload() { + wx.showToast({ + title: '请长按海报图片进行保存', + icon: 'none', + }) + // wx.showLoading({ + // title: '加载中', + // }) + // wx.downloadFile({ + // url: this.data.posterUrl, + // success: (res) => { + // if (res.statusCode === 200) { + // wx.saveImageToPhotosAlbum({ + // filePath: res.tempFilePath, + // success: () => { + // wx.hideLoading() + // wx.showToast({ + // title: '保存成功,请到相册中查看', + // }) + // }, + // fail: () => { + // wx.hideLoading() + // wx.showToast({ + // icon: 'none', + // title: '保存失败,请稍后重试', + // }) + // }, + // }) + // } else { + // wx.hideLoading() + // wx.showToast({ + // icon: 'none', + // title: '下载失败,请稍后重试', + // }) + // } + // }, + // fail: () => { + // wx.hideLoading() + // wx.showToast({ + // icon: 'none', + // title: '下载失败,请稍后重试', + // }) + // }, + // }) + }, + handlePosterFinish(e: any) { + this.setData({ + posterUrl: e.detail, + }) + wx.hideLoading() + }, + handleBack() { + wx.navigateBack() + }, +}) diff --git a/src/doctor/pages/d_invite/index.wxml b/src/doctor/pages/d_invite/index.wxml new file mode 100644 index 0000000..1fd0ca2 --- /dev/null +++ b/src/doctor/pages/d_invite/index.wxml @@ -0,0 +1,6 @@ + + + 长按图片保存 + + + diff --git a/src/doctor/pages/d_login/index.json b/src/doctor/pages/d_login/index.json new file mode 100644 index 0000000..03743bf --- /dev/null +++ b/src/doctor/pages/d_login/index.json @@ -0,0 +1,9 @@ +{ + "navigationBarTitleText": "登录", + "navigationStyle": "custom", + "usingComponents": { + "van-divider": "@vant/weapp/divider/index", + "van-icon": "@vant/weapp/icon/index", + "navBar": "/components/navBar/navBar" + } +} diff --git a/src/doctor/pages/d_login/index.scss b/src/doctor/pages/d_login/index.scss new file mode 100644 index 0000000..3948d3d --- /dev/null +++ b/src/doctor/pages/d_login/index.scss @@ -0,0 +1,122 @@ +.page { + min-height: 100vh; + padding: 460rpx 0 80rpx 0; + box-sizing: border-box; + .container { + padding: 0 50rpx; + .c-title { + font-size: 36rpx; + color: rgba(32, 33, 33, 1); + font-weight: bold; + } + .content { + margin-top: 30rpx; + font-size: 32rpx; + color: rgba(32, 33, 33, 1); + line-height: 56rpx; + .link { + color: rgba(67, 168, 188, 1); + } + } + } + .phone { + margin: 44rpx 48rpx 0; + padding: 24rpx 20rpx; + border-radius: 64rpx; + background: rgba(103, 186, 202, 1); + font-size: 32rpx; + color: rgba(255, 255, 255, 1); + line-height: 1; + &::after { + border: none; + outline: none; + } + } + .tel-code { + margin: 16rpx auto 0; + width: 278rpx; + height: 52rpx; + background: #f7f7fa; + border-radius: 24rpx 24rpx 24rpx 24rpx; + display: flex; + align-items: center; + justify-content: center; + font-size: 28rpx; + color: rgba(161, 164, 172, 1); + .icon { + width: 40rpx; + height: 40rpx; + } + } + .form { + margin-top: 58rpx; + padding: 0 60rpx; + .row { + margin-bottom: 32rpx; + display: flex; + justify-content: space-between; + border-radius: 64rpx; + background: rgba(247, 247, 247, 1); + border: 1rpx solid rgba(237, 239, 240, 1); + .input { + flex: 1; + padding: 20rpx 32rpx; + height: 40rpx; + font-size: 32rpx; + color: #000; + } + .input-placeholade { + color: rgba(194, 201, 202, 1); + } + .code { + margin-left: 24rpx; + flex-shrink: 0; + width: 262rpx; + border-radius: 24rpx; + font-size: 32rpx; + color: rgba(103, 186, 202, 1); + display: flex; + align-items: center; + justify-content: center; + } + } + .submit { + margin-top: 32px; + padding: 24rpx 20rpx; + background: rgba(103, 186, 202, 1); + border-radius: 64rpx; + font-size: 32rpx; + color: #ffffff; + text-align: center; + line-height: 1; + } + } + .divider { + margin: 36rpx auto 0; + width: 338rpx; + } + .check { + margin: 50rpx 50rpx 0; + display: flex; + line-height: 60rpx; + color: rgba(32, 33, 33, 1); + .icon { + margin-top: 12rpx; + margin-right: 10rpx; + flex-shrink: 0; + width: 32rpx; + height: 32rpx; + } + .link { + color: rgba(67, 168, 188, 1); + } + } + .partient { + margin-top: 58rpx; + font-size: 32rpx; + color: rgba(161, 164, 172, 1); + display: flex; + align-items: center; + justify-content: center; + } +} diff --git a/src/doctor/pages/d_login/index.ts b/src/doctor/pages/d_login/index.ts new file mode 100644 index 0000000..a2e435c --- /dev/null +++ b/src/doctor/pages/d_login/index.ts @@ -0,0 +1,153 @@ +const app = getApp() +let timer = null as null | number + +Page({ + data: { + mobile: '', + code: '', + codeText: '发送验证码', + back: false, + showForm: false, + check: false, + }, + onLoad(option) { + if (option.back) { + this.setData({ + back: true, + }) + } + app.mpBehavior({ PageName: 'PG_DOCTORLOGIN' }) + }, + getCode() { + if (timer) return + const mobile = this.data.mobile + if (!mobile) { + wx.showToast({ + title: '手机号不能为空', + icon: 'none', + }) + return + } + // 验证手机号 + if (!/^1[3-9,]\d{9}$/.test(mobile)) { + wx.showToast({ + title: '手机号格式不正确', + icon: 'none', + }) + return + } + wx.ajax({ + method: 'POST', + url: '?r=igg4/login/send-verify-code', + data: { + mobile, + }, + }).then((_res) => { + wx.showToast({ + icon: 'none', + title: '验证码已发送~', + }) + let time = 60 + timer = setInterval(() => { + time-- + this.setData({ + codeText: `${time}s后重新发送`, + }) + if (time <= 0) { + clearInterval(timer as number) + timer = null + this.setData({ + codeText: '发送验证码', + }) + } + }, 1000) + }) + }, + handleSubmit() { + app.mpBehavior({ PageName: 'BTN_DOCTORLOGIN' }) + if (!this.data.mobile) { + wx.showToast({ + icon: 'none', + title: '请输入手机号', + }) + return + } + if (!this.data.code) { + wx.showToast({ + icon: 'none', + title: '请输入验证码', + }) + return + } + if (!this.data.check) { + wx.showToast({ + icon: 'none', + title: '请同意用户协议', + }) + return + } + wx.ajax({ + method: 'POST', + url: '?r=igg4/doctor/login/reg-login', + data: { + mobile: this.data.mobile, + code: this.data.code, + }, + }).then((_res) => { + this.submitCallback() + }) + }, + handleWxSubmit(e: WechatMiniprogram.CustomEvent) { + app.mpBehavior({ PageName: 'BTN_DOCTORQUICKPATIENTLOGIN' }) + if (!this.data.check) { + wx.showToast({ + icon: 'none', + title: '请同意用户协议', + }) + return + } + const { iv, encryptedData } = e.detail + if (iv && encryptedData) { + wx.ajax({ + method: 'POST', + url: '?r=igg4/doctor/login/wx-reg-login', + data: { + iv: encodeURIComponent(iv), + encryptedData: encodeURIComponent(encryptedData), + }, + }).then((_res) => { + this.submitCallback() + }) + } + }, + submitCallback() { + app.globalData.loginType = 2 + app.globalData.isLogin = true + wx.reLaunch({ + url: '/doctor/pages/d_home/index', + }) + }, + handlePatient() { + wx.redirectTo({ + url: '/pages/login/index', + }) + }, + handleTelCode() { + this.setData({ + showForm: !this.data.showForm, + }) + }, + handleLink() { + wx.navigateTo({ + url: '/doc/pages/doc1/index', + }) + }, + handleCheck() { + this.setData({ + check: !this.data.check, + }) + }, + handleBack() { + wx.navigateBack() + }, +}) diff --git a/src/doctor/pages/d_login/index.wxml b/src/doctor/pages/d_login/index.wxml new file mode 100644 index 0000000..dfad4d5 --- /dev/null +++ b/src/doctor/pages/d_login/index.wxml @@ -0,0 +1,60 @@ + + + + 尊敬的医生您好 + gMG 给力加油站是中国罕见病联盟/北京罕见病诊疗与保障学会发起的gMG患者健康全程管理平台; + + 在您加入gMG 给力加油站平台之前,请您阅读并充分理解 + 《隐私协议保护政策》 + ,了解您的权益及相关数据处理方法,我们将严格按照法律法规及 + 《隐私协议保护政策》 + 的相关规定,保证您的个人信息不受侵犯。 + + + + + + 或者 + + + + 手机号验证码 + + + + + + + + {{codeText}} + + 立即加入 + + + + + + 我特此同意依照此 + 《隐私协议保护政策》 + 规定收集我的个人敏感信息 + + + + 我是患者 + + + diff --git a/src/doctor/pages/d_my/index.json b/src/doctor/pages/d_my/index.json new file mode 100644 index 0000000..02e5c98 --- /dev/null +++ b/src/doctor/pages/d_my/index.json @@ -0,0 +1,9 @@ +{ + "navigationStyle": "custom", + "usingComponents": { + "van-icon": "@vant/weapp/icon/index", + "navBar": "/components/navBar/navBar", + "tabbar": "../../components/tabbar/index", + "text-expandsion": "/components/text-expandsion/index" + } +} diff --git a/src/doctor/pages/d_my/index.scss b/src/doctor/pages/d_my/index.scss new file mode 100644 index 0000000..900e51e --- /dev/null +++ b/src/doctor/pages/d_my/index.scss @@ -0,0 +1,140 @@ +page { + background: #f2f4f5; + padding-bottom: calc(140rpx + env(safe-area-inset-bottom)); +} +.page { + min-height: 100vh; + .container { + margin: 160rpx 30rpx 0; + padding: 0 30rpx 40rpx; + background: #fff linear-gradient(to top, #ffffff 0%, #e8f0f1 100%) no-repeat top center/100% 200rpx; + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2rpx solid #ffffff; + .avatar { + margin-top: -50rpx; + width: 128rpx; + height: 128rpx; + .avatar-user { + width: 100%; + height: 100%; + border-radius: 50%; + } + } + .name { + margin: -55rpx 0 0 150rpx; + font-size: 40rpx; + color: rgba(40, 48, 49, 1); + font-weight: bold; + line-height: 1; + } + .card { + margin-top: 52rpx; + padding: 32rpx; + background: #ffffff; + box-shadow: 0rpx 8rpx 32rpx 0rpx rgba(40, 48, 49, 0.04); + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2rpx solid #f8f9f9; + .content { + display: flex; + align-items: start; + gap: 8rpx; + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + line-height: 1; + .tag { + flex-shrink: 0; + padding: 4rpx 12rpx; + font-size: 22rpx; + color: rgba(229, 154, 41, 1); + border-radius: 8rpx; + background-color: rgba(229, 154, 41, 0.29); + } + } + .c-row { + margin-top: 32rpx; + display: flex; + align-items: center; + gap: 12rpx; + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + line-height: 1; + .icon { + flex-shrink: 0; + width: 32rpx; + height: 32rpx; + } + } + } + .row { + margin-top: 32rpx; + .r-title { + width: 128rpx; + height: 32rpx; + } + .r-content { + margin-top: 16rpx; + font-size: 28rpx; + color: rgba(154, 161, 163, 1); + white-space: pre-line; + } + } + } + .invite { + padding: 22rpx 30rpx 36rpx 168rpx; + margin: 24rpx 30rpx 0; + display: flex; + align-items: center; + justify-content: space-between; + border-radius: 24rpx; + border: 2rpx solid #ffffff; + .wrap { + .title { + font-size: 36rpx; + color: rgba(40, 48, 49, 1); + } + .content { + font-size: 28rpx; + color: rgba(154, 161, 163, 1); + } + } + .btn { + width: 198rpx; + height: 64rpx; + display: flex; + align-items: center; + justify-content: center; + font-size: 32rpx; + color: rgba(255, 255, 255, 1); + background: #62bed0; + border-radius: 136rpx 136rpx 136rpx 136rpx; + } + } + .list { + margin: 24rpx 30rpx 0; + .list-item { + padding: 30rpx; + display: flex; + justify-content: space-between; + align-items: center; + background: #ffffff; + border-radius: 24rpx 24rpx 24rpx 24rpx; + .left { + display: flex; + gap: 20rpx; + align-items: center; + .icon { + width: 48rpx; + height: 48rpx; + } + .name { + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + } + } + .more { + color: #d4d9da; + font-size: 32rpx; + } + } + } +} diff --git a/src/doctor/pages/d_my/index.ts b/src/doctor/pages/d_my/index.ts new file mode 100644 index 0000000..6063a7d --- /dev/null +++ b/src/doctor/pages/d_my/index.ts @@ -0,0 +1,69 @@ +const app = getApp() + +Page({ + data: { + doctor: {}, + hospital: {}, + }, + onLoad() { + const SystemInfo = app.globalSystemInfo + if (SystemInfo) { + const { top, bottom } = SystemInfo.capsulePosition + this.setData({ + top, + bottom, + }) + } + }, + onShow() { + app.waitLogin().then((_res) => { + app.mpBehavior({ doctor: true, PageName: 'PG_DOCTORMY' }) + this.getDetail() + }) + }, + getDetail() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/account/info', + data: {}, + }).then((res) => { + let weekName = '' + if (res.doctor.ClinicType == 2) { + weekName = res.doctor.Clinic + } else { + weekName = (res.doctor.Clinic ? res.doctor.Clinic : []) + .map((subItem: { weekday: string | number; timeType: string | number }) => { + const week = ['周一', '周二', '周三', '周四', '周五', '周六', '周日'] + const timeDay = { 1: '上午', 2: '下午' } + return `${week[Number(subItem.weekday) - 1]}${timeDay[subItem.timeType]}` + }) + .join(',') + } + this.setData({ + doctor: { + weekName, + ...res.doctor, + }, + hospital: res.hospital, + }) + }) + }, + handleRouter(e) { + const { url } = e.currentTarget.dataset + if (url === '/doctor/pages/d_invite/index') { + app.mpBehavior({ doctor: true, PageName: 'BTN_DOCTORMYPAGEINVITEDPATIENTS' }) + } + if (url === '/doctor/pages/d_userInfo/index') { + app.mpBehavior({ doctor: true, PageName: 'BTN_DOCTORMYPAGEPERSONALINFO' }) + } + wx.navigateTo({ + url, + }) + }, + onShareAppMessage() { + return { + title: '重症肌无力加油站,重拾生活掌控感!', + path: '/doctor/pages/d_my/index', + } + }, +}) diff --git a/src/doctor/pages/d_my/index.wxml b/src/doctor/pages/d_my/index.wxml new file mode 100644 index 0000000..567cf22 --- /dev/null +++ b/src/doctor/pages/d_my/index.wxml @@ -0,0 +1,66 @@ + + + + + + + {{doctor.Name}} + + + {{hospital.Name}} + {{hospital.HospitalClassificationName}}{{hospital.HospitalLevelName}} + + + + {{hospital.ProvinceName}}{{hospital.CityName}}{{hospital.CountyName}}{{hospital.Address}} + + + + {{hospital.Telephone}} + + + + + + + + + + + {{doctor.weekName}} + + + + + 出示邀约码 + 邀请患者加入你吧 + + 邀请患者 + + + + + + 个人信息 + + + + + + + diff --git a/src/doctor/pages/d_patient/index.json b/src/doctor/pages/d_patient/index.json new file mode 100644 index 0000000..15fca3b --- /dev/null +++ b/src/doctor/pages/d_patient/index.json @@ -0,0 +1,9 @@ +{ + "navigationStyle": "custom", + "usingComponents": { + "tabbar": "../../components/tabbar/index", + "navBar": "/components/navBar/navBar", + "van-icon": "@vant/weapp/icon/index", + "van-popup": "@vant/weapp/popup/index" + } +} diff --git a/src/doctor/pages/d_patient/index.scss b/src/doctor/pages/d_patient/index.scss new file mode 100644 index 0000000..5862fe8 --- /dev/null +++ b/src/doctor/pages/d_patient/index.scss @@ -0,0 +1,369 @@ +page { + background-color: rgba(242, 244, 245, 1); + padding-bottom: calc(140rpx + env(safe-area-inset-bottom)); +} + +.page { + min-height: 100vh; + + .page-header { + position: sticky; + top: 0; + padding: 30rpx; + box-shadow: 0rpx 8rpx 16rpx 0rpx rgba(40, 48, 49, 0.04); + border-radius: 0 0 32rpx 32rpx; + z-index: 10; + + .search { + padding: 18rpx 32rpx; + display: flex; + align-items: center; + gap: 16rpx; + background: linear-gradient(to top, #ffffff 0%, #ebf3f4 100%); + box-shadow: 0rpx 8rpx 8rpx 0rpx rgba(40, 48, 49, 0.04); + border-radius: 140rpx 140rpx 140rpx 140rpx; + border: 2rpx solid #ffffff; + + .icon { + width: 40rpx; + height: 40rpx; + } + + .input { + flex: 1; + font-size: 28rpx; + } + + .input-place { + color: rgba(173, 179, 180, 1); + } + } + .navbar { + margin-top: 32rpx; + display: flex; + justify-content: space-between; + align-items: center; + .nav { + position: relative; + flex: 1; + text-align: center; + font-size: 32rpx; + color: rgba(103, 113, 114, 1); + transition: all 0.3s; + .dot { + padding: 0 4rpx; + position: absolute; + left: 50%; + transform: translateX(35rpx); + top: 0; + min-width: 18rpx; + height: 26rpx; + font-size: 18rpx; + line-height: 26rpx; + color: rgba(255, 255, 255, 1); + border-radius: 50%; + background: rgba(215, 108, 108, 1); + } + &.active { + font-size: 32rpx; + color: rgba(98, 190, 208, 1); + font-weight: bold; + &::after { + position: absolute; + bottom: -30rpx; + left: 50%; + transform: translateX(-50%); + content: ''; + width: 52rpx; + height: 8rpx; + border-radius: 24rpx 24rpx 0 0; + background: #62bed0; + } + } + } + } + } + + .total-line { + padding: 34rpx 30rpx 0; + display: flex; + justify-content: space-between; + align-items: center; + + .wrap { + display: flex; + align-items: center; + gap: 20rpx; + + .user { + font-size: 32rpx; + color: rgba(154, 161, 162, 1); + + .num { + margin-left: 10rpx; + color: rgba(43, 160, 184, 1); + } + } + + .message { + font-size: 32rpx; + color: rgba(43, 160, 184, 1); + } + } + + .btn { + padding: 10rpx 32rpx; + font-size: 32rpx; + line-height: 1; + color: rgba(98, 190, 208, 1); + background: #ffffff; + border-radius: 80rpx 80rpx 80rpx 80rpx; + border: 2rpx solid #62bed0; + display: flex; + align-items: center; + + .icon { + width: 32rpx; + height: 32rpx; + } + } + } + + .list { + margin: 0 30rpx; + + .list-item { + margin-top: 24rpx; + padding: 36rpx 34rpx; + background: #ffffff; + border-radius: 24rpx 24rpx 24rpx 24rpx; + display: flex; + .avatar { + flex-shrink: 0; + .avatar-img { + width: 100rpx; + height: 100rpx; + border-radius: 50%; + } + } + .container { + flex: 1; + padding-left: 20rpx; + .title { + display: flex; + align-items: center; + justify-content: space-between; + .name { + font-size: 32rpx; + color: #283031; + font-weight: bold; + } + .send { + padding: 8rpx 22rpx; + font-size: 24rpx; + color: #67baca; + line-height: 1; + border-radius: 32rpx 32rpx 32rpx 32rpx; + border: 2rpx solid rgba(103, 186, 202, 0.26); + display: flex; + align-items: center; + gap: 8rpx; + .icon { + width: 28rpx; + height: 28rpx; + } + } + } + .tags { + margin-top: 16rpx; + display: flex; + flex-wrap: wrap; + gap: 12rpx; + .tag { + padding: 4rpx 16rpx; + font-size: 22rpx; + color: #e59a29; + line-height: 28rpx; + background: #fff5df; + border-radius: 8rpx 8rpx 8rpx 8rpx; + } + } + .content { + margin-top: 24rpx; + display: flex; + align-items: center; + flex-wrap: wrap; + font-size: 28rpx; + color: #283031; + gap: 14rpx; + .line { + flex-shrink: 0; + width: 2rpx; + height: 32rpx; + background-color: #eaeced; + } + .blod { + font-weight: bold; + } + &.disable { + color: #9aa1a2; + } + } + .replay-date { + margin-top: 16rpx; + font-size: 28rpx; + color: #9aa1a2; + } + } + } + } +} + +.popup { + padding: 92rpx 30rpx calc(30rpx + env(safe-area-inset-bottom)); + + .form { + max-height: 60vh; + overflow-y: auto; + overflow-x: hidden; + + .form-item { + margin-bottom: 48rpx; + + .f-title { + font-size: 36rpx; + color: rgba(40, 48, 49, 1); + font-weight: bold; + } + + .select { + margin-top: 24rpx; + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 16rpx; + + .s-item { + padding: 18rpx 0; + text-align: center; + border-radius: 12rpx; + font-size: 28rpx; + color: rgba(103, 113, 114, 1); + background: #f2f4f5; + + &.active { + color: #fff; + background-color: rgba(103, 186, 202, 1); + } + } + } + + .custom { + margin-top: 16rpx; + display: flex; + align-items: center; + gap: 12rpx; + + .c-item { + padding: 18rpx 24rpx; + display: flex; + align-items: center; + font-size: 32rpx; + color: rgba(103, 113, 114, 1); + border-radius: 12rpx; + background-color: rgba(242, 244, 245, 1); + + .input { + padding: 0; + margin: 0; + width: 3em; + font-size: 32rpx; + line-height: 1; + } + + .input-place { + color: rgba(194, 201, 202, 1); + line-height: 1; + } + } + } + + .date { + margin-top: 24rpx; + display: flex; + align-items: center; + justify-content: space-between; + + .picker { + flex: 1; + + .d-item { + flex: 1; + display: flex; + align-items: center; + justify-content: space-between; + padding: 18rpx 32rpx; + background: #f7f8f9; + border-radius: 12rpx 12rpx 12rpx 12rpx; + + .icon { + width: 32rpx; + height: 32rpx; + } + + .content { + font-size: 32rpx; + color: #677172; + + &:empty::after { + content: attr(data-place); + color: rgba(194, 201, 202, 1); + } + } + } + } + + .sion { + flex-shrink: 0; + margin: 0 14rpx; + font-size: 32rpx; + color: #677172; + } + } + } + } + + .p-footer { + margin-top: 32rpx; + display: flex; + justify-content: space-between; + align-items: center; + gap: 26rpx; + + .reset { + flex: 1; + height: 84rpx; + font-size: 36rpx; + color: rgba(103, 186, 202, 1); + display: flex; + justify-content: center; + align-items: center; + box-sizing: border-box; + background: #ffffff; + border-radius: 98rpx 98rpx 98rpx 98rpx; + border: 2rpx solid #67baca; + } + + .submit { + flex: 1; + height: 84rpx; + font-size: 36rpx; + color: #ffffff; + display: flex; + justify-content: center; + align-items: center; + box-sizing: border-box; + background: rgba(103, 186, 202, 1); + border-radius: 98rpx 98rpx 98rpx 98rpx; + } + } +} diff --git a/src/doctor/pages/d_patient/index.ts b/src/doctor/pages/d_patient/index.ts new file mode 100644 index 0000000..6690ca9 --- /dev/null +++ b/src/doctor/pages/d_patient/index.ts @@ -0,0 +1,211 @@ +import dayjs from 'dayjs' +import { filterColumns } from '@/utils/doctorPatientTask' + +const app = getApp() + +Page({ + data: { + active: 0, + + list: [] as any[], + total: 0, + pagination: { + page: 1, + pages: 1, + count: 1, + }, + + // form + Search: '', + HasAdl: 0, + DoubleStandard: 0, + AdlTime: 0, + AdlScore: [] as any, + AdlScoreChange: [], + AdlScoreChangeType: 0, + AdlScoreChangeMax: '', + AdlScoreChangeMin: '', + SteroidDailyDose: [] as any, + SteroidDailyDoseChange: [] as any, + IsThisWeekAdl: 0, + PharyngealSymptoms: 0, + AntibodyType: 0, + ThyroidAbnormal: 0, + PreviousConvulsion: 0, + TraditionalImmunosuppressant: 0, + MedicalInsuranceType: 0, + BindStartDate: '', + BindEndDate: '', + + HasAdlIndex: 0, + HasAdlName: '全部', + DoubleStandardIndex: 0, + DoubleStandardName: '全部', + AdlTimeIndex: 0, + AdlTimeName: '全部', + + ...filterColumns, + }, + onLoad(options) { + this.setData({ + BindStartDate: options.BindStartDate || '', + BindEndDate: options.BindEndDate || '', + HasAdl: Number(options.HasAdl || ''), + DoubleStandard: Number(options.DoubleStandard || ''), + AdlScore: options.AdlScore ? options.AdlScore.split('-').map(Number) : [], + SteroidDailyDose: options.SteroidDailyDose ? options.SteroidDailyDose.split('-').map(Number) : [], + IsThisWeekAdl: Number(options.IsThisWeekAdl || ''), + }) + app.waitLogin().then((_res) => { + app.mpBehavior({ doctor: true, PageName: 'PG_DOCTORPATIENTLIST' }) + this.getList() + }) + }, + handleReset() { + this.setData({ + Search: '', + HasAdl: 0, + HasAdlIndex: 0, + HasAdlName: '全部', + DoubleStandard: 0, + DoubleStandardIndex: 0, + DoubleStandardName: '全部', + AdlTime: 0, + AdlTimeName: '全部', + AdlScore: [], + AdlScoreChange: [], + AdlScoreChangeType: 0, + AdlScoreChangeMax: '', + AdlScoreChangeMin: '', + SteroidDailyDose: [], + SteroidDailyDoseChange: [], + IsThisWeekAdl: 0, + PharyngealSymptoms: 0, + AntibodyType: 0, + ThyroidAbnormal: 0, + PreviousConvulsion: 0, + TraditionalImmunosuppressant: 0, + MedicalInsuranceType: 0, + BindStartDate: '', + BindEndDate: '', + }) + this.getList() + }, + handleTapSearch() { + app.mpBehavior({ doctor: true, PageName: 'BTN_DOCTORPATIENTLISTSEARCH' }) + }, + handleNav(e) { + const { active } = e.currentTarget.dataset + this.setData({ + active, + }) + this.handleSearch() + }, + handleSearch() { + this.getList() + }, + getList(newPage = 1) { + const { active } = this.data + const params = { + search: this.data.Search, + } + const url = { + 0: '?r=igg4/doctor/patient/get-need-follow-list', + 1: '?r=igg4/doctor/patient/get-no-standard-list', + 2: '?r=igg4/doctor/patient/get-my-list', + }[active] as string + wx.ajax({ + method: 'GET', + url, + data: { + page: newPage, + ...params, + }, + }).then((res) => { + res.list.forEach((item) => { + if (item.LastAdlTime) { + item.LastAdlTimeName = dayjs(item.LastAdlTime).from(dayjs().format('YYYY-MM-DD')).replace(' ', '') + } + }) + const list = res.page === 1 ? res.list : [...this.data.list, ...res.list] + this.setData({ + total: res.count, + list, + pagination: { + page: res.page, + pages: res.pages, + count: res.count, + }, + }) + }) + }, + onReachBottom() { + const { page, pages } = this.data.pagination + if (pages > page) { + this.getList(page + 1) + } + }, + handlePickerChange(e: any) { + const { key } = e.currentTarget.dataset + const index = e.detail.value + const data = this.data[`${key}Column`] + + this.setData({ + [`${key}Index`]: index, + [`${key}Name`]: data[index].value, + [`${key}`]: data[index].id, + }) + this.handleSearch() + }, + handleRadio(e: any) { + const { key, index } = e.currentTarget.dataset + const data = this.data[`${key}Column`] + this.setData({ + [`${key}`]: data[index].id, + [`${key}Name`]: data[index].value, + [`${key}Index`]: index, + }) + }, + handleCheckbox(e: any) { + const { index, key } = e.currentTarget.dataset + const data = this.data[`${key}Column`] + const oldValue = this.data[`${key}`] + const value = oldValue.includes(data[index].id) + ? oldValue.filter((item: any) => item !== data[index].id) + : [...oldValue, data[index].id] + + this.setData({ + [`${key}`]: data[index].id ? value : [], + }) + }, + handleDetail(e: any) { + app.mpBehavior({ doctor: true, PageName: 'BTN_DOCTORPATIENTLISTVIEW' }) + const { index } = e.currentTarget.dataset + const item = this.data.list[index] + + wx.navigateTo({ + url: `/doctor/pages/d_patientDetail/index?id=${item.PatientId}`, + }) + }, + handleSend(e) { + const { index } = e.currentTarget.dataset + wx.navigateTo({ + url: `/doctor/pages/d_interactiveDoctor/index?patientId=${this.data.list[index].PatientId}`, + }) + }, + handleSendGroup() { + app.mpBehavior({ doctor: true, PageName: 'BTN_DOCTORPATIENTLISTMASSMESSAGE' }) + wx.navigateTo({ + url: '/doctor/pages/d_taskList/index', + }) + }, + onShareAppMessage() { + return { + title: '重症肌无力加油站,重拾生活掌控感!', + path: '/doctor/pages/d_patient/index', + } + }, + handleBack() { + wx.navigateBack() + }, +}) diff --git a/src/doctor/pages/d_patient/index.wxml b/src/doctor/pages/d_patient/index.wxml new file mode 100644 index 0000000..7c94d90 --- /dev/null +++ b/src/doctor/pages/d_patient/index.wxml @@ -0,0 +1,224 @@ + + + + + + + + + + + 需随访患者 + {{unReadCount}} + + 未达标患者 + + 我的患者 + {{unReadCount}} + + + + + + + 患者数: + {{total}} + + + 群发管理 + + + + + + + + + + + + + {{item.Name}} + + + 消息 + + + + 最近一次ADL:{{item.LastAdlTimeName}} + 需随访 + + + + ADL评分: + {{item.AdlScore}} + 分 + + + + 激素用量: + {{item.SteroidDailyDose}} + mg/d + + + 无ADL记录 + 复诊时间:{{item.LastReVisitDate}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/doctor/pages/d_patient/index.wxs b/src/doctor/pages/d_patient/index.wxs new file mode 100644 index 0000000..fe90f39 --- /dev/null +++ b/src/doctor/pages/d_patient/index.wxs @@ -0,0 +1,12 @@ +function include(value, arr) { + for (var i = 0; i < arr.length; i++) { + if (arr[i] === value) { + return true + } + } + return false +} + +module.exports = { + include: include, +} diff --git a/src/doctor/pages/d_patientDetail/index.json b/src/doctor/pages/d_patientDetail/index.json new file mode 100644 index 0000000..b11e6da --- /dev/null +++ b/src/doctor/pages/d_patientDetail/index.json @@ -0,0 +1,10 @@ +{ + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/navBar/navBar", + "van-icon": "@vant/weapp/icon/index", + "van-popup": "@vant/weapp/popup/index", + "ec-canvas": "/components/ec-canvas/ec-canvas", + "toast": "/components/toast/index" + } +} diff --git a/src/doctor/pages/d_patientDetail/index.scss b/src/doctor/pages/d_patientDetail/index.scss new file mode 100644 index 0000000..655a40b --- /dev/null +++ b/src/doctor/pages/d_patientDetail/index.scss @@ -0,0 +1,884 @@ +page { + background-color: rgba(242, 244, 245, 1); + padding-bottom: calc(140rpx + env(safe-area-inset-bottom)); +} +.page { + width: 100vw; + overflow-x: hidden; + min-height: 100vh; + .banner { + margin: 40rpx 30rpx 32rpx; + padding: 36rpx 20rpx; + background: #ffffff; + border-radius: 24rpx 24rpx 24rpx 24rpx; + position: relative; + .watermark { + position: absolute; + top: 80rpx; + z-index: 2; + font-size: 36rpx; + line-height: 58rpx; + color: rgba(0, 0, 0, 0.05); + transform: rotate(-12deg); + text-align: center; + .p { + white-space: wrap; + } + } + .banner-container { + .user { + display: flex; + .avatar { + .avatar-img { + width: 100rpx; + height: 100rpx; + border-radius: 50%; + } + } + .wrap { + padding-left: 20rpx; + .w-header { + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 8rpx; + .name { + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + font-weight: bold; + } + .icon { + width: 32rpx; + height: 32rpx; + } + .tel { + position: relative; + z-index: 3; + font-size: 32rpx; + color: rgba(154, 161, 162, 1); + display: flex; + align-items: center; + .tel-icon { + margin-left: 10rpx; + width: 32rpx; + height: 32rpx; + } + } + .send { + margin-left: 32rpx; + width: 92rpx; + height: 32rpx; + font-size: 22rpx; + color: rgba(103, 186, 202, 1); + text-align: center; + border: 1px solid #67baca; + border-radius: 58rpx 58rpx 58rpx 58rpx; + } + } + .w-tags { + margin-top: 28rpx; + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 12rpx; + .label { + width: 164rpx; + height: 40rpx; + } + .tag { + padding: 6rpx 16rpx; + font-size: 24rpx; + line-height: 28rpx; + color: rgba(103, 113, 114, 1); + background-color: rgba(242, 244, 245, 1); + border-radius: 8rpx; + } + } + } + } + .adl { + margin-top: 32rpx; + background: #ffffff; + box-shadow: 0rpx 8rpx 32rpx 0rpx rgba(40, 48, 49, 0.04); + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2rpx solid #f8f9f9; + .a-header { + display: flex; + align-items: flex-start; + flex-direction: column; + .content { + position: relative; + .sub-content1 { + position: relative; + z-index: 1; + border-radius: 24rpx 0 24rpx 0; + padding: 14rpx 28rpx; + font-size: 28rpx; + color: rgba(98, 190, 208, 1); + background-color: rgba(242, 248, 249, 1); + } + .sub-content2 { + position: absolute; + right: 20rpx; + top: 0; + transform: translateX(100%); + border-radius: 0 0 24rpx 0; + padding: 14rpx 28rpx 14rpx 40rpx; + font-size: 28rpx; + color: #e59a29; + background-color: #fff5df; + } + } + .box { + width: 40rpx; + height: 40rpx; + background-color: rgba(242, 248, 249, 1); + } + } + .a-content { + position: relative; + z-index: 1; + margin-top: -40rpx; + padding: 32rpx 30rpx; + background-color: #fff; + border-radius: 24rpx; + .row { + display: flex; + align-items: center; + gap: 20rpx; + &:first-of-type { + margin-bottom: 24rpx; + } + .label { + flex-shrink: 0; + font-size: 28rpx; + color: rgba(154, 161, 162, 1); + width: 6em; + } + .num { + min-width: 3em; + font-size: 28rpx; + color: rgba(40, 48, 49, 1); + } + .tag { + display: flex; + align-items: center; + background-color: rgba(232, 245, 248, 1); + border-radius: 12rpx; + .t-label { + padding: 8rpx 12rpx; + font-size: 24rpx; + color: rgba(255, 255, 255, 1); + background-color: rgba(103, 186, 202, 1); + border-radius: 12rpx; + display: flex; + align-items: center; + gap: 8rpx; + flex-shrink: 0; + .icon { + width: 24rpx; + height: 24rpx; + } + } + .t-content { + padding: 0 16rpx 0 8rpx; + display: flex; + align-items: center; + font-size: 28rpx; + color: rgba(103, 186, 202, 1); + display: flex; + align-items: center; + gap: 4rpx; + flex-shrink: 0; + .icon { + width: 24rpx; + height: 28rpx; + } + } + &.tag-warn { + background-color: rgba(227, 220, 64, 0.1); + .t-label { + background-color: rgba(225, 217, 45, 1); + } + .t-content { + color: rgba(225, 217, 45, 1); + } + } + &.tag-error { + background-color: rgba(248, 234, 234, 1); + .t-label { + background-color: rgba(215, 108, 108, 1); + } + .t-content { + color: rgba(215, 108, 108, 1); + } + } + } + } + .d-row { + margin-top: 22rpx; + display: flex; + gap: 20rpx; + .label { + flex-shrink: 0; + width: 6em; + font-size: 28rpx; + color: rgba(154, 161, 162, 1); + } + .content { + min-width: 3em; + font-size: 28rpx; + color: rgba(40, 48, 49, 1); + } + } + } + } + .info-card { + position: relative; + margin-top: 16rpx; + padding: 32rpx 30rpx; + border-radius: 24rpx; + box-shadow: 0rpx 8rpx 32rpx 0rpx rgba(40, 48, 49, 0.04); + border: 2rpx solid #f8f9f9; + background-color: #fff; + display: grid; + gap: 32rpx 22rpx; + grid-template-columns: repeat(auto-fit, minmax(40%, 1fr)); + .ic-item { + display: flex; + .label { + font-size: 28rpx; + color: #9aa1a2; + white-space: nowrap; + } + .content { + font-size: 28rpx; + color: #283031; + white-space: nowrap; + } + } + .edit { + position: absolute; + bottom: 0; + right: 0; + padding: 6rpx 18rpx; + display: flex; + align-items: center; + font-size: 28rpx; + color: #fff; + border-radius: 32rpx 0 24rpx 0; + background-color: #67baca; + .icon { + width: 32rpx; + height: 32rpx; + } + } + } + .b-footer { + margin: 32rpx auto 0; + display: flex; + align-items: center; + justify-content: center; + .send { + margin: 0 42rpx; + width: 200rpx; + height: 60rpx; + font-size: 32rpx; + color: rgba(98, 190, 208, 1); + display: flex; + align-items: center; + justify-content: center; + background: #ffffff; + border-radius: 64rpx 64rpx 64rpx 64rpx; + border: 2rpx solid #62bed0; + } + .remark { + width: 200rpx; + height: 60rpx; + font-size: 32rpx; + color: rgba(98, 190, 208, 1); + display: flex; + align-items: center; + justify-content: center; + background: #ffffff; + border-radius: 64rpx 64rpx 64rpx 64rpx; + border: 2rpx solid #62bed0; + } + } + } + } + + .chart-container { + margin: 30rpx; + padding: 30rpx; + border-radius: 24rpx; + background-color: #fff; + position: relative; + .watermark { + position: absolute; + top: 80rpx; + z-index: 2; + font-size: 36rpx; + line-height: 58rpx; + color: rgba(0, 0, 0, 0.05); + transform: rotate(-12deg); + text-align: center; + .p { + max-width: 90vw; + white-space: wrap; + } + } + .container { + .c-nav { + position: relative; + z-index: 3; + display: flex; + padding: 8rpx; + border-radius: 98rpx; + background-color: #f2f4f5; + .nav-item { + flex: 1; + padding: 12rpx; + font-size: 32rpx; + color: #677172; + text-align: center; + &.active { + color: #fff; + border-radius: 62rpx; + background-color: #62bed0; + } + } + } + .filter { + position: relative; + z-index: 3; + margin-top: 32rpx; + display: flex; + gap: 16rpx; + align-items: center; + border-radius: 80rpx 80rpx 80rpx 80rpx; + .type { + padding: 10rpx 32rpx; + display: flex; + align-items: center; + justify-content: center; + font-size: 28rpx; + color: rgba(103, 113, 114, 1); + background-color: rgba(242, 244, 245, 1); + border-radius: 34rpx; + .icon { + width: 24rpx; + height: 24rpx; + } + } + .range { + padding: 10rpx 32rpx; + display: flex; + align-items: center; + font-size: 28rpx; + color: rgba(103, 113, 114, 1); + border-radius: 34rpx; + background-color: rgba(242, 244, 245, 1); + .icon { + width: 24rpx; + height: 24rpx; + } + } + } + .card { + margin: 32rpx 0 0; + padding: 20rpx; + background: #ffffff; + box-shadow: 0rpx 8rpx 32rpx 0rpx rgba(40, 48, 49, 0.04); + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2rpx solid #f8f9f9; + .pie { + height: 376rpx; + } + .line { + border-top: 1px dashed rgba(242, 244, 245, 1); + } + .w-header { + padding-top: 32rpx; + display: flex; + justify-content: space-between; + .title { + font-size: 32rpx; + color: #484848; + } + .legend { + display: flex; + align-items: center; + gap: 25rpx; + .item { + font-size: 20rpx; + color: #4f4f4f; + display: flex; + align-items: center; + .logo { + margin-right: 8rpx; + width: 16rpx; + height: 16rpx; + border-radius: 50%; + background-color: #cf5375; + &.hormone { + background-color: #3192a1; + } + } + .icon { + margin-right: 8rpx; + width: 17rpx; + height: 24rpx; + } + } + } + } + .column { + height: 400rpx; + } + } + .module { + margin-top: 30rpx; + .module-header { + display: flex; + .date { + flex-shrink: 0; + font-size: 24rpx; + color: #333333; + } + .tags { + margin-left: 14rpx; + flex: 1; + display: flex; + flex-wrap: nowrap; + overflow-x: scroll; + white-space: nowrap; + &::-webkit-scrollbar { + display: none; + } + .tag1 { + margin-left: 14rpx; + padding: 0 12rpx; + background: #d86687; + border-radius: 6rpx; + font-size: 24rpx; + line-height: 36rpx; + text-align: center; + color: #ffffff; + } + .tag2 { + margin-left: 14rpx; + padding: 0 12rpx; + background: #0b184f; + border-radius: 6rpx; + font-size: 24rpx; + line-height: 36rpx; + text-align: center; + color: #ffffff; + } + .tag3 { + margin-left: 14rpx; + padding: 0 12rpx; + background: #24d8c8; + border-radius: 6rpx; + font-size: 24rpx; + line-height: 36rpx; + text-align: center; + color: #ffffff; + } + } + } + .module-container { + margin-top: 24rpx; + display: flex; + .aside { + margin-right: 30rpx; + padding-left: 14rpx; + border-right: 1px dashed #dddddd; + } + .m-card { + flex: 1; + box-shadow: 0 4rpx 29rpx 0rpx rgba(207, 83, 116, 0.25); + border-radius: 24rpx; + .card-header { + padding: 20rpx 18rpx 4rpx 48rpx; + border-radius: 24rpx 24rpx 0 0; + display: flex; + align-items: center; + justify-content: space-between; + box-shadow: 8rpx 8rpx 16rpx 0rpx rgba(143, 217, 226, 0.1); + &.grade1 { + background: linear-gradient(90deg, #26dac9 7%, rgba(143, 217, 226, 0) 70%, rgba(143, 217, 226, 0) 100%); + } + &.grade2 { + background: linear-gradient( + 90deg, + rgba(235, 111, 87, 1) 7%, + rgba(143, 217, 226, 0) 70%, + rgba(143, 217, 226, 0) 100% + ); + } + &.grade3 { + background: linear-gradient( + 90deg, + rgba(207, 83, 117, 1) 7%, + rgba(143, 217, 226, 0) 70%, + rgba(143, 217, 226, 0) 100% + ); + } + .num { + display: flex; + align-items: baseline; + font-size: 96rpx; + line-height: 1; + color: #ffffff; + letter-spacing: 4rpx; + .sub { + font-size: 24rpx; + color: #fff; + } + } + .num-detail { + display: flex; + .n-item { + width: 73rpx; + &.active { + .box { + background-color: #cf5375; + } + } + .box { + width: 45rpx; + height: 45rpx; + width: 45rpx; + height: 45rpx; + font-size: 32rpx; + color: #fff; + text-align: center; + line-height: 45rpx; + background: #333333; + border-radius: 12rpx 12rpx 12rpx 12rpx; + } + .name { + font-size: 24rpx; + line-height: 48rpx; + color: rgba(51, 51, 51, 0.5); + } + } + } + .status { + font-size: 24rpx; + color: #989898; + text-align: right; + .s-num { + font-size: 32rpx; + } + .s-core { + font-size: 24rpx; + color: #989898; + // background: #484848; + border-radius: 6rpx; + } + } + } + .card-container { + padding: 8rpx 23rpx 20rpx; + border-radius: 0 0 24rpx 24rpx; + background-color: #fff; + .cc-title { + text-indent: 22rpx; + font-size: 24rpx; + color: rgba(79, 79, 79, 1); + } + .cc-content { + margin-top: 12rpx; + padding: 16rpx 20rpx; + border-radius: 24rpx; + background-color: rgba(249, 249, 249, 1); + .line { + font-size: 24rpx; + color: #666666; + line-height: 36rpx; + .dot { + color: #666666; + font-weight: bold; + } + .red { + color: #cf5375; + } + .green { + color: #25d9c8; + } + } + } + .fold { + margin-top: 16rpx; + .fold-header { + display: flex; + justify-content: flex-end; + font-size: 24rpx; + color: rgba(204, 204, 204, 1); + } + .fold-container { + padding-top: 10rpx; + height: 500rpx; + overflow: hidden; + transition: all 0.5s; + &.hide { + padding: 0; + height: 0; + } + .fold-img { + width: 100%; + } + .scurt { + width: 100%; + border: 1px solid rgba(0, 0, 0, 0.1); + box-sizing: border-box; + .s-header { + display: flex; + height: 40rpx; + margin-bottom: -1px; + border-bottom: 1rpx solid rgba(0, 0, 0, 0.1); + .none { + flex-shrink: 0; + width: 226rpx; + background-color: rgba(228, 228, 228, 1); + } + .bar { + flex: 1; + display: flex; + .num { + flex: 1; + text-align: center; + font-size: 24rpx; + color: #fff; + line-height: 40rpx; + } + } + } + .s-body { + display: flex; + .s-aside { + width: 28rpx; + background-color: rgba(102, 102, 102, 0.15); + flex-shrink: 0; + .sa-item { + display: flex; + text-align: center; + justify-content: center; + align-items: center; + font-size: 18rpx; + color: rgba(102, 102, 102, 1); + line-height: 1; + overflow: hidden; + &:not(:last-of-type) { + margin-bottom: -1px; + border-bottom: 1px solid rgba(0, 0, 0, 0.1); + } + } + .sa-item1 { + height: 158rpx; + } + .sa-item2 { + height: 54rpx; + } + .sa-item3 { + height: 106rpx; + } + .sa-item4 { + height: 108rpx; + } + } + .s-container { + flex: 1; + .sc-row { + display: flex; + height: 54rpx; + overflow: hidden; + .sc-title { + width: 198rpx; + font-size: 18rpx; + color: rgba(102, 102, 102, 1); + text-align: center; + line-height: 53rpx; + } + .sc-col { + margin-left: -1px; + border-left: 1px solid rgba(0, 0, 0, 0.1); + flex: 1; + text-align: center; + .icon { + margin-top: 11rpx; + width: 32rpx; + height: 32rpx; + } + } + } + .sc-row:not(:last-of-type) { + margin-bottom: -1px; + border-bottom: 1px solid rgba(0, 0, 0, 0.1); + } + .sc-row:nth-of-type(2n-1) { + background-color: rgba(217, 217, 217, 0.2); + } + } + } + } + } + } + } + } + .drug-card { + margin-top: 30rpx; + flex: 1; + box-shadow: 0 4rpx 29rpx 0rpx rgba(207, 83, 116, 0.25); + border-radius: 24rpx; + .d-header { + border-radius: 24rpx 0 0 0; + padding: 20rpx 50rpx; + display: flex; + align-items: center; + justify-content: space-between; + background: linear-gradient(95deg, #26dac9 7%, rgba(143, 217, 226, 0) 100%); + .name { + font-size: 28rpx; + color: #ffffff; + } + .status { + font-size: 22rpx; + color: #5b6363; + .num { + font-size: 22rpx; + color: #cf5375; + } + } + } + .content { + padding: 20rpx 50rpx; + font-size: 22rpx; + color: #666666; + } + } + } + } + } + } +} + +.popup-remark { + padding: 32rpx 30rpx 84rpx; + .title { + display: flex; + justify-content: center; + font-size: 36rpx; + color: rgba(40, 48, 49, 1); + font-weight: bold; + } + .textarea { + padding: 30rpx; + margin-top: 32rpx; + width: 100%; + height: 216rpx; + box-sizing: border-box; + background: #f7f8f9; + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2rpx solid #f8f9f9; + font-size: 32rx; + } + .submit { + margin-top: 32rpx; + height: 84rpx; + display: flex; + justify-content: center; + align-items: center; + background: #67baca; + font-size: 36rpx; + color: #fff; + border-radius: 64rpx 64rpx 64rpx 64rpx; + } +} +.popup-edit { + width: 650rpx; + background-color: #fff; + .title { + padding-top: 46rpx; + font-size: 40rpx; + color: #283031; + font-weight: bold; + text-align: center; + } + .popup-container { + padding: 0 32rpx 32rpx; + min-height: 20vh; + max-height: 50vh; + overflow-y: auto; + .row { + margin-top: 48rpx; + .row-header { + display: flex; + align-items: center; + justify-content: space-between; + .label { + font-size: 32rpx; + color: #283031; + font-weight: bold; + } + .change-phone { + font-size: 32rpx; + color: #cf5375; + } + } + .row-content { + padding-top: 24rpx; + .radio-btns { + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 22rpx; + .btn { + padding: 18rpx 24rpx; + font-size: 32rpx; + color: #677172; + text-align: center; + line-height: 40rpx; + background: #f7f8f9; + border-radius: 12rpx 12rpx 12rpx 12rpx; + &.active { + color: #fff; + background-color: #67baca; + } + } + } + } + } + } + .popup-footer { + box-shadow: 0rpx 4rpx 32rpx 0rpx rgba(0, 0, 0, 0.15); + padding: 32rpx; + display: flex; + align-items: center; + justify-content: space-between; + gap: 18rpx; + .cancel { + flex: 1; + height: 74rpx; + border-radius: 98rpx 98rpx 98rpx 98rpx; + border: 1px solid #67baca; + font-size: 36rpx; + line-height: 74rpx; + color: #67baca; + text-align: center; + } + .conform { + flex: 1; + height: 74rpx; + border-radius: 98rpx 98rpx 98rpx 98rpx; + border: 1px solid #67baca; + background-color: #67baca; + font-size: 36rpx; + line-height: 74rpx; + color: #fff; + text-align: center; + } + } +} diff --git a/src/doctor/pages/d_patientDetail/index.ts b/src/doctor/pages/d_patientDetail/index.ts new file mode 100644 index 0000000..d2086e8 --- /dev/null +++ b/src/doctor/pages/d_patientDetail/index.ts @@ -0,0 +1,1075 @@ +import dayjs from 'dayjs' + +const app = getApp() + +let echarts: any = null +Page({ + data: { + toastShow: false, + toastType: 'patientDetailSafeDoctor', + toastParams: {} as any, + + showTel: false, + + doctor: {}, + hospital: {}, + + id: '', + remark: '', + detail: {} as any, + ec: { + lazyLoad: true, + }, + fields: { + 1: 'day', + 2: 'month', + 3: 'year', + }, + + StartDate: '', + EndDate: '', + typeRange: [ + { + id: '1', + value: '按天', + }, + { + id: '2', + value: '按月', + }, + { + id: '3', + value: '按年', + }, + ], + type: '3', + typeName: '按年', + userInfo: {}, + + popupRemarkShow: false, + remarkFocus: false, + + popupEditShow: false, + + antibodyTypeRangeList: [ + { + id: '1', + value: 'AchR', + }, + { + id: '2', + value: 'MuSK', + }, + { + id: '3', + value: 'LRP4', + }, + { + id: '4', + value: 'RyR', + }, + ], + thyroidAbnormalRangeList: [ + { + id: '1', + value: '是', + }, + { + id: '2', + value: '否', + }, + ], + previousConvulsionRangeList: [ + { + id: '1', + value: '是', + }, + { + id: '2', + value: '否', + }, + ], + traditionalImmunosuppressantRangeList: [ + { + id: '1', + value: '他克莫司', + }, + { + id: '2', + value: '硫唑嘌呤', + }, + { + id: '3', + value: '吗替麦考酚酯', + }, + { + id: '4', + value: '其它', + }, + ], + medicalInsuranceTypeRangeList: [ + { + id: '1', + value: '城市职工', + }, + { + id: '2', + value: '城市居民', + }, + { + id: '3', + value: '新农合', + }, + ], + + nav: '0', + + adlList: [] as any, + tableData: [ + { + title: '说话', + key: 'TalkingScore', + }, + { + title: '咀嚼', + key: 'ChewScore', + }, + { + title: '吞咽', + key: 'SwallowScore', + }, + { + title: '呼吸', + key: 'BreathScore', + }, + { + title: '刷牙梳头能力受损', + key: 'BrushTeethAndCombHairScore', + }, + { + title: '从椅子上起身能力受损', + key: 'GetUpFromChairScore', + }, + { + title: '复视/重影', + key: 'DoubleVisionScore', + }, + { + title: '眼睑下垂', + key: 'DroopyEyelidsScore', + }, + ], + + pagination: { + page: 1, + pages: 1, + count: 1, + }, + }, + ecDataTrendComponent1: null as any, + ecDataTrendComponent2: null as any, + ecDataTrendComponent3: null as any, + ecDataTrendComponent4: null as any, + async onLoad(option) { + this.setData({ + id: option.id, + }) + echarts = await require.async('../../../resource/components/echart/echarts.js') + this.ecDataTrendComponent1 = this.selectComponent('#chart1') + this.ecDataTrendComponent2 = this.selectComponent('#chart2') + this.ecDataTrendComponent3 = this.selectComponent('#chart3') + this.ecDataTrendComponent4 = this.selectComponent('#chart4') + + app.waitLogin().then(async (_res) => { + app.mpBehavior({ doctor: true, PageName: 'PG_DOCTORPATIENTDETAIL' }) + this.getDoctorDetail() + await this.getDetail() + this.handleNav({ currentTarget: { dataset: { index: '0' } } }, false) + }) + }, + getDoctorDetail() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/account/info', + data: {}, + }).then((res) => { + this.setData({ + doctor: res.doctor, + hospital: res.hospital, + toastShow: true, + toastType: 'patientDetailSafeDoctor', + toastParams: { + Name: res.doctor.Name, + HospitalName: res.hospital.Name, + }, + }) + }) + }, + getDetail() { + return wx + .ajax({ + method: 'GET', + url: '?r=igg4/doctor/patient/info', + data: { patientId: this.data.id }, + }) + .then((res) => { + if (res.LastAdlTime) { + res.LastAdlTimeName = dayjs(res.LastAdlTime).from(dayjs().format('YYYY-MM-DD')).replace(' ', '') + } + if (res.LastUseDrugsTime) { + res.LastUseDrugsTimeName = + dayjs().format('YYYY-MM-DD') === res.LastUseDrugsTime + ? '' + : dayjs(res.LastUseDrugsTime).from(dayjs().format('YYYY-MM-DD')).replace(' ', '') + } + this.setData({ + detail: { + ...res, + hideName: res.Name.replace(/^(.)(.*)$/, (_, first, rest) => first + '*'.repeat(rest.length)), + }, + }) + }) + }, + handleTypeChange(e) { + const index = e.detail.value + const { typeRange, nav } = this.data + const type = typeRange[index].id + const typeName = typeRange[index].value + let EndDate = '' + let StartDate = '' + if (type === '1') { + EndDate = dayjs().format('YYYY-MM-DD') + StartDate = dayjs().subtract(6, 'd').format('YYYY-MM-DD') + } else if (type === '2') { + EndDate = dayjs().format('YYYY-MM') + StartDate = dayjs().subtract(1, 'M').format('YYYY-MM') + } else if (type === '3') { + EndDate = dayjs().format('YYYY') + StartDate = dayjs().subtract(1, 'y').format('YYYY') + } + this.setData({ + type, + typeName, + EndDate, + StartDate, + }) + if (nav === '0') { + this.getGraph() + } else { + this.getAdlList() + } + }, + handleChange() { + const { nav } = this.data + if (nav === '0') { + this.getGraph() + } else { + this.getAdlList() + } + }, + getGraph() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/patient/adl-graph', + data: { + patientId: this.data.id, + StartDate: this.data.StartDate, + EndDate: this.data.EndDate, + DateType: this.data.type, + count: 0, + }, + }).then(async (res) => { + this.initChart1(res.adlSummary) + this.initChart2(res.adlSummary) + + const medication = res.medication.map((item) => { + return { + Date: item.InjectionDate, + ...item, + } + }) + const list = res.list + const newList: any[] = this.mergeArr(list, medication) + const chart3 = await this.initChart3(newList as never[]) + const chart4 = await this.initChart4(newList as never[]) + echarts.connect([chart3, chart4]) + }) + }, + mergeArr(array1: any[] = [], array2: any[] = []) { + // 合并两个数组中相同Date字段的对象 + const mergedArray: any[] = [] + const mergedMap = new Map() + + array1.concat(array2).forEach((obj) => { + const date = obj.Date + if (mergedMap.has(date)) { + mergedMap.get(date).push(obj) + } else { + mergedMap.set(date, [obj]) + } + }) + + mergedMap.forEach((objs: any) => { + if (objs.length === 1) { + mergedArray.push(objs[0]) + } else { + const mergedObj = objs.reduce((acc, cur) => ({ ...acc, ...cur })) + mergedArray.push(mergedObj) + } + }) + + // 按照Date字段对合并后的数组进行排序 + mergedArray.sort((a, b) => { + return a.Date.localeCompare(b.Date) + }) + return mergedArray + }, + initChart1(adlSummary = {}) { + this.ecDataTrendComponent1.init((canvas, width, height, dpr) => { + const chart = echarts.init(canvas, null, { + width, + height, + devicePixelRatio: dpr, // new + }) + canvas.setChart(chart) + + const option = { + tooltip: { + trigger: 'item', + formatter: '{b} \n {c}次,{d}%', + }, + legend: { + show: false, + }, + color: ['rgba(226, 219, 65, 1)', 'rgba(215, 108, 108, 1)', 'rgba(98, 190, 208, 1)'], + series: [ + { + name: '全部患者', + type: 'pie', + radius: ['40%', '60%'], + center: ['50%', '50%'], + label: { + show: true, + width: 80, + alignTo: 'edge', + minMargin: 5, + edgeDistance: 10, + lineHeight: 15, + formatter: '{b} \n{time|{d}%}', + rich: { + time: { + fontSize: 10, + color: '#999', + }, + }, + }, + labelLine: { + length: 15, + length2: 0, + maxSurfaceAngle: 80, + }, + labelLayout(params) { + const isLeft = params.labelRect.x < chart.getWidth() / 2 + const points = params.labelLinePoints + // Update the end point. + points[2][0] = isLeft ? params.labelRect.x : params.labelRect.x + params.labelRect.width + return { + labelLinePoints: points, + } + }, + data: [ + { value: adlSummary.adlNearNum, name: 'ADL接近达标' }, + { value: adlSummary.adlUnStandardNum, name: 'ADL未达标' }, + { value: adlSummary.adlStandardNum, name: 'ADL达标' }, + ], + emphasis: { + itemStyle: { + shadowBlur: 10, + shadowOffsetX: 0, + shadowColor: 'rgba(0, 0, 0, 0.5)', + }, + }, + }, + ], + } + + chart.setOption(option) + return chart + }) + }, + initChart2(adlSummary = {}) { + this.ecDataTrendComponent2.init((canvas, width, height, dpr) => { + const chart = echarts.init(canvas, null, { + width, + height, + devicePixelRatio: dpr, // new + }) + canvas.setChart(chart) + + const option = { + tooltip: { + trigger: 'item', + formatter: '{b} \n {c}次,{d}%', + }, + legend: { + show: false, + }, + color: ['rgba(215, 108, 108, 1)', 'rgba(98, 190, 208, 1)'], + series: [ + { + name: '全部患者', + type: 'pie', + radius: ['40%', '60%'], + center: ['50%', '50%'], + label: { + show: true, + width: 80, + alignTo: 'edge', + minMargin: 5, + edgeDistance: 10, + lineHeight: 15, + formatter: '{b} \n{time|{d}%}', + rich: { + time: { + fontSize: 10, + color: '#999', + }, + }, + }, + labelLine: { + length: 15, + length2: 0, + maxSurfaceAngle: 80, + }, + labelLayout(params) { + const isLeft = params.labelRect.x < chart.getWidth() / 2 + const points = params.labelLinePoints + // Update the end point. + points[2][0] = isLeft ? params.labelRect.x : params.labelRect.x + params.labelRect.width + return { + labelLinePoints: points, + } + }, + data: [ + { value: adlSummary.SteroidDailyDoseUnStandardNum, name: '激素未达标' }, + { value: adlSummary.SteroidDailyDoseStandardNum, name: '激素达标' }, + ], + emphasis: { + itemStyle: { + shadowBlur: 10, + shadowOffsetX: 0, + shadowColor: 'rgba(0, 0, 0, 0.5)', + }, + }, + }, + ], + } + + chart.setOption(option) + return chart + }) + }, + + initChart3(defaultList = []) { + const { userInfo } = this.data + const list: any = defaultList + return new Promise((reslove) => { + this.ecDataTrendComponent3.init((canvas, width, height, dpr) => { + const chart = echarts.init(canvas, null, { + width, + height, + devicePixelRatio: dpr, // new + }) + canvas.setChart(chart) + + const option: any = { + tooltip: { + show: false, + trigger: 'axis', + axisPointer: { + type: 'shadow', + }, + confine: true, + backgroundColor: 'rgba(0, 0, 0, 0.5)', + textStyle: { + color: '#fff', + fontSize: 10, + }, + order: 'seriesDesc', + }, + grid: { + top: '30', + left: '0', + right: '0', + bottom: '10', + containLabel: true, + }, + xAxis: [ + { + type: 'category', + axisTick: { + show: true, + inside: true, + length: 1, + alignWithLabel: true, + lineStyle: { + type: 'dotted', + color: '#D8D8D8', + width: 4, + cap: 'round', + }, + }, + axisLine: { + lineStyle: { + color: '#8C8C8C', + type: 'dashed', + }, + }, + data: list.map((item) => dayjs(item.Date).format('MM-DD')), + axisLabel: { + formatter() { + return '' + }, + }, + }, + ], + yAxis: [ + { + type: 'value', + minInterval: 1, + }, + ], + series: [ + { + name: '总分', + data: list.length ? list.map((item) => item.TotalScore) : [25], + barWidth: '16', + label: { + show: true, + position: 'top', + color: '#CF5375', + }, + type: 'line', + symbol: 'circle', + symbolSize: 8, + showSymbol: list.length >= 1, + connectNulls: true, + z: 10, + itemStyle: { + color: '#CF5375', + }, + markLine: { + symbol: ['none', 'none'], + data: [ + { + name: '达标区(1分)', + yAxis: 1, + label: { + formatter: '{b}', + position: 'insideMiddle', + color: '#24D8C8', + fontSize: '10', + }, + lineStyle: { + cap: '', + color: '#34D7C7', + type: 'dashed', + }, + }, + ], + }, + markArea: { + itemStyle: { + color: 'rgba(37,217,200,0.19)', + }, + data: [ + [ + { + yAxis: 0, + }, + { + yAxis: 1, + }, + ], + ], + }, + }, + ], + dataZoom: { + type: 'inside', // 有type这个属性,滚动条在最下面,也可以不行,写y:36,这表示距离顶端36px,一般就是在图上面。 + startValue: list.length - 5, + endValue: list.length - 1, + filterMode: 'none', + }, + } + + if (this.data.detail.UserType === 4) { + const markLineData = list + .filter((item) => item.InjectionBottles) + .map((item) => { + return { + name: '', + xAxis: dayjs(item.Date).format('MM-DD'), + lineStyle: { + color: 'rgba(37, 217, 200,0.5)', + cap: '', + type: 'solid', + }, + + label: { + formatter: '', + position: 'insideEndBottom', + rotate: 0, + color: '#25D9C8', + offset: [60, 0], + }, + } + }) + option.series.push({ + name: '用药', + data: list.map((item) => (item.InjectionBottles ? 0 : null)), + type: 'line', + symbol: + 'image://data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAABACAYAAABhspUgAAAAAXNSR0IArs4c6QAACAVJREFUaEPtmltsHFcZx/9nZu92bMdJSMitzoWkoXVKUrVV8wKk4gHxgJTwgKA8lhfgCZBoUJEqUYGA0AhRQUSpFJQIHlyqogZFIipUoKiAKJAYQkp9qR1ir9fe6+zuXM4FfWf2MrOJY+/aS0zlkRxZzsw5v/nP/3znO+c7DItcl4vFTWVl/7wg5EctKSK2knCVBFcKcrGH7vL3MvfwVnYeGbsaustgAAODCSDCDLU1Hp/Ym+o7fnrvB9+9U3NssT5ezWe+k5X8qwvCQ0FwVKSEswJg6sfmHH+cm2l0SZ3Tj8F84ChjiDID+1I9ly4ceuTjbQFfyM2MpDk/meEu8oKjJIUG9khh1YHEtUeupgPAWl3AAENEwzLEmIGd8dToq8OPDbcF/OLCrZFZ7p5Mcxc5wVEUAmQLT8mOLFHvfCwzF7ZEC3CcGdiRSIxeHD7WHvDZhZsjM56ngbMELDlsWVO4c4ExOd8E9i1R969vhzhj2BFPjv76cJvApPCtkMK8YYkVOALLUXh7PNE+8M/Iw553MiN8S1ii6eGVAI+mZ0PfhzHoAWfWBlyMMWyPJ0dfG368PUu8nJ8bWRD8ZPYOUWIlwH+YmQ4Dg8FoAPu22J5Ijb7ywKPtAV8uZZ/LC36qIH11q7UIIZRCp8CW5+Ly7M3bgVkzUlC0ONC74VcvHTj6ybaiBN38RmVhV9YxTBs2nrl08VTRrjy1gvEGZRh+HGu5epOp808ceehMFFEkDYN/f++Df1+sn0UnjtYHjB9+63tQ6ssrAV70WcZOyy8+/ZXltL0o8Hfzk3u4jc94Bh7nSm0uOZWNruvFozBMkzEG+iF3KGm5XJTAZFVIxRXCjnGkNB0pIwXPTWYcu6/MeYLAgh1HozHeE48VE6Y5vyFiXknFoufO73/4nWVZ4kwmc9BG5QVLiONcKSYYEFU0z/vd1P3rQaEiBYiwnSvr2Jgo5mFxTz9Gcbj+AjTjmczPKbbF41fej9jnzz5w9J/B9kMKP58e/1xO4ayjZNKlwaUUkqYJJZsDjRKfBcH1dN3pRa3dKpUwX61oqRs5RS1amLWpOmWYzv5k7xfO3X/0p/W+GsBnMtNPLQjvx1UlDUcKQDEkDKanYRJR6W+tMM0dzPPOYYMvmauWkStXfOBA1kYxWecWMJAwDHV/T9+Xzh088kLDSmfmpx9b8Lw3qpDxqv7MCilmaFBJ/9aMmZYcY05VK78aFw2DrGXBdp2AymSLQDIEAynD9B4c3PKRnwwduqIV/ubc5N+Kgj9EnqQEhxIQ+iwyEHPJIm+WSxBMj7TV4NX+lVIiXyzURGCg/NjP3ijdNEAzH/FsjcX/dWn42CH2g+zMJ9Ju5bWyFDrnFQB6GMGSur4N6Bpzq5hwnVUBbW2kWq3CcXyV6QoMvgZwghk43Dtwgn17burlrHBPaGAlEQFDnN68Bku41NDvrQLsVVK2FZhzAcsqNYCpP/rCZA2tsGGAgIeSvRfZs3Pj0wUhdpZr028vo/cj4OaHJ+WvVIpdUbfeaKHg26KpMoU3P7cgaALeHIun2TPpcaskeE9ZSp0v9DPTjwoB4Cytx+xyV4FLxSKE9FeL9TDnZ3D+KoSA+yIRm52aGVOWEiBLVKXEoBHRdtDRoXbNcQ9XuwxMliBrhIBr8VgDGwxJZoI9TcCSo6wkHCmxUQOHV8Zz3MVVu9JVha2SBR6YjCjlrK/1tCUMwwf+WgDYrQGLlsC1VoDJFiHgoMLBSLsWgClSJOvAJdncd6hbYi0B08DzLVFTeB24g+F5t0G3rnAHgt72yLrC93LieO952ARHVDWXQQVuYbqaWQ2rLtrGVJmhEljR6pyRFqS1fIKS+LjB/JmuNQ7vlrMYUs1dxp3udRwrvdJV4GedJ3BDbl6yj1UFdgsJVNMbQp0mt5UQ67OXBLknwOO/OILi2KYQXN++Bez99F/XJvA75x+G9e7GEFzvfTnsf/Iv68CNKhFla50OujWtsD3fA2tyMPSpM3/eBSebCv0tPljBlkfCm9i9Q1kkNofXiF0fdJO/HEb++tYlvXmnGwYOpTF04lrov7oOPDFyGIUb7+sIuP9gBns+Fd6zXgdunen+7xT+z28OIPOn3R1ZYsujU9jxsbf/tx6m3pQMVxzGLhyFNdUycezOYd9n3wrBMeP23c+ue/hO0q7pOLwOfC/Sy1uvfwDZa9tC4g8Oz2L78X8vOTjviYeXpLrLDSsC3qqy2KZyjeYH3EnsKf92JTxLPvti9UOYkv233eefWKEqE52rWGSJFNx9pxbu9Wbge2/VvOYVru/Ar+UN7cb+8FosGTRrz35RpulhE+zrs1TjoKKMf5BuIzN1cTFYRcpwD6NOd2scxRIVZZqbN/q0la7sN6tIumTwjdlxXUWqCAIW6KeiTMtxxXnh4boTPoK4ZJxq84ZssQgvAEwl3HpVXyusK0kG2HNzk/mSEP0VJfS5NCosKjq7USuAU15lKYkbXa4i3czlwOkUQe0KAtfrzf2RqMVOZ6Z+VxD8w1RUJEtElV9JDx4Ipd8nXFtX+btxOULg7ay/d9eohDL/tFX9PCZB70qk3mQ/ys0M5T3nWlXKXqrYcyaRpFtrRw7qiPQyRa3Aso8JLevdqAg/mptHwW1uZ9XPYxIwiUc/GyLRyuH+LcO6d4KuCv5SRYojrpQDFIcjMLTp60dcdMJel6D1YM+y0MI3uUIg57n4RyGLoueGE/xar2SLHsO0NsXi13b1DDz5/H0Hxv8Lo3UyF0Y2DrcAAAAASUVORK5CYII=', + symbolSize: [11, 16], + symbolOffset: [0, 0], + itemStyle: { + color: '#25D9C8', + }, + lineStyle: { + width: 0, + }, + tooltip: { + show: false, + }, + z: 11, + markLine: { + symbol: ['none', 'none'], + data: markLineData, + }, + }) + // option.series.push({ + // name: "用药时间", + // data: list.map((item: any) => (item.InjectionBottles ? item.TotalScore : 0)), + // type: "line", + // symbol: + // "image://data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAABACAYAAABhspUgAAAAAXNSR0IArs4c6QAACAVJREFUaEPtmltsHFcZx/9nZu92bMdJSMitzoWkoXVKUrVV8wKk4gHxgJTwgKA8lhfgCZBoUJEqUYGA0AhRQUSpFJQIHlyqogZFIipUoKiAKJAYQkp9qR1ir9fe6+zuXM4FfWf2MrOJY+/aS0zlkRxZzsw5v/nP/3znO+c7DItcl4vFTWVl/7wg5EctKSK2knCVBFcKcrGH7vL3MvfwVnYeGbsaustgAAODCSDCDLU1Hp/Ym+o7fnrvB9+9U3NssT5ezWe+k5X8qwvCQ0FwVKSEswJg6sfmHH+cm2l0SZ3Tj8F84ChjiDID+1I9ly4ceuTjbQFfyM2MpDk/meEu8oKjJIUG9khh1YHEtUeupgPAWl3AAENEwzLEmIGd8dToq8OPDbcF/OLCrZFZ7p5Mcxc5wVEUAmQLT8mOLFHvfCwzF7ZEC3CcGdiRSIxeHD7WHvDZhZsjM56ngbMELDlsWVO4c4ExOd8E9i1R969vhzhj2BFPjv76cJvApPCtkMK8YYkVOALLUXh7PNE+8M/Iw553MiN8S1ii6eGVAI+mZ0PfhzHoAWfWBlyMMWyPJ0dfG368PUu8nJ8bWRD8ZPYOUWIlwH+YmQ4Dg8FoAPu22J5Ijb7ywKPtAV8uZZ/LC36qIH11q7UIIZRCp8CW5+Ly7M3bgVkzUlC0ONC74VcvHTj6ybaiBN38RmVhV9YxTBs2nrl08VTRrjy1gvEGZRh+HGu5epOp808ceehMFFEkDYN/f++Df1+sn0UnjtYHjB9+63tQ6ssrAV70WcZOyy8+/ZXltL0o8Hfzk3u4jc94Bh7nSm0uOZWNruvFozBMkzEG+iF3KGm5XJTAZFVIxRXCjnGkNB0pIwXPTWYcu6/MeYLAgh1HozHeE48VE6Y5vyFiXknFoufO73/4nWVZ4kwmc9BG5QVLiONcKSYYEFU0z/vd1P3rQaEiBYiwnSvr2Jgo5mFxTz9Gcbj+AjTjmczPKbbF41fej9jnzz5w9J/B9kMKP58e/1xO4ayjZNKlwaUUkqYJJZsDjRKfBcH1dN3pRa3dKpUwX61oqRs5RS1amLWpOmWYzv5k7xfO3X/0p/W+GsBnMtNPLQjvx1UlDUcKQDEkDKanYRJR6W+tMM0dzPPOYYMvmauWkStXfOBA1kYxWecWMJAwDHV/T9+Xzh088kLDSmfmpx9b8Lw3qpDxqv7MCilmaFBJ/9aMmZYcY05VK78aFw2DrGXBdp2AymSLQDIEAynD9B4c3PKRnwwduqIV/ubc5N+Kgj9EnqQEhxIQ+iwyEHPJIm+WSxBMj7TV4NX+lVIiXyzURGCg/NjP3ijdNEAzH/FsjcX/dWn42CH2g+zMJ9Ju5bWyFDrnFQB6GMGSur4N6Bpzq5hwnVUBbW2kWq3CcXyV6QoMvgZwghk43Dtwgn17burlrHBPaGAlEQFDnN68Bku41NDvrQLsVVK2FZhzAcsqNYCpP/rCZA2tsGGAgIeSvRfZs3Pj0wUhdpZr028vo/cj4OaHJ+WvVIpdUbfeaKHg26KpMoU3P7cgaALeHIun2TPpcaskeE9ZSp0v9DPTjwoB4Cytx+xyV4FLxSKE9FeL9TDnZ3D+KoSA+yIRm52aGVOWEiBLVKXEoBHRdtDRoXbNcQ9XuwxMliBrhIBr8VgDGwxJZoI9TcCSo6wkHCmxUQOHV8Zz3MVVu9JVha2SBR6YjCjlrK/1tCUMwwf+WgDYrQGLlsC1VoDJFiHgoMLBSLsWgClSJOvAJdncd6hbYi0B08DzLVFTeB24g+F5t0G3rnAHgt72yLrC93LieO952ARHVDWXQQVuYbqaWQ2rLtrGVJmhEljR6pyRFqS1fIKS+LjB/JmuNQ7vlrMYUs1dxp3udRwrvdJV4GedJ3BDbl6yj1UFdgsJVNMbQp0mt5UQ67OXBLknwOO/OILi2KYQXN++Bez99F/XJvA75x+G9e7GEFzvfTnsf/Iv68CNKhFla50OujWtsD3fA2tyMPSpM3/eBSebCv0tPljBlkfCm9i9Q1kkNofXiF0fdJO/HEb++tYlvXmnGwYOpTF04lrov7oOPDFyGIUb7+sIuP9gBns+Fd6zXgdunen+7xT+z28OIPOn3R1ZYsujU9jxsbf/tx6m3pQMVxzGLhyFNdUycezOYd9n3wrBMeP23c+ue/hO0q7pOLwOfC/Sy1uvfwDZa9tC4g8Oz2L78X8vOTjviYeXpLrLDSsC3qqy2KZyjeYH3EnsKf92JTxLPvti9UOYkv233eefWKEqE52rWGSJFNx9pxbu9Wbge2/VvOYVru/Ar+UN7cb+8FosGTRrz35RpulhE+zrs1TjoKKMf5BuIzN1cTFYRcpwD6NOd2scxRIVZZqbN/q0la7sN6tIumTwjdlxXUWqCAIW6KeiTMtxxXnh4boTPoK4ZJxq84ZssQgvAEwl3HpVXyusK0kG2HNzk/mSEP0VJfS5NCosKjq7USuAU15lKYkbXa4i3czlwOkUQe0KAtfrzf2RqMVOZ6Z+VxD8w1RUJEtElV9JDx4Ipd8nXFtX+btxOULg7ay/d9eohDL/tFX9PCZB70qk3mQ/ys0M5T3nWlXKXqrYcyaRpFtrRw7qiPQyRa3Aso8JLevdqAg/mptHwW1uZ9XPYxIwiUc/GyLRyuH+LcO6d4KuCv5SRYojrpQDFIcjMLTp60dcdMJel6D1YM+y0MI3uUIg57n4RyGLoueGE/xar2SLHsO0NsXi13b1DDz5/H0Hxv8Lo3UyF0Y2DrcAAAAASUVORK5CYII=", + // symbolSize: [11, 16], + // symbolOffset: [0, "100%"], + // itemStyle: { + // color: "#25D9C8", + // }, + // tooltip: { + // show: false, + // }, + // lineStyle: { + // width: 0, + // }, + // z: 1, + // }); + } + + chart.setOption(option) + reslove(chart) + return chart + }) + }) + }, + initChart4(defaultList = []) { + const { userInfo } = this.data + const list: any = defaultList + return new Promise((reslove) => { + this.ecDataTrendComponent4.init((canvas, width, height, dpr) => { + const chart = echarts.init(canvas, null, { + width, + height, + devicePixelRatio: dpr, // new + }) + canvas.setChart(chart) + + const option: any = { + tooltip: { + show: false, + trigger: 'axis', + axisPointer: { + type: 'shadow', + }, + confine: true, + backgroundColor: 'rgba(0, 0, 0, 0.5)', + textStyle: { + color: '#fff', + fontSize: 10, + }, + order: 'seriesDesc', + }, + grid: { + top: '30', + left: '0', + right: '0', + bottom: '10', + containLabel: true, + }, + xAxis: [ + { + type: 'category', + axisTick: { + show: true, + inside: true, + length: 1, + alignWithLabel: true, + lineStyle: { + type: 'dotted', + color: '#D8D8D8', + width: 4, + cap: 'round', + }, + }, + axisLine: { + lineStyle: { + color: '#8C8C8C', + type: 'dashed', + }, + }, + data: list.map((item) => dayjs(item.Date).format('MM-DD')), + }, + ], + yAxis: [ + { + type: 'value', + minInterval: 1, + max(value) { + return value.max + 20 > 999 ? 999 : value.max + 20 + }, + axisLabel: { + // width: 20, + formatter(value: number) { + return value + }, + }, + }, + ], + series: [ + { + name: '激素用量', + data: list.length ? list.map((item) => item.SteroidDailyDose) : [20], + barWidth: '16', + type: 'line', + symbol: 'circle', + symbolSize: 8, + connectNulls: true, + showSymbol: list.length >= 1, + z: 10, + label: { + show: true, + position: 'top', + color: '#18474e', + z: 11, + formatter({ value }) { + return `${value}mg` + }, + }, + itemStyle: { + color: '#3192A1', + }, + markLine: { + symbol: ['none', 'none'], + data: [ + { + name: '达标区(5mg)', + yAxis: 5, + label: { + formatter: '{b}', + position: 'insideMiddle', + color: '#24D8C8', + fontSize: '10', + }, + lineStyle: { + cap: '', + color: '#34D7C7', + type: 'dashed', + }, + }, + { + name: '20', + yAxis: 20, + label: { + formatter: '{b}', + position: 'start', + color: '#D76C6C', + distance: 8, + }, + lineStyle: { + cap: '', + color: '#D76C6C', + type: 'dashed', + }, + }, + ], + }, + markArea: { + itemStyle: { + color: 'rgba(37,217,200,0.19)', + }, + data: [ + [ + { + yAxis: 0, + }, + { + yAxis: 5, + }, + ], + ], + }, + }, + ], + dataZoom: { + type: 'inside', // 有type这个属性,滚动条在最下面,也可以不行,写y:36,这表示距离顶端36px,一般就是在图上面。 + startValue: list.length - 5, + endValue: list.length - 1, + filterMode: 'none', + }, + } + if (this.data.detail.UserType === 4) { + const markLineData = list + .filter((item) => item.InjectionBottles) + .map((item) => { + return { + name: '', + xAxis: dayjs(item.Date).format('MM-DD'), + lineStyle: { + color: 'rgba(37, 217, 200,0.5)', + cap: '', + type: 'solid', + }, + label: { + formatter: '', + position: 'insideEndBottom', + rotate: 0, + color: '#25D9C8', + offset: [60, 0], + }, + } + }) + const maxValue = Math.max(...list.map((item) => item.SteroidDailyDose)) + option.series.push({ + name: '用药', + data: list.map((item) => (item.InjectionBottles ? 0 : null)), + type: 'line', + symbol: + 'image://data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAABACAYAAABhspUgAAAAAXNSR0IArs4c6QAACAVJREFUaEPtmltsHFcZx/9nZu92bMdJSMitzoWkoXVKUrVV8wKk4gHxgJTwgKA8lhfgCZBoUJEqUYGA0AhRQUSpFJQIHlyqogZFIipUoKiAKJAYQkp9qR1ir9fe6+zuXM4FfWf2MrOJY+/aS0zlkRxZzsw5v/nP/3znO+c7DItcl4vFTWVl/7wg5EctKSK2knCVBFcKcrGH7vL3MvfwVnYeGbsaustgAAODCSDCDLU1Hp/Ym+o7fnrvB9+9U3NssT5ezWe+k5X8qwvCQ0FwVKSEswJg6sfmHH+cm2l0SZ3Tj8F84ChjiDID+1I9ly4ceuTjbQFfyM2MpDk/meEu8oKjJIUG9khh1YHEtUeupgPAWl3AAENEwzLEmIGd8dToq8OPDbcF/OLCrZFZ7p5Mcxc5wVEUAmQLT8mOLFHvfCwzF7ZEC3CcGdiRSIxeHD7WHvDZhZsjM56ngbMELDlsWVO4c4ExOd8E9i1R969vhzhj2BFPjv76cJvApPCtkMK8YYkVOALLUXh7PNE+8M/Iw553MiN8S1ii6eGVAI+mZ0PfhzHoAWfWBlyMMWyPJ0dfG368PUu8nJ8bWRD8ZPYOUWIlwH+YmQ4Dg8FoAPu22J5Ijb7ywKPtAV8uZZ/LC36qIH11q7UIIZRCp8CW5+Ly7M3bgVkzUlC0ONC74VcvHTj6ybaiBN38RmVhV9YxTBs2nrl08VTRrjy1gvEGZRh+HGu5epOp808ceehMFFEkDYN/f++Df1+sn0UnjtYHjB9+63tQ6ssrAV70WcZOyy8+/ZXltL0o8Hfzk3u4jc94Bh7nSm0uOZWNruvFozBMkzEG+iF3KGm5XJTAZFVIxRXCjnGkNB0pIwXPTWYcu6/MeYLAgh1HozHeE48VE6Y5vyFiXknFoufO73/4nWVZ4kwmc9BG5QVLiONcKSYYEFU0z/vd1P3rQaEiBYiwnSvr2Jgo5mFxTz9Gcbj+AjTjmczPKbbF41fej9jnzz5w9J/B9kMKP58e/1xO4ayjZNKlwaUUkqYJJZsDjRKfBcH1dN3pRa3dKpUwX61oqRs5RS1amLWpOmWYzv5k7xfO3X/0p/W+GsBnMtNPLQjvx1UlDUcKQDEkDKanYRJR6W+tMM0dzPPOYYMvmauWkStXfOBA1kYxWecWMJAwDHV/T9+Xzh088kLDSmfmpx9b8Lw3qpDxqv7MCilmaFBJ/9aMmZYcY05VK78aFw2DrGXBdp2AymSLQDIEAynD9B4c3PKRnwwduqIV/ubc5N+Kgj9EnqQEhxIQ+iwyEHPJIm+WSxBMj7TV4NX+lVIiXyzURGCg/NjP3ijdNEAzH/FsjcX/dWn42CH2g+zMJ9Ju5bWyFDrnFQB6GMGSur4N6Bpzq5hwnVUBbW2kWq3CcXyV6QoMvgZwghk43Dtwgn17burlrHBPaGAlEQFDnN68Bku41NDvrQLsVVK2FZhzAcsqNYCpP/rCZA2tsGGAgIeSvRfZs3Pj0wUhdpZr028vo/cj4OaHJ+WvVIpdUbfeaKHg26KpMoU3P7cgaALeHIun2TPpcaskeE9ZSp0v9DPTjwoB4Cytx+xyV4FLxSKE9FeL9TDnZ3D+KoSA+yIRm52aGVOWEiBLVKXEoBHRdtDRoXbNcQ9XuwxMliBrhIBr8VgDGwxJZoI9TcCSo6wkHCmxUQOHV8Zz3MVVu9JVha2SBR6YjCjlrK/1tCUMwwf+WgDYrQGLlsC1VoDJFiHgoMLBSLsWgClSJOvAJdncd6hbYi0B08DzLVFTeB24g+F5t0G3rnAHgt72yLrC93LieO952ARHVDWXQQVuYbqaWQ2rLtrGVJmhEljR6pyRFqS1fIKS+LjB/JmuNQ7vlrMYUs1dxp3udRwrvdJV4GedJ3BDbl6yj1UFdgsJVNMbQp0mt5UQ67OXBLknwOO/OILi2KYQXN++Bez99F/XJvA75x+G9e7GEFzvfTnsf/Iv68CNKhFla50OujWtsD3fA2tyMPSpM3/eBSebCv0tPljBlkfCm9i9Q1kkNofXiF0fdJO/HEb++tYlvXmnGwYOpTF04lrov7oOPDFyGIUb7+sIuP9gBns+Fd6zXgdunen+7xT+z28OIPOn3R1ZYsujU9jxsbf/tx6m3pQMVxzGLhyFNdUycezOYd9n3wrBMeP23c+ue/hO0q7pOLwOfC/Sy1uvfwDZa9tC4g8Oz2L78X8vOTjviYeXpLrLDSsC3qqy2KZyjeYH3EnsKf92JTxLPvti9UOYkv233eefWKEqE52rWGSJFNx9pxbu9Wbge2/VvOYVru/Ar+UN7cb+8FosGTRrz35RpulhE+zrs1TjoKKMf5BuIzN1cTFYRcpwD6NOd2scxRIVZZqbN/q0la7sN6tIumTwjdlxXUWqCAIW6KeiTMtxxXnh4boTPoK4ZJxq84ZssQgvAEwl3HpVXyusK0kG2HNzk/mSEP0VJfS5NCosKjq7USuAU15lKYkbXa4i3czlwOkUQe0KAtfrzf2RqMVOZ6Z+VxD8w1RUJEtElV9JDx4Ipd8nXFtX+btxOULg7ay/d9eohDL/tFX9PCZB70qk3mQ/ys0M5T3nWlXKXqrYcyaRpFtrRw7qiPQyRa3Aso8JLevdqAg/mptHwW1uZ9XPYxIwiUc/GyLRyuH+LcO6d4KuCv5SRYojrpQDFIcjMLTp60dcdMJel6D1YM+y0MI3uUIg57n4RyGLoueGE/xar2SLHsO0NsXi13b1DDz5/H0Hxv8Lo3UyF0Y2DrcAAAAASUVORK5CYII=', + symbolSize: [11, 16], + symbolOffset: [0, 0], + itemStyle: { + color: '#25D9C8', + }, + lineStyle: { + width: 0, + }, + tooltip: { + show: false, + }, + z: 11, + markLine: { + symbol: ['none', 'none'], + data: markLineData, + }, + }) + // option.series.push({ + // name: "用药时间", + // data: list.map((item: any) => (item.InjectionBottles ? item.TotalScore : 0)), + // type: "line", + // symbol: + // "image://data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAABACAYAAABhspUgAAAAAXNSR0IArs4c6QAACAVJREFUaEPtmltsHFcZx/9nZu92bMdJSMitzoWkoXVKUrVV8wKk4gHxgJTwgKA8lhfgCZBoUJEqUYGA0AhRQUSpFJQIHlyqogZFIipUoKiAKJAYQkp9qR1ir9fe6+zuXM4FfWf2MrOJY+/aS0zlkRxZzsw5v/nP/3znO+c7DItcl4vFTWVl/7wg5EctKSK2knCVBFcKcrGH7vL3MvfwVnYeGbsaustgAAODCSDCDLU1Hp/Ym+o7fnrvB9+9U3NssT5ezWe+k5X8qwvCQ0FwVKSEswJg6sfmHH+cm2l0SZ3Tj8F84ChjiDID+1I9ly4ceuTjbQFfyM2MpDk/meEu8oKjJIUG9khh1YHEtUeupgPAWl3AAENEwzLEmIGd8dToq8OPDbcF/OLCrZFZ7p5Mcxc5wVEUAmQLT8mOLFHvfCwzF7ZEC3CcGdiRSIxeHD7WHvDZhZsjM56ngbMELDlsWVO4c4ExOd8E9i1R969vhzhj2BFPjv76cJvApPCtkMK8YYkVOALLUXh7PNE+8M/Iw553MiN8S1ii6eGVAI+mZ0PfhzHoAWfWBlyMMWyPJ0dfG368PUu8nJ8bWRD8ZPYOUWIlwH+YmQ4Dg8FoAPu22J5Ijb7ywKPtAV8uZZ/LC36qIH11q7UIIZRCp8CW5+Ly7M3bgVkzUlC0ONC74VcvHTj6ybaiBN38RmVhV9YxTBs2nrl08VTRrjy1gvEGZRh+HGu5epOp808ceehMFFEkDYN/f++Df1+sn0UnjtYHjB9+63tQ6ssrAV70WcZOyy8+/ZXltL0o8Hfzk3u4jc94Bh7nSm0uOZWNruvFozBMkzEG+iF3KGm5XJTAZFVIxRXCjnGkNB0pIwXPTWYcu6/MeYLAgh1HozHeE48VE6Y5vyFiXknFoufO73/4nWVZ4kwmc9BG5QVLiONcKSYYEFU0z/vd1P3rQaEiBYiwnSvr2Jgo5mFxTz9Gcbj+AjTjmczPKbbF41fej9jnzz5w9J/B9kMKP58e/1xO4ayjZNKlwaUUkqYJJZsDjRKfBcH1dN3pRa3dKpUwX61oqRs5RS1amLWpOmWYzv5k7xfO3X/0p/W+GsBnMtNPLQjvx1UlDUcKQDEkDKanYRJR6W+tMM0dzPPOYYMvmauWkStXfOBA1kYxWecWMJAwDHV/T9+Xzh088kLDSmfmpx9b8Lw3qpDxqv7MCilmaFBJ/9aMmZYcY05VK78aFw2DrGXBdp2AymSLQDIEAynD9B4c3PKRnwwduqIV/ubc5N+Kgj9EnqQEhxIQ+iwyEHPJIm+WSxBMj7TV4NX+lVIiXyzURGCg/NjP3ijdNEAzH/FsjcX/dWn42CH2g+zMJ9Ju5bWyFDrnFQB6GMGSur4N6Bpzq5hwnVUBbW2kWq3CcXyV6QoMvgZwghk43Dtwgn17burlrHBPaGAlEQFDnN68Bku41NDvrQLsVVK2FZhzAcsqNYCpP/rCZA2tsGGAgIeSvRfZs3Pj0wUhdpZr028vo/cj4OaHJ+WvVIpdUbfeaKHg26KpMoU3P7cgaALeHIun2TPpcaskeE9ZSp0v9DPTjwoB4Cytx+xyV4FLxSKE9FeL9TDnZ3D+KoSA+yIRm52aGVOWEiBLVKXEoBHRdtDRoXbNcQ9XuwxMliBrhIBr8VgDGwxJZoI9TcCSo6wkHCmxUQOHV8Zz3MVVu9JVha2SBR6YjCjlrK/1tCUMwwf+WgDYrQGLlsC1VoDJFiHgoMLBSLsWgClSJOvAJdncd6hbYi0B08DzLVFTeB24g+F5t0G3rnAHgt72yLrC93LieO952ARHVDWXQQVuYbqaWQ2rLtrGVJmhEljR6pyRFqS1fIKS+LjB/JmuNQ7vlrMYUs1dxp3udRwrvdJV4GedJ3BDbl6yj1UFdgsJVNMbQp0mt5UQ67OXBLknwOO/OILi2KYQXN++Bez99F/XJvA75x+G9e7GEFzvfTnsf/Iv68CNKhFla50OujWtsD3fA2tyMPSpM3/eBSebCv0tPljBlkfCm9i9Q1kkNofXiF0fdJO/HEb++tYlvXmnGwYOpTF04lrov7oOPDFyGIUb7+sIuP9gBns+Fd6zXgdunen+7xT+z28OIPOn3R1ZYsujU9jxsbf/tx6m3pQMVxzGLhyFNdUycezOYd9n3wrBMeP23c+ue/hO0q7pOLwOfC/Sy1uvfwDZa9tC4g8Oz2L78X8vOTjviYeXpLrLDSsC3qqy2KZyjeYH3EnsKf92JTxLPvti9UOYkv233eefWKEqE52rWGSJFNx9pxbu9Wbge2/VvOYVru/Ar+UN7cb+8FosGTRrz35RpulhE+zrs1TjoKKMf5BuIzN1cTFYRcpwD6NOd2scxRIVZZqbN/q0la7sN6tIumTwjdlxXUWqCAIW6KeiTMtxxXnh4boTPoK4ZJxq84ZssQgvAEwl3HpVXyusK0kG2HNzk/mSEP0VJfS5NCosKjq7USuAU15lKYkbXa4i3czlwOkUQe0KAtfrzf2RqMVOZ6Z+VxD8w1RUJEtElV9JDx4Ipd8nXFtX+btxOULg7ay/d9eohDL/tFX9PCZB70qk3mQ/ys0M5T3nWlXKXqrYcyaRpFtrRw7qiPQyRa3Aso8JLevdqAg/mptHwW1uZ9XPYxIwiUc/GyLRyuH+LcO6d4KuCv5SRYojrpQDFIcjMLTp60dcdMJel6D1YM+y0MI3uUIg57n4RyGLoueGE/xar2SLHsO0NsXi13b1DDz5/H0Hxv8Lo3UyF0Y2DrcAAAAASUVORK5CYII=", + // symbolSize: [11, 16], + // symbolOffset: [0, "100%"], + // itemStyle: { + // color: "#25D9C8", + // }, + // tooltip: { + // show: false, + // }, + // lineStyle: { + // width: 0, + // }, + // z: 1, + // }); + } + + chart.setOption(option) + reslove(chart) + return chart + }) + }) + }, + handleRemark() { + app.mpBehavior({ doctor: true, PageName: 'BTN_DOCTORPATIENTDETAILREMARK' }) + this.setData({ + popupRemarkShow: true, + remark: this.data.detail.DoctorRemark, + }) + setTimeout(() => { + this.setData({ + remarkFocus: true, + }) + }, 300) + }, + handleRemarkClose() { + this.setData({ + popupRemarkShow: false, + remarkFocus: false, + remark: '', + }) + }, + handleRemarkSubmit() { + if (!this.data.remark) { + wx.showToast({ + icon: 'none', + title: '请输入备注', + }) + } + wx.ajax({ + method: 'POST', + url: '?r=igg4/doctor/patient/remark', + data: { + PatientId: this.data.id, + DoctorRemark: this.data.remark, + }, + }).then((_res) => { + this.handleRemarkClose() + this.getDetail() + }) + }, + + handleEditUser() { + app.mpBehavior({ doctor: true, PageName: 'BTN_DOCTORPATIENTDETAILEDIT' }) + this.setData({ + popupEditShow: true, + }) + }, + handleUserCancel() { + this.setData({ + popupEditShow: false, + }) + }, + handleUserSubmit() { + this.handleUserCancel() + this.handlePatientUpdate() + }, + handleRadio(e) { + const { id, key } = e.currentTarget.dataset + this.setData({ + [`detail.${key}`]: id, + }) + }, + handlePatientUpdate() { + const { detail } = this.data + wx.ajax({ + method: 'POST', + url: '?r=igg4/doctor/patient/update', + data: { + PatientId: detail.PatientId, //患者Id + AntibodyType: detail.AntibodyType, //抗体类型 1:AChR 2:Musk 3:LRP4 4:RYR + ThyroidAbnormal: detail.ThyroidAbnormal, //胸腺异常 1:是 2:否 + PreviousConvulsion: detail.PreviousConvulsion, //既往发生危象 1:是 2:否 + TraditionalImmunosuppressant: detail.TraditionalImmunosuppressant, //传统免疫抑制剂 1:特克莫苏 2:硫唑嘌呤 3:马替麦考酚酯 4:其他 + MedicalInsuranceType: detail.MedicalInsuranceType, //医保类型 1:城市职工 2:城市居民 3:新农合 + }, + }).then(() => { + wx.showToast({ + icon: 'none', + title: '更新成功', + }) + this.getDetail() + }) + }, + handleBack() { + wx.navigateBack() + }, + handleSend() { + app.mpBehavior({ doctor: true, PageName: 'BTN_DOCTORPATIENTDETAILMESSAGE' }) + wx.navigateTo({ + url: `/doctor/pages/d_interactiveDoctor/index?patientId=${this.data.detail.PatientId}`, + }) + }, + + handleNav(e, mp = true) { + const { index } = e.currentTarget.dataset + if (index == 0 && mp) { + app.mpBehavior({ doctor: true, PageName: 'BTN_DOCTORPATIENTDETAILREPORTGUIDE' }) + } + if (index == 1 && mp) { + app.mpBehavior({ doctor: true, PageName: 'BTN_DOCTORPATIENTDETAILNOTEGUIDE' }) + } + this.setData({ + nav: index, + }) + this.handleTypeChange({ detail: { value: '2' } }) + }, + getAdlList(newPage = 1) { + const { detail, EndDate, StartDate, type } = this.data + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/patient/adl-list', + data: { + DateType: type, + PatientId: detail.PatientId, + StartDate, + EndDate, + page: newPage, + }, + }).then((res) => { + res.list.map((item) => { + let grade = 1 + if (item.TotalScore < 5) { + grade = 1 + } else if (item.TotalScore >= 5 && item.TotalScore < 15) { + grade = 2 + } else { + grade = 3 + } + item.grade = grade + item.fold = false + return item + }) + + const adlList = res.page === 1 ? res.list : [...this.data.adlList, ...res.list] + this.setData({ + adlList, + pagination: { + page: res.page, + pages: res.pages, + count: res.count, + }, + }) + }) + }, + onReachBottom() { + const { page, pages } = this.data.pagination + const nav = this.data.nav + if (pages > page && nav === '1') { + this.getAdlList(page + 1) + } + }, + handleFold(e) { + const { index } = e.currentTarget.dataset + this.setData({ + [`adlList[${index}].fold`]: !this.data.adlList[index].fold, + }) + }, + handleAdlDetail() {}, + handleToastOk() { + this.setData({ + toastShow: false, + }) + }, + handleToastCancel() { + wx.navigateBack() + }, + handleToggleTel() { + console.log(11111) + this.setData({ + showTel: !this.data.showTel, + }) + }, +}) diff --git a/src/doctor/pages/d_patientDetail/index.wxml b/src/doctor/pages/d_patientDetail/index.wxml new file mode 100644 index 0000000..f569423 --- /dev/null +++ b/src/doctor/pages/d_patientDetail/index.wxml @@ -0,0 +1,588 @@ + + + + + + 本页面内容涉及患者个人信息 + 仅用于{{hospital.Name}}{{doctor.Name}}医生进行患者随访管理 + 不可用于其他用途 + 【gMG给力加油站】 + + + + 双达标测评报告 + 双达标笔记 + + + + {{typeName}} + + + + + {{StartDate}} + + ~ + + {{EndDate}} + + + + + + + + + + + + + 备注 + + 保存 + + + + + + 编辑患者信息 + + + + 抗体类型 + + + + + {{item.value}} + + + + + + + 胸腺异常 + + + + + {{item.value}} + + + + + + + 既往发生危象 + + + + + {{item.value}} + + + + + + + 传统免疫抑制剂 + + + + + {{item.value}} + + + + + + + 医保类型 + + + + + {{item.value}} + + + + + + + 取消 + 保存 + + + + + diff --git a/src/doctor/pages/d_patientList/index.json b/src/doctor/pages/d_patientList/index.json new file mode 100644 index 0000000..15fca3b --- /dev/null +++ b/src/doctor/pages/d_patientList/index.json @@ -0,0 +1,9 @@ +{ + "navigationStyle": "custom", + "usingComponents": { + "tabbar": "../../components/tabbar/index", + "navBar": "/components/navBar/navBar", + "van-icon": "@vant/weapp/icon/index", + "van-popup": "@vant/weapp/popup/index" + } +} diff --git a/src/doctor/pages/d_patientList/index.scss b/src/doctor/pages/d_patientList/index.scss new file mode 100644 index 0000000..bd99b73 --- /dev/null +++ b/src/doctor/pages/d_patientList/index.scss @@ -0,0 +1,356 @@ +page { + background-color: rgba(242, 244, 245, 1); + padding-bottom: calc(140rpx + env(safe-area-inset-bottom)); +} + +.page { + min-height: 100vh; + + .page-header { + position: sticky; + top: 0; + padding: 30rpx; + box-shadow: 0rpx 8rpx 16rpx 0rpx rgba(40, 48, 49, 0.04); + border-radius: 0 0 32rpx 32rpx; + z-index: 10; + + .search { + padding: 18rpx 32rpx; + display: flex; + align-items: center; + gap: 16rpx; + background: linear-gradient(to top, #ffffff 0%, #ebf3f4 100%); + box-shadow: 0rpx 8rpx 8rpx 0rpx rgba(40, 48, 49, 0.04); + border-radius: 140rpx 140rpx 140rpx 140rpx; + border: 2rpx solid #ffffff; + + .icon { + width: 40rpx; + height: 40rpx; + } + + .input { + flex: 1; + font-size: 28rpx; + } + + .input-place { + color: rgba(173, 179, 180, 1); + } + } + .navbar { + margin-top: 32rpx; + display: flex; + justify-content: space-between; + align-items: center; + .nav { + position: relative; + flex: 1; + text-align: center; + font-size: 32rpx; + color: rgba(103, 113, 114, 1); + transition: all 0.3s; + .dot { + padding: 0 4rpx; + position: absolute; + left: 50%; + transform: translateX(35rpx); + top: 0; + min-width: 18rpx; + height: 26rpx; + font-size: 18rpx; + line-height: 26rpx; + color: rgba(255, 255, 255, 1); + border-radius: 50%; + background: rgba(215, 108, 108, 1); + } + &.active { + font-size: 32rpx; + color: rgba(98, 190, 208, 1); + font-weight: bold; + &::after { + position: absolute; + bottom: -30rpx; + left: 50%; + transform: translateX(-50%); + content: ''; + width: 52rpx; + height: 8rpx; + border-radius: 24rpx 24rpx 0 0; + background: #62bed0; + } + } + } + } + } + + .total-line { + padding: 34rpx 30rpx 0; + display: flex; + justify-content: space-between; + align-items: center; + + .wrap { + display: flex; + align-items: center; + gap: 20rpx; + + .user { + font-size: 32rpx; + color: rgba(154, 161, 162, 1); + + .num { + margin-left: 10rpx; + color: rgba(43, 160, 184, 1); + } + } + + .message { + font-size: 32rpx; + color: rgba(43, 160, 184, 1); + } + } + .data-tip { + font-size: 24rpx; + color: rgba(154, 161, 162, 1); + } + } + + .list { + margin: 0 30rpx; + + .list-item { + margin-top: 24rpx; + padding: 36rpx 34rpx; + background: #ffffff; + border-radius: 24rpx 24rpx 24rpx 24rpx; + display: flex; + .avatar { + flex-shrink: 0; + .avatar-img { + width: 100rpx; + height: 100rpx; + border-radius: 50%; + } + } + .container { + flex: 1; + padding-left: 20rpx; + .title { + display: flex; + align-items: center; + justify-content: space-between; + .name { + font-size: 32rpx; + color: #283031; + font-weight: bold; + } + .send { + padding: 8rpx 22rpx; + font-size: 24rpx; + color: #67baca; + line-height: 1; + border-radius: 32rpx 32rpx 32rpx 32rpx; + border: 2rpx solid rgba(103, 186, 202, 0.26); + display: flex; + align-items: center; + gap: 8rpx; + .icon { + width: 28rpx; + height: 28rpx; + } + } + } + .tags { + margin-top: 16rpx; + display: flex; + flex-wrap: wrap; + gap: 12rpx; + .tag { + padding: 4rpx 16rpx; + font-size: 22rpx; + color: #e59a29; + line-height: 28rpx; + background: #fff5df; + border-radius: 8rpx 8rpx 8rpx 8rpx; + } + } + .content { + margin-top: 24rpx; + display: flex; + align-items: center; + flex-wrap: wrap; + font-size: 28rpx; + color: #283031; + gap: 14rpx; + .line { + flex-shrink: 0; + width: 2rpx; + height: 32rpx; + background-color: #eaeced; + } + .blod { + font-weight: bold; + } + &.disable { + color: #9aa1a2; + } + } + .replay-date { + margin-top: 16rpx; + font-size: 28rpx; + color: #9aa1a2; + } + } + } + } +} + +.popup { + padding: 92rpx 30rpx calc(30rpx + env(safe-area-inset-bottom)); + + .form { + max-height: 60vh; + overflow-y: auto; + overflow-x: hidden; + + .form-item { + margin-bottom: 48rpx; + + .f-title { + font-size: 36rpx; + color: rgba(40, 48, 49, 1); + font-weight: bold; + } + + .select { + margin-top: 24rpx; + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 16rpx; + + .s-item { + padding: 18rpx 0; + text-align: center; + border-radius: 12rpx; + font-size: 28rpx; + color: rgba(103, 113, 114, 1); + background: #f2f4f5; + + &.active { + color: #fff; + background-color: rgba(103, 186, 202, 1); + } + } + } + + .custom { + margin-top: 16rpx; + display: flex; + align-items: center; + gap: 12rpx; + + .c-item { + padding: 18rpx 24rpx; + display: flex; + align-items: center; + font-size: 32rpx; + color: rgba(103, 113, 114, 1); + border-radius: 12rpx; + background-color: rgba(242, 244, 245, 1); + + .input { + padding: 0; + margin: 0; + width: 3em; + font-size: 32rpx; + line-height: 1; + } + + .input-place { + color: rgba(194, 201, 202, 1); + line-height: 1; + } + } + } + + .date { + margin-top: 24rpx; + display: flex; + align-items: center; + justify-content: space-between; + + .picker { + flex: 1; + + .d-item { + flex: 1; + display: flex; + align-items: center; + justify-content: space-between; + padding: 18rpx 32rpx; + background: #f7f8f9; + border-radius: 12rpx 12rpx 12rpx 12rpx; + + .icon { + width: 32rpx; + height: 32rpx; + } + + .content { + font-size: 32rpx; + color: #677172; + + &:empty::after { + content: attr(data-place); + color: rgba(194, 201, 202, 1); + } + } + } + } + + .sion { + flex-shrink: 0; + margin: 0 14rpx; + font-size: 32rpx; + color: #677172; + } + } + } + } + + .p-footer { + margin-top: 32rpx; + display: flex; + justify-content: space-between; + align-items: center; + gap: 26rpx; + + .reset { + flex: 1; + height: 84rpx; + font-size: 36rpx; + color: rgba(103, 186, 202, 1); + display: flex; + justify-content: center; + align-items: center; + box-sizing: border-box; + background: #ffffff; + border-radius: 98rpx 98rpx 98rpx 98rpx; + border: 2rpx solid #67baca; + } + + .submit { + flex: 1; + height: 84rpx; + font-size: 36rpx; + color: #ffffff; + display: flex; + justify-content: center; + align-items: center; + box-sizing: border-box; + background: rgba(103, 186, 202, 1); + border-radius: 98rpx 98rpx 98rpx 98rpx; + } + } +} diff --git a/src/doctor/pages/d_patientList/index.ts b/src/doctor/pages/d_patientList/index.ts new file mode 100644 index 0000000..ddfcfec --- /dev/null +++ b/src/doctor/pages/d_patientList/index.ts @@ -0,0 +1,98 @@ +import dayjs from 'dayjs' + +const app = getApp() + +Page({ + data: { + active: 0, + + statType: '', + navTitle: '', + + list: [] as any[], + total: 0, + pagination: { + page: 1, + pages: 1, + count: 1, + }, + }, + onLoad(options) { + this.setData({ + statType: options.type, + navTitle: options.name || '患者列表', + }) + app.waitLogin().then((_res) => { + this.getList() + }) + }, + handleReset() { + this.getList() + }, + handleSearch() { + this.getList() + }, + getList(newPage = 1) { + const params = { + statType: this.data.statType, + } + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/patient/get-stat-patient-list', + data: { + page: newPage, + ...params, + }, + }).then((res) => { + res.list.forEach((item) => { + if (item.LastAdlTime) { + item.LastAdlTimeName = dayjs(item.LastAdlTime).from(dayjs().format('YYYY-MM-DD')).replace(' ', '') + } + }) + const list = res.page === 1 ? res.list : [...this.data.list, ...res.list] + this.setData({ + total: res.count, + list, + pagination: { + page: res.page, + pages: res.pages, + count: res.count, + }, + }) + }) + }, + onReachBottom() { + const { page, pages } = this.data.pagination + if (pages > page) { + this.getList(page + 1) + } + }, + handleDetail(e: any) { + const { index } = e.currentTarget.dataset + const item = this.data.list[index] + + wx.navigateTo({ + url: `/doctor/pages/d_patientDetail/index?id=${item.PatientId}`, + }) + }, + handleSend(e) { + const { index } = e.currentTarget.dataset + wx.navigateTo({ + url: `/doctor/pages/d_interactiveDoctor/index?patientId=${this.data.list[index].PatientId}`, + }) + }, + handleSendGroup() { + wx.navigateTo({ + url: '/doctor/pages/d_taskList/index', + }) + }, + onShareAppMessage() { + return { + title: '重症肌无力加油站,重拾生活掌控感!', + path: '/doctor/pages/d_patient/index', + } + }, + handleBack() { + wx.navigateBack() + }, +}) diff --git a/src/doctor/pages/d_patientList/index.wxml b/src/doctor/pages/d_patientList/index.wxml new file mode 100644 index 0000000..38974f6 --- /dev/null +++ b/src/doctor/pages/d_patientList/index.wxml @@ -0,0 +1,192 @@ + + + + + + + 患者数: + {{total}} + + + 实时统计数据 + + + + + + + + + {{item.Name}} + + + 消息 + + + + 最近一次ADL:{{item.LastAdlTimeName}} + 需随访 + + + + ADL评分: + {{item.AdlScore}} + 分 + + + + 激素用量: + {{item.SteroidDailyDose}} + mg/d + + + 无ADL记录 + 复诊时间:{{item.LastReVisitDate}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/doctor/pages/d_patientList/index.wxs b/src/doctor/pages/d_patientList/index.wxs new file mode 100644 index 0000000..fe90f39 --- /dev/null +++ b/src/doctor/pages/d_patientList/index.wxs @@ -0,0 +1,12 @@ +function include(value, arr) { + for (var i = 0; i < arr.length; i++) { + if (arr[i] === value) { + return true + } + } + return false +} + +module.exports = { + include: include, +} diff --git a/src/doctor/pages/d_taskDetail/index.json b/src/doctor/pages/d_taskDetail/index.json new file mode 100644 index 0000000..e967311 --- /dev/null +++ b/src/doctor/pages/d_taskDetail/index.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "任务详情", + "usingComponents": {} +} diff --git a/src/doctor/pages/d_taskDetail/index.scss b/src/doctor/pages/d_taskDetail/index.scss new file mode 100644 index 0000000..830050c --- /dev/null +++ b/src/doctor/pages/d_taskDetail/index.scss @@ -0,0 +1,205 @@ +page { + background-color: rgba(242, 244, 245, 1); + padding-bottom: 200rpx; +} + +.page { + .page-header { + padding: 30rpx 30rpx 48rpx; + background-color: #fff; + border-radius: 0 0 32rpx 32rpx; + + .status-line { + display: flex; + justify-content: space-between; + align-items: center; + + .id { + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + font-weight: bold; + } + + .status { + font-size: 32rpx; + color: rgba(154, 161, 162, 1); + + &.status1 { + color: rgba(215, 108, 108, 1); + } + + &.status2 { + color: rgba(229, 154, 41, 1); + } + + &.status4 { + color: rgba(103, 186, 202, 1); + } + + &.status5 { + color: rgba(154, 161, 162, 1); + } + + &.status6 { + color: rgba(154, 161, 162, 1); + } + } + } + + .row-line { + margin: 32rpx 0; + height: 1rpx; + background-color: rgba(242, 244, 245, 1); + } + + .row { + display: flex; + align-items: center; + gap: 24rpx; + line-height: 1; + + &:last-of-type { + margin-top: 32rpx; + } + + .label { + font-size: 32rpx; + color: rgba(173, 179, 180, 1); + } + + .content { + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + } + } + } + + .card { + margin: 32rpx 30rpx 0; + padding: 32rpx 0; + border-radius: 24rpx; + background-color: #fff; + + .c-title { + display: flex; + align-items: center; + font-size: 36rpx; + color: rgba(40, 48, 49, 1); + font-weight: bold; + gap: 6rpx; + + &:not(:first-of-type) { + margin-top: 50rpx; + } + + .icon { + width: 22rpx; + height: 34rpx; + } + } + + .c-wrap { + &:empty::after { + padding: 32rpx; + display: block; + content: '无'; + } + .row { + display: flex; + margin: 32rpx 30rpx 0; + + .label { + margin-right: 20rpx; + font-size: 32rpx; + flex-shrink: 0; + color: rgba(173, 179, 180, 1); + } + } + } + + .c-prominent { + margin: 32rpx 30rpx 0; + padding: 30rpx; + background: #ffffff; + box-shadow: 0rpx 8rpx 32rpx 0rpx rgba(40, 48, 49, 0.04); + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2rpx solid #f8f9f9; + + .title { + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + } + + .wrap { + margin-top: 32rpx; + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 32rpx; + line-height: 1; + + .item { + display: flex; + align-items: center; + + .label { + width: 5em; + font-size: 32rpx; + color: rgba(173, 179, 180, 1); + } + + .content { + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + + &.success { + color: rgba(98, 190, 208, 1); + } + + &.warn { + color: rgba(215, 108, 108, 1); + } + } + } + } + } + } + + .p-footer { + position: fixed; + bottom: 0; + left: 0; + width: 100%; + box-sizing: border-box; + padding: 20rpx 30rpx 68rpx; + background-color: #fff; + display: flex; + justify-content: center; + gap: 24rpx; + box-shadow: 0rpx 4rpx 32rpx 0rpx rgba(0, 0, 0, 0.15); + + .copy-btn { + width: 332rpx; + height: 84rpx; + background: #ffffff; + border-radius: 98rpx 98rpx 98rpx 98rpx; + border: 2rpx solid #67baca; + display: flex; + align-items: center; + justify-content: center; + font-size: 36rpx; + color: rgba(103, 186, 202, 1); + } + .btn { + width: 332rpx; + height: 84rpx; + color: #fff; + background: #67BACA; + border-radius: 98rpx 98rpx 98rpx 98rpx; + border: 2rpx solid #67baca; + display: flex; + align-items: center; + justify-content: center; + font-size: 36rpx; + } + } +} diff --git a/src/doctor/pages/d_taskDetail/index.ts b/src/doctor/pages/d_taskDetail/index.ts new file mode 100644 index 0000000..11c1915 --- /dev/null +++ b/src/doctor/pages/d_taskDetail/index.ts @@ -0,0 +1,188 @@ +import dayjs from 'dayjs' +import { filterObjs } from '@/utils/doctorPatientTask' + +const app = getApp() + +Page({ + data: { + id: '', + detail: { + SendDetail: {}, + } as any, + Status: { + 1: '待发送', + 2: '发送中', + 4: '已发送', + 5: '已停止', + 6: '已取消', + }, + + templateObj: {}, + + ...filterObjs, + }, + onLoad(options) { + this.setData({ + id: options.id, + }) + app.waitLogin().then(() => { + this.getTemplate() + this.getDetail() + }) + }, + getTemplate() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/task/get-template', + data: {}, + }).then((res) => { + const templateObj = {} + res.forEach((item) => { + templateObj[item.TemplateType] = item.TemplateTypeText + }) + this.setData({ + templateObj, + }) + }) + }, + getDetail() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/task/detail', + data: { + TaskId: this.data.id, + }, + }).then((res) => { + if (typeof res.FilterCondition.AdlScore === 'string') { + res.FilterCondition.AdlScore = res.FilterCondition.AdlScore?.split('-') + .map((item) => Number(item)) + .filter((item) => Boolean(item)) + } else { + res.FilterCondition.AdlScore = [] + } + if (typeof res.FilterCondition.AdlScoreChange === 'string') { + res.FilterCondition.AdlScoreChange = res.FilterCondition.AdlScoreChange?.split('-') + .map((item) => Number(item)) + .filter((item) => Boolean(item)) + } else { + res.FilterCondition.AdlScoreChange = [] + } + if (typeof res.FilterCondition.SteroidDailyDose === 'string') { + res.FilterCondition.SteroidDailyDose = res.FilterCondition.SteroidDailyDose?.split('-') + .map((item) => Number(item)) + .filter((item) => Boolean(item)) + } else { + res.FilterCondition.SteroidDailyDose = [] + } + if (typeof res.FilterCondition.SteroidDailyDoseChange === 'string') { + res.FilterCondition.SteroidDailyDoseChange = res.FilterCondition.SteroidDailyDoseChange?.split('-') + .map((item) => Number(item)) + .filter((item) => Boolean(item)) + } else { + res.FilterCondition.SteroidDailyDoseChange = [] + } + if (res.CreateTime) { + res.CreateTime = dayjs(res.CreateTime).format('YYYY-MM-DD HH:mm') + } + if (res.SendTime) { + res.SendTime = dayjs(res.SendTime).format('YYYY-MM-DD HH:mm') + } + this.setData({ + detail: res, + }) + }) + }, + handleCopy() { + const { FilterCondition } = this.data.detail + wx.navigateTo({ + url: '/doctor/pages/d_createTask/index', + success: (res) => { + res.eventChannel.emit('FilterCondition', { + Search: FilterCondition.Search, + HasAdl: FilterCondition.HasAdl, + DoubleStandard: FilterCondition.DoubleStandard, + AdlTime: FilterCondition.AdlTime, + AdlScore: FilterCondition.AdlScore.filter((item) => Boolean(item)), + AdlScoreChange: FilterCondition.AdlScoreChange.filter((item) => Boolean(item)), + AdlScoreChangeType: FilterCondition.AdlScoreChangeType, + AdlScoreChangeMax: FilterCondition.AdlScoreChangeMax, + AdlScoreChangeMin: FilterCondition.AdlScoreChangeMin, + SteroidDailyDose: FilterCondition.SteroidDailyDose.filter((item) => Boolean(item)), + SteroidDailyDoseChange: FilterCondition.SteroidDailyDoseChange.filter((item) => Boolean(item)), + IsThisWeekAdl: FilterCondition.IsThisWeekAdl, + PharyngealSymptoms: FilterCondition.PharyngealSymptoms, + AntibodyType: FilterCondition.AntibodyType, + ThyroidAbnormal: FilterCondition.ThyroidAbnormal, + PreviousConvulsion: FilterCondition.PreviousConvulsion, + TraditionalImmunosuppressant: FilterCondition.TraditionalImmunosuppressant, + MedicalInsuranceType: FilterCondition.MedicalInsuranceType, + BindStartDate: FilterCondition.BindStartDate, + BindEndDate: FilterCondition.BindEndDate, + }) + }, + }) + }, + handleCancelSend() { + const { detail } = this.data + const { Id } = detail + wx.showModal({ + title: '确认取消发送?', + confirmColor: '#62bed0', + success: (res) => { + if (res.confirm) { + wx.ajax({ + method: 'POST', + url: '?r=igg4/doctor/task/cancel', + data: { + TaskId: Id, + }, + }).then(() => { + this.getDetail() + }) + } + }, + }) + }, + handleStopSend() { + const { detail } = this.data + const { Id } = detail + wx.showModal({ + title: '确认停止发送?', + confirmColor: '#62bed0', + success: (res) => { + if (res.confirm) { + wx.ajax({ + method: 'POST', + url: '?r=igg4/doctor/task/stop', + data: { + TaskId: Id, + }, + }).then(() => { + this.getDetail() + }) + } + }, + }) + }, + handleDelSend() { + const { detail } = this.data + const { Id } = detail + wx.showModal({ + title: '确认删除?', + confirmColor: '#62bed0', + success: (res) => { + if (res.confirm) { + wx.ajax({ + method: 'POST', + url: '?r=igg4/doctor/task/delete', + data: { + TaskId: Id, + }, + }).then(() => { + wx.navigateBack() + }) + } + }, + }) + }, +}) diff --git a/src/doctor/pages/d_taskDetail/index.wxml b/src/doctor/pages/d_taskDetail/index.wxml new file mode 100644 index 0000000..7619770 --- /dev/null +++ b/src/doctor/pages/d_taskDetail/index.wxml @@ -0,0 +1,195 @@ + + + + ID:{{detail.IdNumber}} + {{Status[detail.Status]}} + + + + 创建时间 + {{detail.CreateTime}} + + + 发布时间 + {{detail.SendTime}} + + + + + + + 筛选患者 + + + + 搜索 + {{detail.FilterCondition.Search}} + + + 绑定时间 + {{detail.FilterCondition.BindStartDate}}~{{detail.FilterCondition.BindEndDate}} + + + 本周ADL测评 + {{IsThisWeekAdlObj[detail.FilterCondition.IsThisWeekAdl]}} + + + 是否有ADL测评 + {{HasAdlObj[detail.FilterCondition.HasAdl]}} + + + ADL测评间隔时长 + {{AdlTimeObj[detail.FilterCondition.AdlTime]}} + + + 是否双达标 + {{DoubleStandardObj[detail.FilterCondition.DoubleStandard]}} + + + ADL评分(多选) + + + {{AdlScorceObj[subItem]}}{{index < detail.FilterCondition.AdlScore.length - 1 ? ',' : ''}} + + + + + ADL分数变化(多选) + + + {{AdlScoreChangeObj[subItem]}}{{index < detail.FilterCondition.AdlScoreChange.length - 1 ? ',' : ''}} + + + + {{AdlScoreChangeTypeObj[detail.FilterCondition.AdlScoreChangeType]}} + + + ({{detail.FilterCondition.AdlScoreChangeMin}}-{{detail.FilterCondition.AdlScoreChangeMax}}) + + + + + + 激素用量(多选) + + + {{SteroidDailyDoseObj[subItem]}}{{index < detail.FilterCondition.SteroidDailyDose.length - 1 ? ',' : ''}} + + + + + 激素变化(多选) + + + {{SteroidDailyDoseChangeObj[subItem]}}{{index < detail.FilterCondition.SteroidDailyDoseChange.length - 1 ? + ',' : ''}} + + + + + 延髓症状 + {{PharyngealSymptomsObj[detail.FilterCondition.PharyngealSymptoms]}} + + + 抗体类型 + {{AntibodyTypeObj[detail.FilterCondition.AntibodyType]}} + + + 胸腺异常 + {{ThyroidAbnormalObj[detail.FilterCondition.ThyroidAbnormal]}} + + + 既往发生危象 + {{PreviousConvulsionObj[detail.FilterCondition.PreviousConvulsion]}} + + + 传统免疫抑制剂 + + {{TraditionalImmunosuppressantObj[detail.FilterCondition.TraditionalImmunosuppressant]}} + + + + 医保类型 + {{MedicalInsuranceTypeObj[detail.FilterCondition.MedicalInsuranceType]}} + + + + + 消息内容 + + + + 消息标题 + {{templateObj[detail.TemplateType]}} + + + 消息内容 + {{detail.InteractMsgContent}} + + + + + 发送时间 + + + + 发布时间 + {{detail.SendTime}} + + + + + + + 发送结果 + + + 小程序互动消息 + + + 发送成功 + {{detail.SendDetail.InteractSendSuccessCount}}人 + + + 发送失败 + {{detail.SendDetail.InteractSendFailCount}}人 + + + 已读 + {{detail.SendDetail.InteractReadCount}}人 + + + 未读 + {{detail.SendDetail.InteractUnReadCount}}人 + + + + + 公众号消息 + + + 发送成功 + {{detail.SendDetail.PushSendSuccessCount}}人 + + + 发送失败 + {{detail.SendDetail.PushSendFailCount}}人 + + + 点击 + {{detail.SendDetail.PushClickCount}}人 + + + 未点击 + {{detail.SendDetail.PushUnClickCount}}人 + + + + + + 复制 + 取消发送 + 停止发送 + 删除 + + diff --git a/src/doctor/pages/d_taskList/index.json b/src/doctor/pages/d_taskList/index.json new file mode 100644 index 0000000..ea9f53c --- /dev/null +++ b/src/doctor/pages/d_taskList/index.json @@ -0,0 +1,6 @@ +{ + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/navBar/navBar" + } +} diff --git a/src/doctor/pages/d_taskList/index.scss b/src/doctor/pages/d_taskList/index.scss new file mode 100644 index 0000000..03ad008 --- /dev/null +++ b/src/doctor/pages/d_taskList/index.scss @@ -0,0 +1,173 @@ +page { + background: #f2f4f5; +} + +.page { + padding-bottom: 300rpx; + .card { + margin: 30rpx; + padding: 32rpx 30rpx; + background-color: #fff; + border-radius: 24rpx; + + .c-header { + padding-bottom: 32rpx; + display: flex; + align-items: center; + justify-content: space-between; + align-items: center; + border-bottom: 1px solid rgba(242, 244, 245, 1); + + .id { + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + } + + .status { + font-size: 32rpx; + color: rgba(154, 161, 162, 1); + + &.status1 { + color: rgba(215, 108, 108, 1); + } + + &.status2 { + color: rgba(229, 154, 41, 1); + } + + &.status4 { + color: rgba(103, 186, 202, 1); + } + + &.status5 { + color: rgba(154, 161, 162, 1); + } + + &.status6 { + color: rgba(154, 161, 162, 1); + } + } + } + + .c-container { + padding-bottom: 32rpx; + + .row { + margin-top: 32rpx; + display: flex; + + .label { + flex-shrink: 0; + width: 5em; + font-size: 32rpx; + color: rgba(173, 179, 180, 1); + } + + .content { + flex: 1; + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + + &:empty::after { + display: block; + content: '无'; + } + + .icon { + margin-left: 10rpx; + width: 32rpx; + height: 32rpx; + vertical-align: -4rpx; + } + + .f-row { + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + line-height: 52rpx; + + .f-label { + display: inline-block; + } + + .f-content { + display: inline; + } + } + } + } + } + + .c-footer { + padding: 40rpx 0 0; + border-top: 1px solid rgba(242, 244, 245, 1); + display: flex; + gap: 28rpx; + align-items: center; + justify-content: space-between; + + .total { + font-size: 32rpx; + color: rgba(173, 179, 180, 1); + + .num { + color: rgba(103, 186, 202, 1); + font-weight: bold; + } + } + + .options { + flex: 1; + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 16rpx; + flex-direction: row-reverse; + direction: rtl; + + .copy { + padding: 12rpx 30rpx; + font-size: 32rpx; + display: flex; + align-items: center; + justify-content: center; + color: rgba(103, 186, 202, 1); + border-radius: 88rpx 88rpx 88rpx 88rpx; + border: 1rpx solid #67baca; + } + + .send { + font-size: 32rpx; + display: flex; + align-items: center; + justify-content: center; + color: rgba(40, 48, 49, 1); + border-radius: 88rpx 88rpx 88rpx 88rpx; + border: 1rpx solid rgba(39, 58, 101, 0.15); + } + + .del { + font-size: 32rpx; + display: flex; + align-items: center; + justify-content: center; + color: rgba(40, 48, 49, 1); + border-radius: 88rpx 88rpx 88rpx 88rpx; + border: 1rpx solid rgba(39, 58, 101, 0.15); + } + } + } + } + + .create { + position: fixed; + bottom: 100rpx; + left: 50%; + transform: translateX(-50%); + width: 178rpx; + height: 178rpx; + + .icon { + width: 100%; + height: 100%; + } + } +} diff --git a/src/doctor/pages/d_taskList/index.ts b/src/doctor/pages/d_taskList/index.ts new file mode 100644 index 0000000..498ed15 --- /dev/null +++ b/src/doctor/pages/d_taskList/index.ts @@ -0,0 +1,222 @@ +import dayjs from 'dayjs' +import { filterObjs } from '@/utils/doctorPatientTask' + +const app = getApp() + +Page({ + data: { + list: [] as any[], + pagination: { + page: 1, + pages: 1, + count: 1, + }, + Status: { + 1: '待发送', + 2: '发送中', + 4: '已发送', + 5: '已停止', + 6: '已取消', + }, + ...filterObjs, + }, + onLoad() { + const SystemInfo = app.globalSystemInfo + if (SystemInfo) { + const { top, bottom } = SystemInfo.capsulePosition + this.setData({ + top, + bottom, + }) + } + }, + onShow() { + app.waitLogin().then(() => { + app.mpBehavior({ doctor: true, PageName: 'PG_MASSMESSAGETASKLIST' }) + this.getList() + }) + }, + getList(newPage = 1) { + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/task/list', + data: { + page: newPage, + }, + }).then((res) => { + res.list.forEach((item) => { + if (typeof item.FilterCondition.AdlScore === 'string') { + item.FilterCondition.AdlScore = item.FilterCondition.AdlScore?.split('-') + .map((item) => Number(item)) + .filter((item) => Boolean(item)) + } else { + item.FilterCondition.AdlScore = [] + } + if (typeof item.FilterCondition.AdlScoreChange === 'string') { + item.FilterCondition.AdlScoreChange = item.FilterCondition.AdlScoreChange?.split('-') + .map((item) => Number(item)) + .filter((item) => Boolean(item)) + } else { + item.FilterCondition.AdlScoreChange = [] + } + if (typeof item.FilterCondition.SteroidDailyDose === 'string') { + item.FilterCondition.SteroidDailyDose = item.FilterCondition.SteroidDailyDose?.split('-') + .map((item) => Number(item)) + .filter((item) => Boolean(item)) + } else { + item.FilterCondition.SteroidDailyDose = [] + } + if (typeof item.FilterCondition.SteroidDailyDoseChange === 'string') { + item.FilterCondition.SteroidDailyDoseChange = item.FilterCondition.SteroidDailyDoseChange?.split('-') + .map((item) => Number(item)) + .filter((item) => Boolean(item)) + } else { + item.FilterCondition.SteroidDailyDoseChange = [] + } + + if (item.CreateTime) { + item.CreateTime = dayjs(item.CreateTime).format('YYYY-MM-DD HH:mm') + } + if (item.SendTime) { + item.SendTime = dayjs(item.SendTime).format('YYYY-MM-DD HH:mm') + } + }) + const list = res.page === 1 ? res.list : [...this.data.list, ...res.list] + this.setData({ + list, + pagination: { + page: res.page, + pages: res.pages, + count: res.count, + }, + }) + }) + }, + onReachBottom() { + const { page, pages } = this.data.pagination + if (pages > page) { + this.getList(page + 1) + } + }, + handleRouter(e) { + const { url } = e.currentTarget.dataset + wx.navigateTo({ + url, + }) + }, + handleCreate() { + app.mpBehavior({ doctor: true, PageName: 'BTN_MASSMESSAGETASKLISTADD' }) + wx.navigateTo({ + url: '/doctor/pages/d_createTask/index', + }) + }, + handleDetail(e) { + app.mpBehavior({ doctor: true, PageName: 'BTN_MASSMESSAGETASKLISTTASK' }) + const { id } = e.currentTarget.dataset + wx.navigateTo({ + url: `/doctor/pages/d_taskDetail/index?id=${id}`, + }) + }, + + handleCopy(e) { + const { index } = e.currentTarget.dataset + const { list } = this.data + const { FilterCondition } = list[index] + wx.navigateTo({ + url: '/doctor/pages/d_createTask/index', + success: (res) => { + res.eventChannel.emit('FilterCondition', { + Search: FilterCondition.Search, + HasAdl: FilterCondition.HasAdl, + DoubleStandard: FilterCondition.DoubleStandard, + AdlTime: FilterCondition.AdlTime, + AdlScore: FilterCondition.AdlScore.filter((item) => Boolean(item)), + AdlScoreChange: FilterCondition.AdlScoreChange.filter((item) => Boolean(item)), + AdlScoreChangeType: FilterCondition.AdlScoreChangeType, + AdlScoreChangeMax: FilterCondition.AdlScoreChangeMax, + AdlScoreChangeMin: FilterCondition.AdlScoreChangeMin, + SteroidDailyDose: FilterCondition.SteroidDailyDose.filter((item) => Boolean(item)), + SteroidDailyDoseChange: FilterCondition.SteroidDailyDoseChange.filter((item) => Boolean(item)), + IsThisWeekAdl: FilterCondition.IsThisWeekAdl, + PharyngealSymptoms: FilterCondition.PharyngealSymptoms, + AntibodyType: FilterCondition.AntibodyType, + ThyroidAbnormal: FilterCondition.ThyroidAbnormal, + PreviousConvulsion: FilterCondition.PreviousConvulsion, + TraditionalImmunosuppressant: FilterCondition.TraditionalImmunosuppressant, + MedicalInsuranceType: FilterCondition.MedicalInsuranceType, + BindStartDate: FilterCondition.BindStartDate, + BindEndDate: FilterCondition.BindEndDate, + }) + }, + }) + }, + handleCancelSend(e) { + const { index } = e.currentTarget.dataset + const { list } = this.data + const { Id } = list[index] + wx.showModal({ + title: '确认取消发送?', + confirmColor: '#62bed0', + success: (res) => { + if (res.confirm) { + wx.ajax({ + method: 'POST', + url: '?r=igg4/doctor/task/cancel', + data: { + TaskId: Id, + }, + }).then(() => { + this.getList() + }) + } + }, + }) + }, + handleStopSend(e) { + const { index } = e.currentTarget.dataset + const { list } = this.data + const { Id } = list[index] + wx.showModal({ + title: '确认停止发送?', + confirmColor: '#62bed0', + success: (res) => { + if (res.confirm) { + wx.ajax({ + method: 'POST', + url: '?r=igg4/doctor/task/stop', + data: { + TaskId: Id, + }, + }).then(() => { + this.getList() + }) + } + }, + }) + }, + handleDelSend(e) { + const { index } = e.currentTarget.dataset + const { list } = this.data + const { Id } = list[index] + wx.showModal({ + title: '确认删除?', + confirmColor: '#62bed0', + success: (res) => { + if (res.confirm) { + wx.ajax({ + method: 'POST', + url: '?r=igg4/doctor/task/delete', + data: { + TaskId: Id, + }, + }).then(() => { + this.getList() + }) + } + }, + }) + }, + handleBack() { + wx.navigateBack() + }, +}) diff --git a/src/doctor/pages/d_taskList/index.wxml b/src/doctor/pages/d_taskList/index.wxml new file mode 100644 index 0000000..c76ab25 --- /dev/null +++ b/src/doctor/pages/d_taskList/index.wxml @@ -0,0 +1,143 @@ + + + + + ID:{{item.IdNumber}} + {{Status[item.Status]}} + + + + 创建时间 + {{item.CreateTime}} + + + 发布时间 + + {{item.SendTime}} + + + + + 筛选条件 + + + 搜索: + {{item.FilterCondition.Search}} + + + 绑定时间: + {{item.FilterCondition.BindStartDate || '---'}}~{{item.FilterCondition.BindEndDate || '---'}} + + + 本周ADL测评: + {{IsThisWeekAdlObj[item.FilterCondition.IsThisWeekAdl]}} + + + 是否有ADL测评: + {{HasAdlObj[item.FilterCondition.HasAdl]}} + + + ADL测评间隔时长: + {{AdlTimeObj[item.FilterCondition.AdlTime]}} + + + 是否双达标: + {{DoubleStandardObj[item.FilterCondition.DoubleStandard]}} + + + ADL评分(多选): + + + {{AdlScorceObj[subItem]}}{{index < item.FilterCondition.AdlScore.length - 1 ? ',' : ''}} + + + + + ADL分数变化(多选): + + + {{AdlScoreChangeObj[subItem]}}{{index < item.FilterCondition.AdlScoreChange.length - 1 ? ',' : ''}} + + + {{AdlScoreChangeTypeObj[item.FilterCondition.AdlScoreChangeType]}} + + + ({{item.FilterCondition.AdlScoreChangeMin}}-{{item.FilterCondition.AdlScoreChangeMax}}) + + + + + 激素用量(多选): + + + {{SteroidDailyDoseObj[subItem]}}{{index < item.FilterCondition.SteroidDailyDose.length - 1 ? ',' : ''}} + + + + + 激素变化(多选): + + + {{SteroidDailyDoseChangeObj[subItem]}}{{index < item.FilterCondition.SteroidDailyDoseChange.length - 1 ? + ',' : ''}} + + + + + 延髓症状: + {{PharyngealSymptomsObj[item.FilterCondition.PharyngealSymptoms]}} + + + 抗体类型: + {{AntibodyTypeObj[item.FilterCondition.AntibodyType]}} + + + 胸腺异常: + {{ThyroidAbnormalObj[item.FilterCondition.ThyroidAbnormal]}} + + + 既往发生危象: + {{PreviousConvulsionObj[item.FilterCondition.PreviousConvulsion]}} + + + 传统免疫抑制剂: + + {{TraditionalImmunosuppressantObj[item.FilterCondition.TraditionalImmunosuppressant]}} + + + + 医保类型: + {{MedicalInsuranceTypeObj[item.FilterCondition.MedicalInsuranceType]}} + + + + + + + 共筛选出 + {{item.ActualPatientNum}}人 + + + 复制 + + 取消发送 + + + 停止发送 + + 删除 + + + + + + + + diff --git a/src/doctor/pages/d_trans/index.json b/src/doctor/pages/d_trans/index.json new file mode 100644 index 0000000..0936c13 --- /dev/null +++ b/src/doctor/pages/d_trans/index.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "", + "usingComponents": {} +} diff --git a/src/doctor/pages/d_trans/index.scss b/src/doctor/pages/d_trans/index.scss new file mode 100644 index 0000000..1dd9733 --- /dev/null +++ b/src/doctor/pages/d_trans/index.scss @@ -0,0 +1,35 @@ +.page { + padding: 88rpx 60rpx; + width: 100%; + height: 100vh; + box-sizing: border-box; + .submit { + margin-top: 700rpx; + height: 84rpx; + display: flex; + align-items: center; + justify-content: center; + font-size: 36rpx; + color: rgba(255, 255, 255, 1); + background: #67baca; + border-radius: 64rpx 64rpx 64rpx 64rpx; + } + .back { + margin-top: 36rpx; + height: 84rpx; + display: flex; + align-items: center; + justify-content: center; + font-size: 36rpx; + color: rgba(103, 186, 202, 1); + background: rgba(103, 186, 202, 0.12); + border-radius: 64rpx 64rpx 64rpx 64rpx; + } + .tip{ + margin-top: 82rpx; + font-size: 32rpx; + color: rgba(194, 201, 202, 1); + line-height: 48rpx; + text-align: center; + } +} diff --git a/src/doctor/pages/d_trans/index.ts b/src/doctor/pages/d_trans/index.ts new file mode 100644 index 0000000..268cabc --- /dev/null +++ b/src/doctor/pages/d_trans/index.ts @@ -0,0 +1,31 @@ +const app = getApp() + +Page({ + data: { + path: '', + }, + onLoad(options) { + this.setData({ + path: options.path ? decodeURIComponent(options.path) : '/pages/index/index', + }) + }, + handleLoginOut() { + wx.ajax({ + method: 'POST', + url: '?r=igg4/doctor/account/reg-logout', + data: {}, + }).then((_res) => { + app.globalData.loginType = 1 + app.globalData.anyWhere = true + app.globalData.first = true + wx.reLaunch({ + url: this.data.path, + }) + }) + }, + handleBackHome() { + wx.reLaunch({ + url: '/doctor/pages/d_home/index', + }) + }, +}) diff --git a/src/doctor/pages/d_trans/index.wxml b/src/doctor/pages/d_trans/index.wxml new file mode 100644 index 0000000..b45ebf4 --- /dev/null +++ b/src/doctor/pages/d_trans/index.wxml @@ -0,0 +1,12 @@ + + 随便看看 + 回到医生端 + + 您当前登录的为医生身份 + + 点击随便看看可退出账号 + + diff --git a/src/doctor/pages/d_transfer/index.json b/src/doctor/pages/d_transfer/index.json new file mode 100644 index 0000000..bccb6bc --- /dev/null +++ b/src/doctor/pages/d_transfer/index.json @@ -0,0 +1,9 @@ +{ + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/navBar/navBar", + "pickerArea": "/components/pickerArea/index", + "toast": "/components/toast/index", + "van-popup": "@vant/weapp/popup/index" + } +} diff --git a/src/doctor/pages/d_transfer/index.scss b/src/doctor/pages/d_transfer/index.scss new file mode 100644 index 0000000..6fe171f --- /dev/null +++ b/src/doctor/pages/d_transfer/index.scss @@ -0,0 +1,244 @@ +page { + background-color: #f2f4f5; +} + +.page { + padding-bottom: calc(env(safe-area-inset-bottom) + 300rpx); + .page-header { + margin: 10rpx 30rpx 0; + padding: 22rpx 32rpx; + background: linear-gradient(9deg, #ffffff 0%, #d4e5e8 100%); + box-shadow: 0rpx 8rpx 8rpx 0rpx rgba(40, 48, 49, 0.04); + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2rpx solid #ffffff; + display: flex; + align-items: center; + .name { + flex: 1; + font-size: 32rpx; + color: #283031; + } + .icon { + width: 40rpx; + height: 40rpx; + } + } + .tip { + margin: 32rpx 30rpx 0; + font-size: 32rpx; + color: #283031; + } + .page-container { + padding: 24rpx 30rpx; + .card { + margin-bottom: 24rpx; + position: relative; + padding: 32rpx; + background: #ffffff; + border-radius: 24rpx 24rpx 24rpx 24rpx; + display: flex; + .card-label { + padding: 6rpx 24rpx; + position: absolute; + top: 0; + right: 0; + font-size: 28rpx; + color: #67baca; + background-color: #eef7f9; + border: 2rpx solid #ffffff; + border-radius: 0 24rpx 0 24rpx; + } + .avatar { + width: 112rpx; + height: 112rpx; + border-radius: 16rpx; + } + .wrap { + flex: 1; + padding-left: 16rpx; + .name { + font-size: 36rpx; + color: #283031; + font-weight: bold; + } + .content { + margin-top: 12rpx; + .label { + display: inline-block; + padding: 0 8rpx; + font-size: 24rpx; + color: #ffffff; + line-height: 32rpx; + background-color: #ffc137; + border-radius: 8rpx; + } + .hostipal { + margin-left: 8rpx; + display: inline; + font-size: 28rpx; + color: #484848; + } + } + .site { + margin-top: 8rpx; + font-size: 28rpx; + color: #9e9e9e; + } + .footer { + margin-top: 32rpx; + display: flex; + justify-content: flex-end; + .btn { + padding: 8rpx 28rpx; + background: #67baca; + border-radius: 64rpx 64rpx 64rpx 64rpx; + border: 1rpx solid rgba(154, 161, 162, 0.25); + font-size: 28rpx; + color: #ffffff; + display: flex; + align-items: center; + gap: 8rpx; + .icon { + width: 28rpx; + height: 28rpx; + } + } + } + } + } + } + .page-footer { + padding: 32rpx 30rpx calc(env(safe-area-inset-bottom) + 32rpx); + position: fixed; + bottom: 0; + left: 0; + width: 100%; + box-sizing: border-box; + background: #67baca; + box-shadow: 0rpx -4rpx 24rpx 0rpx rgba(0, 0, 0, 0.13); + border-radius: 24rpx 24rpx 0rpx 0rpx; + .search { + padding: 0 32rpx; + background-color: #fff; + display: flex; + align-items: center; + gap: 10rpx; + border-radius: 140rpx; + .icon { + width: 40rpx; + height: 40rpx; + } + .s-content { + flex: 1; + padding: 22rpx 0; + text-align: center; + font-size: 32rpx; + color: #adb3b4; + } + } + .btn { + padding: 20rpx; + font-size: 28rpx; + color: #ffffff; + display: flex; + justify-content: center; + gap: 10rpx; + } + } +} + +.popup { + padding: 32rpx 30rpx 0; + .title { + font-size: 36rpx; + color: #283031; + text-align: center; + font-weight: bold; + } + .row { + margin-top: 48rpx; + .row-title { + font-size: 32rpx; + color: #9e9e9e; + } + .area { + margin-top: 16rpx; + display: flex; + align-items: center; + justify-content: space-between; + gap: 14rpx; + .item { + flex: 1; + padding: 18rpx 30rpx; + box-shadow: 0rpx 4rpx 12rpx 0rpx rgba(0, 0, 0, 0.11); + border-radius: 12rpx 12rpx 12rpx 12rpx; + border: 2rpx solid #67baca; + display: flex; + align-items: center; + justify-content: space-between; + .content { + font-size: 32rpx; + color: #283031; + max-width: 5em; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } + .icon { + width: 32rpx; + height: 32rpx; + } + .tril { + margin-top: 5rpx; + width: 0; + height: 0; + border-style: solid; + border-width: 12rpx 12rpx 0 12rpx; + border-color: #74bac9 transparent transparent transparent; + } + } + .picker { + flex: 1; + } + } + .row-input { + margin-top: 16rpx; + padding: 18rpx 30rpx; + font-size: 32rpx; + border-radius: 12px; + background-color: #f7f8f9; + } + .place-row-input { + color: #c2c9ca; + } + } + .p-footer { + margin-top: 76rpx; + display: flex; + gap: 26rpx; + .cancel { + flex: 1; + height: 84rpx; + background: #ffffff; + border-radius: 98rpx 98rpx 98rpx 98rpx; + border: 2rpx solid #67baca; + display: flex; + align-items: center; + justify-content: center; + font-size: 36rpx; + color: #67baca; + } + .submit { + flex: 1; + height: 84rpx; + background: #67baca; + border-radius: 98rpx 98rpx 98rpx 98rpx; + border: 2rpx solid #67baca; + font-size: 36rpx; + color: #ffffff; + display: flex; + align-items: center; + justify-content: center; + } + } +} diff --git a/src/doctor/pages/d_transfer/index.ts b/src/doctor/pages/d_transfer/index.ts new file mode 100644 index 0000000..331e1fc --- /dev/null +++ b/src/doctor/pages/d_transfer/index.ts @@ -0,0 +1,131 @@ +const app = getApp() + +Page({ + data: { + toastShow: false, + toastType: 'transferCode', + toastParams: {} as any, + + show: true, + + search: '', + ProvinceName: '', + ProvinceId: '', + CityName: '', + CityId: '', + + list: [], + pagination: { + page: 1, + pages: 1, + count: 0, + }, + }, + onLoad() { + app.waitLogin().then(() => { + app.mpBehavior({ doctor: true, PageName: 'PG_DOCTORRECOMMENDEDREFERRAL' }) + this.getList() + }) + }, + getList(newPage = 1) { + const { search, ProvinceId, CityId } = this.data + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/doctor-recommend/get-doctor-list', + data: { + page: newPage, + search, + provinceId: ProvinceId, + cityId: CityId, + }, + }).then((res) => { + const list = res.page == 1 ? res.list : [...this.data.list, ...res.list] + this.setData({ + list, + pagination: { + page: res.page, + pages: res.pages, + count: res.count, + }, + }) + }) + }, + onReachBottom() { + const { page, pages } = this.data.pagination + if (pages > page) { + this.getList(page + 1) + } + }, + handleChangeSite(e: WechatMiniprogram.CustomEvent) { + const detail = e.detail + this.setData({ + ProvinceId: detail.ProvinceId, + ProvinceName: detail.ProvinceName, + CityId: detail.CityId, + CityName: detail.CityName, + }) + }, + handleSiteShareShow(e) { + this.setData({ + areaShow: e.detail, + }) + }, + handlePopup() { + app.mpBehavior({ doctor: true, PageName: 'BTN_DOCTORRECOMMENDEDREFERRALPAGEFASTFINDDR' }) + this.setData({ + show: true, + }) + }, + handleCode(e) { + const { list } = this.data + const { index } = e.currentTarget.dataset + const item: any = list[index] + const url = `${app.globalData.url}?r=igg4/doctor/doctor-recommend/get-rec-code&loginState=${app.globalData.loginState}&recommendDoctorId=${item.doctorId}` + app.mpBehavior({ doctor: true, PageName: 'BTN_DOCTORRECOMMENDEDREFERRALPAGERECOMMENDCODE' }) + this.setData({ + toastShow: true, + toastType: 'transferCode', + toastParams: { + url, + ...item, + }, + }) + }, + handleToastOk() {}, + handleToastCancel() { + this.setData({ + toastShow: false, + }) + }, + handleBack() { + wx.navigateBack() + }, + handleLog() { + app.mpBehavior({ doctor: true, PageName: 'BTN_DOCTORRECOMMENDEDREFERRALPAGEMYRECORD' }) + wx.navigateTo({ + url: '/doctor/pages/d_transferLog/index', + }) + }, + handleReset() { + this.setData({ + search: '', + ProvinceName: '', + ProvinceId: '', + CityName: '', + CityId: '', + show: false, + }) + this.getList() + }, + handleSearch() { + this.getList() + this.onClose() + }, + onClose() { + this.setData({ + show: false, + }) + }, +}) + +export {} diff --git a/src/doctor/pages/d_transfer/index.wxml b/src/doctor/pages/d_transfer/index.wxml new file mode 100644 index 0000000..a899dbf --- /dev/null +++ b/src/doctor/pages/d_transfer/index.wxml @@ -0,0 +1,97 @@ + + + + + 我的推荐记录 + + + 您可能想找这些医生 + + + 您推荐过 + + + {{item.doctorName}} + + {{item.hospitalClassificationName}}{{item.hospitalLevelName}} + {{item.hospitalName}} + + + {{item.hospitalProvinceName}}{{item.hospitalCityName}}{{item.hospitalCountyName}}{{item.hospitalAreaName}} + + + + + 推荐码 + + + + + + + + + + 快速找医生 + + + + {{ProvinceName}} + {{ProvinceName == CityName ? '' : CityName}} + + 点击一键找医生 + + + + + + 快速找医生 + + + 选择地区 + + + {{ProvinceName || '请选择省份'}} + + + + {{CityName || '请选择城市'}} + + + + + + + 输入医院或姓名模糊搜 + + + + 清空 + 搜索 + + + + + diff --git a/src/doctor/pages/d_transferDetail/index.json b/src/doctor/pages/d_transferDetail/index.json new file mode 100644 index 0000000..ea9f53c --- /dev/null +++ b/src/doctor/pages/d_transferDetail/index.json @@ -0,0 +1,6 @@ +{ + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/navBar/navBar" + } +} diff --git a/src/doctor/pages/d_transferDetail/index.scss b/src/doctor/pages/d_transferDetail/index.scss new file mode 100644 index 0000000..b68c633 --- /dev/null +++ b/src/doctor/pages/d_transferDetail/index.scss @@ -0,0 +1,187 @@ +page { + background-color: #f2f4f5; +} + +.page { + padding-bottom: calc(env(safe-area-inset-bottom) + 300rpx); + padding-left: 30rpx; + padding-right: 30rpx; + .banner { + padding: 32rpx; + background: linear-gradient(9deg, #ffffff 0%, #ecf3f4 100%); + box-shadow: 0rpx 8rpx 8rpx 0rpx rgba(40, 48, 49, 0.04); + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2rpx solid #ffffff; + .user { + display: flex; + gap: 16rpx; + .avatar { + flex-shrink: 0; + width: 116rpx; + height: 116rpx; + border-radius: 50%; + } + .wrap { + .name { + font-size: 44rpx; + color: #62bed0; + line-height: 56rpx; + } + .content { + margin-top: 8rpx; + font-size: 32rpx; + color: #9e9e9e; + line-height: 44rpx; + } + } + } + .info { + margin-top: 36rpx; + display: flex; + gap: 18rpx; + .i-item { + flex: 1; + padding: 32rpx 48rpx; + background: #f2f4f5; + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2rpx solid #ffffff; + .title { + font-size: 28rpx; + color: #9aa1a2; + } + .content { + margin-top: 20rpx; + display: flex; + align-items: baseline; + line-height: 1; + .num { + font-size: 56rpx; + color: #62bed0; + } + .sub { + font-size: 28rpx; + color: #62bed0; + } + } + } + } + } + .table { + margin-top: 24rpx; + background-color: #62bed0; + border-radius: 24rpx; + .thead { + padding: 20rpx 32rpx 20rpx; + display: grid; + grid-template-columns: 1fr 1.5fr 1.5fr; + gap: 36rpx; + .th1, + .th2, + .th3 { + font-size: 28rpx; + color: #ffffff; + text-align: center; + } + } + .tbody { + padding: 0 32rpx; + border-radius: 24rpx; + background-color: #fff; + .tr { + padding: 32rpx 0; + display: grid; + grid-template-columns: 1fr 1fr 1fr; + gap: 36rpx; + border-bottom: 1px solid #f2f4f5; + &:last-of-type { + border: none; + } + .td1 { + display: flex; + align-items: center; + gap: 24rpx; + .order { + flex-shrink: 0; + padding: 0 9rpx; + font-size: 28rpx; + color: #ffffff; + line-height: 36rpx; + min-width: 36rpx; + text-align: center; + box-sizing: border-box; + border-radius: 20rpx; + background-color: #67baca; + } + .name { + font-size: 28rpx; + color: #283031; + } + } + .td2 { + font-size: 28rpx; + color: #484848; + display: flex; + align-items: center; + justify-content: center; + } + .td3 { + font-size: 28rpx; + color: #484848; + display: flex; + align-items: center; + justify-content: center; + } + } + } + } +} + +.page2 { + .banner { + background: linear-gradient(9deg, #ffffff 0%, #fffbf1 100%); + .user { + .wrap { + .name { + color: #e5a51e; + } + } + } + .info { + .i-item { + .content { + .num { + color: #e5a51e; + } + .sub { + color: #e5a51e; + } + } + } + } + } + .table { + background-color: #e5a51e; + .tbody { + .tr { + .td1 { + .order { + background-color: #e5a51e; + } + } + } + } + } +} + +.empty { + margin-top: 230rpx; + text-align: center; + .icon { + width: 344rpx; + height: 344rpx; + } + .title { + font-size: 32rpx; + color: #9aa1a2; + } +} diff --git a/src/doctor/pages/d_transferDetail/index.ts b/src/doctor/pages/d_transferDetail/index.ts new file mode 100644 index 0000000..1c0de8a --- /dev/null +++ b/src/doctor/pages/d_transferDetail/index.ts @@ -0,0 +1,86 @@ +import dayjs from 'dayjs' + +const app = getApp() + +Page({ + data: { + type: '1', + id: '', + + detail: {}, + list: [], + pagination: { + page: 1, + pages: 1, + count: 0, + }, + }, + onLoad(options) { + this.setData({ + id: options.id, + type: options.type, + }) + app.waitLogin().then(() => { + this.getDetail() + this.getList() + }) + }, + getDetail() { + const { id, type } = this.data + const url = + type == '1' + ? '?r=igg4/doctor/doctor-recommend/get-rec-stat-doctor' + : '?r=igg4/doctor/doctor-recommend/get-be-rec-stat-doctor' + wx.ajax({ + method: 'GET', + url, + data: { + recommendDoctorId: id, + }, + }).then((res) => { + this.setData({ + detail: res, + }) + }) + }, + getList(newPage = 1) { + const { id, type } = this.data + const url = + type == '1' + ? '?r=igg4/doctor/doctor-recommend/get-rec-record-list' + : '?r=igg4/doctor/doctor-recommend/get-be-rec-record-list' + wx.ajax({ + method: 'GET', + url, + data: { + page: newPage, + recommendDoctorId: id, + }, + }).then((res) => { + res.list.forEach((item) => { + item.recommendTime = item.recommendTime ? dayjs(item.recommendTime).format('YYYY-MM-DD') : '' + item.bindTime = item.bindTime ? dayjs(item.bindTime).format('YYYY-MM-DD') : '' + }) + const list = res.page == 1 ? res.list : [...this.data.list, ...res.list] + this.setData({ + list, + pagination: { + page: res.page, + pages: res.pages, + count: res.count, + }, + }) + }) + }, + onReachBottom() { + const { page, pages } = this.data.pagination + if (pages > page) { + this.getList(page + 1) + } + }, + handleBack() { + wx.navigateBack() + }, +}) + +export {} diff --git a/src/doctor/pages/d_transferDetail/index.wxml b/src/doctor/pages/d_transferDetail/index.wxml new file mode 100644 index 0000000..973922c --- /dev/null +++ b/src/doctor/pages/d_transferDetail/index.wxml @@ -0,0 +1,64 @@ + + + + + + + 患者名称 + 推荐时间 + 线下复诊 + + + + + {{index+1}} + {{item.patientName}} + + {{item.recommendTime}} + --- + {{item.bindTime}} + --- + + + + + + + + 暂无推荐记录 + + + diff --git a/src/doctor/pages/d_transferLog/index.json b/src/doctor/pages/d_transferLog/index.json new file mode 100644 index 0000000..b1474c9 --- /dev/null +++ b/src/doctor/pages/d_transferLog/index.json @@ -0,0 +1,9 @@ +{ + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/navBar/navBar", + "van-tab": "@vant/weapp/tab/index", + "van-tabs": "@vant/weapp/tabs/index", + "van-icon": "@vant/weapp/icon/index" + } +} diff --git a/src/doctor/pages/d_transferLog/index.scss b/src/doctor/pages/d_transferLog/index.scss new file mode 100644 index 0000000..e250949 --- /dev/null +++ b/src/doctor/pages/d_transferLog/index.scss @@ -0,0 +1,146 @@ +page { + background-color: #f2f4f5; +} + +.page { + padding-bottom: calc(env(safe-area-inset-bottom) + 100rpx); + .page-container { + padding: 24rpx 30rpx; + .tabs { + --tabs-line-height: auto; + .van-tabs__scroll { + border-radius: 98rpx; + } + .tab { + margin: 8rpx; + padding: 8rpx; + font-size: 32rpx; + color: #677172; + line-height: 44rpx; + } + .tab-active { + color: #fff; + background-color: #62bed0; + border-radius: 62rpx; + &:last-of-type { + background-color: #e5a51e; + } + } + } + .container1 { + padding: 24rpx 0 0; + .tip { + font-size: 28rpx; + color: #9aa1a2; + text-align: center; + } + .stat { + margin-top: 28rpx; + padding: 14rpx 32rpx; + font-size: 28rpx; + color: #283031; + border-radius: 24rpx; + background-color: #fff; + .num { + margin: 0 4rpx; + font-size: 40rpx; + color: #62bed0; + } + } + .table { + margin-top: 24rpx; + background-color: #62bed0; + border-radius: 24rpx; + .thead { + padding: 20rpx 32rpx 20rpx; + display: grid; + grid-template-columns: auto 130rpx 130rpx; + gap: 36rpx; + .th2, + .th3 { + font-size: 28rpx; + color: #ffffff; + } + } + .tbody { + padding: 0 32rpx; + border-radius: 24rpx; + background-color: #fff; + .tr { + padding: 32rpx 0; + display: grid; + grid-template-columns: auto 130rpx 130rpx; + gap: 36rpx; + border-bottom: 1px solid #f2f4f5; + &:last-of-type { + border: none; + } + .td1 { + display: flex; + gap: 14rpx; + .avatar { + flex-shrink: 0; + width: 84rpx; + height: 84rpx; + border-radius: 50%; + } + .wrap { + .name { + font-size: 32rpx; + color: #283031; + } + .content { + font-size: 28rpx; + color: #9e9e9e; + } + } + } + .td2 { + font-size: 28rpx; + color: #62bed0; + display: flex; + align-items: center; + } + .td3 { + font-size: 28rpx; + color: #62bed0; + display: flex; + align-items: center; + justify-content: space-between; + } + } + } + } + } + .container2 { + .stat { + .num { + color: #e5a51e; + } + } + .table { + background-color: #e5a51e; + .tbody { + .tr { + .td2, + .td3 { + color: #e5a51e; + } + } + } + } + } + .empty { + margin-top: 260rpx; + text-align: center; + .icon { + width: 344rpx; + height: 344rpx; + } + .title { + font-size: 32rpx; + color: #9aa1a2; + } + } + } +} diff --git a/src/doctor/pages/d_transferLog/index.ts b/src/doctor/pages/d_transferLog/index.ts new file mode 100644 index 0000000..151c53f --- /dev/null +++ b/src/doctor/pages/d_transferLog/index.ts @@ -0,0 +1,91 @@ +const app = getApp() + +Page({ + data: { + toastShow: false, + toastType: 'transferCode', + toastParams: {} as any, + + show: false, + + active: 0, + statInfo: {}, + list: [], + pagination: { + page: 1, + pages: 1, + count: 0, + }, + }, + onLoad() { + app.waitLogin().then(() => { + this.getList() + }) + }, + onChange(e) { + const { index } = e.detail + this.setData({ + active: index, + list: [], + pagination: { + page: 1, + pages: 1, + count: 0, + }, + }) + this.getList() + }, + getList(newPage = 1) { + const { active } = this.data + const url = { + 0: '?r=igg4/doctor/doctor-recommend/get-rec-stat-list', + 1: '?r=igg4/doctor/doctor-recommend/get-be-rec-stat-list', + }[active] + if (newPage == 1) { + app.mpBehavior({ + doctor: true, + PageName: { + 0: 'PG_DOCTORRECOMMENDEDRECORDPAGE_MYRECOMMENDLIST', + 1: 'PG_DOCTORRECOMMENDEDRECORDPAGE_RECOMMENDEDTOMElist', + }[active] as string, + }) + } + if (!url) return + wx.ajax({ + method: 'GET', + url, + data: { + page: newPage, + }, + }).then((res) => { + const list = res.page == 1 ? res.list : [...this.data.list, ...res.list] + this.setData({ + statInfo: res.statInfo, + list, + pagination: { + page: res.page, + pages: res.pages, + count: res.count, + }, + }) + }) + }, + onReachBottom() { + const { page, pages } = this.data.pagination + if (pages > page) { + this.getList(page + 1) + } + }, + handleDetail(e) { + const { type, id, code } = e.currentTarget.dataset + app.mpBehavior({ doctor: true, PageName: code }) + wx.navigateTo({ + url: `/doctor/pages/d_transferDetail/index?type=${type}&id=${id}`, + }) + }, + handleBack() { + wx.navigateBack() + }, +}) + +export {} diff --git a/src/doctor/pages/d_transferLog/index.wxml b/src/doctor/pages/d_transferLog/index.wxml new file mode 100644 index 0000000..60da62b --- /dev/null +++ b/src/doctor/pages/d_transferLog/index.wxml @@ -0,0 +1,119 @@ + + + + + + + 本页面展示您推荐过的医生记录信息 + + 您给{{statInfo.doctorCount}}位医生推荐过 + {{statInfo.patientCount}} + 位患者 线下复诊 + {{statInfo.bindCount}} + 人 + + + + + 历史推荐 + 线下复诊 + + + + + + + {{item.doctorName}} + {{item.hospitalName}} + + + {{item.recommendCount}}次 + + {{item.recommendBindCount}}人 + + + + + + + + + + 暂无推荐记录 + + + + + + 本页面展示推荐过您的医生记录信息 + + 有{{statInfo.doctorCount}}位医生给 + {{statInfo.patientCount}} + 位患者推荐过您 已线下复诊 + {{statInfo.bindCount}} + 人 + + + + + 历史推荐 + 线下复诊 + + + + + + + {{item.doctorName}} + {{item.hospitalName}} + + + {{item.recommendCount}}次 + + {{item.recommendBindCount}}人 + + + + + + + + + + 暂无推荐记录 + + + + + + diff --git a/src/doctor/pages/d_userInfo/index.json b/src/doctor/pages/d_userInfo/index.json new file mode 100644 index 0000000..f69e11f --- /dev/null +++ b/src/doctor/pages/d_userInfo/index.json @@ -0,0 +1,7 @@ +{ + "navigationBarTitleText": "个人信息", + "usingComponents": { + "van-icon": "@vant/weapp/icon/index", + "van-popup": "@vant/weapp/popup/index" + } +} diff --git a/src/doctor/pages/d_userInfo/index.scss b/src/doctor/pages/d_userInfo/index.scss new file mode 100644 index 0000000..4088357 --- /dev/null +++ b/src/doctor/pages/d_userInfo/index.scss @@ -0,0 +1,214 @@ +page { + background: #f2f4f5; +} +.page { + padding: 164rpx 30rpx 40rpx; + .container { + position: relative; + padding: 92rpx 30rpx 64rpx; + background: #ffffff; + border-radius: 24rpx 24rpx 24rpx 24rpx; + .avatar { + position: absolute; + top: -90rpx; + left: 50%; + transform: translateX(-50%); + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + .avatar-user { + flex-shrink: 0; + width: 156rpx; + height: 156rpx; + border-radius: 50%; + } + .edit { + margin-top: -15rpx; + padding: 8rpx 24rpx; + background: #f2f4f5; + border-radius: 108rpx 108rpx 108rpx 108rpx; + font-size: 24rpx; + color: rgba(40, 48, 49, 1); + display: flex; + align-items: center; + line-height: 1; + .icon { + margin-right: 8rpx; + width: 24rpx; + height: 24rpx; + } + } + } + .row { + margin-top: 64rpx; + display: flex; + justify-content: space-between; + .label { + flex-shrink: 0; + font-size: 32rpx; + color: rgba(154, 161, 162, 1); + width: 6em; + } + .switch-row { + display: flex; + justify-content: flex-end; + .switch { + transform: scale(0.8); + } + } + .content { + flex: 1; + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + } + .option { + flex-shrink: 0; + display: flex; + align-items: center; + .change { + font-size: 32rpx; + color: rgba(98, 190, 208, 1); + } + .icon { + color: #d4d9da; + } + } + } + } + .switch-btn { + margin: 64rpx 0; + font-size: 36rpx; + color: rgba(255, 255, 255, 1); + display: flex; + align-items: center; + justify-content: center; + height: 84rpx; + background: #67baca; + border-radius: 64rpx 64rpx 64rpx 64rpx; + } +} + +.popup-date { + padding: 32rpx 30rpx 84rpx; + .title { + display: flex; + justify-content: center; + font-size: 36rpx; + color: rgba(40, 48, 49, 1); + font-weight: bold; + } + .textarea { + padding: 30rpx; + margin-top: 32rpx; + width: 100%; + height: 180rpx; + box-sizing: border-box; + background: #f7f8f9; + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2rpx solid #f8f9f9; + font-size: 32rx; + } + .week { + margin-top: 32rpx; + .w-row { + display: grid; + grid-template-columns: 156rpx repeat(2, 1fr); + background-color: rgba(242, 244, 245, 1); + &:nth-of-type(2n) { + background-color: rgba(247, 248, 249, 1); + } + &:not(:last-of-type) { + border-bottom: 1px solid #fff; + } + &:first-of-type { + border-radius: 24rpx 24rpx 0 0; + .name { + border-radius: 24rpx 0 0 0; + } + } + &:last-of-type { + border-radius: 0 0 24rpx 24rpx; + .name { + border-radius: 0 0 0 24rpx; + } + } + .name { + height: 76rpx; + font-size: 32rpx; + color: #fff; + display: flex; + align-items: center; + justify-content: center; + background-color: rgba(103, 186, 202, 1); + } + .item { + position: relative; + font-size: 32rpx; + color: rgba(103, 113, 114, 1); + display: flex; + align-items: center; + justify-content: center; + border-left: 1px solid #fff; + .icon { + position: absolute; + bottom: 0; + right: 0; + width: 32rpx; + height: 32rpx; + display: none; + } + &.active { + background-color: rgba(237, 252, 255, 1); + .icon { + display: block; + } + } + } + } + } + .submit { + margin-top: 32rpx; + height: 84rpx; + display: flex; + justify-content: center; + align-items: center; + background: #67baca; + font-size: 36rpx; + color: #fff; + border-radius: 64rpx 64rpx 64rpx 64rpx; + } +} + +.popup-brief { + padding: 32rpx 30rpx 84rpx; + .title { + display: flex; + justify-content: center; + font-size: 36rpx; + color: rgba(40, 48, 49, 1); + font-weight: bold; + } + .textarea { + padding: 30rpx; + margin-top: 32rpx; + width: 100%; + height: 280rpx; + box-sizing: border-box; + background: #f7f8f9; + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2rpx solid #f8f9f9; + font-size: 32rx; + } + .submit { + margin-top: 32rpx; + height: 84rpx; + display: flex; + justify-content: center; + align-items: center; + background: #67baca; + font-size: 36rpx; + color: #fff; + border-radius: 64rpx 64rpx 64rpx 64rpx; + } +} diff --git a/src/doctor/pages/d_userInfo/index.ts b/src/doctor/pages/d_userInfo/index.ts new file mode 100644 index 0000000..f4ab9c8 --- /dev/null +++ b/src/doctor/pages/d_userInfo/index.ts @@ -0,0 +1,231 @@ +const app = getApp() + +Page({ + data: { + doctor: {} as any, + hospital: {}, + popupDateShow: false, + popupDateFocus: false, + popupBriefShow: false, + popupBriefFocus: false, + ClinicList: [ + { + name: '周一', + weekday: 1, + timeTypeActive1: false, + timeTypeActive2: false, + }, + { + name: '周二', + weekday: 2, + timeTypeActive1: false, + timeTypeActive2: false, + }, + { + name: '周三', + weekday: 3, + timeTypeActive1: false, + timeTypeActive2: false, + }, + { + name: '周四', + weekday: 4, + timeTypeActive1: false, + timeTypeActive2: false, + }, + { + name: '周五', + weekday: 5, + timeTypeActive1: false, + timeTypeActive2: false, + }, + { + name: '周六', + weekday: 6, + timeTypeActive1: false, + timeTypeActive2: false, + }, + { + name: '周日', + weekday: 7, + timeTypeActive1: false, + timeTypeActive2: false, + }, + ], + PopupClinic: '', + }, + onLoad() {}, + onShow() { + app.waitLogin().then((_res) => { + app.mpBehavior({ doctor: true, PageName: 'PG_DOCTORPERSONALINFO' }) + this.getDetail() + }) + }, + getDetail() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/account/info', + data: {}, + }).then((res) => { + const { ClinicList } = this.data + + let weekName = '' + if (res.doctor.ClinicType == 2) { + weekName = res.doctor.Clinic + } else { + ;(res.doctor.Clinic ? res.doctor.Clinic : []).forEach((subItem: any) => { + if (subItem.timeType == 1) { + ClinicList[subItem.weekday - 1].timeTypeActive1 = true + } + if (subItem.timeType == 2) { + ClinicList[subItem.weekday - 1].timeTypeActive2 = true + } + }) + + weekName = (res.doctor.Clinic ? res.doctor.Clinic : []) + .map((subItem: { weekday: string | number; timeType: string | number }) => { + const week = ['周一', '周二', '周三', '周四', '周五', '周六', '周日'] + const timeDay = { 1: '上午', 2: '下午' } + return `${week[Number(subItem.weekday) - 1]}${timeDay[subItem.timeType]}` + }) + .join(',') + } + + this.setData({ + doctor: { + weekName, + ...res.doctor, + Telephone: res.doctor.Telephone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2'), + }, + hospital: res.hospital, + ClinicList, + }) + }) + }, + handleChangeClinicType(e) { + const value = e.detail.value + if (value) { + this.setData({ + 'doctor.ClinicType': 2, + 'doctor.Clinic': '', + 'doctor.weekName': '', + }) + } else { + this.setData({ + 'doctor.ClinicType': 1, + 'doctor.Clinic': [], + 'doctor.weekName': '', + }) + } + this.handleWeekIntroduceSubmit() + }, + handleChangePhone() { + app.mpBehavior({ doctor: true, PageName: 'BTN_DOCTORPERSONALINFOCHANGEPHONE' }) + wx.navigateTo({ + url: '/doctor/pages/d_changePhone/index', + }) + }, + handleWeek() { + const { doctor } = this.data + this.setData({ + PopupClinic: Array.isArray(doctor.Clinic) ? '' : doctor.Clinic, + popupDateShow: true, + }) + setTimeout(() => { + this.setData({ + popupDateFocus: true, + }) + }, 300) + }, + handleWeekSelect(e) { + const { type, index } = e.currentTarget.dataset + const ClinicList = this.data.ClinicList + ClinicList[index][`timeTypeActive${type}`] = !ClinicList[index][`timeTypeActive${type}`] + this.setData({ + ClinicList, + }) + }, + handleWeekIntroduceSubmit() { + const { doctor, PopupClinic } = this.data + let Clinic = '' + if (doctor.ClinicType == 2) { + Clinic = PopupClinic + } else { + const ClinicList = this.data.ClinicList + Clinic = ClinicList.reduce((pre, cur) => { + if (cur.timeTypeActive1) { + pre.push({ weekday: cur.weekday, timeType: 1 }) + } + if (cur.timeTypeActive2) { + pre.push({ weekday: cur.weekday, timeType: 2 }) + } + return pre + }, [] as any) + } + wx.ajax({ + method: 'POST', + url: '?r=igg4/doctor/account/update-info', + data: { + Introduce: this.data.doctor.Introduce, + Clinic, + ClinicType: doctor.ClinicType, + }, + }).then(() => { + this.onClose() + }) + }, + handleBrief() { + this.setData({ + popupBriefShow: true, + }) + setTimeout(() => { + this.setData({ + popupBriefFocus: true, + }) + }, 300) + }, + handleBriefInput(e) { + const doctor = this.data.doctor + doctor.Introduce = e.detail.value + this.setData({ + doctor, + }) + }, + onClose() { + this.setData({ + popupDateShow: false, + popupBriefShow: false, + popupBriefFocus: false, + popupDateFocus: false, + }) + this.getDetail() + }, + handleSwitch() { + app.mpBehavior({ doctor: true, PageName: 'BTN_DOCTORPERSONALINFOSWITCHACCOUNT' }) + wx.navigateTo({ + url: '/doctor/pages/d_changeDoctor/index', + }) + }, + handleLoginOut() { + wx.showModal({ + title: '确认退出?', + confirmColor: '#62bed0', + success: (res) => { + if (res.confirm) { + wx.ajax({ + method: 'POST', + url: '?r=igg4/doctor/account/reg-logout', + data: {}, + }).then((_res) => { + app.globalData.loginType = 1 + app.globalData.anyWhere = true + app.globalData.first = true + wx.reLaunch({ + url: '/pages/login/index', + }) + }) + } + }, + }) + }, +}) diff --git a/src/doctor/pages/d_userInfo/index.wxml b/src/doctor/pages/d_userInfo/index.wxml new file mode 100644 index 0000000..1da5270 --- /dev/null +++ b/src/doctor/pages/d_userInfo/index.wxml @@ -0,0 +1,121 @@ + + + + + + + + + + + 姓名 + {{doctor.Name}} + + + + 电话 + {{doctor.Telephone}} + 更换 + + + 医院 + {{hospital.Name}} + + + + 多院区出诊 + + + + + + 门诊时间 + {{doctor.weekName || '暂无'}} + + + + 个人简介 + {{doctor.Introduce || '暂无'}} + + + + 切换账号 + + + 退出登录 + + + + + + 门诊时间 + + + + {{item.name}} + + 上午 + + + + 下午 + + + + + 保存 + + + + + + 医生简介 + + 保存 + + diff --git a/src/gift/pages/conformOrder/index.json b/src/gift/pages/conformOrder/index.json new file mode 100644 index 0000000..57dc5ce --- /dev/null +++ b/src/gift/pages/conformOrder/index.json @@ -0,0 +1,6 @@ +{ + "navigationBarTitleText": "确认订单", + "usingComponents": { + "van-icon": "@vant/weapp/icon/index" + } +} diff --git a/src/gift/pages/conformOrder/index.scss b/src/gift/pages/conformOrder/index.scss new file mode 100644 index 0000000..b3dcf8d --- /dev/null +++ b/src/gift/pages/conformOrder/index.scss @@ -0,0 +1,184 @@ +.page { + padding: 34rpx 40rpx; + .site { + padding: 40rpx 32rpx; + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + display: flex; + align-items: center; + justify-content: space-between; + .wrap { + .title { + .label { + width: 72rpx; + height: 36rpx; + border: 1rpx solid #e04775; + font-size: 24rpx; + color: #e04775; + text-align: center; + border-radius: 10rpx; + box-sizing: border-box; + } + .name { + margin-top: -42rpx; + text-indent: 80rpx; + font-size: 36rpx; + line-height: 46rpx; + color: #3f3f3f; + font-weight: bold; + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + &.no-indent { + margin-top: 0; + text-indent: 0; + } + } + } + .content { + margin-top: 0; + margin-top: 12rpx; + font-size: 28rpx; + color: #b6b7ba; + } + } + .more { + flex-shrink: 0; + } + } + .shop { + margin-top: 16px; + padding: 40rpx 32rpx; + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + .shop-header { + padding-bottom: 10px; + display: flex; + .shop-img { + flex-shrink: 0; + width: 204rpx; + height: 204rpx; + border-radius: 24rpx; + } + .wrap { + padding-top: 8rpx; + flex: 1; + padding-left: 24rpx; + .name { + font-size: 32rpx; + font-weight: bold; + color: #3f3f3f; + line-height: 44rpx; + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + } + .specification { + margin-top: 8rpx; + font-size: 28rpx; + color: #b6b7ba; + } + .price { + margin-top: 14rpx; + display: flex; + align-items: center; + justify-content: space-between; + .num { + font-size: 32rpx; + color: #3f3f3f; + } + .sub { + font-size: 22rpx; + } + .val { + font-size: 28rpx; + color: #b6b7ba; + } + } + } + } + .row { + margin-top: 32rpx; + display: flex; + align-items: center; + justify-content: space-between; + .label { + font-size: 32rpx; + color: #3f3f3f; + } + .content { + font-size: 32rpx; + color: #3f3f3f; + &.yellow { + color: #e04775; + } + .sub { + font-size: 22rpx; + } + } + } + } + .remark { + margin-top: 16px; + padding: 40rpx 32rpx; + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + .title { + font-size: 32rpx; + color: #3f3f3f; + font-weight: bold; + } + .textarea { + margin-top: 10rpx; + padding: 24rpx 32rpx; + background-color: #fafafa; + min-height: 196rpx; + border-radius: 16rpx; + box-sizing: border-box; + } + } + .footer { + padding: 24rpx 48rpx 48rpx; + position: fixed; + bottom: 0; + left: 0; + width: 100vw; + box-sizing: border-box; + display: flex; + justify-content: space-between; + align-items: center; + height: 168rpx; + background: #ffffff; + box-shadow: 0rpx 8rpx 20rpx 0rpx rgba(0, 0, 0, 0.26); + .price { + font-size: 28rpx; + color: #b6b7ba; + .num { + font-size: 40rpx; + color: #e04775; + } + .sub { + font-size: 24rpx; + } + } + .submit { + width: 260rpx; + height: 96rpx; + background: #e04775; + border-radius: 48rpx; + text-align: center; + line-height: 96rpx; + color: #fff; + font-weight: bold; + } + } +} diff --git a/src/gift/pages/conformOrder/index.ts b/src/gift/pages/conformOrder/index.ts new file mode 100644 index 0000000..1e84c2f --- /dev/null +++ b/src/gift/pages/conformOrder/index.ts @@ -0,0 +1,86 @@ +const app = getApp(); + +Page({ + data: { + id: "", + detail: {}, + select: false, + addressDetail: {} as any, + remark: "", + }, + onLoad(options) { + this.setData({ + id: options.id, + }); + }, + onShow() { + app.waitLogin().then(() => { + this.getDetail(); + if (!this.data.select) { + this.getDefaultAddress(); + } else { + this.setData({ + select: false, + }); + } + }); + }, + getDefaultAddress() { + wx.ajax({ + method: "GET", + url: "?r=igg4/patient-address/get-default-address", + data: {}, + }).then((res) => { + this.setData({ + addressDetail: res, + }); + }); + }, + getDetail() { + wx.ajax({ + method: "GET", + url: "?r=igg4/gift-order/get-order-detail", + data: { + orderId: this.data.id, + }, + }).then((res) => { + this.setData({ + detail: res, + }); + }); + }, + handleSite() { + if (this.data.addressDetail) { + wx.navigateTo({ + url: "/gift/pages/siteList/index", + }); + } else { + wx.navigateTo({ + url: "/gift/pages/siteEdit/index", + }); + } + }, + handleSubmit() { + if (!this.data.addressDetail?.addressId) { + wx.showToast({ + icon: "none", + title: "请选择地址", + }); + return; + } + wx.ajax({ + method: "POST", + url: "?r=igg4/gift-order/confirm-order", + data: { + orderId: this.data.id, + addressId: this.data.addressDetail.addressId, + remark: this.data.remark, + }, + loading: true, + }).then(() => { + wx.reLaunch({ + url: `/gift/pages/orderEnd/index?id=${this.data.id}`, + }); + }); + }, +}); diff --git a/src/gift/pages/conformOrder/index.wxml b/src/gift/pages/conformOrder/index.wxml new file mode 100644 index 0000000..275c630 --- /dev/null +++ b/src/gift/pages/conformOrder/index.wxml @@ -0,0 +1,56 @@ + + + + + + 默认 + + {{addressDetail.provinceName}}{{addressDetail.cityName}}{{addressDetail.countyName}}{{addressDetail.address}} + + + {{addressDetail.receiveUserName}} {{addressDetail.receiveTelephone}} + + 请添加收货地址 + + + + + + + + {{detail.giftName}} + 规格:{{detail.specName}} + + {{detail.giftScore}}能量 + x{{detail.orderCount}} + + + + + 礼品总价 + {{detail.orderScore}}能量 + + + 配送方式 + 快递配送 + + + 商家电话 + {{detail.serviceTel}} + + + + 留言 + + + + + 共{{detail.orderCount}}件 + + 合计消耗 + {{detail.orderScore}}能量 + + + 提交订单 + + diff --git a/src/gift/pages/cutaneous/index.json b/src/gift/pages/cutaneous/index.json new file mode 100644 index 0000000..bdfcf9b --- /dev/null +++ b/src/gift/pages/cutaneous/index.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "皮下剂型", + "usingComponents": {} +} diff --git a/src/gift/pages/cutaneous/index.scss b/src/gift/pages/cutaneous/index.scss new file mode 100644 index 0000000..87f7f8f --- /dev/null +++ b/src/gift/pages/cutaneous/index.scss @@ -0,0 +1,63 @@ +page { + background-color: #f7f6f7; +} +.page { + .page1 { + height: 869rpx; + } + .page2 { + position: relative; + height: 630rpx; + .mg-video { + position: absolute; + top: 290rpx; + right: 60rpx; + width: 600rpx; + height: 288rpx; + } + } + .page3 { + position: relative; + height: 782rpx; + .cidp-mask { + position: absolute; + top: 174rpx; + right: 30rpx; + z-index: 1; + width: 74rpx; + height: 304rpx; + } + .cidp-list { + position: absolute; + top: 184rpx; + right: 30rpx; + width: 632rpx; + height: 288rpx; + overflow-x: auto; + overflow-y: hidden; + display: flex; + gap: 16rpx; + .cidp-item { + flex-shrink: 0; + width: 216rpx; + height: 288rpx; + } + } + } + .page4 { + height: 302rpx; + } + .page5 { + height: 306rpx; + } + .page6 { + display: block; + width: 100%; + height: 574rpx; + } +} + +#video { + width: 0; + height: 0; +} diff --git a/src/gift/pages/cutaneous/index.ts b/src/gift/pages/cutaneous/index.ts new file mode 100644 index 0000000..5445b23 --- /dev/null +++ b/src/gift/pages/cutaneous/index.ts @@ -0,0 +1,65 @@ +const _app = getApp() + +Page({ + data: { + mg: [ + { + url: 'https://circlehbsaas.oss-cn-beijing.aliyuncs.com/video/20241129469_MG%E4%B8%93%E5%8C%BA%E8%A7%86%E9%A2%9101.mp4', + }, + ], + cidp: [ + { + url: 'https://circlehbsaas.oss-cn-beijing.aliyuncs.com/video/20241129233_CIDP%E4%B8%93%E5%8C%BA%E8%A7%86%E9%A2%9101.mp4', + }, + { + url: 'https://circlehbsaas.oss-cn-beijing.aliyuncs.com/video/20241129667_CIDP%E4%B8%93%E5%8C%BA%E8%A7%86%E9%A2%9103.mp4', + }, + { + url: 'https://circlehbsaas.oss-cn-beijing.aliyuncs.com/video/20241129630_CIDP%E8%A7%86%E9%A2%91%E4%B8%93%E5%8C%BA02.mp4', + }, + { + url: 'https://circlehbsaas.oss-cn-beijing.aliyuncs.com/video/20241129281_CIDP%E4%B8%93%E5%8C%BA%E8%A7%86%E9%A2%9104.mp4', + }, + ], + }, + videoContext: null as WechatMiniprogram.VideoContext | null, + onLoad() { + this.videoContext = wx.createVideoContext('video') + }, + onUnload() { + if (this.videoContext) { + this.videoContext.stop() + } + }, + handleVideo(e: any) { + const { key, index } = e.currentTarget.dataset + const url = this.data[key][index].url + if (this.videoContext) { + this.setData({ + videoUrl: url, + }) + this.videoContext.play() + this.videoContext.requestFullScreen({ + direction: 0, + }) + } + }, + handleFullScreen(e) { + if (!e.detail.fullScreen && this.videoContext) { + this.videoContext.stop() + } + }, + handleDetail(e: any) { + const { id } = e.currentTarget.dataset + wx.navigateTo({ + url: `/gift/pages/cutaneousDetail/index?id=${id}`, + }) + }, + handleVideoDetail() { + wx.navigateTo({ + url: `/gift/pages/cutaneousVideo/index`, + }) + }, +}) + +export {} diff --git a/src/gift/pages/cutaneous/index.wxml b/src/gift/pages/cutaneous/index.wxml new file mode 100644 index 0000000..02c1d1b --- /dev/null +++ b/src/gift/pages/cutaneous/index.wxml @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/gift/pages/cutaneousDetail/index.json b/src/gift/pages/cutaneousDetail/index.json new file mode 100644 index 0000000..bdfcf9b --- /dev/null +++ b/src/gift/pages/cutaneousDetail/index.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "皮下剂型", + "usingComponents": {} +} diff --git a/src/gift/pages/cutaneousDetail/index.scss b/src/gift/pages/cutaneousDetail/index.scss new file mode 100644 index 0000000..7b383ce --- /dev/null +++ b/src/gift/pages/cutaneousDetail/index.scss @@ -0,0 +1,11 @@ +.page { + .card { + width: 100%; + display: block; + } +} + +#video { + width: 0; + height: 0; +} diff --git a/src/gift/pages/cutaneousDetail/index.ts b/src/gift/pages/cutaneousDetail/index.ts new file mode 100644 index 0000000..a0e9476 --- /dev/null +++ b/src/gift/pages/cutaneousDetail/index.ts @@ -0,0 +1,26 @@ +const _app = getApp() + +Page({ + data: { + list: { + 2: ['2-1', '2-2', '2-3', '2-4'], + 3: ['3-1', '3-2', '3-3', '3-4', '3-5'], + 4: ['4-1', '4-2'], + 5: ['5-1', '5-2', '5-3', '5-4', '5-5'], + }, + curentList: [] as any, + }, + onLoad(e) { + if (e.id) { + this.setData({ + curentList: this.data.list[e.id], + }) + } else { + this.setData({ + curentList: this.data.list[2], + }) + } + }, +}) + +export {} diff --git a/src/gift/pages/cutaneousDetail/index.wxml b/src/gift/pages/cutaneousDetail/index.wxml new file mode 100644 index 0000000..9755af0 --- /dev/null +++ b/src/gift/pages/cutaneousDetail/index.wxml @@ -0,0 +1,9 @@ + + + diff --git a/src/gift/pages/cutaneousVideo/index.json b/src/gift/pages/cutaneousVideo/index.json new file mode 100644 index 0000000..bdfcf9b --- /dev/null +++ b/src/gift/pages/cutaneousVideo/index.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "皮下剂型", + "usingComponents": {} +} diff --git a/src/gift/pages/cutaneousVideo/index.scss b/src/gift/pages/cutaneousVideo/index.scss new file mode 100644 index 0000000..8a0dcb2 --- /dev/null +++ b/src/gift/pages/cutaneousVideo/index.scss @@ -0,0 +1,36 @@ +page { + background: linear-gradient(218deg, #e8bbe7 0%, #ffedf6 26%, #ffedf6 100%); +} +.page { + padding: 408rpx 40rpx 0; + .container { + padding: 40rpx 32rpx 42rpx; + background-color: #fff; + border-radius: 32rpx; + .content { + font-size: 32rpx; + line-height: 2; + color: #002b48; + } + .tip { + margin-top: 28rpx; + font-size: 32rpx; + color: rgba(87,87,87,0.5); + } + } + .btn { + margin-top: 42rpx; + height: 92rpx; + font-size: 32rpx; + color: #FFFFFF; + display: flex; + align-items: center; + justify-content: center; + background: linear-gradient(90deg, #dd406a 0%, #9039b0 100%); + border-radius: 112rpx 112rpx 112rpx 112rpx; + } +} +#video { + width: 0; + height: 0; +} diff --git a/src/gift/pages/cutaneousVideo/index.ts b/src/gift/pages/cutaneousVideo/index.ts new file mode 100644 index 0000000..5c5cf14 --- /dev/null +++ b/src/gift/pages/cutaneousVideo/index.ts @@ -0,0 +1,29 @@ +Page({ + data: { + videoUrl: 'https://circlehbsaas.oss-cn-beijing.aliyuncs.com/video/20241214185_1.mp4', + }, + videoContext: null as WechatMiniprogram.VideoContext | null, + onLoad() { + this.videoContext = wx.createVideoContext('video') + }, + onUnload() { + if (this.videoContext) { + this.videoContext.stop() + } + }, + handleVideo() { + if (this.videoContext) { + this.videoContext.play() + this.videoContext.requestFullScreen({ + direction: 0, + }) + } + }, + handleFullScreen(e) { + if (!e.detail.fullScreen && this.videoContext) { + this.videoContext.stop() + } + }, +}) + +export {} diff --git a/src/gift/pages/cutaneousVideo/index.wxml b/src/gift/pages/cutaneousVideo/index.wxml new file mode 100644 index 0000000..56d244e --- /dev/null +++ b/src/gift/pages/cutaneousVideo/index.wxml @@ -0,0 +1,16 @@ + + + + 本视频仅用于专业医护人员或艾加莫德a注射液(皮下注射)已处方患者(或其护理者)在接受充分的皮下注射技术培训后自行注射艾加莫德a注射液(皮下注射); + 本指导视频并不构成专业医疗建议、诊断或治疗的依据,请按照说明书并遵医嘱使用,切勿仅依赖本视频内容。 + + *在观看视频前请阅读声明并确认您的身份 + + 我是专业医护人员 + 我是卫力迦已处方患者(或其护理者) + + + diff --git a/src/gift/pages/dtpDurg/index.json b/src/gift/pages/dtpDurg/index.json new file mode 100644 index 0000000..b632d36 --- /dev/null +++ b/src/gift/pages/dtpDurg/index.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "双通道药房", + "usingComponents": {} +} diff --git a/src/gift/pages/dtpDurg/index.scss b/src/gift/pages/dtpDurg/index.scss new file mode 100644 index 0000000..f0e8cec --- /dev/null +++ b/src/gift/pages/dtpDurg/index.scss @@ -0,0 +1,128 @@ +.page { + position: relative; + .banner { + width: 100%; + min-height: 344rpx; + } + .container { + padding: 48rpx 40rpx; + position: absolute; + top: 316rpx; + left: 0; + width: 100%; + min-height: 100vh; + border-radius: 24rpx 24rpx 0 0; + background-color: #fafafa; + box-sizing: border-box; + .title { + font-size: 36rpx; + color: #484848; + font-weight: bold; + } + .tags { + margin-top: 16rpx; + display: flex; + .tag { + margin-right: 16rpx; + padding-right: 8rpx; + font-size: 22rpx; + color: #e04775; + line-height: 1; + border-radius: 8rpx; + background-color: #f5dfe6; + display: flex; + align-items: center; + .icon { + margin-right: 8rpx; + padding: 4rpx; + width: 24rpx; + max-height: 24rpx; + background-color: #e04775; + border-radius: 8rpx; + } + } + } + .content { + margin-top: 32rpx; + margin-bottom: 20rpx; + display: flex; + justify-content: space-between; + .inner { + .site { + font-size: 28rpx; + color: #9e9e9e; + } + .tel { + font-size: 28rpx; + color: #9b9ea6; + } + } + .options { + flex-shrink: 0; + display: flex; + .option { + margin-left: 30rpx; + .phone { + width: 48rpx; + height: 48rpx; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + background-color: #fff; + box-shadow: 0 4rpx 20rpx 0 rgba(0, 0, 0, 0.1); + &-img { + width: 24rpx; + height: 24rpx; + } + } + .name { + margin-top: 8rpx; + font-size: 24rpx; + color: #484848; + } + } + } + } + + .card { + margin-bottom: 16rpx; + padding: 32rpx 30rpx; + border-radius: 24rpx; + background-color: #fff; + .c-title { + font-size: 32rpx; + font-weight: bold; + color: #484848; + display: flex; + align-items: center; + .c-icon { + margin-right: 16rpx; + width: 36rpx; + height: 36rpx; + } + } + .c-content{ + margin-top: 24rpx; + font-size: 28rpx; + color: #9E9E9E; + } + } + + .remark{ + padding: 32rpx; + border-radius: 24rpx; + background-color: #fff; + .r-title{ + font-size: 32rpx; + color: #484848; + font-weight: bold; + } + .r-content{ + margin-top: 20rpx; + font-size: 28rpx; + color: #9E9E9E; + } + } + } +} diff --git a/src/gift/pages/dtpDurg/index.ts b/src/gift/pages/dtpDurg/index.ts new file mode 100644 index 0000000..b62610a --- /dev/null +++ b/src/gift/pages/dtpDurg/index.ts @@ -0,0 +1,52 @@ +const app = getApp(); + +Page({ + data: { + id: "", + detail: {} as any, + }, + onLoad(options) { + this.setData({ + id: options.id, + }); + app.waitLogin().then(() => { + this.getDetail(); + }); + }, + + getDetail() { + wx.ajax({ + method: "GET", + url: "?r=igg4/dtp-pharmacy/detail", + data: { + Id: this.data.id, + }, + }).then((res) => { + this.setData({ + detail: res, + }); + }); + }, + handleSite() { + const { LNG, LAT, ProvinceName, CityName, CountyName, Address, Name } = this.data.detail; + wx.openLocation({ + latitude: LAT, + longitude: LNG, + name: Name, + address: `${ProvinceName}${CityName}${CountyName}${Address}`, + }); + }, + handlePhone() { + const tel = this.data.detail.Telephone; + if (!tel) { + wx.showToast({ + icon: "none", + title: "电话暂未开通", + }); + return; + } + wx.makePhoneCall({ + phoneNumber: tel, + }); + }, +}); diff --git a/src/gift/pages/dtpDurg/index.wxml b/src/gift/pages/dtpDurg/index.wxml new file mode 100644 index 0000000..d7a435a --- /dev/null +++ b/src/gift/pages/dtpDurg/index.wxml @@ -0,0 +1,61 @@ + + + + + {{detail.Name}} + + + + + 自有输注中心 + + + + + 合作输注中心 + + + + + {{detail.ProvinceName}}{{detail.CityName}}{{detail.CountyName}}{{detail.Address}} + {{detail.Telephone}} + + + + + + + 地址 + + + + + + 电话 + + + + + + + 自有输注中心 + + {{detail.OwnInfusionCenterName}} + + + + + 合作输注中心 + + {{detail.CooperationInfusionCenterName}} + + + 备注 + {{detail.Remark}} + + + diff --git a/src/gift/pages/giftDetail/index.json b/src/gift/pages/giftDetail/index.json new file mode 100644 index 0000000..bc3d960 --- /dev/null +++ b/src/gift/pages/giftDetail/index.json @@ -0,0 +1,7 @@ +{ + "navigationBarTitleText": "礼品详情", + "usingComponents": { + "van-stepper": "@vant/weapp/stepper/index", + "toast": "/components/toast/index" + } +} diff --git a/src/gift/pages/giftDetail/index.scss b/src/gift/pages/giftDetail/index.scss new file mode 100644 index 0000000..b2292c4 --- /dev/null +++ b/src/gift/pages/giftDetail/index.scss @@ -0,0 +1,185 @@ +.page { + background-color: #f9f9f9; + padding-bottom: 400rpx; + .banner { + width: 100%; + .banner-img { + display: block; + width: 100%; + height: 562rpx; + } + } + .container { + padding: 30rpx 40rpx; + .price { + display: flex; + align-items: baseline; + .num { + font-size: 56rpx; + color: #e04775; + font-weight: bold; + } + .sub { + font-size: 32rpx; + color: #e04775; + } + } + .title { + margin-top: 22rpx; + font-size: 36rpx; + color: #3f3f3f; + line-height: 48rpx; + font-weight: bold; + } + .list { + margin-top: 24rpx; + padding: 32rpx; + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + .list-title { + padding-bottom: 16rpx; + position: relative; + font-size: 36rpx; + color: #3f3f3f; + font-weight: bold; + &::before { + content: ""; + position: absolute; + top: 0; + left: -32rpx; + width: 12rpx; + height: 44rpx; + background: #e04775; + border-radius: 0rpx 8rpx 8rpx 0rpx; + } + } + .list-img { + display: block; + width: 100%; + } + } + } + .footer { + padding: 30rpx 40rpx 40rpx; + position: fixed; + bottom: 0; + left: 0; + width: 100vw; + box-sizing: border-box; + background: #ffffff; + box-shadow: 0rpx 8rpx 20rpx 0rpx rgba(0, 0, 0, 0.26); + .options { + padding-bottom: 25rpx; + .row { + display: flex; + align-items: center; + .label { + margin-right: 24rpx; + flex-shrink: 0; + font-size: 32rpx; + color: #b6b7ba; + } + .radios { + display: flex; + overflow: auto; + &::-webkit-scrollbar { + display: none; + } + .radio { + margin-right: 16rpx; + border-radius: 8rpx; + border: 1px solid #d0d0d0; + line-height: 40rpx; + padding: 0 20rpx; + font-size: 28rpx; + color: #aaaaaa; + white-space: nowrap; + &.active { + background-color: #e04775; + border-color: #e04775; + color: #fff; + } + } + } + .stepper { + display: flex; + align-items: center; + .custom-class { + border: 1px solid #e5e5e5; + border-radius: 8rpx; + } + .input-class { + color: #3f3f3f; + font-weight: bold; + background-color: #ffffff; + margin: 0; + } + .plus-class, + .minus-class { + margin: 0; + background-color: #f8f8f8; + } + .minus-class { + border-right: 1px solid #d7d7d7; + } + .plus-class { + border-left: 1px solid #d7d7d7; + } + .status { + margin-left: 8rpx; + font-size: 32rpx; + color: #e1e1e1; + } + } + } + .row:not(:first-of-type) { + margin-top: 24rpx; + } + } + .module { + border-top: 1px solid #f2f2f2; + padding-top: 25rpx; + display: flex; + align-items: center; + justify-content: space-between; + .wrap { + .price { + display: flex; + align-items: baseline; + .sub { + font-size: 28rpx; + color: #e04775; + } + .num { + font-size: 40rpx; + color: #e04775; + font-weight: bold; + } + } + .doc { + display: flex; + align-items: center; + font-size: 24rpx; + color: #999999; + .checkbox { + transform: scale(0.7); + } + .a { + color: #e04775; + } + } + } + .submit { + width: 298rpx; + height: 96rpx; + background: #e04775; + border-radius: 48rpx; + font-size: 36rpx; + color: #ffffff; + line-height: 96rpx; + text-align: center; + } + } + } +} diff --git a/src/gift/pages/giftDetail/index.ts b/src/gift/pages/giftDetail/index.ts new file mode 100644 index 0000000..4a7e1d1 --- /dev/null +++ b/src/gift/pages/giftDetail/index.ts @@ -0,0 +1,150 @@ +const app = getApp(); + +Page({ + data: { + id: "", + detail: {}, + specVecItem: {} as any, + num: 1, + allPrice: "", + + toastShow: false, + toastType: "giftEnter", + + toastParams: { + doc: "", + }, + protocol: false, + }, + onLoad(options) { + this.setData({ + id: options.id, + toastParams: { + doc: `

为让用户更好的享受再鼎gMG给力加油站的服务,gMG给力加油站平台向用户提供了能量兑换服务,并提供了丰富的礼品,平台注册用户可使用有效的能量兑换礼品。

gMG给力加油站的礼品库将提供:

1) 查看用户在能量商城选择兑换的商品信息;

2) 确认兑换商品的订单信息;

3) 实施兑换商品的物流配送服务。

基于以上服务内容,我们在此特别声明:

gMG给力加油站非常重视用户个人信息保护,我们制定了详细的《知情同意书》,我们将按照公示的政策及相关法律法规的要求,对您的个人信息予以保护。为了完整的向您提供能量的商品兑换服务,gMG给力加油站将需要您提供用户真实姓名、手机号、地址信息,以便完成您所兑换商品的物流配送。其中,当用户准备对兑换商品进行结算时,平台会生成兑换该商品的订单,同时该订单中会载明订单号、所兑换的商品或服务信息、应支付的能量值。以上所有信息构成用户的“订单信息”,平台将使用订单信息来进行用户的身份核验、确定交易、支付结算、完成配送。

用户点击本协议的"同意"按钮即视为完全接受以上声明条款,在点击之前请用户再次确认已知悉并完全理解声明的全部内容。

`, + // doc:`

为让用户更好的享受再鼎gMG给力加油站的服务,gMG给力加油站平台向用户提供了能量兑换服务,并提供了丰富的礼品,平台注册用户可使用有效的能量兑换礼品。

gMG给力加油站的礼品库将提供:

1) 查看用户在能量商城选择兑换的商品信息;

2) 确认兑换商品的订单信息;

3) 实施兑换商品的物流配送服务。

基于以上服务内容,我们在此特别声明:

gMG给力加油站非常重视用户个人信息保护,我们制定了详细的《知情同意书》,我们将按照公示的政策及相关法律法规的要求,对您的个人信息予以保护。为了完整的向您提供能量的商品兑换服务,gMG给力加油站将需要您提供用户真实姓名、手机号、地址信息,以便完成您所兑换商品的物流配送。其中,当用户准备对兑换商品进行结算时,平台会生成兑换该商品的订单,同时该订单中会载明订单号、所兑换的商品或服务信息、应支付的能量值。以上所有信息构成用户的“订单信息”,平台将使用订单信息来进行用户的身份核验、确定交易、支付结算、完成配送。

用户点击本协议的"同意"按钮即视为完全接受以上声明条款,在点击之前请用户再次确认已知悉并完全理解声明的全部内容。

` + }, + }); + app.waitLogin().then(() => { + this.setView(); + this.getDetail(); + this.getProtocol(); + }); + }, + setView() { + wx.ajax({ + method: "POST", + url: "?r=igg4/gift-spu/set-visit-num", + data: { spuId: this.data.id }, + showMsg: false, + }); + }, + getDetail() { + wx.ajax({ + method: "GET", + url: "?r=igg4/gift-spu/get-detail", + data: { + spuId: this.data.id, + }, + }).then((res) => { + this.setData({ + detail: { + ...res, + detailList: JSON.parse(res.detail), + }, + specVecItem: res.specVec[0], + allPrice: res.specVec[0].score, + num: res.specVec[0].stock >= 1 ? 1 : 0, + }); + }); + }, + getProtocol() { + wx.ajax({ + method: "GET", + url: "?r=igg4/agreement/get-user-agreement", + data: {}, + }).then((res) => { + this.setData({ + protocol: res, + }); + }); + }, + setProtocol() { + wx.ajax({ + method: "POST", + url: "?r=igg4/agreement/set-user-agreement", + data: {}, + }); + }, + handleSpec(e: any) { + const { index } = e.currentTarget.dataset; + const specVecItem: any = this.data.detail.specVec[index]; + console.log(specVecItem.stock>=1) + this.setData({ + specVecItem: specVecItem, + allPrice: specVecItem.score, + num: specVecItem.stock >= 1 ? 1 : 0, + }); + }, + onChangeNumber(e: any) { + this.setData({ + num: e.detail, + allPrice: this.data.specVecItem.score * e.detail, + }); + }, + handleDoc() { + this.setData({ + toastShow: true, + toastType: "giftEnter", + }); + }, + handleToastOk(e) { + if (!e.detail.protocol) { + wx.showToast({ + title: "请先勾选《用户须知》", + icon: "none", + }); + return; + } + this.setProtocol(); + this.setData({ + protocol: e.detail.protocol, + }); + this.handleToastCancel(); + }, + handleToastCancel() { + this.setData({ + toastShow: false, + toastType: "", + }); + }, + handleProtocol() { + if (!this.data.protocol) { + this.setProtocol(); + } + this.setData({ + protocol: !this.data.protocol, + }); + }, + handleSubmit() { + if (!this.data.protocol) { + wx.showToast({ + icon: "none", + title: "请先同意《用户须知》", + }); + return; + } + wx.ajax({ + method: "POST", + url: "?r=igg4/gift-order/place-order", + data: { + giftId: this.data.specVecItem.giftId, + count: this.data.num, + }, + loading: true, + }).then((res) => { + wx.navigateTo({ + url: `/gift/pages/conformOrder/index?id=${res}`, + }); + }); + }, +}); diff --git a/src/gift/pages/giftDetail/index.wxml b/src/gift/pages/giftDetail/index.wxml new file mode 100644 index 0000000..2da9a75 --- /dev/null +++ b/src/gift/pages/giftDetail/index.wxml @@ -0,0 +1,80 @@ + + + + + {{specVecItem.score}} + 能量 + + {{detail.giftName}} + + 礼品详情 + + + + + + + + 规格 + + + {{item.specName }} + + + + + 数量 + + + 有库存 + 无库存 + + + + + + + + 合计 +   + + {{allPrice}} + + + + 已阅读 + 《用户须知》 + + + 立即兑换 + + + + + diff --git a/src/gift/pages/giftList/index.json b/src/gift/pages/giftList/index.json new file mode 100644 index 0000000..91ab748 --- /dev/null +++ b/src/gift/pages/giftList/index.json @@ -0,0 +1,8 @@ +{ + "navigationBarTitleText": "礼品中心", + "navigationStyle": "custom", + "usingComponents": { + "van-icon": "@vant/weapp/icon/index", + "navBar": "/components/navBar/navBar" + } +} diff --git a/src/gift/pages/giftList/index.scss b/src/gift/pages/giftList/index.scss new file mode 100644 index 0000000..b9e74b7 --- /dev/null +++ b/src/gift/pages/giftList/index.scss @@ -0,0 +1,185 @@ +page { + background-color: #f9f9f9; +} +.page { + .bg { + width: 100%; + height: 902rpx; + } + .page-container { + position: absolute; + left: 0; + top: 0; + width: 100%; + padding: 0 40rpx; + box-sizing: border-box; + padding-bottom: 200rpx; + .notice { + height: 44rpx; + background: linear-gradient(90deg, rgba(241, 241, 241, 0) 0%, #f1f1f1 52%, rgba(241, 241, 241, 0) 100%); + border-radius: 16rpx; + display: flex; + align-items: center; + justify-content: center; + font-size: 24rpx; + color: #3f3f3f; + .icon { + margin-right: 5rpx; + width: 30rpx; + height: 24rpx; + } + } + .banner { + margin-top: 16rpx; + background: #fafafa; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + border: 2rpx solid rgba(151, 151, 151, 0.14); + .banner-header { + padding: 32rpx 0 32rpx 32rpx; + display: flex; + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + border-bottom: 2rpx solid rgba(151, 151, 151, 0.14); + display: flex; + .user { + width: 106rpx; + height: 106rpx; + border-radius: 50%; + } + .wrap { + flex: 1; + padding: 0 150rpx 0 22rpx; + .title { + font-size: 24rpx; + color: #3f3f3f; + } + .price { + font-size: 48rpx; + color: #3f3f3f; + font-weight: bold; + } + } + .rule { + font-size: 24rpx; + color: #ffffff; + width: 136rpx; + height: 44rpx; + background: #f5ab1f; + border-radius: 24rpx 0 0 24rpx; + text-align: center; + line-height: 44rpx; + font-weight: bold; + } + } + .banner-footer { + padding: 20rpx 0 28rpx; + display: flex; + justify-content: space-between; + align-items: center; + .ver-line { + width: 2rpx; + height: 40rpx; + background-color: rgba(221, 221, 221, 0.6); + } + .option { + flex: 1; + display: flex; + justify-content: center; + align-items: center; + font-size: 28rpx; + color: #484848; + font-weight: bold; + .icon { + margin-right: 22rpx; + width: 50rpx; + height: 50rpx; + } + } + } + } + .list { + margin-top: 48rpx; + .list-title { + margin-bottom: 20rpx; + width: 180rpx; + height: 40rpx; + } + .list-cate { + padding: 20rpx 0; + display: flex; + flex-wrap: nowrap; + max-width: 100vw; + box-sizing: border-box; + overflow-x: auto; + &::-webkit-scrollbar { + display: none; + } + .cate { + margin-right: 20rpx; + padding: 10rpx 24rpx; + white-space: nowrap; + line-height: 1; + font-size: 28rpx; + color: #484848; + background-color: #f2f2f2; + border-radius: 24rpx; + &.active { + color: #fff; + background-color: #e04775; + } + } + } + .list-container { + display: flex; + flex-wrap: wrap; + gap: 16rpx 22rpx; + .list-item { + margin-bottom: 16rpx; + width: 324rpx; + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + .photo { + border-radius: 24rpx 24rpx 0 0; + width: 100%; + height: 324rpx; + } + .content { + padding: 18rpx 20rpx 22rpx; + .title { + margin-top: 18rpx; + font-size: 32rpx; + color: #484848; + font-weight: bold; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } + .footer { + margin-top: 6rpx; + display: flex; + justify-content: space-between; + .price { + font-size: 28rpx; + color: #e04775; + } + .btn { + width: 100rpx; + height: 44rpx; + text-align: center; + line-height: 44rpx; + font-size: 24rpx; + color: #ffffff; + background: #e04775; + border-radius: 24rpx; + font-weight: bold; + } + } + } + } + } + } + } +} diff --git a/src/gift/pages/giftList/index.ts b/src/gift/pages/giftList/index.ts new file mode 100644 index 0000000..f5b3726 --- /dev/null +++ b/src/gift/pages/giftList/index.ts @@ -0,0 +1,114 @@ +const app = getApp(); + +Page({ + data: { + bottom: 0, + selfScore: { + expire: {}, + }, + cateList: [], + + cateId: "", + list: [], + pagination: { + page: 1, + pages: 1, + count: 1, + }, + }, + onLoad() { + const SystemInfo = app.globalSystemInfo; + if (SystemInfo) { + const { bottom } = SystemInfo.capsulePosition; + this.setData({ + bottom: bottom, + }); + } + app.waitLogin().then(() => { + app.getUserInfo(this, true); + this.getScore(); + this.getList(); + this.getCateList(); + }); + }, + getScore() { + wx.ajax({ + method: "GET", + url: "?r=igg4/patient-score/get-self-score", + data: {}, + }).then((res) => { + this.setData({ + selfScore: res, + }); + }); + }, + getCateList() { + wx.ajax({ + method: "GET", + url: "?r=igg4/gift-spu/get-cate-all-list", + data: {}, + }).then((res) => { + this.setData({ + cateList: res, + }); + }); + }, + handleCate(e) { + const { id } = e.currentTarget.dataset; + this.setData({ + cateId: id, + }); + this.getList(); + }, + getList(newPage = 1) { + wx.ajax({ + method: "POST", + url: `?r=igg4/gift-spu/get-list&page=${newPage}`, + data: { + cateId: this.data.cateId ? [this.data.cateId] : [], + }, + }).then((res) => { + let list = res.page == 1 ? res.list : [...this.data.list, ...res.list]; + this.setData({ + list: list, + pagination: { + page: res.page, + pages: res.pages, + count: res.count, + }, + }); + }); + }, + handlePirceDetail() { + wx.navigateTo({ + url: "/gift/pages/priceDetail/index", + }); + }, + handleMyGift() { + wx.navigateTo({ + url: "/gift/pages/myGift/index", + }); + }, + handleDetail(e) { + const { id } = e.currentTarget.dataset; + wx.navigateTo({ + url: `/gift/pages/giftDetail/index?id=${id}`, + }); + }, + handleRule() { + wx.navigateTo({ + url: `/gift/pages/scoreRule/index`, + }); + }, + handleBack() { + wx.reLaunch({ + url: "/pages/my/index", + }); + }, + onReachBottom() { + const { page, pages } = this.data.pagination; + if (pages > page) { + this.getList(page + 1); + } + }, +}); diff --git a/src/gift/pages/giftList/index.wxml b/src/gift/pages/giftList/index.wxml new file mode 100644 index 0000000..a25b4cb --- /dev/null +++ b/src/gift/pages/giftList/index.wxml @@ -0,0 +1,51 @@ + + + + + + + 你有{{selfScore.expire.expireScore}}能量将于7月1日过期 + + + + + + 全部 + {{item.cateName}} + + + + + + {{item.giftName}} + + {{item.lowestScore}}能量 + 兑换 + + + + + + + + diff --git a/src/gift/pages/myGift/index.json b/src/gift/pages/myGift/index.json new file mode 100644 index 0000000..7d52f40 --- /dev/null +++ b/src/gift/pages/myGift/index.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "我的礼品", + "usingComponents": {} +} diff --git a/src/gift/pages/myGift/index.scss b/src/gift/pages/myGift/index.scss new file mode 100644 index 0000000..54a67ff --- /dev/null +++ b/src/gift/pages/myGift/index.scss @@ -0,0 +1,110 @@ +page { + background-color: #f7f7f7; +} +.page { + padding: 32rpx 40rpx; + .card { + margin-bottom: 16rpx; + padding: 32rpx; + background: #ffffff; + border-radius: 24rpx; + .header { + display: flex; + justify-content: space-between; + align-items: center; + padding-bottom: 32rpx; + border-bottom: 1px solid #ebebeb; + .on { + font-size: 28rpx; + color: #bbbcbe; + } + .status { + font-size: 28rpx; + color: #e04775; + } + .suc { + color: #24d8c8; + } + } + .shop { + padding: 32rpx 0; + display: flex; + align-items: center; + .shop-img { + flex-shrink: 0; + width: 200rpx; + height: 200rpx; + border-radius: 24rpx; + } + .wrap { + flex: 1; + padding-left: 24rpx; + .name { + font-size: 32rpx; + font-weight: bold; + color: #3f3f3f; + line-height: 44rpx; + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + } + .specification { + display: inline-block; + margin-top: 8rpx; + font-size: 28rpx; + color: #b6b7ba; + border-radius: 10rpx; + } + .price { + margin-top: 14rpx; + display: flex; + align-items: center; + justify-content: space-between; + .num { + font-size: 32rpx; + color: #e04775; + font-weight: bold; + .sub { + font-size: 22rpx; + } + } + .val { + font-size: 28rpx; + color: #b6b7ba; + } + } + } + } + .footer { + border-top: 1px solid #ebebeb; + padding-top: 32rpx; + display: flex; + align-items: center; + justify-content: space-between; + .content { + font-size: 28rpx; + color: #bbbcbe; + display: flex; + align-items: baseline; + .num { + font-size: 42rpx; + color: #e04775; + font-weight: bold; + } + } + .btn { + width: 152rpx; + height: 52rpx; + border-radius: 8rpx; + border: 1rpx solid rgba(158, 158, 158, 0.42); + font-size: 28rpx; + color: #3f3f3f; + text-align: center; + line-height: 52rpx; + } + } + } +} diff --git a/src/gift/pages/myGift/index.ts b/src/gift/pages/myGift/index.ts new file mode 100644 index 0000000..33b0bc9 --- /dev/null +++ b/src/gift/pages/myGift/index.ts @@ -0,0 +1,48 @@ +const app = getApp(); + +Page({ + data: { + list: [], + pagination: { + page: 1, + pages: 1, + count: 1, + }, + }, + onLoad() { + app.waitLogin().then(() => { + this.getList(); + }); + }, + getList(newPage = 1) { + wx.ajax({ + method: "POST", + url: "?r=igg4/gift-order/get-order-list", + data: { + page: newPage, + }, + }).then((res) => { + let list = res.page == 1 ? res.list : [...this.data.list, ...res.list]; + this.setData({ + list: list, + pagination: { + page: res.page, + pages: res.pages, + count: res.count, + }, + }); + }); + }, + handleDetail(e: any) { + const { id } = e.currentTarget.dataset; + wx.navigateTo({ + url: `/gift/pages/orderDetail/index?id=${id}`, + }); + }, + onReachBottom() { + const { page, pages } = this.data.pagination; + if (pages > page) { + this.getList(page + 1); + } + }, +}); diff --git a/src/gift/pages/myGift/index.wxml b/src/gift/pages/myGift/index.wxml new file mode 100644 index 0000000..5d97dba --- /dev/null +++ b/src/gift/pages/myGift/index.wxml @@ -0,0 +1,28 @@ + + + + 订单号:{{item.orderNo}} + {{item.statusName}} + {{item.statusName}} + + + + + {{item.giftName}} + 规格:{{item.specName}} + + {{item.giftScore}}能量 + x{{item.orderCount}} + + + + + + 共{{item.orderCount}}件 消耗能量: + {{item.orderScore}} + + 查看物流 + + + + diff --git a/src/gift/pages/myHealthRecord/index.json b/src/gift/pages/myHealthRecord/index.json new file mode 100644 index 0000000..e084d3a --- /dev/null +++ b/src/gift/pages/myHealthRecord/index.json @@ -0,0 +1,11 @@ +{ + "navigationBarTitleText": "我的健康记录", + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/navBar/navBar", + "van-icon": "@vant/weapp/icon/index", + "calendar": "/components/calendar/index", + "toast": "/components/toast/index", + "ec-canvas": "/components/ec-canvas/ec-canvas" + } +} diff --git a/src/gift/pages/myHealthRecord/index.scss b/src/gift/pages/myHealthRecord/index.scss new file mode 100644 index 0000000..86ffc3a --- /dev/null +++ b/src/gift/pages/myHealthRecord/index.scss @@ -0,0 +1,741 @@ +page { + background-color: rgba(250, 250, 250, 1); + min-height: 100vh; + padding-bottom: 200rpx; +} + +.page { + padding: 0 40rpx 33rpx; + + .calendar-wrap { + height: 80rpx; + overflow: hidden; + transition: all 0.5s; + .calendar { + margin: 0; + } + + .legend { + margin-top: 30rpx; + display: flex; + > view:not(:last-of-type), + > image { + margin-right: 38rpx; + } + justify-content: flex-end; + + .item { + display: flex; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 11rpx; + } + font-size: 24rpx; + color: rgba(79, 79, 79, 1); + + &::before { + margin-right: 10rpx; + content: ""; + width: 16rpx; + height: 16rpx; + border-radius: 50%; + } + } + .drugs { + .icon { + width: 17rpx; + height: 24rpx; + } + font-size: 24rpx; + color: rgba(79, 79, 79, 1); + } + + .item1 { + &::before { + background-color: rgba(207, 83, 117, 1); + } + } + + .item2 { + &::before { + background-color: rgba(37, 217, 200, 1); + } + } + } + &.expend { + height: 600rpx; + } + } + .p-fold { + padding: 20rpx; + text-align: center; + } + .chart { + margin-top: 34rpx; + .c-header { + display: flex; + justify-content: space-between; + align-items: center; + .title { + font-size: 32rpx; + color: rgba(71, 71, 71, 1); + font-weight: bold; + } + .more { + font-size: 24rpx; + color: rgba(204, 204, 204, 1); + } + } + .c-container { + margin-top: 24rpx; + background-color: #fff; + border-radius: 24rpx; + border: 1rpx solid rgba(0, 0, 0, 0.1); + .c-header { + display: flex; + justify-content: space-between; + border-bottom: 1rpx solid rgba(0, 0, 0, 0.1); + .c-nav { + overflow: hidden; + flex: 1; + display: flex; + .nav-item { + padding: 16rpx 0; + width: 80rpx; + text-align: center; + line-height: 42rpx; + font-size: 24rpx; + color: #666666; + font-weight: bold; + &.active { + position: relative; + color: #cf5375; + &::after { + position: absolute; + bottom: 0; + left: -5rpx; + content: ""; + width: 90rpx; + height: 4rpx; + background: #cf5375; + } + } + } + } + .fill { + margin-right: 40rpx; + width: 24rpx; + height: 24rpx; + } + } + .c-content { + padding: 16rpx 0; + .search-num { + padding: 0 32rpx; + display: flex; + align-items: center; + justify-content: space-between; + .col { + display: flex; + align-items: center; + .input { + font-size: 24rpx; + color: #666666; + border: 1px solid #ccc; + padding-left: 1em; + border-radius: 12rpx; + } + .btn { + margin-left: 20rpx; + padding: 4rpx 10rpx; + font-size: 24rpx; + color: #fff; + border-radius: 12rpx; + background-color: #e04775; + } + } + .all { + font-size: 24rpx; + color: rgba(79, 79, 79, 1); + } + } + .search { + padding: 0 36rpx 16rpx; + display: flex; + justify-content: space-between; + border-bottom: 1rpx solid rgba(0, 0, 0, 0.1); + .date { + display: flex; + align-items: center; + font-size: 24rpx; + color: #666666; + .line { + margin: 0 10rpx; + } + .icon { + transform: rotate(90deg); + color: #666666; + } + } + .result { + font-size: 24rpx; + color: #666666; + display: flex; + align-items: center; + .icon { + margin-right: 9rpx; + width: 26rpx; + height: 30rpx; + } + .question { + width: 24rpx; + height: 24rpx; + } + } + } + .wrap { + padding: 0 36rpx; + .w-header { + padding-top: 32rpx; + display: flex; + justify-content: space-between; + .title { + font-size: 32rpx; + color: #484848; + } + .legend { + display: flex; + align-items: center; + gap: 25rpx; + .item { + font-size: 20rpx; + color: #4f4f4f; + display: flex; + align-items: center; + .logo { + margin-right: 8rpx; + width: 16rpx; + height: 16rpx; + border-radius: 50%; + background-color: #cf5375; + &.hormone { + background-color: #3192A1; + } + } + .icon { + margin-right: 8rpx; + width: 17rpx; + height: 24rpx; + } + } + } + } + .unit { + font-size: 22rpx; + color: #ccc; + margin-bottom: -40rpx; + } + .w-chart { + position: relative; + padding-top: 20rpx; + height: 500rpx; + .touch { + position: absolute; + z-index: 100; + width: 100%; + height: 250rpx; + } + .left { + position: absolute; + top: 180rpx; + left: -65rpx; + width: 56rpx; + height: 56rpx; + background: #ffffff; + box-shadow: 0rpx 6rpx 28rpx 0rpx rgba(0, 0, 0, 0.18); + border: 1rpx solid #e8e8e8; + display: flex; + align-items: center; + justify-content: center; + border-radius: 50%; + .icon { + width: 18rpx; + height: 28rpx; + } + } + .right { + position: absolute; + top: 180rpx; + right: -65rpx; + width: 56rpx; + height: 56rpx; + background: #ffffff; + box-shadow: 0rpx 6rpx 28rpx 0rpx rgba(0, 0, 0, 0.18); + border: 1rpx solid #e8e8e8; + display: flex; + align-items: center; + justify-content: center; + border-radius: 50%; + .icon { + width: 18rpx; + height: 28rpx; + } + } + } + } + .share { + padding: 40rpx 0 10rpx; + font-size: 24rpx; + color: #e04775; + display: flex; + justify-content: center; + align-items: center; + .icon { + margin-right: 8rpx; + width: 22rpx; + height: 22rpx; + } + } + } + } + } + .banner { + margin: 36rpx 0 0; + padding: 20rpx; + border-radius: 24rpx; + background-color: #e04775; + display: flex; + align-items: center; + justify-content: space-between; + .inner { + flex: 1; + font-size: 28rpx; + color: #fafafa; + } + .btn { + flex-shrink: 0; + width: 152rpx; + height: 64rpx; + text-align: center; + line-height: 64rpx; + font-size: 28rpx; + color: #e04775; + background: #ffffff; + border-radius: 12rpx; + } + } + .tabs { + margin-top: 36rpx; + display: inline-flex; + background-color: #fff; + box-shadow: 0rpx 8rpx 32rpx 0rpx rgba(0, 0, 0, 0.13); + border-radius: 12rpx; + overflow: hidden; + .tab { + padding: 10rpx 20rpx; + line-height: 40rpx; + font-size: 28rpx; + color: #666666; + background-color: #fff; + &.active { + background-color: #e04775; + color: #fff; + } + &:nth-of-type(2) { + border: 1px solid #dddddd; + border-top: none; + border-bottom: none; + } + } + } + .detail { + margin-top: 34rpx; + .d-header { + display: flex; + justify-content: space-between; + align-items: center; + .title { + font-size: 32rpx; + color: rgba(71, 71, 71, 1); + font-weight: bold; + } + .more { + font-size: 24rpx; + color: rgba(204, 204, 204, 1); + } + } + .module { + margin-top: 30rpx; + .module-header { + display: flex; + .date { + flex-shrink: 0; + font-size: 24rpx; + color: #333333; + } + .tags { + margin-left: 14rpx; + flex: 1; + display: flex; + flex-wrap: nowrap; + overflow-x: scroll; + white-space: nowrap; + &::-webkit-scrollbar { + display: none; + } + .tag1 { + margin-left: 14rpx; + padding: 0 12rpx; + background: #d86687; + border-radius: 6rpx; + font-size: 24rpx; + line-height: 36rpx; + text-align: center; + color: #ffffff; + } + .tag2 { + margin-left: 14rpx; + padding: 0 12rpx; + background: #0b184f; + border-radius: 6rpx; + font-size: 24rpx; + line-height: 36rpx; + text-align: center; + color: #ffffff; + } + .tag3 { + margin-left: 14rpx; + padding: 0 12rpx; + background: #24d8c8; + border-radius: 6rpx; + font-size: 24rpx; + line-height: 36rpx; + text-align: center; + color: #ffffff; + } + } + } + .module-container { + margin-top: 24rpx; + display: flex; + .aside { + margin-right: 30rpx; + padding-left: 14rpx; + border-right: 1px dashed #dddddd; + } + .card { + flex: 1; + box-shadow: 0 4rpx 29rpx 0rpx rgba(207, 83, 116, 0.25); + border-radius: 24rpx; + .card-header { + padding: 20rpx 18rpx 4rpx 48rpx; + border-radius: 24rpx 24rpx 0 0; + display: flex; + align-items: center; + justify-content: space-between; + box-shadow: 8rpx 8rpx 16rpx 0rpx rgba(143, 217, 226, 0.1); + &.grade1 { + background: linear-gradient(90deg, #26dac9 7%, rgba(143, 217, 226, 0) 70%, rgba(143, 217, 226, 0) 100%); + } + &.grade2 { + background: linear-gradient( + 90deg, + rgba(235, 111, 87, 1) 7%, + rgba(143, 217, 226, 0) 70%, + rgba(143, 217, 226, 0) 100% + ); + } + &.grade3 { + background: linear-gradient( + 90deg, + rgba(207, 83, 117, 1) 7%, + rgba(143, 217, 226, 0) 70%, + rgba(143, 217, 226, 0) 100% + ); + } + .num { + display: flex; + align-items: baseline; + font-size: 96rpx; + line-height: 1; + color: #ffffff; + letter-spacing: 4rpx; + .sub { + font-size: 24rpx; + color: #fff; + } + } + .num-detail { + display: flex; + .n-item { + width: 73rpx; + &.active { + .box { + background-color: #cf5375; + } + } + .box { + width: 45rpx; + height: 45rpx; + width: 45rpx; + height: 45rpx; + font-size: 32rpx; + color: #fff; + text-align: center; + line-height: 45rpx; + background: #333333; + border-radius: 12rpx 12rpx 12rpx 12rpx; + } + .name { + font-size: 24rpx; + line-height: 48rpx; + color: rgba(51, 51, 51, 0.5); + } + } + } + .status { + font-size: 24rpx; + color: #989898; + text-align: right; + .s-num { + font-size: 32rpx; + } + .s-core { + font-size: 24rpx; + color: #989898; + // background: #484848; + border-radius: 6rpx; + } + } + } + .card-container { + padding: 8rpx 23rpx 20rpx; + border-radius: 0 0 24rpx 24rpx; + background-color: #fff; + .cc-title { + text-indent: 22rpx; + font-size: 24rpx; + color: rgba(79, 79, 79, 1); + } + .cc-content { + margin-top: 12rpx; + padding: 16rpx 20rpx; + border-radius: 24rpx; + background-color: rgba(249, 249, 249, 1); + .line { + font-size: 24rpx; + color: #666666; + line-height: 36rpx; + .dot { + color: #666666; + font-weight: bold; + } + .red { + color: #cf5375; + } + .green { + color: #25d9c8; + } + } + } + .fold { + margin-top: 16rpx; + .fold-header { + display: flex; + justify-content: flex-end; + font-size: 24rpx; + color: rgba(204, 204, 204, 1); + } + .fold-container { + padding-top: 10rpx; + height: 500rpx; + overflow: hidden; + transition: all 0.5s; + &.hide { + padding: 0; + height: 0; + } + .fold-img { + width: 100%; + } + .scurt { + width: 100%; + border: 1px solid rgba(0, 0, 0, 0.1); + box-sizing: border-box; + .s-header { + display: flex; + height: 40rpx; + margin-bottom: -1px; + border-bottom: 1rpx solid rgba(0, 0, 0, 0.1); + .none { + flex-shrink: 0; + width: 226rpx; + background-color: rgba(228, 228, 228, 1); + } + .bar { + flex: 1; + display: flex; + .num { + flex: 1; + text-align: center; + font-size: 24rpx; + color: #fff; + line-height: 40rpx; + } + } + } + .s-body { + display: flex; + .s-aside { + width: 28rpx; + background-color: rgba(102, 102, 102, 0.15); + flex-shrink: 0; + .sa-item { + display: flex; + text-align: center; + justify-content: center; + align-items: center; + font-size: 18rpx; + color: rgba(102, 102, 102, 1); + line-height: 1; + overflow: hidden; + &:not(:last-of-type) { + margin-bottom: -1px; + border-bottom: 1px solid rgba(0, 0, 0, 0.1); + } + } + .sa-item1 { + height: 158rpx; + } + .sa-item2 { + height: 54rpx; + } + .sa-item3 { + height: 106rpx; + } + .sa-item4 { + height: 108rpx; + } + } + .s-container { + flex: 1; + .sc-row { + display: flex; + height: 54rpx; + overflow: hidden; + .sc-title { + width: 198rpx; + font-size: 18rpx; + color: rgba(102, 102, 102, 1); + text-align: center; + line-height: 53rpx; + } + .sc-col { + margin-left: -1px; + border-left: 1px solid rgba(0, 0, 0, 0.1); + flex: 1; + text-align: center; + .icon { + margin-top: 11rpx; + width: 32rpx; + height: 32rpx; + } + } + } + .sc-row:not(:last-of-type) { + margin-bottom: -1px; + border-bottom: 1px solid rgba(0, 0, 0, 0.1); + } + .sc-row:nth-of-type(2n-1) { + background-color: rgba(217, 217, 217, 0.2); + } + } + } + } + } + } + } + } + .sub-card { + flex: 1; + padding: 14rpx 24rpx 14rpx 48rpx; + display: flex; + align-items: center; + justify-content: space-between; + background: linear-gradient(110deg, #2280d5 0%, #ffffff 60%, #ffffff 100%); + box-shadow: 0 4rpx 29rpx 0rpx rgba(207, 83, 116, 0.25); + border-radius: 24rpx; + .left { + font-size: 96rpx; + color: #fff; + line-height: 1; + .sub { + font-size: 24rpx; + } + } + .inner { + text-align: right; + .i-title { + font-size: 24rpx; + color: #989898; + .num { + font-size: 32rpx; + } + } + .sign { + font-size: 32rpx; + .num { + font-size: 40rpx; + } + } + .i-content { + font-size: 24rpx; + color: #989898; + } + } + } + .drug-card { + margin-top: 30rpx; + flex: 1; + box-shadow: 0 4rpx 29rpx 0rpx rgba(207, 83, 116, 0.25); + border-radius: 24rpx; + .d-header { + border-radius: 24rpx 0 0 0; + padding: 20rpx 50rpx; + display: flex; + align-items: center; + justify-content: space-between; + background: linear-gradient(95deg, #26dac9 7%, rgba(143, 217, 226, 0) 100%); + .name { + font-size: 28rpx; + color: #ffffff; + } + .status { + font-size: 22rpx; + color: #5b6363; + .num { + font-size: 22rpx; + color: #cf5375; + } + } + } + .content { + padding: 20rpx 50rpx; + font-size: 22rpx; + color: #666666; + } + } + } + } + } + .add { + position: fixed; + left: 50%; + bottom: 45rpx; + transform: translateX(-50%); + width: 152rpx; + height: 152rpx; + z-index: 10000; + } +} diff --git a/src/gift/pages/myHealthRecord/index.ts b/src/gift/pages/myHealthRecord/index.ts new file mode 100644 index 0000000..eb3004e --- /dev/null +++ b/src/gift/pages/myHealthRecord/index.ts @@ -0,0 +1,1091 @@ +import dayjs from 'dayjs' +const app = getApp() +const licia = require('miniprogram-licia') + +let echarts: any = null + +Page({ + data: { + calendarDate: '', + fold: true, + ec: { + lazyLoad: true, + }, + calendarConfig: { + multi: false, + hideSelectYear: true, + autoChoosedWhenJump: true, + firstDayOfWeek: 'Mon', + theme: 'nuohe', + takeoverTap: true, + highlightToday: true, + onlyShowCurrentMonth: true, + disableMode: { + type: 'after', // [‘before’, 'after'] + }, + }, + foldAll: true, + + BeginMonth: '', + EndMonth: '', + Type: '2', + Num: '' as string | number, + fields: { + 1: 'day', + 2: 'month', + 3: 'year', + }, + + detail: {}, + alertAdl: {}, + partNameList: app.globalData.partNameList, + list: [], + pagination: { + page: 1, + pages: 1, + count: 1, + }, + defaultList: [], + count: 0, + defaultListLast: {}, + + mList: [], + + userInfo: {} as any, + todayBg: '', + + page: 0, + + tableData: [ + { + title: '说话', + key: 'TalkingScore', + }, + { + title: '咀嚼', + key: 'ChewScore', + }, + { + title: '吞咽', + key: 'SwallowScore', + }, + { + title: '呼吸', + key: 'BreathScore', + }, + { + title: '刷牙梳头能力受损', + key: 'BrushTeethAndCombHairScore', + }, + { + title: '从椅子上起身能力受损', + key: 'GetUpFromChairScore', + }, + { + title: '复视/重影', + key: 'DoubleVisionScore', + }, + { + title: '眼睑下垂', + key: 'DroopyEyelidsScore', + }, + ], + + selectLegends: { + 呼吸: false, + 延髓: false, + 眼肌: false, + 肢体: false, + 总分: true, + }, + + tab: 1, + + theme: '', + }, + ecDataTrendComponent: null as any, + ecDataHormoneComponent: null as any, + onLoad() { + app.getTheme().then((res) => { + this.setData({ + theme: res, + }) + }) + }, + async onShow() { + echarts = await require.async('../../../resource/components/echart/echarts.js') + this.ecDataTrendComponent = this.selectComponent('#mychart-dom-bar') + this.ecDataHormoneComponent = this.selectComponent('#mychart-hormone') + this.setData({ + calendarDate: dayjs().format('YYYY-MM'), + }) + this.handleChangeType() + app.waitLogin().then(() => { + // 强制疾病患者以上身份 + app.permissionVerification(3, 0, `/gift/pages/myHealthRecord/index`).then(() => { + app.mpBehavior({ PageName: 'PG_PATIENTHEALTHRECORD' }) + app.getUserInfo(this, true, (res) => { + if (res.UserType != 4) { + this.setData({ + tab: 2, + }) + } + this.getCale() + this.handleTabCallBack() + this.getMedicationAlertAdl() + }) + }) + }) + }, + handleChangeInput() { + if (Number(this.data.Num) > 100) { + this.setData({ + Num: 100, + }) + } + }, + getCale() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/adl/cale', + data: { + Month: this.data.calendarDate, + }, + }).then((res) => { + this.setCalendarTodos(res) + }) + }, + setCalendarTodos({ adl = [], medication = [] }: { adl: any[]; medication: string[] }) { + const theme = this.data.theme + const calendar = this.selectComponent('#calendar').calendar + const adlDate = adl.map((item) => item.Date) + const dates: any[] = [] + const intersectDate = licia.intersect(adlDate, medication) + const filterAdlDate = adl.filter((item) => !intersectDate.includes(item.Date)) + const filterMedication = medication.filter((item) => !intersectDate.includes(item)) + const intersectAdlDate = adl.filter((item) => intersectDate.includes(item.Date)) + const doc = theme === 'DRUG' ? 'doc' : ' ' + filterMedication.forEach((Date: string) => { + dates.push({ + year: Date.split('-')[0], + month: Date.split('-')[1], + date: Date.split('-')[2], + class: doc, + }) + }) + intersectAdlDate.forEach(({ Date, TotalScore, LastTotalScore }) => { + dates.push({ + year: Date.split('-')[0], + month: Date.split('-')[1], + date: Date.split('-')[2], + class: TotalScore > 5 || TotalScore - LastTotalScore >= 2 ? `error ${doc}` : `primary ${doc}`, + }) + }) + filterAdlDate.forEach(({ Date, TotalScore, LastTotalScore }) => { + dates.push({ + year: Date.split('-')[0], + month: Date.split('-')[1], + date: Date.split('-')[2], + class: TotalScore > 5 || TotalScore - LastTotalScore >= 2 ? 'error' : 'primary', + }) + }) + calendar.setDateStyle(dates) + }, + getMedicationAlertAdl() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/medication/medication-alert-adl', + data: {}, + }).then((res) => { + this.setData({ + alertAdl: res, + }) + }) + }, + handleWhenChangeMonth(e: { detail: { next: any } }) { + const current = e.detail.next + this.setData({ + calendarDate: dayjs(`${current.year}-${current.month}`).format('YYYY-MM'), + }) + this.getCale() + }, + handleChangeType(e?: WechatMiniprogram.CustomEvent) { + let type = '' + let callback = true + if (e) { + type = e.currentTarget.dataset.type + } else { + type = this.data.Type + callback = false + } + let EndMonth = '' + let BeginMonth = '' + if (type == '1') { + if (e) { + app.mpBehavior({ PageName: 'BTN_PATIENTHEALTHRECORDDAILYCURVE' }) + } + EndMonth = dayjs().format('YYYY-MM-DD') + BeginMonth = dayjs().subtract(6, 'd').format('YYYY-MM-DD') + } else if (type == '2') { + if (e) { + app.mpBehavior({ PageName: 'BTN_PATIENTHEALTHRECORDMONTHLYCURVE' }) + } + EndMonth = dayjs().format('YYYY-MM') + BeginMonth = dayjs().subtract(1, 'M').format('YYYY-MM') + } else if (type == '3') { + if (e) { + app.mpBehavior({ PageName: 'BTN_PATIENTHEALTHRECORDYEARLYCURVE' }) + } + EndMonth = dayjs().format('YYYY') + BeginMonth = dayjs().subtract(1, 'y').format('YYYY') + } else if (type == '4' && e) { + app.mpBehavior({ PageName: 'BTN_PATIENTHEALTHRECORDTIMECURVE' }) + } + this.setData({ + page: 0, + Type: type, + Num: '5', + EndMonth, + BeginMonth, + }) + if (callback) { + this.handleTabCallBack() + } + }, + handleChange() { + this.handleTabCallBack() + }, + handleTab(e) { + const { index } = e.currentTarget.dataset + this.setData({ + tab: index, + }) + if (index == 1) { + app.mpBehavior({ PageName: 'BTN_PATIENTHEALTHRECORDCOMPREHENSIVEREPORT' }) + } + if (index == 2) { + app.mpBehavior({ PageName: 'BTN_PATIENTHEALTHRECORDDUALCOMPLIANCENOTES' }) + } + if (index == 3) { + app.mpBehavior({ PageName: 'BTN_PATIENTHEALTHRECORDMEDICATIONRECORD' }) + } + this.handleTabCallBack() + }, + handleTabCallBack() { + const tab = this.data.tab + this.setData({ + pagination: { + page: 1, + pages: 1, + count: 1, + }, + }) + if (tab == 1) { + this.getAllList() + } + if (tab == 2) { + this.getList() + } + if (tab == 3) { + this.getMedicationList() + } + this.getChart() + }, + getAllList(newPage = 1) { + const { BeginMonth, EndMonth, Type, Num } = this.data + wx.ajax({ + method: 'GET', + url: '?r=igg4/adl/composite-list', + data: { + Type: Number(Type) === 4 ? 2 : 1, + DateType: Number(Type) === 4 ? '' : Number(Type), + StartDate: BeginMonth, + EndDate: EndMonth, + Num, + page: newPage, + }, + }).then((res) => { + const list = res.list + list.map((item) => { + let grade = 1 + if (item.TotalScore < 5) { + grade = 1 + } else if (item.TotalScore >= 5 && item.TotalScore < 15) { + grade = 2 + } else { + grade = 3 + } + item.grade = grade + item.fold = true + return item + }) + + const newList = res.page === 1 ? res.list : [...this.data.list, ...res.list] + this.setData({ + list: newList, + pagination: { + page: res.page, + pages: res.pages, + count: res.count, + }, + }) + }) + }, + onReachBottom() { + const { page, pages } = this.data.pagination + const tab = this.data.tab + if (pages > page) { + if (tab == 1) { + this.getAllList(page + 1) + } + if (tab == 2) { + this.getList(page + 1) + } + if (tab == 3) { + this.getMedicationList(page + 1) + } + } + }, + getList(newPage = 1) { + const { BeginMonth, EndMonth, Type, Num } = this.data + wx.ajax({ + method: 'GET', + url: '?r=igg4/adl/list', + data: { + Type: Number(Type) === 4 ? 2 : 1, + DateType: Number(Type) === 4 ? '' : Number(Type), + StartDate: BeginMonth, + EndDate: EndMonth, + Num, + page: newPage, + }, + }).then((res) => { + const list = res.list + list.map((item) => { + let grade = 1 + if (item.TotalScore < 5) { + grade = 1 + } else if (item.TotalScore >= 5 && item.TotalScore < 15) { + grade = 2 + } else { + grade = 3 + } + item.grade = grade + item.fold = true + item.Type = 1 + return item + }) + const newList = res.page === 1 ? res.list : [...this.data.list, ...res.list] + this.setData({ + list: newList, + pagination: { + page: res.page, + pages: res.pages, + count: res.count, + }, + }) + }) + }, + getMedicationList(newPage = 1) { + const { BeginMonth, EndMonth, Type, Num } = this.data + wx.ajax({ + method: 'GET', + url: '?r=igg4/medication/list', + data: { + Type: Number(Type) === 4 ? 2 : 1, + DateType: Number(Type) === 4 ? '' : Number(Type), + StartDate: BeginMonth, + EndDate: EndMonth, + Num, + page: newPage, + }, + }).then((res) => { + const list = res.list + list.map((item) => { + let grade = 1 + if (item.TotalScore < 5) { + grade = 1 + } else if (item.TotalScore >= 5 && item.TotalScore < 15) { + grade = 2 + } else { + grade = 3 + } + item.grade = grade + item.fold = true + item.Type = 2 + return item + }) + const newList = res.page === 1 ? res.list : [...this.data.list, ...res.list] + this.setData({ + list: newList, + pagination: { + page: res.page, + pages: res.pages, + count: res.count, + }, + }) + }) + }, + getChart() { + const { BeginMonth, EndMonth, Type, Num } = this.data + wx.ajax({ + method: 'GET', + url: '?r=igg4/adl/list', + data: { + Type: Number(Type) === 4 ? 2 : 1, + DateType: Number(Type) === 4 ? '' : Number(Type), + StartDate: BeginMonth, + EndDate: EndMonth, + Num, + count: 0, + IsAsc: 1, + }, + }).then(async (res) => { + if (Number(Type) == 4) { + this.setData({ + defaultList: res.list, + count: res.list.length, + defaultListLast: res.list.at(-1), + }) + const chart1 = await this.initChart(res.list) + const chart2 = await this.initHormoneChart(res.list) + echarts.connect([chart1, chart2]) + } + }) + if (Number(Type) != 4) { + wx.ajax({ + method: 'GET', + url: '?r=igg4/adl/graph', + data: { + Type: Number(Type) === 4 ? 2 : 1, + DateType: Number(Type) === 4 ? '' : Number(Type), + StartDate: BeginMonth, + EndDate: EndMonth, + count: 0, + }, + }).then(async (res) => { + const medication = res.medication.map((item) => { + return { + Date: item.InjectionDate, + ...item, + } + }) + const list = res.list + const newList: any[] = this.mergeArr(list, medication) + + if (Number(Type) != 4) { + this.setData({ + defaultList: newList as never[], + defaultListLast: newList.at(-1), + count: list.length, + }) + const chart1 = await this.initChart(newList as never[]) + const chart2 = await this.initHormoneChart(newList as never[]) + echarts.connect([chart1, chart2]) + } + }) + } + }, + mergeArr(array1: any[] = [], array2: any[] = []) { + // 合并两个数组中相同Date字段的对象 + const mergedArray: any[] = [] + const mergedMap = new Map() + + array1.concat(array2).forEach((obj) => { + const date = obj.Date + if (mergedMap.has(date)) { + mergedMap.get(date).push(obj) + } else { + mergedMap.set(date, [obj]) + } + }) + + mergedMap.forEach((objs: any) => { + if (objs.length === 1) { + mergedArray.push(objs[0]) + } else { + const mergedObj = objs.reduce((acc, cur) => ({ ...acc, ...cur })) + mergedArray.push(mergedObj) + } + }) + + // 按照Date字段对合并后的数组进行排序 + mergedArray.sort((a, b) => { + return a.Date.localeCompare(b.Date) + }) + return mergedArray + }, + + initChart(defaultList = []) { + const { theme } = this.data + const list: any = defaultList + return new Promise((reslove) => { + this.ecDataTrendComponent.init((canvas, width, height, dpr) => { + const chart = echarts.init(canvas, null, { + width, + height, + devicePixelRatio: dpr, // new + }) + canvas.setChart(chart) + + const option: any = { + tooltip: { + show: false, + trigger: 'axis', + axisPointer: { + type: 'shadow', + }, + confine: true, + backgroundColor: 'rgba(0, 0, 0, 0.5)', + textStyle: { + color: '#fff', + fontSize: 10, + }, + order: 'seriesDesc', + }, + grid: { + top: '30', + left: '0', + right: '0', + bottom: '10', + containLabel: true, + }, + xAxis: [ + { + type: 'category', + axisTick: { + show: true, + inside: true, + length: 1, + alignWithLabel: true, + lineStyle: { + type: 'dotted', + color: '#D8D8D8', + width: 4, + cap: 'round', + }, + }, + axisLine: { + lineStyle: { + color: '#8C8C8C', + type: 'dashed', + }, + }, + data: list.map((item) => dayjs(item.Date).format('MM-DD')), + axisLabel: { + formatter() { + return '' + }, + }, + }, + ], + yAxis: [ + { + type: 'value', + minInterval: 1, + }, + ], + series: [ + { + name: '总分', + data: list.length ? list.map((item) => item.TotalScore) : [25], + barWidth: '16', + label: { + show: true, + position: 'top', + color: '#CF5375', + }, + type: 'line', + symbol: 'circle', + symbolSize: 8, + showSymbol: list.length >= 1, + connectNulls: true, + z: 10, + itemStyle: { + color: '#CF5375', + }, + markLine: { + symbol: ['none', 'none'], + data: [ + { + name: '达标区(1分)', + yAxis: 1, + label: { + formatter: '{b}', + position: 'insideMiddle', + color: '#24D8C8', + fontSize: '10', + }, + lineStyle: { + cap: '', + color: '#34D7C7', + type: 'dashed', + }, + }, + ], + }, + markArea: { + itemStyle: { + color: 'rgba(37,217,200,0.19)', + }, + data: [ + [ + { + yAxis: 0, + }, + { + yAxis: 1, + }, + ], + ], + }, + }, + ], + dataZoom: { + type: 'inside', // 有type这个属性,滚动条在最下面,也可以不行,写y:36,这表示距离顶端36px,一般就是在图上面。 + startValue: 0, + endValue: 4, + filterMode: 'none', + }, + } + + if (theme === 'DRUG') { + const markLineData = list + .filter((item) => item.InjectionBottles) + .map((item) => { + return { + name: '', + xAxis: dayjs(item.Date).format('MM-DD'), + lineStyle: { + color: 'rgba(37, 217, 200,0.5)', + cap: '', + type: 'solid', + }, + + label: { + formatter: '', + position: 'insideEndBottom', + rotate: 0, + color: '#25D9C8', + offset: [60, 0], + }, + } + }) + option.series.push({ + name: '用药', + data: list.map((item) => (item.InjectionBottles ? 0 : null)), + type: 'line', + symbol: + 'image://data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAABACAYAAABhspUgAAAAAXNSR0IArs4c6QAACAVJREFUaEPtmltsHFcZx/9nZu92bMdJSMitzoWkoXVKUrVV8wKk4gHxgJTwgKA8lhfgCZBoUJEqUYGA0AhRQUSpFJQIHlyqogZFIipUoKiAKJAYQkp9qR1ir9fe6+zuXM4FfWf2MrOJY+/aS0zlkRxZzsw5v/nP/3znO+c7DItcl4vFTWVl/7wg5EctKSK2knCVBFcKcrGH7vL3MvfwVnYeGbsaustgAAODCSDCDLU1Hp/Ym+o7fnrvB9+9U3NssT5ezWe+k5X8qwvCQ0FwVKSEswJg6sfmHH+cm2l0SZ3Tj8F84ChjiDID+1I9ly4ceuTjbQFfyM2MpDk/meEu8oKjJIUG9khh1YHEtUeupgPAWl3AAENEwzLEmIGd8dToq8OPDbcF/OLCrZFZ7p5Mcxc5wVEUAmQLT8mOLFHvfCwzF7ZEC3CcGdiRSIxeHD7WHvDZhZsjM56ngbMELDlsWVO4c4ExOd8E9i1R969vhzhj2BFPjv76cJvApPCtkMK8YYkVOALLUXh7PNE+8M/Iw553MiN8S1ii6eGVAI+mZ0PfhzHoAWfWBlyMMWyPJ0dfG368PUu8nJ8bWRD8ZPYOUWIlwH+YmQ4Dg8FoAPu22J5Ijb7ywKPtAV8uZZ/LC36qIH11q7UIIZRCp8CW5+Ly7M3bgVkzUlC0ONC74VcvHTj6ybaiBN38RmVhV9YxTBs2nrl08VTRrjy1gvEGZRh+HGu5epOp808ceehMFFEkDYN/f++Df1+sn0UnjtYHjB9+63tQ6ssrAV70WcZOyy8+/ZXltL0o8Hfzk3u4jc94Bh7nSm0uOZWNruvFozBMkzEG+iF3KGm5XJTAZFVIxRXCjnGkNB0pIwXPTWYcu6/MeYLAgh1HozHeE48VE6Y5vyFiXknFoufO73/4nWVZ4kwmc9BG5QVLiONcKSYYEFU0z/vd1P3rQaEiBYiwnSvr2Jgo5mFxTz9Gcbj+AjTjmczPKbbF41fej9jnzz5w9J/B9kMKP58e/1xO4ayjZNKlwaUUkqYJJZsDjRKfBcH1dN3pRa3dKpUwX61oqRs5RS1amLWpOmWYzv5k7xfO3X/0p/W+GsBnMtNPLQjvx1UlDUcKQDEkDKanYRJR6W+tMM0dzPPOYYMvmauWkStXfOBA1kYxWecWMJAwDHV/T9+Xzh088kLDSmfmpx9b8Lw3qpDxqv7MCilmaFBJ/9aMmZYcY05VK78aFw2DrGXBdp2AymSLQDIEAynD9B4c3PKRnwwduqIV/ubc5N+Kgj9EnqQEhxIQ+iwyEHPJIm+WSxBMj7TV4NX+lVIiXyzURGCg/NjP3ijdNEAzH/FsjcX/dWn42CH2g+zMJ9Ju5bWyFDrnFQB6GMGSur4N6Bpzq5hwnVUBbW2kWq3CcXyV6QoMvgZwghk43Dtwgn17burlrHBPaGAlEQFDnN68Bku41NDvrQLsVVK2FZhzAcsqNYCpP/rCZA2tsGGAgIeSvRfZs3Pj0wUhdpZr028vo/cj4OaHJ+WvVIpdUbfeaKHg26KpMoU3P7cgaALeHIun2TPpcaskeE9ZSp0v9DPTjwoB4Cytx+xyV4FLxSKE9FeL9TDnZ3D+KoSA+yIRm52aGVOWEiBLVKXEoBHRdtDRoXbNcQ9XuwxMliBrhIBr8VgDGwxJZoI9TcCSo6wkHCmxUQOHV8Zz3MVVu9JVha2SBR6YjCjlrK/1tCUMwwf+WgDYrQGLlsC1VoDJFiHgoMLBSLsWgClSJOvAJdncd6hbYi0B08DzLVFTeB24g+F5t0G3rnAHgt72yLrC93LieO952ARHVDWXQQVuYbqaWQ2rLtrGVJmhEljR6pyRFqS1fIKS+LjB/JmuNQ7vlrMYUs1dxp3udRwrvdJV4GedJ3BDbl6yj1UFdgsJVNMbQp0mt5UQ67OXBLknwOO/OILi2KYQXN++Bez99F/XJvA75x+G9e7GEFzvfTnsf/Iv68CNKhFla50OujWtsD3fA2tyMPSpM3/eBSebCv0tPljBlkfCm9i9Q1kkNofXiF0fdJO/HEb++tYlvXmnGwYOpTF04lrov7oOPDFyGIUb7+sIuP9gBns+Fd6zXgdunen+7xT+z28OIPOn3R1ZYsujU9jxsbf/tx6m3pQMVxzGLhyFNdUycezOYd9n3wrBMeP23c+ue/hO0q7pOLwOfC/Sy1uvfwDZa9tC4g8Oz2L78X8vOTjviYeXpLrLDSsC3qqy2KZyjeYH3EnsKf92JTxLPvti9UOYkv233eefWKEqE52rWGSJFNx9pxbu9Wbge2/VvOYVru/Ar+UN7cb+8FosGTRrz35RpulhE+zrs1TjoKKMf5BuIzN1cTFYRcpwD6NOd2scxRIVZZqbN/q0la7sN6tIumTwjdlxXUWqCAIW6KeiTMtxxXnh4boTPoK4ZJxq84ZssQgvAEwl3HpVXyusK0kG2HNzk/mSEP0VJfS5NCosKjq7USuAU15lKYkbXa4i3czlwOkUQe0KAtfrzf2RqMVOZ6Z+VxD8w1RUJEtElV9JDx4Ipd8nXFtX+btxOULg7ay/d9eohDL/tFX9PCZB70qk3mQ/ys0M5T3nWlXKXqrYcyaRpFtrRw7qiPQyRa3Aso8JLevdqAg/mptHwW1uZ9XPYxIwiUc/GyLRyuH+LcO6d4KuCv5SRYojrpQDFIcjMLTp60dcdMJel6D1YM+y0MI3uUIg57n4RyGLoueGE/xar2SLHsO0NsXi13b1DDz5/H0Hxv8Lo3UyF0Y2DrcAAAAASUVORK5CYII=', + symbolSize: [11, 16], + symbolOffset: [0, 0], + itemStyle: { + color: '#25D9C8', + }, + lineStyle: { + width: 0, + }, + tooltip: { + show: false, + }, + z: 11, + markLine: { + symbol: ['none', 'none'], + data: markLineData, + }, + }) + // option.series.push({ + // name: "用药时间", + // data: list.map((item: any) => (item.InjectionBottles ? item.TotalScore : 0)), + // type: "line", + // symbol: + // "image://data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAABACAYAAABhspUgAAAAAXNSR0IArs4c6QAACAVJREFUaEPtmltsHFcZx/9nZu92bMdJSMitzoWkoXVKUrVV8wKk4gHxgJTwgKA8lhfgCZBoUJEqUYGA0AhRQUSpFJQIHlyqogZFIipUoKiAKJAYQkp9qR1ir9fe6+zuXM4FfWf2MrOJY+/aS0zlkRxZzsw5v/nP/3znO+c7DItcl4vFTWVl/7wg5EctKSK2knCVBFcKcrGH7vL3MvfwVnYeGbsaustgAAODCSDCDLU1Hp/Ym+o7fnrvB9+9U3NssT5ezWe+k5X8qwvCQ0FwVKSEswJg6sfmHH+cm2l0SZ3Tj8F84ChjiDID+1I9ly4ceuTjbQFfyM2MpDk/meEu8oKjJIUG9khh1YHEtUeupgPAWl3AAENEwzLEmIGd8dToq8OPDbcF/OLCrZFZ7p5Mcxc5wVEUAmQLT8mOLFHvfCwzF7ZEC3CcGdiRSIxeHD7WHvDZhZsjM56ngbMELDlsWVO4c4ExOd8E9i1R969vhzhj2BFPjv76cJvApPCtkMK8YYkVOALLUXh7PNE+8M/Iw553MiN8S1ii6eGVAI+mZ0PfhzHoAWfWBlyMMWyPJ0dfG368PUu8nJ8bWRD8ZPYOUWIlwH+YmQ4Dg8FoAPu22J5Ijb7ywKPtAV8uZZ/LC36qIH11q7UIIZRCp8CW5+Ly7M3bgVkzUlC0ONC74VcvHTj6ybaiBN38RmVhV9YxTBs2nrl08VTRrjy1gvEGZRh+HGu5epOp808ceehMFFEkDYN/f++Df1+sn0UnjtYHjB9+63tQ6ssrAV70WcZOyy8+/ZXltL0o8Hfzk3u4jc94Bh7nSm0uOZWNruvFozBMkzEG+iF3KGm5XJTAZFVIxRXCjnGkNB0pIwXPTWYcu6/MeYLAgh1HozHeE48VE6Y5vyFiXknFoufO73/4nWVZ4kwmc9BG5QVLiONcKSYYEFU0z/vd1P3rQaEiBYiwnSvr2Jgo5mFxTz9Gcbj+AjTjmczPKbbF41fej9jnzz5w9J/B9kMKP58e/1xO4ayjZNKlwaUUkqYJJZsDjRKfBcH1dN3pRa3dKpUwX61oqRs5RS1amLWpOmWYzv5k7xfO3X/0p/W+GsBnMtNPLQjvx1UlDUcKQDEkDKanYRJR6W+tMM0dzPPOYYMvmauWkStXfOBA1kYxWecWMJAwDHV/T9+Xzh088kLDSmfmpx9b8Lw3qpDxqv7MCilmaFBJ/9aMmZYcY05VK78aFw2DrGXBdp2AymSLQDIEAynD9B4c3PKRnwwduqIV/ubc5N+Kgj9EnqQEhxIQ+iwyEHPJIm+WSxBMj7TV4NX+lVIiXyzURGCg/NjP3ijdNEAzH/FsjcX/dWn42CH2g+zMJ9Ju5bWyFDrnFQB6GMGSur4N6Bpzq5hwnVUBbW2kWq3CcXyV6QoMvgZwghk43Dtwgn17burlrHBPaGAlEQFDnN68Bku41NDvrQLsVVK2FZhzAcsqNYCpP/rCZA2tsGGAgIeSvRfZs3Pj0wUhdpZr028vo/cj4OaHJ+WvVIpdUbfeaKHg26KpMoU3P7cgaALeHIun2TPpcaskeE9ZSp0v9DPTjwoB4Cytx+xyV4FLxSKE9FeL9TDnZ3D+KoSA+yIRm52aGVOWEiBLVKXEoBHRdtDRoXbNcQ9XuwxMliBrhIBr8VgDGwxJZoI9TcCSo6wkHCmxUQOHV8Zz3MVVu9JVha2SBR6YjCjlrK/1tCUMwwf+WgDYrQGLlsC1VoDJFiHgoMLBSLsWgClSJOvAJdncd6hbYi0B08DzLVFTeB24g+F5t0G3rnAHgt72yLrC93LieO952ARHVDWXQQVuYbqaWQ2rLtrGVJmhEljR6pyRFqS1fIKS+LjB/JmuNQ7vlrMYUs1dxp3udRwrvdJV4GedJ3BDbl6yj1UFdgsJVNMbQp0mt5UQ67OXBLknwOO/OILi2KYQXN++Bez99F/XJvA75x+G9e7GEFzvfTnsf/Iv68CNKhFla50OujWtsD3fA2tyMPSpM3/eBSebCv0tPljBlkfCm9i9Q1kkNofXiF0fdJO/HEb++tYlvXmnGwYOpTF04lrov7oOPDFyGIUb7+sIuP9gBns+Fd6zXgdunen+7xT+z28OIPOn3R1ZYsujU9jxsbf/tx6m3pQMVxzGLhyFNdUycezOYd9n3wrBMeP23c+ue/hO0q7pOLwOfC/Sy1uvfwDZa9tC4g8Oz2L78X8vOTjviYeXpLrLDSsC3qqy2KZyjeYH3EnsKf92JTxLPvti9UOYkv233eefWKEqE52rWGSJFNx9pxbu9Wbge2/VvOYVru/Ar+UN7cb+8FosGTRrz35RpulhE+zrs1TjoKKMf5BuIzN1cTFYRcpwD6NOd2scxRIVZZqbN/q0la7sN6tIumTwjdlxXUWqCAIW6KeiTMtxxXnh4boTPoK4ZJxq84ZssQgvAEwl3HpVXyusK0kG2HNzk/mSEP0VJfS5NCosKjq7USuAU15lKYkbXa4i3czlwOkUQe0KAtfrzf2RqMVOZ6Z+VxD8w1RUJEtElV9JDx4Ipd8nXFtX+btxOULg7ay/d9eohDL/tFX9PCZB70qk3mQ/ys0M5T3nWlXKXqrYcyaRpFtrRw7qiPQyRa3Aso8JLevdqAg/mptHwW1uZ9XPYxIwiUc/GyLRyuH+LcO6d4KuCv5SRYojrpQDFIcjMLTp60dcdMJel6D1YM+y0MI3uUIg57n4RyGLoueGE/xar2SLHsO0NsXi13b1DDz5/H0Hxv8Lo3UyF0Y2DrcAAAAASUVORK5CYII=", + // symbolSize: [11, 16], + // symbolOffset: [0, "100%"], + // itemStyle: { + // color: "#25D9C8", + // }, + // tooltip: { + // show: false, + // }, + // lineStyle: { + // width: 0, + // }, + // z: 1, + // }); + } + + chart.setOption(option) + reslove(chart) + return chart + }) + }) + }, + initHormoneChart(defaultList = []) { + const { theme } = this.data + const list: any = defaultList + return new Promise((reslove) => { + this.ecDataHormoneComponent.init((canvas, width, height, dpr) => { + const chart = echarts.init(canvas, null, { + width, + height, + devicePixelRatio: dpr, // new + }) + canvas.setChart(chart) + + const option: any = { + tooltip: { + show: false, + trigger: 'axis', + axisPointer: { + type: 'shadow', + }, + confine: true, + backgroundColor: 'rgba(0, 0, 0, 0.5)', + textStyle: { + color: '#fff', + fontSize: 10, + }, + order: 'seriesDesc', + }, + grid: { + top: '30', + left: '0', + right: '0', + bottom: '10', + containLabel: true, + }, + xAxis: [ + { + type: 'category', + axisTick: { + show: true, + inside: true, + length: 1, + alignWithLabel: true, + lineStyle: { + type: 'dotted', + color: '#D8D8D8', + width: 4, + cap: 'round', + }, + }, + axisLine: { + lineStyle: { + color: '#8C8C8C', + type: 'dashed', + }, + }, + data: list.map((item) => dayjs(item.Date).format('MM-DD')), + }, + ], + yAxis: [ + { + type: 'value', + minInterval: 1, + max(value) { + return value.max + 20 > 999 ? 999 : value.max + 20 + }, + axisLabel: { + // width: 20, + formatter(value: number) { + return value + }, + }, + }, + ], + series: [ + { + name: '激素用量', + data: list.length ? list.map((item) => item.SteroidDailyDose) : [20], + barWidth: '16', + type: 'line', + symbol: 'circle', + symbolSize: 8, + connectNulls: true, + showSymbol: list.length >= 1, + z: 10, + label: { + show: true, + position: 'top', + color: '#18474e', + z: 11, + formatter({ value }) { + return `${value}mg` + }, + }, + itemStyle: { + color: '#3192A1', + }, + markLine: { + symbol: ['none', 'none'], + data: [ + { + name: '达标区(10mg)', + yAxis: 10, + label: { + formatter: '{b}', + position: 'insideMiddle', + color: '#24D8C8', + fontSize: '10', + }, + lineStyle: { + cap: '', + color: '#34D7C7', + type: 'dashed', + }, + }, + ], + }, + markArea: { + itemStyle: { + color: 'rgba(37,217,200,0.19)', + }, + data: [ + [ + { + yAxis: 0, + }, + { + yAxis: 10, + }, + ], + ], + }, + }, + ], + dataZoom: { + type: 'inside', // 有type这个属性,滚动条在最下面,也可以不行,写y:36,这表示距离顶端36px,一般就是在图上面。 + startValue: 0, + endValue: 4, + filterMode: 'none', + }, + } + if (theme === 'DRUG') { + const markLineData = list + .filter((item) => item.InjectionBottles) + .map((item) => { + return { + name: '', + xAxis: dayjs(item.Date).format('MM-DD'), + lineStyle: { + color: 'rgba(37, 217, 200,0.5)', + cap: '', + type: 'solid', + }, + label: { + formatter: '', + position: 'insideEndBottom', + rotate: 0, + color: '#25D9C8', + offset: [60, 0], + }, + } + }) + const maxValue = Math.max(...list.map((item) => item.SteroidDailyDose)) + option.series.push({ + name: '用药', + data: list.map((item) => (item.InjectionBottles ? 0 : null)), + type: 'line', + symbol: + 'image://data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAABACAYAAABhspUgAAAAAXNSR0IArs4c6QAACAVJREFUaEPtmltsHFcZx/9nZu92bMdJSMitzoWkoXVKUrVV8wKk4gHxgJTwgKA8lhfgCZBoUJEqUYGA0AhRQUSpFJQIHlyqogZFIipUoKiAKJAYQkp9qR1ir9fe6+zuXM4FfWf2MrOJY+/aS0zlkRxZzsw5v/nP/3znO+c7DItcl4vFTWVl/7wg5EctKSK2knCVBFcKcrGH7vL3MvfwVnYeGbsaustgAAODCSDCDLU1Hp/Ym+o7fnrvB9+9U3NssT5ezWe+k5X8qwvCQ0FwVKSEswJg6sfmHH+cm2l0SZ3Tj8F84ChjiDID+1I9ly4ceuTjbQFfyM2MpDk/meEu8oKjJIUG9khh1YHEtUeupgPAWl3AAENEwzLEmIGd8dToq8OPDbcF/OLCrZFZ7p5Mcxc5wVEUAmQLT8mOLFHvfCwzF7ZEC3CcGdiRSIxeHD7WHvDZhZsjM56ngbMELDlsWVO4c4ExOd8E9i1R969vhzhj2BFPjv76cJvApPCtkMK8YYkVOALLUXh7PNE+8M/Iw553MiN8S1ii6eGVAI+mZ0PfhzHoAWfWBlyMMWyPJ0dfG368PUu8nJ8bWRD8ZPYOUWIlwH+YmQ4Dg8FoAPu22J5Ijb7ywKPtAV8uZZ/LC36qIH11q7UIIZRCp8CW5+Ly7M3bgVkzUlC0ONC74VcvHTj6ybaiBN38RmVhV9YxTBs2nrl08VTRrjy1gvEGZRh+HGu5epOp808ceehMFFEkDYN/f++Df1+sn0UnjtYHjB9+63tQ6ssrAV70WcZOyy8+/ZXltL0o8Hfzk3u4jc94Bh7nSm0uOZWNruvFozBMkzEG+iF3KGm5XJTAZFVIxRXCjnGkNB0pIwXPTWYcu6/MeYLAgh1HozHeE48VE6Y5vyFiXknFoufO73/4nWVZ4kwmc9BG5QVLiONcKSYYEFU0z/vd1P3rQaEiBYiwnSvr2Jgo5mFxTz9Gcbj+AjTjmczPKbbF41fej9jnzz5w9J/B9kMKP58e/1xO4ayjZNKlwaUUkqYJJZsDjRKfBcH1dN3pRa3dKpUwX61oqRs5RS1amLWpOmWYzv5k7xfO3X/0p/W+GsBnMtNPLQjvx1UlDUcKQDEkDKanYRJR6W+tMM0dzPPOYYMvmauWkStXfOBA1kYxWecWMJAwDHV/T9+Xzh088kLDSmfmpx9b8Lw3qpDxqv7MCilmaFBJ/9aMmZYcY05VK78aFw2DrGXBdp2AymSLQDIEAynD9B4c3PKRnwwduqIV/ubc5N+Kgj9EnqQEhxIQ+iwyEHPJIm+WSxBMj7TV4NX+lVIiXyzURGCg/NjP3ijdNEAzH/FsjcX/dWn42CH2g+zMJ9Ju5bWyFDrnFQB6GMGSur4N6Bpzq5hwnVUBbW2kWq3CcXyV6QoMvgZwghk43Dtwgn17burlrHBPaGAlEQFDnN68Bku41NDvrQLsVVK2FZhzAcsqNYCpP/rCZA2tsGGAgIeSvRfZs3Pj0wUhdpZr028vo/cj4OaHJ+WvVIpdUbfeaKHg26KpMoU3P7cgaALeHIun2TPpcaskeE9ZSp0v9DPTjwoB4Cytx+xyV4FLxSKE9FeL9TDnZ3D+KoSA+yIRm52aGVOWEiBLVKXEoBHRdtDRoXbNcQ9XuwxMliBrhIBr8VgDGwxJZoI9TcCSo6wkHCmxUQOHV8Zz3MVVu9JVha2SBR6YjCjlrK/1tCUMwwf+WgDYrQGLlsC1VoDJFiHgoMLBSLsWgClSJOvAJdncd6hbYi0B08DzLVFTeB24g+F5t0G3rnAHgt72yLrC93LieO952ARHVDWXQQVuYbqaWQ2rLtrGVJmhEljR6pyRFqS1fIKS+LjB/JmuNQ7vlrMYUs1dxp3udRwrvdJV4GedJ3BDbl6yj1UFdgsJVNMbQp0mt5UQ67OXBLknwOO/OILi2KYQXN++Bez99F/XJvA75x+G9e7GEFzvfTnsf/Iv68CNKhFla50OujWtsD3fA2tyMPSpM3/eBSebCv0tPljBlkfCm9i9Q1kkNofXiF0fdJO/HEb++tYlvXmnGwYOpTF04lrov7oOPDFyGIUb7+sIuP9gBns+Fd6zXgdunen+7xT+z28OIPOn3R1ZYsujU9jxsbf/tx6m3pQMVxzGLhyFNdUycezOYd9n3wrBMeP23c+ue/hO0q7pOLwOfC/Sy1uvfwDZa9tC4g8Oz2L78X8vOTjviYeXpLrLDSsC3qqy2KZyjeYH3EnsKf92JTxLPvti9UOYkv233eefWKEqE52rWGSJFNx9pxbu9Wbge2/VvOYVru/Ar+UN7cb+8FosGTRrz35RpulhE+zrs1TjoKKMf5BuIzN1cTFYRcpwD6NOd2scxRIVZZqbN/q0la7sN6tIumTwjdlxXUWqCAIW6KeiTMtxxXnh4boTPoK4ZJxq84ZssQgvAEwl3HpVXyusK0kG2HNzk/mSEP0VJfS5NCosKjq7USuAU15lKYkbXa4i3czlwOkUQe0KAtfrzf2RqMVOZ6Z+VxD8w1RUJEtElV9JDx4Ipd8nXFtX+btxOULg7ay/d9eohDL/tFX9PCZB70qk3mQ/ys0M5T3nWlXKXqrYcyaRpFtrRw7qiPQyRa3Aso8JLevdqAg/mptHwW1uZ9XPYxIwiUc/GyLRyuH+LcO6d4KuCv5SRYojrpQDFIcjMLTp60dcdMJel6D1YM+y0MI3uUIg57n4RyGLoueGE/xar2SLHsO0NsXi13b1DDz5/H0Hxv8Lo3UyF0Y2DrcAAAAASUVORK5CYII=', + symbolSize: [11, 16], + symbolOffset: [0, 0], + itemStyle: { + color: '#25D9C8', + }, + lineStyle: { + width: 0, + }, + tooltip: { + show: false, + }, + z: 11, + markLine: { + symbol: ['none', 'none'], + data: markLineData, + }, + }) + // option.series.push({ + // name: "用药时间", + // data: list.map((item: any) => (item.InjectionBottles ? item.TotalScore : 0)), + // type: "line", + // symbol: + // "image://data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAABACAYAAABhspUgAAAAAXNSR0IArs4c6QAACAVJREFUaEPtmltsHFcZx/9nZu92bMdJSMitzoWkoXVKUrVV8wKk4gHxgJTwgKA8lhfgCZBoUJEqUYGA0AhRQUSpFJQIHlyqogZFIipUoKiAKJAYQkp9qR1ir9fe6+zuXM4FfWf2MrOJY+/aS0zlkRxZzsw5v/nP/3znO+c7DItcl4vFTWVl/7wg5EctKSK2knCVBFcKcrGH7vL3MvfwVnYeGbsaustgAAODCSDCDLU1Hp/Ym+o7fnrvB9+9U3NssT5ezWe+k5X8qwvCQ0FwVKSEswJg6sfmHH+cm2l0SZ3Tj8F84ChjiDID+1I9ly4ceuTjbQFfyM2MpDk/meEu8oKjJIUG9khh1YHEtUeupgPAWl3AAENEwzLEmIGd8dToq8OPDbcF/OLCrZFZ7p5Mcxc5wVEUAmQLT8mOLFHvfCwzF7ZEC3CcGdiRSIxeHD7WHvDZhZsjM56ngbMELDlsWVO4c4ExOd8E9i1R969vhzhj2BFPjv76cJvApPCtkMK8YYkVOALLUXh7PNE+8M/Iw553MiN8S1ii6eGVAI+mZ0PfhzHoAWfWBlyMMWyPJ0dfG368PUu8nJ8bWRD8ZPYOUWIlwH+YmQ4Dg8FoAPu22J5Ijb7ywKPtAV8uZZ/LC36qIH11q7UIIZRCp8CW5+Ly7M3bgVkzUlC0ONC74VcvHTj6ybaiBN38RmVhV9YxTBs2nrl08VTRrjy1gvEGZRh+HGu5epOp808ceehMFFEkDYN/f++Df1+sn0UnjtYHjB9+63tQ6ssrAV70WcZOyy8+/ZXltL0o8Hfzk3u4jc94Bh7nSm0uOZWNruvFozBMkzEG+iF3KGm5XJTAZFVIxRXCjnGkNB0pIwXPTWYcu6/MeYLAgh1HozHeE48VE6Y5vyFiXknFoufO73/4nWVZ4kwmc9BG5QVLiONcKSYYEFU0z/vd1P3rQaEiBYiwnSvr2Jgo5mFxTz9Gcbj+AjTjmczPKbbF41fej9jnzz5w9J/B9kMKP58e/1xO4ayjZNKlwaUUkqYJJZsDjRKfBcH1dN3pRa3dKpUwX61oqRs5RS1amLWpOmWYzv5k7xfO3X/0p/W+GsBnMtNPLQjvx1UlDUcKQDEkDKanYRJR6W+tMM0dzPPOYYMvmauWkStXfOBA1kYxWecWMJAwDHV/T9+Xzh088kLDSmfmpx9b8Lw3qpDxqv7MCilmaFBJ/9aMmZYcY05VK78aFw2DrGXBdp2AymSLQDIEAynD9B4c3PKRnwwduqIV/ubc5N+Kgj9EnqQEhxIQ+iwyEHPJIm+WSxBMj7TV4NX+lVIiXyzURGCg/NjP3ijdNEAzH/FsjcX/dWn42CH2g+zMJ9Ju5bWyFDrnFQB6GMGSur4N6Bpzq5hwnVUBbW2kWq3CcXyV6QoMvgZwghk43Dtwgn17burlrHBPaGAlEQFDnN68Bku41NDvrQLsVVK2FZhzAcsqNYCpP/rCZA2tsGGAgIeSvRfZs3Pj0wUhdpZr028vo/cj4OaHJ+WvVIpdUbfeaKHg26KpMoU3P7cgaALeHIun2TPpcaskeE9ZSp0v9DPTjwoB4Cytx+xyV4FLxSKE9FeL9TDnZ3D+KoSA+yIRm52aGVOWEiBLVKXEoBHRdtDRoXbNcQ9XuwxMliBrhIBr8VgDGwxJZoI9TcCSo6wkHCmxUQOHV8Zz3MVVu9JVha2SBR6YjCjlrK/1tCUMwwf+WgDYrQGLlsC1VoDJFiHgoMLBSLsWgClSJOvAJdncd6hbYi0B08DzLVFTeB24g+F5t0G3rnAHgt72yLrC93LieO952ARHVDWXQQVuYbqaWQ2rLtrGVJmhEljR6pyRFqS1fIKS+LjB/JmuNQ7vlrMYUs1dxp3udRwrvdJV4GedJ3BDbl6yj1UFdgsJVNMbQp0mt5UQ67OXBLknwOO/OILi2KYQXN++Bez99F/XJvA75x+G9e7GEFzvfTnsf/Iv68CNKhFla50OujWtsD3fA2tyMPSpM3/eBSebCv0tPljBlkfCm9i9Q1kkNofXiF0fdJO/HEb++tYlvXmnGwYOpTF04lrov7oOPDFyGIUb7+sIuP9gBns+Fd6zXgdunen+7xT+z28OIPOn3R1ZYsujU9jxsbf/tx6m3pQMVxzGLhyFNdUycezOYd9n3wrBMeP23c+ue/hO0q7pOLwOfC/Sy1uvfwDZa9tC4g8Oz2L78X8vOTjviYeXpLrLDSsC3qqy2KZyjeYH3EnsKf92JTxLPvti9UOYkv233eefWKEqE52rWGSJFNx9pxbu9Wbge2/VvOYVru/Ar+UN7cb+8FosGTRrz35RpulhE+zrs1TjoKKMf5BuIzN1cTFYRcpwD6NOd2scxRIVZZqbN/q0la7sN6tIumTwjdlxXUWqCAIW6KeiTMtxxXnh4boTPoK4ZJxq84ZssQgvAEwl3HpVXyusK0kG2HNzk/mSEP0VJfS5NCosKjq7USuAU15lKYkbXa4i3czlwOkUQe0KAtfrzf2RqMVOZ6Z+VxD8w1RUJEtElV9JDx4Ipd8nXFtX+btxOULg7ay/d9eohDL/tFX9PCZB70qk3mQ/ys0M5T3nWlXKXqrYcyaRpFtrRw7qiPQyRa3Aso8JLevdqAg/mptHwW1uZ9XPYxIwiUc/GyLRyuH+LcO6d4KuCv5SRYojrpQDFIcjMLTp60dcdMJel6D1YM+y0MI3uUIg57n4RyGLoueGE/xar2SLHsO0NsXi13b1DDz5/H0Hxv8Lo3UyF0Y2DrcAAAAASUVORK5CYII=", + // symbolSize: [11, 16], + // symbolOffset: [0, "100%"], + // itemStyle: { + // color: "#25D9C8", + // }, + // tooltip: { + // show: false, + // }, + // lineStyle: { + // width: 0, + // }, + // z: 1, + // }); + } + + chart.setOption(option) + reslove(chart) + return chart + }) + }) + }, + touchend(e) { + const { type } = e.currentTarget.dataset + const { page, defaultList } = this.data + if (type == 'left' && page > 0) { + this.setData({ + page: page - 1, + }) + this.initChart(defaultList) + this.initHormoneChart(defaultList) + } else if (type == 'right' && page < defaultList.length / 5 - 1) { + this.setData({ + page: page + 1, + }) + this.initChart(defaultList) + this.initHormoneChart(defaultList) + } + }, + handleFoldAll() { + const { list } = this.data + this.setData({ + list: list.map((item) => { + item.fold = !this.data.foldAll + return item + }), + foldAll: !this.data.foldAll, + }) + }, + handleFold(e) { + const { index } = e.currentTarget.dataset + this.setData({ + [`list[${index}].fold`]: !this.data.list[index].fold, + }) + }, + handleDetail(e) { + const { id, isi } = e.currentTarget.dataset + const tab = this.data.tab + if (isi == 1) { + return + } + if (tab == 1) { + app.mpBehavior({ PageName: 'BTN_PATIENTHEALTHRECORDREPORTLIST' }) + } + if (tab == 2) { + app.mpBehavior({ PageName: 'BTN_PATIENTHEALTHRECORDNOTESLIST' }) + } + + wx.navigateTo({ + url: `/pages/adlResult/index?id=${id}`, + }) + }, + handleDel(e) { + const { id, index, isi } = e.currentTarget.dataset + if (isi == 1) { + return + } + if (index != 0) return + wx.showModal({ + title: '确认删除?', + confirmColor: '#cf5375', + success: (res) => { + if (res.confirm) { + wx.ajax({ + method: 'POST', + url: '?r=igg4/adl/delete', + data: { + Id: id, + }, + }).then(() => { + this.handleTabCallBack() + }) + } + }, + }) + }, + handleAdd() { + app.mpBehavior({ PageName: 'BTN_PATIENTHEALTHRECORDASSESSMENT' }) + wx.navigateTo({ + url: '/pages/adl/index', + }) + }, + handleAddDrug() { + app.mpBehavior({ PageName: 'BTN_PATIENTHEALTHRECORDMEDICATION' }) + wx.navigateTo({ + url: '/pages/drugRecord/index', + }) + }, + handleChartDetail() { + const that = this + wx.navigateTo({ + url: '/gift/pages/myHealthRecordChart/index', + success(res) { + res.eventChannel.emit('acceptDataFromOpenerPage', { + list: that.data.defaultList, + selectLegends: that.data.selectLegends, + }) + }, + }) + }, + handleDetailDrug(e) { + const { id, isi } = e.currentTarget.dataset + app.mpBehavior({ PageName: 'BTN_PATIENTHEALTHRECORDMEDICATIONLIST' }) + if (isi == 1) { + return + } + wx.navigateTo({ + url: `/pages/drugRecord/index?id=${id}`, + }) + }, + handleDelDrug(e) { + const { id, isi } = e.currentTarget.dataset + if (isi == 1) { + return + } + wx.showModal({ + title: '确认删除?', + confirmColor: '#cf5375', + success: (res) => { + if (res.confirm) { + wx.ajax({ + method: 'POST', + url: '?r=igg4/medication/delete', + data: { + Id: id, + }, + }).then(() => { + this.handleTabCallBack() + }) + } + }, + }) + }, + toggleFold() { + this.setData({ + fold: !this.data.fold, + }) + }, + handleShare() { + app.mpBehavior({ PageName: 'BTN_PATIENTHEALTHRECORDSHAREDUALCOMPLIANCEPOSTER' }) + wx.navigateTo({ + url: '/pages/adlShare/index', + }) + }, + handleBack() { + wx.navigateBack({ + fail() { + wx.reLaunch({ url: '/pages/index/index' }) + }, + }) + }, + onShareAppMessage() { + return { + title: 'MG-ADL测评表:评估重症肌无力患者症状对生活质量的影响', + path: '/pages/adl/index', + } + }, +}) diff --git a/src/gift/pages/myHealthRecord/index.wxml b/src/gift/pages/myHealthRecord/index.wxml new file mode 100644 index 0000000..d74b27d --- /dev/null +++ b/src/gift/pages/myHealthRecord/index.wxml @@ -0,0 +1,392 @@ + + + + + + + + + + 用药 + + ADL评分异常 + 正常测评 + + + + + + + + + + + + + 月度 + 年度 + 次数 + + + + + + + + 搜索 + + 评测次数:{{count}}次 + + + + + {{BeginMonth}} + + - + + {{EndMonth}} + + + + + + 双达标达成! + + + + + ADL评分记录曲线 + + + + ADL分数 + + + + 用药时间 + + + + + + + + + + + + + + + + 激素日用量记录曲线 + + + + 激素用量 + + + + 单位(mg) + + + + + + + + + + + + + + + + 综合报告 + 双达标笔记 + 用药记录 + + + + 我的既往用药记录 + 我的既往评测报告 + + 全部{{foldAll ? '展开':'收起'}} + + + + + + + {{item.CreateTime || item.InjectionDate}} + + MG-ADL + 用药记录 + 商保项目记录 + + + + + + + + + {{item.TotalScore}} + + + + + {{item.MedullaTypeScore}} + 延髓 + + + {{item.BreathTypeScore}} + 呼吸 + + + {{item.LimbsTypeScore}} + 四肢 + + + {{item.EyeTypeScore}} + 眼睛 + + + + + 用药后第 + {{item.UseDrugDays}} + 天MG-ADL报告 + + 身体状态有提升,继续关注哦~ + 请持续观察,了解身体变化情况! + 请持续观察,了解身体变化情况! + + + + 注意事项 + + + 1 总分 + < + 5分 + ,日常请注意观察 + + + 1 总分 + >= + 5分 + ,您的症状控制欠佳,建议必要时就医 + + + + 2 较上次得分变化 + {{item.TotalScore - item.LastTotalScore }},有进步,加油! + + + 2 与上次得分一致,请继续保持 + + + 2 较上次得分变化 + +{{item.TotalScore - item.LastTotalScore }},请继续关注! + + + 2 较上次得分变化 + +{{item.TotalScore - item.LastTotalScore }},需要重点关注! + + + + {{item.LastTotalScore === null ? 2 : 3}} 您的眼肌类占比 + < + 50%,以全身症状为主,应注意休息警惕病情加重 + + + {{item.LastTotalScore === null ? 2 : 3}} 您的眼肌类占比 + > + 50%,危象风险不高,请继续关注 + + + {{item.LastTotalScore === null ? 2 : 3}} 您的眼肌类占比=50%,危象风险不高,请继续关注 + + + + + {{item.fold ? '展开':'收起'}}详细评测报告 + + + + + + + + + 0分 + 1分 + 2分 + 3分 + + + + + 延髓 + 呼吸 + 四肢 + 眼肌 + + + + {{subItem.title}} + + + + + + + + + + + + + + + + + + + + + + + 激素用量 + + 本次激素用量为 + {{item.SteroidDailyDose}}mg + /天 + + + 距离达标还需努力,请遵医嘱规律治疗 + 恭喜达标,您的激素用量已少于95% 的患友 + + + + + {{item.InjectionBottles}} + + + + + 您的第 + {{item.Times}} + 次用药 + + + 距离上次用药间隔:{{item.DaysSinceLastInjection}}天 + + + + + + + + + + + + + + + + + + diff --git a/src/gift/pages/myHealthRecordChart/index.json b/src/gift/pages/myHealthRecordChart/index.json new file mode 100644 index 0000000..2c6c30b --- /dev/null +++ b/src/gift/pages/myHealthRecordChart/index.json @@ -0,0 +1,11 @@ +{ + "navigationBarTitleText": "我的健康记录", + "pageOrientation":"landscape", + "usingComponents": { + "navBar": "/components/navBar/navBar", + "van-icon": "@vant/weapp/icon/index", + "calendar": "/components/calendar/index", + "toast": "/components/toast/index", + "ec-canvas": "/components/ec-canvas/ec-canvas" + } +} diff --git a/src/gift/pages/myHealthRecordChart/index.scss b/src/gift/pages/myHealthRecordChart/index.scss new file mode 100644 index 0000000..6981e72 --- /dev/null +++ b/src/gift/pages/myHealthRecordChart/index.scss @@ -0,0 +1,14 @@ +page { + min-height: 100vh; +} + +.page { + width: 100vw; + height: 100vh; + box-sizing: border-box; + padding: 20rpx; + #mychart-dom-bar { + width: 100%; + height: 100%; + } +} diff --git a/src/gift/pages/myHealthRecordChart/index.ts b/src/gift/pages/myHealthRecordChart/index.ts new file mode 100644 index 0000000..65788b4 --- /dev/null +++ b/src/gift/pages/myHealthRecordChart/index.ts @@ -0,0 +1,287 @@ +/* eslint-disable */ +const app = getApp() +const licia = require('miniprogram-licia') +import dayjs from 'dayjs' + +let echarts: any = null + +Page({ + data: { + ec: { + lazyLoad: true, + }, + foldAll: true, + + BeginMonth: '', + EndMonth: '', + Type: '1', + Num: '' as string | number, + fields: { + 1: 'day', + 2: 'month', + 3: 'year', + }, + + detail: {}, + partNameList: app.globalData.partNameList, + list: [], + defaultList: [], + count: 0, + + userInfo: {}, + todayBg: '', + selectLegends: {}, + + page: 0, + safeAreaLeft: 20, + + theme: '', + }, + ecDataTrendComponent: null as any, + async onLoad() { + app.getTheme().then((res) => { + this.setData({ + theme: res, + }) + }) + + const that = this + + that.getSystemInfo() + echarts = await require.async('../../../resource/components/echart/echarts.js') + + that.ecDataTrendComponent = that.selectComponent('#mychart-dom-bar') + + const eventChannel = that.getOpenerEventChannel() + eventChannel.on('acceptDataFromOpenerPage', function (data) { + console.log(data) + that.setData({ + defaultList: data.list, + selectLegends: { ...data.selectLegends }, + userInfo: app.globalData.userInfo, + }) + that.initChart(data.list) + }) + + that.initChart(that.data.defaultList as any) + }, + + initChart(defaultList = []) { + const { selectLegends, theme } = this.data + // const list = defaultList.slice(page * 15, (page + 1) * 8); + const list = defaultList + this.ecDataTrendComponent.init((canvas, width, height, dpr) => { + let chart = echarts.init(canvas, null, { + width: width, + height: height, + devicePixelRatio: dpr, // new + }) + canvas.setChart(chart) + + var option = { + dataZoom: [ + { + type: 'inside', // 内置于坐标系中 + // start: 0, + // end: 15, + startValue: 0, + endValue: 15, + xAxisIndex: [0], + }, + ], + tooltip: { + trigger: 'axis', + axisPointer: { + type: 'shadow', + }, + confine: true, + backgroundColor: 'rgba(0, 0, 0, 0.5)', + textStyle: { + color: '#fff', + fontSize: 10, + }, + order: 'seriesDesc', + }, + legend: { + bottom: 0, + padding: 0, + itemGap: 5, + itemWidth: 8, + itemHeight: 8, + icon: 'circle', + selected: selectLegends, + }, + grid: { + top: '5', + left: '0', + right: '0', + bottom: '15', + containLabel: true, + }, + xAxis: [ + { + type: 'category', + axisTick: { + show: false, + }, + axisLine: { + lineStyle: { + color: '#8C8C8C', + type: 'dashed', + }, + }, + axisLabel: { + //x轴文字的配置 + show: true, + interval: 0, //使x轴文字显示全 + rotate: -20, + }, + data: list.map((item) => item.Date), + }, + ], + yAxis: [ + { + type: 'value', + }, + ], + series: [ + { + name: '延髓', + type: 'bar', + stack: 'Ad', + emphasis: { + disabled: true, + focus: 'none', + }, + data: list.map((item) => item.MedullaTypeScore * 1), + barWidth: '16', + itemStyle: { + // borderColor: "#fff", + // borderWidth: 2, + color: '#7FBDA6', + }, + }, + { + name: '呼吸', + type: 'bar', + stack: 'Ad', + emphasis: { + disabled: true, + focus: 'none', + }, + data: list.map((item) => item.BreathTypeScore * 1), + itemStyle: { + // borderColor: "#fff", + // borderWidth: 2, + color: '#F1CE8F', + }, + }, + { + name: '肢体', + type: 'bar', + stack: 'Ad', + emphasis: { + disabled: true, + focus: 'none', + }, + data: list.map((item) => item.LimbsTypeScore * 1), + itemStyle: { + // borderColor: "#fff", + // borderWidth: 2, + color: '#9ED0DE', + }, + }, + { + name: '眼肌', + type: 'bar', + stack: 'Ad', + emphasis: { + disabled: true, + focus: 'none', + }, + data: list.map((item) => item.EyeTypeScore * 1), + itemStyle: { + // borderColor: "#fff", + // borderWidth: 2, + color: '#D37862', + }, + }, + { + name: '总分', + data: list.map((item) => item.TotalScore), + type: 'line', + symbol: 'circle', + connectNulls: true, + itemStyle: { + color: '#CF5375', + }, + }, + ], + // dataZoom: { + // show: true, // 为true 滚动条出现 + // realtime: true, + // type: "slider", // 有type这个属性,滚动条在最下面,也可以不行,写y:36,这表示距离顶端36px,一般就是在图上面。 + // height: 20, // 表示滚动条的高度,也就是粗细 + // start: 20, // 表示默认展示20%~80%这一段。 + // end: 80, + // }, + } + if (theme === 'DRUG') { + let markLineData = list + .filter((item) => item.InjectionBottles) + .map((item) => { + return { + name: '', + xAxis: item.Date, + lineStyle: { + color: '#25D9C8', + cap: '', + type: 'solid', + }, + label: { + formatter: '', + position: 'insideEndBottom', + rotate: 0, + color: '#25D9C8', + offset: [60, 0], + }, + } + }) + option.series.push({ + name: '用药', + data: list.map((item) => item.InjectionBottles), + type: 'line', + symbol: 'none', + itemStyle: { + color: '#25D9C8', + }, + lineStyle: { + width: 0, + }, + markLine: { + symbol: ['none', 'none'], + data: markLineData, + }, + }) + } + + chart.setOption(option) + return chart + }) + }, + getSystemInfo() { + wx.getSystemInfo({ + success: (res) => { + this.setData({ + safeAreaLeft: res.safeArea.left || 20, + }) + }, + }) + }, + onShareAppMessage() { + return { + title: 'MG-ADL测评表:评估重症肌无力患者症状对生活质量的影响', + path: '/pages/adl/index', + } + }, +}) diff --git a/src/gift/pages/myHealthRecordChart/index.wxml b/src/gift/pages/myHealthRecordChart/index.wxml new file mode 100644 index 0000000..35910cc --- /dev/null +++ b/src/gift/pages/myHealthRecordChart/index.wxml @@ -0,0 +1,4 @@ + + + + diff --git a/src/gift/pages/orderDetail/index.json b/src/gift/pages/orderDetail/index.json new file mode 100644 index 0000000..8ad27fa --- /dev/null +++ b/src/gift/pages/orderDetail/index.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "订单详情", + "usingComponents": {} +} diff --git a/src/gift/pages/orderDetail/index.scss b/src/gift/pages/orderDetail/index.scss new file mode 100644 index 0000000..f45a52a --- /dev/null +++ b/src/gift/pages/orderDetail/index.scss @@ -0,0 +1,129 @@ +page { + background-color: #f7f7f7; +} +.page { + padding: 40rpx; + .status-line { + display: flex; + align-items: center; + justify-content: center; + font-size: 40rpx; + color: #e04775; + font-weight: bold; + .icon { + margin-right: 16rpx; + width: 48rpx; + height: 50rpx; + } + } + .site { + margin-top: 26rpx; + padding: 32rpx; + background: #ffffff; + border-radius: 24rpx; + display: flex; + align-items: center; + .icon { + margin-right: 16rpx; + flex-shrink: 0; + width: 44rpx; + height: 44rpx; + } + .wrap { + .title { + font-size: 32rpx; + font-weight: bold; + color: #3f3f3f; + } + .content { + margin-top: 12rpx; + font-size: 28rpx; + color: #bebfc1; + } + } + } + .shop { + margin-top: 16rpx; + padding: 32rpx; + background: #ffffff; + border-radius: 24rpx; + display: flex; + align-items: center; + .shop-img { + flex-shrink: 0; + width: 204rpx; + height: 204rpx; + border-radius: 24rpx; + } + .wrap { + flex: 1; + padding-left: 24rpx; + .name { + font-size: 32rpx; + font-weight: bold; + color: #3f3f3f; + line-height: 44rpx; + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + } + .specification { + display: inline-block; + margin-top: 8rpx; + font-size: 28rpx; + color: #b6b7ba; + border-radius: 10rpx; + } + .price { + margin-top: 14rpx; + display: flex; + align-items: center; + justify-content: space-between; + .num { + font-size: 32rpx; + color: #e04775; + font-weight: bold; + .sub { + font-size: 22rpx; + } + } + .val { + font-size: 28rpx; + color: #b6b7ba; + } + } + } + } + .detail { + margin-top: 16rpx; + padding: 8rpx 32rpx; + background: #ffffff; + border-radius: 24rpx; + .row { + padding: 24rpx 0; + display: flex; + align-items: center; + justify-content: space-between; + .label { + font-size: 28rpx; + color: #bbbcbe; + } + .content { + padding-left: 46rpx; + flex: 1; + font-size: 28rpx; + color: #3f3f3f; + font-weight: bold; + &.yellow { + color: #f5ad1d; + } + } + } + .row:not(:first-of-type) { + border-top: 1rpx solid #ebebeb; + } + } +} diff --git a/src/gift/pages/orderDetail/index.ts b/src/gift/pages/orderDetail/index.ts new file mode 100644 index 0000000..4a7c887 --- /dev/null +++ b/src/gift/pages/orderDetail/index.ts @@ -0,0 +1,29 @@ +const app = getApp(); + +Page({ + data: { + id: "", + detail: {}, + }, + onLoad(options) { + this.setData({ + id: options.id, + }); + app.waitLogin().then(() => { + this.getDetail(); + }); + }, + getDetail() { + wx.ajax({ + method: "GET", + url: "?r=igg4/gift-order/get-order-detail", + data: { + orderId: this.data.id, + }, + }).then((res) => { + this.setData({ + detail: res, + }); + }); + }, +}); diff --git a/src/gift/pages/orderDetail/index.wxml b/src/gift/pages/orderDetail/index.wxml new file mode 100644 index 0000000..d5d9b57 --- /dev/null +++ b/src/gift/pages/orderDetail/index.wxml @@ -0,0 +1,54 @@ + + + + {{detail.statusName}} + + + + + {{detail.receiveUserName}} {{detail.receiveTelephone}} + {{detail.receiveAddress}} + + + + + + {{detail.giftName}} + 规格:{{detail.specName}} + + {{detail.giftScore}}能量 + x{{detail.orderCount}} + + + + + + 消耗能量 + {{detail.orderScore}} + + + 订单编号 + {{detail.orderNo}} + + + 客服电话 + {{detail.serviceTel}} + + + 创建时间 + {{detail.orderTime}} + + + 发货时间 + {{detail.sendTime}} + + + 物流公司 + {{detail.logisticsCompany}} + + + 物流单号 + {{detail.logisticsOrderNo}} + + + diff --git a/src/gift/pages/orderEnd/index.json b/src/gift/pages/orderEnd/index.json new file mode 100644 index 0000000..f052d70 --- /dev/null +++ b/src/gift/pages/orderEnd/index.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "下单成功", + "usingComponents": {} +} diff --git a/src/gift/pages/orderEnd/index.scss b/src/gift/pages/orderEnd/index.scss new file mode 100644 index 0000000..abf9dea --- /dev/null +++ b/src/gift/pages/orderEnd/index.scss @@ -0,0 +1,40 @@ +.page { + text-align: center; + .content-img { + margin-top: 196rpx; + width: 454rpx; + height: 356rpx; + } + .title { + margin-top: -80rpx; + font-size: 44rpx; + color: #e04775; + font-weight: bold; + } + .order-no { + margin-top: 16rpx; + font-size: 28rpx; + color: #9b9ea6; + } + .detail-btn-bd { + margin: 64rpx auto 0; + width: 422rpx; + height: 96rpx; + background: #fff; + border-radius: 48rpx; + line-height: 96rpx; + font-size: 36rpx; + color: #e04775; + border: 4rpx solid #e04775; + } + .detail-btn { + margin: 64rpx auto 0; + width: 422rpx; + height: 96rpx; + background: #e04775; + border-radius: 48rpx; + line-height: 96rpx; + font-size: 36rpx; + color: #ffffff; + } +} diff --git a/src/gift/pages/orderEnd/index.ts b/src/gift/pages/orderEnd/index.ts new file mode 100644 index 0000000..187f81f --- /dev/null +++ b/src/gift/pages/orderEnd/index.ts @@ -0,0 +1,39 @@ +const app = getApp(); + +Page({ + data: { + id: "", + detail: {}, + }, + onLoad(options) { + this.setData({ + id: options.id, + }); + app.waitLogin().then(() => { + this.getDetail(); + }); + }, + getDetail() { + wx.ajax({ + method: "GET", + url: "?r=igg4/gift-order/get-order-detail", + data: { + orderId: this.data.id, + }, + }).then((res) => { + this.setData({ + detail: res, + }); + }); + }, + handleDetail() { + wx.navigateTo({ + url: `/gift/pages/orderDetail/index?id=${this.data.id}`, + }); + }, + handleGift() { + wx.navigateTo({ + url: `/gift/pages/giftList/index`, + }); + }, +}); diff --git a/src/gift/pages/orderEnd/index.wxml b/src/gift/pages/orderEnd/index.wxml new file mode 100644 index 0000000..2353e31 --- /dev/null +++ b/src/gift/pages/orderEnd/index.wxml @@ -0,0 +1,7 @@ + + + 下单成功 + 订单号:{{detail.orderNo}} + 查看订单详情 + 返回礼品中心 + diff --git a/src/gift/pages/priceDetail/index.json b/src/gift/pages/priceDetail/index.json new file mode 100644 index 0000000..14a2011 --- /dev/null +++ b/src/gift/pages/priceDetail/index.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "能量明细", + "usingComponents": {} +} diff --git a/src/gift/pages/priceDetail/index.scss b/src/gift/pages/priceDetail/index.scss new file mode 100644 index 0000000..0adc901 --- /dev/null +++ b/src/gift/pages/priceDetail/index.scss @@ -0,0 +1,78 @@ +page { + background-color: #fafafa; +} + +.page { + padding: 48rpx 40rpx 120rpx; + .banner { + position: relative; + padding: 46rpx 48rpx; + background-color: #e6658d; + border-radius: 24rpx; + .title { + font-size: 28rpx; + color: #ffffff; + } + .num { + font-size: 64rpx; + color: 1897; + font-weight: bold; + color: #fff; + } + .icon{ + position: absolute; + top: 40rpx; + right: 40rpx; + width: 124rpx; + height: 122rpx; + } + } + + .list { + margin-top: 48rpx; + .list-title { + font-size: 36rpx; + color: #3f3f3f; + &::before { + margin-right: 16rpx; + display: inline-block; + content: ""; + width: 12rpx; + height: 44rpx; + background: #e04775; + vertical-align: middle; + border-radius: 0rpx 8rpx 8rpx 0rpx; + } + } + .list-container { + padding: 0 30rpx; + margin-top: 20rpx; + background: #ffffff; + border-radius: 24rpx; + .row { + padding: 30rpx 0; + display: flex; + justify-content: space-between; + .wrap { + .title { + font-size: 32rpx; + color: #3f3f3f; + } + .date { + font-size: 28rpx; + color: #bbbcbe; + } + } + .price { + margin-left: 10rpx; + flex-shrink: 0; + font-size: 40rpx; + color: #f5ad1d; + } + } + .row:not(:last-of-type) { + border-bottom: 1px solid #ebebeb; + } + } + } +} diff --git a/src/gift/pages/priceDetail/index.ts b/src/gift/pages/priceDetail/index.ts new file mode 100644 index 0000000..f6cb028 --- /dev/null +++ b/src/gift/pages/priceDetail/index.ts @@ -0,0 +1,53 @@ +const app = getApp(); + +Page({ + data: { + score: 0, + list: [], + pagination: { + page: 1, + pages: 1, + count: 1, + }, + }, + onLoad() { + app.waitLogin().then(() => { + this.getList(); + this.getDetail() + }); + }, + getDetail() { + wx.ajax({ + method: "GET", + url: "?r=igg4/patient-score/get-self-score", + data: {}, + }).then((res) => { + this.setData({ + score: res.score, + }); + }); + }, + getList(newPage = 1) { + wx.ajax({ + method: "GET", + url: "?r=igg4/patient-score/get-self-record-list", + data: { page: newPage }, + }).then((res) => { + let list = res.page == 1 ? res.list : [...this.data.list, ...res.list]; + this.setData({ + list: list, + pagination: { + page: res.page, + pages: res.pages, + count: res.count, + }, + }); + }); + }, + onReachBottom() { + const { page, pages } = this.data.pagination; + if (pages > page) { + this.getList(page + 1); + } + }, +}); diff --git a/src/gift/pages/priceDetail/index.wxml b/src/gift/pages/priceDetail/index.wxml new file mode 100644 index 0000000..2ed83b5 --- /dev/null +++ b/src/gift/pages/priceDetail/index.wxml @@ -0,0 +1,26 @@ + + + + 能量收支明细 + + + + + {{item.recordTypeName}} + :{{item.giftName}} + + {{item.createTime}} + + {{item.scoreChange}} + + + + + diff --git a/src/gift/pages/scoreRule/index.json b/src/gift/pages/scoreRule/index.json new file mode 100644 index 0000000..eb1d033 --- /dev/null +++ b/src/gift/pages/scoreRule/index.json @@ -0,0 +1,7 @@ +{ + "navigationBarTitleText": "能量规则", + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/navBar/navBar" + } +} diff --git a/src/gift/pages/scoreRule/index.scss b/src/gift/pages/scoreRule/index.scss new file mode 100644 index 0000000..6a98dc4 --- /dev/null +++ b/src/gift/pages/scoreRule/index.scss @@ -0,0 +1,139 @@ +page { + background-color: #f5f5f5; +} +.page { + padding: 200rpx 40rpx 80rpx; + .banner { + position: relative; + .b-title { + position: absolute; + left: 50%; + top: 0; + transform: translate(-50%, -50%); + width: 310rpx; + height: 86rpx; + } + .b-content { + padding: 72rpx 30rpx 36rpx; + background: #fbf0f3; + box-shadow: 0rpx 14rpx 32rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + border: 2rpx solid rgba(224, 71, 117, 0.52); + } + } + .list { + margin-top: 78rpx; + padding: 76rpx 30rpx; + background: #ffffff; + box-shadow: 0rpx 14rpx 32rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + position: relative; + .l-title { + position: absolute; + left: 50%; + top: 0; + transform: translate(-50%, -50%); + width: 310rpx; + height: 86rpx; + } + .l-tip { + font-size: 32rpx; + color: #333333; + font-weight: bold; + } + .module { + .m-title { + position: relative; + margin: 26rpx 96rpx 0 16rpx; + line-height: 60rpx; + padding: 0 24rpx; + background: linear-gradient(270deg, rgba(242, 125, 173, 0) 0%, rgba(224, 71, 117, 0.87) 57%, #e04775 100%); + font-size: 28rpx; + color: #ffffff; + font-weight: bold; + .num { + position: absolute; + left: 0; + top: 0; + transform: translate(-100%, 0); + width: 60rpx; + height: 60rpx; + background-color: #24d8c8; + text-align: center; + line-height: 60rpx; + &::before { + position: absolute; + top: -6rpx; + left: 0; + content: ""; + width: 0; + height: 0; + border-style: solid; + border-width: 0 0 6rpx 14rpx; + border-color: transparent transparent #007167 transparent; + } + } + } + .m-content { + margin-top: 24rpx; + padding: 32rpx 30rpx; + font-size: 28rpx; + color: #666666; + border-radius: 16rpx; + background-color: #f5f5f5; + } + .ul { + .ol { + margin-top: 34rpx; + font-size: 28rpx; + color: #666666; + .o-title { + font-size: 28rpx; + color: #666666; + font-weight: bold; + margin-bottom: 12rpx; + display: flex; + .o-num { + margin-right: 12rpx; + flex-shrink: 0; + width: 34rpx; + height: 34rpx; + font-size: 24rpx; + color: #ffffff; + background-color: #e04775; + text-align: center; + line-height: 34rpx; + border-radius: 50%; + } + } + &.no-title { + display: flex; + } + } + } + } + .tip { + margin-top: 32rpx; + .t-title { + font-size: 32rpx; + color: #666666; + font-weight: bold; + line-height: 1; + &::before { + margin-right: 16rpx; + display: inline-block; + vertical-align: middle; + content: ""; + width: 10rpx; + height: 34rpx; + background-color: #e04775; + } + } + .t-content { + margin-top: 10rpx; + font-size: 28rpx; + color: #666666; + } + } + } +} diff --git a/src/gift/pages/scoreRule/index.ts b/src/gift/pages/scoreRule/index.ts new file mode 100644 index 0000000..f790e55 --- /dev/null +++ b/src/gift/pages/scoreRule/index.ts @@ -0,0 +1,33 @@ +const app = getApp(); + +Page({ + data: { + list: [], + }, + onLoad() { + const SystemInfo = app.globalSystemInfo; + if (SystemInfo) { + const { bottom } = SystemInfo.capsulePosition; + this.setData({ + bottom: bottom, + }); + } + app.waitLogin().then(() => { + this.getDetail(); + }); + }, + getDetail() { + wx.ajax({ + method: "GET", + url: "?r=igg4/patient-score/get-score-explain", + data: {}, + }).then((res) => { + this.setData({ + list: res, + }); + }); + }, + handleBack() { + wx.navigateBack(); + }, +}); diff --git a/src/gift/pages/scoreRule/index.wxml b/src/gift/pages/scoreRule/index.wxml new file mode 100644 index 0000000..36731f8 --- /dev/null +++ b/src/gift/pages/scoreRule/index.wxml @@ -0,0 +1,59 @@ + + + + + + + {{list[1].content}} + + + {{index+1}} + {{item.title}} + + {{item.content}} + + + + {{subIndex+1}} + {{subItem.title}} + + {{subItem.content}} + + + + + + + {{list[2].content}} + + + {{index+1}} + {{item.title}} + + {{item.content}} + + + + {{subIndex+1}} + {{subItem.title}} + + {{subItem.content}} + + + + + {{list[3].title}} + {{list[3].content}} + + + + diff --git a/src/gift/pages/siteEdit/index.json b/src/gift/pages/siteEdit/index.json new file mode 100644 index 0000000..167c8d9 --- /dev/null +++ b/src/gift/pages/siteEdit/index.json @@ -0,0 +1,8 @@ +{ + "navigationBarTitleText": "添加收货地址", + "usingComponents": { + "van-switch": "@vant/weapp/switch/index", + "van-popup": "@vant/weapp/popup/index", + "van-cascader": "@vant/weapp/cascader/index" + } +} diff --git a/src/gift/pages/siteEdit/index.scss b/src/gift/pages/siteEdit/index.scss new file mode 100644 index 0000000..af048b1 --- /dev/null +++ b/src/gift/pages/siteEdit/index.scss @@ -0,0 +1,96 @@ +page { + background-color: #f7f7f7; +} + +.page { + padding: 40rpx; + .form { + padding: 0 32rpx; + background-color: #fff; + border-radius: 24rpx; + .row { + padding: 32rpx 0; + display: flex; + align-items: center; + .label { + flex-shrink: 0; + width: 4em; + font-size: 32rpx; + color: #3f3f3f; + font-weight: bold; + } + .content { + flex: 1; + padding-left: 18rpx; + display: flex; + align-items: center; + .input { + flex: 1; + font-size: 32rpx; + } + .place-input { + color: #bbbcbe; + } + .site { + border-left: 2rpx solid rgba(170, 170, 170, 0.3); + padding-left: 16rpx; + font-size: 32rpx; + color: #e04775; + display: flex; + align-items: center; + .icon { + margin-right: 10rpx; + width: 36rpx; + height: 36rpx; + } + } + } + } + .row:not(:last-of-type) { + border-bottom: 1rpx solid #edeff3; + } + } + .default { + margin-top: 16rpx; + padding: 26rpx 32rpx; + background-color: #fff; + border-radius: 24rpx; + display: flex; + align-items: center; + justify-content: space-between; + } + .footer { + padding: 40rpx; + position: fixed; + left: 0; + bottom: 0; + width: 100vw; + box-sizing: border-box; + bottom: 248rpx; + display: flex; + .cancel { + margin-right: 32rpx; + flex-shrink: 0; + width: 248rpx; + height: 96rpx; + border-radius: 48rpx; + box-sizing: border-box; + line-height: 92rpx; + text-align: center; + font-size: 36rpx; + color: #e04775; + border: 2rpx solid #e04775; + } + .submit { + flex: 1; + height: 96rpx; + background: #e04775; + border-radius: 48rpx; + text-align: center; + line-height: 96rpx; + text-align: center; + font-size: 36rpx; + color: #ffffff; + } + } +} diff --git a/src/gift/pages/siteEdit/index.ts b/src/gift/pages/siteEdit/index.ts new file mode 100644 index 0000000..3a5c45e --- /dev/null +++ b/src/gift/pages/siteEdit/index.ts @@ -0,0 +1,272 @@ +const app = getApp(); + +Page({ + data: { + LAT: "", + LNG: "", + + addressId: "", + receiveUserName: "", + receiveTelephone: "", + address: "", + isDefault: false, + provinceName: "", + provinceId: "", + cityId: "", + cityName: "", + countyId: "", + countyName: "", + + pcc: "", + + cascaderShow: false, + options: [], + areaValue: [] as number[], + cascaderValue: "", + fieldNames: { text: "label", value: "value", children: "children" }, + }, + onLoad(options) { + if (options.id) { + wx.setNavigationBarTitle({ + title: "编辑收货地址", + }); + this.setData({ + addressId: options.id, + }); + } + app.waitLogin().then((_res) => { + this.getArea(); + if (options.id) { + this.getDetail(); + } + }); + }, + getDetail() { + wx.ajax({ + method: "GET", + url: "?r=igg4/patient-address/get-address-detail", + data: { + addressId: this.data.addressId, + }, + }).then((res) => { + console.log("res: ", res); + this.setData({ + ...res, + isDefault: res.isDefault == 1 ? true : false, + pcc: `${res.provinceName}/${res.cityName}/${res.countyName}`, + }); + }); + }, + onChange(e) { + this.setData({ + isDefault: e.detail, + }); + }, + getArea() { + wx.ajax({ + method: "GET", + url: "/js/area.json", + isJSON: true, + }).then((res) => { + this.setData({ + options: res.map((item) => { + return { + ...item, + children: item.children.map((item2) => { + return { + label: item2.label, + value: item2.value, + children: item2.children.map((item3) => { + return { + label: item3.label, + value: item3.value, + }; + }), + }; + }), + }; + }), + }); + }); + }, + handleCascader() { + this.setData({ + cascaderShow: true, + }); + }, + onFinish(e: any) { + const selectedOptions = e.detail.selectedOptions; + console.log(selectedOptions); + this.setData({ + cascaderValue: e.detail.value, + areaValue: [selectedOptions[0].value, selectedOptions[1].value, selectedOptions[2].value], + pcc: `${selectedOptions[0].label}/${selectedOptions[1].label}/${selectedOptions[2].label}`, + provinceId: selectedOptions[0].value, + provinceName: selectedOptions[0].label, + cityId: selectedOptions[1].value, + cityName: selectedOptions[1].label, + countyId: selectedOptions[2].value, + countyName: selectedOptions[2].label, + }); + this.onClose(); + }, + onClose() { + this.setData({ + cascaderShow: false, + }); + }, + handleSite() { + const that = this; + wx.getSetting({ + success(res) { + if ( + res.authSetting["scope.userFuzzyLocation"] != undefined && + res.authSetting["scope.userFuzzyLocation"] == true + ) { + //获取当前位置 + that.getFuzzyLocation(); + } else if (res.authSetting["scope.userFuzzyLocation"] == undefined) { + //获取当前位置 + that.getFuzzyLocation(); + } else { + wx.showModal({ + title: "请求授权当前位置", + content: "需要获取您的地理位置,请确认授权", + confirmColor: "#cf5375", + success: function (res) { + if (res.cancel) { + //取消授权 + wx.showToast({ + title: "拒绝授权", + icon: "none", + duration: 1000, + }); + } else if (res.confirm) { + //确定授权,通过wx.openSetting发起授权请求 + wx.openSetting({ + success: function (res) { + if (res.authSetting["scope.userFuzzyLocation"] == true) { + //再次授权,调用wx.getLocation的API + that.getFuzzyLocation(); + } else { + wx.showToast({ + title: "授权失败", + icon: "none", + duration: 1000, + }); + } + }, + }); + } + }, + }); + } + }, + }); + }, + getFuzzyLocation() { + const that = this; + wx.getFuzzyLocation({ + success(res) { + that.setData({ + LNG: res.longitude, + LAT: res.latitude, + }); + that.getLocationInfo(); + }, + fail(err) { + console.log(err); + }, + }); + }, + getLocationInfo() { + wx.ajax({ + method: "GET", + url: "?r=igg4/nrdl-hospital/location-info", + data: { + lat: this.data.LAT, + lng: this.data.LNG, + }, + loading: true, + }).then((res) => { + this.setData({ + cityId: res.CityId, + cityName: res.CityName, + countyId: res.CountyId, + countyName: res.CountyName, + provinceId: res.ProvinceId, + provinceName: res.ProvinceName, + + pcc: `${res.ProvinceName}/${res.CityName}/${res.CountyName}`, + }); + }); + }, + handleSubmit() { + const { + receiveUserName, + receiveTelephone, + address, + isDefault, + addressId, + provinceName, + provinceId, + cityId, + cityName, + countyId, + countyName, + } = this.data; + let toast = ""; + if (!receiveUserName) toast = "请输入收货人姓名"; + if (!receiveTelephone) toast = "请输入联系电话"; + if (!provinceName) toast = "请选择所在地区"; + if (!address) toast = "请输入详细地址"; + + const params = { + receiveUserName, + receiveTelephone, + provinceName, + address, + isDefault: isDefault ? 1 : 2, + addressId, + provinceId, + cityId, + cityName, + countyId, + countyName, + }; + wx.ajax({ + method: "POST", + url: "?r=igg4/patient-address/save-address", + data: params, + }).then(() => { + wx.navigateBack(); + }); + }, + handleDel() { + wx.showModal({ + title: "确认删除?", + confirmColor: "#DE406A", + success: (res) => { + if (res.confirm) { + wx.ajax({ + method: "POST", + url: "?r=igg4/patient-address/del-address", + data: { + addressId: this.data.addressId, + }, + loading: true, + }).then((res) => { + wx.navigateBack({ + success() { + wx.showToast({ + icon: "none", + title: res, + }); + }, + }); + }); + } + }, + }); + }, +}); diff --git a/src/gift/pages/siteEdit/index.wxml b/src/gift/pages/siteEdit/index.wxml new file mode 100644 index 0000000..371d93a --- /dev/null +++ b/src/gift/pages/siteEdit/index.wxml @@ -0,0 +1,80 @@ + + + + 收货人 + + + + + + 联系电话 + + + + + + 所在地区 + + + + + 定位 + + + + + 详细地址 + + + + + + + 设置为默认地址 + + + + 删除 + 保存 + + + + + + diff --git a/src/gift/pages/siteList/index.json b/src/gift/pages/siteList/index.json new file mode 100644 index 0000000..e27fa26 --- /dev/null +++ b/src/gift/pages/siteList/index.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "地址管理", + "usingComponents": {} +} diff --git a/src/gift/pages/siteList/index.scss b/src/gift/pages/siteList/index.scss new file mode 100644 index 0000000..cc56cf5 --- /dev/null +++ b/src/gift/pages/siteList/index.scss @@ -0,0 +1,73 @@ +page { + background-color: #fafafa; +} +.page { + padding: 34rpx 40rpx 240rpx; + .card { + margin-bottom: 20rpx; + padding: 32rpx; + background: #ffffff; + border-radius: 24rpx; + display: flex; + justify-content: space-between; + align-items: center; + .wrap { + flex: 1; + width: calc(100% - 100rpx); + .title { + display: flex; + align-items: center; + .name { + flex: 1; + font-size: 32rpx; + font-weight: bold; + align-items: center; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } + .label { + flex-shrink: 0; + margin-right: 20rpx; + padding: 0 10rpx; + display: inline-block; + vertical-align: middle; + font-size: 24rpx; + line-height: 34rpx; + color: #e04775; + border: 1rpx solid #e04775; + border-radius: 10rpx; + } + } + .content { + margin-top: 12rpx; + font-size: 28rpx; + color: #bbbcbe; + } + } + .edit { + margin-left: 15rpx; + width: 32rpx; + flex-shrink: 0; + .edit-img { + width: 32rpx; + height: 32rpx; + } + } + } + + .submit { + position: fixed; + bottom: 120rpx; + left: 40rpx; + height: 96rpx; + width: calc(100% - 80rpx); + background: #e04775; + border-radius: 48rpx; + text-align: center; + line-height: 96rpx; + text-align: center; + font-size: 36rpx; + color: #ffffff; + } +} diff --git a/src/gift/pages/siteList/index.ts b/src/gift/pages/siteList/index.ts new file mode 100644 index 0000000..86af78d --- /dev/null +++ b/src/gift/pages/siteList/index.ts @@ -0,0 +1,64 @@ +const app = getApp(); + +Page({ + data: { + list: [], + pagination: { + page: 1, + pages: 1, + count: 1, + }, + }, + onShow() { + app.waitLogin().then(() => { + this.getList(); + }); + }, + getList(newPage = 1) { + wx.ajax({ + method: "GET", + url: "?r=igg4/patient-address/get-list", + data: { + page: newPage, + }, + }).then((res) => { + let list = res.page == 1 ? res.list : [...this.data.list, ...res.list]; + this.setData({ + list: list, + pagination: { + page: res.page, + pages: res.pages, + count: res.count, + }, + }); + }); + }, + handleSelect(e) { + const { index } = e.currentTarget.dataset; + let pages = getCurrentPages(); + + let prevPage = pages[pages.length - 2]; + prevPage.setData({ + select: true, + addressDetail: this.data.list[index], + }); + wx.navigateBack(); + }, + handleEdit(e) { + const { id } = e.currentTarget.dataset; + wx.navigateTo({ + url: `/gift/pages/siteEdit/index?id=${id}`, + }); + }, + handleAdd() { + wx.navigateTo({ + url: "/gift/pages/siteEdit/index", + }); + }, + onReachBottom() { + const { page, pages } = this.data.pagination; + if (pages > page) { + this.getList(page + 1); + } + }, +}); diff --git a/src/gift/pages/siteList/index.wxml b/src/gift/pages/siteList/index.wxml new file mode 100644 index 0000000..8ec8cf0 --- /dev/null +++ b/src/gift/pages/siteList/index.wxml @@ -0,0 +1,17 @@ + + + + + 默认 + {{item.provinceName}}{{item.cityName}}{{item.countyName}}{{item.address}} + + {{item.receiveUserName}} {{item.receiveTelephone}} + + + + + + + + 新增地址 + diff --git a/src/gift/pages/vipCert/index.json b/src/gift/pages/vipCert/index.json new file mode 100644 index 0000000..390abcc --- /dev/null +++ b/src/gift/pages/vipCert/index.json @@ -0,0 +1,11 @@ +{ + "navigationBarTitleText": "", + "navigationStyle": "custom", + "disableSwipeBack": true, + "usingComponents": { + "navBar": "/components/navBar/navBar", + "van-icon": "@vant/weapp/icon/index", + "van-divider": "@vant/weapp/divider/index", + "uploadFile": "/components/uploadFile/index" + } +} diff --git a/src/gift/pages/vipCert/index.scss b/src/gift/pages/vipCert/index.scss new file mode 100644 index 0000000..6eadeab --- /dev/null +++ b/src/gift/pages/vipCert/index.scss @@ -0,0 +1,189 @@ +.page { + position: relative; + box-sizing: border-box; + background-color: #fff; + .bg { + width: 100%; + } + .page-container { + padding-bottom: 80rpx; + position: absolute; + width: 100%; + top: 0; + left: 0; + display: flex; + flex-direction: column; + .page-title { + margin-top: 86rpx; + font-size: 48rpx; + color: #333333; + font-weight: bold; + text-align: center; + } + .sub-title { + margin-top: 32rpx; + font-size: 28rpx; + color: #aaaaaa; + text-align: center; + } + .content { + margin: 40rpx auto 0; + padding: 40rpx 64rpx; + width: 654rpx; + box-sizing: border-box; + background: #ffffff; + box-shadow: 0rpx 4rpx 24rpx 0rpx rgba(0, 0, 0, 0.09); + border: 2rpx solid rgba(224, 71, 117, 0.25); + border-radius: 24rpx; + .c-title { + font-size: 30rpx; + color: #666666; + text-align: center; + .blod { + font-weight: bold; + color: #cf5375; + } + } + .c-link { + margin-top: 24rpx; + font-size: 30rpx; + color: #666666; + text-align: center; + } + .upload { + margin-top: 46rpx; + .upload-container { + position: relative; + width: 510rpx; + height: 510rpx; + border: 2rpx dotted #cf5375; + border-radius: 24rpx; + background: rgba(207, 83, 117, 0.06); + .icon { + display: block; + margin: 148rpx auto 0; + width: 141rpx; + height: 161rpx; + } + .name { + margin-top: 36rpx; + font-size: 28rpx; + font-weight: bold; + color: #cf5375; + text-align: center; + } + .diagnose-img { + width: 100%; + height: 100%; + border-radius: inherit; + } + .ai { + position: absolute; + bottom: -20rpx; + left: calc(50% - 100rpx); + width: 200rpx; + height: 40rpx; + font-size: 28rpx; + line-height: 42rpx; + color: #fff; + text-align: center; + background: #23bbad; + border-radius: 20rpx 20rpx 20rpx 20rpx; + } + .scan { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 80rpx; + background: linear-gradient(0deg, #ec7095 0%, rgba(236, 112, 177, 0) 100%); + border-radius: 0rpx 0rpx 0rpx 0rpx; + opacity: 0.5; + animation: 3s ease-in 1s infinite reverse both running slidein; + @keyframes slidein { + 0% { + top: 0; + } + 50% { + top: 430rpx; + } + 100% { + top: 0rpx; + } + } + } + .error { + position: absolute; + bottom: 0; + left: 0; + padding: 8rpx 20rpx; + width: 100%; + box-sizing: border-box; + font-size: 24rpx; + color: #fff; + white-space: pre-line; + text-align: center; + background-color: #bb232c; + } + } + } + } + .footer { + flex-shrink: 0; + margin: 81rpx 48rpx 0; + box-sizing: border-box; + display: flex; + > view:not(:last-of-type), + > image { + margin-right: 30rpx; + } + .next { + flex: 1; + text-align: center; + height: 88rpx; + line-height: 88rpx; + text-align: center; + border: 2rpx solid #e04775; + border-radius: 24rpx; + font-size: 34rpx; + font-weight: bold; + background-color: #e04775; + color: #fff; + &.active { + background-color: #dddddd; + border-color: #dddddd; + } + } + .btn1 { + flex: 1; + height: 80rpx; + border-radius: 24rpx; + opacity: 1; + border: 2rpx solid #e04775; + font-size: 34rpx; + color: #e04775; + text-align: center; + line-height: 80rpx; + font-weight: bold; + box-sizing: border-box; + } + .btn2 { + flex: 1; + border-radius: 24rpx; + text-align: center; + height: 80rpx; + line-height: 80rpx; + font-size: 34rpx; + color: #fff; + font-weight: bold; + background-color: #cf5375; + } + .msg { + flex: 1; + font-size: 28rpx; + color: #e04775; + text-align: center; + } + } + } +} diff --git a/src/gift/pages/vipCert/index.ts b/src/gift/pages/vipCert/index.ts new file mode 100644 index 0000000..7c1c251 --- /dev/null +++ b/src/gift/pages/vipCert/index.ts @@ -0,0 +1,134 @@ +const app = getApp(); + +Page({ + data: { + diagnoseImg: "", + error: false, + errorText: "", + aiPass: 0, + verify: false, + audit: false, + + userInfo: app.globalData.userInfo, + Hash: "", + }, + onLoad() { + app.waitLogin({}).then(() => { + app.getUserInfo(this, true, (userInfo) => { + if (userInfo.UserType == 4) { + wx.reLaunch({ + url: "/pages/my/index", + }); + } + app.permissionVerification(3, 0, `/pages/index/index`); + }); + }); + }, + handleSetData(e: WechatMiniprogram.CustomEvent) { + const imgUrl = e.detail[0].imgUrl; + this.setData({ + diagnoseImg: imgUrl, + audit: true, + }); + this.handleAiPass(imgUrl); + }, + handleAiPass(imgUrl: string) { + wx.ajax({ + method: "POST", + url: "?r=igg4/common/medicine-image-verify", + data: { + ImageUrl: imgUrl, + }, + }).then((res) => { + const { code, Hash } = res; + this.setData({ + Hash, + }); + if (code === 0) { + this.setData({ + audit: false, + verify: true, + aiPass: 1, + }); + this.handleSubmit(); + } else { + const errorText = { + 1001: "智能审核失败:图片模糊无法识别", + 1002: "智能审核失败:图片模糊无法识别", + 2001: "智能审核失败:疑似提交重复图片", + 2002: '智能审核失败:您提交图片中不包含"艾加莫德"相关字样', + }; + this.setData({ + audit: false, + error: true, + errorText: errorText[code] || errorText[1001], + }); + } + }); + }, + handleSubmit() { + const { registrationSource, registChannel, regBusinessId } = app.globalData; + const { diagnoseImg, error, userInfo, Hash } = this.data; + let urlKey = ""; + + if (error) { + urlKey = userInfo.isFollow ? "nopending" : "pending"; + } else { + urlKey = "reslove"; + } + + const navUrl = { + reslove: "/pages/index/index", + pending: "/gift/pages/vipPending/index", + nopending: "/gift/pages/vimStartPending/index", + }[urlKey] as string; + + wx.ajax({ + method: "POST", + url: "?r=igg4/account/upload-use-drugs-audit-img", + data: { + diagnoseImg, + aiPass: this.data.aiPass, + registrationSource, + registChannel, + regBusinessId, + imgHash: Hash, + }, + loading: true, + }).then((_res) => { + app.getUserInfo(this, true, () => { + wx.reLaunch({ + url: navUrl, + }); + }); + }); + }, + handleReset() { + this.setData({ + diagnoseImg: "", + error: false, + errorText: "", + aiPass: 0, + verify: false, + }); + }, + handleVisitors() { + app.globalData.anyWhere = true; + wx.reLaunch({ + url: "/pages/index/index", + }); + }, + handleVip() { + wx.navigateTo({ + url: "/pages/vipLogin/index", + }); + }, + handleBack() { + wx.navigateBack(); + }, + handleVipScan() { + wx.navigateTo({ + url: "/pages/vipLogin/index", + }); + }, +}); diff --git a/src/gift/pages/vipCert/index.wxml b/src/gift/pages/vipCert/index.wxml new file mode 100644 index 0000000..897c13b --- /dev/null +++ b/src/gift/pages/vipCert/index.wxml @@ -0,0 +1,45 @@ + + + + + 专属身份认证 + 诊断证明审核通过后,即可享受平台全部服务 + + + 请上传有「艾加莫德」字样的 + + 处方单或购药发票 + + + + + 点击上传 + + + + + + 智能审核中 + {{errorText}} + + + + + + 提交人工审核 + 重新提交 + + + 您也可通过扫药盒码认证> + + + + diff --git a/src/gift/pages/vipPending/index.json b/src/gift/pages/vipPending/index.json new file mode 100644 index 0000000..d54917e --- /dev/null +++ b/src/gift/pages/vipPending/index.json @@ -0,0 +1,10 @@ +{ + "navigationBarTitleText": "", + "navigationStyle": "custom", + "disableSwipeBack": true, + "usingComponents": { + "navBar": "/components/navBar/navBar", + "van-icon": "@vant/weapp/icon/index", + "van-divider": "@vant/weapp/divider/index" + } +} diff --git a/src/gift/pages/vipPending/index.scss b/src/gift/pages/vipPending/index.scss new file mode 100644 index 0000000..5a6afb4 --- /dev/null +++ b/src/gift/pages/vipPending/index.scss @@ -0,0 +1,100 @@ +.page { + position: relative; + box-sizing: border-box; + background-color: #fff; + .bg { + width: 100%; + } + .page-container { + padding-bottom: 80rpx; + position: absolute; + width: 100%; + top: 0; + left: 0; + display: flex; + flex-direction: column; + .navbar { + flex-shrink: 0; + padding: 0 20rpx 0; + display: flex; + align-items: center; + font-size: 40rpx; + color: #cf5375; + font-style: italic; + font-weight: bold; + .icon { + margin-right: 9rpx; + width: 42rpx; + height: 46rpx; + } + } + .page-title { + margin-top: 86rpx; + font-size: 48rpx; + color: #333333; + font-weight: bold; + text-align: center; + } + .sub-title { + margin-top: 32rpx; + font-size: 28rpx; + color: #aaaaaa; + text-align: center; + } + .content { + margin: 40rpx auto 0; + width: 654rpx; + box-sizing: border-box; + background: #ffffff; + box-shadow: 0rpx 4rpx 24rpx 0rpx rgba(0, 0, 0, 0.09); + border: 2rpx solid rgba(224, 71, 117, 0.25); + border-radius: 24rpx; + padding-bottom: 60rpx; + .c-header { + border-radius: 24rpx 24rpx 0 0; + background-color: #666666; + padding: 18rpx 20rpx; + text-align: center; + font-size: 28rpx; + color: #fff; + line-height: 42rpx; + } + .code { + margin: 125rpx auto 0; + display: block; + width: 300rpx; + height: 300rpx; + } + .tip{ + margin-top: 87rpx; + font-size: 28rpx; + color: #666666; + text-align: center; + line-height: 48rpx; + } + } + .footer { + flex-shrink: 0; + margin: 81rpx 48rpx 0; + box-sizing: border-box; + display: flex; + > view:not(:last-of-type), + > image { + margin-right: 30rpx; + } + .next { + flex: 1; + text-align: center; + height: 88rpx; + line-height: 88rpx; + text-align: center; + border: 2rpx solid #e04775; + border-radius: 24rpx; + font-size: 34rpx; + font-weight: bold; + background-color: #e04775; + color: #fff; + } + } + } +} diff --git a/src/gift/pages/vipPending/index.ts b/src/gift/pages/vipPending/index.ts new file mode 100644 index 0000000..6ea6c70 --- /dev/null +++ b/src/gift/pages/vipPending/index.ts @@ -0,0 +1,34 @@ +const app = getApp(); + +Page({ + data: { + qrCode: "", + }, + onLoad() { + app.waitLogin().then((res) => { + this.getCode(); + }); + }, + handleVisitors() { + wx.reLaunch({ + url: "/pages/index/index", + }); + }, + getCode() { + wx.ajax({ + method: "GET", + url: "?r=igg4/common/get-channel-wx-code", + data: { + ChannelType: "11", + Id: "", + }, + }).then((res) => { + this.setData({ + qrCode: res, + }); + }); + }, + handleBack() { + wx.navigateBack(); + }, +}); diff --git a/src/gift/pages/vipPending/index.wxml b/src/gift/pages/vipPending/index.wxml new file mode 100644 index 0000000..74e7cc5 --- /dev/null +++ b/src/gift/pages/vipPending/index.wxml @@ -0,0 +1,22 @@ + + + + + 提交成功,审核中 + 诊断证明审核通过后,即可享受平台全部服务 + + + 人工审核周期24小时~48小时 + + + + + 关注"gMG给力加油站"公众号 获取审核进度 + 还可以了解更多重症肌无力专业知识 + + + + 回到首页 + + + diff --git a/src/gift/pages/vipReject/index.json b/src/gift/pages/vipReject/index.json new file mode 100644 index 0000000..d54917e --- /dev/null +++ b/src/gift/pages/vipReject/index.json @@ -0,0 +1,10 @@ +{ + "navigationBarTitleText": "", + "navigationStyle": "custom", + "disableSwipeBack": true, + "usingComponents": { + "navBar": "/components/navBar/navBar", + "van-icon": "@vant/weapp/icon/index", + "van-divider": "@vant/weapp/divider/index" + } +} diff --git a/src/gift/pages/vipReject/index.scss b/src/gift/pages/vipReject/index.scss new file mode 100644 index 0000000..f5c295f --- /dev/null +++ b/src/gift/pages/vipReject/index.scss @@ -0,0 +1,142 @@ +.page { + position: relative; + box-sizing: border-box; + background-color: #fff; + .bg { + width: 100%; + } + .page-container { + position: absolute; + top: 0; + left: 0; + width: 100%; + min-height: 100vh; + display: flex; + flex-direction: column; + padding-bottom: 76rpx; + .navbar { + flex-shrink: 0; + padding: 0 20rpx 0; + display: flex; + align-items: center; + font-size: 40rpx; + color: #cf5375; + font-style: italic; + font-weight: bold; + .icon { + flex-shrink: 0; + margin-right: 9rpx; + width: 42rpx; + height: 46rpx; + } + } + .tip { + position: relative; + margin: 180rpx auto 0; + width: 510rpx; + padding: 20rpx 70rpx; + box-sizing: border-box; + background-color: #bb232c; + border-radius: 24rpx; + word-break: break-all; + .icon { + margin-right: 16rpx; + width: 48rpx; + height: 48rpx; + vertical-align: bottom; + } + .text { + font-size: 26rpx; + color: #fff; + line-height: 48rpx; + } + &::after { + position: absolute; + // bottom: -13.5px; + bottom: 0; + left: 50%; + transform: translate(-50%, 90%); + content: ""; + width: 0; + height: 0; + border-style: solid; + border-width: 12.5px 8px 0 8px; + border-color: #bb232c transparent transparent transparent; + } + } + .page-icon { + margin: 58rpx auto 0; + display: block; + width: 280rpx; + height: 280rpx; + border-radius: 50%; + } + .page-title { + margin-top: 64rpx; + font-size: 56rpx; + color: #333333; + font-weight: bold; + text-align: center; + } + .sub-title { + margin-top: 32rpx; + font-size: 32rpx; + color: #aaa; + text-align: center; + } + .footer { + margin: 179rpx auto 0; + flex-shrink: 0; + width: 622rpx; + box-sizing: border-box; + display: flex; + > view:not(:last-of-type), + > image { + margin-right: 30rpx; + } + .next { + flex: 1; + text-align: center; + height: 88rpx; + line-height: 88rpx; + text-align: center; + border: 2rpx solid #e04775; + border-radius: 24rpx; + font-size: 34rpx; + font-weight: bold; + background-color: #e04775; + color: #fff; + } + } + .divider { + margin: 48rpx auto 0; + width: 300rpx; + } + .ohter { + margin-top: 48rpx; + display: flex; + justify-content: center; + .col { + margin: 0 48rpx; + padding: 0 20rpx; + height: 48rpx; + border-radius: 24rpx; + background: #eeeeee; + font-size: 24rpx; + color: #666666; + display: flex; + align-items: center; + justify-content: center; + &::after { + border: none; + outline: none; + } + .icon { + margin-right: 12rpx; + width: 48rpx; + height: 48rpx; + } + } + } + } +} diff --git a/src/gift/pages/vipReject/index.ts b/src/gift/pages/vipReject/index.ts new file mode 100644 index 0000000..d1e9da8 --- /dev/null +++ b/src/gift/pages/vipReject/index.ts @@ -0,0 +1,25 @@ +const app = getApp(); + +Page({ + data: {}, + onLoad() { + app.waitLogin().then((res) => { + app.getUserInfo(this, true, (res) => { + console.log(res); + }); + }); + }, + handleSubmit() { + wx.reLaunch({ + url: "/gift/pages/vipCert/index", + }); + }, + handleVisitors() { + wx.reLaunch({ + url: "/pages/index/index", + }); + }, + handleBack() { + wx.navigateBack(); + }, +}); diff --git a/src/gift/pages/vipReject/index.wxml b/src/gift/pages/vipReject/index.wxml new file mode 100644 index 0000000..643a996 --- /dev/null +++ b/src/gift/pages/vipReject/index.wxml @@ -0,0 +1,25 @@ + + + + + + + 未通过原因:{{userInfo.UseDrugsRejectReason}} + + + 审核未通过 + 很遗憾您的审核未通过 + + 重新提交 + + + 或者 + + + + + 回到首页 + + + + diff --git a/src/gift/pages/vipStartPending/index.json b/src/gift/pages/vipStartPending/index.json new file mode 100644 index 0000000..d54917e --- /dev/null +++ b/src/gift/pages/vipStartPending/index.json @@ -0,0 +1,10 @@ +{ + "navigationBarTitleText": "", + "navigationStyle": "custom", + "disableSwipeBack": true, + "usingComponents": { + "navBar": "/components/navBar/navBar", + "van-icon": "@vant/weapp/icon/index", + "van-divider": "@vant/weapp/divider/index" + } +} diff --git a/src/gift/pages/vipStartPending/index.scss b/src/gift/pages/vipStartPending/index.scss new file mode 100644 index 0000000..bae36d5 --- /dev/null +++ b/src/gift/pages/vipStartPending/index.scss @@ -0,0 +1,77 @@ +.page { + position: relative; + box-sizing: border-box; + background-color: #fff; + .bg { + width: 100%; + } + .page-container { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100vh; + display: flex; + flex-direction: column; + .navbar { + flex-shrink: 0; + padding: 0 20rpx 0; + display: flex; + align-items: center; + font-size: 40rpx; + color: #cf5375; + font-style: italic; + font-weight: bold; + .icon { + margin-right: 9rpx; + width: 42rpx; + height: 46rpx; + } + } + .page-icon { + margin: 240rpx auto 0; + display: block; + width: 280rpx; + height: 280rpx; + } + .page-title { + margin-top: 64rpx; + font-size: 48rpx; + color: #333333; + font-weight: bold; + text-align: center; + } + .sub-title { + margin-top: 32rpx; + font-size: 28rpx; + color: #666; + text-align: center; + } + .footer { + position: absolute; + left: 64rpx; + bottom: 62rpx; + flex-shrink: 0; + width: 622rpx; + box-sizing: border-box; + display: flex; + > view:not(:last-of-type), + > image { + margin-right: 30rpx; + } + .next { + flex: 1; + text-align: center; + height: 88rpx; + line-height: 88rpx; + text-align: center; + border: 2rpx solid #e04775; + border-radius: 24rpx; + font-size: 34rpx; + font-weight: bold; + background-color: #e04775; + color: #fff; + } + } + } +} diff --git a/src/gift/pages/vipStartPending/index.ts b/src/gift/pages/vipStartPending/index.ts new file mode 100644 index 0000000..7ed1e55 --- /dev/null +++ b/src/gift/pages/vipStartPending/index.ts @@ -0,0 +1,14 @@ +const app = getApp(); + +Page({ + data: {}, + onLoad() {}, + handleVisitors() { + wx.reLaunch({ + url: "/pages/index/index", + }); + }, + handleBack() { + wx.navigateBack(); + }, +}); diff --git a/src/gift/pages/vipStartPending/index.wxml b/src/gift/pages/vipStartPending/index.wxml new file mode 100644 index 0000000..3607763 --- /dev/null +++ b/src/gift/pages/vipStartPending/index.wxml @@ -0,0 +1,15 @@ + + + + + + 提交成功,审核中 + + 人工审核周期24小时~48小时 + + + + 回到首页 + + + diff --git a/src/images/1.5/adl-add.png b/src/images/1.5/adl-add.png new file mode 100644 index 0000000..43b9d64 Binary files /dev/null and b/src/images/1.5/adl-add.png differ diff --git a/src/images/1.5/adl-alert-test.png b/src/images/1.5/adl-alert-test.png new file mode 100644 index 0000000..23bd2fe Binary files /dev/null and b/src/images/1.5/adl-alert-test.png differ diff --git a/src/images/1.5/adl-alert.png b/src/images/1.5/adl-alert.png new file mode 100644 index 0000000..edabd9a Binary files /dev/null and b/src/images/1.5/adl-alert.png differ diff --git a/src/images/1.5/adl-bg-active.png b/src/images/1.5/adl-bg-active.png new file mode 100644 index 0000000..5a28079 Binary files /dev/null and b/src/images/1.5/adl-bg-active.png differ diff --git a/src/images/1.5/adl-bg.png b/src/images/1.5/adl-bg.png new file mode 100644 index 0000000..eb84136 Binary files /dev/null and b/src/images/1.5/adl-bg.png differ diff --git a/src/images/1.5/arrow-right.png b/src/images/1.5/arrow-right.png new file mode 100644 index 0000000..055f63d Binary files /dev/null and b/src/images/1.5/arrow-right.png differ diff --git a/src/images/1.5/btn-drug.png b/src/images/1.5/btn-drug.png new file mode 100644 index 0000000..3184f76 Binary files /dev/null and b/src/images/1.5/btn-drug.png differ diff --git a/src/images/1.5/certIcon-2.png b/src/images/1.5/certIcon-2.png new file mode 100644 index 0000000..25d995f Binary files /dev/null and b/src/images/1.5/certIcon-2.png differ diff --git a/src/images/1.5/certIcon.png b/src/images/1.5/certIcon.png new file mode 100644 index 0000000..d32e02d Binary files /dev/null and b/src/images/1.5/certIcon.png differ diff --git a/src/images/1.5/certIcon1-bg.png b/src/images/1.5/certIcon1-bg.png new file mode 100644 index 0000000..58687d2 Binary files /dev/null and b/src/images/1.5/certIcon1-bg.png differ diff --git a/src/images/1.5/certIcon1.png b/src/images/1.5/certIcon1.png new file mode 100644 index 0000000..8ef649e Binary files /dev/null and b/src/images/1.5/certIcon1.png differ diff --git a/src/images/1.5/certIcon2-bg.png b/src/images/1.5/certIcon2-bg.png new file mode 100644 index 0000000..eb82013 Binary files /dev/null and b/src/images/1.5/certIcon2-bg.png differ diff --git a/src/images/1.5/certIcon2.png b/src/images/1.5/certIcon2.png new file mode 100644 index 0000000..c7e922f Binary files /dev/null and b/src/images/1.5/certIcon2.png differ diff --git a/src/images/1.5/d1.png b/src/images/1.5/d1.png new file mode 100644 index 0000000..b9ede5b Binary files /dev/null and b/src/images/1.5/d1.png differ diff --git a/src/images/1.5/d2.png b/src/images/1.5/d2.png new file mode 100644 index 0000000..099a271 Binary files /dev/null and b/src/images/1.5/d2.png differ diff --git a/src/images/1.5/d3.png b/src/images/1.5/d3.png new file mode 100644 index 0000000..f447962 Binary files /dev/null and b/src/images/1.5/d3.png differ diff --git a/src/images/1.5/drug-icon.png b/src/images/1.5/drug-icon.png new file mode 100644 index 0000000..809cd38 Binary files /dev/null and b/src/images/1.5/drug-icon.png differ diff --git a/src/images/1.5/drug-record-bg.png b/src/images/1.5/drug-record-bg.png new file mode 100644 index 0000000..a78005a Binary files /dev/null and b/src/images/1.5/drug-record-bg.png differ diff --git a/src/images/1.5/drug-reocrd-upload.png b/src/images/1.5/drug-reocrd-upload.png new file mode 100644 index 0000000..484e1e1 Binary files /dev/null and b/src/images/1.5/drug-reocrd-upload.png differ diff --git a/src/images/1.5/drugs.png b/src/images/1.5/drugs.png new file mode 100644 index 0000000..a5fa3c6 Binary files /dev/null and b/src/images/1.5/drugs.png differ diff --git a/src/images/1.5/hoem-question.png b/src/images/1.5/hoem-question.png new file mode 100644 index 0000000..a0d9a5b Binary files /dev/null and b/src/images/1.5/hoem-question.png differ diff --git a/src/images/1.5/home-adl.png b/src/images/1.5/home-adl.png new file mode 100644 index 0000000..e0438bc Binary files /dev/null and b/src/images/1.5/home-adl.png differ diff --git a/src/images/1.5/hos-icon1.png b/src/images/1.5/hos-icon1.png new file mode 100644 index 0000000..a2d0452 Binary files /dev/null and b/src/images/1.5/hos-icon1.png differ diff --git a/src/images/1.5/hos-title.png b/src/images/1.5/hos-title.png new file mode 100644 index 0000000..d0b6698 Binary files /dev/null and b/src/images/1.5/hos-title.png differ diff --git a/src/images/1.5/hostipal.png b/src/images/1.5/hostipal.png new file mode 100644 index 0000000..054849d Binary files /dev/null and b/src/images/1.5/hostipal.png differ diff --git a/src/images/1.5/live-play.png b/src/images/1.5/live-play.png new file mode 100644 index 0000000..f79a300 Binary files /dev/null and b/src/images/1.5/live-play.png differ diff --git a/src/images/1.5/my-common-icon1.png b/src/images/1.5/my-common-icon1.png new file mode 100644 index 0000000..f40dd95 Binary files /dev/null and b/src/images/1.5/my-common-icon1.png differ diff --git a/src/images/1.5/my-common-icon2.png b/src/images/1.5/my-common-icon2.png new file mode 100644 index 0000000..e7606df Binary files /dev/null and b/src/images/1.5/my-common-icon2.png differ diff --git a/src/images/1.5/my-list-icon1.png b/src/images/1.5/my-list-icon1.png new file mode 100644 index 0000000..9d8b8be Binary files /dev/null and b/src/images/1.5/my-list-icon1.png differ diff --git a/src/images/1.5/my-list-icon2.png b/src/images/1.5/my-list-icon2.png new file mode 100644 index 0000000..7eb3bf1 Binary files /dev/null and b/src/images/1.5/my-list-icon2.png differ diff --git a/src/images/1.5/my-list-icon3.png b/src/images/1.5/my-list-icon3.png new file mode 100644 index 0000000..84f540d Binary files /dev/null and b/src/images/1.5/my-list-icon3.png differ diff --git a/src/images/1.5/my-list-icon4.png b/src/images/1.5/my-list-icon4.png new file mode 100644 index 0000000..88b2e97 Binary files /dev/null and b/src/images/1.5/my-list-icon4.png differ diff --git a/src/images/1.5/my-list-icon5.png b/src/images/1.5/my-list-icon5.png new file mode 100644 index 0000000..3d200fc Binary files /dev/null and b/src/images/1.5/my-list-icon5.png differ diff --git a/src/images/1.5/n-site.png b/src/images/1.5/n-site.png new file mode 100644 index 0000000..f2fe6e4 Binary files /dev/null and b/src/images/1.5/n-site.png differ diff --git a/src/images/1.5/page-title.png b/src/images/1.5/page-title.png new file mode 100644 index 0000000..ab9e022 Binary files /dev/null and b/src/images/1.5/page-title.png differ diff --git a/src/images/1.5/phone.png b/src/images/1.5/phone.png new file mode 100644 index 0000000..33c4f55 Binary files /dev/null and b/src/images/1.5/phone.png differ diff --git a/src/images/1.5/search.png b/src/images/1.5/search.png new file mode 100644 index 0000000..9979385 Binary files /dev/null and b/src/images/1.5/search.png differ diff --git a/src/images/1.5/server-icon1.png b/src/images/1.5/server-icon1.png new file mode 100644 index 0000000..a67ae78 Binary files /dev/null and b/src/images/1.5/server-icon1.png differ diff --git a/src/images/1.5/server-icon2.png b/src/images/1.5/server-icon2.png new file mode 100644 index 0000000..7f008f4 Binary files /dev/null and b/src/images/1.5/server-icon2.png differ diff --git a/src/images/1.5/server-icon3.png b/src/images/1.5/server-icon3.png new file mode 100644 index 0000000..79ac1a8 Binary files /dev/null and b/src/images/1.5/server-icon3.png differ diff --git a/src/images/1.5/server-icon4.png b/src/images/1.5/server-icon4.png new file mode 100644 index 0000000..2d4da12 Binary files /dev/null and b/src/images/1.5/server-icon4.png differ diff --git a/src/images/1.5/site-circle.png b/src/images/1.5/site-circle.png new file mode 100644 index 0000000..3eb8b57 Binary files /dev/null and b/src/images/1.5/site-circle.png differ diff --git a/src/images/1.5/site.png b/src/images/1.5/site.png new file mode 100644 index 0000000..4a21c5c Binary files /dev/null and b/src/images/1.5/site.png differ diff --git a/src/images/1.5/story-bg.png b/src/images/1.5/story-bg.png new file mode 100644 index 0000000..e9dd236 Binary files /dev/null and b/src/images/1.5/story-bg.png differ diff --git a/src/images/1.5/story-share.png b/src/images/1.5/story-share.png new file mode 100644 index 0000000..72d6a04 Binary files /dev/null and b/src/images/1.5/story-share.png differ diff --git a/src/images/1.5/vip-toast.png b/src/images/1.5/vip-toast.png new file mode 100644 index 0000000..d68f767 Binary files /dev/null and b/src/images/1.5/vip-toast.png differ diff --git a/src/images/1.5/warn.png b/src/images/1.5/warn.png new file mode 100644 index 0000000..dbc8375 Binary files /dev/null and b/src/images/1.5/warn.png differ diff --git a/src/images/1/1.png b/src/images/1/1.png new file mode 100644 index 0000000..7ba80cc Binary files /dev/null and b/src/images/1/1.png differ diff --git a/src/images/1/2.png b/src/images/1/2.png new file mode 100644 index 0000000..234e9ea Binary files /dev/null and b/src/images/1/2.png differ diff --git a/src/images/1/3.png b/src/images/1/3.png new file mode 100644 index 0000000..fd31aab Binary files /dev/null and b/src/images/1/3.png differ diff --git a/src/images/1/a.png b/src/images/1/a.png new file mode 100644 index 0000000..55e416f Binary files /dev/null and b/src/images/1/a.png differ diff --git a/src/images/1/adl-add.png b/src/images/1/adl-add.png new file mode 100644 index 0000000..bce0a75 Binary files /dev/null and b/src/images/1/adl-add.png differ diff --git a/src/images/1/adl-bg-active.png b/src/images/1/adl-bg-active.png new file mode 100644 index 0000000..5fd7ca5 Binary files /dev/null and b/src/images/1/adl-bg-active.png differ diff --git a/src/images/1/adl-bg.png b/src/images/1/adl-bg.png new file mode 100644 index 0000000..9f3c227 Binary files /dev/null and b/src/images/1/adl-bg.png differ diff --git a/src/images/1/adl-detail-bg.png b/src/images/1/adl-detail-bg.png new file mode 100644 index 0000000..25df5f4 Binary files /dev/null and b/src/images/1/adl-detail-bg.png differ diff --git a/src/images/1/adl-faveicon.png b/src/images/1/adl-faveicon.png new file mode 100644 index 0000000..4b85c00 Binary files /dev/null and b/src/images/1/adl-faveicon.png differ diff --git a/src/images/1/adl-icon1.png b/src/images/1/adl-icon1.png new file mode 100644 index 0000000..4b91c82 Binary files /dev/null and b/src/images/1/adl-icon1.png differ diff --git a/src/images/1/adl-icon2.png b/src/images/1/adl-icon2.png new file mode 100644 index 0000000..79f6693 Binary files /dev/null and b/src/images/1/adl-icon2.png differ diff --git a/src/images/1/adl-icon3.png b/src/images/1/adl-icon3.png new file mode 100644 index 0000000..cdcdd06 Binary files /dev/null and b/src/images/1/adl-icon3.png differ diff --git a/src/images/1/adl-icon4.png b/src/images/1/adl-icon4.png new file mode 100644 index 0000000..c0dc58b Binary files /dev/null and b/src/images/1/adl-icon4.png differ diff --git a/src/images/1/adl-icon5.png b/src/images/1/adl-icon5.png new file mode 100644 index 0000000..6d19310 Binary files /dev/null and b/src/images/1/adl-icon5.png differ diff --git a/src/images/1/adl-icon6.png b/src/images/1/adl-icon6.png new file mode 100644 index 0000000..08e34ab Binary files /dev/null and b/src/images/1/adl-icon6.png differ diff --git a/src/images/1/adl-icon7.png b/src/images/1/adl-icon7.png new file mode 100644 index 0000000..33b6c93 Binary files /dev/null and b/src/images/1/adl-icon7.png differ diff --git a/src/images/1/adl-icon8.png b/src/images/1/adl-icon8.png new file mode 100644 index 0000000..94bcdef Binary files /dev/null and b/src/images/1/adl-icon8.png differ diff --git a/src/images/1/adl-icon9.png b/src/images/1/adl-icon9.png new file mode 100644 index 0000000..16effd7 Binary files /dev/null and b/src/images/1/adl-icon9.png differ diff --git a/src/images/1/adl-result1.png b/src/images/1/adl-result1.png new file mode 100644 index 0000000..92f8e34 Binary files /dev/null and b/src/images/1/adl-result1.png differ diff --git a/src/images/1/adl-result2.png b/src/images/1/adl-result2.png new file mode 100644 index 0000000..b3e6992 Binary files /dev/null and b/src/images/1/adl-result2.png differ diff --git a/src/images/1/adl-result3.png b/src/images/1/adl-result3.png new file mode 100644 index 0000000..58359bb Binary files /dev/null and b/src/images/1/adl-result3.png differ diff --git a/src/images/1/adl-scurt-icon.png b/src/images/1/adl-scurt-icon.png new file mode 100644 index 0000000..e8fb2b9 Binary files /dev/null and b/src/images/1/adl-scurt-icon.png differ diff --git a/src/images/1/adl-scurt.png b/src/images/1/adl-scurt.png new file mode 100644 index 0000000..6de2feb Binary files /dev/null and b/src/images/1/adl-scurt.png differ diff --git a/src/images/1/adl-share-bg.png b/src/images/1/adl-share-bg.png new file mode 100644 index 0000000..cdecfe3 Binary files /dev/null and b/src/images/1/adl-share-bg.png differ diff --git a/src/images/1/adl-test-bg.png b/src/images/1/adl-test-bg.png new file mode 100644 index 0000000..18c2f23 Binary files /dev/null and b/src/images/1/adl-test-bg.png differ diff --git a/src/images/1/arrow-right.png b/src/images/1/arrow-right.png new file mode 100644 index 0000000..bfbd15f Binary files /dev/null and b/src/images/1/arrow-right.png differ diff --git a/src/images/1/audio-pause.png b/src/images/1/audio-pause.png new file mode 100644 index 0000000..b7920c0 Binary files /dev/null and b/src/images/1/audio-pause.png differ diff --git a/src/images/1/audio-play.png b/src/images/1/audio-play.png new file mode 100644 index 0000000..3958eca Binary files /dev/null and b/src/images/1/audio-play.png differ diff --git a/src/images/1/cert-pending.png b/src/images/1/cert-pending.png new file mode 100644 index 0000000..1e7665a Binary files /dev/null and b/src/images/1/cert-pending.png differ diff --git a/src/images/1/cert-reject.png b/src/images/1/cert-reject.png new file mode 100644 index 0000000..7ca0deb Binary files /dev/null and b/src/images/1/cert-reject.png differ diff --git a/src/images/1/cert-reslove.png b/src/images/1/cert-reslove.png new file mode 100644 index 0000000..04e8cad Binary files /dev/null and b/src/images/1/cert-reslove.png differ diff --git a/src/images/1/code.png b/src/images/1/code.png new file mode 100644 index 0000000..66eac86 Binary files /dev/null and b/src/images/1/code.png differ diff --git a/src/images/1/date.png b/src/images/1/date.png new file mode 100644 index 0000000..f20c539 Binary files /dev/null and b/src/images/1/date.png differ diff --git a/src/images/1/default-user.png b/src/images/1/default-user.png new file mode 100644 index 0000000..83e7b6c Binary files /dev/null and b/src/images/1/default-user.png differ diff --git a/src/images/1/del-story.png b/src/images/1/del-story.png new file mode 100644 index 0000000..fb10b8f Binary files /dev/null and b/src/images/1/del-story.png differ diff --git a/src/images/1/download.png b/src/images/1/download.png new file mode 100644 index 0000000..5de65f8 Binary files /dev/null and b/src/images/1/download.png differ diff --git a/src/images/1/enter-switch1-active.png b/src/images/1/enter-switch1-active.png new file mode 100644 index 0000000..1e235cb Binary files /dev/null and b/src/images/1/enter-switch1-active.png differ diff --git a/src/images/1/enter-switch1.png b/src/images/1/enter-switch1.png new file mode 100644 index 0000000..71b5d8f Binary files /dev/null and b/src/images/1/enter-switch1.png differ diff --git a/src/images/1/enter-switch2-active.png b/src/images/1/enter-switch2-active.png new file mode 100644 index 0000000..4ee4811 Binary files /dev/null and b/src/images/1/enter-switch2-active.png differ diff --git a/src/images/1/enter-switch2.png b/src/images/1/enter-switch2.png new file mode 100644 index 0000000..cf04727 Binary files /dev/null and b/src/images/1/enter-switch2.png differ diff --git a/src/images/1/f-warn.png b/src/images/1/f-warn.png new file mode 100644 index 0000000..3a3b31d Binary files /dev/null and b/src/images/1/f-warn.png differ diff --git a/src/images/1/family-fa.png b/src/images/1/family-fa.png new file mode 100644 index 0000000..5217620 Binary files /dev/null and b/src/images/1/family-fa.png differ diff --git a/src/images/1/family-kin.png b/src/images/1/family-kin.png new file mode 100644 index 0000000..18d6e76 Binary files /dev/null and b/src/images/1/family-kin.png differ diff --git a/src/images/1/family-mom.png b/src/images/1/family-mom.png new file mode 100644 index 0000000..f10294f Binary files /dev/null and b/src/images/1/family-mom.png differ diff --git a/src/images/1/family-scan.png b/src/images/1/family-scan.png new file mode 100644 index 0000000..0c5c040 Binary files /dev/null and b/src/images/1/family-scan.png differ diff --git a/src/images/1/family-user.png b/src/images/1/family-user.png new file mode 100644 index 0000000..faf846a Binary files /dev/null and b/src/images/1/family-user.png differ diff --git a/src/images/1/fillscreen.png b/src/images/1/fillscreen.png new file mode 100644 index 0000000..d79a62e Binary files /dev/null and b/src/images/1/fillscreen.png differ diff --git a/src/images/1/firee-audio-bg.png b/src/images/1/firee-audio-bg.png new file mode 100644 index 0000000..3d22647 Binary files /dev/null and b/src/images/1/firee-audio-bg.png differ diff --git a/src/images/1/fixed-share.png b/src/images/1/fixed-share.png new file mode 100644 index 0000000..90cda4f Binary files /dev/null and b/src/images/1/fixed-share.png differ diff --git a/src/images/1/frame.png b/src/images/1/frame.png new file mode 100644 index 0000000..4ddf1e9 Binary files /dev/null and b/src/images/1/frame.png differ diff --git a/src/images/1/home-adl-icon1.png b/src/images/1/home-adl-icon1.png new file mode 100644 index 0000000..a641c25 Binary files /dev/null and b/src/images/1/home-adl-icon1.png differ diff --git a/src/images/1/home-adl-icon2.png b/src/images/1/home-adl-icon2.png new file mode 100644 index 0000000..c3867c5 Binary files /dev/null and b/src/images/1/home-adl-icon2.png differ diff --git a/src/images/1/home-adl-icon3.png b/src/images/1/home-adl-icon3.png new file mode 100644 index 0000000..c29c859 Binary files /dev/null and b/src/images/1/home-adl-icon3.png differ diff --git a/src/images/1/home-adl-icon4.png b/src/images/1/home-adl-icon4.png new file mode 100644 index 0000000..fe9ef4b Binary files /dev/null and b/src/images/1/home-adl-icon4.png differ diff --git a/src/images/1/home-adl.png b/src/images/1/home-adl.png new file mode 100644 index 0000000..af8c5ac Binary files /dev/null and b/src/images/1/home-adl.png differ diff --git a/src/images/1/identity-family-active.png b/src/images/1/identity-family-active.png new file mode 100644 index 0000000..9db42a7 Binary files /dev/null and b/src/images/1/identity-family-active.png differ diff --git a/src/images/1/identity-family.png b/src/images/1/identity-family.png new file mode 100644 index 0000000..38a8dc8 Binary files /dev/null and b/src/images/1/identity-family.png differ diff --git a/src/images/1/identity-user-active.png b/src/images/1/identity-user-active.png new file mode 100644 index 0000000..4782a51 Binary files /dev/null and b/src/images/1/identity-user-active.png differ diff --git a/src/images/1/identity-user.png b/src/images/1/identity-user.png new file mode 100644 index 0000000..e1db151 Binary files /dev/null and b/src/images/1/identity-user.png differ diff --git a/src/images/1/index-bg.png b/src/images/1/index-bg.png new file mode 100644 index 0000000..388861a Binary files /dev/null and b/src/images/1/index-bg.png differ diff --git a/src/images/1/knowle-bg.png b/src/images/1/knowle-bg.png new file mode 100644 index 0000000..1725ed4 Binary files /dev/null and b/src/images/1/knowle-bg.png differ diff --git a/src/images/1/left.png b/src/images/1/left.png new file mode 100644 index 0000000..967dc03 Binary files /dev/null and b/src/images/1/left.png differ diff --git a/src/images/1/live-detail-play.png b/src/images/1/live-detail-play.png new file mode 100644 index 0000000..bdfa8b9 Binary files /dev/null and b/src/images/1/live-detail-play.png differ diff --git a/src/images/1/live-play.png b/src/images/1/live-play.png new file mode 100644 index 0000000..4cbc663 Binary files /dev/null and b/src/images/1/live-play.png differ diff --git a/src/images/1/live-resluct.png b/src/images/1/live-resluct.png new file mode 100644 index 0000000..2cd04e2 Binary files /dev/null and b/src/images/1/live-resluct.png differ diff --git a/src/images/1/live-result-reject.png b/src/images/1/live-result-reject.png new file mode 100644 index 0000000..ea6998b Binary files /dev/null and b/src/images/1/live-result-reject.png differ diff --git a/src/images/1/live-result-success.png b/src/images/1/live-result-success.png new file mode 100644 index 0000000..8470c8a Binary files /dev/null and b/src/images/1/live-result-success.png differ diff --git a/src/images/1/live-result-warn.png b/src/images/1/live-result-warn.png new file mode 100644 index 0000000..692f272 Binary files /dev/null and b/src/images/1/live-result-warn.png differ diff --git a/src/images/1/login-bg.png b/src/images/1/login-bg.png new file mode 100644 index 0000000..bc2bf39 Binary files /dev/null and b/src/images/1/login-bg.png differ diff --git a/src/images/1/login-mask-bg.png b/src/images/1/login-mask-bg.png new file mode 100644 index 0000000..a76ad9d Binary files /dev/null and b/src/images/1/login-mask-bg.png differ diff --git a/src/images/1/login-title.png b/src/images/1/login-title.png new file mode 100644 index 0000000..86e3946 Binary files /dev/null and b/src/images/1/login-title.png differ diff --git a/src/images/1/look-no.png b/src/images/1/look-no.png new file mode 100644 index 0000000..0185301 Binary files /dev/null and b/src/images/1/look-no.png differ diff --git a/src/images/1/look.png b/src/images/1/look.png new file mode 100644 index 0000000..a860bf2 Binary files /dev/null and b/src/images/1/look.png differ diff --git a/src/images/1/look的副本.png b/src/images/1/look的副本.png new file mode 100644 index 0000000..a860bf2 Binary files /dev/null and b/src/images/1/look的副本.png differ diff --git a/src/images/1/man-active.png b/src/images/1/man-active.png new file mode 100644 index 0000000..6bc2a18 Binary files /dev/null and b/src/images/1/man-active.png differ diff --git a/src/images/1/man.png b/src/images/1/man.png new file mode 100644 index 0000000..7169049 Binary files /dev/null and b/src/images/1/man.png differ diff --git a/src/images/1/my-bg.png b/src/images/1/my-bg.png new file mode 100644 index 0000000..f73fc83 Binary files /dev/null and b/src/images/1/my-bg.png differ diff --git a/src/images/1/my-common-icon1.png b/src/images/1/my-common-icon1.png new file mode 100644 index 0000000..3a01e62 Binary files /dev/null and b/src/images/1/my-common-icon1.png differ diff --git a/src/images/1/my-common-icon2.png b/src/images/1/my-common-icon2.png new file mode 100644 index 0000000..5512519 Binary files /dev/null and b/src/images/1/my-common-icon2.png differ diff --git a/src/images/1/my-list-icon1.png b/src/images/1/my-list-icon1.png new file mode 100644 index 0000000..6fdd063 Binary files /dev/null and b/src/images/1/my-list-icon1.png differ diff --git a/src/images/1/my-list-icon2.png b/src/images/1/my-list-icon2.png new file mode 100644 index 0000000..e1e3c38 Binary files /dev/null and b/src/images/1/my-list-icon2.png differ diff --git a/src/images/1/my-list-icon3.png b/src/images/1/my-list-icon3.png new file mode 100644 index 0000000..a81ae38 Binary files /dev/null and b/src/images/1/my-list-icon3.png differ diff --git a/src/images/1/my-list-icon4.png b/src/images/1/my-list-icon4.png new file mode 100644 index 0000000..0f9ba15 Binary files /dev/null and b/src/images/1/my-list-icon4.png differ diff --git a/src/images/1/nav-site.png b/src/images/1/nav-site.png new file mode 100644 index 0000000..ce44b32 Binary files /dev/null and b/src/images/1/nav-site.png differ diff --git a/src/images/1/page-title.png b/src/images/1/page-title.png new file mode 100644 index 0000000..a35553a Binary files /dev/null and b/src/images/1/page-title.png differ diff --git a/src/images/1/popup-soory-enter-bg.png b/src/images/1/popup-soory-enter-bg.png new file mode 100644 index 0000000..bd18480 Binary files /dev/null and b/src/images/1/popup-soory-enter-bg.png differ diff --git a/src/images/1/poster-bg.png b/src/images/1/poster-bg.png new file mode 100644 index 0000000..ea188ca Binary files /dev/null and b/src/images/1/poster-bg.png differ diff --git a/src/images/1/poster.png b/src/images/1/poster.png new file mode 100644 index 0000000..540b403 Binary files /dev/null and b/src/images/1/poster.png differ diff --git a/src/images/1/poster的副本.png b/src/images/1/poster的副本.png new file mode 100644 index 0000000..540b403 Binary files /dev/null and b/src/images/1/poster的副本.png differ diff --git a/src/images/1/privacyAgreement-icon.png b/src/images/1/privacyAgreement-icon.png new file mode 100644 index 0000000..80ed01a Binary files /dev/null and b/src/images/1/privacyAgreement-icon.png differ diff --git a/src/images/1/question-prev.png b/src/images/1/question-prev.png new file mode 100644 index 0000000..4980a64 Binary files /dev/null and b/src/images/1/question-prev.png differ diff --git a/src/images/1/question-true.png b/src/images/1/question-true.png new file mode 100644 index 0000000..65f4465 Binary files /dev/null and b/src/images/1/question-true.png differ diff --git a/src/images/1/right.png b/src/images/1/right.png new file mode 100644 index 0000000..c14fb2f Binary files /dev/null and b/src/images/1/right.png differ diff --git a/src/images/1/save-active-plan.png b/src/images/1/save-active-plan.png new file mode 100644 index 0000000..2af71c9 Binary files /dev/null and b/src/images/1/save-active-plan.png differ diff --git a/src/images/1/save-active.png b/src/images/1/save-active.png new file mode 100644 index 0000000..8025930 Binary files /dev/null and b/src/images/1/save-active.png differ diff --git a/src/images/1/save.png b/src/images/1/save.png new file mode 100644 index 0000000..6173274 Binary files /dev/null and b/src/images/1/save.png differ diff --git a/src/images/1/scan-example.png b/src/images/1/scan-example.png new file mode 100644 index 0000000..dac390f Binary files /dev/null and b/src/images/1/scan-example.png differ diff --git a/src/images/1/search.png b/src/images/1/search.png new file mode 100644 index 0000000..b2e993c Binary files /dev/null and b/src/images/1/search.png differ diff --git a/src/images/1/select-active.png b/src/images/1/select-active.png new file mode 100644 index 0000000..d5c9d7d Binary files /dev/null and b/src/images/1/select-active.png differ diff --git a/src/images/1/select.png b/src/images/1/select.png new file mode 100644 index 0000000..06ffa29 Binary files /dev/null and b/src/images/1/select.png differ diff --git a/src/images/1/server-bg.png b/src/images/1/server-bg.png new file mode 100644 index 0000000..4804372 Binary files /dev/null and b/src/images/1/server-bg.png differ diff --git a/src/images/1/server-icon1.png b/src/images/1/server-icon1.png new file mode 100644 index 0000000..128b5ed Binary files /dev/null and b/src/images/1/server-icon1.png differ diff --git a/src/images/1/server-icon2.png b/src/images/1/server-icon2.png new file mode 100644 index 0000000..128b5ed Binary files /dev/null and b/src/images/1/server-icon2.png differ diff --git a/src/images/1/share-active.png b/src/images/1/share-active.png new file mode 100644 index 0000000..81e062c Binary files /dev/null and b/src/images/1/share-active.png differ diff --git a/src/images/1/share.png b/src/images/1/share.png new file mode 100644 index 0000000..35ddae7 Binary files /dev/null and b/src/images/1/share.png differ diff --git a/src/images/1/site.png b/src/images/1/site.png new file mode 100644 index 0000000..5a2f7aa Binary files /dev/null and b/src/images/1/site.png differ diff --git a/src/images/1/star-active.png b/src/images/1/star-active.png new file mode 100644 index 0000000..64d0e24 Binary files /dev/null and b/src/images/1/star-active.png differ diff --git a/src/images/1/star-detail.png b/src/images/1/star-detail.png new file mode 100644 index 0000000..a08d7f9 Binary files /dev/null and b/src/images/1/star-detail.png differ diff --git a/src/images/1/star.png b/src/images/1/star.png new file mode 100644 index 0000000..5b8603c Binary files /dev/null and b/src/images/1/star.png differ diff --git a/src/images/1/start.gif b/src/images/1/start.gif new file mode 100644 index 0000000..5d2ce34 Binary files /dev/null and b/src/images/1/start.gif differ diff --git a/src/images/1/start.png b/src/images/1/start.png new file mode 100644 index 0000000..3685663 Binary files /dev/null and b/src/images/1/start.png differ diff --git a/src/images/1/story-bg.png b/src/images/1/story-bg.png new file mode 100644 index 0000000..754cbb3 Binary files /dev/null and b/src/images/1/story-bg.png differ diff --git a/src/images/1/story-enter-bg.png b/src/images/1/story-enter-bg.png new file mode 100644 index 0000000..9a3511f Binary files /dev/null and b/src/images/1/story-enter-bg.png differ diff --git a/src/images/1/story-share.png b/src/images/1/story-share.png new file mode 100644 index 0000000..05d9f08 Binary files /dev/null and b/src/images/1/story-share.png differ diff --git a/src/images/1/storyDetail-bg.png b/src/images/1/storyDetail-bg.png new file mode 100644 index 0000000..8279539 Binary files /dev/null and b/src/images/1/storyDetail-bg.png differ diff --git a/src/images/1/storyGuide-bg.png b/src/images/1/storyGuide-bg.png new file mode 100644 index 0000000..82ff51f Binary files /dev/null and b/src/images/1/storyGuide-bg.png differ diff --git a/src/images/1/storyStatus1.png b/src/images/1/storyStatus1.png new file mode 100644 index 0000000..efb6811 Binary files /dev/null and b/src/images/1/storyStatus1.png differ diff --git a/src/images/1/storyStatus2.png b/src/images/1/storyStatus2.png new file mode 100644 index 0000000..64cf431 Binary files /dev/null and b/src/images/1/storyStatus2.png differ diff --git a/src/images/1/storyStatus3.png b/src/images/1/storyStatus3.png new file mode 100644 index 0000000..8cb3c9b Binary files /dev/null and b/src/images/1/storyStatus3.png differ diff --git a/src/images/1/storyStatus4.png b/src/images/1/storyStatus4.png new file mode 100644 index 0000000..29c9444 Binary files /dev/null and b/src/images/1/storyStatus4.png differ diff --git a/src/images/1/succees.png b/src/images/1/succees.png new file mode 100644 index 0000000..ad9a47a Binary files /dev/null and b/src/images/1/succees.png differ diff --git a/src/images/1/telephone.png b/src/images/1/telephone.png new file mode 100644 index 0000000..b4f1ab4 Binary files /dev/null and b/src/images/1/telephone.png differ diff --git a/src/images/1/thePublic-bg.png b/src/images/1/thePublic-bg.png new file mode 100644 index 0000000..a1ebbd3 Binary files /dev/null and b/src/images/1/thePublic-bg.png differ diff --git a/src/images/1/thePublic.png b/src/images/1/thePublic.png new file mode 100644 index 0000000..de01526 Binary files /dev/null and b/src/images/1/thePublic.png differ diff --git a/src/images/1/tip.png b/src/images/1/tip.png new file mode 100644 index 0000000..c3f5a6f Binary files /dev/null and b/src/images/1/tip.png differ diff --git a/src/images/1/toast-story-badge.png b/src/images/1/toast-story-badge.png new file mode 100644 index 0000000..a177382 Binary files /dev/null and b/src/images/1/toast-story-badge.png differ diff --git a/src/images/1/upload-cert.png b/src/images/1/upload-cert.png new file mode 100644 index 0000000..35d70c2 Binary files /dev/null and b/src/images/1/upload-cert.png differ diff --git a/src/images/1/upload-del.png b/src/images/1/upload-del.png new file mode 100644 index 0000000..f958124 Binary files /dev/null and b/src/images/1/upload-del.png differ diff --git a/src/images/1/upload-icon.png b/src/images/1/upload-icon.png new file mode 100644 index 0000000..4a96192 Binary files /dev/null and b/src/images/1/upload-icon.png differ diff --git a/src/images/1/video-play.png b/src/images/1/video-play.png new file mode 100644 index 0000000..d678f33 Binary files /dev/null and b/src/images/1/video-play.png differ diff --git a/src/images/1/view-active.png b/src/images/1/view-active.png new file mode 100644 index 0000000..ffd0638 Binary files /dev/null and b/src/images/1/view-active.png differ diff --git a/src/images/1/view-play.png b/src/images/1/view-play.png new file mode 100644 index 0000000..d678f33 Binary files /dev/null and b/src/images/1/view-play.png differ diff --git a/src/images/1/view.png b/src/images/1/view.png new file mode 100644 index 0000000..cbdef01 Binary files /dev/null and b/src/images/1/view.png differ diff --git a/src/images/1/voice-play.png b/src/images/1/voice-play.png new file mode 100644 index 0000000..980c05b Binary files /dev/null and b/src/images/1/voice-play.png differ diff --git a/src/images/1/voice-stop.png b/src/images/1/voice-stop.png new file mode 100644 index 0000000..9e3a1dd Binary files /dev/null and b/src/images/1/voice-stop.png differ diff --git a/src/images/1/warn.png b/src/images/1/warn.png new file mode 100644 index 0000000..262b42b Binary files /dev/null and b/src/images/1/warn.png differ diff --git a/src/images/1/wechat.png b/src/images/1/wechat.png new file mode 100644 index 0000000..9c142c2 Binary files /dev/null and b/src/images/1/wechat.png differ diff --git a/src/images/1/woman-active.png b/src/images/1/woman-active.png new file mode 100644 index 0000000..92b97c9 Binary files /dev/null and b/src/images/1/woman-active.png differ diff --git a/src/images/1/woman.png b/src/images/1/woman.png new file mode 100644 index 0000000..99dcbe3 Binary files /dev/null and b/src/images/1/woman.png differ diff --git a/src/images/2/adl-close1.png b/src/images/2/adl-close1.png new file mode 100644 index 0000000..1f9eaee Binary files /dev/null and b/src/images/2/adl-close1.png differ diff --git a/src/images/2/adl-close2.png b/src/images/2/adl-close2.png new file mode 100644 index 0000000..d11f8e6 Binary files /dev/null and b/src/images/2/adl-close2.png differ diff --git a/src/images/2/adl-money.png b/src/images/2/adl-money.png new file mode 100644 index 0000000..a32efc9 Binary files /dev/null and b/src/images/2/adl-money.png differ diff --git a/src/images/2/adl-result-btn.gif b/src/images/2/adl-result-btn.gif new file mode 100644 index 0000000..af215a1 Binary files /dev/null and b/src/images/2/adl-result-btn.gif differ diff --git a/src/images/2/big-money.png b/src/images/2/big-money.png new file mode 100644 index 0000000..1e6104a Binary files /dev/null and b/src/images/2/big-money.png differ diff --git a/src/images/2/close.png b/src/images/2/close.png new file mode 100644 index 0000000..48f39fc Binary files /dev/null and b/src/images/2/close.png differ diff --git a/src/images/2/doctor-bg.png b/src/images/2/doctor-bg.png new file mode 100644 index 0000000..4504cdc Binary files /dev/null and b/src/images/2/doctor-bg.png differ diff --git a/src/images/2/doctor-drug-bg.png b/src/images/2/doctor-drug-bg.png new file mode 100644 index 0000000..8752655 Binary files /dev/null and b/src/images/2/doctor-drug-bg.png differ diff --git a/src/images/2/doctor-home-bg.png b/src/images/2/doctor-home-bg.png new file mode 100644 index 0000000..87d80c7 Binary files /dev/null and b/src/images/2/doctor-home-bg.png differ diff --git a/src/images/2/doctor-home-drug-bg.png b/src/images/2/doctor-home-drug-bg.png new file mode 100644 index 0000000..245a11f Binary files /dev/null and b/src/images/2/doctor-home-drug-bg.png differ diff --git a/src/images/2/edit.png b/src/images/2/edit.png new file mode 100644 index 0000000..ea07315 Binary files /dev/null and b/src/images/2/edit.png differ diff --git a/src/images/2/follow.png b/src/images/2/follow.png new file mode 100644 index 0000000..9f3b638 Binary files /dev/null and b/src/images/2/follow.png differ diff --git a/src/images/2/gift-drug.png b/src/images/2/gift-drug.png new file mode 100644 index 0000000..b467e74 Binary files /dev/null and b/src/images/2/gift-drug.png differ diff --git a/src/images/2/gift-list-title.png b/src/images/2/gift-list-title.png new file mode 100644 index 0000000..889bf66 Binary files /dev/null and b/src/images/2/gift-list-title.png differ diff --git a/src/images/2/gift.png b/src/images/2/gift.png new file mode 100644 index 0000000..dff4385 Binary files /dev/null and b/src/images/2/gift.png differ diff --git a/src/images/2/mg.png b/src/images/2/mg.png new file mode 100644 index 0000000..1374728 Binary files /dev/null and b/src/images/2/mg.png differ diff --git a/src/images/2/money.png b/src/images/2/money.png new file mode 100644 index 0000000..6707a47 Binary files /dev/null and b/src/images/2/money.png differ diff --git a/src/images/2/new-label.png b/src/images/2/new-label.png new file mode 100644 index 0000000..a1a1d11 Binary files /dev/null and b/src/images/2/new-label.png differ diff --git a/src/images/2/notice.png b/src/images/2/notice.png new file mode 100644 index 0000000..f7ec080 Binary files /dev/null and b/src/images/2/notice.png differ diff --git a/src/images/2/order-end.png b/src/images/2/order-end.png new file mode 100644 index 0000000..79f9dcf Binary files /dev/null and b/src/images/2/order-end.png differ diff --git a/src/images/2/order-site.png b/src/images/2/order-site.png new file mode 100644 index 0000000..e7b6977 Binary files /dev/null and b/src/images/2/order-site.png differ diff --git a/src/images/2/order-status1.png b/src/images/2/order-status1.png new file mode 100644 index 0000000..dfe8d09 Binary files /dev/null and b/src/images/2/order-status1.png differ diff --git a/src/images/2/popup-dedicated-doctor-bg.png b/src/images/2/popup-dedicated-doctor-bg.png new file mode 100644 index 0000000..fd486ac Binary files /dev/null and b/src/images/2/popup-dedicated-doctor-bg.png differ diff --git a/src/images/2/popup-dedicated-doctor-content-drug.png b/src/images/2/popup-dedicated-doctor-content-drug.png new file mode 100644 index 0000000..2ede554 Binary files /dev/null and b/src/images/2/popup-dedicated-doctor-content-drug.png differ diff --git a/src/images/2/popup-dedicated-doctor-content.png b/src/images/2/popup-dedicated-doctor-content.png new file mode 100644 index 0000000..c7ce33d Binary files /dev/null and b/src/images/2/popup-dedicated-doctor-content.png differ diff --git a/src/images/2/popup-dedicated-doctor-drug-bg.png b/src/images/2/popup-dedicated-doctor-drug-bg.png new file mode 100644 index 0000000..4a1e146 Binary files /dev/null and b/src/images/2/popup-dedicated-doctor-drug-bg.png differ diff --git a/src/images/2/price-detail-banner-bg.png b/src/images/2/price-detail-banner-bg.png new file mode 100644 index 0000000..6c85355 Binary files /dev/null and b/src/images/2/price-detail-banner-bg.png differ diff --git a/src/images/2/progress-bg1.png b/src/images/2/progress-bg1.png new file mode 100644 index 0000000..a29e6e1 Binary files /dev/null and b/src/images/2/progress-bg1.png differ diff --git a/src/images/2/progress-bg2.png b/src/images/2/progress-bg2.png new file mode 100644 index 0000000..ae25c00 Binary files /dev/null and b/src/images/2/progress-bg2.png differ diff --git a/src/images/2/progress-end-bg1.png b/src/images/2/progress-end-bg1.png new file mode 100644 index 0000000..d6723b4 Binary files /dev/null and b/src/images/2/progress-end-bg1.png differ diff --git a/src/images/2/progress-end-bg2.png b/src/images/2/progress-end-bg2.png new file mode 100644 index 0000000..95eb6e9 Binary files /dev/null and b/src/images/2/progress-end-bg2.png differ diff --git a/src/images/2/score-rule-bg.png b/src/images/2/score-rule-bg.png new file mode 100644 index 0000000..4e5ad1c Binary files /dev/null and b/src/images/2/score-rule-bg.png differ diff --git a/src/images/2/score-rule-title1.png b/src/images/2/score-rule-title1.png new file mode 100644 index 0000000..ece17f7 Binary files /dev/null and b/src/images/2/score-rule-title1.png differ diff --git a/src/images/2/score-rule-title2.png b/src/images/2/score-rule-title2.png new file mode 100644 index 0000000..eebc069 Binary files /dev/null and b/src/images/2/score-rule-title2.png differ diff --git a/src/images/2/score-rule-title3.png b/src/images/2/score-rule-title3.png new file mode 100644 index 0000000..d2ba554 Binary files /dev/null and b/src/images/2/score-rule-title3.png differ diff --git a/src/images/2/site.png b/src/images/2/site.png new file mode 100644 index 0000000..d19c2d0 Binary files /dev/null and b/src/images/2/site.png differ diff --git a/src/images/2/story-guide1.png b/src/images/2/story-guide1.png new file mode 100644 index 0000000..a03ed70 Binary files /dev/null and b/src/images/2/story-guide1.png differ diff --git a/src/images/2/story-guide2.png b/src/images/2/story-guide2.png new file mode 100644 index 0000000..cb1bf9d Binary files /dev/null and b/src/images/2/story-guide2.png differ diff --git a/src/images/2/story-guide3.png b/src/images/2/story-guide3.png new file mode 100644 index 0000000..ed074ad Binary files /dev/null and b/src/images/2/story-guide3.png differ diff --git a/src/images/2/true.png b/src/images/2/true.png new file mode 100644 index 0000000..5a28bee Binary files /dev/null and b/src/images/2/true.png differ diff --git a/src/images/3/icon-clock.png b/src/images/3/icon-clock.png new file mode 100644 index 0000000..dea669a Binary files /dev/null and b/src/images/3/icon-clock.png differ diff --git a/src/images/3/icon-edit-white.png b/src/images/3/icon-edit-white.png new file mode 100644 index 0000000..e6f1149 Binary files /dev/null and b/src/images/3/icon-edit-white.png differ diff --git a/src/images/3/icon-send-date.png b/src/images/3/icon-send-date.png new file mode 100644 index 0000000..d31fae5 Binary files /dev/null and b/src/images/3/icon-send-date.png differ diff --git a/src/images/3/icon-user.png b/src/images/3/icon-user.png new file mode 100644 index 0000000..6b6f48e Binary files /dev/null and b/src/images/3/icon-user.png differ diff --git a/src/images/3/order-end.png b/src/images/3/order-end.png new file mode 100644 index 0000000..2e83433 Binary files /dev/null and b/src/images/3/order-end.png differ diff --git a/src/images/3/triangle-down.png b/src/images/3/triangle-down.png new file mode 100644 index 0000000..5183024 Binary files /dev/null and b/src/images/3/triangle-down.png differ diff --git a/src/images/3/userinfo-bg.png b/src/images/3/userinfo-bg.png new file mode 100644 index 0000000..bf74e21 Binary files /dev/null and b/src/images/3/userinfo-bg.png differ diff --git a/src/images/5/card1.png b/src/images/5/card1.png new file mode 100644 index 0000000..230030f Binary files /dev/null and b/src/images/5/card1.png differ diff --git a/src/images/5/close1.png b/src/images/5/close1.png new file mode 100644 index 0000000..65fc01f Binary files /dev/null and b/src/images/5/close1.png differ diff --git a/src/images/5/code.png b/src/images/5/code.png new file mode 100644 index 0000000..9432646 Binary files /dev/null and b/src/images/5/code.png differ diff --git a/src/images/5/d_home_icon1.png b/src/images/5/d_home_icon1.png new file mode 100644 index 0000000..8d54978 Binary files /dev/null and b/src/images/5/d_home_icon1.png differ diff --git a/src/images/5/d_home_icon2.png b/src/images/5/d_home_icon2.png new file mode 100644 index 0000000..ab6a95e Binary files /dev/null and b/src/images/5/d_home_icon2.png differ diff --git a/src/images/5/d_home_icon3.png b/src/images/5/d_home_icon3.png new file mode 100644 index 0000000..5c65a9b Binary files /dev/null and b/src/images/5/d_home_icon3.png differ diff --git a/src/images/5/d_home_icon4.png b/src/images/5/d_home_icon4.png new file mode 100644 index 0000000..ca8c3ef Binary files /dev/null and b/src/images/5/d_home_icon4.png differ diff --git a/src/images/5/doctor.png b/src/images/5/doctor.png new file mode 100644 index 0000000..b3d181f Binary files /dev/null and b/src/images/5/doctor.png differ diff --git a/src/images/5/eye1.png b/src/images/5/eye1.png new file mode 100644 index 0000000..0fd9436 Binary files /dev/null and b/src/images/5/eye1.png differ diff --git a/src/images/5/eye2.png b/src/images/5/eye2.png new file mode 100644 index 0000000..59ceb60 Binary files /dev/null and b/src/images/5/eye2.png differ diff --git a/src/images/5/hostipal.png b/src/images/5/hostipal.png new file mode 100644 index 0000000..8be6677 Binary files /dev/null and b/src/images/5/hostipal.png differ diff --git a/src/images/5/icon-message.png b/src/images/5/icon-message.png new file mode 100644 index 0000000..67b9023 Binary files /dev/null and b/src/images/5/icon-message.png differ diff --git a/src/images/5/icon-referral.png b/src/images/5/icon-referral.png new file mode 100644 index 0000000..3d76b67 Binary files /dev/null and b/src/images/5/icon-referral.png differ diff --git a/src/images/5/logo1.png b/src/images/5/logo1.png new file mode 100644 index 0000000..7a8acee Binary files /dev/null and b/src/images/5/logo1.png differ diff --git a/src/images/5/new.png b/src/images/5/new.png new file mode 100644 index 0000000..89ec30f Binary files /dev/null and b/src/images/5/new.png differ diff --git a/src/images/5/public-bg1.png b/src/images/5/public-bg1.png new file mode 100644 index 0000000..8757257 Binary files /dev/null and b/src/images/5/public-bg1.png differ diff --git a/src/images/5/record-btn.png b/src/images/5/record-btn.png new file mode 100644 index 0000000..7ad0990 Binary files /dev/null and b/src/images/5/record-btn.png differ diff --git a/src/images/5/referral-card.png b/src/images/5/referral-card.png new file mode 100644 index 0000000..fd89ba0 Binary files /dev/null and b/src/images/5/referral-card.png differ diff --git a/src/images/5/referral-toast-bg.png b/src/images/5/referral-toast-bg.png new file mode 100644 index 0000000..1c96358 Binary files /dev/null and b/src/images/5/referral-toast-bg.png differ diff --git a/src/images/5/reg-close.png b/src/images/5/reg-close.png new file mode 100644 index 0000000..d8880ce Binary files /dev/null and b/src/images/5/reg-close.png differ diff --git a/src/images/5/safe-bg.png b/src/images/5/safe-bg.png new file mode 100644 index 0000000..0d1e011 Binary files /dev/null and b/src/images/5/safe-bg.png differ diff --git a/src/images/5/share1.png b/src/images/5/share1.png new file mode 100644 index 0000000..34a84fd Binary files /dev/null and b/src/images/5/share1.png differ diff --git a/src/images/5/year-bg.png b/src/images/5/year-bg.png new file mode 100644 index 0000000..6c38503 Binary files /dev/null and b/src/images/5/year-bg.png differ diff --git a/src/images/bg1.png b/src/images/bg1.png new file mode 100644 index 0000000..feff44e Binary files /dev/null and b/src/images/bg1.png differ diff --git a/src/images/bg10.png b/src/images/bg10.png new file mode 100644 index 0000000..6a187a7 Binary files /dev/null and b/src/images/bg10.png differ diff --git a/src/images/bg11.png b/src/images/bg11.png new file mode 100644 index 0000000..27ee8eb Binary files /dev/null and b/src/images/bg11.png differ diff --git a/src/images/bg12.png b/src/images/bg12.png new file mode 100644 index 0000000..d536827 Binary files /dev/null and b/src/images/bg12.png differ diff --git a/src/images/bg13.png b/src/images/bg13.png new file mode 100644 index 0000000..8bb6243 Binary files /dev/null and b/src/images/bg13.png differ diff --git a/src/images/bg2.png b/src/images/bg2.png new file mode 100644 index 0000000..eff00bf Binary files /dev/null and b/src/images/bg2.png differ diff --git a/src/images/bg3.png b/src/images/bg3.png new file mode 100644 index 0000000..37a334b Binary files /dev/null and b/src/images/bg3.png differ diff --git a/src/images/bg4.png b/src/images/bg4.png new file mode 100644 index 0000000..c72f4c0 Binary files /dev/null and b/src/images/bg4.png differ diff --git a/src/images/bg5.png b/src/images/bg5.png new file mode 100644 index 0000000..575f1fa Binary files /dev/null and b/src/images/bg5.png differ diff --git a/src/images/bg6.png b/src/images/bg6.png new file mode 100644 index 0000000..b61a54a Binary files /dev/null and b/src/images/bg6.png differ diff --git a/src/images/bg7.png b/src/images/bg7.png new file mode 100644 index 0000000..20733d0 Binary files /dev/null and b/src/images/bg7.png differ diff --git a/src/images/bg8.png b/src/images/bg8.png new file mode 100644 index 0000000..d87998e Binary files /dev/null and b/src/images/bg8.png differ diff --git a/src/images/bg9.png b/src/images/bg9.png new file mode 100644 index 0000000..40b574f Binary files /dev/null and b/src/images/bg9.png differ diff --git a/src/images/cutaneous/2-1.png b/src/images/cutaneous/2-1.png new file mode 100644 index 0000000..dc195e0 Binary files /dev/null and b/src/images/cutaneous/2-1.png differ diff --git a/src/images/cutaneous/2-2.png b/src/images/cutaneous/2-2.png new file mode 100644 index 0000000..ad2dbf9 Binary files /dev/null and b/src/images/cutaneous/2-2.png differ diff --git a/src/images/cutaneous/2-3.png b/src/images/cutaneous/2-3.png new file mode 100644 index 0000000..9e899c0 Binary files /dev/null and b/src/images/cutaneous/2-3.png differ diff --git a/src/images/cutaneous/2-4.png b/src/images/cutaneous/2-4.png new file mode 100644 index 0000000..440acdf Binary files /dev/null and b/src/images/cutaneous/2-4.png differ diff --git a/src/images/cutaneous/3-1.png b/src/images/cutaneous/3-1.png new file mode 100644 index 0000000..6c5797f Binary files /dev/null and b/src/images/cutaneous/3-1.png differ diff --git a/src/images/cutaneous/3-2.png b/src/images/cutaneous/3-2.png new file mode 100644 index 0000000..38e0e92 Binary files /dev/null and b/src/images/cutaneous/3-2.png differ diff --git a/src/images/cutaneous/3-3.png b/src/images/cutaneous/3-3.png new file mode 100644 index 0000000..0139d5a Binary files /dev/null and b/src/images/cutaneous/3-3.png differ diff --git a/src/images/cutaneous/3-4.png b/src/images/cutaneous/3-4.png new file mode 100644 index 0000000..b2029a6 Binary files /dev/null and b/src/images/cutaneous/3-4.png differ diff --git a/src/images/cutaneous/3-5.png b/src/images/cutaneous/3-5.png new file mode 100644 index 0000000..e4b27c3 Binary files /dev/null and b/src/images/cutaneous/3-5.png differ diff --git a/src/images/cutaneous/4-1.png b/src/images/cutaneous/4-1.png new file mode 100644 index 0000000..9911bfa Binary files /dev/null and b/src/images/cutaneous/4-1.png differ diff --git a/src/images/cutaneous/4-2.png b/src/images/cutaneous/4-2.png new file mode 100644 index 0000000..980fc34 Binary files /dev/null and b/src/images/cutaneous/4-2.png differ diff --git a/src/images/cutaneous/5-1.png b/src/images/cutaneous/5-1.png new file mode 100644 index 0000000..3a867ff Binary files /dev/null and b/src/images/cutaneous/5-1.png differ diff --git a/src/images/cutaneous/5-2.png b/src/images/cutaneous/5-2.png new file mode 100644 index 0000000..130ea88 Binary files /dev/null and b/src/images/cutaneous/5-2.png differ diff --git a/src/images/cutaneous/5-3.png b/src/images/cutaneous/5-3.png new file mode 100644 index 0000000..d810ea5 Binary files /dev/null and b/src/images/cutaneous/5-3.png differ diff --git a/src/images/cutaneous/5-4.png b/src/images/cutaneous/5-4.png new file mode 100644 index 0000000..f6ab353 Binary files /dev/null and b/src/images/cutaneous/5-4.png differ diff --git a/src/images/cutaneous/5-5.png b/src/images/cutaneous/5-5.png new file mode 100644 index 0000000..d362baf Binary files /dev/null and b/src/images/cutaneous/5-5.png differ diff --git a/src/images/cutaneous/cidp-mask.png b/src/images/cutaneous/cidp-mask.png new file mode 100644 index 0000000..2386e41 Binary files /dev/null and b/src/images/cutaneous/cidp-mask.png differ diff --git a/src/images/cutaneous/home1.png b/src/images/cutaneous/home1.png new file mode 100644 index 0000000..482afa0 Binary files /dev/null and b/src/images/cutaneous/home1.png differ diff --git a/src/images/cutaneous/home2.png b/src/images/cutaneous/home2.png new file mode 100644 index 0000000..67f882a Binary files /dev/null and b/src/images/cutaneous/home2.png differ diff --git a/src/images/cutaneous/home3.png b/src/images/cutaneous/home3.png new file mode 100644 index 0000000..84df3ba Binary files /dev/null and b/src/images/cutaneous/home3.png differ diff --git a/src/images/cutaneous/home4.png b/src/images/cutaneous/home4.png new file mode 100644 index 0000000..f038a9c Binary files /dev/null and b/src/images/cutaneous/home4.png differ diff --git a/src/images/cutaneous/home5.png b/src/images/cutaneous/home5.png new file mode 100644 index 0000000..29c3ee7 Binary files /dev/null and b/src/images/cutaneous/home5.png differ diff --git a/src/images/cutaneous/home6.png b/src/images/cutaneous/home6.png new file mode 100644 index 0000000..e3f8f6d Binary files /dev/null and b/src/images/cutaneous/home6.png differ diff --git a/src/images/cutaneous/video-bg.png b/src/images/cutaneous/video-bg.png new file mode 100644 index 0000000..0cbf1be Binary files /dev/null and b/src/images/cutaneous/video-bg.png differ diff --git a/src/images/cutaneous/video1-1.png b/src/images/cutaneous/video1-1.png new file mode 100644 index 0000000..9276f67 Binary files /dev/null and b/src/images/cutaneous/video1-1.png differ diff --git a/src/images/cutaneous/video2-1.png b/src/images/cutaneous/video2-1.png new file mode 100644 index 0000000..7637f8f Binary files /dev/null and b/src/images/cutaneous/video2-1.png differ diff --git a/src/images/cutaneous/video2-2.png b/src/images/cutaneous/video2-2.png new file mode 100644 index 0000000..dd8ad62 Binary files /dev/null and b/src/images/cutaneous/video2-2.png differ diff --git a/src/images/cutaneous/video2-3.png b/src/images/cutaneous/video2-3.png new file mode 100644 index 0000000..3cc64dc Binary files /dev/null and b/src/images/cutaneous/video2-3.png differ diff --git a/src/images/cutaneous/video2-4.png b/src/images/cutaneous/video2-4.png new file mode 100644 index 0000000..81aa89b Binary files /dev/null and b/src/images/cutaneous/video2-4.png differ diff --git a/src/images/default_infusion_center.png b/src/images/default_infusion_center.png new file mode 100644 index 0000000..d79a3e3 Binary files /dev/null and b/src/images/default_infusion_center.png differ diff --git a/src/images/demo.png b/src/images/demo.png new file mode 100644 index 0000000..0ee411b Binary files /dev/null and b/src/images/demo.png differ diff --git a/src/images/doctor/arrow-right.png b/src/images/doctor/arrow-right.png new file mode 100644 index 0000000..e4bb4e8 Binary files /dev/null and b/src/images/doctor/arrow-right.png differ diff --git a/src/images/doctor/arrow-right1.png b/src/images/doctor/arrow-right1.png new file mode 100644 index 0000000..e8760fa Binary files /dev/null and b/src/images/doctor/arrow-right1.png differ diff --git a/src/images/doctor/audio-left.gif b/src/images/doctor/audio-left.gif new file mode 100644 index 0000000..121b528 Binary files /dev/null and b/src/images/doctor/audio-left.gif differ diff --git a/src/images/doctor/audio-left.png b/src/images/doctor/audio-left.png new file mode 100644 index 0000000..7eec941 Binary files /dev/null and b/src/images/doctor/audio-left.png differ diff --git a/src/images/doctor/audio-right.gif b/src/images/doctor/audio-right.gif new file mode 100644 index 0000000..dfb7a5a Binary files /dev/null and b/src/images/doctor/audio-right.gif differ diff --git a/src/images/doctor/audio-right.png b/src/images/doctor/audio-right.png new file mode 100644 index 0000000..eabc8c0 Binary files /dev/null and b/src/images/doctor/audio-right.png differ diff --git a/src/images/doctor/circle-right.png b/src/images/doctor/circle-right.png new file mode 100644 index 0000000..2487e4c Binary files /dev/null and b/src/images/doctor/circle-right.png differ diff --git a/src/images/doctor/clear.png b/src/images/doctor/clear.png new file mode 100644 index 0000000..0226ae7 Binary files /dev/null and b/src/images/doctor/clear.png differ diff --git a/src/images/doctor/create-task-bg.png b/src/images/doctor/create-task-bg.png new file mode 100644 index 0000000..a958a3f Binary files /dev/null and b/src/images/doctor/create-task-bg.png differ diff --git a/src/images/doctor/custom-export-badge.png b/src/images/doctor/custom-export-badge.png new file mode 100644 index 0000000..bcdc9eb Binary files /dev/null and b/src/images/doctor/custom-export-badge.png differ diff --git a/src/images/doctor/d_interactive-adl-bg.png b/src/images/doctor/d_interactive-adl-bg.png new file mode 100644 index 0000000..c7d11c1 Binary files /dev/null and b/src/images/doctor/d_interactive-adl-bg.png differ diff --git a/src/images/doctor/d_interactivePatient-tab-active1.png b/src/images/doctor/d_interactivePatient-tab-active1.png new file mode 100644 index 0000000..2907e9a Binary files /dev/null and b/src/images/doctor/d_interactivePatient-tab-active1.png differ diff --git a/src/images/doctor/d_interactivePatient-tab-active2.png b/src/images/doctor/d_interactivePatient-tab-active2.png new file mode 100644 index 0000000..a306039 Binary files /dev/null and b/src/images/doctor/d_interactivePatient-tab-active2.png differ diff --git a/src/images/doctor/d_interactivePatient-tab-active3.png b/src/images/doctor/d_interactivePatient-tab-active3.png new file mode 100644 index 0000000..91f4943 Binary files /dev/null and b/src/images/doctor/d_interactivePatient-tab-active3.png differ diff --git a/src/images/doctor/d_interactivePatient-tab-active4.png b/src/images/doctor/d_interactivePatient-tab-active4.png new file mode 100644 index 0000000..484b8d5 Binary files /dev/null and b/src/images/doctor/d_interactivePatient-tab-active4.png differ diff --git a/src/images/doctor/d_interactivePatient-tab1.png b/src/images/doctor/d_interactivePatient-tab1.png new file mode 100644 index 0000000..189192a Binary files /dev/null and b/src/images/doctor/d_interactivePatient-tab1.png differ diff --git a/src/images/doctor/d_interactivePatient-tab2.png b/src/images/doctor/d_interactivePatient-tab2.png new file mode 100644 index 0000000..71c9e21 Binary files /dev/null and b/src/images/doctor/d_interactivePatient-tab2.png differ diff --git a/src/images/doctor/d_interactivePatient-tab3.png b/src/images/doctor/d_interactivePatient-tab3.png new file mode 100644 index 0000000..d49b2e5 Binary files /dev/null and b/src/images/doctor/d_interactivePatient-tab3.png differ diff --git a/src/images/doctor/d_interactivePatient-tab4.png b/src/images/doctor/d_interactivePatient-tab4.png new file mode 100644 index 0000000..bc97209 Binary files /dev/null and b/src/images/doctor/d_interactivePatient-tab4.png differ diff --git a/src/images/doctor/d_interactiveTitle1.png b/src/images/doctor/d_interactiveTitle1.png new file mode 100644 index 0000000..546d63e Binary files /dev/null and b/src/images/doctor/d_interactiveTitle1.png differ diff --git a/src/images/doctor/d_patient-bg.png b/src/images/doctor/d_patient-bg.png new file mode 100644 index 0000000..86ba202 Binary files /dev/null and b/src/images/doctor/d_patient-bg.png differ diff --git a/src/images/doctor/d_patient-detail-bg.png b/src/images/doctor/d_patient-detail-bg.png new file mode 100644 index 0000000..7ecfb22 Binary files /dev/null and b/src/images/doctor/d_patient-detail-bg.png differ diff --git a/src/images/doctor/data-down.png b/src/images/doctor/data-down.png new file mode 100644 index 0000000..1465559 Binary files /dev/null and b/src/images/doctor/data-down.png differ diff --git a/src/images/doctor/doctor_a.jpg b/src/images/doctor/doctor_a.jpg new file mode 100644 index 0000000..31e544a Binary files /dev/null and b/src/images/doctor/doctor_a.jpg differ diff --git a/src/images/doctor/drug-label.png b/src/images/doctor/drug-label.png new file mode 100644 index 0000000..12f5689 Binary files /dev/null and b/src/images/doctor/drug-label.png differ diff --git a/src/images/doctor/export-guide.png b/src/images/doctor/export-guide.png new file mode 100644 index 0000000..1416051 Binary files /dev/null and b/src/images/doctor/export-guide.png differ diff --git a/src/images/doctor/export.gif b/src/images/doctor/export.gif new file mode 100644 index 0000000..f514555 Binary files /dev/null and b/src/images/doctor/export.gif differ diff --git a/src/images/doctor/export.png b/src/images/doctor/export.png new file mode 100644 index 0000000..2da6799 Binary files /dev/null and b/src/images/doctor/export.png differ diff --git a/src/images/doctor/home-bg.png b/src/images/doctor/home-bg.png new file mode 100644 index 0000000..fbc7ed4 Binary files /dev/null and b/src/images/doctor/home-bg.png differ diff --git a/src/images/doctor/home-title.png b/src/images/doctor/home-title.png new file mode 100644 index 0000000..c3c7659 Binary files /dev/null and b/src/images/doctor/home-title.png differ diff --git a/src/images/doctor/icon-adl-none.png b/src/images/doctor/icon-adl-none.png new file mode 100644 index 0000000..3dc53cf Binary files /dev/null and b/src/images/doctor/icon-adl-none.png differ diff --git a/src/images/doctor/icon-circle-down.png b/src/images/doctor/icon-circle-down.png new file mode 100644 index 0000000..1979a05 Binary files /dev/null and b/src/images/doctor/icon-circle-down.png differ diff --git a/src/images/doctor/icon-circle-up.png b/src/images/doctor/icon-circle-up.png new file mode 100644 index 0000000..f15aff3 Binary files /dev/null and b/src/images/doctor/icon-circle-up.png differ diff --git a/src/images/doctor/icon-clear.png b/src/images/doctor/icon-clear.png new file mode 100644 index 0000000..c526148 Binary files /dev/null and b/src/images/doctor/icon-clear.png differ diff --git a/src/images/doctor/icon-create.png b/src/images/doctor/icon-create.png new file mode 100644 index 0000000..fc09ac9 Binary files /dev/null and b/src/images/doctor/icon-create.png differ diff --git a/src/images/doctor/icon-date.png b/src/images/doctor/icon-date.png new file mode 100644 index 0000000..3a6220c Binary files /dev/null and b/src/images/doctor/icon-date.png differ diff --git a/src/images/doctor/icon-down-error.png b/src/images/doctor/icon-down-error.png new file mode 100644 index 0000000..b3caed9 Binary files /dev/null and b/src/images/doctor/icon-down-error.png differ diff --git a/src/images/doctor/icon-down-success.png b/src/images/doctor/icon-down-success.png new file mode 100644 index 0000000..33d9e99 Binary files /dev/null and b/src/images/doctor/icon-down-success.png differ diff --git a/src/images/doctor/icon-down-warn.png b/src/images/doctor/icon-down-warn.png new file mode 100644 index 0000000..a80866e Binary files /dev/null and b/src/images/doctor/icon-down-warn.png differ diff --git a/src/images/doctor/icon-down.png b/src/images/doctor/icon-down.png new file mode 100644 index 0000000..33d9e99 Binary files /dev/null and b/src/images/doctor/icon-down.png differ diff --git a/src/images/doctor/icon-down1.png b/src/images/doctor/icon-down1.png new file mode 100644 index 0000000..8721683 Binary files /dev/null and b/src/images/doctor/icon-down1.png differ diff --git a/src/images/doctor/icon-drug-none.png b/src/images/doctor/icon-drug-none.png new file mode 100644 index 0000000..67e69be Binary files /dev/null and b/src/images/doctor/icon-drug-none.png differ diff --git a/src/images/doctor/icon-edit.png b/src/images/doctor/icon-edit.png new file mode 100644 index 0000000..ae35a7f Binary files /dev/null and b/src/images/doctor/icon-edit.png differ diff --git a/src/images/doctor/icon-error.png b/src/images/doctor/icon-error.png new file mode 100644 index 0000000..dc105cb Binary files /dev/null and b/src/images/doctor/icon-error.png differ diff --git a/src/images/doctor/icon-export.png b/src/images/doctor/icon-export.png new file mode 100644 index 0000000..c101669 Binary files /dev/null and b/src/images/doctor/icon-export.png differ diff --git a/src/images/doctor/icon-man.png b/src/images/doctor/icon-man.png new file mode 100644 index 0000000..442d40f Binary files /dev/null and b/src/images/doctor/icon-man.png differ diff --git a/src/images/doctor/icon-message.png b/src/images/doctor/icon-message.png new file mode 100644 index 0000000..8b66368 Binary files /dev/null and b/src/images/doctor/icon-message.png differ diff --git a/src/images/doctor/icon-phone.png b/src/images/doctor/icon-phone.png new file mode 100644 index 0000000..a18fa06 Binary files /dev/null and b/src/images/doctor/icon-phone.png differ diff --git a/src/images/doctor/icon-question.png b/src/images/doctor/icon-question.png new file mode 100644 index 0000000..7711338 Binary files /dev/null and b/src/images/doctor/icon-question.png differ diff --git a/src/images/doctor/icon-question1.png b/src/images/doctor/icon-question1.png new file mode 100644 index 0000000..1bb7637 Binary files /dev/null and b/src/images/doctor/icon-question1.png differ diff --git a/src/images/doctor/icon-search.png b/src/images/doctor/icon-search.png new file mode 100644 index 0000000..5d49873 Binary files /dev/null and b/src/images/doctor/icon-search.png differ diff --git a/src/images/doctor/icon-select.png b/src/images/doctor/icon-select.png new file mode 100644 index 0000000..84f937f Binary files /dev/null and b/src/images/doctor/icon-select.png differ diff --git a/src/images/doctor/icon-site.png b/src/images/doctor/icon-site.png new file mode 100644 index 0000000..42b8580 Binary files /dev/null and b/src/images/doctor/icon-site.png differ diff --git a/src/images/doctor/icon-success.png b/src/images/doctor/icon-success.png new file mode 100644 index 0000000..82572dd Binary files /dev/null and b/src/images/doctor/icon-success.png differ diff --git a/src/images/doctor/icon-title-lable.png b/src/images/doctor/icon-title-lable.png new file mode 100644 index 0000000..cf3712a Binary files /dev/null and b/src/images/doctor/icon-title-lable.png differ diff --git a/src/images/doctor/icon-up-error.png b/src/images/doctor/icon-up-error.png new file mode 100644 index 0000000..617a728 Binary files /dev/null and b/src/images/doctor/icon-up-error.png differ diff --git a/src/images/doctor/icon-up-success.png b/src/images/doctor/icon-up-success.png new file mode 100644 index 0000000..efd6daf Binary files /dev/null and b/src/images/doctor/icon-up-success.png differ diff --git a/src/images/doctor/icon-up-warn.png b/src/images/doctor/icon-up-warn.png new file mode 100644 index 0000000..74f5a1f Binary files /dev/null and b/src/images/doctor/icon-up-warn.png differ diff --git a/src/images/doctor/icon-up.png b/src/images/doctor/icon-up.png new file mode 100644 index 0000000..617a728 Binary files /dev/null and b/src/images/doctor/icon-up.png differ diff --git a/src/images/doctor/icon-warn.png b/src/images/doctor/icon-warn.png new file mode 100644 index 0000000..ea96892 Binary files /dev/null and b/src/images/doctor/icon-warn.png differ diff --git a/src/images/doctor/icon-woman.png b/src/images/doctor/icon-woman.png new file mode 100644 index 0000000..9d04c8d Binary files /dev/null and b/src/images/doctor/icon-woman.png differ diff --git a/src/images/doctor/invite-bg.png b/src/images/doctor/invite-bg.png new file mode 100644 index 0000000..d1eff46 Binary files /dev/null and b/src/images/doctor/invite-bg.png differ diff --git a/src/images/doctor/invite-container-bg.png b/src/images/doctor/invite-container-bg.png new file mode 100644 index 0000000..62a436d Binary files /dev/null and b/src/images/doctor/invite-container-bg.png differ diff --git a/src/images/doctor/login-bg.png b/src/images/doctor/login-bg.png new file mode 100644 index 0000000..697cf0a Binary files /dev/null and b/src/images/doctor/login-bg.png differ diff --git a/src/images/doctor/login-title.png b/src/images/doctor/login-title.png new file mode 100644 index 0000000..53585c5 Binary files /dev/null and b/src/images/doctor/login-title.png differ diff --git a/src/images/doctor/my-bg.png b/src/images/doctor/my-bg.png new file mode 100644 index 0000000..fdf3a0a Binary files /dev/null and b/src/images/doctor/my-bg.png differ diff --git a/src/images/doctor/my-code.png b/src/images/doctor/my-code.png new file mode 100644 index 0000000..93f29c9 Binary files /dev/null and b/src/images/doctor/my-code.png differ diff --git a/src/images/doctor/my-list-icon1.png b/src/images/doctor/my-list-icon1.png new file mode 100644 index 0000000..60dcfdc Binary files /dev/null and b/src/images/doctor/my-list-icon1.png differ diff --git a/src/images/doctor/my-title1.png b/src/images/doctor/my-title1.png new file mode 100644 index 0000000..edddc79 Binary files /dev/null and b/src/images/doctor/my-title1.png differ diff --git a/src/images/doctor/my-title2.png b/src/images/doctor/my-title2.png new file mode 100644 index 0000000..cef9a9f Binary files /dev/null and b/src/images/doctor/my-title2.png differ diff --git a/src/images/doctor/new.png b/src/images/doctor/new.png new file mode 100644 index 0000000..839d040 Binary files /dev/null and b/src/images/doctor/new.png differ diff --git a/src/images/doctor/tabbar/1-active.png b/src/images/doctor/tabbar/1-active.png new file mode 100644 index 0000000..16e50a7 Binary files /dev/null and b/src/images/doctor/tabbar/1-active.png differ diff --git a/src/images/doctor/tabbar/1.png b/src/images/doctor/tabbar/1.png new file mode 100644 index 0000000..b3e154e Binary files /dev/null and b/src/images/doctor/tabbar/1.png differ diff --git a/src/images/doctor/tabbar/2-active.png b/src/images/doctor/tabbar/2-active.png new file mode 100644 index 0000000..1b5133c Binary files /dev/null and b/src/images/doctor/tabbar/2-active.png differ diff --git a/src/images/doctor/tabbar/2.png b/src/images/doctor/tabbar/2.png new file mode 100644 index 0000000..0501cc5 Binary files /dev/null and b/src/images/doctor/tabbar/2.png differ diff --git a/src/images/doctor/tabbar/3-active.png b/src/images/doctor/tabbar/3-active.png new file mode 100644 index 0000000..39e416e Binary files /dev/null and b/src/images/doctor/tabbar/3-active.png differ diff --git a/src/images/doctor/tabbar/3.png b/src/images/doctor/tabbar/3.png new file mode 100644 index 0000000..dd45f08 Binary files /dev/null and b/src/images/doctor/tabbar/3.png differ diff --git a/src/images/doctor/tabbar/4-active.png b/src/images/doctor/tabbar/4-active.png new file mode 100644 index 0000000..9e49dba Binary files /dev/null and b/src/images/doctor/tabbar/4-active.png differ diff --git a/src/images/doctor/tabbar/4.png b/src/images/doctor/tabbar/4.png new file mode 100644 index 0000000..ec5a265 Binary files /dev/null and b/src/images/doctor/tabbar/4.png differ diff --git a/src/images/doctor/trans-bg.png b/src/images/doctor/trans-bg.png new file mode 100644 index 0000000..8b3d5c3 Binary files /dev/null and b/src/images/doctor/trans-bg.png differ diff --git a/src/images/doctor/triangle-down.png b/src/images/doctor/triangle-down.png new file mode 100644 index 0000000..1465559 Binary files /dev/null and b/src/images/doctor/triangle-down.png differ diff --git a/src/images/doctor/user_default.png b/src/images/doctor/user_default.png new file mode 100644 index 0000000..e5b9ea5 Binary files /dev/null and b/src/images/doctor/user_default.png differ diff --git a/src/images/double-standard/adl-banner.png b/src/images/double-standard/adl-banner.png new file mode 100644 index 0000000..875976f Binary files /dev/null and b/src/images/double-standard/adl-banner.png differ diff --git a/src/images/double-standard/adl-bg.png b/src/images/double-standard/adl-bg.png new file mode 100644 index 0000000..0742790 Binary files /dev/null and b/src/images/double-standard/adl-bg.png differ diff --git a/src/images/double-standard/adl-cure.png b/src/images/double-standard/adl-cure.png new file mode 100644 index 0000000..64ad280 Binary files /dev/null and b/src/images/double-standard/adl-cure.png differ diff --git a/src/images/double-standard/adl-drug.png b/src/images/double-standard/adl-drug.png new file mode 100644 index 0000000..87d0289 Binary files /dev/null and b/src/images/double-standard/adl-drug.png differ diff --git a/src/images/double-standard/adl-play.png b/src/images/double-standard/adl-play.png new file mode 100644 index 0000000..5049c60 Binary files /dev/null and b/src/images/double-standard/adl-play.png differ diff --git a/src/images/double-standard/adl-poster.png b/src/images/double-standard/adl-poster.png new file mode 100644 index 0000000..5b3ccd9 Binary files /dev/null and b/src/images/double-standard/adl-poster.png differ diff --git a/src/images/double-standard/adl-question.png b/src/images/double-standard/adl-question.png new file mode 100644 index 0000000..dc16cab Binary files /dev/null and b/src/images/double-standard/adl-question.png differ diff --git a/src/images/double-standard/adl-result-bg1.png b/src/images/double-standard/adl-result-bg1.png new file mode 100644 index 0000000..915f477 Binary files /dev/null and b/src/images/double-standard/adl-result-bg1.png differ diff --git a/src/images/double-standard/adl-result-bg2.png b/src/images/double-standard/adl-result-bg2.png new file mode 100644 index 0000000..ce549a5 Binary files /dev/null and b/src/images/double-standard/adl-result-bg2.png differ diff --git a/src/images/double-standard/adl-result-bg3.png b/src/images/double-standard/adl-result-bg3.png new file mode 100644 index 0000000..3ea0385 Binary files /dev/null and b/src/images/double-standard/adl-result-bg3.png differ diff --git a/src/images/double-standard/adl-result-icon1.png b/src/images/double-standard/adl-result-icon1.png new file mode 100644 index 0000000..faa6d6d Binary files /dev/null and b/src/images/double-standard/adl-result-icon1.png differ diff --git a/src/images/double-standard/adl-result-icon2.png b/src/images/double-standard/adl-result-icon2.png new file mode 100644 index 0000000..7e0c42e Binary files /dev/null and b/src/images/double-standard/adl-result-icon2.png differ diff --git a/src/images/double-standard/adl-result-preple1.png b/src/images/double-standard/adl-result-preple1.png new file mode 100644 index 0000000..33c2d8b Binary files /dev/null and b/src/images/double-standard/adl-result-preple1.png differ diff --git a/src/images/double-standard/adl-result-preple2.png b/src/images/double-standard/adl-result-preple2.png new file mode 100644 index 0000000..d5318ff Binary files /dev/null and b/src/images/double-standard/adl-result-preple2.png differ diff --git a/src/images/double-standard/adl-result-preple3.png b/src/images/double-standard/adl-result-preple3.png new file mode 100644 index 0000000..23a45ff Binary files /dev/null and b/src/images/double-standard/adl-result-preple3.png differ diff --git a/src/images/double-standard/adl-result-status1.png b/src/images/double-standard/adl-result-status1.png new file mode 100644 index 0000000..eab687d Binary files /dev/null and b/src/images/double-standard/adl-result-status1.png differ diff --git a/src/images/double-standard/adl-result-status2.png b/src/images/double-standard/adl-result-status2.png new file mode 100644 index 0000000..f316c5a Binary files /dev/null and b/src/images/double-standard/adl-result-status2.png differ diff --git a/src/images/double-standard/adl-result-status3.png b/src/images/double-standard/adl-result-status3.png new file mode 100644 index 0000000..35f445b Binary files /dev/null and b/src/images/double-standard/adl-result-status3.png differ diff --git a/src/images/double-standard/adl-result-status4.png b/src/images/double-standard/adl-result-status4.png new file mode 100644 index 0000000..201936b Binary files /dev/null and b/src/images/double-standard/adl-result-status4.png differ diff --git a/src/images/double-standard/adl-rule-icon1.png b/src/images/double-standard/adl-rule-icon1.png new file mode 100644 index 0000000..7ce5e41 Binary files /dev/null and b/src/images/double-standard/adl-rule-icon1.png differ diff --git a/src/images/double-standard/adl-rule-icon2.png b/src/images/double-standard/adl-rule-icon2.png new file mode 100644 index 0000000..04d18b5 Binary files /dev/null and b/src/images/double-standard/adl-rule-icon2.png differ diff --git a/src/images/double-standard/adl-share.png b/src/images/double-standard/adl-share.png new file mode 100644 index 0000000..37ce0ab Binary files /dev/null and b/src/images/double-standard/adl-share.png differ diff --git a/src/images/double-standard/adl-success.png b/src/images/double-standard/adl-success.png new file mode 100644 index 0000000..551c6a7 Binary files /dev/null and b/src/images/double-standard/adl-success.png differ diff --git a/src/images/double-standard/double-standards-badge-drug.png b/src/images/double-standard/double-standards-badge-drug.png new file mode 100644 index 0000000..3b604bc Binary files /dev/null and b/src/images/double-standard/double-standards-badge-drug.png differ diff --git a/src/images/double-standard/double-standards-badge.png b/src/images/double-standard/double-standards-badge.png new file mode 100644 index 0000000..3d089d9 Binary files /dev/null and b/src/images/double-standard/double-standards-badge.png differ diff --git a/src/images/double-standard/home-adl-badge.png b/src/images/double-standard/home-adl-badge.png new file mode 100644 index 0000000..37ee723 Binary files /dev/null and b/src/images/double-standard/home-adl-badge.png differ diff --git a/src/images/double-standard/home-adl-bg.png b/src/images/double-standard/home-adl-bg.png new file mode 100644 index 0000000..0adf9af Binary files /dev/null and b/src/images/double-standard/home-adl-bg.png differ diff --git a/src/images/double-standard/home-adl-drug-badge.png b/src/images/double-standard/home-adl-drug-badge.png new file mode 100644 index 0000000..37888cc Binary files /dev/null and b/src/images/double-standard/home-adl-drug-badge.png differ diff --git a/src/images/double-standard/home-adl-drug-bg.png b/src/images/double-standard/home-adl-drug-bg.png new file mode 100644 index 0000000..a38ca5d Binary files /dev/null and b/src/images/double-standard/home-adl-drug-bg.png differ diff --git a/src/images/double-standard/home-adl-drug-new.png b/src/images/double-standard/home-adl-drug-new.png new file mode 100644 index 0000000..b23e031 Binary files /dev/null and b/src/images/double-standard/home-adl-drug-new.png differ diff --git a/src/images/double-standard/home-adl-new.png b/src/images/double-standard/home-adl-new.png new file mode 100644 index 0000000..a62b199 Binary files /dev/null and b/src/images/double-standard/home-adl-new.png differ diff --git a/src/images/double-standard/home-adl-title-drug.png b/src/images/double-standard/home-adl-title-drug.png new file mode 100644 index 0000000..58a3703 Binary files /dev/null and b/src/images/double-standard/home-adl-title-drug.png differ diff --git a/src/images/double-standard/home-adl-title.png b/src/images/double-standard/home-adl-title.png new file mode 100644 index 0000000..8bd7be9 Binary files /dev/null and b/src/images/double-standard/home-adl-title.png differ diff --git a/src/images/double-standard/home-new.png b/src/images/double-standard/home-new.png new file mode 100644 index 0000000..f3b5141 Binary files /dev/null and b/src/images/double-standard/home-new.png differ diff --git a/src/images/double-standard/share-badge.png b/src/images/double-standard/share-badge.png new file mode 100644 index 0000000..3d52822 Binary files /dev/null and b/src/images/double-standard/share-badge.png differ diff --git a/src/images/empty1.png b/src/images/empty1.png new file mode 100644 index 0000000..19e73e2 Binary files /dev/null and b/src/images/empty1.png differ diff --git a/src/images/icon1.png b/src/images/icon1.png new file mode 100644 index 0000000..371c6df Binary files /dev/null and b/src/images/icon1.png differ diff --git a/src/images/icon10.png b/src/images/icon10.png new file mode 100644 index 0000000..498d588 Binary files /dev/null and b/src/images/icon10.png differ diff --git a/src/images/icon11.png b/src/images/icon11.png new file mode 100644 index 0000000..da65e0b Binary files /dev/null and b/src/images/icon11.png differ diff --git a/src/images/icon12.png b/src/images/icon12.png new file mode 100644 index 0000000..18cf17d Binary files /dev/null and b/src/images/icon12.png differ diff --git a/src/images/icon13.png b/src/images/icon13.png new file mode 100644 index 0000000..df8353b Binary files /dev/null and b/src/images/icon13.png differ diff --git a/src/images/icon14.png b/src/images/icon14.png new file mode 100644 index 0000000..e1ead24 Binary files /dev/null and b/src/images/icon14.png differ diff --git a/src/images/icon15.png b/src/images/icon15.png new file mode 100644 index 0000000..96d4b7d Binary files /dev/null and b/src/images/icon15.png differ diff --git a/src/images/icon16.png b/src/images/icon16.png new file mode 100644 index 0000000..fc4d6f1 Binary files /dev/null and b/src/images/icon16.png differ diff --git a/src/images/icon17.png b/src/images/icon17.png new file mode 100644 index 0000000..3bed378 Binary files /dev/null and b/src/images/icon17.png differ diff --git a/src/images/icon18.png b/src/images/icon18.png new file mode 100644 index 0000000..ef338b5 Binary files /dev/null and b/src/images/icon18.png differ diff --git a/src/images/icon19.png b/src/images/icon19.png new file mode 100644 index 0000000..f56fdfa Binary files /dev/null and b/src/images/icon19.png differ diff --git a/src/images/icon2.png b/src/images/icon2.png new file mode 100644 index 0000000..d122210 Binary files /dev/null and b/src/images/icon2.png differ diff --git a/src/images/icon20.png b/src/images/icon20.png new file mode 100644 index 0000000..1756d0c Binary files /dev/null and b/src/images/icon20.png differ diff --git a/src/images/icon21.png b/src/images/icon21.png new file mode 100644 index 0000000..547640b Binary files /dev/null and b/src/images/icon21.png differ diff --git a/src/images/icon22.png b/src/images/icon22.png new file mode 100644 index 0000000..548b5d5 Binary files /dev/null and b/src/images/icon22.png differ diff --git a/src/images/icon23.png b/src/images/icon23.png new file mode 100644 index 0000000..1dadc77 Binary files /dev/null and b/src/images/icon23.png differ diff --git a/src/images/icon24.png b/src/images/icon24.png new file mode 100644 index 0000000..39b2c17 Binary files /dev/null and b/src/images/icon24.png differ diff --git a/src/images/icon25.png b/src/images/icon25.png new file mode 100644 index 0000000..4536c47 Binary files /dev/null and b/src/images/icon25.png differ diff --git a/src/images/icon26.png b/src/images/icon26.png new file mode 100644 index 0000000..d22b330 Binary files /dev/null and b/src/images/icon26.png differ diff --git a/src/images/icon27.png b/src/images/icon27.png new file mode 100644 index 0000000..f007eb1 Binary files /dev/null and b/src/images/icon27.png differ diff --git a/src/images/icon28.png b/src/images/icon28.png new file mode 100644 index 0000000..68af82f Binary files /dev/null and b/src/images/icon28.png differ diff --git a/src/images/icon3.png b/src/images/icon3.png new file mode 100644 index 0000000..79d5333 Binary files /dev/null and b/src/images/icon3.png differ diff --git a/src/images/icon4.png b/src/images/icon4.png new file mode 100644 index 0000000..43a6dc4 Binary files /dev/null and b/src/images/icon4.png differ diff --git a/src/images/icon5.png b/src/images/icon5.png new file mode 100644 index 0000000..a67e680 Binary files /dev/null and b/src/images/icon5.png differ diff --git a/src/images/icon6.png b/src/images/icon6.png new file mode 100644 index 0000000..66d1325 Binary files /dev/null and b/src/images/icon6.png differ diff --git a/src/images/icon7.png b/src/images/icon7.png new file mode 100644 index 0000000..776807b Binary files /dev/null and b/src/images/icon7.png differ diff --git a/src/images/icon8.png b/src/images/icon8.png new file mode 100644 index 0000000..778d0e5 Binary files /dev/null and b/src/images/icon8.png differ diff --git a/src/images/icon9.png b/src/images/icon9.png new file mode 100644 index 0000000..f452f8b Binary files /dev/null and b/src/images/icon9.png differ diff --git a/src/images/infusionCenter.png b/src/images/infusionCenter.png new file mode 100644 index 0000000..4e6d251 Binary files /dev/null and b/src/images/infusionCenter.png differ diff --git a/src/images/live-banner.png b/src/images/live-banner.png new file mode 100644 index 0000000..fc1337d Binary files /dev/null and b/src/images/live-banner.png differ diff --git a/src/images/none.png b/src/images/none.png new file mode 100644 index 0000000..e0c650f Binary files /dev/null and b/src/images/none.png differ diff --git a/src/images/nrdl/2-1.png b/src/images/nrdl/2-1.png new file mode 100644 index 0000000..db0d8a8 Binary files /dev/null and b/src/images/nrdl/2-1.png differ diff --git a/src/images/nrdl/2-10.png b/src/images/nrdl/2-10.png new file mode 100644 index 0000000..950c5e2 Binary files /dev/null and b/src/images/nrdl/2-10.png differ diff --git a/src/images/nrdl/2-11.png b/src/images/nrdl/2-11.png new file mode 100644 index 0000000..fce0269 Binary files /dev/null and b/src/images/nrdl/2-11.png differ diff --git a/src/images/nrdl/2-2.png b/src/images/nrdl/2-2.png new file mode 100644 index 0000000..d807ea5 Binary files /dev/null and b/src/images/nrdl/2-2.png differ diff --git a/src/images/nrdl/2-3.png b/src/images/nrdl/2-3.png new file mode 100644 index 0000000..d5d2639 Binary files /dev/null and b/src/images/nrdl/2-3.png differ diff --git a/src/images/nrdl/2-4.png b/src/images/nrdl/2-4.png new file mode 100644 index 0000000..f209bab Binary files /dev/null and b/src/images/nrdl/2-4.png differ diff --git a/src/images/nrdl/2-5.png b/src/images/nrdl/2-5.png new file mode 100644 index 0000000..99939e1 Binary files /dev/null and b/src/images/nrdl/2-5.png differ diff --git a/src/images/nrdl/2-6.png b/src/images/nrdl/2-6.png new file mode 100644 index 0000000..787f1cf Binary files /dev/null and b/src/images/nrdl/2-6.png differ diff --git a/src/images/nrdl/2-7.png b/src/images/nrdl/2-7.png new file mode 100644 index 0000000..07a25fd Binary files /dev/null and b/src/images/nrdl/2-7.png differ diff --git a/src/images/nrdl/2-8.png b/src/images/nrdl/2-8.png new file mode 100644 index 0000000..0abd926 Binary files /dev/null and b/src/images/nrdl/2-8.png differ diff --git a/src/images/nrdl/2-9.png b/src/images/nrdl/2-9.png new file mode 100644 index 0000000..7913f5d Binary files /dev/null and b/src/images/nrdl/2-9.png differ diff --git a/src/images/nrdl/2-bf.png b/src/images/nrdl/2-bf.png new file mode 100644 index 0000000..451a3ec Binary files /dev/null and b/src/images/nrdl/2-bf.png differ diff --git a/src/images/nrdl/2.png b/src/images/nrdl/2.png new file mode 100644 index 0000000..5d75b8d Binary files /dev/null and b/src/images/nrdl/2.png differ diff --git a/src/images/nrdl/3.png b/src/images/nrdl/3.png new file mode 100644 index 0000000..991d081 Binary files /dev/null and b/src/images/nrdl/3.png differ diff --git a/src/images/nrdl/4.png b/src/images/nrdl/4.png new file mode 100644 index 0000000..2162639 Binary files /dev/null and b/src/images/nrdl/4.png differ diff --git a/src/images/nrdl/5-1.png b/src/images/nrdl/5-1.png new file mode 100644 index 0000000..102c43d Binary files /dev/null and b/src/images/nrdl/5-1.png differ diff --git a/src/images/nrdl/5-2.png b/src/images/nrdl/5-2.png new file mode 100644 index 0000000..30872ec Binary files /dev/null and b/src/images/nrdl/5-2.png differ diff --git a/src/images/nrdl/5-3.png b/src/images/nrdl/5-3.png new file mode 100644 index 0000000..99622d5 Binary files /dev/null and b/src/images/nrdl/5-3.png differ diff --git a/src/images/nrdl/5-4.png b/src/images/nrdl/5-4.png new file mode 100644 index 0000000..4cbbdc2 Binary files /dev/null and b/src/images/nrdl/5-4.png differ diff --git a/src/images/nrdl/5-5.png b/src/images/nrdl/5-5.png new file mode 100644 index 0000000..3f2fc5a Binary files /dev/null and b/src/images/nrdl/5-5.png differ diff --git a/src/images/nrdl/5.png b/src/images/nrdl/5.png new file mode 100644 index 0000000..e5ca55e Binary files /dev/null and b/src/images/nrdl/5.png differ diff --git a/src/images/nrdl/cooperate-1.png b/src/images/nrdl/cooperate-1.png new file mode 100644 index 0000000..7ef7fcc Binary files /dev/null and b/src/images/nrdl/cooperate-1.png differ diff --git a/src/images/nrdl/cooperate.png b/src/images/nrdl/cooperate.png new file mode 100644 index 0000000..80377e6 Binary files /dev/null and b/src/images/nrdl/cooperate.png differ diff --git a/src/images/nrdl/drug.png b/src/images/nrdl/drug.png new file mode 100644 index 0000000..179bf38 Binary files /dev/null and b/src/images/nrdl/drug.png differ diff --git a/src/images/nrdl/dtp-default.png b/src/images/nrdl/dtp-default.png new file mode 100644 index 0000000..655910c Binary files /dev/null and b/src/images/nrdl/dtp-default.png differ diff --git a/src/images/nrdl/dtp-durg.png b/src/images/nrdl/dtp-durg.png new file mode 100644 index 0000000..263a5e3 Binary files /dev/null and b/src/images/nrdl/dtp-durg.png differ diff --git a/src/images/nrdl/home1.gif b/src/images/nrdl/home1.gif new file mode 100644 index 0000000..de42720 Binary files /dev/null and b/src/images/nrdl/home1.gif differ diff --git a/src/images/nrdl/home1.png b/src/images/nrdl/home1.png new file mode 100644 index 0000000..1e414eb Binary files /dev/null and b/src/images/nrdl/home1.png differ diff --git a/src/images/nrdl/home2.gif b/src/images/nrdl/home2.gif new file mode 100644 index 0000000..ebcea19 Binary files /dev/null and b/src/images/nrdl/home2.gif differ diff --git a/src/images/nrdl/inject-1.png b/src/images/nrdl/inject-1.png new file mode 100644 index 0000000..8b925fe Binary files /dev/null and b/src/images/nrdl/inject-1.png differ diff --git a/src/images/nrdl/inject.png b/src/images/nrdl/inject.png new file mode 100644 index 0000000..ad4ffdb Binary files /dev/null and b/src/images/nrdl/inject.png differ diff --git a/src/images/nrdl/nm-bg1.png b/src/images/nrdl/nm-bg1.png new file mode 100644 index 0000000..79f0c23 Binary files /dev/null and b/src/images/nrdl/nm-bg1.png differ diff --git a/src/images/nrdl/nm-bg2.png b/src/images/nrdl/nm-bg2.png new file mode 100644 index 0000000..d22aac8 Binary files /dev/null and b/src/images/nrdl/nm-bg2.png differ diff --git a/src/images/nrdl/nm-bg3.png b/src/images/nrdl/nm-bg3.png new file mode 100644 index 0000000..1109218 Binary files /dev/null and b/src/images/nrdl/nm-bg3.png differ diff --git a/src/images/nrdl/nm-bg4.png b/src/images/nrdl/nm-bg4.png new file mode 100644 index 0000000..34dcc12 Binary files /dev/null and b/src/images/nrdl/nm-bg4.png differ diff --git a/src/images/nrdl/nm1-label.png b/src/images/nrdl/nm1-label.png new file mode 100644 index 0000000..069e4a0 Binary files /dev/null and b/src/images/nrdl/nm1-label.png differ diff --git a/src/images/nrdl/nrdl-bg.png b/src/images/nrdl/nrdl-bg.png new file mode 100644 index 0000000..d890aab Binary files /dev/null and b/src/images/nrdl/nrdl-bg.png differ diff --git a/src/images/nrdl/nrdl-follow-badge.png b/src/images/nrdl/nrdl-follow-badge.png new file mode 100644 index 0000000..d7f9daa Binary files /dev/null and b/src/images/nrdl/nrdl-follow-badge.png differ diff --git a/src/images/nrdl/nrdl-table-bg.png b/src/images/nrdl/nrdl-table-bg.png new file mode 100644 index 0000000..065a3c8 Binary files /dev/null and b/src/images/nrdl/nrdl-table-bg.png differ diff --git a/src/images/nrdl/nrdl-table.png b/src/images/nrdl/nrdl-table.png new file mode 100644 index 0000000..36c3a4c Binary files /dev/null and b/src/images/nrdl/nrdl-table.png differ diff --git a/src/images/nrdl/nrdl-user.png b/src/images/nrdl/nrdl-user.png new file mode 100644 index 0000000..9caac49 Binary files /dev/null and b/src/images/nrdl/nrdl-user.png differ diff --git a/src/images/nrdl/phone.png b/src/images/nrdl/phone.png new file mode 100644 index 0000000..77ea5e0 Binary files /dev/null and b/src/images/nrdl/phone.png differ diff --git a/src/images/nrdl/popup-dtp-bg.png b/src/images/nrdl/popup-dtp-bg.png new file mode 100644 index 0000000..01b689d Binary files /dev/null and b/src/images/nrdl/popup-dtp-bg.png differ diff --git a/src/images/nrdl/popup-dtp-title.png b/src/images/nrdl/popup-dtp-title.png new file mode 100644 index 0000000..63b10b2 Binary files /dev/null and b/src/images/nrdl/popup-dtp-title.png differ diff --git a/src/images/nrdl/qa1.png b/src/images/nrdl/qa1.png new file mode 100644 index 0000000..3aaa065 Binary files /dev/null and b/src/images/nrdl/qa1.png differ diff --git a/src/images/nrdl/qa2.png b/src/images/nrdl/qa2.png new file mode 100644 index 0000000..1bf0ea3 Binary files /dev/null and b/src/images/nrdl/qa2.png differ diff --git a/src/images/nrdl/qa3.png b/src/images/nrdl/qa3.png new file mode 100644 index 0000000..ecfa3c3 Binary files /dev/null and b/src/images/nrdl/qa3.png differ diff --git a/src/images/nrdl/qa4.png b/src/images/nrdl/qa4.png new file mode 100644 index 0000000..e42de55 Binary files /dev/null and b/src/images/nrdl/qa4.png differ diff --git a/src/images/nrdl/site.png b/src/images/nrdl/site.png new file mode 100644 index 0000000..d667fe9 Binary files /dev/null and b/src/images/nrdl/site.png differ diff --git a/src/images/nrdl/true.png b/src/images/nrdl/true.png new file mode 100644 index 0000000..c441fd3 Binary files /dev/null and b/src/images/nrdl/true.png differ diff --git a/src/images/star/icon1.png b/src/images/star/icon1.png new file mode 100644 index 0000000..189a7f8 Binary files /dev/null and b/src/images/star/icon1.png differ diff --git a/src/images/star/icon2.png b/src/images/star/icon2.png new file mode 100644 index 0000000..781e39f Binary files /dev/null and b/src/images/star/icon2.png differ diff --git a/src/images/star/icon3.png b/src/images/star/icon3.png new file mode 100644 index 0000000..f76ad07 Binary files /dev/null and b/src/images/star/icon3.png differ diff --git a/src/images/star/icon4.png b/src/images/star/icon4.png new file mode 100644 index 0000000..982cce8 Binary files /dev/null and b/src/images/star/icon4.png differ diff --git a/src/images/star/icon5.png b/src/images/star/icon5.png new file mode 100644 index 0000000..14a888a Binary files /dev/null and b/src/images/star/icon5.png differ diff --git a/src/images/star/icon6.png b/src/images/star/icon6.png new file mode 100644 index 0000000..fa87826 Binary files /dev/null and b/src/images/star/icon6.png differ diff --git a/src/images/star/icon7.png b/src/images/star/icon7.png new file mode 100644 index 0000000..c8f642d Binary files /dev/null and b/src/images/star/icon7.png differ diff --git a/src/images/star/icon8.png b/src/images/star/icon8.png new file mode 100644 index 0000000..d96c4eb Binary files /dev/null and b/src/images/star/icon8.png differ diff --git a/src/images/tabbar/class-active.png b/src/images/tabbar/class-active.png new file mode 100644 index 0000000..55b3644 Binary files /dev/null and b/src/images/tabbar/class-active.png differ diff --git a/src/images/tabbar/class.png b/src/images/tabbar/class.png new file mode 100644 index 0000000..1c8327b Binary files /dev/null and b/src/images/tabbar/class.png differ diff --git a/src/images/tabbar/drug-class-active.png b/src/images/tabbar/drug-class-active.png new file mode 100644 index 0000000..5d44b7b Binary files /dev/null and b/src/images/tabbar/drug-class-active.png differ diff --git a/src/images/tabbar/drug-gift-active.png b/src/images/tabbar/drug-gift-active.png new file mode 100644 index 0000000..69497d3 Binary files /dev/null and b/src/images/tabbar/drug-gift-active.png differ diff --git a/src/images/tabbar/drug-home-active.png b/src/images/tabbar/drug-home-active.png new file mode 100644 index 0000000..8f2bff7 Binary files /dev/null and b/src/images/tabbar/drug-home-active.png differ diff --git a/src/images/tabbar/drug-my-active.png b/src/images/tabbar/drug-my-active.png new file mode 100644 index 0000000..0eda22c Binary files /dev/null and b/src/images/tabbar/drug-my-active.png differ diff --git a/src/images/tabbar/drug-story-active.png b/src/images/tabbar/drug-story-active.png new file mode 100644 index 0000000..ed11c40 Binary files /dev/null and b/src/images/tabbar/drug-story-active.png differ diff --git a/src/images/tabbar/gift-active.png b/src/images/tabbar/gift-active.png new file mode 100644 index 0000000..668cd09 Binary files /dev/null and b/src/images/tabbar/gift-active.png differ diff --git a/src/images/tabbar/gift.png b/src/images/tabbar/gift.png new file mode 100644 index 0000000..4c90439 Binary files /dev/null and b/src/images/tabbar/gift.png differ diff --git a/src/images/tabbar/home-active.png b/src/images/tabbar/home-active.png new file mode 100644 index 0000000..72df9b1 Binary files /dev/null and b/src/images/tabbar/home-active.png differ diff --git a/src/images/tabbar/home.png b/src/images/tabbar/home.png new file mode 100644 index 0000000..3333f34 Binary files /dev/null and b/src/images/tabbar/home.png differ diff --git a/src/images/tabbar/my-active.png b/src/images/tabbar/my-active.png new file mode 100644 index 0000000..db6d2d3 Binary files /dev/null and b/src/images/tabbar/my-active.png differ diff --git a/src/images/tabbar/my.png b/src/images/tabbar/my.png new file mode 100644 index 0000000..e7ffb58 Binary files /dev/null and b/src/images/tabbar/my.png differ diff --git a/src/images/tabbar/story-active.png b/src/images/tabbar/story-active.png new file mode 100644 index 0000000..47d0c0a Binary files /dev/null and b/src/images/tabbar/story-active.png differ diff --git a/src/images/tabbar/story.png b/src/images/tabbar/story.png new file mode 100644 index 0000000..a028932 Binary files /dev/null and b/src/images/tabbar/story.png differ diff --git a/src/miniprogram_npm/@miniprogram-component-plus/video-swiper/index.js b/src/miniprogram_npm/@miniprogram-component-plus/video-swiper/index.js new file mode 100644 index 0000000..b1bec89 --- /dev/null +++ b/src/miniprogram_npm/@miniprogram-component-plus/video-swiper/index.js @@ -0,0 +1,254 @@ +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Component({ + options: { + addGlobalClass: true, + pureDataPattern: /^_/ + }, + properties: { + duration: { + type: Number, + value: 500 + }, + easingFunction: { + type: String, + value: 'default' + }, + loop: { + type: Boolean, + value: true + }, + videoList: { + type: Array, + value: [], + observer: function observer() { + var newVal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + + this._videoListChanged(newVal); + } + } + }, + data: { + nextQueue: [], + prevQueue: [], + curQueue: [], + circular: false, + _last: 1, + _change: -1, + _invalidUp: 0, + _invalidDown: 0, + _videoContexts: [] + }, + lifetimes: { + attached: function attached() { + this.data._videoContexts = [wx.createVideoContext('video_0', this), wx.createVideoContext('video_1', this), wx.createVideoContext('video_2', this)]; + } + }, + methods: { + _videoListChanged: function _videoListChanged(newVal) { + var _this = this; + + var data = this.data; + newVal.forEach(function (item) { + data.nextQueue.push(item); + }); + if (data.curQueue.length === 0) { + this.setData({ + curQueue: data.nextQueue.splice(0, 3) + }, function () { + _this.playCurrent(1); + }); + } + }, + animationfinish: function animationfinish(e) { + var _data = this.data, + _last = _data._last, + _change = _data._change, + curQueue = _data.curQueue, + prevQueue = _data.prevQueue, + nextQueue = _data.nextQueue; + + var current = e.detail.current; + var diff = current - _last; + if (diff === 0) return; + this.data._last = current; + this.playCurrent(current); + this.triggerEvent('change', { activeId: curQueue[current].id }); + var direction = diff === 1 || diff === -2 ? 'up' : 'down'; + if (direction === 'up') { + if (this.data._invalidDown === 0) { + var change = (_change + 1) % 3; + var add = nextQueue.shift(); + var remove = curQueue[change]; + if (add) { + prevQueue.push(remove); + curQueue[change] = add; + this.data._change = change; + } else { + this.data._invalidUp += 1; + } + } else { + this.data._invalidDown -= 1; + } + } + if (direction === 'down') { + if (this.data._invalidUp === 0) { + var _change2 = _change; + var _remove = curQueue[_change2]; + var _add = prevQueue.pop(); + if (_add) { + curQueue[_change2] = _add; + nextQueue.unshift(_remove); + this.data._change = (_change2 - 1 + 3) % 3; + } else { + this.data._invalidDown += 1; + } + } else { + this.data._invalidUp -= 1; + } + } + var circular = true; + if (nextQueue.length === 0 && current !== 0) { + circular = false; + } + if (prevQueue.length === 0 && current !== 2) { + circular = false; + } + this.setData({ + curQueue: curQueue, + circular: circular + }); + }, + playCurrent: function playCurrent(current) { + this.data._videoContexts.forEach(function (ctx, index) { + index !== current ? ctx.pause() : ctx.play(); + }); + }, + onPlay: function onPlay(e) { + this.trigger(e, 'play'); + }, + onPause: function onPause(e) { + this.trigger(e, 'pause'); + }, + onEnded: function onEnded(e) { + this.trigger(e, 'ended'); + }, + onError: function onError(e) { + this.trigger(e, 'error'); + }, + onTimeUpdate: function onTimeUpdate(e) { + this.trigger(e, 'timeupdate'); + }, + onWaiting: function onWaiting(e) { + this.trigger(e, 'wait'); + }, + onProgress: function onProgress(e) { + this.trigger(e, 'progress'); + }, + onLoadedMetaData: function onLoadedMetaData(e) { + this.trigger(e, 'loadedmetadata'); + }, + trigger: function trigger(e, type) { + var ext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + var detail = e.detail; + var activeId = e.target.dataset.id; + this.triggerEvent(type, Object.assign(Object.assign(Object.assign({}, detail), { activeId: activeId }), ext)); + } + } +}); + +/***/ }) +/******/ ]); \ No newline at end of file diff --git a/src/miniprogram_npm/@miniprogram-component-plus/video-swiper/index.json b/src/miniprogram_npm/@miniprogram-component-plus/video-swiper/index.json new file mode 100644 index 0000000..7e37c03 --- /dev/null +++ b/src/miniprogram_npm/@miniprogram-component-plus/video-swiper/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/src/miniprogram_npm/@miniprogram-component-plus/video-swiper/index.wxml b/src/miniprogram_npm/@miniprogram-component-plus/video-swiper/index.wxml new file mode 100644 index 0000000..06c821d --- /dev/null +++ b/src/miniprogram_npm/@miniprogram-component-plus/video-swiper/index.wxml @@ -0,0 +1,37 @@ + + + + + + + + + diff --git a/src/miniprogram_npm/@miniprogram-component-plus/video-swiper/index.wxss b/src/miniprogram_npm/@miniprogram-component-plus/video-swiper/index.wxss new file mode 100644 index 0000000..ea7f6f2 --- /dev/null +++ b/src/miniprogram_npm/@miniprogram-component-plus/video-swiper/index.wxss @@ -0,0 +1 @@ +.container{width:100%;height:100%}.video-swiper{width:100%;height:100%}.video_item{height:100%;width:100%} \ No newline at end of file diff --git a/src/miniprogram_npm/@vant/weapp/action-sheet/index.d.ts b/src/miniprogram_npm/@vant/weapp/action-sheet/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/action-sheet/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/miniprogram_npm/@vant/weapp/action-sheet/index.js b/src/miniprogram_npm/@vant/weapp/action-sheet/index.js new file mode 100644 index 0000000..a39818a --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/action-sheet/index.js @@ -0,0 +1,74 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +var button_1 = require("../mixins/button"); +(0, component_1.VantComponent)({ + classes: ['list-class'], + mixins: [button_1.button], + 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 _this = this; + var index = event.currentTarget.dataset.index; + var _a = this.data, actions = _a.actions, closeOnClickAction = _a.closeOnClickAction, canIUseGetUserProfile = _a.canIUseGetUserProfile; + var item = actions[index]; + if (item) { + this.$emit('select', item); + if (closeOnClickAction) { + this.onClose(); + } + if (item.openType === 'getUserInfo' && canIUseGetUserProfile) { + wx.getUserProfile({ + desc: item.getUserProfileDesc || ' ', + complete: function (userProfile) { + _this.$emit('getuserinfo', userProfile); + }, + }); + } + } + }, + onCancel: function () { + this.$emit('cancel'); + }, + onClose: function () { + this.$emit('close'); + }, + onClickOverlay: function () { + this.$emit('click-overlay'); + this.onClose(); + }, + }, +}); diff --git a/src/miniprogram_npm/@vant/weapp/action-sheet/index.json b/src/miniprogram_npm/@vant/weapp/action-sheet/index.json new file mode 100644 index 0000000..19bf989 --- /dev/null +++ b/src/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/miniprogram_npm/@vant/weapp/action-sheet/index.wxml b/src/miniprogram_npm/@vant/weapp/action-sheet/index.wxml new file mode 100644 index 0000000..d59a45d --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/action-sheet/index.wxml @@ -0,0 +1,69 @@ + + + + + {{ title }} + + + + {{ description }} + + + + + + + + + + {{ cancelText }} + + + diff --git a/src/miniprogram_npm/@vant/weapp/action-sheet/index.wxss b/src/miniprogram_npm/@vant/weapp/action-sheet/index.wxss new file mode 100644 index 0000000..eedd361 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/action-sheet/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-action-sheet{color:var(--action-sheet-item-text-color,#323233);max-height:var(--action-sheet-max-height,90%)!important}.van-action-sheet__cancel,.van-action-sheet__item{background-color:var(--action-sheet-item-background,#fff);font-size:var(--action-sheet-item-font-size,16px);line-height:var(--action-sheet-item-line-height,22px);padding:14px 16px;text-align:center}.van-action-sheet__cancel--hover,.van-action-sheet__item--hover{background-color:#f2f3f5}.van-action-sheet__cancel:after,.van-action-sheet__item:after{border-width:0}.van-action-sheet__cancel{color:var(--action-sheet-cancel-text-color,#646566)}.van-action-sheet__gap{background-color:var(--action-sheet-cancel-padding-color,#f7f8fa);display:block;height:var(--action-sheet-cancel-padding-top,8px)}.van-action-sheet__item--disabled{color:var(--action-sheet-item-disabled-text-color,#c8c9cc)}.van-action-sheet__item--disabled.van-action-sheet__item--hover{background-color:var(--action-sheet-item-background,#fff)}.van-action-sheet__subname{color:var(--action-sheet-subname-color,#969799);font-size:var(--action-sheet-subname-font-size,12px);line-height:var(--action-sheet-subname-line-height,20px);margin-top:var(--padding-xs,8px)}.van-action-sheet__header{font-size:var(--action-sheet-header-font-size,16px);font-weight:var(--font-weight-bold,500);line-height:var(--action-sheet-header-height,48px);text-align:center}.van-action-sheet__description{color:var(--action-sheet-description-color,#969799);font-size:var(--action-sheet-description-font-size,14px);line-height:var(--action-sheet-description-line-height,20px);padding:20px var(--padding-md,16px);text-align:center}.van-action-sheet__close{color:var(--action-sheet-close-icon-color,#c8c9cc);font-size:var(--action-sheet-close-icon-size,22px)!important;line-height:inherit!important;padding:var(--action-sheet-close-icon-padding,0 16px);position:absolute!important;right:0;top:0}.van-action-sheet__loading{display:flex!important} \ No newline at end of file diff --git a/src/miniprogram_npm/@vant/weapp/area/index.d.ts b/src/miniprogram_npm/@vant/weapp/area/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/area/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/miniprogram_npm/@vant/weapp/area/index.js b/src/miniprogram_npm/@vant/weapp/area/index.js new file mode 100644 index 0000000..73de66d --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/area/index.js @@ -0,0 +1,235 @@ +"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'; +(0, component_1.VantComponent)({ + classes: ['active-class', 'toolbar-class', 'column-class'], + props: __assign(__assign({}, shared_1.pickerProps), { showToolbar: { + type: Boolean, + value: true, + }, 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; + (0, 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; + var _b = event.detail, index = _b.index, picker = _b.picker, value = _b.value; + this.code = value[index].code; + (_a = this.setValues()) === null || _a === void 0 ? void 0 : _a.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["".concat(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: "".concat(code).concat(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/miniprogram_npm/@vant/weapp/area/index.json b/src/miniprogram_npm/@vant/weapp/area/index.json new file mode 100644 index 0000000..a778e91 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/area/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-picker": "../picker/index" + } +} diff --git a/src/miniprogram_npm/@vant/weapp/area/index.wxml b/src/miniprogram_npm/@vant/weapp/area/index.wxml new file mode 100644 index 0000000..3a437b7 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/area/index.wxml @@ -0,0 +1,20 @@ + + + diff --git a/src/miniprogram_npm/@vant/weapp/area/index.wxs b/src/miniprogram_npm/@vant/weapp/area/index.wxs new file mode 100644 index 0000000..07723c1 --- /dev/null +++ b/src/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/miniprogram_npm/@vant/weapp/area/index.wxss b/src/miniprogram_npm/@vant/weapp/area/index.wxss new file mode 100644 index 0000000..99694d6 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/area/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss'; \ No newline at end of file diff --git a/src/miniprogram_npm/@vant/weapp/button/index.d.ts b/src/miniprogram_npm/@vant/weapp/button/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/button/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/miniprogram_npm/@vant/weapp/button/index.js b/src/miniprogram_npm/@vant/weapp/button/index.js new file mode 100644 index 0000000..984135c --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/button/index.js @@ -0,0 +1,67 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +var button_1 = require("../mixins/button"); +var version_1 = require("../common/version"); +var mixins = [button_1.button]; +if ((0, version_1.canIUseFormFieldButton)()) { + mixins.push('wx://form-field-button'); +} +(0, 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 (event) { + var _this = this; + this.$emit('click', event); + var _a = this.data, canIUseGetUserProfile = _a.canIUseGetUserProfile, openType = _a.openType, getUserProfileDesc = _a.getUserProfileDesc, lang = _a.lang; + if (openType === 'getUserInfo' && canIUseGetUserProfile) { + wx.getUserProfile({ + desc: getUserProfileDesc || ' ', + lang: lang || 'en', + complete: function (userProfile) { + _this.$emit('getuserinfo', userProfile); + }, + }); + } + }, + }, +}); diff --git a/src/miniprogram_npm/@vant/weapp/button/index.json b/src/miniprogram_npm/@vant/weapp/button/index.json new file mode 100644 index 0000000..e00a588 --- /dev/null +++ b/src/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/miniprogram_npm/@vant/weapp/button/index.wxml b/src/miniprogram_npm/@vant/weapp/button/index.wxml new file mode 100644 index 0000000..e7f60f1 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/button/index.wxml @@ -0,0 +1,56 @@ + + + + diff --git a/src/miniprogram_npm/@vant/weapp/button/index.wxs b/src/miniprogram_npm/@vant/weapp/button/index.wxs new file mode 100644 index 0000000..8b649fe --- /dev/null +++ b/src/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/miniprogram_npm/@vant/weapp/button/index.wxss b/src/miniprogram_npm/@vant/weapp/button/index.wxss new file mode 100644 index 0000000..bd8bb5a --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/button/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-button{-webkit-text-size-adjust:100%;align-items:center;-webkit-appearance:none;border-radius:var(--button-border-radius,2px);box-sizing:border-box;display:inline-flex;font-size:var(--button-default-font-size,16px);height:var(--button-default-height,44px);justify-content:center;line-height:var(--button-line-height,20px);padding:0;position:relative;text-align:center;transition:opacity .2s;vertical-align:middle}.van-button:before{background-color:#000;border:inherit;border-color:#000;border-radius:inherit;content:" ";height:100%;left:50%;opacity:0;position:absolute;top:50%;transform:translate(-50%,-50%);width:100%}.van-button:after{border-width:0}.van-button--active:before{opacity:.15}.van-button--unclickable:after{display:none}.van-button--default{background:var(--button-default-background-color,#fff);border:var(--button-border-width,1px) solid var(--button-default-border-color,#ebedf0);color:var(--button-default-color,#323233)}.van-button--primary{background:var(--button-primary-background-color,#07c160);border:var(--button-border-width,1px) solid var(--button-primary-border-color,#07c160);color:var(--button-primary-color,#fff)}.van-button--info{background:var(--button-info-background-color,#1989fa);border:var(--button-border-width,1px) solid var(--button-info-border-color,#1989fa);color:var(--button-info-color,#fff)}.van-button--danger{background:var(--button-danger-background-color,#ee0a24);border:var(--button-border-width,1px) solid var(--button-danger-border-color,#ee0a24);color:var(--button-danger-color,#fff)}.van-button--warning{background:var(--button-warning-background-color,#ff976a);border:var(--button-border-width,1px) solid var(--button-warning-border-color,#ff976a);color:var(--button-warning-color,#fff)}.van-button--plain{background:var(--button-plain-background-color,#fff)}.van-button--plain.van-button--primary{color:var(--button-primary-background-color,#07c160)}.van-button--plain.van-button--info{color:var(--button-info-background-color,#1989fa)}.van-button--plain.van-button--danger{color:var(--button-danger-background-color,#ee0a24)}.van-button--plain.van-button--warning{color:var(--button-warning-background-color,#ff976a)}.van-button--large{height:var(--button-large-height,50px);width:100%}.van-button--normal{font-size:var(--button-normal-font-size,14px);padding:0 15px}.van-button--small{font-size:var(--button-small-font-size,12px);height:var(--button-small-height,30px);min-width:var(--button-small-min-width,60px);padding:0 var(--padding-xs,8px)}.van-button--mini{display:inline-block;font-size:var(--button-mini-font-size,10px);height:var(--button-mini-height,22px);min-width:var(--button-mini-min-width,50px)}.van-button--mini+.van-button--mini{margin-left:5px}.van-button--block{display:flex;width:100%}.van-button--round{border-radius:var(--button-round-border-radius,999px)}.van-button--square{border-radius:0}.van-button--disabled{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{line-height:inherit!important;min-width:1em;vertical-align:top}.van-button--hairline{border-width:0;padding-top:1px}.van-button--hairline:after{border-color:inherit;border-radius:calc(var(--button-border-radius, 2px)*2);border-width:1px}.van-button--hairline.van-button--round:after{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/miniprogram_npm/@vant/weapp/calendar/calendar.wxml b/src/miniprogram_npm/@vant/weapp/calendar/calendar.wxml new file mode 100644 index 0000000..2ddb048 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/calendar/calendar.wxml @@ -0,0 +1,70 @@ + + + +
+ +
+ + + + + + + + + + + + {{ + computed.getButtonDisabled(type, currentDate, minRange) + ? confirmDisabledText + : confirmText + }} + + +
diff --git a/src/miniprogram_npm/@vant/weapp/calendar/components/header/index.d.ts b/src/miniprogram_npm/@vant/weapp/calendar/components/header/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/calendar/components/header/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/miniprogram_npm/@vant/weapp/calendar/components/header/index.js b/src/miniprogram_npm/@vant/weapp/calendar/components/header/index.js new file mode 100644 index 0000000..544b3a4 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/calendar/components/header/index.js @@ -0,0 +1,45 @@ +"use strict"; +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../../../common/component"); +(0, component_1.VantComponent)({ + props: { + title: { + type: String, + value: '日期选择', + }, + subtitle: String, + showTitle: Boolean, + showSubtitle: Boolean, + firstDayOfWeek: { + type: Number, + observer: 'initWeekDay', + }, + }, + data: { + weekdays: [], + }, + created: function () { + this.initWeekDay(); + }, + methods: { + initWeekDay: function () { + var defaultWeeks = ['日', '一', '二', '三', '四', '五', '六']; + var firstDayOfWeek = this.data.firstDayOfWeek || 0; + this.setData({ + weekdays: __spreadArray(__spreadArray([], defaultWeeks.slice(firstDayOfWeek, 7), true), defaultWeeks.slice(0, firstDayOfWeek), true), + }); + }, + onClickSubtitle: function (event) { + this.$emit('click-subtitle', event); + }, + }, +}); diff --git a/src/miniprogram_npm/@vant/weapp/calendar/components/header/index.json b/src/miniprogram_npm/@vant/weapp/calendar/components/header/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/calendar/components/header/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/src/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxml b/src/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxml new file mode 100644 index 0000000..7e56c83 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxml @@ -0,0 +1,16 @@ + + + + {{ title }} + + + + {{ subtitle }} + + + + + {{ item }} + + + diff --git a/src/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxss b/src/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxss new file mode 100644 index 0000000..272537e --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxss @@ -0,0 +1 @@ +@import '../../../common/index.wxss';.van-calendar__header{box-shadow:var(--calendar-header-box-shadow,0 2px 10px hsla(220,1%,50%,.16));flex-shrink:0}.van-calendar__header-subtitle,.van-calendar__header-title{font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.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:flex}.van-calendar__weekday{flex:1;font-size:var(--calendar-weekdays-font-size,12px);line-height:var(--calendar-weekdays-height,30px);text-align:center} \ No newline at end of file diff --git a/src/miniprogram_npm/@vant/weapp/calendar/components/month/index.d.ts b/src/miniprogram_npm/@vant/weapp/calendar/components/month/index.d.ts new file mode 100644 index 0000000..3ccf85a --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/calendar/components/month/index.d.ts @@ -0,0 +1,6 @@ +export interface Day { + date: Date; + type: string; + text: number; + bottomInfo?: string; +} diff --git a/src/miniprogram_npm/@vant/weapp/calendar/components/month/index.js b/src/miniprogram_npm/@vant/weapp/calendar/components/month/index.js new file mode 100644 index 0000000..4d137f5 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/calendar/components/month/index.js @@ -0,0 +1,158 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../../../common/component"); +var utils_1 = require("../../utils"); +(0, 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', + }, + firstDayOfWeek: { + type: Number, + 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 = (0, 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 (0, utils_1.compareDay)(item, date) === 0; }); + }; + if (isSelected(day)) { + var prevDay = (0, utils_1.getPrevDay)(day); + var nextDay = (0, 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 = (0, utils_1.compareDay)(day, startDay); + if (!endDay) { + return compareToStart === 0 ? 'start' : ''; + } + var compareToEnd = (0, 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'; + } + return ''; + }, + getDayType: function (day) { + var _a = this.data, type = _a.type, minDate = _a.minDate, maxDate = _a.maxDate, currentDate = _a.currentDate; + if ((0, utils_1.compareDay)(day, minDate) < 0 || (0, utils_1.compareDay)(day, maxDate) > 0) { + return 'disabled'; + } + if (type === 'single') { + return (0, utils_1.compareDay)(day, currentDate) === 0 ? 'selected' : ''; + } + if (type === 'multiple') { + return this.getMultipleDayType(day); + } + /* istanbul ignore else */ + if (type === 'range') { + return this.getRangeDayType(day); + } + return ''; + }, + 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/miniprogram_npm/@vant/weapp/calendar/components/month/index.json b/src/miniprogram_npm/@vant/weapp/calendar/components/month/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/calendar/components/month/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/src/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxml b/src/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxml new file mode 100644 index 0000000..0c73b2f --- /dev/null +++ b/src/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/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxs b/src/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxs new file mode 100644 index 0000000..55e45a5 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxs @@ -0,0 +1,71 @@ +/* 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, firstDayOfWeek) { + var style = []; + var current = getDate(date).getDay() || 7; + var offset = current < firstDayOfWeek ? (7 - firstDayOfWeek + current) : + current === 7 && firstDayOfWeek === 0 ? 0 : + (current - firstDayOfWeek); + + 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 === 'start-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/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxss b/src/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxss new file mode 100644 index 0000000..9aee73d --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxss @@ -0,0 +1 @@ +@import '../../../common/index.wxss';.van-calendar{background-color:var(--calendar-background-color,#fff);display:flex;flex-direction:column;height:100%}.van-calendar__month-title{font-size:var(--calendar-month-title-font-size,14px);font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.van-calendar__days{display:flex;flex-wrap:wrap;position:relative;-webkit-user-select:none;user-select:none}.van-calendar__month-mark{color:var(--calendar-month-mark-color,rgba(242,243,245,.8));font-size:var(--calendar-month-mark-font-size,160px);left:50%;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:0}.van-calendar__day,.van-calendar__selected-day{align-items:center;display:flex;justify-content:center;text-align:center}.van-calendar__day{font-size:var(--calendar-day-font-size,16px);height:var(--calendar-day-height,64px);position:relative;width:14.285%}.van-calendar__day--end,.van-calendar__day--multiple-middle,.van-calendar__day--multiple-selected,.van-calendar__day--start,.van-calendar__day--start-end{background-color:var(--calendar-range-edge-background-color,#ee0a24);color:var(--calendar-range-edge-color,#fff)}.van-calendar__day--start{border-radius:4px 0 0 4px}.van-calendar__day--end{border-radius:0 4px 4px 0}.van-calendar__day--multiple-selected,.van-calendar__day--start-end{border-radius:4px}.van-calendar__day--middle{color:var(--calendar-range-middle-color,#ee0a24)}.van-calendar__day--middle:after{background-color:currentColor;bottom:0;content:"";left:0;opacity:var(--calendar-range-middle-background-opacity,.1);position:absolute;right:0;top:0}.van-calendar__day--disabled{color:var(--calendar-day-disabled-color,#c8c9cc);cursor:default}.van-calendar__bottom-info,.van-calendar__top-info{font-size:var(--calendar-info-font-size,10px);left:0;line-height:var(--calendar-info-line-height,14px);position:absolute;right:0}@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{background-color:var(--calendar-selected-day-background-color,#ee0a24);border-radius:4px;color:var(--calendar-selected-day-color,#fff);height:var(--calendar-selected-day-size,54px);width:var(--calendar-selected-day-size,54px)} \ No newline at end of file diff --git a/src/miniprogram_npm/@vant/weapp/calendar/index.d.ts b/src/miniprogram_npm/@vant/weapp/calendar/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/calendar/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/miniprogram_npm/@vant/weapp/calendar/index.js b/src/miniprogram_npm/@vant/weapp/calendar/index.js new file mode 100644 index 0000000..eea8751 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/calendar/index.js @@ -0,0 +1,379 @@ +"use strict"; +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +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"); +var initialMinDate = (0, utils_1.getToday)().getTime(); +var initialMaxDate = (function () { + var now = (0, utils_1.getToday)(); + return new Date(now.getFullYear(), now.getMonth() + 6, now.getDate()).getTime(); +})(); +var getTime = function (date) { + return date instanceof Date ? date.getTime() : date; +}; +(0, 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: '确定', + }, + confirmDisabledText: { + type: String, + value: '确定', + }, + rangePrompt: String, + showRangePrompt: { + type: Boolean, + value: true, + }, + defaultDate: { + type: null, + value: (0, utils_1.getToday)().getTime(), + observer: function (val) { + this.setData({ currentDate: val }); + this.scrollIntoView(); + }, + }, + allowSameDay: Boolean, + type: { + type: String, + value: 'single', + observer: 'reset', + }, + minDate: { + type: Number, + value: initialMinDate, + }, + maxDate: { + type: Number, + value: initialMaxDate, + }, + 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, + }, + minRange: { + type: Number, + value: 1, + }, + firstDayOfWeek: { + type: Number, + value: 0, + }, + readonly: Boolean, + }, + data: { + subtitle: '', + currentDate: null, + scrollIntoView: '', + }, + watch: { + minDate: function () { + this.initRect(); + }, + maxDate: function () { + this.initRect(); + }, + }, + created: function () { + this.setData({ + currentDate: this.getInitialDate(this.data.defaultDate), + }); + }, + mounted: function () { + if (this.data.show || !this.data.poppable) { + this.initRect(); + this.scrollIntoView(); + } + }, + methods: { + reset: function () { + this.setData({ currentDate: this.getInitialDate(this.data.defaultDate) }); + 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: (0, utils_1.formatMonthTitle)(res.dataset.date) }); + } + }); + }, + limitDateRange: function (date, minDate, maxDate) { + if (minDate === void 0) { minDate = null; } + if (maxDate === void 0) { maxDate = null; } + minDate = minDate || this.data.minDate; + maxDate = maxDate || this.data.maxDate; + if ((0, utils_1.compareDay)(date, minDate) === -1) { + return minDate; + } + if ((0, utils_1.compareDay)(date, maxDate) === 1) { + return maxDate; + } + return date; + }, + getInitialDate: function (defaultDate) { + var _this = this; + if (defaultDate === void 0) { defaultDate = null; } + var _a = this.data, type = _a.type, minDate = _a.minDate, maxDate = _a.maxDate, allowSameDay = _a.allowSameDay; + if (!defaultDate) + return []; + var now = (0, utils_1.getToday)().getTime(); + if (type === 'range') { + if (!Array.isArray(defaultDate)) { + defaultDate = []; + } + var _b = defaultDate || [], startDay = _b[0], endDay = _b[1]; + var startDate = getTime(startDay || now); + var start = this.limitDateRange(startDate, minDate, allowSameDay ? startDate : (0, utils_1.getPrevDay)(new Date(maxDate)).getTime()); + var date = getTime(endDay || now); + var end = this.limitDateRange(date, allowSameDay ? date : (0, utils_1.getNextDay)(new Date(minDate)).getTime()); + return [start, end]; + } + if (type === 'multiple') { + if (Array.isArray(defaultDate)) { + return defaultDate.map(function (date) { return _this.limitDateRange(date); }); + } + return [this.limitDateRange(now)]; + } + if (!defaultDate || Array.isArray(defaultDate)) { + defaultDate = now; + } + return this.limitDateRange(defaultDate); + }, + scrollIntoView: function () { + var _this = this; + (0, 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; + if (!currentDate) + return; + // @ts-ignore + var targetDate = type === 'single' ? currentDate : currentDate[0]; + var displayed = show || !poppable; + if (!targetDate || !displayed) { + return; + } + var months = (0, utils_1.getMonths)(minDate, maxDate); + months.some(function (month, index) { + if ((0, utils_1.compareMonth)(month, targetDate) === 0) { + _this.setData({ scrollIntoView: "month".concat(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) { + if (this.data.readonly) { + return; + } + 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_1 = currentDate[0], endDay = currentDate[1]; + if (startDay_1 && !endDay) { + var compareToStart = (0, utils_1.compareDay)(date, startDay_1); + if (compareToStart === 1) { + var days_1 = this.selectComponent('.month').data.days; + days_1.some(function (day, index) { + var isDisabled = day.type === 'disabled' && + getTime(startDay_1) < getTime(day.date) && + getTime(day.date) < getTime(date); + if (isDisabled) { + (date = days_1[index - 1].date); + } + return isDisabled; + }); + this.select([startDay_1, date], true); + } + else if (compareToStart === -1) { + this.select([date, null]); + } + else if (allowSameDay) { + this.select([date, date], true); + } + } + else { + this.select([date, null]); + } + } + else if (type === 'multiple') { + var selectedIndex_1; + // @ts-ignore + var selected = currentDate.some(function (dateItem, index) { + var equal = (0, 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(__spreadArray(__spreadArray([], currentDate, true), [date], false)); + } + } + else { + this.select(date, true); + } + }, + unselect: function (dateArray) { + var date = dateArray[0]; + if (date) { + this.$emit('unselect', (0, 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], + (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) { + this.setData({ + currentDate: Array.isArray(date) ? date.map(getTime) : getTime(date), + }); + this.$emit('select', (0, utils_1.copyDates)(date)); + }, + checkRange: function (date) { + var _a = this.data, maxRange = _a.maxRange, rangePrompt = _a.rangePrompt, showRangePrompt = _a.showRangePrompt; + if (maxRange && (0, utils_1.calcDateNum)(date) > maxRange) { + if (showRangePrompt) { + (0, toast_1.default)({ + context: this, + message: rangePrompt || "\u9009\u62E9\u5929\u6570\u4E0D\u80FD\u8D85\u8FC7 ".concat(maxRange, " \u5929"), + }); + } + this.$emit('over-range'); + 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', (0, utils_1.copyDates)(_this.data.currentDate)); + }); + }, + onClickSubtitle: function (event) { + this.$emit('click-subtitle', event); + }, + }, +}); diff --git a/src/miniprogram_npm/@vant/weapp/calendar/index.json b/src/miniprogram_npm/@vant/weapp/calendar/index.json new file mode 100644 index 0000000..397d5ae --- /dev/null +++ b/src/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/miniprogram_npm/@vant/weapp/calendar/index.wxml b/src/miniprogram_npm/@vant/weapp/calendar/index.wxml new file mode 100644 index 0000000..9667eef --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/calendar/index.wxml @@ -0,0 +1,26 @@ + + + + + + + + + + + + diff --git a/src/miniprogram_npm/@vant/weapp/calendar/index.wxs b/src/miniprogram_npm/@vant/weapp/calendar/index.wxs new file mode 100644 index 0000000..0a56646 --- /dev/null +++ b/src/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, minRange) { + if (currentDate == null) { + return true; + } + + if (type === 'range') { + return !currentDate[0] || !currentDate[1]; + } + + if (type === 'multiple') { + return currentDate.length < minRange; + } + + return !currentDate; +} + +module.exports = { + getMonths: getMonths, + getButtonDisabled: getButtonDisabled +}; diff --git a/src/miniprogram_npm/@vant/weapp/calendar/index.wxss b/src/miniprogram_npm/@vant/weapp/calendar/index.wxss new file mode 100644 index 0000000..a1f1cf0 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/calendar/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-calendar{background-color:var(--calendar-background-color,#fff);display:flex;flex-direction:column;height:var(--calendar-height,100%)}.van-calendar__close-icon{top:11px}.van-calendar__popup--bottom,.van-calendar__popup--top{height:var(--calendar-popup-height,90%)}.van-calendar__popup--left,.van-calendar__popup--right{height:100%}.van-calendar__body{-webkit-overflow-scrolling:touch;flex:1;overflow:auto}.van-calendar__footer{flex-shrink:0;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:var(--calendar-confirm-button-height,36px)!important;line-height:var(--calendar-confirm-button-line-height,34px)!important;margin:var(--calendar-confirm-button-margin,7px 0)!important} \ No newline at end of file diff --git a/src/miniprogram_npm/@vant/weapp/calendar/utils.d.ts b/src/miniprogram_npm/@vant/weapp/calendar/utils.d.ts new file mode 100644 index 0000000..889e6e7 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/calendar/utils.d.ts @@ -0,0 +1,12 @@ +export declare const ROW_HEIGHT = 64; +export declare function formatMonthTitle(date: Date): string; +export declare function compareMonth(date1: Date | number, date2: Date | number): 0 | 1 | -1; +export declare function compareDay(day1: Date | number, day2: Date | number): 0 | 1 | -1; +export declare function getDayByOffset(date: Date, offset: number): Date; +export declare function getPrevDay(date: Date): Date; +export declare function getNextDay(date: Date): Date; +export declare function getToday(): Date; +export declare function calcDateNum(date: [Date, Date]): number; +export declare function copyDates(dates: Date | Date[]): Date | Date[]; +export declare function getMonthEndDay(year: number, month: number): number; +export declare function getMonths(minDate: number, maxDate: number): number[]; diff --git a/src/miniprogram_npm/@vant/weapp/calendar/utils.js b/src/miniprogram_npm/@vant/weapp/calendar/utils.js new file mode 100644 index 0000000..c9e5df7 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/calendar/utils.js @@ -0,0 +1,97 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getMonths = exports.getMonthEndDay = exports.copyDates = exports.calcDateNum = exports.getToday = 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 "".concat(date.getFullYear(), "\u5E74").concat(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 getToday() { + var today = new Date(); + today.setHours(0, 0, 0, 0); + return today; +} +exports.getToday = getToday; +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/miniprogram_npm/@vant/weapp/calendar/utils.wxs b/src/miniprogram_npm/@vant/weapp/calendar/utils.wxs new file mode 100644 index 0000000..e57f6b3 --- /dev/null +++ b/src/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/miniprogram_npm/@vant/weapp/card/index.d.ts b/src/miniprogram_npm/@vant/weapp/card/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/card/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/miniprogram_npm/@vant/weapp/card/index.js b/src/miniprogram_npm/@vant/weapp/card/index.js new file mode 100644 index 0000000..2815655 --- /dev/null +++ b/src/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"); +(0, 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] ? ".".concat(priceArr[1]) : '', + }); + }, + onClickThumb: function () { + this.jumpLink('thumbLink'); + }, + }, +}); diff --git a/src/miniprogram_npm/@vant/weapp/card/index.json b/src/miniprogram_npm/@vant/weapp/card/index.json new file mode 100644 index 0000000..e917407 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/card/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-tag": "../tag/index" + } +} diff --git a/src/miniprogram_npm/@vant/weapp/card/index.wxml b/src/miniprogram_npm/@vant/weapp/card/index.wxml new file mode 100644 index 0000000..62173e4 --- /dev/null +++ b/src/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/miniprogram_npm/@vant/weapp/card/index.wxss b/src/miniprogram_npm/@vant/weapp/card/index.wxss new file mode 100644 index 0000000..0f4d7c5 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/card/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-card{background-color:var(--card-background-color,#fafafa);box-sizing:border-box;color:var(--card-text-color,#323233);font-size:var(--card-font-size,12px);padding:var(--card-padding,8px 16px);position:relative}.van-card__header{display:flex}.van-card__header--center{align-items:center;justify-content:center}.van-card__thumb{flex:none;height:var(--card-thumb-size,88px);margin-right:var(--padding-xs,8px);position:relative;width:var(--card-thumb-size,88px)}.van-card__thumb:empty{display:none}.van-card__img{border-radius:8px;height:100%;width:100%}.van-card__content{display:flex;flex:1;flex-direction:column;justify-content:space-between;min-height:var(--card-thumb-size,88px);min-width:0;position:relative}.van-card__content--center{justify-content:center}.van-card__desc,.van-card__title{word-wrap:break-word}.van-card__title{font-weight:700;line-height:var(--card-title-line-height,16px)}.van-card__desc{color:var(--card-desc-color,#646566);line-height:var(--card-desc-line-height,20px)}.van-card__bottom{line-height:20px}.van-card__price{color:var(--card-price-color,#ee0a24);display:inline-block;font-size:var(--card-price-font-size,12px);font-weight:700}.van-card__price-integer{font-size:var(--card-price-integer-font-size,16px)}.van-card__price-decimal,.van-card__price-integer{font-family:var(--card-price-font-family,Avenir-Heavy,PingFang SC,Helvetica Neue,Arial,sans-serif)}.van-card__origin-price{color:var(--card-origin-price-color,#646566);display:inline-block;font-size:var(--card-origin-price-font-size,10px);margin-left:5px;text-decoration:line-through}.van-card__num{float:right}.van-card__tag{left:0;position:absolute!important;top:2px}.van-card__footer{flex:none;text-align:right;width:100%} \ No newline at end of file diff --git a/src/miniprogram_npm/@vant/weapp/cascader/index.d.ts b/src/miniprogram_npm/@vant/weapp/cascader/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/cascader/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/miniprogram_npm/@vant/weapp/cascader/index.js b/src/miniprogram_npm/@vant/weapp/cascader/index.js new file mode 100644 index 0000000..63915ee --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/cascader/index.js @@ -0,0 +1,222 @@ +"use strict"; +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +var FieldName; +(function (FieldName) { + FieldName["TEXT"] = "text"; + FieldName["VALUE"] = "value"; + FieldName["CHILDREN"] = "children"; +})(FieldName || (FieldName = {})); +var defaultFieldNames = { + text: FieldName.TEXT, + value: FieldName.VALUE, + children: FieldName.CHILDREN, +}; +(0, component_1.VantComponent)({ + props: { + title: String, + value: { + type: String, + }, + placeholder: { + type: String, + value: '请选择', + }, + activeColor: { + type: String, + value: '#1989fa', + }, + options: { + type: Array, + value: [], + }, + swipeable: { + type: Boolean, + value: false, + }, + closeable: { + type: Boolean, + value: true, + }, + showHeader: { + type: Boolean, + value: true, + }, + closeIcon: { + type: String, + value: 'cross', + }, + fieldNames: { + type: Object, + value: defaultFieldNames, + observer: 'updateFieldNames', + }, + }, + data: { + tabs: [], + activeTab: 0, + textKey: FieldName.TEXT, + valueKey: FieldName.VALUE, + childrenKey: FieldName.CHILDREN, + innerValue: '', + }, + watch: { + options: function () { + this.updateTabs(); + }, + value: function (newVal) { + this.updateValue(newVal); + }, + }, + created: function () { + this.updateTabs(); + }, + methods: { + updateValue: function (val) { + var _this = this; + if (val !== undefined) { + var values = this.data.tabs.map(function (tab) { return tab.selected && tab.selected[_this.data.valueKey]; }); + if (values.indexOf(val) > -1) { + return; + } + } + this.innerValue = val; + this.updateTabs(); + }, + updateFieldNames: function () { + var _a = this.data.fieldNames || defaultFieldNames, _b = _a.text, text = _b === void 0 ? 'text' : _b, _c = _a.value, value = _c === void 0 ? 'value' : _c, _d = _a.children, children = _d === void 0 ? 'children' : _d; + this.setData({ + textKey: text, + valueKey: value, + childrenKey: children, + }); + }, + getSelectedOptionsByValue: function (options, value) { + for (var i = 0; i < options.length; i++) { + var option = options[i]; + if (option[this.data.valueKey] === value) { + return [option]; + } + if (option[this.data.childrenKey]) { + var selectedOptions = this.getSelectedOptionsByValue(option[this.data.childrenKey], value); + if (selectedOptions) { + return __spreadArray([option], selectedOptions, true); + } + } + } + }, + updateTabs: function () { + var _this = this; + var options = this.data.options; + var innerValue = this.innerValue; + if (!options.length) { + return; + } + if (innerValue !== undefined) { + var selectedOptions = this.getSelectedOptionsByValue(options, innerValue); + if (selectedOptions) { + var optionsCursor_1 = options; + var tabs_1 = selectedOptions.map(function (option) { + var tab = { + options: optionsCursor_1, + selected: option, + }; + var next = optionsCursor_1.find(function (item) { return item[_this.data.valueKey] === option[_this.data.valueKey]; }); + if (next) { + optionsCursor_1 = next[_this.data.childrenKey]; + } + return tab; + }); + if (optionsCursor_1) { + tabs_1.push({ + options: optionsCursor_1, + selected: null, + }); + } + this.setData({ + tabs: tabs_1, + }); + wx.nextTick(function () { + _this.setData({ + activeTab: tabs_1.length - 1, + }); + }); + return; + } + } + this.setData({ + tabs: [ + { + options: options, + selected: null, + }, + ], + }); + }, + onClose: function () { + this.$emit('close'); + }, + onClickTab: function (e) { + var _a = e.detail, tabIndex = _a.index, title = _a.title; + this.$emit('click-tab', { title: title, tabIndex: tabIndex }); + this.setData({ + activeTab: tabIndex, + }); + }, + // 选中 + onSelect: function (e) { + var _this = this; + var _a = e.currentTarget.dataset, option = _a.option, tabIndex = _a.tabIndex; + if (option && option.disabled) { + return; + } + var _b = this.data, valueKey = _b.valueKey, childrenKey = _b.childrenKey; + var tabs = this.data.tabs; + tabs[tabIndex].selected = option; + if (tabs.length > tabIndex + 1) { + tabs = tabs.slice(0, tabIndex + 1); + } + if (option[childrenKey]) { + var nextTab = { + options: option[childrenKey], + selected: null, + }; + if (tabs[tabIndex + 1]) { + tabs[tabIndex + 1] = nextTab; + } + else { + tabs.push(nextTab); + } + wx.nextTick(function () { + _this.setData({ + activeTab: tabIndex + 1, + }); + }); + } + this.setData({ + tabs: tabs, + }); + var selectedOptions = tabs.map(function (tab) { return tab.selected; }).filter(Boolean); + var value = option[valueKey]; + var params = { + value: value, + tabIndex: tabIndex, + selectedOptions: selectedOptions, + }; + this.innerValue = value; + this.$emit('change', params); + if (!option[childrenKey]) { + this.$emit('finish', params); + } + }, + }, +}); diff --git a/src/miniprogram_npm/@vant/weapp/cascader/index.json b/src/miniprogram_npm/@vant/weapp/cascader/index.json new file mode 100644 index 0000000..d0f75eb --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/cascader/index.json @@ -0,0 +1,8 @@ +{ + "component": true, + "usingComponents": { + "van-icon": "../icon/index", + "van-tab": "../tab/index", + "van-tabs": "../tabs/index" + } +} \ No newline at end of file diff --git a/src/miniprogram_npm/@vant/weapp/cascader/index.wxml b/src/miniprogram_npm/@vant/weapp/cascader/index.wxml new file mode 100644 index 0000000..1794b82 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/cascader/index.wxml @@ -0,0 +1,53 @@ + + + + {{ title }} + + + + + + + + + + + {{ option[textKey] }} + + + + + + + diff --git a/src/miniprogram_npm/@vant/weapp/cascader/index.wxs b/src/miniprogram_npm/@vant/weapp/cascader/index.wxs new file mode 100644 index 0000000..b1aab58 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/cascader/index.wxs @@ -0,0 +1,24 @@ +var utils = require('../wxs/utils.wxs'); +var style = require('../wxs/style.wxs'); + +function isSelected(tab, valueKey, option) { + return tab.selected && tab.selected[valueKey] === option[valueKey] +} + +function optionClass(tab, valueKey, option) { + return utils.bem('cascader__option', { selected: isSelected(tab, valueKey, option), disabled: option.disabled }) +} + +function optionStyle(data) { + var color = data.option.color || (isSelected(data.tab, data.valueKey, data.option) ? data.activeColor : undefined); + return style({ + color + }); +} + + +module.exports = { + isSelected: isSelected, + optionClass: optionClass, + optionStyle: optionStyle, +}; \ No newline at end of file diff --git a/src/miniprogram_npm/@vant/weapp/cascader/index.wxss b/src/miniprogram_npm/@vant/weapp/cascader/index.wxss new file mode 100644 index 0000000..7062486 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/cascader/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-cascader__header{align-items:center;display:flex;height:48px;justify-content:space-between;padding:0 16px}.van-cascader__title{font-size:16px;font-weight:600;line-height:20px}.van-cascader__close-icon{color:#c8c9cc;font-size:22px;height:22px}.van-cascader__tabs-wrap{height:48px!important;padding:0 8px}.van-cascader__tab{color:#323233!important;flex:none!important;font-weight:600!important;padding:0 8px!important}.van-cascader__tab--unselected{color:#969799!important;font-weight:400!important}.van-cascader__option{align-items:center;cursor:pointer;display:flex;font-size:14px;justify-content:space-between;line-height:20px;padding:10px 16px}.van-cascader__option:active{background-color:#f2f3f5}.van-cascader__option--selected{color:#1989fa;font-weight:600}.van-cascader__option--disabled{color:#c8c9cc;cursor:not-allowed}.van-cascader__option--disabled:active{background-color:initial}.van-cascader__options{-webkit-overflow-scrolling:touch;box-sizing:border-box;height:384px;overflow-y:auto;padding-top:6px} \ No newline at end of file diff --git a/src/miniprogram_npm/@vant/weapp/cell-group/index.d.ts b/src/miniprogram_npm/@vant/weapp/cell-group/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/cell-group/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/miniprogram_npm/@vant/weapp/cell-group/index.js b/src/miniprogram_npm/@vant/weapp/cell-group/index.js new file mode 100644 index 0000000..34a93a6 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/cell-group/index.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +(0, component_1.VantComponent)({ + props: { + title: String, + border: { + type: Boolean, + value: true, + }, + inset: Boolean, + }, +}); diff --git a/src/miniprogram_npm/@vant/weapp/cell-group/index.json b/src/miniprogram_npm/@vant/weapp/cell-group/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/cell-group/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/src/miniprogram_npm/@vant/weapp/cell-group/index.wxml b/src/miniprogram_npm/@vant/weapp/cell-group/index.wxml new file mode 100644 index 0000000..311e064 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/cell-group/index.wxml @@ -0,0 +1,11 @@ + + + + {{ title }} + + + + diff --git a/src/miniprogram_npm/@vant/weapp/cell-group/index.wxss b/src/miniprogram_npm/@vant/weapp/cell-group/index.wxss new file mode 100644 index 0000000..08b252f --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/cell-group/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-cell-group--inset{border-radius:var(--cell-group-inset-border-radius,8px);margin:var(--cell-group-inset-padding,0 16px);overflow:hidden}.van-cell-group__title{color:var(--cell-group-title-color,#969799);font-size:var(--cell-group-title-font-size,14px);line-height:var(--cell-group-title-line-height,16px);padding:var(--cell-group-title-padding,16px 16px 8px)}.van-cell-group__title--inset{padding:var(--cell-group-inset-title-padding,16px 16px 8px 32px)} \ No newline at end of file diff --git a/src/miniprogram_npm/@vant/weapp/cell/index.d.ts b/src/miniprogram_npm/@vant/weapp/cell/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/cell/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/miniprogram_npm/@vant/weapp/cell/index.js b/src/miniprogram_npm/@vant/weapp/cell/index.js new file mode 100644 index 0000000..80f3039 --- /dev/null +++ b/src/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"); +(0, 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/miniprogram_npm/@vant/weapp/cell/index.json b/src/miniprogram_npm/@vant/weapp/cell/index.json new file mode 100644 index 0000000..0a336c0 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/cell/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-icon": "../icon/index" + } +} diff --git a/src/miniprogram_npm/@vant/weapp/cell/index.wxml b/src/miniprogram_npm/@vant/weapp/cell/index.wxml new file mode 100644 index 0000000..8387c3c --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/cell/index.wxml @@ -0,0 +1,47 @@ + + + + + + + + + + {{ title }} + + + + + {{ label }} + + + + + {{ value }} + + + + + + + + diff --git a/src/miniprogram_npm/@vant/weapp/cell/index.wxs b/src/miniprogram_npm/@vant/weapp/cell/index.wxs new file mode 100644 index 0000000..e3500c4 --- /dev/null +++ b/src/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/miniprogram_npm/@vant/weapp/cell/index.wxss b/src/miniprogram_npm/@vant/weapp/cell/index.wxss new file mode 100644 index 0000000..1802f8e --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/cell/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-cell{background-color:var(--cell-background-color,#fff);box-sizing:border-box;color:var(--cell-text-color,#323233);display:flex;font-size:var(--cell-font-size,14px);line-height:var(--cell-line-height,24px);padding:var(--cell-vertical-padding,10px) var(--cell-horizontal-padding,16px);position:relative;width:100%}.van-cell:after{border-bottom:1px solid #ebedf0;bottom:0;box-sizing:border-box;content:" ";left:16px;pointer-events:none;position:absolute;right:16px;transform:scaleY(.5);transform-origin:center}.van-cell--borderless:after{display:none}.van-cell-group{background-color:var(--cell-background-color,#fff)}.van-cell__label{color:var(--cell-label-color,#969799);font-size:var(--cell-label-font-size,12px);line-height:var(--cell-label-line-height,18px);margin-top:var(--cell-label-margin-top,3px)}.van-cell__value{color:var(--cell-value-color,#969799);overflow:hidden;text-align:right;vertical-align:middle}.van-cell__title,.van-cell__value{flex:1}.van-cell__title:empty,.van-cell__value:empty{display:none}.van-cell__left-icon-wrap,.van-cell__right-icon-wrap{align-items:center;display:flex;font-size:var(--cell-icon-size,16px);height:var(--cell-line-height,24px)}.van-cell__left-icon-wrap{margin-right:var(--padding-base,4px)}.van-cell__right-icon-wrap{color:var(--cell-right-icon-color,#969799);margin-left:var(--padding-base,4px)}.van-cell__left-icon{vertical-align:middle}.van-cell__left-icon,.van-cell__right-icon{line-height:var(--cell-line-height,24px)}.van-cell--clickable.van-cell--hover{background-color:var(--cell-active-color,#f2f3f5)}.van-cell--required{overflow:visible}.van-cell--required:before{color:var(--cell-required-color,#ee0a24);content:"*";font-size:var(--cell-font-size,14px);left:var(--padding-xs,8px);position:absolute}.van-cell--center{align-items:center}.van-cell--large{padding-bottom:var(--cell-large-vertical-padding,12px);padding-top:var(--cell-large-vertical-padding,12px)}.van-cell--large .van-cell__title{font-size:var(--cell-large-title-font-size,16px)}.van-cell--large .van-cell__value{font-size:var(--cell-large-value-font-size,16px)}.van-cell--large .van-cell__label{font-size:var(--cell-large-label-font-size,14px)} \ No newline at end of file diff --git a/src/miniprogram_npm/@vant/weapp/checkbox-group/index.d.ts b/src/miniprogram_npm/@vant/weapp/checkbox-group/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/checkbox-group/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/miniprogram_npm/@vant/weapp/checkbox-group/index.js b/src/miniprogram_npm/@vant/weapp/checkbox-group/index.js new file mode 100644 index 0000000..80c93a1 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/checkbox-group/index.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var relation_1 = require("../common/relation"); +var component_1 = require("../common/component"); +(0, component_1.VantComponent)({ + field: true, + relation: (0, relation_1.useChildren)('checkbox', function (target) { + this.updateChild(target); + }), + props: { + max: Number, + value: { + type: Array, + observer: 'updateChildren', + }, + disabled: { + type: Boolean, + observer: 'updateChildren', + }, + direction: { + type: String, + value: 'vertical', + }, + }, + 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, direction = _a.direction; + child.setData({ + value: value.indexOf(child.data.name) !== -1, + parentDisabled: disabled, + direction: direction, + }); + }, + }, +}); diff --git a/src/miniprogram_npm/@vant/weapp/checkbox-group/index.json b/src/miniprogram_npm/@vant/weapp/checkbox-group/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/checkbox-group/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/src/miniprogram_npm/@vant/weapp/checkbox-group/index.wxml b/src/miniprogram_npm/@vant/weapp/checkbox-group/index.wxml new file mode 100644 index 0000000..638bf9d --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/checkbox-group/index.wxml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/miniprogram_npm/@vant/weapp/checkbox-group/index.wxss b/src/miniprogram_npm/@vant/weapp/checkbox-group/index.wxss new file mode 100644 index 0000000..c5666d7 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/checkbox-group/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-checkbox-group--horizontal{display:flex;flex-wrap:wrap} \ No newline at end of file diff --git a/src/miniprogram_npm/@vant/weapp/checkbox/index.d.ts b/src/miniprogram_npm/@vant/weapp/checkbox/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/checkbox/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/miniprogram_npm/@vant/weapp/checkbox/index.js b/src/miniprogram_npm/@vant/weapp/checkbox/index.js new file mode 100644 index 0000000..6247365 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/checkbox/index.js @@ -0,0 +1,79 @@ +"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); +} +(0, component_1.VantComponent)({ + field: true, + relation: (0, 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, + direction: 'vertical', + }, + 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/miniprogram_npm/@vant/weapp/checkbox/index.json b/src/miniprogram_npm/@vant/weapp/checkbox/index.json new file mode 100644 index 0000000..0a336c0 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/checkbox/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-icon": "../icon/index" + } +} diff --git a/src/miniprogram_npm/@vant/weapp/checkbox/index.wxml b/src/miniprogram_npm/@vant/weapp/checkbox/index.wxml new file mode 100644 index 0000000..39a7bb0 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/checkbox/index.wxml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + diff --git a/src/miniprogram_npm/@vant/weapp/checkbox/index.wxs b/src/miniprogram_npm/@vant/weapp/checkbox/index.wxs new file mode 100644 index 0000000..eb9c772 --- /dev/null +++ b/src/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/miniprogram_npm/@vant/weapp/checkbox/index.wxss b/src/miniprogram_npm/@vant/weapp/checkbox/index.wxss new file mode 100644 index 0000000..da2272a --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/checkbox/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-checkbox{align-items:center;display:flex;overflow:hidden;-webkit-user-select:none;user-select:none}.van-checkbox--horizontal{margin-right:12px}.van-checkbox__icon-wrap,.van-checkbox__label{line-height:var(--checkbox-size,20px)}.van-checkbox__icon-wrap{flex:none}.van-checkbox__icon{align-items:center;border:1px solid var(--checkbox-border-color,#c8c9cc);box-sizing:border-box;color:transparent;display:flex;font-size:var(--checkbox-size,20px);height:1em;justify-content:center;text-align:center;transition-duration:var(--checkbox-transition-duration,.2s);transition-property:color,border-color,background-color;width:1em}.van-checkbox__icon--round{border-radius:100%}.van-checkbox__icon--checked{background-color:var(--checkbox-checked-icon-color,#1989fa);border-color:var(--checkbox-checked-icon-color,#1989fa);color:#fff}.van-checkbox__icon--disabled{background-color:var(--checkbox-disabled-background-color,#ebedf0);border-color:var(--checkbox-disabled-icon-color,#c8c9cc)}.van-checkbox__icon--disabled.van-checkbox__icon--checked{color:var(--checkbox-disabled-icon-color,#c8c9cc)}.van-checkbox__label{word-wrap:break-word;color:var(--checkbox-label-color,#323233);padding-left:var(--checkbox-label-margin,10px)}.van-checkbox__label--left{float:left;margin:0 var(--checkbox-label-margin,10px) 0 0}.van-checkbox__label--disabled{color:var(--checkbox-disabled-label-color,#c8c9cc)}.van-checkbox__label:empty{margin:0} \ No newline at end of file diff --git a/src/miniprogram_npm/@vant/weapp/circle/canvas.d.ts b/src/miniprogram_npm/@vant/weapp/circle/canvas.d.ts new file mode 100644 index 0000000..8a0b71e --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/circle/canvas.d.ts @@ -0,0 +1,4 @@ +/// +type CanvasContext = WechatMiniprogram.CanvasContext; +export declare function adaptor(ctx: CanvasContext & Record): CanvasContext; +export {}; diff --git a/src/miniprogram_npm/@vant/weapp/circle/canvas.js b/src/miniprogram_npm/@vant/weapp/circle/canvas.js new file mode 100644 index 0000000..d81df74 --- /dev/null +++ b/src/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/miniprogram_npm/@vant/weapp/circle/index.d.ts b/src/miniprogram_npm/@vant/weapp/circle/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/circle/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/miniprogram_npm/@vant/weapp/circle/index.js b/src/miniprogram_npm/@vant/weapp/circle/index.js new file mode 100644 index 0000000..e131e4b --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/circle/index.js @@ -0,0 +1,207 @@ +"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; +(0, 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 === '' || !(0, version_1.canIUseCanvas2d)()) { + var ctx = wx.createCanvasContext('van-circle', this); + return Promise.resolve(ctx); + } + var dpr = (0, 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((0, canvas_1.adaptor)(ctx)); + }); + }); + }, + setHoverColor: function () { + var _this = this; + var _a = this.data, color = _a.color, size = _a.size; + if ((0, validator_1.isObj)(color)) { + return this.getContext().then(function (context) { + if (!context) + return; + 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) { + if (!context) + return; + 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.clearMockInterval(); + this.currentValue = this.currentValue || 0; + var run = function () { + _this.interval = setTimeout(function () { + if (_this.currentValue !== value) { + if (Math.abs(_this.currentValue - value) < STEP) { + _this.currentValue = value; + } + else if (_this.currentValue < value) { + _this.currentValue += STEP; + } + else { + _this.currentValue -= STEP; + } + _this.drawCircle(_this.currentValue); + run(); + } + else { + _this.clearMockInterval(); + } + }, 1000 / speed); + }; + run(); + }, + clearMockInterval: function () { + if (this.interval) { + clearTimeout(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.clearMockInterval(); + }, +}); diff --git a/src/miniprogram_npm/@vant/weapp/circle/index.json b/src/miniprogram_npm/@vant/weapp/circle/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/circle/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/src/miniprogram_npm/@vant/weapp/circle/index.wxml b/src/miniprogram_npm/@vant/weapp/circle/index.wxml new file mode 100644 index 0000000..52bc59f --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/circle/index.wxml @@ -0,0 +1,9 @@ + + + + + + + + {{ text }} + diff --git a/src/miniprogram_npm/@vant/weapp/circle/index.wxss b/src/miniprogram_npm/@vant/weapp/circle/index.wxss new file mode 100644 index 0000000..2200751 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/circle/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-circle{display:inline-block;position:relative;text-align:center}.van-circle__text{color:var(--circle-text-color,#323233);left:0;position:absolute;top:50%;transform:translateY(-50%);width:100%} \ No newline at end of file diff --git a/src/miniprogram_npm/@vant/weapp/col/index.d.ts b/src/miniprogram_npm/@vant/weapp/col/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/col/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/miniprogram_npm/@vant/weapp/col/index.js b/src/miniprogram_npm/@vant/weapp/col/index.js new file mode 100644 index 0000000..63c56eb --- /dev/null +++ b/src/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"); +(0, component_1.VantComponent)({ + relation: (0, relation_1.useParent)('row'), + props: { + span: Number, + offset: Number, + }, +}); diff --git a/src/miniprogram_npm/@vant/weapp/col/index.json b/src/miniprogram_npm/@vant/weapp/col/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/col/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/src/miniprogram_npm/@vant/weapp/col/index.wxml b/src/miniprogram_npm/@vant/weapp/col/index.wxml new file mode 100644 index 0000000..975348b --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/col/index.wxml @@ -0,0 +1,9 @@ + + + + + + diff --git a/src/miniprogram_npm/@vant/weapp/col/index.wxs b/src/miniprogram_npm/@vant/weapp/col/index.wxs new file mode 100644 index 0000000..507c1cb --- /dev/null +++ b/src/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/miniprogram_npm/@vant/weapp/col/index.wxss b/src/miniprogram_npm/@vant/weapp/col/index.wxss new file mode 100644 index 0000000..2fa265e --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/col/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-col{box-sizing:border-box;float:left}.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/miniprogram_npm/@vant/weapp/collapse-item/animate.d.ts b/src/miniprogram_npm/@vant/weapp/collapse-item/animate.d.ts new file mode 100644 index 0000000..32157b6 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/collapse-item/animate.d.ts @@ -0,0 +1,2 @@ +/// +export declare function setContentAnimate(context: WechatMiniprogram.Component.TrivialInstance, expanded: boolean, mounted: boolean): void; diff --git a/src/miniprogram_npm/@vant/weapp/collapse-item/animate.js b/src/miniprogram_npm/@vant/weapp/collapse-item/animate.js new file mode 100644 index 0000000..5734087 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/collapse-item/animate.js @@ -0,0 +1,43 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.setContentAnimate = void 0; +var utils_1 = require("../common/utils"); +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) { + (0, utils_1.getRect)(context, '.van-collapse-item__content') + .then(function (rect) { return rect.height; }) + .then(function (height) { + useAnimation(context, expanded, mounted, height); + }); +} +exports.setContentAnimate = setContentAnimate; diff --git a/src/miniprogram_npm/@vant/weapp/collapse-item/index.d.ts b/src/miniprogram_npm/@vant/weapp/collapse-item/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/collapse-item/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/miniprogram_npm/@vant/weapp/collapse-item/index.js b/src/miniprogram_npm/@vant/weapp/collapse-item/index.js new file mode 100644 index 0000000..982490e --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/collapse-item/index.js @@ -0,0 +1,62 @@ +"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"); +(0, component_1.VantComponent)({ + classes: ['title-class', 'content-class'], + relation: (0, relation_1.useParent)('collapse'), + props: { + size: String, + 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) { + (0, 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/miniprogram_npm/@vant/weapp/collapse-item/index.json b/src/miniprogram_npm/@vant/weapp/collapse-item/index.json new file mode 100644 index 0000000..0e5425c --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/collapse-item/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-cell": "../cell/index" + } +} diff --git a/src/miniprogram_npm/@vant/weapp/collapse-item/index.wxml b/src/miniprogram_npm/@vant/weapp/collapse-item/index.wxml new file mode 100644 index 0000000..f11d0d4 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/collapse-item/index.wxml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + diff --git a/src/miniprogram_npm/@vant/weapp/collapse-item/index.wxss b/src/miniprogram_npm/@vant/weapp/collapse-item/index.wxss new file mode 100644 index 0000000..4a65b5a --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/collapse-item/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-collapse-item__title .van-cell__right-icon{transform:rotate(90deg);transition:transform var(--collapse-item-transition-duration,.3s)}.van-collapse-item__title--expanded .van-cell__right-icon{transform:rotate(-90deg)}.van-collapse-item__title--disabled .van-cell,.van-collapse-item__title--disabled .van-cell__right-icon{color:var(--collapse-item-title-disabled-color,#c8c9cc)!important}.van-collapse-item__title--disabled .van-cell--hover{background-color:#fff!important}.van-collapse-item__wrapper{overflow:hidden}.van-collapse-item__content{background-color:var(--collapse-item-content-background-color,#fff);color:var(--collapse-item-content-text-color,#969799);font-size:var(--collapse-item-content-font-size,13px);line-height:var(--collapse-item-content-line-height,1.5);padding:var(--collapse-item-content-padding,15px)} \ No newline at end of file diff --git a/src/miniprogram_npm/@vant/weapp/collapse/index.d.ts b/src/miniprogram_npm/@vant/weapp/collapse/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/collapse/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/miniprogram_npm/@vant/weapp/collapse/index.js b/src/miniprogram_npm/@vant/weapp/collapse/index.js new file mode 100644 index 0000000..943d542 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/collapse/index.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +var relation_1 = require("../common/relation"); +(0, component_1.VantComponent)({ + relation: (0, 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/miniprogram_npm/@vant/weapp/collapse/index.json b/src/miniprogram_npm/@vant/weapp/collapse/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/collapse/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/src/miniprogram_npm/@vant/weapp/collapse/index.wxml b/src/miniprogram_npm/@vant/weapp/collapse/index.wxml new file mode 100644 index 0000000..fd4e171 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/collapse/index.wxml @@ -0,0 +1,3 @@ + + + diff --git a/src/miniprogram_npm/@vant/weapp/collapse/index.wxss b/src/miniprogram_npm/@vant/weapp/collapse/index.wxss new file mode 100644 index 0000000..99694d6 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/collapse/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss'; \ No newline at end of file diff --git a/src/miniprogram_npm/@vant/weapp/common/color.d.ts b/src/miniprogram_npm/@vant/weapp/common/color.d.ts new file mode 100644 index 0000000..386f307 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/common/color.d.ts @@ -0,0 +1,7 @@ +export declare const RED = "#ee0a24"; +export declare const BLUE = "#1989fa"; +export declare const WHITE = "#fff"; +export declare const GREEN = "#07c160"; +export declare const ORANGE = "#ff976a"; +export declare const GRAY = "#323233"; +export declare const GRAY_DARK = "#969799"; diff --git a/src/miniprogram_npm/@vant/weapp/common/color.js b/src/miniprogram_npm/@vant/weapp/common/color.js new file mode 100644 index 0000000..008a45a --- /dev/null +++ b/src/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/miniprogram_npm/@vant/weapp/common/component.d.ts b/src/miniprogram_npm/@vant/weapp/common/component.d.ts new file mode 100644 index 0000000..1d0fd27 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/common/component.d.ts @@ -0,0 +1,4 @@ +/// +import { VantComponentOptions } from 'definitions/index'; +declare function VantComponent(vantOptions: VantComponentOptions): void; +export { VantComponent }; diff --git a/src/miniprogram_npm/@vant/weapp/common/component.js b/src/miniprogram_npm/@vant/weapp/common/component.js new file mode 100644 index 0000000..66da00e --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/common/component.js @@ -0,0 +1,49 @@ +"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', + watch: 'observers', + 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/miniprogram_npm/@vant/weapp/common/index.wxss b/src/miniprogram_npm/@vant/weapp/common/index.wxss new file mode 100644 index 0000000..a73bb7a --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/common/index.wxss @@ -0,0 +1 @@ +.van-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden;text-overflow:ellipsis}.van-multi-ellipsis--l3{-webkit-line-clamp:3}.van-clearfix:after{clear:both;content:"";display:table}.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{border:0 solid #ebedf0;bottom:-50%;box-sizing:border-box;content:" ";left:-50%;pointer-events:none;position:absolute;right:-50%;top:-50%;transform:scale(.5);transform-origin:center}.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/miniprogram_npm/@vant/weapp/common/relation.d.ts b/src/miniprogram_npm/@vant/weapp/common/relation.d.ts new file mode 100644 index 0000000..10193fa --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/common/relation.d.ts @@ -0,0 +1,15 @@ +/// +type TrivialInstance = WechatMiniprogram.Component.TrivialInstance; +export declare function useParent(name: string, onEffect?: (this: TrivialInstance) => void): { + relations: { + [x: string]: WechatMiniprogram.Component.RelationOption; + }; + mixin: string; +}; +export declare function useChildren(name: string, onEffect?: (this: TrivialInstance, target: TrivialInstance) => void): { + relations: { + [x: string]: WechatMiniprogram.Component.RelationOption; + }; + mixin: string; +}; +export {}; diff --git a/src/miniprogram_npm/@vant/weapp/common/relation.js b/src/miniprogram_npm/@vant/weapp/common/relation.js new file mode 100644 index 0000000..008256c --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/common/relation.js @@ -0,0 +1,65 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.useChildren = exports.useParent = void 0; +function useParent(name, onEffect) { + var _a; + var path = "../".concat(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 = "../".concat(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/miniprogram_npm/@vant/weapp/common/style/clearfix.wxss b/src/miniprogram_npm/@vant/weapp/common/style/clearfix.wxss new file mode 100644 index 0000000..442246f --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/common/style/clearfix.wxss @@ -0,0 +1 @@ +.van-clearfix:after{clear:both;content:"";display:table} \ No newline at end of file diff --git a/src/miniprogram_npm/@vant/weapp/common/style/ellipsis.wxss b/src/miniprogram_npm/@vant/weapp/common/style/ellipsis.wxss new file mode 100644 index 0000000..ee701df --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/common/style/ellipsis.wxss @@ -0,0 +1 @@ +.van-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden;text-overflow:ellipsis}.van-multi-ellipsis--l3{-webkit-line-clamp:3} \ No newline at end of file diff --git a/src/miniprogram_npm/@vant/weapp/common/style/hairline.wxss b/src/miniprogram_npm/@vant/weapp/common/style/hairline.wxss new file mode 100644 index 0000000..f7c6260 --- /dev/null +++ b/src/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{border:0 solid #ebedf0;bottom:-50%;box-sizing:border-box;content:" ";left:-50%;pointer-events:none;position:absolute;right:-50%;top:-50%;transform:scale(.5);transform-origin:center}.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/miniprogram_npm/@vant/weapp/common/style/mixins/clearfix.wxss b/src/miniprogram_npm/@vant/weapp/common/style/mixins/clearfix.wxss new file mode 100644 index 0000000..e69de29 diff --git a/src/miniprogram_npm/@vant/weapp/common/style/mixins/ellipsis.wxss b/src/miniprogram_npm/@vant/weapp/common/style/mixins/ellipsis.wxss new file mode 100644 index 0000000..e69de29 diff --git a/src/miniprogram_npm/@vant/weapp/common/style/mixins/hairline.wxss b/src/miniprogram_npm/@vant/weapp/common/style/mixins/hairline.wxss new file mode 100644 index 0000000..e69de29 diff --git a/src/miniprogram_npm/@vant/weapp/common/style/var.wxss b/src/miniprogram_npm/@vant/weapp/common/style/var.wxss new file mode 100644 index 0000000..e69de29 diff --git a/src/miniprogram_npm/@vant/weapp/common/utils.d.ts b/src/miniprogram_npm/@vant/weapp/common/utils.d.ts new file mode 100644 index 0000000..a77d8c6 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/common/utils.d.ts @@ -0,0 +1,21 @@ +/// +/// +/// +/// +/// +export { isDef } from './validator'; +export { getSystemInfoSync } from './version'; +export declare function range(num: number, min: number, max: number): number; +export declare function nextTick(cb: (...args: any[]) => void): void; +export declare function addUnit(value?: string | number): string | undefined; +export declare function requestAnimationFrame(cb: () => void): NodeJS.Timeout; +export declare function pickExclude(obj: unknown, keys: string[]): {}; +export declare function getRect(context: WechatMiniprogram.Component.TrivialInstance, selector: string): Promise; +export declare function getAllRect(context: WechatMiniprogram.Component.TrivialInstance, selector: string): Promise; +export declare function groupSetData(context: WechatMiniprogram.Component.TrivialInstance, cb: () => void): void; +export declare function toPromise(promiseLike: Promise | unknown): Promise; +export declare function addNumber(num1: any, num2: any): number; +export declare const clamp: (num: any, min: any, max: any) => number; +export declare function getCurrentPage(): T & WechatMiniprogram.OptionalInterface & WechatMiniprogram.Page.InstanceProperties & WechatMiniprogram.Page.InstanceMethods & WechatMiniprogram.Page.Data & WechatMiniprogram.IAnyObject; +export declare const isPC: boolean; +export declare const isWxWork: boolean; diff --git a/src/miniprogram_npm/@vant/weapp/common/utils.js b/src/miniprogram_npm/@vant/weapp/common/utils.js new file mode 100644 index 0000000..1727628 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/common/utils.js @@ -0,0 +1,109 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isWxWork = exports.isPC = exports.getCurrentPage = exports.clamp = exports.addNumber = exports.toPromise = exports.groupSetData = exports.getAllRect = exports.getRect = exports.pickExclude = exports.requestAnimationFrame = exports.addUnit = exports.nextTick = exports.range = exports.getSystemInfoSync = exports.isDef = void 0; +var validator_1 = require("./validator"); +var version_1 = require("./version"); +var validator_2 = require("./validator"); +Object.defineProperty(exports, "isDef", { enumerable: true, get: function () { return validator_2.isDef; } }); +var version_2 = require("./version"); +Object.defineProperty(exports, "getSystemInfoSync", { enumerable: true, get: function () { return version_2.getSystemInfoSync; } }); +function range(num, min, max) { + return Math.min(Math.max(num, min), max); +} +exports.range = range; +function nextTick(cb) { + if ((0, version_1.canIUseNextTick)()) { + wx.nextTick(cb); + } + else { + setTimeout(function () { + cb(); + }, 1000 / 30); + } +} +exports.nextTick = nextTick; +function addUnit(value) { + if (!(0, validator_1.isDef)(value)) { + return undefined; + } + value = String(value); + return (0, validator_1.isNumber)(value) ? "".concat(value, "px") : value; +} +exports.addUnit = addUnit; +function requestAnimationFrame(cb) { + return setTimeout(function () { + cb(); + }, 1000 / 30); +} +exports.requestAnimationFrame = requestAnimationFrame; +function pickExclude(obj, keys) { + if (!(0, 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 ((0, version_1.canIUseGroupSetData)()) { + context.groupSetData(cb); + } + else { + cb(); + } +} +exports.groupSetData = groupSetData; +function toPromise(promiseLike) { + if ((0, validator_1.isPromise)(promiseLike)) { + return promiseLike; + } + return Promise.resolve(promiseLike); +} +exports.toPromise = toPromise; +// 浮点数精度处理 +function addNumber(num1, num2) { + var cardinal = Math.pow(10, 10); + return Math.round((num1 + num2) * cardinal) / cardinal; +} +exports.addNumber = addNumber; +// 限制value在[min, max]之间 +var clamp = function (num, min, max) { return Math.min(Math.max(num, min), max); }; +exports.clamp = clamp; +function getCurrentPage() { + var pages = getCurrentPages(); + return pages[pages.length - 1]; +} +exports.getCurrentPage = getCurrentPage; +exports.isPC = ['mac', 'windows'].includes((0, version_1.getSystemInfoSync)().platform); +// 是否企业微信 +exports.isWxWork = (0, version_1.getSystemInfoSync)().environment === 'wxwork'; diff --git a/src/miniprogram_npm/@vant/weapp/common/validator.d.ts b/src/miniprogram_npm/@vant/weapp/common/validator.d.ts new file mode 100644 index 0000000..152894a --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/common/validator.d.ts @@ -0,0 +1,9 @@ +export declare function isFunction(val: unknown): val is Function; +export declare function isPlainObject(val: unknown): val is Record; +export declare function isPromise(val: unknown): val is Promise; +export declare function isDef(value: unknown): boolean; +export declare function isObj(x: unknown): x is Record; +export declare function isNumber(value: string): boolean; +export declare function isBoolean(value: unknown): value is boolean; +export declare function isImageUrl(url: string): boolean; +export declare function isVideoUrl(url: string): boolean; diff --git a/src/miniprogram_npm/@vant/weapp/common/validator.js b/src/miniprogram_npm/@vant/weapp/common/validator.js new file mode 100644 index 0000000..169e796 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/common/validator.js @@ -0,0 +1,43 @@ +"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; +// eslint-disable-next-line @typescript-eslint/ban-types +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/miniprogram_npm/@vant/weapp/common/version.d.ts b/src/miniprogram_npm/@vant/weapp/common/version.d.ts new file mode 100644 index 0000000..3393221 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/common/version.d.ts @@ -0,0 +1,15 @@ +/// +interface WxWorkSystemInfo extends WechatMiniprogram.SystemInfo { + environment?: 'wxwork'; +} +interface SystemInfo extends WxWorkSystemInfo, WechatMiniprogram.SystemInfo { +} +export declare function getSystemInfoSync(): SystemInfo; +export declare function canIUseModel(): boolean; +export declare function canIUseFormFieldButton(): boolean; +export declare function canIUseAnimate(): boolean; +export declare function canIUseGroupSetData(): boolean; +export declare function canIUseNextTick(): boolean; +export declare function canIUseCanvas2d(): boolean; +export declare function canIUseGetUserProfile(): boolean; +export {}; diff --git a/src/miniprogram_npm/@vant/weapp/common/version.js b/src/miniprogram_npm/@vant/weapp/common/version.js new file mode 100644 index 0000000..5937008 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/common/version.js @@ -0,0 +1,70 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.canIUseGetUserProfile = exports.canIUseCanvas2d = exports.canIUseNextTick = exports.canIUseGroupSetData = exports.canIUseAnimate = exports.canIUseFormFieldButton = exports.canIUseModel = exports.getSystemInfoSync = void 0; +var systemInfo; +function getSystemInfoSync() { + if (systemInfo == null) { + systemInfo = wx.getSystemInfoSync(); + } + return systemInfo; +} +exports.getSystemInfoSync = getSystemInfoSync; +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 = 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() { + try { + return wx.canIUse('nextTick'); + } + catch (e) { + return gte('2.7.1'); + } +} +exports.canIUseNextTick = canIUseNextTick; +function canIUseCanvas2d() { + return gte('2.9.0'); +} +exports.canIUseCanvas2d = canIUseCanvas2d; +function canIUseGetUserProfile() { + return !!wx.getUserProfile; +} +exports.canIUseGetUserProfile = canIUseGetUserProfile; diff --git a/src/miniprogram_npm/@vant/weapp/config-provider/index.d.ts b/src/miniprogram_npm/@vant/weapp/config-provider/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/config-provider/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/miniprogram_npm/@vant/weapp/config-provider/index.js b/src/miniprogram_npm/@vant/weapp/config-provider/index.js new file mode 100644 index 0000000..21fb1c4 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/config-provider/index.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +(0, component_1.VantComponent)({ + props: { + themeVars: { + type: Object, + value: {}, + }, + }, +}); diff --git a/src/miniprogram_npm/@vant/weapp/config-provider/index.json b/src/miniprogram_npm/@vant/weapp/config-provider/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/config-provider/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/src/miniprogram_npm/@vant/weapp/config-provider/index.wxml b/src/miniprogram_npm/@vant/weapp/config-provider/index.wxml new file mode 100644 index 0000000..3cfb461 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/config-provider/index.wxml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/miniprogram_npm/@vant/weapp/config-provider/index.wxs b/src/miniprogram_npm/@vant/weapp/config-provider/index.wxs new file mode 100644 index 0000000..7ca0203 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/config-provider/index.wxs @@ -0,0 +1,29 @@ +/* eslint-disable */ +var object = require('../wxs/object.wxs'); +var style = require('../wxs/style.wxs'); + +function kebabCase(word) { + var newWord = word + .replace(getRegExp("[A-Z]", 'g'), function (i) { + return '-' + i; + }) + .toLowerCase() + .replace(getRegExp("^-"), ''); + + return newWord; +} + +function mapThemeVarsToCSSVars(themeVars) { + var cssVars = {}; + object.keys(themeVars).forEach(function (key) { + var cssVarsKey = '--' + kebabCase(key); + cssVars[cssVarsKey] = themeVars[key]; + }); + + return style(cssVars); +} + +module.exports = { + kebabCase: kebabCase, + mapThemeVarsToCSSVars: mapThemeVarsToCSSVars, +}; diff --git a/src/miniprogram_npm/@vant/weapp/count-down/index.d.ts b/src/miniprogram_npm/@vant/weapp/count-down/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/count-down/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/miniprogram_npm/@vant/weapp/count-down/index.js b/src/miniprogram_npm/@vant/weapp/count-down/index.js new file mode 100644 index 0000000..afc780b --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/count-down/index.js @@ -0,0 +1,104 @@ +"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); +} +(0, 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: (0, 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 (!(0, 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 = (0, utils_1.parseTimeData)(remain); + if (this.data.useSlot) { + this.$emit('change', timeData); + } + this.setData({ + formattedTime: (0, utils_1.parseFormat)(this.data.format, timeData), + }); + if (remain === 0) { + this.pause(); + this.$emit('finish'); + } + }, + }, +}); diff --git a/src/miniprogram_npm/@vant/weapp/count-down/index.json b/src/miniprogram_npm/@vant/weapp/count-down/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/count-down/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/src/miniprogram_npm/@vant/weapp/count-down/index.wxml b/src/miniprogram_npm/@vant/weapp/count-down/index.wxml new file mode 100644 index 0000000..e206e16 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/count-down/index.wxml @@ -0,0 +1,4 @@ + + + {{ formattedTime }} + diff --git a/src/miniprogram_npm/@vant/weapp/count-down/index.wxss b/src/miniprogram_npm/@vant/weapp/count-down/index.wxss new file mode 100644 index 0000000..8b957f7 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/count-down/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-count-down{color:var(--count-down-text-color,#323233);font-size:var(--count-down-font-size,14px);line-height:var(--count-down-line-height,20px)} \ No newline at end of file diff --git a/src/miniprogram_npm/@vant/weapp/count-down/utils.d.ts b/src/miniprogram_npm/@vant/weapp/count-down/utils.d.ts new file mode 100644 index 0000000..876a6c1 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/count-down/utils.d.ts @@ -0,0 +1,10 @@ +export type TimeData = { + days: number; + hours: number; + minutes: number; + seconds: number; + milliseconds: number; +}; +export declare function parseTimeData(time: number): TimeData; +export declare function parseFormat(format: string, timeData: TimeData): string; +export declare function isSameSecond(time1: number, time2: number): boolean; diff --git a/src/miniprogram_npm/@vant/weapp/count-down/utils.js b/src/miniprogram_npm/@vant/weapp/count-down/utils.js new file mode 100644 index 0000000..a7cfa5f --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/count-down/utils.js @@ -0,0 +1,64 @@ +"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/miniprogram_npm/@vant/weapp/datetime-picker/index.d.ts b/src/miniprogram_npm/@vant/weapp/datetime-picker/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/datetime-picker/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/miniprogram_npm/@vant/weapp/datetime-picker/index.js b/src/miniprogram_npm/@vant/weapp/datetime-picker/index.js new file mode 100644 index 0000000..e30afef --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/datetime-picker/index.js @@ -0,0 +1,329 @@ +"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 __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +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 (0, 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".concat(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; }; +(0, 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; + this.updateColumnValue(val).then(function () { + if (!isEqual) { + _this.$emit('input', val); + } + }); + }, + 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, __spreadArray(__spreadArray([], args, true), [false], 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; + return type === 'year' ? "".concat(value) : padZero(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 = "".concat(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 "".concat(hour, ":").concat(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["".concat(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["".concat(type, "Year")] = year, + _a["".concat(type, "Month")] = month, + _a["".concat(type, "Date")] = date, + _a["".concat(type, "Hour")] = hour, + _a["".concat(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 = "".concat(+originColumns[0].values[indexes[0]], ":").concat(+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', "".concat(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/miniprogram_npm/@vant/weapp/datetime-picker/index.json b/src/miniprogram_npm/@vant/weapp/datetime-picker/index.json new file mode 100644 index 0000000..a778e91 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/datetime-picker/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-picker": "../picker/index" + } +} diff --git a/src/miniprogram_npm/@vant/weapp/datetime-picker/index.wxml b/src/miniprogram_npm/@vant/weapp/datetime-picker/index.wxml new file mode 100644 index 0000000..ade2202 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/datetime-picker/index.wxml @@ -0,0 +1,16 @@ + diff --git a/src/miniprogram_npm/@vant/weapp/datetime-picker/index.wxss b/src/miniprogram_npm/@vant/weapp/datetime-picker/index.wxss new file mode 100644 index 0000000..99694d6 --- /dev/null +++ b/src/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/miniprogram_npm/@vant/weapp/definitions/index.d.ts b/src/miniprogram_npm/@vant/weapp/definitions/index.d.ts new file mode 100644 index 0000000..d0554f6 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/definitions/index.d.ts @@ -0,0 +1,28 @@ +/// +interface VantComponentInstance { + parent: WechatMiniprogram.Component.TrivialInstance; + children: WechatMiniprogram.Component.TrivialInstance[]; + index: number; + $emit: (name: string, detail?: unknown, options?: WechatMiniprogram.Component.TriggerEventOption) => void; +} +export type VantComponentOptions = { + data?: Data; + field?: boolean; + classes?: string[]; + mixins?: string[]; + props?: Props; + relation?: { + relations: Record; + mixin: string; + }; + watch?: Record any>; + methods?: Methods; + beforeCreate?: () => void; + created?: () => void; + mounted?: () => void; + destroyed?: () => void; +} & ThisType, Props, Methods> & Record>; +export {}; diff --git a/src/miniprogram_npm/@vant/weapp/definitions/index.js b/src/miniprogram_npm/@vant/weapp/definitions/index.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/definitions/index.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/src/miniprogram_npm/@vant/weapp/dialog/dialog.d.ts b/src/miniprogram_npm/@vant/weapp/dialog/dialog.d.ts new file mode 100644 index 0000000..db2da5f --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/dialog/dialog.d.ts @@ -0,0 +1,55 @@ +/// +/// +export type Action = 'confirm' | 'cancel' | 'overlay'; +type DialogContext = WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance; +interface DialogOptions { + lang?: string; + show?: boolean; + title?: string; + width?: string | number | null; + zIndex?: number; + theme?: string; + context?: (() => DialogContext) | DialogContext; + message?: string; + overlay?: boolean; + selector?: string; + ariaLabel?: string; + /** + * @deprecated use custom-class instead + */ + className?: string; + customStyle?: string; + transition?: string; + /** + * @deprecated use beforeClose instead + */ + asyncClose?: boolean; + beforeClose?: null | ((action: Action) => Promise | void); + businessId?: number; + sessionFrom?: string; + overlayStyle?: string; + appParameter?: string; + messageAlign?: string; + sendMessageImg?: string; + showMessageCard?: boolean; + sendMessagePath?: string; + sendMessageTitle?: string; + confirmButtonText?: string; + cancelButtonText?: string; + showConfirmButton?: boolean; + showCancelButton?: boolean; + closeOnClickOverlay?: boolean; + confirmButtonOpenType?: string; +} +declare const Dialog: { + (options: DialogOptions): Promise; + alert(options: DialogOptions): Promise; + confirm(options: DialogOptions): Promise; + close(): void; + stopLoading(): void; + currentOptions: DialogOptions; + defaultOptions: DialogOptions; + setDefaultOptions(options: DialogOptions): void; + resetDefaultOptions(): void; +}; +export default Dialog; diff --git a/src/miniprogram_npm/@vant/weapp/dialog/dialog.js b/src/miniprogram_npm/@vant/weapp/dialog/dialog.js new file mode 100644 index 0000000..400f4f1 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/dialog/dialog.js @@ -0,0 +1,92 @@ +"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 = (typeof options.context === 'function' + ? options.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/miniprogram_npm/@vant/weapp/dialog/index.d.ts b/src/miniprogram_npm/@vant/weapp/dialog/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/dialog/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/miniprogram_npm/@vant/weapp/dialog/index.js b/src/miniprogram_npm/@vant/weapp/dialog/index.js new file mode 100644 index 0000000..f10f50f --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/dialog/index.js @@ -0,0 +1,131 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +var button_1 = require("../mixins/button"); +var color_1 = require("../common/color"); +var utils_1 = require("../common/utils"); +(0, component_1.VantComponent)({ + mixins: [button_1.button], + classes: ['cancle-button-class', 'confirm-button-class'], + props: { + show: { + type: Boolean, + observer: function (show) { + !show && this.stopLoading(); + }, + }, + title: String, + message: String, + theme: { + type: String, + value: 'default', + }, + confirmButtonId: String, + className: String, + customStyle: String, + asyncClose: Boolean, + messageAlign: String, + beforeClose: null, + overlayStyle: String, + useSlot: Boolean, + useTitleSlot: Boolean, + useConfirmButtonSlot: Boolean, + useCancelButtonSlot: 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.".concat(action)] = true, + _a)); + if (beforeClose) { + (0, utils_1.toPromise)(beforeClose(action)).then(function (value) { + if (value) { + _this.close(action); + } + else { + _this.stopLoading(); + } + }); + } + }, + }, +}); diff --git a/src/miniprogram_npm/@vant/weapp/dialog/index.json b/src/miniprogram_npm/@vant/weapp/dialog/index.json new file mode 100644 index 0000000..43417fc --- /dev/null +++ b/src/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/miniprogram_npm/@vant/weapp/dialog/index.wxml b/src/miniprogram_npm/@vant/weapp/dialog/index.wxml new file mode 100644 index 0000000..7cf12d8 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/dialog/index.wxml @@ -0,0 +1,124 @@ + + + + + + {{ title }} + + + + + {{ message }} + + + + + {{ cancelButtonText }} + + + {{ confirmButtonText }} + + + + + + + + + {{ cancelButtonText }} + + + + + + + + {{ confirmButtonText }} + + + + diff --git a/src/miniprogram_npm/@vant/weapp/dialog/index.wxss b/src/miniprogram_npm/@vant/weapp/dialog/index.wxss new file mode 100644 index 0000000..507a789 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/dialog/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-dialog{background-color:var(--dialog-background-color,#fff);border-radius:var(--dialog-border-radius,16px);font-size:var(--dialog-font-size,16px);overflow:hidden;top:45%!important;width:var(--dialog-width,320px)}@media (max-width:321px){.van-dialog{width:var(--dialog-small-screen-width,90%)}}.van-dialog__header{font-weight:var(--dialog-header-font-weight,500);line-height:var(--dialog-header-line-height,24px);padding-top:var(--dialog-header-padding-top,24px);text-align:center}.van-dialog__header--isolated{padding:var(--dialog-header-isolated-padding,24px 0)}.van-dialog__message{-webkit-overflow-scrolling:touch;font-size:var(--dialog-message-font-size,14px);line-height:var(--dialog-message-line-height,20px);max-height:var(--dialog-message-max-height,60vh);overflow-y:auto;padding:var(--dialog-message-padding,24px);text-align:center}.van-dialog__message-text{word-wrap:break-word}.van-dialog__message--hasTitle{color:var(--dialog-has-title-message-text-color,#646566);padding-top:var(--dialog-has-title-message-padding-top,8px)}.van-dialog__message--round-button{color:#323233;padding-bottom:16px}.van-dialog__message--left{text-align:left}.van-dialog__message--right{text-align:right}.van-dialog__message--justify{text-align:justify}.van-dialog__footer{display:flex}.van-dialog__footer--round-button{padding:8px 24px 16px!important;position:relative!important}.van-dialog__button{flex:1}.van-dialog__cancel,.van-dialog__confirm{border:0!important}.van-dialog-bounce-enter{opacity:0;transform:translate3d(-50%,-50%,0) scale(.7)}.van-dialog-bounce-leave-active{opacity:0;transform:translate3d(-50%,-50%,0) scale(.9)} \ No newline at end of file diff --git a/src/miniprogram_npm/@vant/weapp/divider/index.d.ts b/src/miniprogram_npm/@vant/weapp/divider/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/divider/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/miniprogram_npm/@vant/weapp/divider/index.js b/src/miniprogram_npm/@vant/weapp/divider/index.js new file mode 100644 index 0000000..5c63844 --- /dev/null +++ b/src/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"); +(0, component_1.VantComponent)({ + props: { + dashed: Boolean, + hairline: Boolean, + contentPosition: String, + fontSize: String, + borderColor: String, + textColor: String, + customStyle: String, + }, +}); diff --git a/src/miniprogram_npm/@vant/weapp/divider/index.json b/src/miniprogram_npm/@vant/weapp/divider/index.json new file mode 100644 index 0000000..a89ef4d --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/divider/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} diff --git a/src/miniprogram_npm/@vant/weapp/divider/index.wxml b/src/miniprogram_npm/@vant/weapp/divider/index.wxml new file mode 100644 index 0000000..f6a5a45 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/divider/index.wxml @@ -0,0 +1,9 @@ + + + + + + diff --git a/src/miniprogram_npm/@vant/weapp/divider/index.wxs b/src/miniprogram_npm/@vant/weapp/divider/index.wxs new file mode 100644 index 0000000..215b14f --- /dev/null +++ b/src/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/miniprogram_npm/@vant/weapp/divider/index.wxss b/src/miniprogram_npm/@vant/weapp/divider/index.wxss new file mode 100644 index 0000000..e91dc44 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/divider/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-divider{align-items:center;border:0 solid var(--divider-border-color,#ebedf0);color:var(--divider-text-color,#969799);display:flex;font-size:var(--divider-font-size,14px);line-height:var(--divider-line-height,24px);margin:var(--divider-margin,16px 0)}.van-divider:after,.van-divider:before{border-color:inherit;border-style:inherit;border-width:1px 0 0;box-sizing:border-box;display:block;flex:1;height:1px}.van-divider:before{content:""}.van-divider--hairline:after,.van-divider--hairline:before{transform:scaleY(.5)}.van-divider--dashed{border-style:dashed}.van-divider--center:before,.van-divider--left:before,.van-divider--right:before{margin-right:var(--divider-content-padding,16px)}.van-divider--center:after,.van-divider--left:after,.van-divider--right:after{content:"";margin-left:var(--divider-content-padding,16px)}.van-divider--left:before{max-width:var(--divider-content-left-width,10%)}.van-divider--right:after{max-width:var(--divider-content-right-width,10%)} \ No newline at end of file diff --git a/src/miniprogram_npm/@vant/weapp/dropdown-item/index.d.ts b/src/miniprogram_npm/@vant/weapp/dropdown-item/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/dropdown-item/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/miniprogram_npm/@vant/weapp/dropdown-item/index.js b/src/miniprogram_npm/@vant/weapp/dropdown-item/index.js new file mode 100644 index 0000000..826c26a --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/dropdown-item/index.js @@ -0,0 +1,136 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var relation_1 = require("../common/relation"); +var component_1 = require("../common/component"); +(0, component_1.VantComponent)({ + classes: ['item-title-class'], + field: true, + relation: (0, 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, + useBeforeToggle: { + type: Boolean, + value: false, + }, + rootPortal: { + type: Boolean, + value: false, + }, + }, + data: { + transition: true, + showPopup: false, + showWrapper: false, + displayTitle: '', + safeAreaTabBar: false, + }, + 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, safeAreaTabBar = _a.safeAreaTabBar; + this.setData({ + overlay: overlay, + duration: duration, + activeColor: activeColor, + closeOnClickOverlay: closeOnClickOverlay, + direction: direction, + safeAreaTabBar: safeAreaTabBar, + }); + } + }, + 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; + if (options === void 0) { options = {}; } + var showPopup = this.data.showPopup; + if (typeof show !== 'boolean') { + show = !showPopup; + } + if (show === showPopup) { + return; + } + this.onBeforeToggle(show).then(function (status) { + var _a; + if (!status) { + 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(); + } + }); + }, + onBeforeToggle: function (status) { + var _this = this; + var useBeforeToggle = this.data.useBeforeToggle; + if (!useBeforeToggle) { + return Promise.resolve(true); + } + return new Promise(function (resolve) { + _this.$emit('before-toggle', { + status: status, + callback: function (value) { return resolve(value); }, + }); + }); + }, + }, +}); diff --git a/src/miniprogram_npm/@vant/weapp/dropdown-item/index.json b/src/miniprogram_npm/@vant/weapp/dropdown-item/index.json new file mode 100644 index 0000000..88d5409 --- /dev/null +++ b/src/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/miniprogram_npm/@vant/weapp/dropdown-item/index.wxml b/src/miniprogram_npm/@vant/weapp/dropdown-item/index.wxml new file mode 100644 index 0000000..63904f4 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/dropdown-item/index.wxml @@ -0,0 +1,50 @@ + + + + + + + {{ item.text }} + + + + + + + diff --git a/src/miniprogram_npm/@vant/weapp/dropdown-item/index.wxss b/src/miniprogram_npm/@vant/weapp/dropdown-item/index.wxss new file mode 100644 index 0000000..80505e9 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/dropdown-item/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-dropdown-item{left:0;overflow:hidden;position:fixed;right:0}.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: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/miniprogram_npm/@vant/weapp/dropdown-item/shared.d.ts b/src/miniprogram_npm/@vant/weapp/dropdown-item/shared.d.ts new file mode 100644 index 0000000..774eb4c --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/dropdown-item/shared.d.ts @@ -0,0 +1,5 @@ +export interface Option { + text: string; + value: string | number; + icon: string; +} diff --git a/src/miniprogram_npm/@vant/weapp/dropdown-item/shared.js b/src/miniprogram_npm/@vant/weapp/dropdown-item/shared.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/dropdown-item/shared.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/src/miniprogram_npm/@vant/weapp/dropdown-menu/index.d.ts b/src/miniprogram_npm/@vant/weapp/dropdown-menu/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/dropdown-menu/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/miniprogram_npm/@vant/weapp/dropdown-menu/index.js b/src/miniprogram_npm/@vant/weapp/dropdown-menu/index.js new file mode 100644 index 0000000..aed2921 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/dropdown-menu/index.js @@ -0,0 +1,122 @@ +"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 = []; +(0, component_1.VantComponent)({ + field: true, + classes: ['title-class'], + relation: (0, 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', + }, + safeAreaTabBar: { + type: Boolean, + value: false, + }, + closeOnClickOverlay: { + type: Boolean, + value: true, + observer: 'updateChildrenData', + }, + closeOnClickOutside: { + type: Boolean, + value: true, + }, + }, + data: { + itemListData: [], + }, + beforeCreate: function () { + var windowHeight = (0, 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 (0, 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: ".concat(zIndex, ";"); + if (direction === 'down') { + wrapperStyle += "top: ".concat((0, utils_1.addUnit)(offset), ";"); + } + else { + wrapperStyle += "bottom: ".concat((0, 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/miniprogram_npm/@vant/weapp/dropdown-menu/index.json b/src/miniprogram_npm/@vant/weapp/dropdown-menu/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/dropdown-menu/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/src/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxml b/src/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxml new file mode 100644 index 0000000..ec165a9 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxml @@ -0,0 +1,23 @@ + + + + + + + + {{ computed.displayTitle(item) }} + + + + + + diff --git a/src/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxs b/src/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxs new file mode 100644 index 0000000..6538854 --- /dev/null +++ b/src/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/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxss b/src/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxss new file mode 100644 index 0000000..dba000e --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-dropdown-menu{background-color:var(--dropdown-menu-background-color,#fff);box-shadow:var(--dropdown-menu-box-shadow,0 2px 12px hsla(210,1%,40%,.12));display:flex;height:var(--dropdown-menu-height,50px);-webkit-user-select:none;user-select:none}.van-dropdown-menu__item{align-items:center;display:flex;flex:1;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:var(--dropdown-menu-title-disabled-text-color,#969799)}.van-dropdown-menu__title{box-sizing:border-box;color:var(--dropdown-menu-title-text-color,#323233);font-size:var(--dropdown-menu-title-font-size,15px);line-height:var(--dropdown-menu-title-line-height,18px);max-width:100%;padding:var(--dropdown-menu-title-padding,0 24px 0 8px);position:relative}.van-dropdown-menu__title:after{border-color:transparent transparent currentcolor currentcolor;border-style:solid;border-width:3px;content:"";margin-top:-5px;opacity:.8;position:absolute;right:11px;top:50%;transform:rotate(-45deg)}.van-dropdown-menu__title--active{color:var(--dropdown-menu-title-active-text-color,#ee0a24)}.van-dropdown-menu__title--down:after{margin-top:-1px;transform:rotate(135deg)} \ No newline at end of file diff --git a/src/miniprogram_npm/@vant/weapp/empty/index.d.ts b/src/miniprogram_npm/@vant/weapp/empty/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/empty/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/miniprogram_npm/@vant/weapp/empty/index.js b/src/miniprogram_npm/@vant/weapp/empty/index.js new file mode 100644 index 0000000..755e638 --- /dev/null +++ b/src/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"); +(0, component_1.VantComponent)({ + props: { + description: String, + image: { + type: String, + value: 'default', + }, + }, +}); diff --git a/src/miniprogram_npm/@vant/weapp/empty/index.json b/src/miniprogram_npm/@vant/weapp/empty/index.json new file mode 100644 index 0000000..a89ef4d --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/empty/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} diff --git a/src/miniprogram_npm/@vant/weapp/empty/index.wxml b/src/miniprogram_npm/@vant/weapp/empty/index.wxml new file mode 100644 index 0000000..9c7b719 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/empty/index.wxml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + {{ description }} + + + + + + diff --git a/src/miniprogram_npm/@vant/weapp/empty/index.wxs b/src/miniprogram_npm/@vant/weapp/empty/index.wxs new file mode 100644 index 0000000..cf92ece --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/empty/index.wxs @@ -0,0 +1,15 @@ +/* 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/miniprogram_npm/@vant/weapp/empty/index.wxss b/src/miniprogram_npm/@vant/weapp/empty/index.wxss new file mode 100644 index 0000000..0fb74fe --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/empty/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-empty{align-items:center;box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;padding:32px 0}.van-empty__image{height:160px;width:160px}.van-empty__image:empty{display:none}.van-empty__image__img{height:100%;width:100%}.van-empty__image:not(:empty)+.van-empty__image{display:none}.van-empty__description{color:#969799;font-size:14px;line-height:20px;margin-top:16px;padding:0 60px}.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/miniprogram_npm/@vant/weapp/field/index.d.ts b/src/miniprogram_npm/@vant/weapp/field/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/field/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/miniprogram_npm/@vant/weapp/field/index.js b/src/miniprogram_npm/@vant/weapp/field/index.js new file mode 100644 index 0000000..c20d266 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/field/index.js @@ -0,0 +1,137 @@ +"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"); +(0, 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', + }, clearTrigger: { + type: String, + value: 'focus', + }, border: { + type: Boolean, + value: true, + }, titleWidth: { + type: String, + value: '6.2em', + }, clearIcon: { + type: String, + value: 'clear', + }, extraEventParams: { + type: Boolean, + value: false, + } }), + data: { + focused: false, + innerValue: '', + showClear: false, + }, + created: function () { + this.value = this.data.value; + this.setData({ innerValue: this.value }); + }, + methods: { + formatValue: function (value) { + var maxlength = this.data.maxlength; + if (maxlength !== -1 && value.length > maxlength) { + return value.slice(0, maxlength); + } + return value; + }, + onInput: function (event) { + var _a = (event.detail || {}).value, value = _a === void 0 ? '' : _a; + var formatValue = this.formatValue(value); + this.value = formatValue; + this.setShowClear(); + return this.emitChange(__assign(__assign({}, event.detail), { value: formatValue })); + }, + 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(); + (0, utils_1.nextTick)(function () { + _this.emitChange({ value: '' }); + _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({ value: value }); + }, + onLineChange: function (event) { + this.$emit('linechange', event.detail); + }, + onKeyboardHeightChange: function (event) { + this.$emit('keyboardheightchange', event.detail); + }, + emitChange: function (detail) { + var extraEventParams = this.data.extraEventParams; + this.setData({ value: detail.value }); + var result; + var data = extraEventParams + ? __assign(__assign({}, detail), { callback: function (data) { + result = data; + } }) : detail.value; + this.$emit('input', data); + this.$emit('change', data); + return result; + }, + setShowClear: function () { + var _a = this.data, clearable = _a.clearable, readonly = _a.readonly, clearTrigger = _a.clearTrigger; + var _b = this, focused = _b.focused, value = _b.value; + var showClear = false; + if (clearable && !readonly) { + var hasValue = !!value; + var trigger = clearTrigger === 'always' || (clearTrigger === 'focus' && focused); + showClear = hasValue && trigger; + } + this.setData({ showClear: showClear }); + }, + noop: function () { }, + }, +}); diff --git a/src/miniprogram_npm/@vant/weapp/field/index.json b/src/miniprogram_npm/@vant/weapp/field/index.json new file mode 100644 index 0000000..5906c50 --- /dev/null +++ b/src/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/miniprogram_npm/@vant/weapp/field/index.wxml b/src/miniprogram_npm/@vant/weapp/field/index.wxml new file mode 100644 index 0000000..6018993 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/field/index.wxml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/miniprogram_npm/@vant/weapp/field/index.wxs b/src/miniprogram_npm/@vant/weapp/field/index.wxs new file mode 100644 index 0000000..78575b9 --- /dev/null +++ b/src/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/miniprogram_npm/@vant/weapp/field/index.wxss b/src/miniprogram_npm/@vant/weapp/field/index.wxss new file mode 100644 index 0000000..5f7d306 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/field/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-field{--cell-icon-size:var(--field-icon-size,16px)}.van-field__label{color:var(--field-label-color,#646566)}.van-field__label--disabled{color:var(--field-disabled-text-color,#c8c9cc)}.van-field__body{align-items:center;display:flex}.van-field__body--textarea{box-sizing:border-box;line-height:1.2em;min-height:var(--cell-line-height,24px);padding:3.6px 0}.van-field__control:empty+.van-field__control{display:block}.van-field__control{background-color:initial;border:0;box-sizing:border-box;color:var(--field-input-text-color,#323233);display:none;height:var(--cell-line-height,24px);line-height:inherit;margin:0;min-height:var(--cell-line-height,24px);padding:0;position:relative;resize:none;text-align:left;width:100%}.van-field__control:empty{display:none}.van-field__control--textarea{height:var(--field-text-area-min-height,18px);min-height:var(--field-text-area-min-height,18px)}.van-field__control--error{color:var(--field-input-error-text-color,#ee0a24)}.van-field__control--disabled{background-color:initial;color:var(--field-input-disabled-text-color,#c8c9cc);opacity:1}.van-field__control--center{text-align:center}.van-field__control--right{text-align:right}.van-field__control--custom{align-items:center;display:flex;min-height:var(--cell-line-height,24px)}.van-field__placeholder{color:var(--field-placeholder-text-color,#c8c9cc);left:0;pointer-events:none;position:absolute;right:0;top:0}.van-field__placeholder--error{color:var(--field-error-message-color,#ee0a24)}.van-field__icon-root{align-items:center;display:flex;min-height:var(--cell-line-height,24px)}.van-field__clear-root,.van-field__icon-container{line-height:inherit;margin-right:calc(var(--padding-xs, 8px)*-1);padding:0 var(--padding-xs,8px);vertical-align:middle}.van-field__button,.van-field__clear-root,.van-field__icon-container{flex-shrink:0}.van-field__clear-root{color:var(--field-clear-icon-color,#c8c9cc);font-size:var(--field-clear-icon-size,16px)}.van-field__icon-container{color:var(--field-icon-container-color,#969799);font-size:var(--field-icon-size,16px)}.van-field__icon-container:empty{display:none}.van-field__button{padding-left:var(--padding-xs,8px)}.van-field__button:empty{display:none}.van-field__error-message{color:var(--field-error-message-color,#ee0a24);display:block;font-size:var(--field-error-message-text-font-size,12px);text-align:left}.van-field__error-message--center{text-align:center}.van-field__error-message--right{text-align:right}.van-field__word-limit{color:var(--field-word-limit-color,#646566);font-size:var(--field-word-limit-font-size,12px);line-height:var(--field-word-limit-line-height,16px);margin-top:var(--padding-base,4px);text-align:right}.van-field__word-num{display:inline}.van-field__word-num--full{color:var(--field-word-num-full-color,#ee0a24)} \ No newline at end of file diff --git a/src/miniprogram_npm/@vant/weapp/field/input.wxml b/src/miniprogram_npm/@vant/weapp/field/input.wxml new file mode 100644 index 0000000..c10f4c4 --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/field/input.wxml @@ -0,0 +1,30 @@ + + diff --git a/src/miniprogram_npm/@vant/weapp/field/props.d.ts b/src/miniprogram_npm/@vant/weapp/field/props.d.ts new file mode 100644 index 0000000..5cd130a --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/field/props.d.ts @@ -0,0 +1,4 @@ +/// +export declare const commonProps: WechatMiniprogram.Component.PropertyOption; +export declare const inputProps: WechatMiniprogram.Component.PropertyOption; +export declare const textareaProps: WechatMiniprogram.Component.PropertyOption; diff --git a/src/miniprogram_npm/@vant/weapp/field/props.js b/src/miniprogram_npm/@vant/weapp/field/props.js new file mode 100644 index 0000000..3cb8dca --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/field/props.js @@ -0,0 +1,67 @@ +"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, + alwaysEmbed: Boolean, +}; +exports.textareaProps = { + autoHeight: Boolean, + fixed: Boolean, + showConfirmBar: { + type: Boolean, + value: true, + }, + disableDefaultPadding: { + type: Boolean, + value: true, + }, +}; diff --git a/src/miniprogram_npm/@vant/weapp/field/textarea.wxml b/src/miniprogram_npm/@vant/weapp/field/textarea.wxml new file mode 100644 index 0000000..945d03e --- /dev/null +++ b/src/miniprogram_npm/@vant/weapp/field/textarea.wxml @@ -0,0 +1,32 @@ + + + + + + 提交记录 + + + + diff --git a/src/pages/enterInfo/index.json b/src/pages/enterInfo/index.json new file mode 100644 index 0000000..ffc6647 --- /dev/null +++ b/src/pages/enterInfo/index.json @@ -0,0 +1,12 @@ +{ + "navigationBarTitleText": "", + "navigationStyle": "custom", + "disableSwipeBack": true, + "usingComponents": { + "loginNavbar": "/components/loginNavbar/index", + "pageNavbar": "/components/pageNavbar/index", + "van-icon": "@vant/weapp/icon/index", + "van-divider": "@vant/weapp/divider/index", + "van-popup": "@vant/weapp/popup/index" + } +} diff --git a/src/pages/enterInfo/index.scss b/src/pages/enterInfo/index.scss new file mode 100644 index 0000000..78ad38d --- /dev/null +++ b/src/pages/enterInfo/index.scss @@ -0,0 +1,230 @@ +.page { + min-height: 100vh; + position: relative; + box-sizing: border-box; + background-color: #fff; + .bg { + width: 100%; + } + .page-container { + padding-bottom: 180rpx; + position: absolute; + width: 100%; + top: 0; + left: 0; + display: flex; + flex-direction: column; + .navbar { + flex-shrink: 0; + } + .title { + margin-top: 86rpx; + font-size: 56rpx; + color: #333333; + font-weight: bold; + text-align: center; + } + .content { + margin: 86rpx auto 0; + padding: 40rpx 64rpx 0; + width: 654rpx; + box-sizing: border-box; + background: #ffffff; + box-shadow: 0rpx 4rpx 24rpx 0rpx rgba(0, 0, 0, 0.09); + border: 2rpx solid rgba(224, 71, 117, 0.25); + border-radius: 24rpx; + .switch { + margin-bottom: 40rpx; + display: flex; + gap: 22rpx; + justify-content: space-between; + .item { + padding: 19rpx 19rpx 16rpx; + flex: 1; + background: #f2f2f2; + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 1px solid #d2d2d2; + text-align: center; + .icon { + width: 152rpx; + height: 90rpx; + } + .name { + margin-top: 12rpx; + font-size: 28rpx; + color: #999999; + line-height: 32rpx; + } + &.active { + background-color: #ffffff; + border-color: #cf5375; + .name { + color: #cf5375; + } + } + } + } + .divider { + font-size: 24rpx; + color: #aaaaaa; + } + .row { + margin-bottom: 40rpx; + display: flex; + flex-wrap: wrap; + justify-content: space-between; + &.row-age { + display: grid; + grid-template-columns: repeat(3, 1fr); + } + .picker { + flex: 1; + padding: 24rpx 32rpx; + font-size: 28rpx; + color: #999999; + background: #f2f2f2; + border: 2rpx solid #cccccc; + border-radius: 24rpx; + .select { + display: flex; + justify-content: space-between; + align-items: center; + .icons { + display: flex; + align-items: center; + .required { + width: 12rpx; + height: 12rpx; + border-radius: 50%; + background: #e04775; + margin-right: 20rpx; + } + } + .select-content { + } + } + } + .input { + flex: 1; + padding: 24rpx 32rpx; + height: 40rpx; + font-size: 32rpx; + color: #333; + background: #f2f2f2; + border: 2rpx solid #cccccc; + border-radius: 24rpx; + } + .item { + padding: 12rpx 24rpx; + opacity: 1; + border: 2rpx solid #cccccc; + font-size: 28rpx; + color: #999999; + display: flex; + align-items: center; + justify-content: center; + border-radius: 12rpx; + background: linear-gradient(90deg, #fff 0%, #f9f9f9 100%); + .icon { + width: 64rpx; + height: 64rpx; + } + &.active { + color: #e04775; + background: linear-gradient(90deg, #fff 0%, #f9f9f9 100%); + border-color: #e04775; + } + } + .input-required { + display: flex; + justify-content: space-between; + align-items: center; + &::after { + margin-right: 60rpx; + content: ''; + width: 12rpx; + height: 12rpx; + border-radius: 50%; + background: #e04775; + } + } + .age-item { + margin-bottom: 24rpx; + width: 160rpx; + height: 88rpx; + white-space: nowrap; + font-size: 28rpx; + color: #999999; + display: flex; + align-items: center; + justify-content: center; + border-radius: 12rpx; + box-sizing: border-box; + border: 2rpx solid #d2d2d2; + &.active { + color: #e04775; + border-color: #e04775; + } + } + } + .tip { + margin-top: -26rpx; + font-size: 24rpx; + line-height: 40rpx; + color: #cf5375; + } + } + } + .footer { + position: fixed; + left: 0; + bottom: 40rpx; + width: calc(100% - 96rpx); + flex-shrink: 0; + margin: 0 48rpx; + box-sizing: border-box; + display: flex; + > view:not(:last-of-type), + > image { + margin-right: 30rpx; + } + .next { + flex: 1; + text-align: center; + height: 88rpx; + line-height: 88rpx; + text-align: center; + border: 2rpx solid #e04775; + border-radius: 24rpx; + font-size: 34rpx; + font-weight: bold; + background-color: #e04775; + color: #fff; + } + } +} + +.popup { + .popup-title { + display: flex; + justify-content: space-between; + padding: 20rpx 40rpx; + font-size: 32rpx; + .clsoe { + color: #7f7f7f; + } + .sure { + color: #22c065; + } + } + .popup-picker { + .picker-col { + padding: 10rpx 30rpx; + font-size: 28rpx; + line-height: 40rpx; + box-sizing: border-box; + display: flex; + align-items: center; + } + } +} diff --git a/src/pages/enterInfo/index.ts b/src/pages/enterInfo/index.ts new file mode 100644 index 0000000..d178ee9 --- /dev/null +++ b/src/pages/enterInfo/index.ts @@ -0,0 +1,158 @@ +import dayjs from 'dayjs' +const app = getApp() + +Page({ + data: { + relationType: '1', + name: '', + gender: '', + birth: '', + ageRange: '', + diagnosisTime: '', + diagnoseType: '', + + diagnoseTypeShow: false, + DiagnoseType: app.globalData.DiagnoseType, + diagnoseTypeIndex: '', + diagnoseTypeName: '', + selectDiagnoseTypeIndex: '0', + + currentDate: dayjs().format('YYYY-MM'), + submiting: false, + + proces: '0', + }, + onLoad(options) { + this.setData({ + pagePath: options.page, + proces: options.proces, + }) + app.waitLogin({ isReg: false, loginPage: true }).then(() => { + app.getUserInfo(this, true, (userInfo) => { + this.setData({ + relationType: userInfo.RelationType || '1', + name: userInfo.PatientName, + gender: userInfo.Gender, + ageRange: userInfo.AgeRange, + }) + }) + app.mpBehavior({ PageName: 'PG_PATIENTINFOENTRY' }) + }) + }, + handleRelationType(e: WechatMiniprogram.CustomEvent) { + const { id } = e.currentTarget.dataset + this.setData({ + relationType: id, + }) + }, + handleGender(e: WechatMiniprogram.CustomEvent) { + const { id } = e.currentTarget.dataset + this.setData({ + gender: id, + }) + }, + handleSelectAge(e: WechatMiniprogram.CustomEvent) { + const { id } = e.currentTarget.dataset + this.setData({ + ageRange: id, + }) + }, + bindChangeDate(e: WechatMiniprogram.CustomEvent) { + const { key } = e.currentTarget.dataset + this.setData({ + [key]: e.detail.value, + }) + }, + handleDiagnoseTypeSave() { + const rangeIndex = this.data.selectDiagnoseTypeIndex + const { DiagnoseType } = this.data + const { id, name } = DiagnoseType[rangeIndex] + this.setData({ + diagnoseTypeIndex: rangeIndex, + diagnoseTypeName: name, + diagnoseType: id, + }) + this.handleDiagnoseTypeShow() + }, + handleDiagnoseTypeShow() { + this.setData({ + diagnoseTypeShow: !this.data.diagnoseTypeShow, + }) + }, + bindChange(e: WechatMiniprogram.CustomEvent) { + const rangeIndex = e.detail.value[0] + this.setData({ + selectDiagnoseTypeIndex: rangeIndex, + }) + }, + handleSubmit() { + if (this.data.submiting) return + app.mpBehavior({ PageName: 'BTN_PATIENTINFONEXT' }) + const { name, gender, ageRange, relationType } = this.data + const { registrationSource, registChannel, regBusinessId, WorkerId, IsAliQiWei } = app.globalData + const { doctorId, inviteChan, recDoctorId: recommendDoctorId } = app.globalData.scene + let toast = '' + // if (!diagnosisTime) toast = "确诊时间不能为空"; + // if (!birth) toast = "出生日期不能为空"; + if (!gender) toast = '请选择性别' + if (!ageRange) toast = '请选择年龄范围' + if (!name) toast = '姓名不能为空' + if (toast) { + wx.showToast({ title: toast, icon: 'none' }) + return + } + + const backPage = app.globalData.backPage + const navUrl = + typeof backPage === 'string' && backPage.includes('liveResult') ? backPage : '/pages/certReslove/index' + + this.setData({ + submiting: true, + }) + wx.ajax({ + method: 'POST', + url: '?r=igg4/account/reg', + data: { + name, + gender, + ageRange, + // birth, + // diagnoseType, + // diagnosisTime, + relationType, + registrationSource, + registChannel, + regBusinessId, + WorkerId, + inviteChannel: inviteChan, + IsAliQiWei, + inviteDoctorId: recommendDoctorId ? '' : doctorId, + recommendDoctorId: recommendDoctorId ? doctorId : '', + beRecommendDoctorId: recommendDoctorId, + }, + loading: true, + }) + .then((_res) => { + app.globalData.scene.doctorId = '' + app.globalData.scene.recDoctorId = '' + app.getUserInfo(this, true, () => { + wx.reLaunch({ + url: navUrl, + }) + this.setData({ + submiting: false, + }) + }) + }) + .catch(() => { + this.setData({ + submiting: false, + }) + }) + }, + handleBack() { + wx.navigateBack() + }, +}) + +export {} diff --git a/src/pages/enterInfo/index.wxml b/src/pages/enterInfo/index.wxml new file mode 100644 index 0000000..42abca9 --- /dev/null +++ b/src/pages/enterInfo/index.wxml @@ -0,0 +1,170 @@ + + + + + 录入信息 + + + 选择身份 + + + + + + + + 患者本人 + + + + + 患者亲友 + + + + + + 请您输入真实姓名,便于医生识别随访 + + 患者性别 + + + + + 女性用户 + + + + 男性用户 + + + + 患者年龄范围 + + + 18岁以下 + 18岁-44岁 + 45岁-59岁 + 60岁-74岁 + 75岁以上 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 立即进入 + + + + + + 关闭 + 保存 + + + + {{item.name}} + + + diff --git a/src/pages/family/index.json b/src/pages/family/index.json new file mode 100644 index 0000000..4dc1106 --- /dev/null +++ b/src/pages/family/index.json @@ -0,0 +1,10 @@ +{ + "navigationBarTitleText": "录入出血信息", + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/navBar/navBar", + "van-icon": "@vant/weapp/icon/index", + "van-loading": "@vant/weapp/loading/index", + "van-image": "@vant/weapp/image/index" + } +} diff --git a/src/pages/family/index.scss b/src/pages/family/index.scss new file mode 100644 index 0000000..b7df3be --- /dev/null +++ b/src/pages/family/index.scss @@ -0,0 +1,69 @@ +page { + background-color: #f9f9f9; +} +.page { + padding-bottom: 80rpx; + position: relative; + .bg { + width: 100%; + } + .page-container { + position: absolute; + top: 120px; + padding: 34rpx 60rpx; + .container { + padding: 0 40rpx 56rpx; + text-align: center; + background: #ffffff; + box-shadow: 0rpx 16rpx 32rpx 0rpx rgba(174, 181, 200, 0.25); + border-radius: 24rpx; + .author { + width: 164rpx; + height: 164rpx; + border-radius: 50%; + margin-top: -82rpx; + } + .name { + margin-top: 16rpx; + font-size: 32rpx; + color: #cf5375; + font-weight: bold; + } + .title { + margin-top: 47rpx; + font-size: 36rpx; + color: #cf5375; + font-weight: bold; + } + .content { + margin-top: 24rpx; + font-size: 28rpx; + color: #afb7cb; + } + .code { + margin-top: 20rpx; + width: 250rpx; + height: 250rpx; + border-radius: 50%; + } + .tip { + margin-top: 12rpx; + font-size: 28rxp; + color: #afb7cb; + } + } + .link { + margin-top: 64rpx; + font-size: 32rpx; + color: #cf5375; + text-align: center; + font-weight: bold; + } + .num { + margin-top: 15rpx; + text-align: center; + font-size: 28rpx; + color: #aeb7cb; + } + } +} diff --git a/src/pages/family/index.ts b/src/pages/family/index.ts new file mode 100644 index 0000000..6d5c241 --- /dev/null +++ b/src/pages/family/index.ts @@ -0,0 +1,59 @@ +const app = getApp() + +interface IMpInfo { + BindNum: number + LeftBindNum: number + PatientId: number + PatientName: string + RelationType: number + UserId: string + Avatar: string + qrCodeLoad: false +} + +Page({ + data: { + types: ['运动出血', '外伤', '疾病', '疾病', '自发出血'], + mpInfo: {} as IMpInfo, + qrCode: '', + }, + onLoad() { + app.waitLogin().then(() => { + app.mpBehavior({ PageName: 'PG_PATIENTMYRELATIVES' }) + this.getMpInfo() + }) + }, + getMpInfo() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/account/mp-info', + }).then((res: IMpInfo) => { + this.setData({ + mpInfo: res, + }) + this.getQrCode() + }) + }, + getQrCode() { + this.setData({ + qrCode: `${app.globalData.url}?r=igg4/account/mp-img&PatientId=${this.data.mpInfo.PatientId}&loginState=${app.globalData.loginState}`, + }) + }, + handleQrCodeLoad() { + this.setData({ + qrCodeLoad: true, + }) + }, + routerTo(e) { + const { url } = e.currentTarget.dataset + if (url === '/pages/familyList/index') { + app.mpBehavior({ PageName: 'BTN_PATIENTFAMILYMEMBERSVIEW' }) + } + wx.navigateTo({ + url, + }) + }, + handleBack() { + wx.navigateBack() + }, +}) diff --git a/src/pages/family/index.wxml b/src/pages/family/index.wxml new file mode 100644 index 0000000..921692a --- /dev/null +++ b/src/pages/family/index.wxml @@ -0,0 +1,24 @@ + + + + + + + + + 我是ID:{{mpInfo.PatientId}} + 我是ID:{{mpInfo.PatientId}}亲友 + 邀请你和我绑定亲友号 + 扫码绑定亲友号后,多个亲友号的ADL测评都将展示{{mpInfo.PatientName}}的健康数据 + + + + 请使用微信扫一扫绑定 + + + 查看我的家庭成员 + + + 还能绑定{{mpInfo.LeftBindNum || 0}}个人 + + diff --git a/src/pages/familyList/index.json b/src/pages/familyList/index.json new file mode 100644 index 0000000..39dd32e --- /dev/null +++ b/src/pages/familyList/index.json @@ -0,0 +1,9 @@ +{ + "navigationBarTitleText": "录入出血信息", + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/navBar/navBar", + "van-icon": "@vant/weapp/icon/index", + "toast":"/components/toast/index" + } +} diff --git a/src/pages/familyList/index.scss b/src/pages/familyList/index.scss new file mode 100644 index 0000000..c4a8ce6 --- /dev/null +++ b/src/pages/familyList/index.scss @@ -0,0 +1,77 @@ +page { + background-color: #f9f9f9; +} +.page { + position: relative; + padding-bottom: 80rpx; + .bg { + width: 100%; + } + .page-container { + position: absolute; + top: 180rpx; + padding: 34rpx 40rpx; + width: 100%; + box-sizing: border-box; + .card { + position: relative; + margin-bottom: 32rpx; + padding: 40rpx 0 0 18rpx; + border-radius: 12rpx; + border: 2rpx solid #f2f2f2; + box-shadow: 0 10rpx 10rpx #f2f2f2; + background-color: #fff; + display: flex; + align-items: flex-end; + box-sizing: border-box; + .author { + width: 150rpx; + flex-shrink: 0; + } + .inner { + padding: 0 20rpx 48rpx 20rpx; + .title { + display: flex; + align-items: center; + font-size: 36rpx; + color: #cf5375; + &.active { + padding-right: 80rpx; + } + > view, + > image { + margin-right: 40rpx; + } + font-weight: bold; + .label { + flex-shrink: 0; + font-weight: normal; + width: 80rpx; + height: 40rpx; + background: #f7e6e6; + border-radius: 8rpx; + font-size: 24rpx; + color: #eb8480; + text-align: center; + line-height: 40rpx; + } + } + .date { + margin-top: 20rpx; + font-size: 28rpx; + color: #afb7cb; + } + } + .cancel { + position: absolute; + right: 0; + top: 32rpx; + padding: 2rpx 36rpx; + font-size: 24rpx; + color: #ffffff; + background: linear-gradient(90deg, #cf5375 0%, #cf5375 100%); + border-radius: 200rpx 0rpx 0rpx 200rpx; + } + } + } +} diff --git a/src/pages/familyList/index.ts b/src/pages/familyList/index.ts new file mode 100644 index 0000000..3ed3914 --- /dev/null +++ b/src/pages/familyList/index.ts @@ -0,0 +1,79 @@ +const app = getApp(); + +Page({ + data: { + toastShow: false, + toastType: "", + // toastShow:true, + // toastType:"familyUnbind", + familyList: [], + userInfo: {}, + UserId: "", + }, + onLoad() { + app.waitLogin().then(() => { + app.mpBehavior({ PageName: 'PG_PATIENTMYRELATIVESLIST' }) + this.getFamilyList(); + app.getUserInfo(this); + }); + }, + getFamilyList(loading = true) { + wx.ajax({ + method: "GET", + url: "?r=igg4/account/relatives", + data: {}, + loading, + }).then((res) => { + this.setData({ + familyList: res, + }); + }); + }, + handleUnbind(e) { + const { id } = e.currentTarget.dataset; + this.setData({ + UserId: id, + toastShow: true, + toastType: "familyUnbind", + }); + }, + handleUnbinOk() { + const { UserId } = this.data; + this.handleUnbindCancel(); + wx.ajax({ + method: "POST", + url: "?r=igg4/account/unbind-user", + data: { + UserId, + }, + loading: true, + }).then(() => { + wx.showToast({ + icon: "none", + title: "解绑成功", + success: () => { + app.getUserInfo(this, true, (_userInfo) => { + app.waitLogin().then(() => { + this.getFamilyList(false); + }); + }); + }, + }); + }); + }, + handleUnbindCancel() { + this.setData({ + toastShow: false, + toastType: "", + }); + }, + handleBack() { + wx.navigateBack({ + fail() { + wx.reLaunch({ + url: "/pages/index/index", + }); + }, + }); + }, +}); diff --git a/src/pages/familyList/index.wxml b/src/pages/familyList/index.wxml new file mode 100644 index 0000000..8e6d024 --- /dev/null +++ b/src/pages/familyList/index.wxml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + ID:{{userInfo.PatientId}} + ID:{{userInfo.PatientId}}亲友 + 本人 + + 绑定时间:{{card.BindPatientTime}} + + + 解绑 + + + + + + + + diff --git a/src/pages/familyScan/index.json b/src/pages/familyScan/index.json new file mode 100644 index 0000000..3f12651 --- /dev/null +++ b/src/pages/familyScan/index.json @@ -0,0 +1,8 @@ +{ + "navigationBarTitleText": "录入出血信息", + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/navBar/navBar", + "van-icon": "@vant/weapp/icon/index" + } +} diff --git a/src/pages/familyScan/index.scss b/src/pages/familyScan/index.scss new file mode 100644 index 0000000..6a8a8d8 --- /dev/null +++ b/src/pages/familyScan/index.scss @@ -0,0 +1,210 @@ +.page { + padding-bottom: 80rpx; + box-sizing: border-box; + position: relative; + height: 100vh; + .bg { + width: 100%; + height: 100vh; + filter: blur(5rpx); + } + .banner { + position: absolute; + top: 0; + left: 0; + padding: 223rpx 69rpx 64rpx; + .center { + display: flex; + align-items: flex-end; + justify-content: space-between; + > view:not(:last-of-type), + > image { + margin-right: 42rpx; + } + .icon { + width: 127rpx; + height: 142rpx; + } + .content { + .title { + font-size: 48rpx; + color: #ffffff; + font-weight: bold; + white-space: nowrap; + } + .en-title { + margin-top: 20rpx; + font-size: 36rpx; + color: #fff; + } + } + } + } + + .page-container { + position: absolute; + width: 100vw; + bottom: 0; + left: 0; + z-index: 1; + height: 76vh; + padding: 86rpx 60rpx; + box-sizing: border-box; + border-radius: 48rpx 48rpx 0 0; + box-shadow: 0 -10rpx 20rpx #afb7cb; + background-color: #fff; + .error { + text-align: center; + .icon { + width: 256rpx; + height: 256rpx; + } + .beyond { + margin-top: 66rpx; + font-size: 32rpx; + color: #495069; + font-weight: bold; + } + .repeat { + @extend .beyond; + } + .unbind { + margin-top: 32rpx; + padding: 0 60rpx; + .tip { + font-size: 36rpx; + font-weight: bold; + color: #E04775; + } + .content { + margin-top: 30rpx; + font-size: 32rpx; + color: #afb7cb; + line-height: 1.5; + .blob { + font-weight: bold; + } + } + .sure { + margin-top: 60rpx; + font-size: 36rpx; + color: #E04775; + font-weight: bold; + } + } + } + .identity-wrapper { + .title { + font-size: 36rpx; + color: #495069; + text-align: center; + font-weight: bold; + } + .identity { + margin-top: 39rpx; + display: flex; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 24rpx; + } + .item { + padding: 42rpx; + flex: 1; + text-align: center; + border-radius: 12rpx; + background-color: #f9f7fa; + .icon { + width: 122rpx; + height: 106rpx; + } + .icon-active { + display: none; + width: 122rpx; + height: 106rpx; + } + .name { + margin-top: 14rpx; + font-size: 32rpx; + color: #afb7cb; + } + } + .active { + .name { + color: #E04775; + } + .icon { + display: none; + } + .icon-active { + display: inline-block; + } + } + } + .title-second { + margin-top: 84rpx; + } + .relation { + margin-top: 37rpx; + display: flex; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 18rpx; + } + .item { + flex: 1; + padding: 51rpx 6rpx; + text-align: center; + border-radius: 12rpx; + font-size: 28rpx; + color: #E04775; + font-weight: bold; + background-color: #f9f7fa; + } + .active { + color: #fff; + background-color: #E04775; + } + } + } + .footer { + position: fixed; + left: 0; + padding: 0 48rpx; + bottom: 78rpx; + width: 100%; + box-sizing: border-box; + margin-top: 88rpx; + display: flex; + align-items: center; + justify-content: space-between; + > view:not(:last-of-type), + > button:not(:last-of-type), + > image { + margin-right: 30rpx; + } + + .cancel, + .submit { + flex: 1; + font-size: 36rpx; + font-weight: bold; + height: 80rpx; + text-align: center; + line-height: 80rpx; + border-radius: 40rpx; + } + + .cancel { + color: #fff; + background-color: #afb7cb; + } + + .submit { + color: #fff; + background-color: #E04775; + } + } + } +} diff --git a/src/pages/familyScan/index.ts b/src/pages/familyScan/index.ts new file mode 100644 index 0000000..7ba1025 --- /dev/null +++ b/src/pages/familyScan/index.ts @@ -0,0 +1,111 @@ +const app = getApp(); +import { parseScene } from "@/utils/util"; + +Page({ + data: { + PatientId: "", + RelationType: "", + resetBind: false, + reload: false, + mpPatientInfo: {}, + ignoreAgreement: {}, + userInfo: {} as any, + }, + onLoad(options) { + this.setData({ + ignoreAgreement: options.ignoreAgreement, + }); + }, + onShow() { + // const options = wx.getEnterOptionsSync(); + const scene = app.globalData.scene; + if (scene?.pId) { + this.setData({ + PatientId: scene.pId, + }); + } + app.waitLogin({ isReg: false }).then(() => { + app.getUserInfo(this, true, () => { + this.getMpPatientInfo(); + }); + }); + }, + getMpPatientInfo() { + const { UserType } = this.data.userInfo; + wx.ajax({ + method: "GET", + url: "?r=igg4/account/mp-patient-info", + data: { + PatientId: this.data.PatientId, + }, + loading: true, + }).then((res) => { + let RelationType = res.HasSelf == 1 ? "2" : ""; + if (!res.PatientId) { + if (!this.data.ignoreAgreement) { + if (UserType >= 2) { + wx.navigateTo({ + url: `/pages/privacyAgreement/index?page=/pages/familyScan/index`, + }); + } else { + wx.navigateTo({ + url: `/pages/login/index?page=/pages/familyScan/index`, + }); + } + } + } + this.setData({ + mpPatientInfo: res, + RelationType: res.HasSelf ? "2" : RelationType, + reload: true, + }); + }); + }, + handleHome() { + wx.reLaunch({ + url: "/pages/index/index", + }); + }, + handleResetBind() { + this.setData({ + resetBind: true, + }); + }, + handleSwitchRType(e) { + const { type } = e.currentTarget.dataset; + this.setData({ + RelationType: type, + }); + }, + handleSubmit() { + const { PatientId, RelationType } = this.data; + if (!RelationType) { + wx.showToast({ + title: "请选择身份", + icon: "none", + }); + return; + } + + // wx.reLaunch({ + // url: "/pages/login/index", + // }); + + // return; + wx.ajax({ + method: "POST", + url: "?r=igg4/account/bind-patient", + data: { + PatientId, + RelationType, + }, + loading: true, + }).then(() => { + app.getUserInfo(this, true, (userInfo) => { + wx.reLaunch({ + url: "/pages/index/index", + }); + }); + }); + }, +}); diff --git a/src/pages/familyScan/index.wxml b/src/pages/familyScan/index.wxml new file mode 100644 index 0000000..1bc2270 --- /dev/null +++ b/src/pages/familyScan/index.wxml @@ -0,0 +1,86 @@ + + + + + + + + + + 当前患者账号已注销,该邀请码已失效, + + 请您重新注册账号。 + + 关闭 + + + + 您已加入ID:{{mpPatientInfo.ToBindPatientId}}的亲友号 + + 无需重复加入 + + 关闭 + + + + 当前ID:{{mpPatientInfo.ToBindPatientId}}的亲友号已绑定3个用户 + + 无法继续绑定 + + 关闭 + + + + 注意 + + 您正在扫码绑定新的患者! + 您当前已有账号: + ID:{{mpPatientInfo.PatientId}} + ID:{{mpPatientInfo.PatientId}}亲友 + + 若绑定新的患者,ID:{{mpPatientInfo.PatientId}}的记录数据(ADL测评和用药数据)您将无法管理和查看 + + 是否继续绑定? + + + + + + + + 请选择您的身份? + + + + + 本人 + + + + + 亲友 + + + + 完成 + + + + + diff --git a/src/pages/getUserInfo/index.json b/src/pages/getUserInfo/index.json new file mode 100644 index 0000000..df2c928 --- /dev/null +++ b/src/pages/getUserInfo/index.json @@ -0,0 +1,10 @@ +{ + "navigationBarTitleText": "我的故事", + "navigationStyle": "custom", + "disableScroll": true, + "usingComponents": { + "navBar": "/components/navBar/navBar", + "text-expandsion": "/components/text-expandsion/index", + "freeAudio": "/components/freeAudio/index" + } +} diff --git a/src/pages/getUserInfo/index.scss b/src/pages/getUserInfo/index.scss new file mode 100644 index 0000000..a28ab53 --- /dev/null +++ b/src/pages/getUserInfo/index.scss @@ -0,0 +1,55 @@ +page { + min-height: 100vh; + background: linear-gradient(180deg, rgba(253, 253, 253, 0.49) 0%, #fafafa 100%); + background-color: #fff; +} +.page { + width: 100%; + height: 100vh; + overflow: hidden; + background-color: #fafafa; + .page-container { + margin-top: 100rpx; + padding: 0 104rpx; + background: #fff; + height: 100vh; + border-radius: 32rpx 32rpx 0 0; + .avatar-wrapper { + width: 280rpx; + height: 280rpx; + background-color: transparent; + outline: none; + padding: 0; + overflow: visible; + &::after { + border: none; + } + .avatar { + display: block; + transform: translateY(-50%); + width: 280rpx; + height: 280rpx; + border-radius: 50%; + } + } + .tip { + margin-top: -90rpx; + text-align: center; + font-size: 36rpx; + color: #aeb6cd; + } + + .container { + display: flex; + } + .submit { + width: 100%; + text-align: center; + line-height: 84rpx; + height: 84rpx; + background-color: #023eba; + border-radius: 100rpx; + color: #fff; + } + } +} diff --git a/src/pages/getUserInfo/index.ts b/src/pages/getUserInfo/index.ts new file mode 100644 index 0000000..1971e67 --- /dev/null +++ b/src/pages/getUserInfo/index.ts @@ -0,0 +1,77 @@ +const app = getApp(); + +Page({ + data: { + list: [], + userInfo: { + avatarUrl: "", + }, + }, + onLoad() { + const SystemInfo = app.globalSystemInfo; + if (SystemInfo) { + const { bottom } = SystemInfo.capsulePosition; + this.setData({ + bottom: bottom, + }); + } + }, + onShow() { + app.waitLogin().then((_res) => { + app.getUserInfo(this, true); + }); + }, + onChooseAvatar(e) { + const { avatarUrl } = e.detail; + const that = this; + let url = `${app.globalData.upFileUrl}?r=file-service/upload-img`; + wx.showLoading({ + title: "上传中", + }); + wx.uploadFile({ + url: url, + filePath: avatarUrl, + name: "file", + success(res) { + let data = JSON.parse(res.data); + let avatarUrl = data.data.Url; + wx.ajax({ + method: "POST", + url: "?r=igg4/account/update-user-img", + data: { + UserImg: decodeURI(avatarUrl), + }, + }) + .then(() => { + wx.hideLoading(); + wx.showToast({ + title: "头像更新成功!", + icon: "none", + }); + that.setData({ + ["userInfo.UserImg"]: avatarUrl, + }); + }) + .catch(() => { + wx.hideLoading(); + }); + }, + fail() { + wx.hideLoading(); + }, + }); + }, + routerTo(e) { + const { url } = e.currentTarget.dataset; + wx.navigateTo({ + url, + }); + }, + handleSubmit() { + console.log(this.data.userInfo); + }, + handleBack() { + wx.navigateBack(); + app.getUserInfo(this, true); + }, +}); diff --git a/src/pages/getUserInfo/index.wxml b/src/pages/getUserInfo/index.wxml new file mode 100644 index 0000000..e23f95f --- /dev/null +++ b/src/pages/getUserInfo/index.wxml @@ -0,0 +1,12 @@ + + + + + 点击配置头像 + + diff --git a/src/pages/hospital/index.json b/src/pages/hospital/index.json new file mode 100644 index 0000000..f7d5fa0 --- /dev/null +++ b/src/pages/hospital/index.json @@ -0,0 +1,7 @@ +{ + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/navBar/navBar", + "timeOut": "/components/timeOut/index" + } +} diff --git a/src/pages/hospital/index.scss b/src/pages/hospital/index.scss new file mode 100644 index 0000000..058b5e4 --- /dev/null +++ b/src/pages/hospital/index.scss @@ -0,0 +1,196 @@ +.scroll-view{ + height: 100vh; +} +.page { + background-color: #fafafa; + .banner { + padding: 44rpx 30rpx 0; + display: flex; + align-items: center; + .hosttipat-img { + flex-shrink: 0; + width: 180rpx; + height: 180rpx; + border-radius: 24rpx; + border: 2rpx solid rgba(151, 151, 151, 0.21); + overflow: hidden; + .img { + width: 100%; + height: 100%; + } + } + .wrap { + margin-left: 24rpx; + flex: 1; + .title { + display: flex; + align-items: center; + .name { + font-size: 36rpx; + color: #484848; + word-break: break-all; + } + .tag { + flex-shrink: 0; + margin-left: 12rpx; + padding: 6rpx 12rpx; + font-size: 22rpx; + line-height: 1; + color: #ffffff; + background: #ffc137; + border-radius: 8rpx; + } + } + .content { + margin-top: 28rpx; + display: flex; + align-items: center; + justify-content: space-between; + .inner { + .site { + font-size: 24rpx; + color: #9b9ea6; + } + .site-num { + font-size: 24rpx; + color: #9b9ea6; + } + } + .options { + flex-shrink: 0; + .icon { + margin-left: 44rpx; + width: 30rpx; + height: 30rpx; + background-color: #edeeef; + border-radius: 50%; + padding: 6rpx; + } + } + } + } + } + .module { + margin-top: 64rpx; + padding: 0 30rpx; + .module-container { + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border: 1rpx solid #ebecee; + border-radius: 24rpx; + .m-title { + position: relative; + margin-bottom: 48rpx; + height: 88rpx; + background-color: #fff; + background: #ffeff4; + box-shadow: inset 0rpx 2rpx 12rpx 0rpx rgba(255, 255, 255, 0); + border-radius: 24rpx 24rpx 0rpx 0rpx; + border: 1rpx solid #efeff1; + display: flex; + align-items: center; + justify-content: center; + .m-title-img { + width: 166rpx; + height: 42rpx; + } + .m-icon1 { + position: absolute; + top: -20rpx; + left: 64rpx; + width: 20rpx; + height: 64rpx; + } + .m-icon2 { + position: absolute; + top: -20rpx; + right: 64rpx; + width: 20rpx; + height: 64rpx; + } + } + } + .new-card { + margin-bottom: 16rpx; + padding: 32rpx; + display: flex; + .avatar { + flex-shrink: 0; + width: 172rpx; + height: 172rpx; + border-radius: 24rpx; + } + .content { + flex: 1; + padding-left: 20rpx; + .name { + font-size: 32rpx; + color: #484848; + font-weight: bold; + } + .p { + margin-top: 8rpx; + font-size: 24rpx; + color: #9da0a8; + &.ellipsis { + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + } + } + .row { + margin-top: 16rpx; + display: flex; + flex-wrap: wrap; + .tag { + margin-right: 16rpx; + margin-bottom: 10rpx; + width: 120rpx; + height: 32rpx; + background: #ffe6ee; + border-radius: 8rpx; + display: flex; + .week { + flex: 1; + font-size: 20rpx; + line-height: 32rpx; + color: #ffffff; + background-color: #e66c8e; + text-align: center; + border-radius: 8rpx 0 8rpx 8rpx; + } + .value { + flex: 1; + font-size: 20rpx; + color: #e04775; + text-align: center; + line-height: 32rpx; + } + } + .week-name { + flex: 1; + padding: 20rpx 24rpx; + background-color: rgba(253, 244, 247, 1); + border-radius: 16rpx; + font-size: 24rpx; + color: rgba(157, 160, 168, 1); + line-height: 40rpx; + .label { + margin-right: 12rpx; + display: inline-block; + font-size: 20rpx; + color: rgba(255, 255, 255, 1); + line-height: 32rpx; + padding: 0 8rpx; + background: #e04775; + border-radius: 8rpx 8rpx 8rpx 8rpx; + } + } + } + } + } + } +} diff --git a/src/pages/hospital/index.ts b/src/pages/hospital/index.ts new file mode 100644 index 0000000..3fd6b72 --- /dev/null +++ b/src/pages/hospital/index.ts @@ -0,0 +1,197 @@ +const app = getApp() + +Page({ + data: { + id: '', + detail: {} as any, + LNG: '' as number | string, + LAT: '' as number | string, + pagination: { + page: 1, + pages: 1, + count: 0, + }, + + asideOut: false, + timeToast: false, + timeToastType: '18', + timeToastParams: { + rewardScore: 0, + }, + }, + onLoad(options) { + app.waitLogin().then((_res) => { + this.setData({ + id: options.id, + }) + this.handleToggleSite() + }) + }, + handleToggleSite() { + const that = this + if (!this.data.LNG) { + wx.getSetting({ + success(res) { + if ( + res.authSetting['scope.userFuzzyLocation'] != undefined && + res.authSetting['scope.userFuzzyLocation'] == true + ) { + //获取当前位置 + that.getFuzzyLocation() + } else if (res.authSetting['scope.userFuzzyLocation'] == undefined) { + //获取当前位置 + that.getFuzzyLocation() + } else { + wx.showModal({ + title: '请求授权当前位置', + content: '需要获取您的地理位置,请确认授权', + confirmColor: '#cf5375', + success(res) { + if (res.cancel) { + //取消授权 + wx.showToast({ + title: '拒绝授权', + icon: 'none', + duration: 1000, + }) + that.getDetail() + } else if (res.confirm) { + //确定授权,通过wx.openSetting发起授权请求 + wx.openSetting({ + success(res) { + if (res.authSetting['scope.userFuzzyLocation'] == true) { + wx.showToast({ + title: '授权成功', + icon: 'success', + duration: 1000 + }) + // 再次授权,调用wx.getLocation的API + that.getFuzzyLocation() + } else { + wx.showToast({ + title: '授权失败', + icon: 'none', + duration: 1000 + }) + that.getDetail() + } + }, + }) + } + }, + }) + } + }, + }) + } else { + that.setData({ + LNG: '', + LAT: '', + }) + this.getDetail() + } + }, + getFuzzyLocation() { + const that = this + wx.getFuzzyLocation({ + success(res) { + console.log(res) + that.setData({ + LNG: res.longitude, + LAT: res.latitude, + }) + that.getDetail() + }, + fail() { + that.getDetail() + }, + }) + }, + getDetail() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/hospital/detail', + data: { + Id: this.data.id, + lng: this.data.LNG, + lat: this.data.LAT, + }, + }).then((res) => { + if (res.CanGetScore) { + this.handleTimeOut(res.Id) + } + this.setData({ + detail: { + ...res, + doctors: res.doctors.map((item: any) => { + let weekName = '' + if (item.ClinicType == 2) { + weekName = item.Clinic + } else { + weekName = (JSON.parse(item.Clinic) ? JSON.parse(item.Clinic) : []).map( + (subItem: { weekday: string | number; timeType: string | number }) => { + const week = ['周一', '周二', '周三', '周四', '周五', '周六', '周日'] + const timeDay = { 1: '上午', 2: '下午' } + return { week: week[Number(subItem.weekday) - 1], timeDay: timeDay[subItem.timeType] } + }, + ) + } + return { + weekName, + ...item, + } + }), + }, + }) + }) + }, + handlePhone() { + const { detail } = this.data + wx.makePhoneCall({ + phoneNumber: detail.Telephone, + }) + }, + handleOpenMap() { + const { detail } = this.data + wx.openLocation({ + latitude: detail.LAT, + longitude: detail.LNG, + name: detail.Name, + address: `${detail.ProvinceName}${detail.CityName}${detail.CountyName}${detail.Address}`, + }) + }, + handleTimeOut(Id) { + wx.ajax({ + method: 'POST', + url: '?r=igg4/score/send-score', + data: { + Type: this.data.timeToastType, + Id, + }, + }).then((res) => { + if (!Array.isArray(res)) { + this.setData({ + timeToast: true, + timeToastParams: { + rewardScore: res.rewardScore, + }, + }) + setTimeout(() => { + this.setData({ + timeToast: false, + }) + }, 3000) + } + }) + }, + routerTo(e) { + const { url } = e.currentTarget.dataset + wx.navigateTo({ + url, + }) + }, + handleBack() { + wx.navigateBack() + }, + onPageScroll() {}, +}) diff --git a/src/pages/hospital/index.wxml b/src/pages/hospital/index.wxml new file mode 100644 index 0000000..9cd6bd9 --- /dev/null +++ b/src/pages/hospital/index.wxml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + {{item.Name}} + {{item.Introduce}} + + + + 出诊时间{{item.weekName}} + + + + {{wItem.week}} + {{wItem.timeDay}} + + + + + + + + + + + + diff --git a/src/pages/index/index.json b/src/pages/index/index.json new file mode 100644 index 0000000..9ccd05a --- /dev/null +++ b/src/pages/index/index.json @@ -0,0 +1,9 @@ +{ + "navigationStyle": "custom", + "usingComponents": { + "pageNavbar": "/components/pageNavbar/index", + "van-icon": "@vant/weapp/icon/index", + "toast": "/components/toast/index", + "referralFrom": "/components/referralFrom/index" + } +} diff --git a/src/pages/index/index.scss b/src/pages/index/index.scss new file mode 100644 index 0000000..3eff4d0 --- /dev/null +++ b/src/pages/index/index.scss @@ -0,0 +1,1302 @@ +$page-margin: 40rpx; +page { + background-color: #fafafa; +} + +.page { + position: relative; + min-height: 100vh; + .bg { + margin-top: 96rpx; + width: 100%; + } + .drug-bg { + width: 100%; + } + .page-container { + position: absolute; + left: 0; + top: 0; + width: 100%; + box-sizing: border-box; + padding-bottom: 180rpx; + .user { + margin: 53rpx $page-margin 0; + display: flex; + align-items: center; + .avatar { + width: 87rpx; + height: 87rpx; + border-radius: 50%; + } + .content { + margin-left: 33rpx; + .name { + font-size: 32rpx; + color: #333333; + font-weight: bold; + line-height: 48rpx; + } + .info { + font-size: 24rpx; + color: #999999; + line-height: 48rpx; + .num { + font-size: 32rpx; + color: #333333; + font-weight: bold; + } + } + } + } + .referral { + margin: $page-margin $page-margin 0; + .referral-img { + margin-left: -20rpx; + width: calc(100% + 20rpx); + height: 234rpx; + } + } + .doctor { + margin: $page-margin $page-margin 0; + padding: 70rpx 10rpx 10rpx; + border-radius: 24rpx; + .container { + padding: 27rpx 0 27rpx 27rpx; + display: flex; + justify-content: space-between; + background: rgba(255, 255, 255, 0.95); + border-radius: 21rpx; + .avatar { + width: 104rpx; + height: 104rpx; + .a-img { + width: 100%; + height: 100%; + border-radius: 50%; + border: 3rpx solid #fff; + box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(52, 44, 46, 0.17); + } + } + .wrap { + padding: 6rpx 16rpx 0; + flex: 1; + .name-wrap { + display: flex; + .name { + position: relative; + font-size: 36rpx; + color: rgba(51, 51, 51, 1); + font-weight: bold; + display: flex; + align-items: center; + line-height: 40rpx; + .n-content { + max-width: 8em; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } + .bubble { + margin-left: 8rpx; + padding: 0 14rpx; + height: 30rpx; + line-height: 30rpx; + box-sizing: border-box; + text-align: center; + font-size: 22rpx; + color: rgba(255, 255, 255, 1); + background: #ee951b; + border-radius: 32rpx; + position: relative; + &::after { + position: absolute; + left: 14rpx; + bottom: -8rpx; + content: ''; + width: 0; + height: 0; + border-style: solid; + border-width: 13rpx 13rpx 0 0; + border-color: #ee951b transparent transparent transparent; + } + } + } + .icon { + margin-left: 4rpx; + margin-top: -20rpx; + display: inline-block; + width: 36rpx; + height: 24rpx; + } + } + .content { + margin-top: 16rpx; + font-size: 26rpx; + line-height: 38rpx; + color: rgba(51, 51, 51, 1); + } + .hostipal { + margin-top: 16rpx; + font-size: 28rpx; + color: #999999; + line-height: 36rpx; + overflow: hidden; + .h-content { + margin-right: 16rpx; + display: inline; + } + .tag { + display: inline-block; + padding: 4rpx 12rpx; + font-size: 22rpx; + line-height: 1; + color: #ffffff; + background: #ee951b; + line-height: 24rpx; + border-radius: 8rpx 8rpx 8rpx 8rpx; + } + } + } + .btn { + align-self: center; + width: 151rpx; + height: 44rpx; + font-size: 28rpx; + color: #cf5375; + background: linear-gradient(136deg, #ebeffe 0%, #fce3ec 100%), #ffffff; + border-radius: 420rpx 0 0 420rpx; + display: flex; + align-items: center; + justify-content: center; + } + } + &.doctor-drugs { + .container { + .btn { + color: #ffffff; + background: rgba(37, 217, 200, 1); + } + } + } + } + .banner { + margin: $page-margin; + .swiper { + width: 100%; + height: 280rpx; + .swiper-item { + display: block; + width: 100%; + height: 240rpx; + box-sizing: border-box; + border-radius: 20rpx; + .swiper-item-img { + width: 100%; + height: 100%; + } + } + + .wx-swiper-dot-active { + width: 30rpx !important; + } + + .wx-swiper-dot { + width: 9rpx; + height: 6rpx; + border-radius: 2rpx; + } + } + } + .adl { + position: relative; + margin: $page-margin; + .adl-bg { + width: 100%; + height: 240rpx; + } + .adl-container { + padding: 63rpx 40rpx 24rpx; + width: 100%; + box-sizing: border-box; + position: absolute; + top: 0; + left: 0; + .other { + .new { + position: absolute; + left: -22rpx; + top: 9rpx; + .icon { + width: 123rpx; + height: 59rpx; + } + .new-text { + position: absolute; + width: 68rpx; + height: 26rpx; + top: 13rpx; + left: 18rpx; + } + } + .adl-title { + width: 334rpx; + height: 86rpx; + } + .title { + font-size: 44rpx; + font-weight: bold; + color: #fff; + line-height: 48rpx; + .blod { + // font-size: 50rpx; + } + } + .num { + font-size: 25rpx; + line-height: 36rpx; + color: #fff; + } + .status { + margin-top: 18rpx; + padding: 0 25rpx; + display: inline-block; + font-size: 22rpx; + color: #e04775; + background-color: #fff; + border-radius: 17rpx; + } + .btn { + margin-top: 10rpx; + width: 206rpx; + height: 54rpx; + border-radius: 30rpx; + text-align: center; + line-height: 54rpx; + background: #ffffff linear-gradient(136deg, #e6edfe 0%, #fee0ea 100%); + opacity: 1; + margin-right: 20rpx; + font-size: 28rpx; + color: #cf5375; + font-weight: bold; + .icon { + width: 21rpx; + height: 21rpx; + margin-left: 9rpx; + } + } + .o-aside { + position: absolute; + top: 7rpx; + right: 0; + .badge { + width: 302rpx; + height: 233rpx; + } + } + } + } + &.adl-drugs { + .adl-container { + .other { + .title { + color: #fff; + } + .num { + color: #fff; + } + .status { + color: #24d8c8; + } + .btn { + width: 206rpx; + height: 54rpx; + background: #ffffff; + font-size: 28rpx; + color: #25d9c8; + font-weight: bold; + display: flex; + align-items: center; + justify-content: center; + border-radius: 32rpx 32rpx 32rpx 32rpx; + .icon { + width: 21rpx; + height: 21rpx; + } + } + .o-aside { + .box { + .change { + color: #ffffff; + } + .center { + background: linear-gradient(163deg, #fcfcfc 70%, #2fdbca 100%); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + } + .b-line { + background: linear-gradient(61deg, #ffffff 30%, #f08f35 49%, #e55273 100%); + &::after { + border-color: transparent transparent #fff transparent; + } + } + } + } + } + } + } + } + .drug-record { + position: relative; + margin: $page-margin $page-margin 64rpx; + padding: 24rpx 40rpx; + border-radius: 24rpx; + background: linear-gradient(to bottom, #25d9c8 0%, #a8ede6 100%); + .d-header { + display: flex; + justify-content: space-between; + align-items: center; + .status { + display: flex; + align-items: center; + .name { + margin-right: 10rpx; + font-size: 28rpx; + color: #fff; + font-weight: bold; + } + .icons { + display: flex; + align-items: center; + .icon { + margin-right: 14rpx; + width: 32rpx; + height: 32rpx; + } + } + } + .more { + font-size: 24rpx; + color: #ffffff; + } + } + .d-line { + margin: 31rpx 0 25rpx; + width: 26rpx; + height: 4rpx; + background: #ffffff; + border-radius: 0rpx 0rpx 0rpx 0rpx; + } + .date { + .d-name { + font-size: 24rpx; + color: #ffffff; + } + .d-str { + display: flex; + align-items: center; + font-size: 28rpx; + color: #ffffff; + font-weight: bold; + .week { + font-weight: bold; + margin-left: 10rpx; + font-size: 20rpx; + color: #26dac9; + width: 55rpx; + height: 24rpx; + line-height: 24rpx; + text-align: center; + border-radius: 6rpx 6rpx 6rpx 6rpx; + background: #ffffff; + } + } + } + .d-card { + min-width: 300rpx; + padding: 15rpx 24rpx 23rpx; + position: absolute; + top: 95rpx; + right: 32rpx; + box-shadow: 8rpx 16rpx 24rpx 0 #dfdfdf; + background-color: #fff; + border-radius: 24rpx; + .dc-header { + display: flex; + align-items: center; + font-size: 24rpx; + color: #12245c; + font-weight: bold; + .over-date { + margin-left: 17rpx; + font-size: 20rpx; + color: #bec3d1; + } + } + .dc-content { + margin-top: 13rpx; + display: flex; + align-items: flex-end; + justify-content: space-between; + .c-l { + display: flex; + align-items: flex-end; + .box { + padding: 0 20rpx; + height: 59rpx; + font-size: 48rpx; + color: #ffffff; + text-align: center; + line-height: 59rpx; + background-color: #12245c; + border-radius: 6rpx 6rpx 6rpx 6rpx; + opacity: 1; + font-weight: bold; + } + .sub { + margin-left: 10rpx; + font-size: 24rpx; + color: #12245c; + } + &.today { + .box { + padding: 5rpx 8rpx; + font-size: 32rpx; + background: linear-gradient(91deg, #12245c 0%, rgba(18, 36, 92, 0.52) 100%); + } + } + } + .more { + font-size: 24rpx; + color: #25d9c8; + } + } + } + .d-noraml { + display: flex; + justify-content: space-between; + align-items: center; + .n-left { + // padding: 40rpx 0; + flex-shrink: 0; + margin-right: 40rpx; + .title { + font-size: 28rpx; + color: #ffffff; + line-height: 48rpx; + font-weight: bold; + } + .btn { + margin-top: 46rpx; + width: 206rpx; + height: 54rpx; + background: #ffffff; + font-size: 28rpx; + color: #25d9c8; + font-weight: bold; + display: flex; + align-items: center; + justify-content: center; + border-radius: 32rpx 32rpx 32rpx 32rpx; + .icon { + width: 21rpx; + height: 21rpx; + } + } + } + .n-right { + flex: 1; + display: flex; + justify-content: space-between; + .item { + .icon { + margin: 0 auto; + width: 64rpx; + height: 64rpx; + background: linear-gradient(120deg, #a7ede6 0%, #3cd9ca 100%); + border-radius: 12rpx 12rpx 12rpx 12rpx; + display: flex; + align-items: center; + justify-content: center; + image { + width: 48rpx; + height: 48rpx; + } + } + .name { + margin: 4rpx; + font-size: 20rpx; + color: #ffffff; + } + } + } + } + } + .live { + margin: $page-margin 0; + .header { + margin: 0 $page-margin; + display: flex; + align-items: center; + justify-content: space-between; + .title { + font-size: 32rpx; + color: #474747; + font-weight: bold; + } + .more { + font-size: 24rpx; + color: #cccccc; + } + } + .live-container { + margin-top: 24rpx; + margin-left: $page-margin; + overflow-x: auto; + overflow-y: hidden; + &::-webkit-scrollbar { + display: none; + } + .scroll { + display: flex; + flex-wrap: nowrap; + .live-item { + flex-shrink: 0; + width: 670rpx; + height: 331rpx; + margin-right: 30rpx; + .live-img { + width: 100%; + height: 100%; + border-radius: 24rpx; + } + } + } + } + } + .live-up { + margin: $page-margin 0; + .header { + margin: 0 $page-margin; + display: flex; + align-items: center; + justify-content: space-between; + .title { + font-size: 32rpx; + color: #474747; + font-weight: bold; + } + .more { + font-size: 24rpx; + color: #cccccc; + } + } + .live-container { + margin-top: 24rpx; + margin-left: $page-margin; + overflow-x: auto; + overflow-y: hidden; + &::-webkit-scrollbar { + display: none; + } + .scroll { + display: flex; + flex-wrap: nowrap; + .live-item { + flex-shrink: 0; + width: 670rpx; + height: 331rpx; + margin-right: 30rpx; + .live-img { + width: 100%; + height: 100%; + border-radius: 24rpx; + } + } + .item { + margin-right: 30rpx; + flex-shrink: 0; + width: 418rpx; + border-radius: 24rpx; + border: 1px solid #d6d9e1; + .photo-wrap { + position: relative; + width: 100%; + height: 235rpx; + border-radius: 24rpx 24rpx 0 0; + .photo { + width: 100%; + height: 100%; + border-radius: 24rpx 24rpx 0 0; + } + .status { + position: absolute; + left: 0; + top: 0; + padding: 5rpx 18rpx; + background: #ffffff linear-gradient(136deg, #e7eeff 0%, #fde0ea 100%); + border-radius: 24rpx 0 24rpx 0; + display: flex; + align-items: center; + font-size: 24rpx; + color: #cf5375; + .dot { + margin-right: 10rpx; + width: 10rpx; + height: 10rpx; + border-radius: 50%; + background: #cf5375; + } + &.bad { + color: #484848; + background: #e6e6e6; + .dot { + display: none; + } + } + } + .date { + padding: 18rpx 18rpx 8rpx; + position: absolute; + left: 40rpx; + bottom: 0; + background: #e04775; + border-radius: 11rpx 11rpx 0rpx 0rpx; + text-align: center; + .d-title { + font-size: 22rpx; + color: #ffffff; + font-weight: bold; + .icon { + margin-right: -10rpx; + } + } + .ymd { + font-size: 18rpx; + color: #fff; + line-height: 28rpx; + border-bottom: 2rpx solid rgba(255, 255, 255, 0.34); + } + .hm { + font-size: 18rpx; + color: #fff; + line-height: 28rpx; + } + } + } + .content { + padding: 24rpx 28rpx; + display: flex; + align-items: center; + border-radius: 0 0 24rpx 24rpx; + background-color: #fff; + .name { + max-width: 4em; + font-size: 28rpx; + color: #666666; + font-weight: bold; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + } + .labels { + margin-left: 10rpx; + flex: 1; + .label { + display: block; + font-size: 24rpx; + color: #cccccc; + max-width: 4em; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + } + .label:not(:first-of-type) { + display: none; + } + } + .btn { + flex-shrink: 0; + padding: 0 13rpx; + height: 48rpx; + line-height: 48rpx; + font-size: 28rpx; + font-weight: bold; + color: #cf5375; + border-radius: 24rpx; + background: #ffffff linear-gradient(136deg, #e7eefe 0%, #fee0ea 100%); + display: flex; + align-items: center; + justify-content: center; + .icon { + width: 40rpx; + height: 40rpx; + } + } + } + } + } + &.live-container-drugs { + .scroll { + .item { + .content { + .btn { + .icon { + margin-right: 10rpx; + width: 24rpx; + height: 24rpx; + } + background: #25d9c8; + color: #fff; + } + } + } + } + } + } + } + .live-up-new { + margin: 0 40rpx; + .l-banner { + width: 100%; + height: 834rpx; + border-radius: 24rpx; + .live-img { + width: 100%; + height: 100%; + object-fit: cover; + } + } + .item { + margin-top: 24rpx; + padding: 24rpx; + background: #ffffff; + border-radius: 24rpx; + display: flex; + .photo-wrap { + flex-shrink: 0; + width: 182rpx; + height: 182rpx; + position: relative; + .photo { + width: 100%; + height: 100%; + border-radius: 24rpx; + } + .status { + position: absolute; + bottom: 0; + left: 0; + width: 100%; + height: 40rpx; + font-size: 24rpx; + color: #fff; + display: flex; + align-items: center; + justify-content: center; + gap: 10rpx; + background-color: rgba(0, 0, 0, 0.46); + border-radius: 0 0 24rpx 24rpx; + .icon { + width: 20rpx; + height: 20rpx; + } + &.active { + background-color: rgba(207, 83, 117, 1); + } + } + } + .content { + flex: 1; + padding-left: 24rpx; + display: flex; + flex-direction: column; + justify-content: space-between; + .name { + font-size: 32rpx; + color: rgba(72, 72, 72, 1); + font-weight: bold; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + } + .labels { + margin-top: 16rpx; + max-width: 56vw; + font-size: 28rpx; + color: rgba(173, 173, 173, 1); + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + } + .c-footer { + margin-top: 20rpx; + display: flex; + align-items: center; + justify-content: space-between; + gap: 20rpx; + padding: 0 0 0 16rpx; + background-color: rgba(250, 250, 250, 1); + border-radius: 48rpx; + .date { + font-size: 24rpx; + color: rgba(72, 72, 72, 1); + } + .btn { + width: 128rpx; + height: 48rpx; + display: flex; + align-items: center; + justify-content: center; + gap: 8rpx; + background-color: rgba(207, 83, 117, 1); + border-radius: 24rpx; + font-size: 24rpx; + color: rgba(255, 255, 255, 1); + .icon { + width: 24rpx; + height: 24rpx; + } + } + } + } + } + } + .story { + margin: $page-margin 0; + .header { + margin: 0 $page-margin; + display: flex; + align-items: center; + justify-content: space-between; + .title { + font-size: 32rpx; + color: #474747; + font-weight: bold; + } + .more { + font-size: 24rpx; + color: #cccccc; + } + } + .story-container { + position: relative; + margin-top: 24rpx; + overflow-x: auto; + overflow-y: hidden; + &::-webkit-scrollbar { + display: none; + } + &::after { + position: sticky; + left: 0; + bottom: 0; + margin-top: -253rpx; + display: block; + content: ''; + width: 100vw; + height: 253rpx; + background: #cf5375; + } + &.story-container-drugs { + &::after { + display: none; + } + } + .scroll { + position: relative; + display: flex; + flex-wrap: nowrap; + padding-left: $page-margin; + padding-bottom: 55rpx; + .story-item { + position: relative; + z-index: 1; + flex-shrink: 0; + width: 281rpx; + height: 375rpx; + margin-right: 40rpx; + .story-img { + width: 100%; + height: 100%; + border-radius: 24rpx; + } + .story-content { + position: absolute; + left: 0; + bottom: 0; + padding: 40rpx 29rpx 26rpx; + box-sizing: border-box; + width: 100%; + font-size: 24rpx; + line-height: 32rpx; + color: #273a65; + font-weight: bold; + background: linear-gradient(180deg, rgba(236, 236, 236, 0) 0%, rgba(236, 236, 236, 1) 100%); + border-radius: 0 0 24rpx 24rpx; + } + } + } + } + } + .server { + margin: $page-margin; + .header { + display: flex; + align-items: center; + justify-content: space-between; + .title { + font-size: 32rpx; + color: #474747; + font-weight: bold; + } + .more { + font-size: 24rpx; + color: #cccccc; + } + } + .server-container { + margin-top: 24rpx; + .two { + display: flex; + justify-content: space-between; + .item { + position: relative; + flex: 1; + height: 163rpx; + display: flex; + justify-content: flex-end; + .item-bg { + width: 100%; + height: 100%; + border-radius: 24rpx; + border: 1px solid #d7dae1; + } + .item-container { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + border: 2px solid #d7dae1; + padding: 28rpx 31rpx; + box-sizing: border-box; + border-radius: 24rpx; + .title { + font-size: 28rpx; + font-weight: bold; + color: #666666; + } + .line { + margin-top: 20rpx; + width: 25rpx; + height: 4rpx; + background-color: #666666; + } + .en { + margin-top: 20rpx; + font-size: 20rpx; + color: #666666; + } + .icon { + position: absolute; + bottom: 0; + right: 0; + border-radius: 0 0 24rpx 0; + width: 106rpx; + height: 107rpx; + } + } + } + .item:not(:first-of-type) { + margin-left: 30rpx; + } + } + .four { + margin-top: 24rpx; + padding: 22rpx 30rpx; + border-radius: 24rpx; + background-color: #fff; + display: flex; + align-items: center; + border: 1px solid #d5d8e0; + .item { + flex: 1; + text-align: center; + .icon { + width: 95rpx; + height: 95rpx; + } + .name { + font-size: 24rpx; + color: #666666; + } + } + } + } + } + .new-server { + margin: $page-margin; + padding: 24rpx 32rpx; + border-radius: 32rpx; + .title { + font-size: 32rpx; + color: #333333; + font-weight: bold; + line-height: 40rpx; + } + .list { + margin-top: 24rpx; + padding: 12rpx 0 48rpx; + border-radius: 24rpx; + display: flex; + align-items: center; + gap: 20rpx; + .item { + flex: 1; + text-align: center; + .icon { + display: inline-block; + width: 104rpx; + height: 104rpx; + } + .name { + margin-top: 12rpx; + font-size: 28rpx; + color: #666666; + } + } + } + } + .book { + margin: $page-margin; + .header { + display: flex; + align-items: center; + justify-content: space-between; + .title { + font-size: 32rpx; + color: #474747; + font-weight: bold; + } + .more { + font-size: 24rpx; + color: #cccccc; + } + } + .swiper { + margin: 0 -40rpx; + height: 700rpx; + .swiper-item { + padding: 32rpx 40rpx; + box-sizing: border-box; + .book-list { + padding: 0 32rpx; + border-radius: 32rpx; + box-shadow: 0 0 32rpx 1rpx rgba(0, 0, 0, 0.08); + + .card { + padding: 32rpx 0; + display: flex; + > view:not(:last-of-type), + > image { + margin-right: 24rpx; + } + + .cover { + flex-shrink: 0; + width: 210rpx; + height: 140rpx; + position: relative; + + .photo { + width: 100%; + height: 100%; + border-radius: 8rpx; + } + + .label { + position: absolute; + top: 12rpx; + left: 0; + font-size: 16rpx; + color: #fff; + padding: 4rpx 10rpx; + background-color: #293b61; + } + } + + .content { + font-size: 28rpx; + color: #666666; + font-weight: bold; + .title { + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; + } + } + } + + .card:not(:last-of-type) { + border-bottom: 1rpx solid rgba(152, 175, 225, 0.5); + } + } + } + + .wx-swiper-dot-active { + width: 30rpx !important; + } + + .wx-swiper-dot { + width: 9rpx; + height: 6rpx; + border-radius: 2rpx; + } + } + } + } + .reg { + position: fixed; + left: 64rpx; + bottom: calc(env(safe-area-inset-bottom) + 120rpx); + width: 622rpx; + background-color: rgba(39, 58, 101, 0.8); + box-shadow: 0 8rpx 24rpx rgba(92, 144, 220, 0.25); + height: 84rpx; + line-height: 84rpx; + border-radius: 24rpx; + font-size: 30rpx; + color: #ffffff; + text-align: center; + .blod { + font-weight: bold; + } + .reg-close { + position: absolute; + right: -10rpx; + top: -10rpx; + width: 40rpx; + height: 40rpx; + } + } + .reg-audit { + position: fixed; + left: 34rpx; + bottom: calc(env(safe-area-inset-bottom) + 120rpx); + width: 682rpx; + background-color: rgba(39, 58, 101, 0.8); + box-shadow: 0 8rpx 24rpx rgba(92, 144, 220, 0.25); + height: 84rpx; + line-height: 84rpx; + border-radius: 24rpx; + font-size: 30rpx; + color: #ffffff; + text-align: center; + .blod { + font-weight: bold; + } + } + .public { + position: fixed; + left: 30rpx; + bottom: calc(env(safe-area-inset-bottom) + 120rpx); + width: 690rpx; + height: 152rpx; + box-shadow: 0rpx 2rpx 16rpx 0rpx #390f1b2d; + border-radius: 24rpx; + background: linear-gradient(346deg, #ffffff 0%, #ffe2eb 100%); + border: 2rpx solid #ffffff; + display: flex; + align-items: center; + justify-content: space-between; + box-sizing: border-box; + padding: 0 48rpx 0 32rpx; + .logo { + flex-shrink: 0; + width: 88rpx; + height: 88rpx; + } + .wrap { + padding: 0 24rpx; + flex: 1; + .title { + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + font-weight: bold; + } + .content { + margin-top: 4rpx; + font-size: 28rpx; + color: rgba(154, 161, 162, 1); + } + } + .btn { + width: 158rpx; + height: 64rpx; + font-size: 32rpx; + color: rgba(255, 255, 255, 1); + display: flex; + align-items: center; + justify-content: center; + background: #cf5375; + border-radius: 12rpx 12rpx 12rpx 12rpx; + } + .close { + position: absolute; + top: 0; + right: 0; + width: 48rpx; + height: 48rpx; + } + } +} + +.slidearea { + width: 30rpx; + position: fixed; + right: 0; + top: 0; + height: calc(100vh - env(safe-area-inset-bottom) - 120rpx); + // background-color: #000; + z-index: 10; + .mview { + position: relative; + width: 30rpx; + height: 30rpx; + .slidebar { + position: absolute; + top: 15rpx; + left: 40rpx; + transform: translate(-100%, -50%); + padding: 20rpx; + width: 346rpx; + height: 234rpx; + white-space: nowrap; + } + } +} + +.question { + position: fixed; + z-index: 10; + width: 154rpx; + height: 136rpx; + right: 28rpx; + bottom: 242rpx; + &-img { + width: 100%; + height: 100%; + } +} + +.official-account { + position: fixed; + bottom: 180rpx; + left: 20rpx; + width: calc(100% - 40rpx); +} diff --git a/src/pages/index/index.ts b/src/pages/index/index.ts new file mode 100644 index 0000000..1809101 --- /dev/null +++ b/src/pages/index/index.ts @@ -0,0 +1,682 @@ +import dayjs from 'dayjs' +const app = getApp() +const licia = require('miniprogram-licia') + +Page({ + data: { + today: dayjs().format('YYYY年MM月DD日 dddd'), + + configList: [], + infoList: [], + storyList: [], + userInfo: {} as any, + anyWhere: false, + regGuide: true, + + adlList: [], + adlNum: '', + adlNewRecord: {} as any, + + liveList: [], + liveStatus: app.globalData.liveStatus, + + liveDownList: [], + + detail: {}, + + referralFromShow: false, + publicCard: false, + + // toastShow: true, + // toastType: "doubleStandards", + // toastType: "vipScan", + // toastType: "healthCare", + // toastType: "aldAlert", + // toastType: "dedicatedDoctor", + // toastType: 'referral-toast', + // toastType: 'public-toast', + // toastType: 'recommendDoctor', + // toastType: 'recommendBindDoctor', + + toastShow: false, + toastType: '', + toastParams: {} as any, + + sliderTop: 0, + + unreadCount: 0, + + options: {} as any, + + firstLogin: '', + }, + onLoad(options) { + const systemInfo = wx.getSystemInfoSync() + + app.getTheme().then((res) => { + this.setData({ + theme: res, + }) + }) + + this.setData({ + sliderTop: systemInfo.screenHeight - 160, + options, + firstLogin: options.fl, + }) + }, + onShow() { + app.waitLogin({}).then(() => { + app.mpBehavior({ PageName: 'PG_PATIENTHOME' }) + this.setData({ + anyWhere: app.globalData.anyWhere, + }) + if (this.data.options.es === '201501') { + app.globalData.IsAliQiWei = 1 + app.mpBehavior({ PageName: 'JUMP_PATIENT_HOME_INDEX' }) + this.setData({ + options: {}, + }) + app.permissionVerification(3, 0).then(() => { + wx.ajax({ method: 'POST', url: '?r=igg4/account/update-aliqiwei', data: {} }).then(() => { + if (Object.keys(this.data.userInfo).length > 0) { + app.getUserInfo(this, true, (userInfo) => { + this.getConfig(userInfo) + }) + } + }) + }) + } + app.getUserInfo(this, true, (userInfo) => { + this.setData({ + userInfo, + publicCard: userInfo.isShowFollowGuide == 1, + }) + if (this.data.firstLogin != '1' || userInfo.EntryFourPeriod != 1) { + this.getPopup() + } else { + this.setData({ + firstLogin: '', + }) + } + this.getConfig(userInfo) + this.getSystemConfig() + if (userInfo.ExclusiveDoctorId > 0) { + this.getUnreadCount() + } + + if (userInfo.UserType == 4) { + this.getLastRecord() + } + }) + }) + }, + getUnreadCount() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/message-interact/get-unread-count', + data: {}, + }).then((res) => { + this.setData({ + unreadCount: res, + }) + }) + }, + getSystemConfig() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/common/get-config', + data: {}, + }).then((res) => { + this.setData({ + systemConfig: res, + }) + }) + }, + getLastRecord() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/medication/last-record', + }).then((res) => { + this.setData({ + detail: { + weekName: dayjs(res.InjectionDate).format('ddd'), + days: dayjs().diff(res.InjectionDate, 'day'), + ...res, + }, + }) + }) + }, + getConfig(userInfo: any) { + let UserType = userInfo.UserType + if (UserType <= 2) { + UserType = 1 + } + wx.ajax({ + method: 'GET', + url: `?r=igg4/mini-conf/get-config`, + data: { userType: UserType }, + }).then((res) => { + res = res.map((item: any) => { + if (item.code == 'spread1' || item.code == 'spread2' || item.code == 'serviceConf') { + item.subList = item.subList.filter((subItem) => { + return subItem.showStatus == 1 + }) + } + if (item.name === 'BANNER-MINIDOVTOR') { + item.subList = item.subList.filter((subItem: any) => { + if (subItem.linkUrl == 'MINIDOCTOR-4.0' && userInfo.EntryFourPeriod != 1) { + return false + } + // if (subItem.linkUrl == 'MINIDOCTOR-1.0') { + // return false + // } + if (subItem.linkUrl == 'MINIDOCTOR' && userInfo.EntryTwoPeriowd != 1) { + return false + } + return true + }) + } + return item + }) + this.setData({ + configList: res, + }) + res.forEach((item) => { + if (item.code == 'article') { + this.getInfoList(item.configId) + } + if (item.code == 'story') { + this.getStoryList(item.configId) + } + if (item.code == 'adl') { + this.getAdl() + } + if (item.code == 'activity2') { + this.getActivity(item.configId, item.showNum, 'liveList') + } + if (item.code == 'activity1') { + this.getActivity(item.configId, item.showNum, 'liveDownList') + } + }) + }) + }, + async getPopup() { + const data5 = await wx.ajax({ + method: 'GET', + url: '?r=igg4/popup/info', + data: { + Type: 5, + }, + }) + if (data5.showAlert) { + this.setData({ + toastShow: data5.showAlert, + toastType: 'doubleStandards', + toastParams: data5, + }) + + return + } + + const data4 = await wx.ajax({ + method: 'GET', + url: '?r=igg4/popup/info', + data: { + Type: 4, + }, + }) + if (data4.showAlert) { + this.setData({ + toastShow: data4.showAlert, + toastType: 'vipScan', + toastParams: {}, + }) + return + } + + const data1 = await wx.ajax({ + method: 'GET', + url: '?r=igg4/popup/info', + data: { Type: 1 }, + }) + if (!Array.isArray(data1)) { + this.setData({ + toastShow: true, + toastType: 'healthCare', + toastParams: data1, + }) + return + } + + const data2 = await wx.ajax({ + method: 'GET', + url: '?r=igg4/popup/info', + data: { + Type: 2, + }, + }) + if (data2.showAlert && this.data.userInfo.UserType == 4) { + this.setData({ + toastShow: data2.showAlert, + toastType: 'aldAlert', + toastParams: { + id: data2.articleId, + }, + }) + return + } + + const data3 = await wx.ajax({ + method: 'GET', + url: '?r=igg4/popup/info', + data: { + Type: 6, + }, + }) + if (data3.showAlert) { + this.setData({ + toastShow: data3.showAlert, + toastType: data3.isRecommend ? 'recommendBindDoctor' : 'dedicatedDoctor', + toastParams: { + ...data3.doctorInfo, + }, + }) + return + } + + const data6 = await wx.ajax({ + method: 'GET', + url: '?r=igg4/re-visit/get-popup-show-status', + }) + if (data6.showStatus === 1) { + this.setData({ + toastShow: true, + toastType: 'referral-toast', + toastParams: {}, + }) + return + } + + const data7 = await wx.ajax({ + method: 'GET', + url: '?r=igg4/popup/info', + data: { + Type: 7, + }, + }) + if (data7.showAlert) { + this.setData({ + toastShow: data7.showAlert, + toastType: 'recommendDoctor', + toastParams: { + ...data7.doctorInfo, + }, + }) + } + }, + setPopupInfo() { + wx.ajax({ + method: 'POST', + url: '?r=igg4/popup/update-click-status', + data: { + Type: 1, + Id: this.data.toastParams.Id, + }, + }).then((_res) => {}) + }, + setBannerClick() { + wx.ajax({ + method: 'POST', + url: '?r=igg4/nrdl/add-banner-click-record', + data: {}, + }) + }, + getInfoList(configId: string) { + wx.ajax({ + method: 'GET', + url: '?r=igg4/pic-text/index-list', + data: { + count: 0, + ConfigId: configId, + }, + }).then((res) => { + this.setData({ + infoList: licia.chunk(res.list, 3), + }) + }) + }, + getStoryList(configId: string) { + wx.ajax({ + method: 'GET', + url: '?r=igg4/story/index-list', + data: { + count: 0, + ConfigId: configId, + }, + }).then((res) => { + this.setData({ + storyList: res.list, + }) + }) + }, + getAdl() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/adl/index', + data: {}, + }).then((res) => { + const newRecord = res.newRecord + this.setData({ + adlList: res.list, + adlNum: res.count, + adlNewRecord: { + days: dayjs().diff(newRecord.CreateTime, 'day'), + ...newRecord, + newCreateTime: dayjs(newRecord.CreateTime).format('YYYY-MM-DD'), + }, + }) + }) + }, + getActivity(ConfigId: string, count: number, key: string) { + wx.ajax({ + method: 'GET', + url: '?r=igg4/activity/index-list', + data: { ConfigId, count }, + }).then((res) => { + this.setData({ + [key]: res.list.map((item) => { + item.EndTimeValue = dayjs(item.EndTime).valueOf() + item.BeginTimeValue = dayjs(item.BeginTime).valueOf() + item.SignUpDeadlineValue = dayjs(item.SignUpDeadline).valueOf() + item.BeginDate = dayjs(item.BeginTime).format('YYYY-MM-DD') + item.EndDate = dayjs(item.EndTime).format('YYYY-MM-DD') + item.isDay = item.BeginDate == item.EndDate + item.BeginHm = dayjs(item.BeginTime).format('HH:mm') + item.EndHm = dayjs(item.EndTime).format('HH:mm') + item.BeginTime = dayjs(item.BeginTime).format('YYYY-MM-DD HH:mm') + item.EndTime = dayjs(item.EndTime).format('YYYY-MM-DD HH:mm') + return item + }), + }) + }) + }, + routerTo(e) { + let { url, active, code } = e.currentTarget.dataset + if (!url) return + if (code === 'adl') { + app.mpBehavior({ PageName: 'BTN_PATIENTHOMEADLMODULE' }) + } + if (code === 'drugs') { + app.mpBehavior({ PageName: 'BTN_PATIENTHOMEMEDICATIONMODULE' }) + } + if (code === 'story' && url === '/pages/story/index') { + app.mpBehavior({ PageName: 'BTN_PATIENTHOMESTORIESVIEWALL' }) + } + if (code === 'story' && url.includes('/pages/publishStoryDetail/index')) { + app.mpBehavior({ PageName: 'BTN_PATIENTHOMESTORYCLICK' }) + } + if (code === 'activity2' && url === '/pages/live/index') { + app.mpBehavior({ PageName: 'BTN_PATIENTHOMEONLINEACTIVITIESVIEWALL' }) + } + if (code === 'activity2' && url === '/pages/live/index?index=0') { + app.mpBehavior({ PageName: 'BTN_PATIENTHOMEONLINEACTIVITIESMONTHLYPOSTER' }) + } + if (code === 'activity2' && url.includes('/pages/liveDetail/index')) { + app.mpBehavior({ PageName: 'BTN_PATIENTHOMEONLINEACTIVITIESCARD' }) + } + if (code === 'activity1' && url === '/pages/live/index') { + app.mpBehavior({ PageName: 'BTN_PATIENTHOMEOFFLINEACTIVITIESVIEWALL' }) + } + if (code === 'activity1' && url.includes('/pages/liveDetail/index')) { + app.mpBehavior({ PageName: 'BTN_PATIENTHOMEOFFLINEACTIVITIESCARD' }) + } + if (code === 'article' && url === '/pages/repository/index') { + app.mpBehavior({ PageName: 'BTN_PATIENTHOMERECOMMENDEDREADINGVIEWALL' }) + } + if (code === 'article' && url.includes('/pages/repositoryDetail/index')) { + app.mpBehavior({ PageName: 'BTN_PATIENTHOMERECOMMENDEDREADINGARTICLE' }) + } + if (code === 'serviceConf') { + app.mpBehavior({ PageName: 'BTN_PATIENTHOMESERVICE' }) + } + if (url === '/pages/interactivePatient/index') { + app.mpBehavior({ PageName: 'BTN_PATIENTHOMEDOCTORCARD' }) + } + + if (url === 'NRDL') { + this.setBannerClick() + this.handleNRDL() + return + } + + if (url.includes('loginState')) { + url = url + encodeURIComponent(app.globalData.loginState) + app.permissionVerification(2, 11, `/pages/repository/index`).then(() => { + wx.navigateTo({ + url, + }) + }) + return + } + + wx.navigateTo({ + url, + fail() { + app.globalData.active = active + wx.switchTab({ + url, + }) + }, + }) + }, + handleReg() { + app.permissionVerification(3, 0, '') + }, + handleMiniDoctor(e) { + const { link } = e.currentTarget.dataset + let period = '' + if (link === 'MINIDOCTOR-1.0') { + period = '2' + } + wx.navigateTo({ + url: `/pages/webview/index?period=${period}`, + }) + }, + handleQuestion() { + app.permissionVerification(2, 11, `/pages/repository/index`).then(() => { + const webviewUrl = encodeURIComponent( + `${app.globalData.url}/zdcare/#/info?loginState=${app.globalData.loginState}`, + ) + wx.navigateTo({ + url: `/pages/webview/index?url=${webviewUrl}`, + }) + }) + }, + handleSlider() { + wx.ajax({ + method: 'POST', + url: '?r=igg4/nrdl/add-slide-click-record', + data: {}, + }) + this.handleNRDL() + }, + handleNRDL() { + app.permissionVerification(3, 12, `/pages/index/index`).then(() => { + wx.navigateTo({ + url: `/pages/nrdl/index`, + }) + // if (this.data.userInfo.has7DayAdl === 1) { + // wx.navigateTo({ + // url: `/pages/nrdl/index`, + // }); + // } else { + // this.setData({ + // toastShow: true, + // toastType: "ndrlAldAlert", + // }); + // } + }) + }, + routerVipTo() { + const { MedicineAuditSwitch, UseDrugsAuditStatus, isFollow } = this.data.userInfo + if (MedicineAuditSwitch === '0') { + wx.navigateTo({ + url: '/pages/vipLogin/index', + }) + } else if (MedicineAuditSwitch === '1') { + const pendPath = { + 0: '/gift/pages/vipPending/index', + 1: '/gift/pages/vipStartPending/index', + }[isFollow] + const url = { + 1: pendPath, + 2: '/gift/pages/vipReject/index', + }[UseDrugsAuditStatus] + wx.navigateTo({ + url: url || '/gift/pages/vipCert/index', + }) + } else { + wx.showToast({ + icon: 'none', + title: '工程师正在努力建设中,敬请期待!', + }) + } + }, + handleToastOk() { + const { toastType } = this.data + if (toastType === 'vipScan') { + this.routerVipTo() + this.handleToastCancel() + } else if (toastType === 'aldAlert') { + wx.navigateTo({ + url: '/pages/adl/index', + }) + this.handleToastCancel() + } else if (toastType === 'healthCare') { + this.setPopupInfo() + this.handleNRDL() + this.handleToastCancel() + } else if (toastType === 'ndrlAldAlert') { + wx.navigateTo({ + url: '/pages/adl/index?nrdl=1', + }) + this.handleToastCancel() + } else if (toastType === 'doubleStandards') { + wx.navigateTo({ + url: '/pages/adl/index', + }) + this.handleToastCancel() + } else if (toastType === 'dedicatedDoctor' || toastType === 'recommendBindDoctor') { + wx.ajax({ + method: 'POST', + url: '?r=igg4/popup/close-popup', + data: { + Type: 6, + }, + }).then((_res) => { + if (toastType === 'dedicatedDoctor') { + wx.navigateTo({ + url: '/pages/interactivePatient/index', + }) + } + app.getUserInfo(this, true) + }) + this.handleToastCancel(null, false) + } else if (toastType === 'referral-toast') { + this.setData({ + referralFromShow: true, + }) + wx.ajax({ + method: 'POST', + url: '?r=igg4/re-visit/update-popup-show-status', + data: {}, + }) + this.handleToastCancel(null, false) + } else if (toastType === 'recommendDoctor') { + wx.ajax({ + method: 'POST', + url: '?r=igg4/popup/close-popup', + data: { + Type: 7, + }, + }).then(() => { + wx.navigateTo({ + url: '/pages/doctor/index?active=4', + }) + }) + this.handleToastCancel(null, false) + } + }, + handleToastCancel(_e = null, sure = true) { + const { toastType } = this.data + if (toastType === 'doubleStandards' && sure) { + wx.ajax({ + method: 'POST', + url: '?r=igg4/popup/close-popup', + data: { + Type: 5, + }, + }) + } else if ((toastType === 'dedicatedDoctor' || toastType === 'recommendBindDoctor') && sure) { + wx.ajax({ + method: 'POST', + url: '?r=igg4/popup/close-popup', + data: { + Type: 6, + }, + }) + app.getUserInfo(this, true) + } else if (toastType === 'referral-toast' && sure) { + wx.ajax({ + method: 'POST', + url: '?r=igg4/re-visit/update-popup-show-status', + data: {}, + }) + } else if (toastType === 'recommendDoctor' && sure) { + wx.ajax({ + method: 'POST', + url: '?r=igg4/popup/close-popup', + data: { + Type: 7, + }, + }) + } + this.setData({ + toastShow: false, + toastType: '', + toastParams: '', + }) + }, + handlePublic() { + this.setData({ + toastShow: true, + toastType: 'public-toast', + toastParams: {}, + }) + this.handlePublicClose() + }, + handlePublicClose() { + this.setData({ + publicCard: false, + }) + wx.ajax({ + method: 'POST', + url: '?r=igg4/account/add-user-subscribe-guide-record', + data: {}, + }) + }, + handleMp(e: any) { + const { code } = e.currentTarget.dataset + const PageName = { + spread1: 'BTN_PATIENTHOMEBANNER1', + spread2: 'BTN_PATIENTHOMEBANNER2', + }[code] + app.mpBehavior({ PageName }) + }, + handleRegClose() { + this.setData({ + regGuide: false, + }) + }, +}) diff --git a/src/pages/index/index.wxml b/src/pages/index/index.wxml new file mode 100644 index 0000000..366943e --- /dev/null +++ b/src/pages/index/index.wxml @@ -0,0 +1,512 @@ + + + + + + + + + {{today}} + + 今天是重症肌无力加油站陪伴你的第 + {{userInfo.JoinDays}} + 天 + + + + + + + + + + + + + + + {{userInfo.ExclusiveDoctorName}} + + + + 医生给您留言了,记得查看! + + {{userInfo.ExclusiveDoctorHospitalName}} + + {{userInfo.ExclusiveDoctorHospitalClassificationName}}{{userInfo.ExclusiveDoctorHospitalLevelName}} + + + + + {{unreadCount ? '去看看':'去咨询'}} + + + + + + + + + + + + + + + 最近一次测评 {{adlNewRecord.newCreateTime}} + + + 立即自测 + + + + + + + + + + + + + + + + + 连续治疗 {{detail.Times}} 次 + + + 查看健康档案 + + + + + + 上次治疗日期 + + {{detail.InjectionDate}} + {{detail.weekName}} + + + + 距离上次用药 + + + 今天治疗 + + + {{detail.days}} + + + + 更新记录 + + + + + + + + + 展示您的注射信息 + 开启您的专属服务 + + + 开始记录 + + + + + + + + + ADL提醒 + + + + + + 随访服务 + + + + + + 健康报告 + + + + + + + {{card.name}} + + 查看全部 + + + + + + + + + + + + + + + {{card.name}} + + 查看全部 + + + + + + + + + + + + + + {{liveStatus[item.Status]}} + + + + + + + + + + + + + + + + + + {{item.MasterName}} + + + {{item.MasterTitle}} + + + + {{item.Status==2?'参会':'查看'}} + + + + + + + + + + + + + + + + + {{liveStatus[item.Status]}} + + + + + + + + + + + + + + + + + + {{item.Name}} + + {{item.doctorName}}{{item.hospitalName ? ' | ' + item.hospitalName : ''}} + + + {{item.BeginTime}} + + + {{item.Status==2?'参会':'查看'}} + + + + + + + + {{card.name}} + + 查看全部 + + + + + + + + {{item.Title}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + 就诊地图 + + + + + {{item.title}} + + + + + + + {{card.name}} + + 查看全部 + + + + + + + + + + + {{item.CateName}} + + + {{item.Title}} + + + + + + + + + + + 注册 + 后享受全面重症肌无力患者服务 + + + + + 您的认证正在审核中,审核通过后获取全部服务 + + + + + + + 关注公众号 + 重要提醒不丢失~ + + 去关注 + + + + + + + + + + + + + + + + + + diff --git a/src/pages/infusionCenter/index.json b/src/pages/infusionCenter/index.json new file mode 100644 index 0000000..db5eb9b --- /dev/null +++ b/src/pages/infusionCenter/index.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "输注中心", + "usingComponents": {} +} diff --git a/src/pages/infusionCenter/index.scss b/src/pages/infusionCenter/index.scss new file mode 100644 index 0000000..241b2f3 --- /dev/null +++ b/src/pages/infusionCenter/index.scss @@ -0,0 +1,108 @@ +.page { + position: relative; + .banner { + width: 100%; + min-height: 344rpx; + } + .container { + padding: 48rpx 40rpx; + position: absolute; + top: 316rpx; + left: 0; + width: 100%; + min-height: 100vh; + border-radius: 24rpx 24rpx 0 0; + background-color: #fafafa; + box-sizing: border-box; + .title { + font-size: 36rpx; + color: #484848; + font-weight: bold; + } + .tags { + margin-top: 16rpx; + display: flex; + .tag { + margin-right: 16rpx; + padding-right: 8rpx; + font-size: 22rpx; + color: #e04775; + line-height: 1; + border-radius: 8rpx; + background-color: #f5dfe6; + display: flex; + align-items: center; + .icon { + margin-right: 8rpx; + padding: 4rpx; + width: 24rpx; + max-height: 24rpx; + background-color: #e04775; + border-radius: 8rpx; + } + } + } + .content { + margin-top: 32rpx; + display: flex; + justify-content: space-between; + .inner { + .site { + font-size: 28rpx; + color: #9e9e9e; + } + .tel { + margin-top: 16rpx; + font-size: 28rpx; + color: #9b9ea6; + } + } + .options { + flex-shrink: 0; + padding-left: 20rpx; + border-left: 1px solid rgba(235, 236, 238, 62%); + flex-shrink: 0; + display: flex; + .option { + margin-left: 30rpx; + .phone { + margin: 0 auto; + width: 44rpx; + height: 44rpx; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + background-color: #fff; + box-shadow: 0 4rpx 20rpx 0 rgba(0, 0, 0, 0.1); + &-img { + width: 30rpx; + height: 30rpx; + } + } + .name { + margin-top: 8rpx; + font-size: 28rpx; + color: #9e9e9e; + } + } + } + } + + .remark { + padding: 32rpx; + border-radius: 24rpx; + background-color: #fff; + .r-title { + font-size: 32rpx; + color: #484848; + font-weight: bold; + } + .r-content { + margin-top: 20rpx; + font-size: 28rpx; + color: #9e9e9e; + } + } + } +} diff --git a/src/pages/infusionCenter/index.ts b/src/pages/infusionCenter/index.ts new file mode 100644 index 0000000..3c0a3fa --- /dev/null +++ b/src/pages/infusionCenter/index.ts @@ -0,0 +1,52 @@ +const app = getApp() + +Page({ + data: { + id: '', + detail: {} as any, + }, + onLoad(options) { + this.setData({ + id: options.id, + }) + app.waitLogin().then(() => { + this.getDetail() + }) + }, + + getDetail() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/infusion-center/detail', + data: { + Id: this.data.id, + }, + }).then((res) => { + this.setData({ + detail: res, + }) + }) + }, + handleSite() { + const { LNG, LAT, ProvinceName, CityName, CountyName, Address, Name } = this.data.detail + wx.openLocation({ + latitude: LAT, + longitude: LNG, + name: Name, + address: `${ProvinceName}${CityName}${CountyName}${Address}`, + }) + }, + handlePhone() { + const tel = this.data.detail.Telephone + if (!tel) { + wx.showToast({ + icon: 'none', + title: '电话暂未开通', + }) + return + } + wx.makePhoneCall({ + phoneNumber: tel, + }) + }, +}) diff --git a/src/pages/infusionCenter/index.wxml b/src/pages/infusionCenter/index.wxml new file mode 100644 index 0000000..f45b8fa --- /dev/null +++ b/src/pages/infusionCenter/index.wxml @@ -0,0 +1,42 @@ + + + + {{detail.Name}} + + + + + 自有输注中心 + + + + + 合作输注中心 + + + + + {{detail.ProvinceName}}{{detail.CityName}}{{detail.CountyName}}{{detail.Address}} + {{detail.Telephone}} + + + + + + + 电话 + + + + + + 地址 + + + + + + + + + diff --git a/src/pages/interactivePatient/index.json b/src/pages/interactivePatient/index.json new file mode 100644 index 0000000..a3970b4 --- /dev/null +++ b/src/pages/interactivePatient/index.json @@ -0,0 +1,8 @@ +{ + "navigationBarTitleText": "互动", + "usingComponents": { + "van-icon": "@vant/weapp/icon/index", + "van-loading": "@vant/weapp/loading/index", + "referralFrom": "/components/referralFrom/index" + } +} diff --git a/src/pages/interactivePatient/index.scss b/src/pages/interactivePatient/index.scss new file mode 100644 index 0000000..059672c --- /dev/null +++ b/src/pages/interactivePatient/index.scss @@ -0,0 +1,600 @@ +page { + background-color: rgba(242, 244, 245, 1); +} +.page { + height: 100vh; + overflow: hidden; + display: flex; + flex-direction: column; + justify-content: space-between; + .page-header { + flex-shrink: 0; + padding: 30rpx; + display: flex; + align-items: center; + justify-content: space-between; + border-radius: 0 0 24rpx 24rpx; + background-color: #fff; + .avatar { + width: 104rpx; + height: 104rpx; + border-radius: 50%; + } + .wrap { + flex: 1; + padding: 0 20rpx; + .name { + font-size: 40rpx; + color: rgba(40, 48, 49, 1); + font-weight: bold; + } + .content { + margin-top: 8rpx; + font-size: 28rpx; + color: rgba(154, 161, 162, 1); + display: flex; + gap: 8rpx; + align-items: start; + .tag { + margin-top: 7rpx; + padding: 0 10rpx; + flex-shrink: 0; + height: 28rpx; + font-size: 22rpx; + color: rgba(229, 154, 41, 1); + line-height: 1; + text-align: center; + line-height: 28rpx; + background: rgba(229, 154, 41, 0.29); + border-radius: 8rpx 8rpx 8rpx 8rpx; + } + } + } + .more { + color: #d4d9da; + } + } + .page-container { + flex: 1; + overflow: hidden; + .scroll-view { + height: 100%; + .date { + padding-top: 20rpx; + font-size: 28rpx; + color: rgba(173, 179, 180, 1); + text-align: center; + } + .doctor { + padding: 15rpx 30rpx; + display: flex; + .avatar { + padding-right: 16rpx; + flex-shrink: 0; + .a-img { + width: 80rpx; + height: 80rpx; + border-radius: 50%; + } + } + .d-container { + flex: 1; + margin-right: 74rpx; + display: flex; + flex-direction: column; + align-items: start; + .guide { + margin-bottom: 32rpx; + padding: 32rpx 30rpx; + border-radius: 0 32rpx 32rpx; + background: linear-gradient(13deg, #ffffff 8%, #e8f0f1 100%); + border: 2rpx solid #ffffff; + .title { + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + font-weight: bold; + } + .sub-title { + font-size: 28rpx; + color: rgba(154, 161, 162, 1); + margin-bottom: 30rpx; + } + .list { + .l-item { + display: flex; + align-items: center; + gap: 16rpx; + margin-bottom: 30rpx; + .order { + flex-shrink: 0; + width: 28rpx; + height: 28rpx; + font-size: 24rpx; + display: flex; + align-items: center; + justify-content: center; + color: rgba(255, 255, 255, 1); + border-radius: 6rpx; + background: #67baca; + } + .content { + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + } + } + } + .tip { + font-size: 28rpx; + color: rgba(103, 113, 114, 1); + display: flex; + align-items: center; + .icon { + width: 44rpx; + height: 44rpx; + } + } + } + .message { + margin-bottom: 32rpx; + padding: 26rpx 32rpx; + background-color: #fff; + border-radius: 0 32rpx 32rpx; + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + white-space: pre-line; + } + .week { + margin-bottom: 32rpx; + padding: 26rpx 32rpx; + background-color: #fff; + border-radius: 0 32rpx 32rpx; + .w-title { + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + } + .w-container { + margin-top: 24rpx; + .w-content { + padding: 32rpx; + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + line-height: 48rpx; + border-radius: 24rpx; + background-color: rgba(247, 248, 249, 1); + } + .row { + display: flex; + .label { + width: 156rpx; + height: 76rpx; + display: flex; + align-items: center; + justify-content: center; + font-size: 32rpx; + color: rgba(255, 255, 255, 1); + background-color: rgba(103, 186, 202, 1); + } + .content { + width: 156rpx; + height: 76rpx; + display: flex; + align-items: center; + justify-content: center; + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + background-color: rgba(242, 244, 245, 1); + } + &:first-of-type { + .label { + border-radius: 24rpx 0 0 0; + } + .content { + border-radius: 0 24rpx 0 0; + } + } + &:last-of-type { + .label { + border-radius: 0 0 0 24rpx; + } + .content { + border-radius: 0 0 24rpx 0; + } + } + &:not(:last-of-type) { + border-bottom: 2rpx solid #fff; + } + } + } + } + .adl { + margin-bottom: 32rpx; + padding: 32rpx 156rpx 34rpx 30rpx; + border-radius: 0 32rpx 32rpx; + background: linear-gradient(141deg, #edfcff 0%, #d4f3f9 100%); + border: 2rpx solid #fff; + .title { + width: 324rpx; + height: 40rpx; + } + .sub-title { + margin-top: 18rpx; + line-height: 1; + font-size: 28rpx; + color: rgba(255, 255, 255, 0.8); + } + .btn { + margin-top: 20rpx; + width: 220rpx; + height: 56rpx; + text-align: center; + line-height: 56rpx; + font-size: 28rpx; + color: #e04775; + background: #ffffff; + border-radius: 102rpx 102rpx 102rpx 102rpx; + } + .tip { + margin-top: 10rpx; + font-size: 24rpx; + color: #fff; + } + } + .audio { + margin-bottom: 32rpx; + padding: 22rpx 24rpx; + border-radius: 0 32rpx 32rpx; + background-color: #fff; + min-width: 218rpx; + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + display: flex; + align-items: center; + gap: 12rpx; + box-sizing: border-box; + .icon { + width: 32rpx; + height: 40rpx; + } + } + .info { + margin-bottom: 32rpx; + padding: 26rpx 32rpx; + background-color: #fff; + border-radius: 0 32rpx 32rpx 32rpx; + .content { + font-size: 28rpx; + color: #283031; + } + .btn { + margin-top: 24rpx; + padding: 22rpx; + font-size: 32rpx; + color: #283031; + line-height: 40rpx; + text-align: center; + background: #67baca; + color: #ffffff; + border-radius: 104rpx 104rpx 104rpx 104rpx; + border: 1rpx solid #f8f9f9; + } + } + .referral { + margin-bottom: 32rpx; + width: 502rpx; + height: 262rpx; + background: linear-gradient(223deg, #59b0c2 0%, #94e2f1 100%); + box-shadow: 0rpx 4rpx 24rpx 0rpx rgba(0, 0, 0, 0.07); + border-radius: 24rpx 24rpx 24rpx 24rpx; + .r-header { + padding: 20rpx 24rpx 0 32rpx; + display: flex; + .title { + font-size: 32rpx; + color: #ffffff; + line-height: 48rpx; + } + .icon { + flex-shrink: 0; + width: 138rpx; + height: 122rpx; + } + } + .r-footer { + padding: 32rpx; + background: linear-gradient(11deg, #ffffff 8%, rgba(255, 255, 255, 0.79) 100%); + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2rpx solid #ffffff; + .btn { + width: 438rpx; + height: 64rpx; + font-size: 32rpx; + color: #fff; + text-align: center; + line-height: 64rpx; + background: #67baca; + border-radius: 104rpx 104rpx 104rpx 104rpx; + } + } + } + .trans { + margin-bottom: 32rpx; + padding: 32rpx; + width: 508rpx; + box-sizing: border-box; + background: linear-gradient(223deg, #59b0c2 0%, #94e2f1 100%); + box-shadow: 0rpx 4rpx 24rpx 0rpx rgba(0, 0, 0, 0.07); + border-radius: 24rpx 24rpx 24rpx 24rpx; + .user { + padding: 24rpx 32rpx; + display: flex; + gap: 24rpx; + border-radius: 24rpx; + background-color: #fff; + .u-avatar { + width: 112rpx; + height: 112rpx; + flex-shrink: 0; + border-radius: 50%; + } + .wrap { + .name { + font-size: 40rpx; + color: #283031; + } + .content { + margin-top: 12rpx; + font-size: 28rpx; + color: #9aa1a2; + line-height: 36rpx; + } + } + } + .tip { + margin-top: 24rpx; + font-size: 32rpx; + color: #ffffff; + } + } + } + } + .patient { + padding: 15rpx 30rpx; + display: flex; + justify-content: flex-end; + .avatar { + padding-left: 16rpx; + flex-shrink: 0; + .a-img { + width: 80rpx; + height: 80rpx; + border-radius: 50%; + } + } + .p-container { + flex: 1; + margin-left: 74rpx; + display: flex; + flex-direction: column; + align-items: flex-end; + .guide { + margin-bottom: 32rpx; + padding: 32rpx 30rpx; + border-radius: 32rpx 0 32rpx 32rpx; + background: linear-gradient(13deg, #ffffff 8%, #e8f0f1 100%); + border: 2rpx solid #ffffff; + .title { + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + font-weight: bold; + } + .sub-title { + font-size: 28rpx; + color: rgba(154, 161, 162, 1); + margin-bottom: 30rpx; + } + .list { + .l-item { + display: flex; + align-items: center; + gap: 16rpx; + margin-bottom: 30rpx; + .order { + flex-shrink: 0; + width: 28rpx; + height: 28rpx; + font-size: 24rpx; + display: flex; + align-items: center; + justify-content: center; + color: rgba(255, 255, 255, 1); + border-radius: 6rpx; + background: #67baca; + } + .content { + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + } + } + } + .tip { + font-size: 28rpx; + color: rgba(103, 113, 114, 1); + display: flex; + align-items: center; + .icon { + width: 44rpx; + height: 44rpx; + } + } + } + .message { + margin-bottom: 32rpx; + padding: 26rpx 32rpx; + background: #67baca; + border-radius: 32rpx 0 32rpx 32rpx; + font-size: 32rpx; + color: #fff; + white-space: pre-line; + } + .referral-replay { + margin-bottom: 32rpx; + padding: 18rpx 32rpx; + border-radius: 32rpx; + background-color: #fff; + .title { + font-size: 32rpx; + color: #283031; + line-height: 48rpx; + } + .sub-title { + margin-top: 32rpx; + font-size: 32rpx; + color: #67baca; + font-weight: bold; + display: flex; + align-items: center; + &::before { + margin-right: 8rpx; + content: ''; + width: 6rpx; + height: 32rpx; + background-color: #67baca; + border-radius: 84rpx; + } + } + .r-list { + margin-top: 12rpx; + .item { + padding: 24rpx 0; + font-size: 32rpx; + color: #283031; + line-height: 36rpx; + border-bottom: 1px solid #eaeced; + &:last-of-type { + border: none; + } + } + } + } + } + } + .place { + height: 10vh; + } + } + } + .page-footer { + position: relative; + flex-shrink: 0; + padding: 18rpx 30rpx calc(env(safe-area-inset-bottom) + 30rpx); + border-radius: 24rpx 24rpx 0 0; + background-color: #fff; + transition: all 0.3s; + height: calc(124rpx + env(safe-area-inset-bottom)); + box-sizing: border-box; + .unread { + position: absolute; + top: -80rpx; + left: 50%; + transform: translateX(-50%); + padding: 12rpx 32rpx; + border-radius: 138rpx; + font-size: 24rpx; + color: rgba(103, 113, 114, 1); + background-color: #fff; + } + &.expend { + height: 50vh; + } + .line { + margin: 0 auto; + width: 52rpx; + height: 6rpx; + background: #f2f4f5; + border-radius: 48rpx 48rpx 48rpx 48rpx; + } + .title { + margin-top: 26rpx; + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + display: flex; + align-items: center; + justify-content: center; + .icon { + width: 36rpx; + height: 36rpx; + } + } + .tabs { + padding: 24rpx 0; + display: flex; + align-items: center; + gap: 22rpx; + overflow-x: auto; + &::-webkit-scrollbar { + display: none; + } + .tab { + flex-shrink: 0; + padding: 13rpx 22rpx; + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + border-radius: 129rpx; + background-color: rgba(242, 244, 245, 1); + display: flex; + align-items: center; + gap: 8rpx; + line-height: 1; + .icon { + width: 32rpx; + height: 32rpx; + } + .icon-active { + width: 32rpx; + height: 32rpx; + display: none; + } + &.active { + color: #fff; + background-color: rgba(103, 186, 202, 1); + .icon { + display: none; + } + .icon-active { + display: block; + } + } + } + } + .list { + max-height: 35vh; + overflow-y: auto; + .l-item { + padding: 20rpx 0; + display: flex; + justify-content: space-between; + align-items: center; + .order { + width: 28rpx; + height: 28rpx; + font-size: 24rpx; + display: flex; + align-items: center; + justify-content: center; + color: rgba(255, 255, 255, 1); + border-radius: 6rpx; + background: #67baca; + } + .content { + padding: 0 16rpx; + flex: 1; + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + } + .icon { + color: rgba(40, 48, 49, 1); + } + } + } + } +} diff --git a/src/pages/interactivePatient/index.ts b/src/pages/interactivePatient/index.ts new file mode 100644 index 0000000..7916868 --- /dev/null +++ b/src/pages/interactivePatient/index.ts @@ -0,0 +1,374 @@ +import dayjs from 'dayjs' + +const app = getApp() + +interface IMessageItem { + msgId: string + msgContentType: '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' // 1:文本 2: 出诊时间 3: adl卡片 4: 语音 5: 欢迎语 6:补充真实姓名 7: 提醒完善信息 8: 复诊卡片 9:患者恢复复诊消息 + msgContent: any + msgVisitTime: string + msgFromType: '1' | '2' // 1: 患者 2: 医生 + isPlay?: boolean + welcomeMsg?: { + hotQuestion: Item[] + } + msgCreateTime: string // 消息创建时间 + msgCreateTimeName?: string // 消息创建时间 + showTime?: boolean + ReVisitInfo?: any +} + +interface Item { + questionId: string + question: string +} + +Page({ + data: { + expend: false, + scrollTop: 0, + scrollIntoView: '', + doctorDetail: {} as any, + + questionActive: 0, + questionList: [] as any, + questionActiveList: [] as Item[], + + isLoad: false, + isFinish: false, + messageList: [] as IMessageItem[], + nextMsgId: '', + unReadCount: 0, + firstNotReadMsgId: 0, + isVisitAdl: 2, + adlMsgId: 0, + + week: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'], + timeDay: { 1: '上午', 2: '下午' }, + + userInfo: {}, + }, + innerAudioContext: null as WechatMiniprogram.InnerAudioContext | null, + onLoad(options) { + this.innerAudioContext = wx.createInnerAudioContext({ + useWebAudioImplement: true, + }) + app.waitLogin({}).then(() => { + app.mpBehavior({ PageName: 'PG_PATIENTINTERACTIONDETAILS' }) + this.getDoctorDetail() + this.getQuestionList() + this.getMessageList() + app.getUserInfo(this, true, (userInfo) => { + this.setData({ + userInfo, + }) + }) + if (options.adlPushId) { + wx.ajax({ + method: 'POST', + url: '?r=igg4/push-click/adl-push-click', + data: { adlPushId: options.adlPushId }, + }) + } + if (options.taskPushId) { + wx.ajax({ + method: 'POST', + url: '?r=igg4/push-click/task-push-click', + data: { taskPushId: options.taskPushId }, + }) + } + }) + }, + onUnload() { + if (this.innerAudioContext) { + this.innerAudioContext.stop() + } + }, + handleView(index = -1) { + this.setData({ + scrollIntoView: index > -1 ? `view${index}` : `place`, + }) + }, + getDoctorDetail() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/message-interact/get-bind-doctor-info', + data: {}, + }).then((res) => { + this.setData({ + doctorDetail: { + ...res, + }, + }) + }) + }, + getQuestionList() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/message-interact/get-question-list', + data: {}, + }).then((res) => { + this.setData({ + questionList: res, + questionActiveList: res[0].questionList, + }) + }) + }, + getMessageList() { + if (this.data.isLoad || this.data.isFinish) return + this.setData({ + isLoad: true, + }) + const nextMsgId = this.data.nextMsgId + wx.ajax({ + method: 'GET', + url: '?r=igg4/message-interact/patient-get-message-list', + data: { + nextMsgId, + }, + }).then((res) => { + res.messageList.map((item) => { + if (item.msgContentType === '4') { + item.msgContent = JSON.parse(item.msgContent) + } + if (item.msgContentType === '2') { + item.msgVisitTime = item.msgVisitTimeType == 2 ? item.msgVisitTime : JSON.parse(item.msgVisitTime) + } + if (item.msgContentType === '5') { + item.welcomeMsg = JSON.parse(item.welcomeMsg) + } + if (item.msgContentType === '9') { + item.ReVisitInfo = JSON.parse(item.ReVisitInfo) + item.ReVisitInfo.visitDateName = dayjs(item.ReVisitInfo.visitDate).format('YYYY年M月DD日') + } + if (item.msgContentType === '10') { + item.msgContentInfo = JSON.parse(item.msgContentInfo) + } + + return item + }) + this.setData({ + messageList: [...res.messageList.reverse(), ...this.data.messageList], + nextMsgId: res.nextMsgId, + unReadCount: res.unReadCount, + firstNotReadMsgId: res.firstNotReadMsgId, + isVisitAdl: res.isVisitAdl, + adlMsgId: res.adlMsgId, + isLoad: false, + isFinish: nextMsgId === res.nextMsgId, + }) + this.filterCreateTime() + if (!nextMsgId) { + this.handleView() + } + }) + }, + scrolltoupper(e) { + if (e.detail.direction === 'top') { + this.getMessageList() + } + }, + handleHot(e) { + const { index, mindex } = e.currentTarget.dataset + const { messageList } = this.data + const hotList = messageList[mindex].welcomeMsg?.hotQuestion + const hot = hotList?.[index] + this.setData({ + messageList: [ + ...messageList, + { + msgId: '', + msgContentType: '1', + msgContent: hot?.question, + msgVisitTime: '', + msgFromType: '1', + msgCreateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'), + }, + ], + }) + this.handleView() + this.sendQuestion(hot?.questionId) + }, + handleQuestion(e) { + const { index } = e.currentTarget.dataset + const { questionActiveList, messageList } = this.data + const question = questionActiveList[index] + this.setData({ + messageList: [ + ...messageList, + { + msgId: '', + msgContentType: '1', + msgContent: question.question, + msgVisitTime: '', + msgFromType: '1', + msgCreateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'), + }, + ], + }) + this.sendQuestion(question.questionId) + }, + sendQuestion(questionId) { + wx.ajax({ + method: 'POST', + url: '?r=igg4/message-interact/send-question-message', + data: { + questionId, + }, + }).then((res) => { + this.setData({ + messageList: [ + ...this.data.messageList, + { + msgId: '', + msgContentType: '1', + msgContent: res, + msgVisitTime: '', + msgFromType: '2', + msgCreateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'), + }, + ], + }) + this.filterCreateTime() + this.handleView() + }) + }, + formatTime(date: string) { + let msgCreateTimeName = '' + if (dayjs().format('YYYY-MM-DD') === dayjs(date).format('YYYY-MM-DD')) { + msgCreateTimeName = dayjs(date).format('HH:mm') + } else if (dayjs().format('YYYY-MM-DD') === dayjs(date).add(1, 'day').format('YYYY-MM-DD')) { + msgCreateTimeName = `昨天 ${dayjs(date).format('HH:mm')}` + } else if (dayjs().diff(date, 'day') < 7) { + msgCreateTimeName = dayjs(date).format(`dddd HH:mm`) + } else { + msgCreateTimeName = dayjs(date).format('YYYY-MM-DD HH:mm') + } + return msgCreateTimeName + }, + filterCreateTime() { + const gapTime = 5 * 60 * 1000 + const { messageList } = this.data + + let preTime = 0 + messageList.forEach((item, index) => { + if (index === 0) { + item.showTime = true + preTime = dayjs(item.msgCreateTime).valueOf() + item.msgCreateTimeName = this.formatTime(item.msgCreateTime) + } else { + const curTime = dayjs(item.msgCreateTime).valueOf() + if (curTime - preTime > gapTime) { + item.showTime = true + item.msgCreateTimeName = this.formatTime(item.msgCreateTime) + preTime = dayjs(item.msgCreateTime).valueOf() + } + } + }) + this.setData({ + messageList, + }) + }, + handleQuestionTab(e) { + const { index } = e.currentTarget.dataset + this.setData({ + questionActive: index, + questionActiveList: this.data.questionList[index].questionList, + }) + }, + handleDoctorDetail() { + const { doctorId } = this.data.doctorDetail + wx.navigateTo({ + url: `/pages/doctorDetail/index?id=${doctorId}`, + }) + }, + handleRead() { + const { firstNotReadMsgId, messageList } = this.data + const index = messageList.findIndex((item) => `${item.msgId}` === `${firstNotReadMsgId}`) + this.handleView(index) + this.setData({ + unReadCount: 0, + }) + }, + handleFooter() { + app.mpBehavior({ PageName: 'BTN_PATIENTINTERACTIONCHOOSEQUESTION' }) + this.setData({ + expend: !this.data.expend, + }) + if (this.data.expend) { + setTimeout(() => { + this.handleView() + }, 300) + } + }, + handleAdl() { + wx.navigateTo({ + url: '/pages/adl/index', + }) + }, + handleAudio(e) { + const { index } = e.currentTarget.dataset + const { messageList } = this.data + const messageItem = messageList[index] + const { url } = messageItem.msgContent[0] + if (this.innerAudioContext) { + if (messageItem.isPlay) { + this.innerAudioContext.stop() + messageItem.isPlay = false + this.setData({ + messageList, + }) + return + } + this.innerAudioContext.stop() + this.innerAudioContext.src = url + this.innerAudioContext.play() + messageItem.isPlay = true + this.innerAudioContext.onEnded(() => { + messageItem.isPlay = false + this.setData({ + messageList, + }) + }) + this.setData({ + messageList, + }) + } + }, + handleFillUserInfo() { + wx.navigateTo({ + url: '/pages/personalInformation/index', + }) + }, + handleReferral() { + this.setData({ + referralFromShow: true, + }) + }, + handleReferralReplay(e) { + const params = e.detail + this.setData({ + messageList: [ + ...this.data.messageList, + { + msgId: '', + msgContentType: '9', + msgVisitTime: '', + msgContent: '', + msgFromType: '1', + msgCreateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'), + ReVisitInfo: { + ...params, + visitDateName: dayjs(params.visitDate).format('YYYY年M月DD日'), + }, + }, + ], + }) + }, + handleTrans(e) { + const { id } = e.currentTarget.dataset + wx.navigateTo({ + url: `/pages/doctorDetail/index?id=${id}`, + }) + }, +}) diff --git a/src/pages/interactivePatient/index.wxml b/src/pages/interactivePatient/index.wxml new file mode 100644 index 0000000..90fb63a --- /dev/null +++ b/src/pages/interactivePatient/index.wxml @@ -0,0 +1,209 @@ + + + + + + + {{doctorDetail.doctorName}} + + {{doctorDetail.hospitalName}} + {{doctorDetail.hospitalClassificationName}}{{doctorDetail.hospitalLevelName}} + + + + + + + + + {{message.msgCreateTimeName}} + + + + + + + {{message.welcomeMsg.title}} + {{message.welcomeMsg.questionDes}} + + + {{index+1}} + {{item.question}} + + + + {{message.welcomeMsg.guideClick}} + + + + {{message.msgContent}} + + 以下是我的出诊时间 + + {{message.msgVisitTime}} + + + {{week[item.weekday-1]}} + {{timeDay[item.timeType]}} + + + + + + + ADL+激素双达标 + 点击进入ADL + 建议您定期做ADL测评 + + + + + {{message.msgContent[0].duration}}'' + + + {{message.msgContent}} + 提交您的真实姓名 + + + {{message.msgContent}} + 完善个人信息 + + + + 您最近有按照医生的 提醒,定期复诊吗? + + + + 已复诊 + + + + + + + {{message.msgContentInfo.doctorName}} + {{message.msgContentInfo.hospitalName}} + + + 推荐好医生给你,建议2周内复诊 + + + + + + {{message.msgContent}} + + 我最近一次复诊时间是{{message.ReVisitInfo.visitDateName}} + 我的方案是 + + 1.激素 + + 2.传统免疫抑制剂(如他克莫司、吗 替麦考酚酯等) + + 3.静脉输注丙种球蛋白 + 4.血浆置换 + + 5.B细胞抑制剂(如:利妥昔单抗、泰 它西普、伊奈利珠单抗) + + 6.FcRn拮抗剂(如:艾加莫德) + + 7.C5补体抑制剂(如:依库珠单抗) + + 8.中药或中成药 + 9.其他 + + + + + + + + + + + + + + 您有{{unReadCount}}条新消息 + + + + + + 请选择您要咨询的问题 + + + + + + {{item.typeName}} + + + + + {{index+1}} + {{item.question}} + + + + + + + diff --git a/src/pages/live/index.json b/src/pages/live/index.json new file mode 100644 index 0000000..3058bf2 --- /dev/null +++ b/src/pages/live/index.json @@ -0,0 +1,9 @@ +{ + "navigationBarTitleText": "", + "navigationBarBackgroundColor": "#fafafa", + "usingComponents": { + "van-tab": "@vant/weapp/tab/index", + "van-tabs": "@vant/weapp/tabs/index", + "van-icon": "@vant/weapp/icon/index" + } +} diff --git a/src/pages/live/index.scss b/src/pages/live/index.scss new file mode 100644 index 0000000..eabb93e --- /dev/null +++ b/src/pages/live/index.scss @@ -0,0 +1,405 @@ +.page { + padding-bottom: 120rpx; + background-color: #fafafa; + position: relative; + .tab { + font-size: 32rpx; + color: #9e9e9e; + background-color: #fafafa; + &.tab-active { + font-size: 36rpx; + color: #484848; + } + } + .search { + margin: 32rpx 30rpx 0; + padding: 18rpx 32rpx; + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 38rpx; + border: 2rpx solid #ebecee; + display: flex; + align-items: center; + .icon { + width: 40rpx; + height: 40rpx; + } + .input { + flex: 1; + margin-left: 20rpx; + font-size: 28rpx; + } + .placeholder-input { + color: #a8a8a8; + } + .clear { + color: #ccc; + } + } + .sticky { + position: sticky; + top: 0rpx; + left: 0; + z-index: 20; + padding-bottom: 10rpx; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + background-color: #fafafa; + .tags { + margin-top: 20rpx; + padding-top: 28rpx; + position: relative; + overflow-y: hidden; + overflow-x: auto; + padding-bottom: 8rpx; + &::-webkit-scrollbar { + display: none; + } + .scroll { + padding-left: 30rpx; + display: flex; + flex-wrap: nowrap; + .tag { + margin-right: 16rpx; + flex-shrink: 0; + font-size: 28rpx; + color: #484848; + background-color: #f2f2f2; + border-radius: 24rpx; + padding: 10rpx 24rpx; + line-height: 1; + &.active { + position: relative; + color: #fff; + background-color: var(--name); + } + } + .site { + flex-shrink: 0; + margin-left: auto; + position: sticky; + top: 0; + right: 0; + display: flex; + align-items: center; + justify-content: center; + width: 164rpx; + white-space: nowrap; + font-size: 24rpx; + color: #484848; + background-color: #fafafa; + box-shadow: -12rpx 2rpx 10rpx -12rpx rgba(0, 0, 0, 0.5); + .icon { + margin-right: 8rpx; + width: 32rpx; + height: 32rpx; + } + } + } + } + } + .info-list { + margin: 32rpx 30rpx; + .list-item { + margin-bottom: 32rpx; + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + border: 2rpx solid #ebecee; + + .photo-wrap { + position: relative; + .photo { + border-radius: 24rpx 24rpx 0 0; + display: block; + width: 100%; + height: 388rpx; + } + .status { + padding: 6rpx 32rpx; + position: absolute; + top: 0; + left: 0; + display: flex; + align-items: center; + background: linear-gradient(90deg, #e5e9f5 0%, #fde4ec 100%); + border-radius: 24rpx 0rpx 24rpx 0rpx; + font-size: 28rpx; + color: var(--name); + .dot { + margin-right: 8rpx; + width: 13rpx; + height: 13rpx; + border-radius: 50%; + background-color: var(--name); + } + &.bad { + color: #484848; + background: #e6e6e6; + .dot { + display: none; + } + } + } + .money { + padding: 0 16rpx 0 0; + position: absolute; + right: 16rpx; + bottom: 16rpx; + background-color: #ffedca; + font-size: 24rpx; + color: #f5ad1d; + line-height: 30rpx; + display: flex; + align-items: center; + justify-content: center; + border-radius: 36rpx; + .icon { + margin-right: 5rpx; + width: 38rpx; + height: 36rpx; + } + } + .date { + padding: 18rpx 18rpx 8rpx; + position: absolute; + left: 40rpx; + bottom: 0; + background: var(--name); + border-radius: 11rpx 11rpx 0rpx 0rpx; + text-align: center; + .d-title { + font-size: 22rpx; + color: #ffffff; + font-weight: bold; + .icon { + margin-right: -10rpx; + } + } + .ymd { + font-size: 18rpx; + color: #fff; + line-height: 28rpx; + border-bottom: 2rpx solid rgba(255, 255, 255, 0.34); + } + .hm { + font-size: 18rpx; + color: #fff; + line-height: 28rpx; + } + } + } + .inner { + padding: 32rpx 34rpx; + background-color: #fff; + border-radius: 0 0 24rpx 24rpx; + .title { + font-size: 32rpx; + color: #252525; + font-weight: bold; + } + .content { + margin-top: 20rpx; + display: flex; + justify-content: space-between; + align-items: flex-start; + .labels { + display: flex; + align-items: center; + flex-wrap: wrap; + .label { + margin-right: 16rpx; + margin-bottom: 16rpx; + padding: 2rpx 20rpx; + font-size: 22rpx; + color: var(--name); + border-radius: 18rpx; + background-color: var(--tag-bg); + word-break: break-all; + } + } + .people { + flex-shrink: 0; + color: #9e9e9e; + font-size: 22rpx; + } + } + .footer { + margin-top: 32rpx; + display: flex; + align-items: center; + justify-content: space-between; + .site { + font-size: 22rpx; + color: #bebebe; + } + .btn { + margin-left: 10rpx; + flex-shrink: 0; + padding: 4rpx 36rpx; + font-size: 28rpx; + color: #ffffff; + background: var(--name); + border-radius: 24rpx; + &.active { + color: #484848; + background-color: #e7e7e7; + } + .icon { + width: 24rpx; + height: 24rpx; + } + } + } + } + } + } + + .video-list { + margin: 32rpx 30rpx; + .list-item { + margin-bottom: 32rpx; + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + border: 2rpx solid #ebecee; + + .photo-wrap { + position: relative; + .photo { + border-radius: 24rpx 24rpx 0 0; + display: block; + width: 100%; + height: 388rpx; + } + .status { + padding: 6rpx 32rpx; + position: absolute; + top: 0; + left: 0; + display: flex; + align-items: center; + background: linear-gradient(90deg, #e5e9f5 0%, #fde4ec 100%); + border-radius: 24rpx 0rpx 24rpx 0rpx; + font-size: 28rpx; + color: var(--name); + .dot { + margin-right: 8rpx; + width: 13rpx; + height: 13rpx; + border-radius: 50%; + background-color: var(--name); + } + &.bad { + color: #484848; + background: #e6e6e6; + .dot { + display: none; + } + } + } + .date { + padding: 18rpx 18rpx 8rpx; + position: absolute; + left: 40rpx; + bottom: 0; + background: var(--name); + border-radius: 11rpx 11rpx 0rpx 0rpx; + text-align: center; + .d-title { + font-size: 22rpx; + color: #ffffff; + font-weight: bold; + } + .ymd { + font-size: 18rpx; + color: #fff; + line-height: 28rpx; + border-bottom: 2rpx solid rgba(255, 255, 255, 0.34); + } + .hm { + font-size: 18rpx; + color: #fff; + line-height: 28rpx; + } + } + .money { + padding: 0 16rpx 0 0; + position: absolute; + right: 16rpx; + bottom: 16rpx; + background-color: #ffedca; + font-size: 24rpx; + color: #f5ad1d; + line-height: 30rpx; + display: flex; + align-items: center; + justify-content: center; + border-radius: 36rpx; + .icon { + margin-right: 5rpx; + width: 38rpx; + height: 36rpx; + } + } + } + .inner { + padding: 32rpx 34rpx; + background-color: #fff; + border-radius: 0 0 24rpx 24rpx; + .title { + font-size: 32rpx; + color: #252525; + font-weight: bold; + } + .content { + margin-top: 20rpx; + display: flex; + justify-content: space-between; + align-items: flex-start; + .labels { + display: flex; + align-items: center; + flex-wrap: wrap; + .label { + margin-right: 16rpx; + padding: 2rpx 20rpx; + font-size: 22rpx; + color: var(--name); + border-radius: 18rpx; + background-color: var(--tag-bg); + word-break: break-all; + } + } + .people { + color: #9e9e9e; + flex-shrink: 0; + font-size: 22rpx; + } + } + .footer { + margin-top: 32rpx; + display: flex; + align-items: center; + justify-content: space-between; + .site { + font-size: 22rpx; + color: #bebebe; + } + .btn { + margin-left: 10rpx; + flex-shrink: 0; + padding: 4rpx 36rpx; + font-size: 28rpx; + color: #ffffff; + background: var(--name); + border-radius: 24rpx; + &.active { + color: #484848; + background-color: #e7e7e7; + } + } + } + } + } + } +} diff --git a/src/pages/live/index.ts b/src/pages/live/index.ts new file mode 100644 index 0000000..d13c2d6 --- /dev/null +++ b/src/pages/live/index.ts @@ -0,0 +1,255 @@ +import dayjs from 'dayjs' +const app = getApp() +let live_time: null | number = null + +Page({ + data: { + active: 0, + CateId: '', + Search: '', + LNG: '' as string | number, + LAT: '' as string | number, + online_open_status: 0, // 线上 + offline_open_status: 0, // 线下 + cateList: [], + list: [], + pagination: { + page: 1, + pages: 1, + count: 1, + }, + liveStatus: app.globalData.liveStatus, + activityStatus: app.globalData.activityStatus, + userInfo: {}, + }, + onLoad() { + app.getTheme().then((res) => { + this.setData({ + theme: res, + }) + }) + + this.setData({ + dateValue: dayjs().valueOf(), + }) + if (live_time) { + clearInterval(live_time) + } + live_time = setInterval(() => { + this.setData({ + dateValue: dayjs().valueOf(), + }) + }, 1000) + }, + onShow() { + if (app.globalData.active) { + this.setData({ + active: Number(app.globalData.active), + }) + app.globalData.active = '' + } + app.waitLogin().then(() => { + app.mpBehavior({ PageName: 'PG_PATIENTWEDNESDAYLECTURELIST' }) + this.getConfig() + app.getUserInfo(this, true) + }) + }, + tabChange(e) { + this.setData({ + active: e.detail.index, + LNG: '', + LAT: '', + }) + if (e.detail.index == 0) { + app.mpBehavior({ PageName: 'PG_PATIENTWEDNESDAYLECTURELIST' }) + } else if (e.detail.index == 1) { + app.mpBehavior({ PageName: 'PG_PATIENTWEDNESDAYACTIVITYLIST' }) + } + this.getList() + }, + getConfig() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/common/get-config', + data: {}, + }).then((res) => { + let active = this.data.active + if (res.online_open_status == 0) { + active = 1 + } + this.setData({ + online_open_status: res.online_open_status, + offline_open_status: res.offline_open_status, + active, + }) + this.getList() + this.getCateList() + }) + }, + getCateList() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/activity/cate-list', + data: {}, + }).then((res) => { + this.setData({ + cateList: res, + }) + }) + }, + handleClear() { + this.setData({ + Search: '', + }) + this.handleSearch() + }, + handleSearch() { + this.getList() + }, + handleToggleSite() { + const that = this + if (!this.data.LNG) { + wx.getSetting({ + success(res) { + if ( + res.authSetting['scope.userFuzzyLocation'] != undefined && + res.authSetting['scope.userFuzzyLocation'] == true + ) { + //获取当前位置 + that.getFuzzyLocation() + } else if (res.authSetting['scope.userFuzzyLocation'] == undefined) { + //获取当前位置 + that.getFuzzyLocation() + } else { + wx.showModal({ + title: '请求授权当前位置', + content: '需要获取您的地理位置,请确认授权', + confirmColor: '#cf5375', + success (res) { + if (res.cancel) { + //取消授权 + wx.showToast({ + title: '拒绝授权', + icon: 'none', + duration: 1000, + }) + } else if (res.confirm) { + //确定授权,通过wx.openSetting发起授权请求 + wx.openSetting({ + success (res) { + if (res.authSetting['scope.userFuzzyLocation'] == true) { + // wx.showToast({ + // title: '授权成功', + // icon: 'success', + // duration: 1000 + // }) + //再次授权,调用wx.getLocation的API + that.getFuzzyLocation() + } else { + // wx.showToast({ + // title: '授权失败', + // icon: 'none', + // duration: 1000 + // }) + } + }, + }) + } + }, + }) + } + }, + }) + } else { + that.setData({ + LNG: '', + LAT: '', + }) + that.getList() + } + }, + getFuzzyLocation() { + const that = this + wx.getFuzzyLocation({ + success(res) { + that.setData({ + LNG: res.longitude, + LAT: res.latitude, + }) + that.getList() + }, + fail(err) { + console.log(err) + }, + }) + }, + handleCate(e: WechatMiniprogram.CustomEvent) { + const { id } = e.currentTarget.dataset + this.setData({ + CateId: id, + }) + this.getList() + }, + getList(newPage = 1) { + const { active } = this.data + const { CateId, Search, LNG, LAT } = this.data + wx.ajax({ + method: 'GET', + url: '?r=igg4/activity/list', + data: { + Type: Number(active || 0) + 1, + CateId, + Search, + LNG: LNG || undefined, + LAT: LAT || undefined, + page: newPage, + }, + }).then((res) => { + res.list = res.list.map((item) => { + item.EndTimeValue = dayjs(item.EndTime).valueOf() + item.BeginTimeValue = dayjs(item.BeginTime).valueOf() + item.SignUpDeadlineValue = dayjs(item.SignUpDeadline).valueOf() + item.BeginDate = dayjs(item.BeginTime).format('YYYY-MM-DD') + item.EndDate = dayjs(item.EndTime).format('YYYY-MM-DD') + item.isDay = item.BeginDate == item.EndDate + item.BeginHm = dayjs(item.BeginTime).format('HH:mm') + item.EndHm = dayjs(item.EndTime).format('HH:mm') + item.BeginTime = dayjs(item.BeginTime).format('YYYY-MM-DD HH:mm') + item.EndTime = dayjs(item.EndTime).format('YYYY-MM-DD HH:mm') + return item + }) + const list = res.page == 1 ? res.list : [...this.data.list, ...res.list] + this.setData({ + list, + pagination: { + page: res.page, + pages: res.pages, + count: res.count, + }, + }) + }) + }, + handleDetail(e) { + const { id } = e.currentTarget.dataset + if (this.data.active == 0) { + app.mpBehavior({ PageName: 'BTN_PATIENTWEDNESDAYTALKMEETINGLIST' }) + } else if (this.data.active == 1) { + app.mpBehavior({ PageName: 'BTN_PATIENTWEDNESDAYTALKACTIVITYLIST' }) + } + wx.navigateTo({ + url: `/pages/liveDetail/index?id=${id}`, + }) + }, + onReachBottom() { + const { page, pages } = this.data.pagination + if (pages > page) { + this.getList(page + 1) + } + }, + onShareAppMessage() { + return { + title: '周三大咖说', + path: 'pages/live/index', + } + }, +}) diff --git a/src/pages/live/index.wxml b/src/pages/live/index.wxml new file mode 100644 index 0000000..128c80b --- /dev/null +++ b/src/pages/live/index.wxml @@ -0,0 +1,179 @@ + + + + + + + + + + + + + + 全部 + + {{item.CateName}} + + + + + 距离最近 + + + + + + + + + + + {{liveStatus[item.Status]}} + + + + {{item.Name}} + + + {{label}} + + {{item.SignUpPeopleNum}}人已报名 + + + {{item.MasterName}} {{item.MasterTitle}} + 已取消 + 已删除 + 看回放 + 回放生成中 + + + 审核中 + + 参会 + 已报名 + + + + 已满额 + + + + + + + 已满额 + + 报名已截止 + 报名 + + + + + + + + + + + + {{activityStatus[item.Status]}} + + + + + + + + + + + + + + + + + + {{item.Name}} + + + {{label}} + + {{item.SignUpPeopleNum}}人已报名 + + + + {{item.Location}} + {{item.Distance}} + + 已结束 + 已取消 + 已删除 + + + 审核中 + + 已报名 + 已报名 + + + + 已满额 + + + + + + + 已满额 + + 报名已截止 + 报名 + + + + + + + diff --git a/src/pages/liveDetail/index.json b/src/pages/liveDetail/index.json new file mode 100644 index 0000000..b7c69dd --- /dev/null +++ b/src/pages/liveDetail/index.json @@ -0,0 +1,9 @@ +{ + "navigationBarTitleText": "活动详情", + "navigationBarBackgroundColor": "#EEF0F3", + "usingComponents": { + "mp-html": "mp-html", + "customPoster": "/components/customPoster/index", + "van-popup": "@vant/weapp/popup/index" + } +} diff --git a/src/pages/liveDetail/index.scss b/src/pages/liveDetail/index.scss new file mode 100644 index 0000000..b44769f --- /dev/null +++ b/src/pages/liveDetail/index.scss @@ -0,0 +1,221 @@ +page { + background-color: #eef0f3; +} + +.page { + min-height: 100vh; + .banner { + width: 100%; + height: 422rpx; + } + .page-container { + padding: 18rpx 30rpx 160rpx; + .title { + font-size: 40rpx; + color: #333333; + line-height: 64rpx; + font-weight: bold; + } + .stat { + margin-top: 20rpx; + display: flex; + .s-item { + display: flex; + align-items: center; + font-size: 24rpx; + color: #1e1f21; + margin-right: 48rpx; + .icon { + width: 36rpx; + height: 36rpx; + margin-right: 12rpx; + } + } + } + .module { + margin-top: 30rpx; + padding: 34rpx 32rpx; + border-radius: 24rpx; + border: 2rpx solid #ebecee; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + background-color: #fff; + > view:nth-of-type(2) { + margin-top: 30rpx; + } + .info { + display: flex; + align-items: center; + font-size: 28rpx; + color: #636466; + .icon { + margin-right: 12rpx; + width: 32rpx; + height: 32rpx; + } + } + .site { + display: flex; + justify-content: space-between; + .wrap { + font-size: 28rpx; + color: #636466; + display: flex; + .icon { + flex-shrink: 0; + margin-right: 12rpx; + width: 32rpx; + height: 32rpx; + vertical-align: middle; + } + } + .nav-site { + margin-left: 10rpx; + flex-shrink: 0; + width: 36rpx; + height: 36rpx; + } + } + } + .screen { + position: relative; + margin-top: 30rpx; + padding: 32rpx 32rpx 0; + background: linear-gradient(360deg, #ffffff 0%, #f6f7f7 100%); + border-radius: 24rpx; + box-sizing: border-box; + .screen-list { + max-height: 200rpx; + .s-item { + display: flex; + align-items: center; + font-size: 28rpx; + .avatar { + margin-right: 20rpx; + width: 68rpx; + height: 68rpx; + border-radius: 50%; + } + .name { + margin-right: 20rpx; + color: #1e1f21; + } + .action { + margin-right: 20rpx; + color: #9b9fa4; + } + .date { + color: #e04775; + } + } + } + &::after { + position: absolute; + bottom: 0; + left: 0; + content: ''; + width: 100%; + height: 32rpx; + background: linear-gradient(180deg, rgba(251, 252, 252, 0.49) 0%, #fcfdfd 100%); + } + } + .content { + margin-top: 24rpx; + .c-title { + font-size: 36rpx; + color: #333333; + font-weight: bold; + margin-bottom: 32rpx; + } + .c-img { + width: 100%; + } + } + } + .footer { + padding: 16rpx 30rpx calc(30rpx + env(safe-area-inset-bottom)); + position: fixed; + bottom: 0; + left: 0; + width: 100%; + box-sizing: border-box; + display: flex; + background-color: #fff; + box-shadow: 0rpx 8rpx 48rpx 0rpx rgba(0, 0, 0, 0.19); + .inner { + flex: 1; + display: flex; + .i-item { + text-align: center; + .num { + font-size: 36rpx; + color: #1e1f21; + } + .name { + font-size: 22rpx; + color: #a8acb0; + } + } + .vertical { + margin: 0 38rpx; + width: 2rpx; + height: 64rpx; + opacity: 0.19; + background: linear-gradient(180deg, rgba(200, 200, 200, 0), rgba(173, 173, 173, 1), rgba(151, 151, 151, 0)); + } + } + .btn { + width: 346rpx; + height: 88rpx; + background: #e04775; + border-radius: 44rpx; + text-align: center; + line-height: 88rpx; + font-size: 32rpx; + color: #ffffff; + &.active { + color: #484848; + background-color: #e7e7e7; + } + } + } + .video { + width: 0; + height: 0; + position: relative; + .play { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 95rpx; + height: 95rpx; + } + } +} + +.fixed-share { + position: fixed; + right: 14rpx; + bottom: 264rpx; + width: 104rpx; + height: 104rpx; +} + +.custom-popup { + background-color: transparent !important; +} +.p-share { + width: 622rpx; + .photo { + display: block; + width: 100%; + height: 964rpx; + border-radius: 24rpx; + } + .tip { + margin: 34rpx auto; + font-size: 28rpx; + color: #ffffff; + text-align: center; + } +} diff --git a/src/pages/liveDetail/index.ts b/src/pages/liveDetail/index.ts new file mode 100644 index 0000000..6984cff --- /dev/null +++ b/src/pages/liveDetail/index.ts @@ -0,0 +1,352 @@ +import dayjs from 'dayjs' +const app = getApp() +let live_time: null | number = null + +Page({ + data: { + id: '', + shareShow: false, + detail: {} as any, + userInfo: {} as any, + posterUrl: '', + params: {}, + play: false, + + meeting_notice: '', + }, + videoContext: {} as WechatMiniprogram.VideoContext, + onLoad(options) { + const scene = app.globalData.scene + this.setData({ + id: options.id || scene.id, + }) + if (live_time) { + clearInterval(live_time) + } + this.setData({ + dateValue: dayjs().valueOf(), + }) + live_time = setInterval(() => { + this.setData({ + dateValue: dayjs().valueOf(), + }) + }, 1000) + }, + onShow() { + app.waitLogin({ isReg: false }).then(() => { + this.getDetail() + this.setView() + this.getTmeplateList() + app.getUserInfo(this, true, () => { + this.getPosterParams() + }) + }) + }, + onReady() { + this.videoContext = wx.createVideoContext('video') + }, + getTmeplateList() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/activity/get-template-list', + data: {}, + }).then((res) => { + this.setData({ + meeting_notice: res.meeting_notice, + }) + }) + }, + getPosterParams() { + wx.ajax({ + method: 'POST', + url: '?r=poster/prepare', + data: { + posterId: 'activity-invite', + activityId: this.data.id, + userId: this.data.userInfo.UserId, + }, + }).then((res) => { + this.setData({ + params: res, + }) + }) + }, + setView() { + wx.ajax({ + method: 'POST', + url: '?r=igg4/activity/view', + data: { + Id: this.data.id, + }, + }).then((res) => { + console.log('res: ', res) + }) + }, + getDetail() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/activity/detail', + data: { + Id: this.data.id, + }, + }).then((res) => { + if (res.ReplayVideoUrl) { + this.videoContext = wx.createVideoContext('video') + } + if (res.Type == 1) { + app.mpBehavior({ PageName: 'PG_PATIENTLECTUREDETAILS' }) + wx.setNavigationBarTitle({ + title: '会议详情', + }) + } else { + app.mpBehavior({ PageName: 'PG_PATIENTACTIVITYDETAILS' }) + wx.setNavigationBarTitle({ + title: '活动详情', + }) + } + this.setData({ + detail: { + ...res, + EndTimeValue: dayjs(res.EndTime).valueOf(), + BeginTimeValue: dayjs(res.BeginTime).valueOf(), + SignUpDeadlineValue: dayjs(res.SignUpDeadline).valueOf(), + DetailJson: res.DetailJson ? JSON.parse(res.DetailJson) : [], + SignUpRecord: res.SignUpRecord.map((item) => { + item.date = dayjs().from(item.CreateTime) + item.UserId = '******'.slice(0, 6 - String(item.UserId).length) + item.UserId + return item + }), + BeginTime: dayjs(res.BeginTime).format('YYYY-MM-DD HH:mm'), + }, + }) + }) + }, + handleReplay() { + app.mpBehavior({ PageName: 'BTN_PATIENTMEETINGDETAILREPLAY' }) + this.videoContext.requestFullScreen({}) + this.videoContext.seek(0) + this.videoContext.play() + }, + handleFullscreenExit() { + this.videoContext.pause() + }, + handleLive() { + const { Type } = this.data.detail + app + .permissionVerification(3, Type == 1 ? 1 : 10, `/pages/liveDetail/index?id=${this.data.id}`, this.data.id) + .then(() => { + const { TencentMeetingCode } = this.data.detail + wx.navigateToMiniProgram({ + appId: 'wx33fd6cdc62520063', // 要跳转的微信小程序appid + // path: `pages/sub-preMeeting/join-meeting/join-meeting?m=${TencentMeetingCode}`, // 要跳转到的页面路径 + // path:`pages/index/index?chn=${channel}&code=${TencentMeetingCode}&pwd=${password}&nm={nickname}` + path: `pages/index/index?code=${TencentMeetingCode}`, + }) + }) + }, + // handleLiveTest() { + // wx.navigateToMiniProgram({ + // appId: 'wx33fd6cdc62520063', // 要跳转的微信小程序appid + // path: `pages/index/index?code=521826426`, + // }) + // }, + handleResult() { + wx.navigateTo({ + url: `/pages/liveResult/index?id=${this.data.id}`, + }) + }, + handleSignUp() { + const { Type } = this.data.detail + const { UserType } = this.data.userInfo + + if (Type == 1) { + app.mpBehavior({ PageName: 'BTN_PATIENTMEETINGDETAILSIGNUP' }) + } else if (Type == 2) { + app.mpBehavior({ PageName: 'BTN_PATIENTACTIVITYDETAILSIGNUP' }) + } + + wx.ajax({ + method: 'POST', + url: '?r=igg4/activity/sign-up', + data: { + Id: this.data.id, + PreUserIdentity: UserType, + }, + }).then((res) => { + app + .permissionVerification( + 3, + Type == 1 ? 1 : 10, + `/pages/liveResult/index?id=${this.data.id}&rewardScore=${res.rewardScore}`, + this.data.id, + ) + .then(() => { + this.handleSignUpCallback() + wx.navigateTo({ + url: `/pages/liveResult/index?id=${this.data.id}&rewardScore=${res.rewardScore}`, + }) + }) + }) + }, + handleSignUpCallback() { + wx.requestSubscribeMessage({ + tmplIds: [this.data.meeting_notice], + success: (res) => { + const subscribe = { meeting_notice: 2 } + ;[this.data.meeting_notice].forEach((item) => { + subscribe.meeting_notice = res[item] === 'accept' ? 1 : 2 + }) + this.postSubscribe(subscribe) + }, + fail: () => { + const subscribe = { meeting_notice: 2 } + this.postSubscribe(subscribe) + }, + }) + }, + postSubscribe(subscribe) { + wx.ajax({ + method: 'POST', + url: '?r=igg4/activity/subscribe', + data: { + ActivityId: this.data.id, + subscribe, + }, + showMsg: false, + }) + }, + handleShare() { + this.setData({ + shareShow: true, + }) + this.saveShare() + }, + saveShare() { + const { UserType } = this.data.userInfo + wx.ajax({ + method: 'POST', + url: '?r=igg4/activity/share', + data: { Id: this.data.id, PreUserIdentity: UserType }, + }).then(() => { + this.getDetail() + }) + }, + handleMap() { + const { LocationLAT, LocationLNG, Location } = this.data.detail + wx.openLocation({ + latitude: LocationLAT * 1, + longitude: LocationLNG * 1, + name: Location, + fail(err) { + console.log(err) + }, + }) + }, + handleShareClose() { + this.setData({ + shareShow: false, + }) + }, + handlePosterFinish(e) { + this.setData({ + posterUrl: e.detail, + }) + }, + handleDownload() { + const that = this + wx.getSetting({ + success(res) { + console.log(res) + if ( + res.authSetting['scope.writePhotosAlbum'] != undefined && + res.authSetting['scope.writePhotosAlbum'] == true + ) { + that.saveImage() + } else if (res.authSetting['scope.writePhotosAlbum'] == undefined) { + //获取当前位置 + that.saveImage() + } else { + wx.showModal({ + title: '请求授权相册权限', + content: '需要保存海报到相册,请确认授权', + confirmColor: '#cf5375', + success(res) { + if (res.cancel) { + //取消授权 + wx.showToast({ + title: '拒绝授权', + icon: 'none', + duration: 1000, + }) + } else if (res.confirm) { + //确定授权,通过wx.openSetting发起授权请求 + wx.openSetting({ + success(res) { + if (res.authSetting['scope.writePhotosAlbum'] == true) { + that.saveImage() + } else { + wx.showToast({ + title: '授权失败', + icon: 'none', + duration: 1000, + }) + } + }, + }) + } + }, + }) + } + }, + }) + }, + saveImage() { + wx.showLoading({ + title: '加载中', + }) + wx.saveImageToPhotosAlbum({ + filePath: this.data.posterUrl, + success: () => { + wx.hideLoading() + wx.showToast({ + title: '保存成功,请到相册中查看', + }) + }, + fail: () => { + wx.hideLoading() + wx.showToast({ + icon: 'none', + title: '保存失败,请稍后重试', + }) + }, + }) + }, + handleVideoPlay() { + this.setData({ + play: true, + }) + }, + handleVideoPause() { + this.setData({ + play: false, + }) + }, + handlePlayVideo() { + this.videoContext.play() + }, + onShareAppMessage() { + this.saveShare() + return { + title: `【会议报名】${this.data.detail.Name}`, + path: `/pages/liveDetail/index?id=${this.data.id}`, + // imageUrl: this.data.detail.IntroductionUrl, + } + }, + onShareTimeline() { + this.saveShare() + return { + title: `【会议报名】${this.data.detail.Name}`, + query: `id=${this.data.id}`, + } + }, +}) diff --git a/src/pages/liveDetail/index.wxml b/src/pages/liveDetail/index.wxml new file mode 100644 index 0000000..53dd4d0 --- /dev/null +++ b/src/pages/liveDetail/index.wxml @@ -0,0 +1,170 @@ + + + + {{detail.Name}} + + + + {{detail.ActivityBasicNum * 1 + detail.OpenNum * 1}}次 + + + + {{detail.ShareNum}}次 + + + + + + {{detail.BeginTime}} + + + + + {{detail.Location}} + + + + + + + + + {{item.UserId || '***'}} + 报名了活动 + {{item.date}} + + + + + 详情介绍 + + + + + + + {{detail.SignUpPeopleNum}}人 + 已报名 + + + + + {{detail.LimitPeopleNum}}人 + 限额 + + + + + 已取消 + 已删除 + 看回放 + 回放生成中 + + + 审核中 + + 参会 + 已报名 + + + + 已满额 + + + + + + + 已满额 + + 报名已截止 + 报名 + + + + 已结束 + 已取消 + 已删除 + + + 审核中 + + + 已报名 + + 已报名 + + + + 已满额 + + + + + + + 已满额 + + 报名已截止 + 报名 + + + + + + + + + + + + + 点击下载到手机 + + + diff --git a/src/pages/liveResult/index.json b/src/pages/liveResult/index.json new file mode 100644 index 0000000..0936c13 --- /dev/null +++ b/src/pages/liveResult/index.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "", + "usingComponents": {} +} diff --git a/src/pages/liveResult/index.scss b/src/pages/liveResult/index.scss new file mode 100644 index 0000000..e872d3e --- /dev/null +++ b/src/pages/liveResult/index.scss @@ -0,0 +1,164 @@ +page { + background: linear-gradient(180deg, #f9f9f9 0%, #f9f9f9 100%); +} +.page { + min-height: 100vh; + padding: 74rpx 0 120rpx; + .badge { + margin: 0 auto; + display: block; + width: 166rpx; + height: 166rpx; + border-radius: 50%; + } + .status { + margin-top: 32rpx; + font-size: 40rpx; + color: #e04775; + font-weight: bold; + text-align: center; + &.green { + color: #24d8c8; + } + } + .nostatus { + margin-top: 32rpx; + font-size: 40rpx; + color: #24d8c8; + font-weight: bold; + text-align: center; + } + .tip { + margin-top: 16rpx; + font-size: 32rpx; + color: #333333; + text-align: center; + } + .price { + margin: 10rpx auto 0; + font-size: 56rpx; + color: #f5ad1d; + display: flex; + justify-content: center; + align-items: baseline; + font-weight: bold; + .sub { + font-size: 36rpx; + color: #484848; + } + } + .container { + position: relative; + margin: 86rpx 40rpx 0; + width: calc(100% - 80rpx); + &::before { + content: ""; + position: absolute; + width: 100%; + height: 34rpx; + background-color: #e04775; + border-radius: 18rpx; + } + + .c-content { + padding: 42rpx; + position: relative; + top: 20rpx; + left: 20rpx; + width: calc(100% - 40rpx); + background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #ffffff 3%, #ffffff 100%); + box-shadow: 0rpx 4rpx 40rpx 0rpx rgba(0, 0, 0, 0.06); + box-sizing: border-box; + .video { + display: block; + margin: 0 auto; + width: 403rpx; + height: 714rpx; + border-radius: 24rpx; + } + .c-title { + margin-top: 24rpx; + font-size: 36rpx; + color: #333333; + line-height: 1.4; + text-align: center; + white-space: pre-line; + font-weight: bold; + } + .date { + margin-top: 32rpx; + font-size: 28rpx; + color: #636466; + display: flex; + align-items: center; + justify-content: center; + text-align: center; + line-height: 1; + .icon { + margin-right: 10rpx; + width: 32rpx; + height: 32rpx; + } + } + .site { + margin-top: 30rpx; + font-size: 28rpx; + color: #636466; + line-height: 1; + text-align: center; + } + .code { + margin: 48rpx auto 0; + display: block; + width: 258rpx; + height: 258rpx; + } + .c-tip { + margin-top: 16rpx; + font-size: 28rpx; + color: #333333; + text-align: center; + } + &::after { + position: absolute; + left: 0; + bottom: -70rpx; + content: ""; + width: 100%; + height: 75rpx; + border-bottom: none; + // background: radial-gradient(circle at 50% 50%, #f9f9f9 0, #f9f9f9 50%, transparent 0); + background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABNgAAAB8CAYAAAC7dA2XAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAE2KADAAQAAAABAAAAfAAAAABi5d06AAA1XUlEQVR4Ae2dDbhsV1nfZ/bsmTPn8+YafEAKhUKkTf2ohJAI2lakaNUCIlaKRXxilCA+ooWnKGCRL0G0YBVLhCCUinw0oNgAtqaQgCkiKUlBApiQ0EjIB7m5ubnnnHvP50z/756771l7zZ4z58zn2rN/63nuPWv251q/d+213vWud61VvffY8XbFCQ8696jziygEIAABCEAAAhCAAAQgAAEIQAACEIAABCDgEjh23/3uz0rk/qpWq+5P4hCAAAQgAAEIQAACEIAABCAAAQhAAAIQgEAfAhkDW7udcWbrcyunIQABCEAAAhCAAAQgAAEIQAACEIAABCBQTgLmqJY6q0VppJwoyDUEIAABCEAAAhCAAAQgAAEIQAACEIAABA5PwBzVUme1KI3YYzC2HR4md0AAAhCAAAQgAAEIQAACEIAABCAAAQiUmwBTRMstf3IPAQhAAAIQgAAEIAABCEAAAhCAAAQgMCSBjIFtyGdxOwQgAAEIQAACEIAABCAAAQhAAAIQgAAESkHAXYMtLkWOySQEIAABCEAAAhCAAAQgAAEIQAACEIAABEZIwF12jU0ORgiWR0EAAhCAAAQgAAEIQAACEIAABCAAAQiUj0Bmk4PyZZ8cQwACEIAABCAAAQhAAAIQgAAEIAABCEBgOAJ4sA3Hj7shAAEIQAACEIAABCAAAQhAAAIQgAAESkzA1mLDg63EBYCsQwACEIAABCAAAQhAAAIQgAAEIAABCAxHwNZiYxfR4RhyNwQgAAEIQAACEIAABCAAAQhAAAIQgEDJCWBgK3kBIPsQgAAEIAABCEAAAhCAAAQgAAEIQAACwxHAwDYcP+6GAAQgAAEIQAACEIAABCAAAQhAAAIQKDkBDGwlLwBkHwIQgAAEIAABCEAAAhCAAAQgAAEIQGA4AhjYhuPH3RCAAAQgAAEIQAACEIAABCAAAQhAAAIlJ5AY2Gw7UftHgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABPYn4NvRYrvcthMlQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAv0J+LY0poj2Z8YVEIAABCAAAQhAAAIQgAAEIAABCEAAAhDIEHBnhCYebJmz/IAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAT2JeB6sUX+nNF97+QkBCAAAQhAAAIQgAAEIAABCEAAAhCAAARKTsDfySByrW0lZ0P2IQABCEAAAhCAAAQgAAEIQAACEIAABCDQl4C/mwFrsPVFxgUQgAAEIAABCEAAAhCAAAQgAAEIQAACEOhNAANbbzacgQAEIAABCEAAAhCAAAQgAAEIQAACEIBAXwIY2Poi4gIIQAACEIAABCAAAQhAAAIQgAAEIAABCGQJsItolge/IAABCEAAAhCAAAQgAAEIQAACEIAABCBwKALuvgaJB5trcTvUk7gYAhCAAAQgAAEIQAACEIAABCAAAQhAAAIlI2C2NDfE9sO1uLkniUMAAhCAAAQgAAEIQAACEIAABCAAAQhAAAJZAr4tjTXYsnz4BQEIQAACEIAABCAAAQhAAAIQgAAEIACBQxHIGNh897ZDPYmLIQABCEAAAhCAAAQgAAEIQAACEIAABCBQQgIZA5vv3lZCHmQZAhCAAAQgAAEIQAACEIAABCAAAQhAAAIHJmAOaxkDGx5sB2bHhRCAAAQgAAEIQAACEIAABCAAAQhAAAIQSPY2yBjY8GCjVEAAAhCAAAQgAAEIQAACEIAABCAAAQhAoD8Bc1RLndWSXUT738IVEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAQErAdVTLeLClF/AXAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQOBiBxMDmurQd7DauggAEIAABCEAAAhCAAAQgAAEIQAACEIAABIxAMkXUdWkDCwQgAAEIQAACEIAABCAAAQhAAAIQgAAEIHAwAua4xhTRg7HiKghAAAIQgAAEIAABCEAAAhCAAAQgAAEIdBEwxzUMbF1YOAABCEAAAhCAAAQgAAEIQAACEIAABCAAgYMTwMB2cFZcCQEIQAACEIAABCAAAQhAAAIQgAAEIACBLgIY2LqQcAACEIAABCAAAQhAAAIQgAAEIAABCEAAAr0J2LprbkgMbHbMO+5eQxwCEIAABCAAAQhAAAIQgAAEIAABCEAAAhA4Q8DfMPTMLqLwgQAEIAABCEAAAhCAAAQgAAEIQAACEIAABAYhwBTRQahxDwQgAAEIQAACEIAABCAAAQhAAAIQgAAEzhDAwEZRgAAEIAABCEAAAhCAAAQgAAEIQAACEIDAEATOrMFW1Rps2cXZhngmt0IAAhCAAAQgAAEIQAACEIAABCAAAQhAoDQEzqzB1i5NhskoBCAAAQhAAAIQgAAEIAABCEAAAhCAAARGSYApoqOkybMgAAEIQAACEIAABCAAAQhAAAIQgAAESkcAA1vpRE6GIQABCEAAAhCAAAQgAAEIQAACEIAABEZJAAPbKGnyLAhAAAIQgAAEIAABCEAAAhCAAAQgAIFSEbB9DTIGNjY6KJX8ySwEIAABCEAAAhCAAAQgAAEIQAACEIDAkATa7XbWwGYHCBCAAAQgAAEIQAACEIAABCAAAQhAAAIQgMDBCWQ82A5+G1dCAAIQgAAEIAABCEAAAhCAAAQgAAEIQKC8BGwmaDobNHYxpAfdY8QhAAEIQAACEIAABCAAAQhAAAIQgAAEIACBLAF3JmjGg809kb2FXxCAAAQgAAEIQAACEIAABCAAAQhAAAIQgEAegYyBLe8CjkEAAhCAAAQgAAEIQAACEIAABCAAAQhAAAK9CWBg682GMxCAAAQgAAEIQAACEIAABCAAAQhAAAIQ6EsAA1tfRFwAAQhAAAIQgAAEIAABCEAAAhCAAAQgAIHeBCI2NugNhzMQgAAEIAABCEAAAhCAAAQgAAEIQAACEOhHIGJjg36IOA8BCEAAAhCAAAQgAAEIQAACEIAABCAAgd4Ekimi5sWGJ1tvSJyBAAQgAAEIQAACEIAABCAAAQhAAAIQgEAvArGdwIutFx6OQwACEIAABCAAAQhAAAIQgAAEIAABCECgm0DqrGZ2tcTAll4iRzYCBCAAAQhAAAIQgAAEIAABCEAAAhCAAAQg0IeA67CWGNhci1ufezkNAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIOASYIurAIAoBCEAAAhCAAAQgAAEIQAACEIAABCAAgcMSSDY5OOxNXA8BCEAAAhCAAAQgAAEIQAACEIAABCAAAQh0CLCLKCUBAhCAAAQgAAEIQAACEIAABCAAAQhAAAIDErCl15giOiA8boMABCAAAQhAAAIQgAAEIAABCEAAAhCAgG12wBRRygEEIAABCEAAAhCAAAQgAAEIQAACEIAABIYgwBTRIeBxKwQgAAEIQAACEIAABCAAAQhAAAIQgAAEmCJKGYAABCAAAQhAAAIQgAAEIAABCEAAAhCAwBAEmCI6BDxuhQAEIAABCEAAAhCAAAQgAAEIQAACEIAABjbKAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEBiRgu4hiYBsQHrdBAAIQgAAEIAABCEAAAhCAAAQgAAEIQIBdRCkDEIAABCAAAQhAAAIQgAAEIAABCEAAAhAYkgAebEMC5HYIQAACEIAABCAAAQhAAAIQgAAEIACBchGwaaFuyBjY/JPuhcQhAAEIQAACEIAABCAAAQhAAAIQgAAEIACBSsWmhbohY2DzT7oXEocABCAAAQhAAAIQgAAEIAABCEAAAhCAAAS6CWQMbN2nOQIBCEAAAhCAAAQgAAEIQAACEIAABCAAAQjsRwAD2350OAcBCEAAAhCAAAQgAAEIQAACEIAABCAAgT4EMgY21mDrQ4vTEIAABCAAAQhAAAIQgAAEIAABCEAAAhDwCGQMbKzB5tHhJwQgAAEIQAACEIAABCAAAQhAAAIQgAAE+hDIGNj6XMtpCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAwCOAgc0Dwk8IQAACEIAABCAAAQhAAAIQgAAEIAABCByUgC25hoHtoLS4DgIQgAAEIAABCEAAAhCAAAQgAAEIQAACHgFbcg0DmweFnxCAAAQgAAEIQAACEIAABCAAAQhAAAIQOAwBDGyHocW1EIAABCAAAQhAAAIQgAAEIAABCEAAAhDwCMTeb34OSMDcAbd3diq7O7uV3Varsru7W2m12hU7nv6zObnpvyiqVmpRrRLVokpcq1Xq9Tg5N+Drue0QBM7KaVdyakle+pvKyP52ZFQ5K6ua5NP5J1nFseSGXfoQuAe+1L6hHfue9NdkZLLak1MliZ/9nmy+u76lRE6STxzXElkN/HJuPDABq+d2drbPyEhyksxaTr2390116r/I5CNZRcl3FVXq+qZMjoTxEjA52Pe0s7uTtE0Wb6mt2vum0rrP5GT1n31PnfbJviv7pkx2hPETSOu9naTuk5zOtFHpd5XIp3JGnzijS9QkH2ub7K/pFITxE7DvZ3tbep/JKdH77Huyf532ya/7UvkkdaDkZHUfYfwETA6JnM7o5gfVz63+s7oP/Xz8MkrfsKN+VKf+O6R+bnqF+lHo5ynJ8f49q58739SeLoF+Pl76B3+66Qw7aqNMl2idaaf62iYS3dz0COtLoZ8fnHb2yuq9x45LFdgLDzr36N4PYvsSsEZga2ursmWFV43CsMEKsjXkjXo9+Tvs87i/Q8CU4M2tbSlY9m8n6VAOw8Ya8LrJqGGyaiSd0WGex70dAtY4byVy2tE3tZ10/odhY0ab9HtqNBoyDmDEGYane699R4msZFizenDYYHKyzmZjroFxYFiYzv2mBKd1n8nJvrFhgnU2GyarRj1pp4Z5FvfuETC5bG5uJe3Ttr4pU4CHCWbASb4ptVNzkhUG7GFoZu+1es/ap9Swlj17uF8mF9P77JuyNsoMOoTREBi9fm51n+l9+ieZEUZDAP18NBzH/ZRUP0/rPpPbMMHqvrSvi34+DMnue8ein6vuM3nZQCshn8Cx++7PnMDAlsHR/4dVKhtShLf0zyzC4wrWkZlTZ7Opf3gNHJ6y9SPN+GmyMsPauII1EqmcTFEmHJ6ANQabm5uJIWBYA8B+b29IMZ5TJ8bkRTg8AfMiTOSkb8q8NcYVrAE3OTWbcxgGBoCcGmsSg80IBn56JcHaJWuf7Huy9opweAJmrDE5bW1vJV5Ph39C/zuSjozVfZKTKciEwxMwY82m9Amr/4Y1fu73djOKpm2UyY1wOAKJsUbfk+l9NrgwroB+PhzZSevnVvdhFB1MZhPVz02fkO5HODyBRD+3Pu+GtVHo54cnOPwdGNgGZGgF9vTpjaThHqcRIC95zbm5yvx8k9HNPDjeMZONKVcmq3FWMt5rk5+mHJuc6MTk0ek+Zp3LU5LTKLw/u5/e+4h5IJqczIBD6E/AOiomJzMETDJYB9NkNK9/DDL0J291n9V7p6VgTbqNMqV4fn4u8cbpn1KusG/JvqlxGgHyKNvU0fmFJp2YPDg5x6xtMjlZWzXJYN7W881OG4WhrT/5qernSRuFft5fSp1pg9PUzxfm55kddBBB6Rr08wOCmvJl6OdTFoDzegxsDoyDRK2jcurU6aTT0u96jWptysX/q+oX3qwVoW5QP/7/6J479e/uhYWF+9bX123+7bfo30NareoFlUrrQsUfI0+4R8n6PK/4vsE6m9ZAMNUtH5NZ7k0Z7mdYU2e9pfXv7ohq1a9IVp+vtKNPq99xuxTZe5rN5l0nTpxoyhvtoZVK/GDJ6Px2tX2xllU5v9XafbTk9E39Oq82Ura4uIArbb6Ykqk16/qm+hnWrGOhDuGxahTdWo2qN1Xblc9UKtGX2+3ont3dU3efc845W/Io+BbJ+8H6nh6ptW++W/++U2M35+3u7Oh4e9/5Nma0WVyYx6Oth5zsOzI5HcSwpnpvXWuq3VarRl+uVtuf1SNv1L9v6Fu5c2lp6cTp06e/WfGH6NhD9diLtC7EY6Vuf6u+p0dKQdh3yNLKQafua+LRliMr8wY4vSHDmuq+fnWTjMs7Wqvwdv1V3RfdKFn9tR75dTG+e35+/p7V1dUVxR+if2qnou/cbbcurLbb5+/sttRG7S7nvD5zyLxEFxcWGAzKUNn7YZ2W9VOnZFjbf4RZ/Nvy5LwnqlobFf2NyanVqt3aaFTvmZubu+v48UpUX9x8SHW7/RA1Z+fpm7pY5eDbW+3d8+RtZd/avu5P5oGzuDjPYNCeaDIx67SsrZ8+kPe75PRAVK3dqubkS/pmPiPZ3dRu79wjGdy9vLy8trGx8WCr+/TIh7errYvbu+1/opV5z1MZ+PuqY/d1/dSzpPM1kwGhTAL5kRCw+m5s+nm1cmGl3Tq4fq6B8AXpE+jn+YVz3Pp5u9V6tPpS6Of5+A981DzWBtLPq9LPW+jnBwY95IVj18/b0s9b6OeHERMGtkPQso6lVTRWkHsFeSvdpY76h6QA/4E6kp/vdV2/4yc3Nh4ji8PzWzvtH9ci1A83xSEvmMJlRgG8b/bo2PSN9fVTySYTe0ezMXUo1rVg49UyBLxjcXHxquzZg/+6//77z9H6a5futivP1sKRj1XZ6GnEMS8pU45NZoTO6KV9T6Zo9Qr6lnbVYbk+qkbvXlpaeJfYrfW6dr/j+n6itbXTz5TB7ad3WrtP1sL7zV7Xm+fhkgyi1ukkdAiYF5R1XParh+px7bZqLbqyXqtdLuPM7YOy08DD41XFPk+d2qdrA5Jv7vUcM4gumVGAKQRnEZkyvKa6zwwCvYIGC+6XQe3D1Wrt7cvL85/sdV2/45KTjNaVy1rt1rP03n+ospFbsVl9l9Z9/Z5ZlvM2pdraqP08oVT/bGmDgr+sVWvvWlxsvlccB1rYVXJpnjp16jm7rfZz1EZ9j97dc+0Cmzpl+oR9W4ROG2WDdGas7hUkl7bWTLtJxrT3Viq7b1tZWTnW69p+x9fWNp4iY9yl0mF+SMaBlV7X27R5G7RjmtseoYPo52rb79Zg6p+ORD/fkn7eQj/fk8DBYgfTz6P1OK5frSUIR6Cfz10q4/VPqh/1Xfvq5+awoLrP2ivCGf1cgwobmgbfK5h+Lr3veg36jE4/35F+3tpPP68neh/6+Z5UDqqf12rxlbVadTT6eUv6+Tb6+Z4UumMY2LqZdB2xTuXq2npPZViVzI6MLB+utOOXrqzMfbnrAUMekLfHI9QovX57Z/eZ6jjleneYUWB5abH0irEpw2YIyAvWcEohvTGOo1fJqPZnedcMc8w6Mmtrp14qGb1AhoEH5T3LOi4mJ5NXmYMtjLqmb6rX+jVmqFZD8GbJ6bcH7Vjux1dyerY8EF+mDUm+3b7vvGAdTTMMlDnYYMLq6npPY7UMABsy2LynVq38mmR116hZra2tSSmu/Ia+px9UWnItnmYUMINomRVjK8LmCdXLWC3Pp5YW4/6kBhVeLu/pT41aTg888MA3RVH8KsnpEtV/i3nPN4V4ZXmx9IZrmxJlxrVe9Y68/m6Rofq3VhYX357HcZhjeqcNNPzCbmvnxVKOH5H3LPuONJhR+mmjZghYXVvr6V1onmoy1lyxvLz4KjEbaOAnj396THJ6suq8V2s9vidIbrm9fmufrJ0qc7DvCP28GCWgj37ersf1G6tx9dWq+9DPpyjSEPRzGdlerjbq23q1kzbAYMuFlDmYfn5S+nmv2T9qnzbiBvr5tMoIBrY+5K3gWgG2guwHeT9tx7X4PVKwXiAF65R/ftS/VdHEMgz8jjoxP6dOTFfN0jHeaFSzhAsXm6HGDDbWMPhBstEIc+OvKpXaJSsrzZv98+P4LcPAT2sa1RvUQGhaaXewkTLzZitj2E/JUtn9Wq1ee9HywsIHJsHGDDhy9vlD7dR3QV5DblPczCCqMjSJ5AT1DvOusY5LHhfVfaf0TckAOv8ysemuHEeck/vua680GutXyCD6zDxDmxlvVA+XcsdRm15ohgAzCPhB05Na8gT4aFRtX6rpad/wz4/j98mT6y+TAedXlZ6uKaT2HZkx1IyiZQv2HZlhzQxseUF1zRc1Cf6ylZX56/LOj/qY6r4f2N1t/2e1meflPds6L9aJKWMwQ7UZrPPGXswDVHrfK5eXF35vEmzkffjw7e3dd0rv+36Voa6GqMyDq6af2wBQ3iY7iX5el36+GJJ+Xs7BVS0B0dHPc9YuPKufN6SfN8PQz8s8uGoOCqaj5wUZQO+QrvXvVPdNTj9vV96+vbX9uDw9FP28p35+Oq7Hv6e6b2L6edxYu2Jne7e3fq5+lHlelylgYNtH2uZybh1MP1hfW9OSrt3eWnz6uedWT/rnx/1bFU1THar3b23tPDVP4bK1VGxB3LIEGRsrD5xcyzWCymvj6/Va9HR519g6UBMP6sT8iowCr1EnuGu7NlsIfCkx3kw8WVN5oTWQpgznGUHVaG/WG/GL1CC8ZRqJWz19+p/tbm5/QJ2YrimJHc+bpVKtI9XLCGrK8Fyj/j6V2+cqPtCUtWHke/LkyQe1K9GHtSPwxf5zzHhjxlBTusoSZMDXANBarhFUdd8XGnHth+Wx9rVp8NC3frm8b56Xt/ahtU/WTpUldEaa842g5gmlKYY/pTZq4KUKhuEoT6mflJzelud5aFMQV1aWSjXAoEHM3GlRyXSoRvymlaWllwzDe9B7bdmQ9ta26r7tb/WfYet8rSwvlWpTkX3183r92u3tpSD1cxtgKNOSLvvq57H083qg+nniGW+Dq/7XNpu/99PPtfbxpjyhpqefr0o/3+2ln0dqo5YrtllZWcJ++rn0vvetoJ8HURQwsPUQg625YetD+UGd7fVGfe4ZS0vNq/1zk/6tkc2LN7e2/1yeArZZQiaYd5R5Sc16SDwMzbjmDTV3DAGNV8ur5ZXTZmDrtNVq9f+5ubV1kZ8WG302xdiMA7McrPE2I2ieK7MMNtcsLy/9KzEYuxdoP8YyXP/O5ub2L/mGa/MOPaKOphnbZj1YvZe35pDK6j21qPov5An1hWkz0PpfP7q5ufPevLU6zGjdLIGHlOqTxCvAq/rMELwtg81lWgP0ndOWky1voDZKnd2dR/ppsd2wbSrirAfzMDy5uto11dDq/MZc/b9qUOESxcfuBbofZ9V38erq2pWS1Y/611mdZ3Wf1YGzHOw7Mk9Q89z1g4z2X1Ld9yR9U/f45yb9e3X11AtlEH2T78lr5cm8eMuwa7mtOWTeoH4ITz/fkX6+g37uNVIqqxqoC0c/j6Sfa9AuRz+vJ8sa2Lc1y8H085PSzzXA3JVNeZtfo4FL9PMuMtM5YPWe1X9+CEk/Pyn9fKfk+rnJBwObX0r1u5d12KavVSut7zpy5MjxnNumckgVY1MeDDdIKTzfT8CsT/Ho5b0hJWtL09d+eGlp/mM+k2n+No+Oza3N53u6RuI2e0QjMLPaiNv03QdOWgczO4XN8qtO9m+qk/3SacrFf3fHeLN9pb8YuKXXOpqaIuTfMjO/e3lvyGP3eq2f9UQx6NbAppR7W2Rf61J+TvVAl9fhrK/P0ct7I1kXqjl30aSm2hxU9A+srv3F1ubWU/zrzdvQBhhmNfTy3pCxqtWcq18mr7WRr7M2DEt5XL94Y3P7t/0BBvMOWDkyu14CSQdTnqCmU/hBu7R+QHXfv/aPT/O36r7Hyhh6nYy3XRZq+55m2Yu3p34eSz+vop9Ps1y670Y/d2mEG0+8q23wG/08XCGdSZnNqDPdzw/o5z6RMH77BrbZHqI8APNk6+gczzV52XxSnetHhmRcs+yow7sh48w/lhL4IT976c4i/vFZ+G3rDeVNjZLx4775ZuMxoRnXjLlGl39+rjH3fFsXyZXBXl7co7MRTzsuvnHNptuIxb8Jzbhm1NXp/VAcz3+H3OIz07/38pIR32wISrlY77Fj1Fyz8U7VfReFZFw7I6e7VPc9VMb0G3wh2ChfniLiX1fE3+Zhk7d0gTrVt5xzZOVhoRnXjPGR5aUf0LRQ27Akg9zyYkbdWQzWcclbukAehqfVRn1PaMY1k4E8tN7YnJv/QRukcmVia1yZh4PVgbMY7HvyjWsqq+25+bmXh2ZcM/4qOzdqw5JHaDrQHb488vLiX1PU3/vq50cC1s8b9Xz9vMdaV0WVT5ruPZ02W19oynnY+nmznPq5b1wrtn6eHchPy2TR/9rMkjzv6uD187lG1/JMs6yf71fOSm1gS6bceG7n1iGQl82bNcf7nysebM9aSuAzmvNzrzCl0BWwjfb12lnOva5I8XQ9G1/ZtzWHzjmy/LD5+fnbQ82PjGxvlWfhP7XdXdw0mnJvmzTMWrA11/xpoTaNY64RX6CFUt8fan5tN+BWa+Xhmm5zm5tG88az6V5WBmcp2JTQ0xuZImnG+3ZzrvlCrTn0M6HmVWncOXJk6XGabvJHfho7Hc3u6V7+dUX6bd9SnnFN+f+ojI2PEY+R72Y4Kj4ypr9E5enfmvLuPnNj0xaU716Owb2maPHEGC+DlF9PaBrH3Zq++w+0Lt6nQ82TLX8hA+A/kjdkxlM/9cbz291Q83HQdK1J5/M7LjbNWgyeqt0MX3fQ50z6upWVlWMyXD9Cg7//2313Uvbkjed3mt1rihhPjPFF1c9XlvP1c9V7Vv/NUthPPz8Sun6+uPjWuunn2h3dlcls6+eZ5tiWQVkrin6u9jRHP+9ud11ZFjGe6OfS0d22tzD6+fLShWXRz/uVrUhC63fNTJ43ZcRG0t38W1zW4efLKPLCImRaa7m8RiOuP24fnpteUyDz5ta71xQlniqPfselMde4+pyV5e9Q3jMNY4j5UufqU3Nz8aPUkK266TMDr+3gMyvBRin8DQ3Mw1DTrB8mT4nPh55P28BECuGj1Th8xk1rZ02l2TGGWsfFDPEW0vrPvCw1he0pMoK+2c17qHEtxP5c1dUv89NnO0CbvGYhdDou3btGNZuN31X+f6QIeZRn8XtUrh4vA0ZmLp4pkLPkcWhGUN/AIQ/Dm2UEfXgI63j1KysapPqqvCH/nu0a515rBl7TJ2YlmJe/lbu03rO/apc3tYbtt8lL7COh51PpbWnw93vVRr3bTavpSasz5HFoHlH+wILJSvkuvn6ufgf6uVt6pxtfMf28Hj9KMxi69fMzetJ0Uziat1tfw/Rz+47snwUtg2T6ubVRhdDP1UY9WtMju/RzG9iflWD6uT8A2Vliool+XjAhR66FtGBpHzi5iTKiD9L+uvlX4325jFZvHfjBU7hxeWHhT9TR/HX/1VbhuHnzzxflt1U0pmy5QaMYX7UpSO6x0ONS3u9q1Gvf63tzmKHDn6oSel7y0meNgr8Qp3kFWOf66NGjJ/LuCfWYDOxPsAVE3fRZR9Nv9NzzRYmb0cY8J9O6If0rg/UvSsn6WFHyYemUp93rtbnBf3PTbPnxO2bu+SLFV9UR8wcWtADxtctLS79cpHzY9Lb6XONZUuq7BoL8qeRFyleaVjMWWv3nBpturrWxHqs8ZwyL7jWhxZXWjShqP9amtLppM4PULHjFmx6hjaJ8va9djxs/1Gw2b3HzHHpcBvafkrf1jW46bVrvLEy/TuvwtG1K85jo55oRkP4uwl/08yJIKZmCfVc9Tz9X/2NbRqmih2Qw/4yx0L4r+2f6uTzXCqefa/ZWl35uButZ0s/98qbNkaSfh7XGuJ9G//es6+d+fvN+l3KKqH2IvmJviwaqY/2CPEihH0s82TRlyE2ndcyK3tG0RsFX7NUorLdbuxe4eS1K3EaJ1KBdmo4epek2Ofm7oqbnivA3r6xZZ1pTWZ5pnhFFyIObRqW9pWldjzPPBvd40pEuuLKVV9bMG0J1yFvcvBYlrt1on6WO5t+66U2MoVpfrsihY3jPKvbK553a3evJRcyXdTSlJL7RTfteR9o9Wqx4nuHdBlHiuPkE1SOFc/2yaYgyWn+/v25ons5UJEn1Kmsqky9dXp6/pkh5SdMqI9t3a42rzLTePJ0pvb4of/PKGvp5eNLLK2uzqZ/bQFdmbCg8YeyTos6garYpmlX9vOjGUPTzfQpyAU+VzsBmH6BvtJGSckxW8ScWUH5nk2xThuR1k1mLzEbVizoNxxRim3LoBnOTldHmSUXziHLzICPbuxqN+G3uMWsA/by650OP2xQik5cb1En7TXmuXOUeK1Jc03q/3qjPPdUUETfd5iHg59U9H3Lc6j3fW1LT2G4yb4iQ090vbUr/hf70DltfzowfRQw2+ONPHY+0hmOtVr3AjL9FzJOlWSOa/17191+66TevIn8tQPd86HHfY0jy0TS2uecuL899MfS090qfrRenui/jJWl1np/XXveHePzUqY2uQdW5ufp/V5l8Q4jpPUiaVNa2NF38IvNEca83A5XpFEUM6OfFkNos6+cacOzWz+X5WtRQJv3cvP7Rz8MqqbOmnx+GbukMbGueZ4O8VLakaF0oZaWYvTFH2tVK+wLlJ9MSmLJVxAqnoyRmbBsVjTa/QEab650sFzK6srx8mabkZXZaMUNoEdflMCOuPz1KneiPLy0tdq2PVTRh2eLfjWbj19x0W8fFPNmKFsxD0r4pN2hR8wc0je0i91gR46q71+I4eqI//bqoa0fZ7q5uUP7a2jn1X8o4n5m27F5TlLg8Dr9Pnnh3uem178mmtxUt2JR4f901dc5+39adK1pe/PTaWoxqo97nHrf2qYgLtJvB2jfiqgzepnb46W7+ihjX1NZb40b9J6yOSNPfMX5k65D0XOh/u/VzTWObKf08ml39vD4b+rlmMl3m71SOfh5ezYF+Hp5M8lI0a/p5Xh57HSuVgS1R5KVsuUEV6aUh70LpprVf/MiRI8eVn6edWb8yubyIBgHzavC9DG1Tg6Ktj7efvFaWFp+okeeMFlw0LzZzWlv3RvbMaKNO9FP2y3uRztmucv6iqtZZK9pC+uYR5RraO0ab+En6m1H4iyQbN63Ly8tfkHHjV9xjefWIez7EeGKw9qYha2DhP2ka2ydCTO9h06Ty1tJaNxebN3J6b8cgUKxiaO2q72WoaeVfUefsF9N8Ff2v1jl9dlyPM8ZQvx4pQh67jDaRbbjRenwR0n6QNKqN+pAMhn/sXmvT94o2XSpfP5/7mdnSz+e69PN0wyFXfiHH89rVRD8v2Pp4+zFeWVl8Avr5foTCODcz+rkGVdHPwyhTo0xFaQxsVnj9hkzTo76o0ebMbkyjhDuNZ9lCiFK2rnPfbSPtRZoycOp0xu6ULMYpg9SPuXkqelwdzS3t2PYiNx+muBRpSq95M/iGprhW/1nrRLv5Knq8FlWe5npHmWHRL6Mh59Fk1GWwrtc/bIvPh5zuw6ZtaWnhjfqm/s69z6/z3XMhxnO8DI9rGlumnggx3YdJk6Ygfk1t1Dvce8ywaPVfUcLp05tdCnEUzRXeI8rnr931bJfys4dtLSJ/M5uzJwOMmJHJNzRp57w32GBkgMkdOEky7F6i2QuZrfTWNS22KKHM+rm1zcXWz2tb6OfhfWmbefp5A/08NEkl+rlk5QbpR+jnLpCCxktjYLNGzLcQayrb0woqtz7Jbj9DBoGzU14t30VRim06hz/lsN6ov0ZK/lqfTBfutJTiP1BFepub8CJNP9zwpkrqe/qcphZ9wM3PLMRtap7kdLmbFzOEFmVamz89yjZvUNn7CTc/sxKv16MfyxoEZFz0lJdQ82r1XtfmO/X4uaGmd5h0yRh6mcrhqvuMohitrT31y5S8XD9Y5HXXXDm4cRlDP6WByI+7x6zed3Up91xocd/ArvV271Xdl5n2H1qaB0mP6rwd7VKe8Z60NSj9NTcHefYk7kE/z3awJ8F8kHfk6+fxa2dVP9e61oXVz/2+RKKfL6CfD1Lux3lPCfXzs8sZ2MCCr0uNk/Wkn10KA5t5nPgGJk3nuMbWr5g08Em8z3YCU/4yhg5fgZlEOgZ5h68QWyfMdkkd5FlFuCeK4p9102lr+vgGRvd8KHHfwGRGDe08N5PGAGMug8AvmWHK5e8bGN1zocStAbORTDeok3mF5FUc9wY38X3i8sr7rLzYbnAv8xVN91xIcb/uM+O78vORkNI4qrSo/Gmn3tpr3eflGRjd86HErTy5Bibzbl1eWrgklPSNOh21qPocyWtPKU4MjFujfs3In5dnYIrj+otH/qJAHqiBoHfKIHC3mxy/TnHPhRLP1c8bdfTzUATkpMMvT7Oun9eiOvq5I/9Qo3n6eRH0vpLq55mZM0WQ06DlvhQGti2tR+G6YJuyKEUkU3EOCjDU+3Z2tn/eX+dmQ143IQdbiN2fIiljwO+GnOZh06a1la7xd381Y2jowTdYKw83ScH/fOjpHjR9ZhBQWfwv7v32PbkdbfdcKPFOGvdSYzvOSRmZ2U6m5TSOq8/by3Elmca85a1r5p4PIW7TI/1dT7VxQ2YnxxDSOco0qL74LZXHzLS2ItR9fjuqNeU+ovph5jysU1nLyHuXBuyuS3/b3w2tQxl68NuoOI6PawmNPwo93cOkrx7XXuHeb9Nj/WUc3PMhxHP187iGfh6CcJw0lFc/zy47UYQ2yq/7yqifW18S/dz5gAOJFlE/HxRdKQxstuCrG+ThcKMWTv2qe2zW4kePHj0R12v/y82Xb7xyz4UQ9z1tzGNIxoBfDyFt40xDLYozi7ObMcA1CI/z3YM82xR23xgQVeNfGORZRbpHZfGXs2uxtYP3NvS/+Vocf1DGgGyFWCQhHCCt5sUmg8At7qU+B/dcCHG/7pNCfLfycVUIaRtnGrSI/tvc5/tttXsuhLhfN9tgnVYo+7kQ0jbWNCRr9+y9Ia8N2Ds7/Zh1rHxP8HocvWH6KRtvClRnXBHXaifdt4T+Tfnp05IgN5RBP1cbVSj9fMsboC+Pfl57ifs9ddqAsw697qkg4nl1M/p5EKLpSoSvl2oQH/28i1JxD8y8gc0W5fUVrage/UZxRXbwlMdR9DL3ajOK+Gv8uOenHd/c3M4kQYrix8xzKHNwBn9o3bL3+zsWbWo9plCDrxBr59ATs7LL4X7MVRY3lNfr3Wv8BtI9N+24/73bWuWNuPar007XJN4fRbWM56u1ASGPZnZ9U7V4pj1t0jKg6f+vMCNV+juvvU7PhfDX/96lEN+sHWy/EULaxpmGlWbzZm1gc4f7Dt+Tzz037bj/vdvAiIxP/3Ha6ZrE+2v12gfd9/jGe/fctON533tUi1437XRN4v1aUqNQ+rn/vZdbPw93jLJLlyiRfi4P3s+4367fXrvnph3P08/Vv0A/n7ZgRvj+mTewmfu5G2pRbWN5YeFP3GOzGjdPDn2w97v5C9VwYx5bvldUrVZ9pZv2WY7Htexopj9aGFLe/UarFtf+LKT0jTMtsaf822hmqIYb/1tXB/nr8gy4fZx8Qnm2vA0vV6c6s9GLySrEYAuRW0czDWZw2tycf236e5b/Kq9r8tb7kptHv4Pgnpt2vGuwLqq9ZdppmtT7NWU5Y/T1WUwqHQd5j1+GbGBEZW3mB+uMjQZW/4PyehZTx6MlzB160c9j9POzJTXcCPp5uLJxUyZHhde7v9HPXRrhxIuknw9DbeYNbNZ5MWUjVTi0XsonhgFWtHtl/LjKzb9vxAolP1uSkxukED8gA2HGW8g9P2txGRNf5eZpW96GIRpuzBDqe0GaQu+mfZbjKpNX6ZvKLEAU6k5t6beefv9RXH3fLMvGzZvy3NJUo8/asTT/ocrJ1klyg7yibjn33Gpmmpd7ftbiUbX2VjdP4copWyebV5TW9Pp9N+2zHF9cXHidvqWzluBkUEyb8oQYUr3P0mbfv8rYm0JM5zjSpJ1fv6426k7LtwX769cx43jvIM/0v/Xy6edRZhmAUOWEfl48/Tz9/kunn8uJJq337K9fxwxST43jHv9bL5t+rjVRE/08ZRuqnNL0DfJ39g1sOx0Pk9RYUa3W/ngQUIW9p1a7wvKe5t8Kse3aFFrwKxut75D5+EJL76jTY96GynPG3TLECsdPk9K8JoX+a6PmEfLzatXaF930+WXXPTetuH3vqazS778Rx5dPKz3TeG9Uaf+pvTfNf4hysvSlcrK4BRlu/qITK8f/MlK9I+0MWI47RvzwnI1s0MMNGi2/XekOL6FuIkcYV17XNPCVmQ674w2MjfB1Az/KNgxJv3l7iOxLLZWxzLTJgR9ekBvVqf6kMbBgf/2yG0o2tqWfu6GM+rmb/07ZdY+EEffbTvRztdteexCCpFxdwr77UurntY5+ntZ/ftkNQU6WNvvW3VA2/bwWVRL9PGUQopzStA36d6YNbOZp40+9WVxsvn9QWEW8b2V+/rqaN1Uq9WwJKT9uw2Dpks9hKabxujJQh+0W93eQDbinVMh1fmZ3DnVl4ca1dspH3d9+2XXPTSvuT4e0Nf6azeat00rPNN4rQ80fuu+1qVJmvAkp5HV+5SSUSXdI6R1HWsxwo47AcffZfsfbPTetuG9Mimq1a6eVlmm9V3XfX7vvDrKN8jxCtYmQeXOF9eG7EMcQl5wy03lDbKPQzysV9PMxFP4xPVLLg9zsPjrEb8qvj9HPwzeEWplCP68ku12Hpp+73/sg8Zk2sPkWYo2+HpOilfESGgRa0e7RorG3u2n2p/i556YRt06m+2HZzAbN0X7XNNIyzXdG1ejj7vtDk5Olzf+mqrXKn7tpLkNcaxG93c3nToDTpMyY5AYtSJxRDt1zsxpfWVk5JsPNqpu/0GTly0mK1vbS0tL/ddNchrjaqBvdfPpc3HPTiu/sZj3Yqu3o3dNKy7Teq93ornTfHeJgnf+N65v6KzfNZYjLI/6jMrKdbQRMxwrtm/J1Cenn96KfS8fy6plpl1f0844EqtXoGlcW6OcujXDiXfq55ykWQkr9Ngr9vCMVn0sIshomDTNtYNv1vBVUQf6/YWAV9V4ZbjKd69AKsd9QaQfATfNqKCrvgdNdq17r3utzcc9NK+6nqVatXj2ttEzrvbZRgK2/5L4/tM6LLyf5hP6Nm96yxOW9e6eb19DlVI2iY256yxKvVaMb3LzuBqYUdzqZe2srqH3SIFDzE26ayxBvtbb/h5vP0L4nS5ufJskq43Xnpn+W42qjMus47rYyTdbUs56jn2cGgqeewAklwNfP/fI7oWT0fI2vS6Cfd1D5XHoCnOAJP03o56mszo41TFAavV/lywn9PEw59Zbgwc7MtoHN8yypRpXMbmUHQ1T8q6Rofc7NRXgNeLbyq0bV+9z0liXe2t6+1s1raHKyTqb9S4N1MmVsKs1GFGm+7a+8A7KdF6+uca+dRtwvO6oDSrWmYcpcZfQradz+dis27tnJx/30qLP1d5NPxfTfqGmxn3JT4XNxz00j7g9KSU4bKlvZhmsaCZvwO80rtHtwITDDjVcXq2xdO2FMQbxOcrrLTYjfJrjnphH3v3H0844UQpPTjucNj34eppzQz/dqMfTzPRYhx0LXz4dlF/sPOHZfZtdo/3Shf2tKR0k7me1Pu4KzxQRDlnNUrZayk3nkyJHj9x0/oYHdVi2VV9hyKmcn02TT6bzsHk3ldHI1bIdLdTJL523TkVPV1gj8kVROGxubFfsXalAn829DTds407W1tXWt+3zzbgm57qvWqpk149y0z3rcOi8Sz9m67/4TmbGGoLJvg0C2gVBQiZpQYrSO7a161fnp69bXT1XsX6gB/bwjGfTzMEso+nmYcslLFfp5HpXwjkmXKJR+fliCM+3B5sOIonYpXdBlsDFFqzBBimEpPdhMQOoPFGaNQBkDThemUI04odVK5cSIHznWx21sLBSqDhgVjHa1cseonjWJ50SV7JTWSbwzhHccPXr0hIwhe+6xISRqnzRoEOiBfU7P9KlqJQp7NMGhrzIVlnudk7axR6PqPWN/xwhfgH4+QphjfBT6+RjhjvDR6OcjhDnmR6GfjxnwlB5fKgOblK17p8R5qq+V6/DdU03AIV8uI1O4Q+KHzMthL1cZLY6BrVoN1xXosOAPeb3klFk8/5C3T/zyc8/NTmmdeAKm9cJW4er8Eg8uFMfApqGQ9WkV6Wm/V+1zYQZWVE9nd6aYNryJvr9dqEEg9POJFo6BX4Z+PjC6id6o7wn9fKLEB38Z+vng7EK+s1QGNrmNFmpEb1QFx9ZNGdWzJvOcaqEUw1EyKVijuDHKvBfsWYXxYFGZKoxn0OjLQPUbo3/m+J7YqrZLO/VQ5bQwxpBqpV1aA5tKf7jzDLs/zcKUqe6kD3mkWqxpzOjnQ8p7YreXWj8vzAC4igP6+cS+icFfhH4+OLvQ7/z/h9g5JEdFJDcAAAAASUVORK5CYII="); + background-size: 101% 100%; + // background-repeat: repeat-x; + // background-color: white; + // background-size: 30px 30px; + background-position: -1px 0; + } + } + } + .footer { + padding-top: 106rpx; + .btn { + margin: 0 auto 24rpx; + width: 440rpx; + height: 96rpx; + background: #e04775; + border-radius: 48rpx; + line-height: 96rpx; + text-align: center; + font-size: 32rpx; + color: #ffffff; + box-sizing: border-box; + } + .btn1 { + border: 2rpx solid #e04775; + background-color: transparent; + color: #e04775; + } + .btn2 { + background-color: transparent; + color: #e04775; + } + } +} diff --git a/src/pages/liveResult/index.ts b/src/pages/liveResult/index.ts new file mode 100644 index 0000000..16c7019 --- /dev/null +++ b/src/pages/liveResult/index.ts @@ -0,0 +1,100 @@ +const app = getApp(); +import dayjs from "dayjs"; +let live_time: null | number = null; + +Page({ + data: { + id: "", + detail: {} as any, + liveDetail: {} as any, + userInfo: {}, + codeUrl: "", + dateValue: "" as string | number, + rewardScore: 0 as number | undefined, + }, + onLoad(options) { + this.setData({ + id: options.id, + rewardScore: options.rewardScore, + }); + if (live_time) { + clearInterval(live_time); + } + this.setData({ + dateValue: dayjs().valueOf(), + }); + live_time = setInterval(() => { + this.setData({ + dateValue: dayjs().valueOf(), + }); + }, 1000); + app.waitLogin().then((_res) => { + this.getLiveDetail(); + this.getDetail(); + this.getCode(); + app.getUserInfo(this, true); + }); + }, + getDetail() { + wx.ajax({ + method: "GET", + url: "?r=igg4/activity/sign-up-detail", + data: { + Id: this.data.id, + }, + }).then((res) => { + res.BeginTime = dayjs(res.BeginTime).format("YYYY-MM-DD HH:mm"); + res.BeginTimeValue = dayjs(res.BeginTime).valueOf(); + this.setData({ + detail: res, + }); + }); + }, + getLiveDetail() { + wx.ajax({ + method: "GET", + url: "?r=igg4/activity/detail", + data: { + Id: this.data.id, + }, + }).then((res) => { + this.setData({ + liveDetail: res, + }); + }); + }, + handleLive() { + const { TencentMeetingCode } = this.data.detail; + wx.navigateToMiniProgram({ + appId: "wx33fd6cdc62520063", // 要跳转的微信小程序appid + path: `pages/index/index?code=${TencentMeetingCode}`, + }); + }, + getCode() { + const { registChannel } = app.globalData; + wx.ajax({ + method: "GET", + url: "?r=igg4/common/get-channel-wx-code", + data: { + Id: this.data.id, + ChannelType: registChannel, + }, + }).then((res) => { + this.setData({ + codeUrl: res, + }); + }); + }, + handleHome() { + wx.reLaunch({ + url: "/pages/index/index", + }); + }, + onShareAppMessage() { + return { + title: this.data.detail.ActivityName, + path: `/pages/liveDetail/index?id=${this.data.detail.ActivityId}`, + imageUrl: `${this.data.liveDetail.IntroductionUrl}`, + }; + }, +}); diff --git a/src/pages/liveResult/index.wxml b/src/pages/liveResult/index.wxml new file mode 100644 index 0000000..f237a2e --- /dev/null +++ b/src/pages/liveResult/index.wxml @@ -0,0 +1,61 @@ + + + + 资料审核中 + 资料审核通过后可参与活动 + + + + + 报名成功 + 您已成功报名大咖秀 + + +{{rewardScore}} + 能量 + + + + + + + + + + + + {{detail.ActivityName}} + + + {{detail.BeginTime}} + + 地点:{{detail.Location}} + + + 关注"gMG给力加油站"公众号获取活动通知 + + + + + + + + + + + 进入会议间 + + + + + 立即进入会议间 + + + + + 回到首页 + + diff --git a/src/pages/login/index.json b/src/pages/login/index.json new file mode 100644 index 0000000..4b94838 --- /dev/null +++ b/src/pages/login/index.json @@ -0,0 +1,8 @@ +{ + "navigationStyle": "custom", + "usingComponents": { + "van-icon": "@vant/weapp/icon/index", + "van-divider": "@vant/weapp/divider/index", + "van-popup": "@vant/weapp/popup/index" + } +} diff --git a/src/pages/login/index.scss b/src/pages/login/index.scss new file mode 100644 index 0000000..2958bb2 --- /dev/null +++ b/src/pages/login/index.scss @@ -0,0 +1,188 @@ +pgae { +} +.page { + padding-bottom: 80rpx; + position: relative; + height: 100vh; + background-color: #fafafa; + .bg { + width: 100%; + } + .container { + position: absolute; + left: 0; + top: 300rpx; + width: 100%; + .frame { + display: block; + margin: 0 auto; + width: 124rpx; + height: 145rpx; + } + .title { + display: block; + margin: 32rpx auto 0; + width: 430rpx; + height: 50rpx; + } + .content { + padding: 32rpx 50rpx 0; + font-size: 32rpx; + color: rgba(102, 102, 102, 1); + line-height: 64rpx; + .link { + color: rgba(207, 83, 117, 1); + } + } + .form { + margin-top: 32rpx; + padding: 0 64rpx; + .row { + margin-bottom: 40rpx; + display: flex; + .input { + flex: 1; + padding: 24rpx 32rpx; + height: 40rpx; + font-size: 28rpx; + color: #999999; + background: #f2f2f2; + border: 1rpx solid #cccccc; + border-radius: 24rpx; + } + .code { + margin-left: 24rpx; + flex-shrink: 0; + width: 212rpx; + border: 2rpx solid #e04775; + border-radius: 24rpx; + font-size: 28rpx; + color: #e04775; + display: flex; + align-items: center; + justify-content: center; + } + .submit { + width: 622rpx; + height: 88rpx; + background: #e04775; + border-radius: 24rpx; + font-size: 34rpx; + color: #ffffff; + font-weight: bold; + text-align: center; + line-height: 88rpx; + } + } + } + .phone-btn { + margin: 48rpx 50rpx 0; + height: 88rpx; + line-height: 88rpx; + text-align: center; + font-size: 34rpx; + color: #ffffff; + background: #cf5375; + border-radius: 24rpx 24rpx 24rpx 24rpx; + &::after { + border: none; + outline: none; + } + } + .divider { + margin: 48rpx auto 0; + width: 300rpx; + } + .other { + margin-top: 48rpx; + display: flex; + justify-content: center; + align-items: center; + .col { + font-size: 32rpx; + color: rgba(153, 153, 153, 1); + display: flex; + align-items: center; + justify-content: center; + } + .line { + flex-shrink: 0; + margin: 0 50rpx; + width: 1rpx; + height: 36rpx; + background-color: rgba(221, 221, 221, 1); + } + } + .argument { + margin-top: 76rpx; + padding: 0 50rpx; + .a-col { + margin-bottom: 20rpx; + display: flex; + gap: 12rpx; + + .icon { + flex-shrink: 0; + width: 36rpx; + height: 36rpx; + } + .a-content { + font-size: 28rpx; + color: rgba(102, 102, 102, 1); + .link { + color: rgba(207, 83, 117, 1); + } + } + } + } + } +} + +.popup { + padding: 64rpx 40rpx 0; + width: 630rpx; + height: 332rpx; + background: linear-gradient(180deg, #ffedf3 0%, #ffffff 40%, #ffffff 100%); + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2rpx solid #ffffff; + box-sizing: border-box; + .p-title { + font-size: 36rpx; + color: #333333; + font-weight: bold; + text-align: center; + } + .p-content { + margin-top: 10rpx; + font-size: 32rpx; + text-align: center; + .link { + color: #cf5375; + } + } + .p-footer { + margin-top: 32rpx; + display: flex; + align-items: center; + gap: 30rpx; + .p-cancel { + flex: 1; + height: 80rpx; + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2px solid rgba(240, 184, 201, 0.2); + font-size: 32rpx; + color: #cf5375; + display: flex; + align-items: center; + justify-content: center; + } + .p-submit { + flex: 1; + height: 84rpx; + background: #cf5375; + border-radius: 24rpx 24rpx 24rpx 24rpx; + font-size: 32rpx; + color: #ffffff; + } + } +} diff --git a/src/pages/login/index.ts b/src/pages/login/index.ts new file mode 100644 index 0000000..5cf9b14 --- /dev/null +++ b/src/pages/login/index.ts @@ -0,0 +1,178 @@ +const app = getApp() +let timer = null as null | number + +Page({ + data: { + mobile: '', + code: '', + + check1: false, + check2: false, + + codeText: '发送验证码', + page: '', + + popupShow: false, + }, + onLoad(options: any) { + this.setData({ + page: options.page, + }) + app.waitLogin({ isReg: false, loginPage: true }).then(() => { + app.mpBehavior({ PageName: 'PG_PATIENTLOGIN' }) + }) + }, + getCode() { + if (timer) return + const mobile = this.data.mobile + if (!mobile) { + wx.showToast({ + title: '手机号不能为空', + icon: 'none', + }) + return + } + // 验证手机号 + if (!/^1[3-9,]\d{9}$/.test(mobile)) { + wx.showToast({ + title: '手机号格式不正确', + icon: 'none', + }) + return + } + wx.ajax({ + method: 'POST', + url: '?r=igg4/login/send-verify-code', + data: { + mobile, + }, + }).then((_res) => { + wx.showToast({ + icon: 'none', + title: '验证码已发送~', + }) + let time = 60 + timer = setInterval(() => { + time-- + this.setData({ + codeText: `${time}s后重新发送`, + }) + if (time <= 0) { + clearInterval(timer as number) + timer = null + this.setData({ + codeText: '发送验证码', + }) + } + }, 1000) + }) + }, + handleSubmit() { + app.mpBehavior({ PageName: 'BTN_PATIENTLOGIN' }) + const { mobile, code } = this.data + const { registrationSource, registChannel, regBusinessId } = app.globalData + wx.ajax({ + method: 'POST', + url: '?r=igg4/login/reg-login', + data: { + mobile, + code, + registrationSource, + registChannel, + regBusinessId, + }, + }).then((_res) => { + this.submitCallback() + }) + }, + handleWxSubmit(e: WechatMiniprogram.CustomEvent) { + app.mpBehavior({ PageName: 'BTN_PATIENTQUICKPATIENTLOGIN' }) + const { iv, encryptedData } = e.detail + const { registrationSource, registChannel, regBusinessId } = app.globalData + if (iv && encryptedData) { + wx.ajax({ + method: 'POST', + url: '?r=igg4/login/wx-reg-login', + data: { + iv: encodeURIComponent(iv), + encryptedData: encodeURIComponent(encryptedData), + registrationSource, + registChannel, + regBusinessId, + }, + }).then((_res) => { + this.submitCallback() + }) + } + }, + handleWxCheck() { + this.setData({ + popupShow: true, + }) + }, + submitCallback() { + app.globalData.loginType = 1 + app.globalData.isLogin = true + app.getUserInfo(this, true, (userInfo) => { + // 1-空白用户,2-注册用户,3-疾病患者,4-用药患者 + const { PatientId, AuditStatus, UserType } = userInfo + const backPage = app.globalData.backPage + let urlKey = '' + if (UserType >= 3) { + urlKey = 'home' + } else if (!PatientId) { + urlKey = 'agreement' + } else if (AuditStatus == 1 && typeof backPage === 'string' && backPage.includes('liveResult')) { + urlKey = 'home' + } else if ([0, 2].includes(AuditStatus)) { + urlKey = 'enterInfo' + } + const navUrl = { + home: backPage || '/pages/index/index', + agreement: `/pages/enterInfo/index`, + enterInfo: '/pages/enterInfo/index', + }[urlKey] + + if (['agreement', 'enterInfo'].includes(urlKey)) { + wx.navigateTo({ + url: navUrl, + }) + } else { + wx.reLaunch({ + url: navUrl, + }) + } + }) + }, + handleVisitors() { + app.mpBehavior({ PageName: 'BTN_PATIENTLOOKAROUND' }) + app.globalData.anyWhere = true + app.globalData.first = true + app.globalData.loginType = 1 + wx.reLaunch({ + url: '/pages/index/index', + }) + }, + handleDoctor() { + wx.reLaunch({ + url: '/doctor/pages/d_login/index', + }) + }, + handleLink(e: any) { + const { url } = e.currentTarget.dataset + wx.navigateTo({ + url, + }) + }, + handleCheck(e: any) { + const { key } = e.currentTarget.dataset + this.setData({ + [key]: !this.data[key], + }) + }, + handlePopupCancel() { + this.setData({ + popupShow: false, + }) + }, +}) diff --git a/src/pages/login/index.wxml b/src/pages/login/index.wxml new file mode 100644 index 0000000..19c51c3 --- /dev/null +++ b/src/pages/login/index.wxml @@ -0,0 +1,103 @@ + + + + + + + + 在您加入gMG 给力加油站平台之前,请您阅读并充分理解 + 《个人信息及隐私保护政策》 + ,了解您的权益及相关数据处理方法,我们将严格按照法律法规及 + 《个人信息及隐私保护政策》 + 的相关规定保证您的个人信息不受侵犯。 + + + + + + + + + + + + + + + + + + + + + 我已阅读并同意 + 《个人信息及隐私协议政策》 + + + + + + + 我特此同意依照此 + 《个人信息及隐私保护政策》 + 规定收集我的个人敏感信息 + + + + + + 随便看看 + + + + + 我是医生 + + + + + + + + + 阅读并同意 + + 《个人信息及隐私保护政策》 + + + 取消 + + + + diff --git a/src/pages/my/index.json b/src/pages/my/index.json new file mode 100644 index 0000000..75951a7 --- /dev/null +++ b/src/pages/my/index.json @@ -0,0 +1,9 @@ +{ + "navigationBarTitleText": "个人中心", + "navigationStyle": "custom", + "usingComponents": { + "van-icon": "@vant/weapp/icon/index", + "navBar": "/components/navBar/navBar", + "van-switch": "@vant/weapp/switch/index" + } +} diff --git a/src/pages/my/index.scss b/src/pages/my/index.scss new file mode 100644 index 0000000..77593bc --- /dev/null +++ b/src/pages/my/index.scss @@ -0,0 +1,203 @@ +page { + background-color: #fcfcfc; +} +.page { + .bg { + width: 100%; + height: 902rpx; + } + + .page-container { + position: absolute; + left: 0; + top: 0; + width: 100%; + padding: 0 40rpx; + box-sizing: border-box; + padding-bottom: 200rpx; + + .banner { + padding: 24rpx; + border-radius: 24rpx; + background: rgba(255, 255, 255, 0.13); + border: 2rpx solid rgba(235, 236, 238, 0.51); + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + .user { + display: flex; + align-items: center; + justify-content: space-between; + .avatar { + flex-shrink: 0; + width: 116rpx; + height: 116rpx; + border-radius: 50%; + border: 4rpx solid #fff; + } + .inner { + flex: 1; + padding-left: 16rpx; + .name { + font-size: 40rpx; + font-weight: bold; + color: var(--name); + } + + .tip { + margin-top: 16rpx; + font-size: 24rpx; + color: #9e9e9e; + + .day { + font-size: 36rpx; + color: var(--name); + font-weight: bold; + } + } + } + } + .options { + margin-top: 32rpx; + padding: 30rpx 22rpx; + display: flex; + align-items: center; + justify-content: space-between; + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + border: 1rpx solid rgba(222, 222, 222, 0.6); + .ver-line { + margin: 0 26rpx; + flex-shrink: 0; + width: 2rpx; + height: 60rpx; + background-color: rgba(221, 221, 221, 0.6); + } + .option { + flex: 1; + display: flex; + align-items: center; + justify-content: center; + .icon { + margin-right: 16rpx; + width: 50rpx; + height: 50rpx; + } + .wrap { + .title { + font-size: 28rpx; + color: #484848; + font-weight: bold; + .sub { + font-size: 20rpx; + } + } + .content { + margin-top: 4rpx; + font-size: 20rpx; + color: var(--name); + display: flex; + align-items: center; + justify-content: center; + &.gift { + color: #c2c2c2; + } + + .line { + margin: 0 10rpx; + width: 2rpx; + height: 16rpx; + background-color: var(--name); + } + } + } + } + } + .notice { + margin-top: 24rpx; + height: 44rpx; + background: linear-gradient(90deg, rgba(241, 241, 241, 0) 0%, #f1f1f1 52%, rgba(241, 241, 241, 0) 100%); + border-radius: 16rpx; + display: flex; + align-items: center; + justify-content: center; + font-size: 24rpx; + color: #3f3f3f; + .icon { + margin-right: 6rpx; + width: 30rpx; + height: 24rpx; + } + } + } + .common-operations { + margin-top: 32rpx; + display: flex; + .item { + flex: 1; + padding: 30rpx; + display: flex; + align-items: center; + justify-content: center; + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + border: 2rpx solid rgba(235, 236, 238, 0.51); + .icon { + width: 64rpx; + height: 64rpx; + margin-right: 16rpx; + } + .name { + font-size: 32rpx; + color: #474747; + } + } + .item:first-of-type { + margin-right: 30rpx; + } + } + .options-list { + margin-top: 32rpx; + padding: 16rpx 28rpx; + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + border: 2rpx solid rgba(235, 236, 238, 0.51); + .row { + padding: 30rpx 0; + display: flex; + align-items: center; + justify-content: space-between; + .col { + font-size: 32rpx; + color: #484848; + display: flex; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 16rpx; + } + .icon { + width: 36rpx; + height: 36rpx; + } + .icon { + width: 40rpx; + height: 36rpx; + } + } + .more { + font-size: 30rpx; + color: #e7e8e9; + font-weight: bold; + } + } + } + } + .switch-doctor { + margin-top: 80rpx; + text-align: center; + font-size: 32rpx; + color: #484848; + } +} diff --git a/src/pages/my/index.ts b/src/pages/my/index.ts new file mode 100644 index 0000000..a5d8112 --- /dev/null +++ b/src/pages/my/index.ts @@ -0,0 +1,138 @@ +import dayjs from 'dayjs' +const app = getApp() + +Page({ + data: { + today: dayjs().format('YYYY年MM月DD日 dddd'), + userInfo: {} as any, + RegDay: 0, + RegDaysName: '', + integral: 0, + selfScore: { + expire: {}, + }, + + adlNewRecord: {} as any, + }, + onLoad() { + app.getTheme().then((res) => { + this.setData({ + theme: res, + }) + }) + + const SystemInfo = app.globalSystemInfo + if (SystemInfo) { + const { bottom } = SystemInfo.capsulePosition + this.setData({ + bottom, + }) + } + wx.hideShareMenu() + }, + onShow() { + app.waitLogin().then(() => { + app.mpBehavior({ PageName: 'PG_PATIENTMY' }) + app.getUserInfo(this, true, () => {}) + this.getScore() + }) + }, + getScore() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/patient-score/get-self-score', + data: {}, + }).then((res) => { + this.setData({ + selfScore: res, + }) + }) + }, + handleMyHealthRecord(e) { + app.mpBehavior({ PageName: 'BTN_PATIENTMYPAGEHEALTHRECORD' }) + const { url } = e.currentTarget.dataset + app.permissionVerification(3, 0, url).then(() => { + wx.navigateTo({ + url, + }) + }) + }, + handleFamily(e) { + app.mpBehavior({ PageName: 'BTN_PATIENTMYPAGEFAMILYMEMBERS' }) + const { url } = e.currentTarget.dataset + app.permissionVerification(3, 0, url).then(() => { + wx.navigateTo({ + url, + }) + }) + }, + handleAdlChaneg(e) { + if (!e.detail) { + app.mpBehavior({ PageName: 'BTN_PATIENTMYPAGECLOSEADLREMINDER' }) + } + wx.ajax({ + method: 'POST', + url: '?r=igg4/account/update-adl-notify-switch', + data: { + AdlNotifySwitch: e.detail ? 1 : 2, + }, + }).then(() => { + app.getUserInfo(this, true) + }) + }, + routerTo(e) { + const { url } = e.currentTarget.dataset + if (!url) { + wx.showToast({ + icon: 'none', + title: '工程师正在努力建设中,敬请期待!', + }) + } + if (url === '/pages/mySave/index') { + app.mpBehavior({ PageName: 'BTN_PATIENTMYPAGEFAVORITES' }) + } + if (url === '/pages/myLive/index') { + app.mpBehavior({ PageName: 'BTN_PATIENTMYPAGESIGNEDUPMEETINGS' }) + } + if (url === '/pages/personalInformation/index') { + app.mpBehavior({ PageName: 'BTN_PATIENTMYPAGEPERSONALINFO' }) + } + if (url === '/pages/storyList/index') { + app.mpBehavior({ PageName: 'BTN_PATIENTMYPAGEMYSTORIES' }) + } + wx.navigateTo({ + url, + }) + }, + routerVipTo() { + const { MedicineAuditSwitch, UseDrugsAuditStatus, isFollow } = this.data.userInfo + if (MedicineAuditSwitch === '0') { + wx.navigateTo({ + url: '/pages/vipLogin/index', + }) + } else if (MedicineAuditSwitch === '1') { + const pendPath = { + 0: '/gift/pages/vipPending/index', + 1: '/gift/pages/vipStartPending/index', + }[isFollow] + const url = { + 1: pendPath, + 2: '/gift/pages/vipReject/index', + }[UseDrugsAuditStatus] + wx.navigateTo({ + url: url || '/gift/pages/vipCert/index', + }) + } else { + wx.showToast({ + icon: 'none', + title: '工程师正在努力建设中,敬请期待!', + }) + } + }, + + handleMiniDoctor() { + wx.navigateTo({ + url: '/pages/webview/index', + }) + }, +}) diff --git a/src/pages/my/index.wxml b/src/pages/my/index.wxml new file mode 100644 index 0000000..fb08904 --- /dev/null +++ b/src/pages/my/index.wxml @@ -0,0 +1,150 @@ + + + + + + + + + 健康档案 + + + + 我的收藏 + + + + + + + 我报名的会议 + + + + + + + + + 我的亲友 + + + + + + + + + 个人信息 + + + + + + + + + 我的故事 + + + + + + + + + + + + + + + + + + ADL提醒 + + + + + + + + diff --git a/src/pages/myLive/index.json b/src/pages/myLive/index.json new file mode 100644 index 0000000..ea644da --- /dev/null +++ b/src/pages/myLive/index.json @@ -0,0 +1,8 @@ +{ + "navigationBarTitleText": "我报名的活动", + "usingComponents": { + "van-tab": "@vant/weapp/tab/index", + "van-tabs": "@vant/weapp/tabs/index", + "van-icon": "@vant/weapp/icon/index" + } +} diff --git a/src/pages/myLive/index.scss b/src/pages/myLive/index.scss new file mode 100644 index 0000000..ddbcf98 --- /dev/null +++ b/src/pages/myLive/index.scss @@ -0,0 +1,318 @@ +.page { + padding-bottom: 120rpx; + .sticky { + position: sticky; + top: 0; + left: 0; + z-index: 20; + background-color: #fff; + padding-bottom: 10rpx; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + .tab { + font-size: 32rpx; + color: #9e9e9e; + } + .tab-active { + font-size: 36rpx; + color: #484848; + } + } + + .allin-list { + margin: 32rpx 30rpx; + .on-list-item { + margin-bottom: 20rpx; + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + border: 2rpx solid #ebecee; + + .photo-wrap { + position: relative; + .photo { + border-radius: 24rpx 24rpx 0 0; + display: block; + width: 100%; + height: 388rpx; + } + .status { + padding: 6rpx 32rpx; + position: absolute; + top: 0; + left: 0; + display: flex; + align-items: center; + background: linear-gradient(90deg, #e5e9f5 0%, #fde4ec 100%); + border-radius: 24rpx 0rpx 24rpx 0rpx; + font-size: 28rpx; + color: #e04775; + .dot { + margin-right: 8rpx; + width: 13rpx; + height: 13rpx; + border-radius: 50%; + background-color: #e04775; + } + &.bad { + color: #484848; + background: #e6e6e6; + .dot { + display: none; + } + } + } + .date { + padding: 18rpx 18rpx 8rpx; + position: absolute; + left: 40rpx; + bottom: 0; + background: #e04775; + border-radius: 11rpx 11rpx 0rpx 0rpx; + text-align: center; + .d-title { + font-size: 22rpx; + color: #ffffff; + font-weight: bold; + } + .ymd { + font-size: 18rpx; + color: #fff; + line-height: 28rpx; + border-bottom: 2rpx solid rgba(255, 255, 255, 0.34); + } + .hm { + font-size: 18rpx; + color: #fff; + line-height: 28rpx; + } + } + } + .inner { + padding: 32rpx 34rpx; + background-color: #fff; + border-radius: 0 0 24rpx 24rpx; + .tag { + margin-bottom: 16rpx; + width: 112rpx; + height: 36rpx; + font-size: 22rpx; + color: #ffffff; + line-height: 36rpx; + text-align: center; + background: #ffc137; + border-radius: 8rpx; + } + .title { + font-size: 32rpx; + color: #252525; + font-weight: bold; + .t-tag { + display: inline-block; + width: 112rpx; + height: 36rpx; + font-size: 22rpx; + color: #ffffff; + line-height: 36rpx; + text-align: center; + background: #e04775; + border-radius: 8rpx; + margin-right: 1em; + } + } + .content { + margin-top: 20rpx; + display: flex; + justify-content: space-between; + align-items: center; + .labels { + display: flex; + align-items: center; + flex-wrap: wrap; + .label { + margin-right: 16rpx; + margin-bottom: 16rpx; + padding: 2rpx 20rpx; + font-size: 22rpx; + color: #e04775; + border-radius: 18rpx; + background-color: rgba(224, 71, 117, 0.13); + word-break: break-all; + } + } + .people { + color: #9e9e9e; + font-size: 22rpx; + } + } + .footer { + margin-top: 32rpx; + display: flex; + align-items: center; + justify-content: space-between; + .site { + font-size: 22rpx; + color: #bebebe; + } + .btn { + margin-left: 10rpx; + flex-shrink: 0; + padding: 4rpx 36rpx; + font-size: 28rpx; + color: #ffffff; + background: #e04775; + border-radius: 24rpx; + &.active { + color: #484848; + background-color: #e7e7e7; + } + .icon { + width: 24rpx; + height: 24rpx; + } + } + } + } + } + .off-list-item { + margin-bottom: 20rpx; + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + border: 2rpx solid #ebecee; + + .photo-wrap { + position: relative; + .photo { + border-radius: 24rpx 24rpx 0 0; + display: block; + width: 100%; + height: 388rpx; + } + .status { + padding: 6rpx 32rpx; + position: absolute; + top: 0; + left: 0; + display: flex; + align-items: center; + background: linear-gradient(90deg, #e5e9f5 0%, #fde4ec 100%); + border-radius: 24rpx 0rpx 24rpx 0rpx; + font-size: 28rpx; + color: #e04775; + .dot { + margin-right: 8rpx; + width: 13rpx; + height: 13rpx; + border-radius: 50%; + background-color: #e04775; + } + &.bad { + color: #484848; + background: #e6e6e6; + .dot { + display: none; + } + } + } + .date { + padding: 18rpx 18rpx 8rpx; + position: absolute; + left: 40rpx; + bottom: 0; + background: #e04775; + border-radius: 11rpx 11rpx 0rpx 0rpx; + text-align: center; + .d-title { + font-size: 22rpx; + color: #ffffff; + font-weight: bold; + } + .ymd { + font-size: 18rpx; + color: #fff; + line-height: 28rpx; + border-bottom: 2rpx solid rgba(255, 255, 255, 0.34); + } + .hm { + font-size: 18rpx; + color: #fff; + line-height: 28rpx; + } + } + } + .inner { + padding: 32rpx 34rpx; + background-color: #fff; + border-radius: 0 0 24rpx 24rpx; + .tag { + margin-bottom: 16rpx; + width: 112rpx; + height: 36rpx; + font-size: 22rpx; + color: #ffffff; + line-height: 36rpx; + text-align: center; + background: #ffc137; + border-radius: 8rpx; + } + .title { + font-size: 32rpx; + color: #252525; + font-weight: bold; + } + .content { + margin-top: 20rpx; + display: flex; + justify-content: space-between; + align-items: center; + .labels { + display: flex; + align-items: center; + flex-wrap: wrap; + .label { + margin-right: 16rpx; + margin-bottom: 16rpx; + padding: 2rpx 20rpx; + font-size: 22rpx; + color: #e04775; + border-radius: 18rpx; + background-color: rgba(224, 71, 117, 0.13); + word-break: break-all; + } + } + .people { + color: #9e9e9e; + font-size: 22rpx; + } + } + .footer { + margin-top: 32rpx; + display: flex; + align-items: center; + justify-content: space-between; + .site { + font-size: 22rpx; + color: #bebebe; + } + .btn { + margin-left: 10rpx; + flex-shrink: 0; + padding: 4rpx 36rpx; + font-size: 28rpx; + color: #ffffff; + background: #e04775; + border-radius: 24rpx; + &.active { + color: #484848; + background-color: #e7e7e7; + } + .icon { + width: 24rpx; + height: 24rpx; + } + } + } + } + } + } +} diff --git a/src/pages/myLive/index.ts b/src/pages/myLive/index.ts new file mode 100644 index 0000000..d533024 --- /dev/null +++ b/src/pages/myLive/index.ts @@ -0,0 +1,126 @@ +import dayjs from 'dayjs' +const app = getApp() +let live_time: null | number = null + +Page({ + data: { + active: 0, + list: [], + pagination: { + page: 1, + pages: 1, + count: 1, + }, + online_open_status: 1, // 线上 + offline_open_status: 1, // 线下 + liveStatus: app.globalData.liveStatus, + activityStatus: app.globalData.activityStatus, + userInfo: {}, + }, + onLoad() { + this.setData({ + dateValue: dayjs().valueOf(), + }) + if (live_time) { + clearInterval(live_time) + } + live_time = setInterval(() => { + this.setData({ + dateValue: dayjs().valueOf(), + }) + }, 1000) + app.waitLogin().then(() => { + this.getConfig() + app.getUserInfo(this, true) + }) + }, + getConfig() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/common/get-config', + data: {}, + }).then((res) => { + let active = 0 + if (res.online_open_status == 0) { + active = 1 + } + this.setData({ + online_open_status: res.online_open_status, + offline_open_status: res.offline_open_status, + active, + }) + this.getList() + }) + }, + getList(newPage = 1) { + const { active } = this.data + if (newPage == 1 && active == 0) { + app.mpBehavior({ PageName: 'PG_PATIENTMYEVENTS_ALL' }) + } + if (newPage == 1 && active == 1) { + app.mpBehavior({ PageName: 'PG_PATIENTMYEVENTS_ONLINE' }) + } + if (newPage == 1 && active == 2) { + app.mpBehavior({ PageName: 'PG_PATIENTMYEVENTS_OFFLINE' }) + } + wx.ajax({ + method: 'GET', + url: '?r=igg4/activity/sign-up-list', + data: { + Type: Number(active) == 0 ? '' : Number(active), + page: newPage, + }, + }).then((res) => { + res.list = res.list.map((item) => { + item.EndTimeValue = dayjs(item.EndTime).valueOf() + item.BeginTimeValue = dayjs(item.BeginTime).valueOf() + item.SignUpDeadlineValue = dayjs(item.SignUpDeadline).valueOf() + item.BeginDate = dayjs(item.BeginTime).format('YYYY-MM-DD') + item.EndDate = dayjs(item.EndTime).format('YYYY-MM-DD') + item.isDay = item.BeginDate == item.EndDate + item.BeginHm = dayjs(item.BeginTime).format('HH:mm') + item.EndHm = dayjs(item.EndTime).format('HH:mm') + item.BeginTime = dayjs(item.BeginTime).format('YYYY-MM-DD HH:mm') + item.EndTime = dayjs(item.EndTime).format('YYYY-MM-DD HH:mm') + return item + }) + const list = res.page == 1 ? res.list : [...this.data.list, ...res.list] + this.setData({ + list, + pagination: { + page: res.page, + pages: res.pages, + count: res.count, + }, + }) + }) + }, + tabChange(e) { + this.setData({ + active: e.detail.index, + }) + this.getList() + }, + handleDetail(e) { + const { id } = e.currentTarget.dataset + const {active} = this.data + if (active == 0) { + app.mpBehavior({ PageName: 'BTN_PATIENTSIGNEDUPACTIVITIESALLLIST' }) + } + if (active == 1) { + app.mpBehavior({ PageName: 'BTN_PATIENTSIGNEDUPACTIVITIESONLINELIST' }) + } + if (active == 2) { + app.mpBehavior({ PageName: 'BTN_PATIENTSIGNEDUPACTIVITIESOFFLINELIST' }) + } + wx.navigateTo({ + url: `/pages/liveDetail/index?id=${id}`, + }) + }, + onReachBottom() { + const { page, pages } = this.data.pagination + if (pages > page) { + this.getList(page + 1) + } + }, +}) diff --git a/src/pages/myLive/index.wxml b/src/pages/myLive/index.wxml new file mode 100644 index 0000000..7b7174f --- /dev/null +++ b/src/pages/myLive/index.wxml @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + {{liveStatus[item.Status]}} + + + + + + + + + + + + + + + + + + 线上活动 + {{item.Name}} + + + {{label}} + + {{item.SignUpPeopleNum}}人已报名 + + + {{item.MasterName}} {{item.MasterTitle}} + 已取消 + 已删除 + 看回放 + 回放生成中 + + + 审核中 + + 参会 + 已报名 + + + + 已满额 + + + + + + + 已满额 + + 报名已截止 + 报名 + + + + + + + + + + {{activityStatus[item.Status]}} + + + + + + + + + + + + + + + + + + 线下活动 + {{item.Name}} + + + {{label}} + + {{item.SignUpPeopleNum}}人已报名 + + + + {{item.Location}} + {{item.Distance}} + + 已结束 + 已取消 + 已删除 + + + 审核中 + + 已报名 + 已报名 + + + + 已满额 + + + + + + + 已满额 + + 报名已截止 + 报名 + + + + + + + + diff --git a/src/pages/mySave/index.json b/src/pages/mySave/index.json new file mode 100644 index 0000000..2c8f8c7 --- /dev/null +++ b/src/pages/mySave/index.json @@ -0,0 +1,8 @@ +{ + "navigationBarTitleText": "我的收藏", + "usingComponents": { + "van-tab": "@vant/weapp/tab/index", + "van-tabs": "@vant/weapp/tabs/index", + "van-icon": "@vant/weapp/icon/index" + } +} diff --git a/src/pages/mySave/index.scss b/src/pages/mySave/index.scss new file mode 100644 index 0000000..a82e2f3 --- /dev/null +++ b/src/pages/mySave/index.scss @@ -0,0 +1,295 @@ +.page { + padding-bottom: 120rpx; + .sticky { + position: sticky; + top: 0; + left: 0; + z-index: 20; + background-color: #fff; + padding-bottom: 10rpx; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + .tab { + font-size: 32rpx; + color: #9e9e9e; + } + .tab-active { + font-size: 36rpx; + color: #484848; + } + } + + .info-list { + margin: 32rpx 30rpx; + padding: 24rpx; + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + border: 2rpx solid #ebecee; + .list-item { + display: flex; + margin-bottom: 22rpx; + .photo { + width: 232rpx; + height: 184rpx; + flex-shrink: 0; + border-radius: 16rpx; + border: 1rpx solid #ebecee; + margin-right: 16rpx; + } + .inner { + flex: 1; + padding-bottom: 20rpx; + border-bottom: 1rpx solid rgba(182, 183, 186, 0.21); + .title { + font-size: 28rpx; + color: #252525; + font-weight: bold; + line-height: 42rpx; + } + .date { + margin-top: 10rpx; + color: #9e9e9e; + font-size: 22rpx; + } + .labels { + margin-top: 16rpx; + display: flex; + flex-wrap: wrap; + align-items: center; + .label { + margin-right: 16rpx; + margin-bottom: 10rpx; + padding: 2rpx 20rpx; + font-size: 22rpx; + color: #e04775; + word-break: break-all; + border-radius: 18rpx; + background-color: rgba(224, 71, 117, 0.13); + } + } + .footer { + margin-top: 10rpx; + display: flex; + justify-content: flex-end; + .f-item { + display: flex; + align-items: center; + font-size: 22rpx; + color: #b6b7ba; + .icon { + margin-right: 8rpx; + width: 32rpx; + height: 32rpx; + } + &.active { + color: #e04775; + } + &::after { + margin: 18rpx; + content: ""; + width: 2rpx; + height: 20rpx; + background-color: #f3f3f4; + } + } + .share { + padding: 0; + background-color: transparent; + margin: 0; + &::after { + border: none; + outline: none; + } + } + } + } + } + } + + .video-list { + margin: 32rpx 30rpx; + .list-item { + margin-bottom: 20rpx; + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + border: 2rpx solid #ebecee; + .photo { + position: relative; + border-radius: 24rpx 24rpx 0 0; + display: block; + width: 100%; + height: 388rpx; + overflow: hidden; + .video { + border-radius: inherit; + width: 100%; + height: 100%; + } + .poster { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + border-radius: inherit; + } + .play { + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + width: 104rpx; + height: 104rpx; + } + } + .inner { + padding: 32rpx 34rpx 28rpx; + background-color: #fff; + border-radius: 0 0 24rpx 24rpx; + .title { + font-size: 32rpx; + color: #252525; + font-weight: bold; + } + .content { + margin-top: 22rpx; + padding-bottom: 24rpx; + display: flex; + justify-content: space-between; + align-items: center; + border-bottom: 1rpx solid #ebecee; + .labels { + display: flex; + flex-wrap: wrap; + align-items: center; + .label { + margin-right: 16rpx; + margin-bottom: 10rpx; + padding: 2rpx 20rpx; + font-size: 22rpx; + color: #e04775; + word-break: break-all; + border-radius: 18rpx; + background-color: rgba(224, 71, 117, 0.13); + } + } + .date { + color: #9e9e9e; + font-size: 22rpx; + } + } + .footer { + margin-top: 28rpx; + display: flex; + justify-content: space-around; + .f-item { + display: flex; + align-items: center; + font-size: 22rpx; + color: #b6b7ba; + .icon { + margin-right: 8rpx; + width: 32rpx; + height: 32rpx; + } + &.active { + color: #e04775; + } + &::after { + margin: 18rpx; + content: ""; + width: 2rpx; + height: 20rpx; + background-color: #f3f3f4; + } + } + .share { + padding: 0; + background-color: transparent; + margin: 0; + &::after { + border: none; + outline: none; + } + } + } + } + } + } + + .question-list { + margin: 32rpx 30rpx; + .row { + padding: 38rpx 32rpx; + display: flex; + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + border: 2rpx solid #ebecee; + margin-bottom: 16rpx; + .num { + padding: 0 15rpx; + font-size: 28rpx; + color: #cf5375; + flex-shrink: 0; + height: 40rpx; + background: #ffffff linear-gradient(136deg, #e8ebfd 0%, #fde0ea 100%); + border-radius: 8rpx; + text-align: center; + line-height: 40rpx; + } + .wrap { + flex: 1; + color: #252525; + padding-left: 16rpx; + display: flex; + align-items: center; + justify-content: space-between; + .content { + flex: 1; + .c-title { + font-size: 28rpx; + color: #252525; + font-weight: bold; + } + .footer { + margin-top: 28rpx; + display: flex; + justify-content: flex-end; + .f-item { + display: flex; + align-items: center; + font-size: 22rpx; + color: #b6b7ba; + .icon { + margin-right: 8rpx; + width: 32rpx; + height: 32rpx; + } + &.active { + color: #e04775; + } + &:not(:last-of-type)::after { + margin: 18rpx; + content: ""; + width: 2rpx; + height: 20rpx; + background-color: #f3f3f4; + } + } + .share { + padding: 0; + background-color: transparent; + margin: 0; + &::after { + border: none; + outline: none; + } + } + } + } + } + } + } +} diff --git a/src/pages/mySave/index.ts b/src/pages/mySave/index.ts new file mode 100644 index 0000000..f9005af --- /dev/null +++ b/src/pages/mySave/index.ts @@ -0,0 +1,345 @@ +const app = getApp() +const licia = require('miniprogram-licia') + +Page({ + data: { + active: 0, + list: [] as any, + HistoryId: '', + pagination: { + page: 1, + pages: 1, + count: 1, + }, + picTextStatus: 0, + videoStatus: 0, + config: {} as any, + }, + onLoad() { + app.waitLogin().then(() => { + wx.ajax({ + method: 'GET', + url: '?r=igg4/common/get-config', + }).then((res) => { + this.setData({ + config: res, + }) + this.getConfig() + }) + }) + }, + getConfig() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/common/get-config', + data: {}, + }).then((res) => { + this.setData({ + picTextStatus: res.picTextStatus, + videoStatus: res.videoStatus, + active: res.picTextStatus == 0 ? 1 : 0, + }) + this.getList() + }) + }, + getList() { + const { active, pagination } = this.data + if (active == 0) { + this.getInfoList() + } else if (active == 1) { + this.getVideoList() + } else if (active == 2) { + this.getQuestionList() + } + + if (active == 0 && pagination.page == 1) { + app.mpBehavior({ PageName: 'PG_PATIENTMYFAVORITES_KNOWLEDGEBASE' }) + } + if (active == 1 && pagination.page == 1) { + app.mpBehavior({ PageName: 'PG_PATIENTMYFAVORITES_VIDEOCLASS' }) + } + if (active == 2 && pagination.page == 1) { + app.mpBehavior({ PageName: 'PG_PATIENTMYFAVORITES_HEALTHQA' }) + } + }, + getInfoList(newPage = 1) { + wx.ajax({ + method: 'GET', + url: '?r=igg4/pic-text/collection-list', + data: { + page: newPage, + }, + loading: true, + }).then((res) => { + res.list = res.list.map((item) => { + return item + }) + const list = res.page == 1 ? res.list : [...this.data.list, ...res.list] + this.setData({ + list, + pagination: { + page: res.page, + pages: res.pages, + count: res.count, + }, + }) + }) + }, + getVideoList(newPage = 1) { + wx.ajax({ + method: 'GET', + url: '?r=igg4/video/collection-list', + data: { + page: newPage, + }, + loading: true, + }).then((res) => { + res.list = res.list.map((item) => { + return item + }) + const list = res.page == 1 ? res.list : [...this.data.list, ...res.list] + this.setData({ + list, + pagination: { + page: res.page, + pages: res.pages, + count: res.count, + }, + }) + }) + }, + getQuestionList(newPage = 1) { + wx.ajax({ + method: 'GET', + url: '?r=igg4/health-question/collection-list', + data: { + page: newPage, + }, + loading: true, + }).then((res) => { + res.list = res.list.map((item) => { + return item + }) + const list = res.page == 1 ? res.list : [...this.data.list, ...res.list] + this.setData({ + list, + pagination: { + page: res.page, + pages: res.pages, + count: res.count, + }, + }) + }) + }, + handleStar(e) { + const { id, index } = e.currentTarget.dataset + wx.ajax({ + method: 'POST', + url: '?r=igg4/pic-text/compliment', + data: { + ContentId: id, + }, + loading: true, + }).then(() => { + this.setData({ + [`list[${index}].IsCompliment`]: 1, + [`list[${index}].ComplimentNum`]: Number(this.data.list[index].ComplimentNum) + 1, + }) + }) + }, + handleVideoStar(e: WechatMiniprogram.CustomEvent) { + const { id, index } = e.currentTarget.dataset + wx.ajax({ + method: 'POST', + url: '?r=igg4/video/compliment', + data: { + ContentId: id, + }, + loading: true, + }).then(() => { + this.setData({ + [`list[${index}].ComplimentNum`]: Number(this.data.list[index].ComplimentNum) + 1, + [`list[${index}].IsCompliment`]: 1, + }) + }) + }, + handleVideoPlay(e: WechatMiniprogram.CustomEvent) { + const { id, index } = e.currentTarget.dataset + const { list } = this.data + list.map((item: any, i) => { + if (item.play && i != index) { + const ctx = wx.createVideoContext(`video${i}`) + ctx.pause() + this.setData({ + [`list[${index}].play`]: false, + }) + } + }) + this.setData({ + [`list[${index}].play`]: true, + }) + wx.ajax({ + method: 'POST', + url: '?r=igg4/video/view', + data: { + ContentId: id, + }, + }).then((res) => { + this.setData({ + HistoryId: res.HistoryId, + }) + }) + }, + handleVideo(e: WechatMiniprogram.CustomEvent) { + const { index } = e.currentTarget.dataset + const context = wx.createVideoContext(`video${index}`) + context.play() + }, + handleVideoTime: licia.throttle(function (e: WechatMiniprogram.CustomEvent) { + wx.ajax({ + method: 'GET', + url: '?r=igg4/video/watch-duration', + data: { + HistoryId: this.data.HistoryId, + WatchDuration: e.detail.currentTime, + }, + }).then((res) => { + console.log('res: ', res) + }) + }, 5000), + handleVideoPause(e: WechatMiniprogram.CustomEvent) { + console.log(e) + }, + handleDetail(e: WechatMiniprogram.CustomEvent) { + const { id } = e.currentTarget.dataset + if (this.data.config.picTextEbookStatus == 1) { + const webviewUrl = encodeURIComponent( + `${app.globalData.url}/zdcare/#/book?loginState=${app.globalData.loginState}&Id=${id}`, + ) + wx.navigateTo({ + url: `/pages/webview/index?url=${webviewUrl}`, + }) + } else { + wx.navigateTo({ + url: `/pages/repositoryDetail/index?id=${id}`, + }) + } + }, + handleQuestionDetail(e) { + const { id } = e.currentTarget.dataset + const webviewUrl = encodeURIComponent( + `${app.globalData.url}/zdcare/#/info-detail?loginState=${app.globalData.loginState}&Id=${id}`, + ) + wx.navigateTo({ + url: `/pages/webview/index?url=${webviewUrl}`, + }) + }, + handleVideoToggleSave(e: WechatMiniprogram.CustomEvent) { + const { id, collect, index } = e.currentTarget.dataset + if (collect == 1) { + wx.ajax({ + method: 'POST', + url: '?r=igg4/video/cancel-collection', + data: { + ContentId: id, + }, + loading: true, + }).then(() => { + wx.showToast({ + title: '取消收藏', + icon: 'none', + }) + this.setData({ + [`list[${index}].IsCollect`]: 0, + [`list[${index}].CollectionPeopleNum`]: Number(this.data.list[index].CollectionPeopleNum) - 1, + }) + }) + } else { + wx.ajax({ + method: 'POST', + url: '?r=igg4/video/collection', + data: { + ContentId: id, + }, + loading: true, + }).then(() => { + wx.showToast({ + title: '收藏成功', + icon: 'none', + }) + this.setData({ + [`list[${index}].IsCollect`]: 1, + [`list[${index}].CollectionPeopleNum`]: Number(this.data.list[index].CollectionPeopleNum) + 1, + }) + }) + } + }, + onReachBottom() { + const { page, pages } = this.data.pagination + const { active } = this.data + if (pages > page) { + if (active == 0) { + this.getInfoList(page + 1) + } else { + this.getVideoList(page + 1) + } + } + }, + tabChange(e) { + this.setData({ + active: e.detail.index, + CateId: '', + Search: '', + list: [], + pagination: { + page: 1, + pages: 1, + count: 1, + }, + }) + this.getList() + }, + onShareAppMessage(e: any) { + if (e.from === 'button') { + const { id, index, type } = e.target.dataset + const { list } = this.data + const { Title, TitlePicLink, ImageUrl } = list[index] + if (type == 'info') { + wx.ajax({ + method: 'POST', + url: '?r=igg4/pic-text/share', + data: { ContentId: id }, + }).then(() => { + this.setData({ + [`list[${index}].ShareNum`]: Number(this.data.list[index].ShareNum) + 1, + }) + }) + return { + title: Title, + path: `/pages/repositoryDetail/index?id=${id}`, + imageUrl: TitlePicLink, + } + } else { + wx.ajax({ + method: 'POST', + url: '?r=igg4/video/share', + data: { ContentId: id }, + }).then(() => { + this.setData({ + [`list[${index}].ShareNum`]: Number(this.data.list[index].ShareNum) + 1, + }) + }) + return { + title: Title, + path: `/pages/repository/index?id=${id}&active=1&title=${Title}`, + imageUrl: ImageUrl, + } + } + } else { + return { + title: '知识库', + path: '/pages/repository/index', + } + } + }, +}) diff --git a/src/pages/mySave/index.wxml b/src/pages/mySave/index.wxml new file mode 100644 index 0000000..ed4e50b --- /dev/null +++ b/src/pages/mySave/index.wxml @@ -0,0 +1,187 @@ + + + + + + + + + + + + + {{item.Title}} + {{item.UpdatedAt}} + + {{label}} + + + + + {{~~item.OpenNum + ~~item.BasicNum}} + + + + + {{item.ComplimentNum}} + + + + + + + + + + + + + + + + + {{item.Title}} + + + {{label}} + + {{item.UpdatedAt}} + + + + + {{~~item.OpenNum + ~~item.BasicNum}} + + + + + + {{item.ComplimentNum}} + + + + + {{item.CollectionPeopleNum}} + + + + + + + + + {{item.CateName}} + + + {{ item.Title }} + + + + {{~~item.OpenNum + ~~item.BasicNum}} + + + + + + {{item.ComplimentNum}} + + + + + + + + + + + + + + + + + + + diff --git a/src/pages/nrdl/index.json b/src/pages/nrdl/index.json new file mode 100644 index 0000000..e648c54 --- /dev/null +++ b/src/pages/nrdl/index.json @@ -0,0 +1,13 @@ +{ + "navigationBarTitleText": "艾加莫德医保报销全知道", + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/navBar/navBar", + "van-divider": "@vant/weapp/divider/index", + "van-cascader": "@vant/weapp/cascader/index", + "van-popup": "@vant/weapp/popup/index", + "van-icon": "@vant/weapp/icon/index", + "toast": "/components/toast/index", + "timeOut": "/components/timeOut/index" + } +} diff --git a/src/pages/nrdl/index.scss b/src/pages/nrdl/index.scss new file mode 100644 index 0000000..ec11022 --- /dev/null +++ b/src/pages/nrdl/index.scss @@ -0,0 +1,286 @@ +page { + background-color: #fafafa; + padding-bottom: 80rpx; +} +.page { + .tip { + margin: 708rpx 40rpx 0; + padding: 62rpx 40rpx 38rpx; + background: linear-gradient(180deg, #ffe0ea 0%, #fff 60%, #ffffff 100%); + box-shadow: 0rpx 4rpx 24rpx 0rpx rgba(0, 0, 0, 0.09); + border-radius: 24rpx; + border: 2rpx solid rgba(224, 71, 117, 0.25); + .title { + font-size: 36rpx; + color: #14265d; + font-weight: bold; + &.mt { + margin-top: 44rpx; + } + } + .faild { + margin-top: 16rpx; + padding: 0 24rpx; + display: flex; + align-items: center; + justify-content: space-between; + height: 88rpx; + background: #ffffff; + border-radius: 24rpx; + border: 1rpx solid rgba(224, 71, 117, 0.25); + .input { + flex: 1; + font-size: 32rpx; + } + .placeholder-input { + font-size: 32rpx; + color: #b0b0b0; + } + .btn { + font-size: 32rpx; + color: #cd355f; + } + } + .submit { + position: relative; + margin-top: 66rpx; + height: 96rpx; + text-align: center; + line-height: 96rpx; + font-size: 40rpx; + color: #ffffff; + background: linear-gradient(138deg, #cf5375 0%, #cd355f 100%); + border-radius: 24rpx; + border: 1rpx solid rgba(224, 71, 117, 0.25); + } + .num { + margin-top: 24rpx; + font-size: 32rpx; + color: #ce3962; + text-align: center; + } + .swiper { + margin: 10rpx auto 0; + height: 48rpx; + text-align: center; + .siper-item { + font-size: 30rpx; + color: #666666; + line-height: 87rpx; + display: flex; + align-items: center; + justify-content: center; + } + } + } + .policy { + position: relative; + margin: 38px 40rpx 0; + padding: 68rpx 40rpx; + background: #ffffff; + border-radius: 24rpx; + border: 2rpx solid rgba(224, 71, 117, 0.25); + &-title { + position: absolute; + top: 0; + left: 50%; + transform: translate(-50%, -50%); + font-size: 40rpx; + color: #ffffff; + width: 318rpx; + height: 72rpx; + text-align: center; + line-height: 72rpx; + background: linear-gradient(138deg, #cf5375 0%, #cd355f 100%); + border-radius: 36rpx; + } + &-card { + margin-bottom: 32rpx; + padding: 34rpx 30rpx 0; + border-radius: 24rpx; + background: linear-gradient(180deg, #F5E0E6 0%, #ffffff 100%); + background-size: 100% 100rpx; + background-repeat: no-repeat; + border: 2rpx solid #f4cbd8; + .pc-title { + padding-bottom: 20rpx; + display: flex; + justify-content: space-between; + .name { + font-size: 36rpx; + color: #15275e; + font-weight: bold; + } + .status { + padding: 6rpx 24rpx; + font-size: 30rpx; + line-height: 44rpx; + border-radius: 28rpx; + color: #e04775; + background-color: #f5d7df; + &.active { + color: #ffffff; + background-color: #cd3861; + } + } + } + .none { + padding: 30rpx 0; + font-size: 32rpx; + color: #b0b0b0; + border-top: 1px solid #eeeeee; + } + .row { + margin-top: 24rpx; + .name { + flex-shrink: 0; + font-size: 32rpx; + color: #b0b0b0; + } + .content { + font-size: 32rpx; + color: #15275e; + line-height: 44rpx; + padding-bottom: 32rpx; + } + &:not(:last-of-type) { + border-bottom: 1px solid #efefef; + } + } + .row1 { + display: flex; + justify-content: space-between; + } + .row2 { + .content { + margin-top: 16rpx; + } + } + } + .statement { + margin-top: 32rpx; + &-title { + font-size: 36rpx; + color: #15275e; + font-weight: bold; + } + &-content { + font-size: 32rpx; + color: #b4b4b4; + } + } + &-btn { + margin-top: 32rpx; + width: 590rpx; + height: 84rpx; + font-size: 36rpx; + color: #ffffff; + line-height: 84rpx; + text-align: center; + background: linear-gradient(138deg, #cf5375 0%, #cd355f 100%); + border-radius: 24rpx; + border: 1rpx solid rgba(224, 71, 117, 0.25); + } + } + .module1 { + margin: 32px 40rpx 0; + height: 249rpx; + position: relative; + .money { + position: absolute; + top: 0; + top: 0; + } + .label { + margin-top: 35rpx; + width: 243rpx; + height: 50rpx; + } + .title { + margin-top: 8rpx; + padding-left: 47rpx; + font-size: 40rpx; + font-weight: bold; + color: #12245c; + line-height: 54rpx; + } + .content { + padding-left: 47rpx; + font-size: 40rpx; + color: #12245c; + line-height: 54rpx; + } + } + .module2 { + margin: 24rpx 40rpx 0; + width: calc(100% - 80rpx); + height: 248rpx; + position: relative; + .content { + margin-top: 8rpx; + padding-left: 47rpx; + font-size: 40rpx; + color: #12245c; + line-height: 54rpx; + } + .title { + padding-top: 58rpx; + padding-left: 47rpx; + font-size: 40rpx; + font-weight: bold; + color: #12245c; + line-height: 54rpx; + } + } + .container { + margin: 69rpx 40rpx 0; + padding: 73rpx 43rpx 54rpx; + background: #ffffff; + box-shadow: 0rpx 4rpx 24rpx 0rpx rgba(0, 0, 0, 0.09); + border-radius: 24rpx 24rpx 24rpx 24rpx; + .c-title { + margin: -100rpx auto 0; + font-size: 40rpx; + color: #ffffff; + font-weight: bold; + width: 319rpx; + height: 72rpx; + text-align: center; + line-height: 72rpx; + background: linear-gradient(138deg, #cf5375 0%, #cd355f 100%); + border-radius: 36rpx 36rpx 36rpx 36rpx; + } + .module3 { + margin-top: 38rpx; + height: 243rpx; + position: relative; + } + .more { + margin: 48rpx auto 0; + width: 400rpx; + font-size: 32rpx; + color: #666666; + text-align: center; + } + .video1 { + margin: 38rpx auto 0; + display: block; + width: 100%; + height: 331rpx; + object-fit: cover; + border-radius: 24rpx; + } + .video2 { + margin: 38rpx auto 0; + display: block; + width: 100%; + height: 251rpx; + object-fit: cover; + border-radius: 24rpx; + } + } + .img { + display: block; + width: 100%; + } +} diff --git a/src/pages/nrdl/index.ts b/src/pages/nrdl/index.ts new file mode 100644 index 0000000..321f1e3 --- /dev/null +++ b/src/pages/nrdl/index.ts @@ -0,0 +1,446 @@ +const app = getApp(); +import dayjs from "dayjs"; + +Page({ + data: { + NrdlOnePicSwitch: 0, + NrdlCityListSwitch: 0, + NrdlQASwitch: 0, + NrdlOnePicAJMDSwitch: 0, + showProgress: false, + video1Height: null as null | string, + video2Height: null as null | string, + + nrdlDetail: {}, + + cascaderShow: false, + options: [], + areaValue: [], + cascaderName: "", + cascaderValue: "", + fieldNames: { text: "label", value: "value", children: "children" }, + + hosList: [] as { HospitalName: string; HospitalId: string }[], + hosName: "", + hosIndex: "", + hosValue: "", + + OtherHospitalName: "", + + toastShow: false, + toastType: "popupNdrlFollow", + toastParams: {} as any, + + LAT: "", + LNG: "", + + follow: false, + + asideOut: false, + asideType: "11", + + score: [], + + medicalInsurancePolicy: null, + + timeToastType: "19", + }, + onLoad() { + const SystemInfo = app.globalSystemInfo; + if (SystemInfo) { + const { bottom } = SystemInfo.capsulePosition; + this.setData({ + bottom: bottom, + }); + } + app.waitLogin().then((_res) => { + app.mpBehavior({ PageName: 'PG_PATIENTNRDL' }) + this.addOpenRecord(); + this.getConfig(); + this.getCode(); + this.getArea(); + this.getNrdlDetail(); + this.getAdlScore(); + }); + }, + getAdlScore() { + wx.ajax({ + method: "GET", + url: "?r=igg4/nrdl/get-score", + data: {}, + }).then((res) => { + this.setData({ + score: res, + }); + }); + }, + getConfig() { + wx.ajax({ + method: "GET", + url: "?r=igg4/common/get-config", + data: {}, + }).then((res) => { + this.setData({ + NrdlOnePicSwitch: res.NrdlOnePicSwitch, + NrdlCityListSwitch: res.NrdlCityListSwitch, + NrdlQASwitch: res.NrdlQASwitch, + NrdlOnePicAJMDSwitch: res.NrdlOnePicAJMDSwitch, + }); + }); + }, + addOpenRecord() { + wx.ajax({ + method: "POST", + url: "?r=igg4/nrdl/add-open-record&OpenType=1", + data: {}, + }).then((res) => { + if (res.CanGetScore) { + this.setData({ + asideOut: true, + }); + } + }); + }, + handleDetail(e) { + const { id } = e.currentTarget.dataset; + if (id == 3) { + wx.navigateTo({ + url: "/pages/nrdlTable/index", + }); + return; + } + wx.navigateTo({ + url: `/pages/nrdlDetail/index?id=${id}`, + }); + }, + getCode() { + wx.ajax({ + method: "GET", + url: "?r=igg4/common/get-channel-wx-code", + data: { ChannelType: 12 }, + }).then((res) => { + this.setData({ + ["toastParams.code"]: res, + }); + }); + }, + getNrdlDetail() { + wx.ajax({ + method: "GET", + url: "?r=igg4/nrdl-hospital/detail", + data: {}, + }).then((res) => { + res.last10Records = res.last10Records.map((item) => { + return { + ...item, + telephone: item.Telephone.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2"), + timeNow: dayjs(item.CreateTime).fromNow().replace(" ", ""), + }; + }); + this.setData({ + nrdlDetail: res, + ["toastParams.follow"]: res.isFollow, + }); + const newRecord = res.newRecord; + if (!Array.isArray(newRecord) && newRecord) { + this.setData({ + areaValue: [newRecord.ProvinceId, newRecord.CityId], + cascaderName: `${newRecord.ProvinceName}/${newRecord.CityName}`, + cascaderValue: newRecord.CityId, + hosName: + { + "0": "暂无选定医院", + "-1": "其它医院", + }[newRecord.HospitalId] || newRecord.HospitalName, + hosValue: newRecord.HospitalId, + OtherHospitalName: newRecord.OtherHospitalName, + follow: true, + }); + this.getHospitalList(); + } + const medicalInsurancePolicy = res.medicalInsurancePolicy; + this.setData({ + medicalInsurancePolicy, + }); + }); + }, + handlePlay(e) { + const { id, width, height } = e.currentTarget.dataset; + let query = wx.createSelectorQuery(); + query + .select(`#${id}`) + .boundingClientRect((rect) => { + let videoWidth = rect.width; + let videoHeight = videoWidth * (height / width); + if (id === "video1") { + this.setData({ + video1Height: videoHeight + "px", + }); + } + if (id === "video2") { + this.setData({ + video2Height: videoHeight + "px", + }); + } + }) + .exec(); + }, + getArea() { + wx.ajax({ + method: "GET", + url: "/js/area.json", + isJSON: true, + }).then((res) => { + this.setData({ + options: res.map((item) => { + return { + ...item, + children: item.children.map((item2) => { + return { + label: item2.label, + value: item2.value, + }; + }), + }; + }), + }); + }); + }, + handleGetSite() { + const that = this; + wx.getSetting({ + success(res) { + if ( + res.authSetting["scope.userFuzzyLocation"] != undefined && + res.authSetting["scope.userFuzzyLocation"] == true + ) { + //获取当前位置 + that.getFuzzyLocation(); + } else if (res.authSetting["scope.userFuzzyLocation"] == undefined) { + //获取当前位置 + that.getFuzzyLocation(); + } else { + wx.showModal({ + title: "请求授权当前位置", + content: "需要获取您的地理位置,请确认授权", + confirmColor: "#cf5375", + success: function (res) { + if (res.cancel) { + //取消授权 + wx.showToast({ + title: "拒绝授权", + icon: "none", + duration: 1000, + }); + } else if (res.confirm) { + //确定授权,通过wx.openSetting发起授权请求 + wx.openSetting({ + success: function (res) { + if (res.authSetting["scope.userFuzzyLocation"] == true) { + //再次授权,调用wx.getLocation的API + that.getFuzzyLocation(); + } else { + wx.showToast({ + title: "授权失败", + icon: "none", + duration: 1000, + }); + } + }, + }); + } + }, + }); + } + }, + }); + }, + getFuzzyLocation() { + const that = this; + wx.getFuzzyLocation({ + success(res) { + that.setData({ + LNG: res.longitude, + LAT: res.latitude, + }); + that.getLocationInfo(); + }, + fail(err) { + console.log(err); + }, + }); + }, + handleCascader() { + this.setData({ + cascaderShow: true, + }); + }, + onFinish(e) { + console.log(e); + const selectedOptions = e.detail.selectedOptions; + this.setData({ + cascaderName: `${selectedOptions[0].label}/${selectedOptions[1].label}`, + cascaderValue: e.detail.value, + areaValue: [selectedOptions[0].value, selectedOptions[1].value], + hosName: "", + hosIndex: "", + hosValue: "", + follow: false, + }); + this.getHospitalList(); + this.onClose(); + }, + onClose() { + this.setData({ + cascaderShow: false, + }); + }, + handleToggleSite() { + const that = this; + if (!this.data.LNG) { + } else { + that.setData({ + LNG: "", + LAT: "", + }); + this.getLocationInfo(); + } + }, + getLocationInfo() { + wx.ajax({ + method: "GET", + url: "?r=igg4/nrdl-hospital/location-info", + data: { + lat: this.data.LAT, + lng: this.data.LNG, + }, + loading: true, + }).then((res) => { + this.setData({ + cascaderName: `${res.ProvinceName}/${res.CityName}`, + cascaderValue: res.CityId, + areaValue: [res.ProvinceId, res.CityId], + hosIndex: "", + hosValue: "", + hosName: "", + follow: false, + }); + this.getHospitalList(); + }); + }, + getHospitalList() { + const areaValue = this.data.areaValue; + wx.ajax({ + method: "GET", + url: "?r=igg4/nrdl-hospital/list", + data: { + ProvinceId: areaValue[0], + CityId: areaValue[1], + }, + }).then((res) => { + this.setData({ + hosList: [ + { + HospitalName: "暂无选定医院", + HospitalId: "0", + }, + ...res, + { + HospitalName: "其它医院", + HospitalId: "-1", + }, + ], + }); + }); + }, + handleChangeHos(e) { + const index = e.detail.value; + const hos = this.data.hosList[index]; + this.setData({ + hosIndex: index, + hosName: hos.HospitalName, + hosValue: hos.HospitalId, + follow: false, + }); + if (hos.HospitalId !== "-1") { + this.setData({ + OtherHospitalName: "", + }); + } + }, + handleToastCancel() { + this.setData({ + toastShow: false, + }); + }, + handleSubmit() { + const { areaValue, cascaderName, hosName, hosValue, OtherHospitalName } = this.data; + let title = ""; + if (!areaValue.length) { + title = "请选择地区"; + } + if (!hosName) { + title = "请选择医院"; + } + if (title) { + wx.showToast({ + title, + icon: "none", + }); + return; + } + wx.ajax({ + method: "POST", + url: "?r=igg4/nrdl-hospital/add", + data: { + ProvinceId: areaValue[0], //省Id + ProvinceName: cascaderName.split("/")[0], //省份名 + CityId: areaValue[1], //城市Id + CityName: cascaderName.split("/")[1], //城市名 + HospitalId: hosValue || undefined, //医院id 为空时填0 + HospitalName: hosName || undefined, //医院名 为空时,空字符串 + OtherHospitalName: OtherHospitalName, + }, + }).then((res) => { + this.setData({ + follow: true, + }); + if (res.rewardScore > 0) { + this.setData({ + timeToast: true, + timeToastParams: { + rewardScore: res.rewardScore, + }, + }); + setTimeout(() => { + this.setData({ + timeToast: false, + }); + }, 3000); + } + this.getAdlScore(); + this.getNrdlDetail(); + }); + }, + handleHos() { + wx.navigateTo({ + url: "/pages/doctor/index", + }); + this.handleDtpRecord(); + }, + handleDtpRecord() { + wx.ajax({ + method: "POST", + url: "?r=igg4/nrdl/add-dtp-pharmacy-click-record", + data: {}, + }).then((res) => { + console.log("res: ", res); + }); + }, + handleBack() { + wx.navigateBack(); + }, + catchtouchmove() { + return false; + }, +}); diff --git a/src/pages/nrdl/index.wxml b/src/pages/nrdl/index.wxml new file mode 100644 index 0000000..04b09e8 --- /dev/null +++ b/src/pages/nrdl/index.wxml @@ -0,0 +1,248 @@ + + + + 我的医保所在地 + + + 一键获取 + + 我计划就诊的医院 + + + + + + + + + 其它医院 + + + + + 已关注 + 抢先关注 + 已有{{nrdlDetail.totalPatientNum}}人抢先关注 + + + {{item.telephone}} {{item.timeNow}}关注 + + + + + + 医保政策 + + + 住院报销政策 + 本地已执行 + 本地待执行 + + + 可报销日期 + {{medicalInsurancePolicy.HospitalizationPolicyReimbursementDate}} + + + + + 门诊报销政策 + + 本地已执行 + + 本地待执行 + + + 可报销日期 + {{medicalInsurancePolicy.OutpatientPolicyReimbursementDate}} + + + 落地政策 + {{medicalInsurancePolicy.OutpatientPolicy}} + + + {{medicalInsurancePolicy.OutpatientPolicy}} + {{medicalInsurancePolicy.OutpatientPolicyIntroduction}} + + + 备注说明 + {{medicalInsurancePolicy.OutpatientPolicyRemark}} + + + + + 双通道药店政策 + 本地已执行 + 本地待执行 + + + 可报销日期 + {{medicalInsurancePolicy.DTPReimbursementDate}} + + + 双通道药店 + {{medicalInsurancePolicy.DTPIntroduction}} + + + 备注说明 + {{medicalInsurancePolicy.DTPRemark}} + + + + 免责声明 + 各地医保报销比例和具体政策请以当地执行为准 + + 我想详细了解就诊医院和药店 + + + 医保政策 + + + 住院政策 + + 暂无相关政策 + + + + 门诊政策 + + 暂无相关政策 + + + + 双通道药店政策 + + 暂无相关政策 + + + 免责声明 + 各地医保报销比例和具体政策请以当地执行为准 + + 我想详细了解就诊医院和药店 + + + + + 艾加莫德医保报销 + 你要知道的事 + + + 城市惠民保 + 自付费用报销list + + + 关于艾加莫德 + + + + + 有力人生,患者心声 + + + + + + + + + + + + + + diff --git a/src/pages/nrdlDetail/index.json b/src/pages/nrdlDetail/index.json new file mode 100644 index 0000000..f7d5fa0 --- /dev/null +++ b/src/pages/nrdlDetail/index.json @@ -0,0 +1,7 @@ +{ + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/navBar/navBar", + "timeOut": "/components/timeOut/index" + } +} diff --git a/src/pages/nrdlDetail/index.scss b/src/pages/nrdlDetail/index.scss new file mode 100644 index 0000000..6d1d66f --- /dev/null +++ b/src/pages/nrdlDetail/index.scss @@ -0,0 +1,10 @@ +page { + background-color: #fafafa; +} +.img { + width: 100%; + display: block; + &.hide { + opacity: 0; + } +} diff --git a/src/pages/nrdlDetail/index.ts b/src/pages/nrdlDetail/index.ts new file mode 100644 index 0000000..06bc975 --- /dev/null +++ b/src/pages/nrdlDetail/index.ts @@ -0,0 +1,94 @@ +const app = getApp() + +Page({ + data: { + id: '', + NrdlCityListSwitch: '0', + isLoad: false, + + asideOut: false, + timeToast: false, + asideType: '11', + }, + onLoad(options) { + this.setData({ + id: options.id, + asideType: { + 2: '12', + 3: '13', + 4: '14', + 5: '15', + }[options.id as string], + }) + const titles = { + 2: '一图读懂报销热点问题', + 3: '报销城市一览', + 4: '艾加莫德常见问题答疑', + 5: '一图读懂艾加莫德', + } + if (options.id) { + wx.setNavigationBarTitle({ + title: titles[options.id], + }) + } + app.waitLogin().then((_res) => { + if (options.id == '2') { + app.mpBehavior({ PageName: 'PG_PATIENTIGAMODREIMBURSEMENT' }) + } + if (options.id == '4') { + app.mpBehavior({ PageName: 'PG_PATIENTIGAMODFAQ' }) + } + if (options.id == '5') { + app.mpBehavior({ PageName: 'PG_PATIENTIGAMODINFO' }) + } + this.addOpenRecord() + this.getConfig() + }) + }, + addOpenRecord() { + wx.ajax({ + method: 'POST', + url: `?r=igg4/nrdl/add-open-record&OpenType=${this.data.id}`, + data: {}, + }).then((res) => { + if (res.CanGetScore) { + this.setData({ + asideOut: true, + }) + } + }) + }, + getConfig() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/common/get-config', + data: {}, + }).then((res) => { + this.setData({ + NrdlCityListSwitch: res.NrdlCityListSwitch, + }) + }) + }, + handleSwitch() { + if (this.data.id == '2') { + if (this.data.NrdlCityListSwitch == '1') { + wx.navigateTo({ + url: '/pages/nrdlTable/index', + }) + } else { + wx.showToast({ + icon: 'none', + title: '敬请期待', + }) + } + } + }, + bindload() { + this.setData({ + isLoad: true, + }) + }, + handleBack() { + wx.navigateBack() + }, +}) diff --git a/src/pages/nrdlDetail/index.wxml b/src/pages/nrdlDetail/index.wxml new file mode 100644 index 0000000..675859f --- /dev/null +++ b/src/pages/nrdlDetail/index.wxml @@ -0,0 +1,21 @@ + + + + + + + diff --git a/src/pages/nrdlTable/index.json b/src/pages/nrdlTable/index.json new file mode 100644 index 0000000..b91d973 --- /dev/null +++ b/src/pages/nrdlTable/index.json @@ -0,0 +1,6 @@ +{ + "navigationBarTitleText": "城市惠民保自付费用报销list", + "usingComponents": { + "timeOut": "/components/timeOut/index" + } +} diff --git a/src/pages/nrdlTable/index.scss b/src/pages/nrdlTable/index.scss new file mode 100644 index 0000000..2960db6 --- /dev/null +++ b/src/pages/nrdlTable/index.scss @@ -0,0 +1,63 @@ +.page { + padding: 478rpx 20rpx 20rpx; + border-color:#fff; + .table { + border-collapse: collapse; + border-top: 1px solid #ece9ea; + border-left: 1px solid #ece9ea; + border-bottom: 1px solid #ece9ea; + border-radius: 20rpx 20rpx 0 0; + .t-header { + display: flex; + border-collapse: collapse; + background-color: #e5829f; + color: #fff !important; + border-radius: 20rpx 20rpx 0 0; + .item7 { + border-right: 0 20rpx 0 0; + } + } + .t-body { + .row { + display: flex; + border-collapse: collapse; + background-color: #fbf0f4; + } + .row:nth-of-type(2n) { + background-color: #f6e0e8; + .item { + border-right: 1px solid #fff7fa; + } + } + } + .item { + padding: 20rpx 5rpx; + font-size: 20rpx; + border-right: 1px solid #f0d5dd; + display: flex; + align-items: center; + justify-content: center; + } + .item1 { + width: 5%; + } + .item2 { + width: 10%; + } + .item3 { + width: 15%; + } + .item4 { + width: 20%; + } + .item5 { + width: 20%; + } + .item6 { + width: 20%; + } + .item7 { + width: 20%; + } + } +} diff --git a/src/pages/nrdlTable/index.ts b/src/pages/nrdlTable/index.ts new file mode 100644 index 0000000..37d66a1 --- /dev/null +++ b/src/pages/nrdlTable/index.ts @@ -0,0 +1,876 @@ +const app = getApp(); + +Page({ + data: { + list: [ + { + index: 2, + provide: "江苏", + city: "南京", + name: "南京宁惠保", + date1: "2023.9.19-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院、门特、", + }, + { + index: 2, + provide: "江苏", + city: "南京", + name: "南京宁惠保", + date1: "2023.9.19-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "国谈药(住院)", + }, + { + index: 3, + provide: "江苏", + city: "苏州", + name: "苏惠保", + date1: "2023.10.18-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门诊", + }, + { + index: 4, + provide: "江苏", + city: "徐州", + name: "惠徐保", + date1: "2023.10.24-2024.1.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 5, + provide: "江苏", + city: "镇江", + name: "镇江惠民保", + date1: "2023.10.30-2023.12.28", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 6, + provide: "江苏", + city: "无锡", + name: "医惠锡城升级版", + date1: "2023.10.18-2023.12.29", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 7, + provide: "浙江", + city: "杭州", + name: "西湖益联保", + date1: "2023.11.8-2024.1.20", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 8, + provide: "浙江", + city: "嘉兴", + name: "嘉兴大病无忧", + date1: "2023.11.6-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "通赔", + }, + { + index: 9, + provide: "浙江", + city: "衢州", + name: "惠衢保", + date1: "2023.10.19-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 10, + provide: "浙江", + city: "绍兴", + name: "越惠保", + date1: "2023.11.1-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 11, + provide: "浙江", + city: "丽水", + name: "浙丽保", + date1: "2023.11.29-2024.1.31", + date2: "2024.1.1-2024.12.31", + content: "通赔", + }, + { + index: 12, + provide: "浙江", + city: "温州", + name: "温州益康保", + date1: "2023.9.1-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 13, + provide: "浙江", + city: "湖州", + name: "南太湖健康保", + date1: "2023.11.10-2024.1.20", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 14, + provide: "浙江", + city: "台州", + name: "台州利民保", + date1: "2023.10.11-2024.1.10", + date2: "2024.1.1-2024.12.31", + content: "通赔", + }, + { + index: 15, + provide: "浙江", + city: "舟山", + name: "舟惠保", + date1: "2023.11.17-2024.2.29", + date2: "2024.1.1-2024.12.31", + content: "通赔", + }, + { + index: 16, + provide: "广东", + city: "广州", + name: "穗岁康", + date1: "2023.11.1-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 16, + provide: "广东", + city: "广州", + name: "穗岁康", + date1: "2023.11.1-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特、门急诊", + }, + { + index: 17, + provide: "广东", + city: "广州", + name: "广州惠民保", + date1: "2023.11.15-2024.1.15", + date2: "2024.1.1-2024.12.31", + content: "基础版:住院", + }, + { + index: 17, + provide: "广东", + city: "广州", + name: "广州惠民保", + date1: "2023.11.15-2024.1.15", + date2: "2024.1.1-2024.12.31", + content: "升级版:住院和门特", + }, + { + index: 18, + provide: "广东", + city: "珠海", + name: "大爱无疆", + date1: "2023.1.1起-2023.12.30", + date2: "投保生效日-2023.12.31", + content: "住院和门特", + }, + { + index: 19, + provide: "广东", + city: "珠海", + name: "大爱无疆", + date1: "2023.1.1起-2023.12.30", + date2: "投保生效日-2023.12.31", + content: "住院", + }, + { + index: 20, + provide: "广东", + city: "珠海", + name: "大爱无疆", + date1: "2023.1.1起-2023.12.30", + date2: "投保生效日-2023.12.31", + content: "国谈药品", + }, + { + index: 19, + provide: "广东", + city: "深圳", + name: "深圳专属医疗险", + date1: "全年可投保,等待期30日", + date2: "1年期或6年期", + content: "国谈药品", + }, + { + index: 20, + provide: "广东", + city: "梅州", + name: "梅州惠民保", + date1: "2023.10.18-2023.12.29", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 21, + provide: "广东", + city: "河源", + name: "河源市民保", + date1: "2023.11.21-2023.12.29", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 22, + provide: "广东", + city: "茂名", + name: "茂名市民保", + date1: "2023.10.11-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 23, + provide: "广东", + city: "潮州", + name: "益安保", + date1: "2023.11.16-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 24, + provide: "广东", + city: "云浮", + name: "云浮云福保", + date1: "2023.11.22-2024.1.10", + date2: "2024.1.1-2024.12.31", + content: "基础版:住院", + }, + { + index: 24, + provide: "广东", + city: "云浮", + name: "云浮云福保", + date1: "2023.11.22-2024.1.10", + date2: "2024.1.1-2024.12.31", + content: "升级版:住院和门特", + }, + { + index: 25, + provide: "广东", + city: "惠州", + name: "惠州惠医保", + date1: "2023.11.13-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 26, + provide: "广东", + city: "汕尾", + name: "善美保", + date1: "2023.10.11-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 27, + provide: "广东", + city: "肇庆", + name: "肇福保", + date1: "2023.11.16-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 28, + provide: "广东", + city: "肇庆", + name: "肇福保", + date1: "2023.11.16-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 28, + provide: "广东", + city: "阳江", + name: "阳江市惠民保", + date1: "2023.11.14-2023.12.29", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 29, + provide: "广东", + city: "清远", + name: "清远惠民保", + date1: "2023.11.12-2024.1.12", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 30, + provide: "广东", + city: "中山", + name: "中山博爱康", + date1: "2023.11.1-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 31, + provide: "山东", + city: "济南", + name: "齐鲁保", + date1: "2023.10.10-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特慢", + }, + { + index: 32, + provide: "山东", + city: "潍坊", + name: "潍坊惠民保", + date1: "2023.11.15-2024.1.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特慢", + }, + { + index: 33, + provide: "山东", + city: "烟台", + name: "烟台市民健康保", + date1: "2023.10.26-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 34, + provide: "山东", + city: "全省", + name: "山东新民保", + date1: "2023.11.1-2023.12.30", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 35, + provide: "山东", + city: "菏泽", + name: "惠荷保", + date1: "2023.11.9-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 36, + provide: "山东", + city: "德州", + name: "德州惠民保", + date1: "2023.11.15-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特慢", + }, + { + index: 37, + provide: "山东", + city: "日照", + name: "日照暖心保", + date1: "2023.11.16-2024.1.31", + date2: "2023.12.1-2024.11.30", + content: "住院和门特慢", + }, + { + index: 38, + provide: "山东", + city: "枣庄", + name: "枣惠保", + date1: "2023.11.17-2024.1.15", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 39, + provide: "山东", + city: "聊城", + name: "聊惠保", + date1: "2023.11.15-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 40, + provide: "四川", + city: "德阳", + name: "德e保", + date1: "2023.11.8-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院、门特、单行支付药品", + }, + { + index: 41, + provide: "四川", + city: "宜宾", + name: "惠宜保", + date1: "2023.11.15-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院、门特、国家谈判药品、单行支付药品、高值药品", + }, + { + index: 42, + provide: "四川", + city: "广安", + name: "广安e惠保", + date1: "2023.11.10-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和", + }, + { + index: 42, + provide: "四川", + city: "广安", + name: "广安e惠保", + date1: "2023.11.10-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "参照住院报销的门诊费用", + }, + { + index: 43, + provide: "四川", + city: "雅安", + name: "惠雅保", + date1: "2023.12.8-2024.2.24", + date2: "2024.1.1-2024.12.31", + content: "住院和门特慢", + }, + { + index: 44, + provide: "四川", + city: "攀枝花", + name: "花城保", + date1: "2023.11.28-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和一类门诊", + }, + { + index: 45, + provide: "四川", + city: "巴中", + name: "巴惠保", + date1: "2023.11.8-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特慢", + }, + { + index: 46, + provide: "四川", + city: "乐山", + name: "乐山惠嘉保", + date1: "2023.12.18-2024.2.29", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 47, + provide: "重庆市", + city: "重庆", + name: "重庆渝快保", + date1: "2023.10.26-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 48, + provide: "湖北", + city: "黄冈", + name: "黄惠保", + date1: "2023.9.6-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 49, + provide: "湖北", + city: "宜昌", + name: "宜昌市民保", + date1: "2023.11.8-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特慢", + }, + { + index: 50, + provide: "湖北", + city: "咸宁", + name: "咸惠保", + date1: "2023.1.1-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 51, + provide: "湖北", + city: "荆门", + name: "惠荆保", + date1: "2023.9.19-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 52, + provide: "湖北", + city: "鄂州", + name: "鄂州惠民保", + date1: "2023.10.17-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 53, + provide: "湖北", + city: "荆州", + name: "荆州惠民保", + date1: "2023.10.23-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 54, + provide: "湖北", + city: "襄阳", + name: "襄阳惠民保", + date1: "2023.11.8-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特慢", + }, + { + index: 55, + provide: "湖北", + city: "黄石", + name: "黄石石惠保", + date1: "2023.12.18-2024.3.31", + date2: "2024.1.1-2024.12.31", + content: "住院、门特慢、单独支付药品", + }, + { + index: 56, + provide: "广西", + city: "全省", + name: "桂民保", + date1: "2023.12.1-2024.1.31", + date2: "2024.1.18-2025.1.17", + content: "住院", + }, + { + index: 57, + provide: "广西", + city: "桂林", + name: "惠桂保", + date1: "长期投保", + date2: "次月1日起一年", + content: "住院", + }, + { + index: 58, + provide: "广西", + city: "桂林", + name: "桂林惠民保", + date1: "2023.11.15-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 59, + provide: "广西", + city: "钦州", + name: "钦州钦惠保", + date1: "2023.12.20-", + date2: "2023.12.31-2024.12.30", + content: "住院", + }, + { + index: 60, + provide: "广西", + city: "柳州", + name: "柳州惠民保", + date1: "2023.11.29-2024.1.15", + date2: "2024.1.16-2025.1.15", + content: "住院", + }, + { + index: 61, + provide: "福建", + city: "莆田", + name: "莆仙保", + date1: "2023.11.1-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 62, + provide: "福建", + city: "三明", + name: "三明普惠医联保", + date1: "2023.9.1-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 63, + provide: "福建", + city: "三明", + name: "三明普惠医联保", + date1: "2023.9.1-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 64, + provide: "福建", + city: "三明", + name: "三明普惠医联保", + date1: "2023.9.1-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "门特", + }, + { + index: 63, + provide: "辽宁", + city: "全省", + name: "惠辽保", + date1: "2023.12.28-2024.12.29", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 64, + provide: "辽宁", + city: "丹东", + name: "丹惠保", + date1: "2023.12.12-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 65, + provide: "辽宁", + city: "大连", + name: "大连工惠保", + date1: "2023.11.1-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特慢", + }, + { + index: 66, + provide: "河北", + city: "全省", + name: "冀惠保", + date1: "一期:2023.11.10-2024.1.10", + date2: "一期:2024.1.11-2025.1.10", + content: "住院", + }, + { + index: 66, + provide: "河北", + city: "全省", + name: "冀惠保", + date1: "二期:2024.1.11-2024.2.29", + date2: "二期:2024.3.1-2025.2.28", + content: "住院", + }, + { + index: 67, + provide: "河北", + city: "唐山", + name: "惠唐保", + date1: "2023.11.13-2023.1.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特慢", + }, + { + index: 68, + provide: "河北", + city: "张家口", + name: "张家口家惠保", + date1: "2023.12.10-2024.2.15", + date2: "2024.2.16-2025.2.15", + content: "住院", + }, + { + index: 69, + provide: "江西", + city: "抚州", + name: "抚惠保", + date1: "2023.12.20-2024.2.29", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 70, + provide: "江西", + city: "赣州", + name: "赣州惠民保", + date1: "2023.12.12-2024.1.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门慢", + }, + { + index: 71, + provide: "河南", + city: "郑州", + name: "郑州医惠保", + date1: "2023.12.20-2024.3.20", + date2: "2024.3.21-2025.3.20", + content: "住院和门特", + }, + { + index: 72, + provide: "河南", + city: "安阳", + name: "安阳惠民保", + date1: "2023.10.16-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 73, + provide: "河南", + city: "鹤壁", + name: "惠鹤保", + date1: "2023.11.13-2024.2.29", + date2: "2024.3.1-2025.2.28", + content: "住院", + }, + { + index: 74, + provide: "海南", + city: "全省", + name: "惠琼保", + date1: "2023.11.29-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特慢", + }, + { + index: 75, + provide: "海南", + city: "全省", + name: "惠琼保", + date1: "2023.11.29-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特慢", + }, + { + index: 75, + provide: "安徽", + city: "全省", + name: "安徽惠民保", + date1: "2023.11.1-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特慢", + }, + { + index: 76, + provide: "黑龙江", + city: "全省", + name: "龙江惠民保", + date1: "2023.11.8-2023.12.28", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 77, + provide: "北京", + city: "北京", + name: "北京普惠健康保", + date1: "2023.11.1-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门诊", + }, + { + index: 78, + provide: "陕西", + city: "全省", + name: "惠秦保", + date1: "2023.6.25-2023.12.31", + date2: "一期:2023.6.30-2023.12.30", + content: "住院和门特", + }, + { + index: 78, + provide: "陕西", + city: "全省", + name: "惠秦保", + date1: "2023.6.25-2023.12.31", + date2: "二期:2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 79, + provide: "宁夏", + city: "全省", + name: "平安宁康保", + date1: "2023.12.5-2023.12.30", + date2: "2023.12.31-2024.12.30", + content: "住院和门特慢", + }, + { + index: 80, + provide: "甘肃", + city: "兰州", + name: "金城·惠医保", + date1: "2023.10.26-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特慢", + }, + { + index: 81, + provide: "新疆", + city: "阿克苏", + name: "阿克苏惠民保", + date1: "2023.10.12-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "通赔", + }, + { + index: 82, + provide: "青海", + city: "全省", + name: "青海健康保", + date1: "2023.12.5-2024.2.29", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + ], + + asideOut: false, + asideType: "13", + }, + onLoad() { + app.waitLogin().then((_res) => { + app.mpBehavior({ PageName: 'PG_PATIENTCITYHEALTHINSURANCE' }) + this.addOpenRecord(); + }); + }, + addOpenRecord() { + wx.ajax({ + method: "POST", + url: `?r=igg4/nrdl/add-open-record&OpenType=${3}`, + data: {}, + }).then((res) => { + if (res.CanGetScore) { + this.setData({ + asideOut: true, + }); + } + }); + }, +}); diff --git a/src/pages/nrdlTable/index.wxml b/src/pages/nrdlTable/index.wxml new file mode 100644 index 0000000..0f705cf --- /dev/null +++ b/src/pages/nrdlTable/index.wxml @@ -0,0 +1,29 @@ + + + + 编号 + 省份 + 城市 + 惠民保名称 + 投保时间 + 报销时间 + 医院内可自付报销范围 + + + + {{index+1}} + {{item.provide}} + {{item.city}} + {{item.name}} + {{item.date1}} + {{item.date1}} + {{item.content}} + + + + + + diff --git a/src/pages/personalInformation/index.json b/src/pages/personalInformation/index.json new file mode 100644 index 0000000..c428f44 --- /dev/null +++ b/src/pages/personalInformation/index.json @@ -0,0 +1,11 @@ +{ + "navigationBarTitleText": "治疗记录", + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/navBar/navBar", + "van-icon": "@vant/weapp/icon/index", + "van-toast": "@vant/weapp/toast/index", + "van-popup": "@vant/weapp/popup/index", + "van-switch": "@vant/weapp/switch/index" + } +} diff --git a/src/pages/personalInformation/index.scss b/src/pages/personalInformation/index.scss new file mode 100644 index 0000000..efbdb7f --- /dev/null +++ b/src/pages/personalInformation/index.scss @@ -0,0 +1,359 @@ +.page { + padding-bottom: 200rpx; + .page-container { + width: 100%; + padding: 30rpx 38rpx; + box-sizing: border-box; + + .banner-new { + padding: 38rpx 30rpx; + background-color: #fff; + border-radius: 24rpx; + box-shadow: 0rpx 4rpx 24rpx 0rpx rgba(0, 0, 0, 0.09); + .row { + margin-top: 48rpx; + &:first-of-type { + margin-top: 0; + } + .row-header { + display: flex; + align-items: center; + justify-content: space-between; + .label { + font-size: 32rpx; + color: #283031; + font-weight: bold; + } + .change-phone { + font-size: 32rpx; + color: #cf5375; + } + } + .row-content { + padding-top: 24rpx; + .input { + padding: 24rpx 28rpx; + background-color: #f2f2f2; + border: 1px solid #ccc; + border-radius: 12rpx; + color: #283031; + line-height: 40rpx; + } + .place-input { + color: #999999; + } + .radio-btns { + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 22rpx; + .btn { + padding: 24rpx; + font-size: 32rpx; + color: #999999; + text-align: center; + line-height: 40rpx; + border-radius: 12rpx 12rpx 12rpx 12rpx; + border: 1px solid #cccccc; + &.active { + color: #e04775; + border-color: #e04775; + } + } + } + .r-picker { + display: block; + .r-picker-content { + padding: 24rpx 28rpx; + background: #f2f2f2; + border-radius: 12rpx 12rpx 12rpx 12rpx; + border: 1rpx solid #cccccc; + display: flex; + align-items: center; + justify-content: space-between; + .value { + font-size: 32rpx; + color: #283031; + line-height: 40rpx; + &:empty { + &::after { + content: attr(data-place); + color: #999999; + font-size: 32rpx; + } + } + } + .triangle { + width: 48rpx; + height: 48rpx; + } + } + } + } + } + .protocol { + margin-top: 48rpx; + display: flex; + align-items: center; + justify-content: space-between; + .wrap { + line-height: 1; + .name { + font-size: 32rpx; + color: #283031; + font-weight: bold; + } + .book { + margin-top: 16rpx; + font-size: 28rpx; + color: #cf5375; + } + } + } + } + + // .footer-new { + // position: fixed; + // left: 0; + // bottom: 80rpx; + // z-index: 10; + // width: 100%; + // padding: 0 30rpx; + // box-sizing: border-box; + // display: grid; + // grid-template-columns: repeat(auto-fit, minmax(200rpx, 1fr)); + // gap: 20rpx; + // .btn1 { + // height: 88rpx; + // text-align: center; + // line-height: 88rpx; + // background: #dddddd; + // font-size: 34rpx; + // font-weight: bold; + // color: #283031; + // border-radius: 24rpx 24rpx 24rpx 24rpx; + // } + // .btn2 { + // height: 88rpx; + // text-align: center; + // line-height: 88rpx; + // background: #dddddd; + // font-size: 34rpx; + // font-weight: bold; + // color: #283031; + // border-radius: 24rpx 24rpx 24rpx 24rpx; + // } + // .btn3 { + // height: 88rpx; + // text-align: center; + // line-height: 88rpx; + // background: #dddddd; + // font-size: 34rpx; + // font-weight: bold; + // color: #283031; + // border-radius: 24rpx 24rpx 24rpx 24rpx; + // } + // } + + .cancellation { + margin-top: 45rpx; + height: 80rpx; + text-align: center; + line-height: 80rpx; + font-size: 32rpx; + color: #fff; + background: #b8bfd1; + border-radius: 100rpx 100rpx 100rpx 100rpx; + } + } + + .picker { + font-size: 28rpx; + color: #023eba; + max-width: 50vw; + } + + .call { + text-align: center; + margin: 0 auto; + width: 560rpx; + height: 80rpx; + line-height: 80rpx; + background: #023eba; + border-radius: 100px 100px 100px 100px; + font-size: 34rpx; + font-family: + Source Han Sans CN-Bold, + Source Han Sans CN; + font-weight: bold; + color: #ffffff; + } + + .order-shop { + position: fixed; + left: 0; + top: 0; + width: 100vw; + height: 100vh; + background-color: rgba(0, 0, 0, 0.25); + z-index: 666; + } + + .order-shop-worker { + position: fixed; + display: flex; + justify-content: center; + align-items: center; + left: 0; + top: 0; + width: 100vw; + height: 100vh; + background-color: rgba(0, 0, 0, 0.25); + z-index: 3; + } + + .order-shop-box { + position: fixed; + left: 0; + bottom: 0; + width: 100vw; + max-height: 80vh; + background: #ffffff; + box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.5); + border-radius: 32rpx 32rpx 0px 0px; + padding: 48rpx 0 60rpx; + } + + .order-shop-worker-box { + width: 646rpx; + padding: 48rpx 40rpx 64rpx; + background: #ffffff; + border-radius: 32rpx; + } + + .order-shop-title { + text-align: center; + font-size: 36rpx; + font-family: + PingFangSC-Medium, + PingFang SC; + font-weight: bold; + color: #222222; + line-height: 50rpx; + } + + .order-search { + box-sizing: border-box; + width: 690rpx; + height: 84rpx; + line-height: 84rpx; + background: #f8f8f8; + border-radius: 42rpx; + margin: 32rpx auto; + padding-left: 74rpx; + background-position: 30rpx center; + background-repeat: no-repeat; + background-size: 36rpx; + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABMCAYAAAD6BTBNAAAAAXNSR0IArs4c6QAADFpJREFUeF7dnHmQHFUdx7+/N5OQhBw7vRuRwyMWGBQEJcEQIEn3LJBjpjcgJlwhqIVFyRUxSBQoDAhBBCmQq8pSUIggCwps9+bA7PQkYQkoMRaHBIyCFBggOz2bc2N2p39Wz+6GHP36mJk9+6+per/3e7/3mXf+3u89Qh99VapVFaNd4wtwxgumsQCNhHBGEdNwZuwCYTvAO5jxUQziLaeN3rZfnrWtj8yVFku9ZBAlVPM4QZx0CBoxJgM4LFrZxABvBqiZCVaMY5kWa+Zb0XRUXrpHAVarxrEO0cUEngfgs5U2n4FNBHqsILB0a1P635XWH0ZfDwBkqk6aZzPjOgCnhDGiAjLMwGpicYedTa2ogL7QKioIkCmhmRcQcD2A40JbUGFBBtYLiJ/mrNRzFVbtqa4iAKs040QBPAjg1N4wOlQZTH9uj9GV25tSb4eSL1GoPIDqI8MUGrsE4KsAxEu0oceyMfA/IvzMdkbeiqzW0RMFlQxw7FTjmI4Y6gn4aumGuTMrPgTzJgZa3aULgdoAZwQTuUuaBIiPAeNTpZfh5qRmsDjfzs56vzw9B+cuCaBSu+ybKBQeBmFUNINoN8DNBMowIYtDxOv28uC13ZjTzQQNcU4QHFOZOAnwZAKGRCmbgRYCzbOt9Moo+YJkIwNUVGMBCHcDEEHKP0mnZgYeZW6vb82e0xo+n7fkyCnLxh4SL1zggOYTeEJYfQxqF+BLc5b+aNg8QXKRACY0YwkBPw5S2pXOzMIUhNtyVurlkHkii1VNMzUh+AYAtaEyM9wF+XV2tu6uUPIBQqEBRoHHwN8ECpfnrLN7DNyB9aqpNTWH+QEwvhQSzELb0t2eVNYXCmBXt70nREltRLQol0k9AJATQr6yIhNeGVI9+sMfOuDFIcZIhwRdkmtKLy3HiECAxQnDKTwZYszbyMI5L980+9VyDKpEXqXWmAyHngD4c376GGgXTLNy2fSqUsv1BeguVQoC64NnW14R491ztmTn7ijVkErnGz19hRLf09EA8GkBuj8We5yvtTTP/m8pNsgBqo8MS1DNuqB1HhEtzW394DtYf1l7KQb0aJ7JLw5PDM/VEyPtVw4Bq3M1bbV4am4hqj1SgIpm3g3wNb4Fu/AyqflAcUHcPz/Viiu081mAU/7dmW7IW+klUSvhCbBrb/uK//aMV9jbNtf1y5Z3IIUJxghlDFah0w8p+3YVCnz81jV170SB6AGQSdHMFwIcAxtj3HZyfxrzgio9SjVqhhA2ADhKJksMI5fV64J07Zt+EMCEZlxIwO99lLRxTEzKr0q9FqWg/iCbUJefDuqwyM/xQZhuZ/Tnw9p7AMBi63PBSP15RHR1LpO+L2wB/U1O0cybAb5JahdjrZ3Vp4a1ez+A1UnjHGb8SZbZ3WHkrfTJfbJIDlujILnO1cVrBBwtraegqfmm9NogVW76fgAVreElgCZJMjKhMLk3t2dhKlCKTEIzZhHQ6JO30bZ036VPd969AN0DICa8Kf1XGEY+4gBbSuV6K4+iGi+CpLNyR4zFZ7ZkUx8G2bMXYJCzgCBO6UmvSpChlU5PaGaKwKaP3lDOhm6ApGjGu/KjR2q2rfTpla5EX+tTNMPtccd62cGMDfmsflKQjUWACdU8noilyxIGXZa30r8KUjbQ0qs183oG3yYb80XHniNb1p672a9eRYDVmnE1A/d6C9Juh9sPr4Qnub8BTpxhfJYKcHcent51Bi7KW/rjgQATSeMZYpwtEWyyLf2M/lb5StmjaMbfAZzoqY/wazujfzcQoKIZ7mzjGatCoBtyJWyyK1XBntYT4DR5w7b0430BulFSgnbkpUJEp9mZ9Is9XZG+0l+jmXUO2DOKwT1Xzte0Hern5qJqrXESw3lJMv4xhomqMEePfQWg3HLH1JpfiDn8L5meAsWO3pqZJU2nKs2YL4DfSRRsti39iHKN7N/5WSha406Ah3kuZ4BU3tKXyepAimouBLH3EV/EjXX/BiW3Tkma/wCz52mew/St1mxa1sBAimosBuEnnvQH2fZNhtBvW8eMq/JZ/X55C0yad4F5oaT5Pp639IsGassKa7eiGW64x1kSBtfnLf12KcBqzXyAwZd7C/BvbKvu0rCGDFS5hGY+S+DZkon0FttKe/ZQV94dA+8E8bUSgE/YVt2FAxVMWLsV1XwexGd6D2P0o3w2fYe8C2vmTQDf7JmZYOYzuh7WkIEqp2jGOlk4MoOuyFtpN3jU83O9MD8A8AtJ8qD0whxYV0UzNgIY78XAAS5p9YnmooRqXEQE7/gQwsd2Ro94HWGAtUPViidox04Chkoa0Qy/mEKqURsnOuT8VVbtQjspW19Iy7d6A4zXgeaOnmocE49BGkftcHxca3am6yuVdOFJy0ZjhNMKsOchuwNWW6261QOck9R8RWs4F6CnJQK7bWv9ocBiaaRZEZqiGR8A8N6ysVhsZ1Oek8xggJpImvcR85WSurxqW7q3q6srQxdAsx7gOZ4zMWhN3kpPGwywvOqgaOYbAH/ZK42IHspl0pI1cmeOTpd+0vweMXtO1W4MXXtH7Mgda2dtGWwQu8Y/976dd5CVQ3Pt1emn/OpdzFijLR/voMOdyr0HSmBBztJ/OdgABkQpOO2Mw7Zn9ZZAgMVWqBn/lJ3WM2h93kpPHFwAFwtFnbAJhHGSer1kW7pfNNcnXbhzIpHvSNx0x6Fk6+q0NVggKklzDpjrZfUJ2oF059vb97s8s5uk4wEwqA6XFM3cALDnLSsG9nSI9iO2N30jF9Rg9hs8E5rhhn6pskxCULKlaeC3wqDWB8LTdkb3XJUcyGb/4CK1cQbIWS6lTnjT3nr4iVg/sf/FQwc1la70sao1skA73wRYEmhJLJi+3pJNuRG6gZ9XgOUrBEivTw30Y84Qsd8rbUufEUiuS+AggNVa42yG86x8cEU7CUyzm3TXBTSgvkSyYSYxuQFFknt+xMw8NZ/V3RDnUJ/nAtLPwdiplf7TMTR+0raVM+xQpfQDIUVddhRTYQMBNXJz6AnbSkdyIHsCHFXb+MW447xKwCE+hTXbu5Uzse7Utn7Ax9eEKvWZKiHia8D4io/gNtEx5NiWtTN8g4l8J5F9E5WksRjsfVrXLceux9oZeU5P3QavyB8zuX64Mnz4SjCm+OkrNfbb56ZS8YJKNviqFDXa23gu1uu7KlLhCirpankNQfDcIhl4KG/pV3T+DP/53pULN24Ul97r2h3UBe0bw5tVvqRrO0RhWUC33a8gBj2Yt9Kuays0xODbmpo5nQGDwEFX7N9njl+Qz84MPYOVj8lbgzvbgulR/wnDO29UiIEA3WKqNWM+M34Lkrh9umxhoINAS2zecjuy397dU4BkersWybcAvCDE9VypeVEghgLolqSoDdeC6M4wUNwnmQAs8AvKCaMnikzn9sx9y0G2w4iize3D4bpzaIBFiJ1HoC7EcA9OMNYx0W15K+13JyNazfaTXiyU5MRzwe5rSd6OgQOVd/YSZGShHPvKh4EYCWCxO9ea8xyHHw5xpX5fWza6j4Q5MV6aX6W/VwaxYtZOTzLNA/PFPv48r2J2CcL5LRndTGjm/SQNafkkaxDEyACLEFXzDCZ2LyRGfRDHPd16DaCMALLtAq9vbUq963t1TLXio50d4+IxPoFJqMRw341xQ9Gi2v4emM+zs3XdwaTuW19lQ4xqxN6/pua0547goeJxBso8cKLdILwDh4svFzG4jViMALH7qE+CgXHyQ+9wbZkIZvuQIZd4bD3LhlgywKLpc+pjiZYRiwjFd1tGhKtOr0ptI6Ibc5m0G98nW9uVBbE8gF0sxkxtGBcXdC8T+kkgUvEJgj+IjvjCkHvbkiFWBGB3m1KSxllwcCPIf9/Zc22w+Ezo88y4NYpLqsuekiBWFGA3mEStOYUcXgRgem88i+eeYRChQTjijrCeZMmfGBoiiO6xM+lregRgt3Fj1cZPF8i5kBnziIrP5FWyPHdG/wuDHusQe54McwAUsuWHhuiQmFbJCvnaVzPlj4cX4kM1Imju6xkMHO3vbzxInbs1fJuImrkAq53Y6kHnRViId/YawINwzKmPjcmN/LzgwnhmGkvgURBiJDF3viPtviFN2C5AHzkce6s1+/J7flFSIVtXFLEwEPsQYJSq9J2sL8Re7cJ9x6DskklJmneD+fv7aiKIn+es1KK+68Jl16t3FVQlG6cKdooPUTgkzNZMao37+/+7SsIz/Eyb1AAAAABJRU5ErkJggg==); + } + + .search-input { + font-size: 28rpx; + line-height: 84rpx; + height: 84rpx; + padding-right: 30rpx; + } + + .search-cell-box { + max-height: 550rpx; + } + + .search-cell { + display: flex; + justify-content: space-between; + padding: 0 60rpx; + color: #aeb6cd; + } + + .shop-text { + padding: 20rpx 0; + text-align: center; + line-height: 40rpx; + // border-bottom: 2rpx solid #f8f8f8; + flex: 1; + font-size: 32rpx; + font-family: + Alibaba PuHuiTi-Medium, + Alibaba PuHuiTi; + font-weight: 500; + } + + .search-cell-active { + border-bottom: none; + color: #364e9e; + font-size: 32rpx; + font-family: + Alibaba PuHuiTi-Medium, + Alibaba PuHuiTi; + font-weight: 500; + color: #364e9e; + } + + .fl1 { + display: flex; + justify-content: space-between; + padding: 0 30rpx; + } + + .closeShop { + color: #aeb6cd; + font-size: 28rpx; + margin-left: auto; + } + + .clickShop { + color: #364e9e; + font-size: 28rpx; + } + + .empty-image { + margin: 0 auto; + width: 100%; + padding-top: 450rpx; + text-align: center; + background-position: center 100rpx; + background-size: 300rpx; + background-repeat: no-repeat; + background-image: url(https://m.zd.hbraas.com/zd/none.png?t={{Timestamp}}); + } + + .moretext { + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + } +} + +.popup { + .popup-title { + display: flex; + justify-content: space-between; + padding: 20rpx 40rpx; + font-size: 32rpx; + .clsoe { + color: #7f7f7f; + } + .sure { + color: #22c065; + } + } + .popup-picker { + .picker-col { + padding: 10rpx 30rpx; + font-size: 28rpx; + line-height: 40rpx; + box-sizing: border-box; + display: flex; + align-items: center; + } + } +} diff --git a/src/pages/personalInformation/index.ts b/src/pages/personalInformation/index.ts new file mode 100644 index 0000000..3bf6c50 --- /dev/null +++ b/src/pages/personalInformation/index.ts @@ -0,0 +1,379 @@ +import dayjs from 'dayjs' +const app = getApp() +const licia = require('miniprogram-licia') + +Page({ + data: { + isEdit: false, + area: [] as string[][], + city: [] as string[][], + userInfo: {} as any, + areaValue: '', + bron: '', + age: '', + ageStart: '1930-01-01', + ageEnd: '', + + rtValue: '0', + RTList: [ + { id: 1, value: '本人' }, + { id: 2, value: '亲友' }, + ], + + genderValue: '0', + GenderList: [ + { + id: 1, + value: '男', + }, + { + id: 2, + value: '女', + }, + ], + + ageRangeValue: '0', + ageRangeList: [ + { + id: 5, + value: '18岁以下', + }, + { + id: 1, + value: '18岁-44岁', + }, + { + id: 2, + value: '45岁-59岁', + }, + { + id: 3, + value: '60岁-74岁', + }, + { + id: 4, + value: '75岁以上', + }, + ], + + taskValue: 0, + TaskList: [ + { + id: 1, + value: '接受随访', + }, + { + id: 2, + value: '不接受随访', + }, + ], + + antibodyTypeRangeList: [ + { + id: '1', + value: 'AchR', + }, + { + id: '2', + value: 'MuSK', + }, + { + id: '3', + value: 'LRP4', + }, + { + id: '4', + value: 'RyR', + }, + ], + thyroidAbnormalRangeList: [ + { + id: '1', + value: '是', + }, + { + id: '2', + value: '否', + }, + ], + previousConvulsionRangeList: [ + { + id: '1', + value: '是', + }, + { + id: '2', + value: '否', + }, + ], + traditionalImmunosuppressantRangeList: [ + { + id: '1', + value: '他克莫司', + }, + { + id: '2', + value: '硫唑嘌呤', + }, + { + id: '3', + value: '吗替麦考酚酯', + }, + { + id: '4', + value: '其它', + }, + ], + medicalInsuranceTypeRangeList: [ + { + id: '1', + value: '城市职工', + }, + { + id: '2', + value: '城市居民', + }, + { + id: '3', + value: '新农合', + }, + ], + + DiagnosisTime: '', + + selectDiagnoseTypeIndex: '0', + diagnoseTypeShow: false, + diagnoseTypeValue: '0', + DTList: app.globalData.DiagnoseType.map((item) => { + return { + id: item.id, + value: item.name, + } + }), + }, + onShow() { + const SystemInfo = app.globalSystemInfo + if (SystemInfo) { + const { bottom } = SystemInfo.capsulePosition + this.setData({ + bottom, + }) + } + const ageEnd = licia.dateFormat(new Date(), 'yyyy-mm-dd') + + this.setData({ + ageEnd, + }) + + app.waitLogin().then(() => { + app.mpBehavior({ PageName: 'PG_PATIENTPERSONALINFO' }) + const that = this + app.getUserInfo(that, true, that.formatUserInfo.bind(that)) + }) + }, + + formatUserInfo(res) { + this.formatBorn(res.Birth) + this.handleChaneDiagnosisTime({ detail: { value: res.DiagnosisTime } }, false) + const diagnoseTypeValue = this.data.DTList.findIndex((item) => item.id == res.DiagnoseType) + this.handleChangeDiagnoseType({ detail: { value: [diagnoseTypeValue] } }) + this.handleDiagnoseTypeSave(false) + // this.handleTapRT(); + }, + formatBorn(Birth) { + let bron = '' + let age = '' + const date = new Date() + const year = date.getFullYear() + const month = date.getMonth() + 1 + if (!Birth) { + bron = `${Birth}年` + age = '岁' + } else if (Birth && Birth.split('-').length > 1) { + bron = `${Birth.split('-')[0]}年${Birth.split('-')[1]}月` + age = + month - Birth.split('-')[1] >= 0 + ? `${year - Birth.split('-')[0]}岁${month - Birth.split('-')[1]}个月` + : `${year - Birth.split('-')[0] - 1}岁${12 - Birth.split('-')[1] + month}个月` + } else { + bron = `${Birth}年` + age = `${year - Birth}岁` + } + age = age.replace('岁0个月', '岁') + this.setData({ + bron, + age, + 'userInfo.Birth': Birth, + 'userInfo.AgeYear': Number(dayjs().format('YYYY')) - Birth.split('-')[0], + }) + }, + + handleChaneAge(e) { + const Birth = e.detail.value + this.formatBorn(Birth) + this.updateUserInfo() + }, + handleChaneDiagnosisTime(e, update = true) { + const DiagnosisTime = e.detail.value + this.setData({ + DiagnosisTime: dayjs(DiagnosisTime).format('YYYY年MM月'), + 'userInfo.DiagnosisTime': DiagnosisTime, + }) + this.updateUserInfo(update) + }, + + handleInput(e) { + const { key } = e.currentTarget.dataset + this.setData({ + [`userInfo.${key}`]: e.detail.value, + }) + }, + handleChangeRT(e, update = true) { + const value = e.detail.value + const id = this.data.RTList.filter((_item, index) => index == value)[0]?.id + this.setData({ + rtValue: value, + 'userInfo.RelationType': id, + }) + this.updateUserInfo(update) + }, + handleChangeGender(e, update = true) { + const value = e.detail.value + const id = this.data.GenderList.filter((_item, index) => index == value)[0]?.id + this.setData({ + genderValue: value, + 'userInfo.Gender': id, + }) + this.updateUserInfo(update) + }, + handleChangeTask(e, update = true) { + const value = e.detail ? 0 : 1 + const id = this.data.TaskList.filter((_item, index) => index == value)[0]?.id + this.setData({ + taskValue: value, + 'userInfo.PatientCanFollowUp': id, + }) + this.updateUserInfo(update) + }, + handleChangeAgeRange(e, update = true) { + const value = e.detail.value + const id = this.data.ageRangeList.filter((_item, index) => index == value)[0]?.id + this.setData({ + ageRangeValue: value, + 'userInfo.AgeRange': id, + }) + this.updateUserInfo(update) + }, + handleDiagnoseTypeSave(update = true) { + const rangeIndex = this.data.selectDiagnoseTypeIndex + const id = this.data.DTList.filter((_item, index) => index == rangeIndex)[0]?.id + this.setData({ + diagnoseTypeValue: rangeIndex, + 'userInfo.DiagnoseType': id, + }) + if (update) { + this.handleDiagnoseTypeShow() + } + + this.updateUserInfo(update) + }, + handleRadio(e) { + const { id, key } = e.currentTarget.dataset + this.setData({ + [`userInfo.${key}`]: id, + }) + this.updateUserInfo(true) + }, + handleDiagnoseTypeShow() { + this.setData({ + diagnoseTypeShow: !this.data.diagnoseTypeShow, + }) + }, + handleChangeDiagnoseType(e) { + const value = e.detail.value[0] + this.setData({ + selectDiagnoseTypeIndex: value, + }) + }, + handleRedioSelect(e) { + const { key, id } = e.currentTarget.dataset + this.setData({ + [`userInfo.${key}`]: id, + }) + this.updateUserInfo() + }, + updateUserInfo(update = true) { + if (!update) return + const { PatientName, RelationType, Gender, Birth, DiagnosisTime, DiagnoseType, ...userInfo } = this.data.userInfo + wx.ajax({ + method: 'POST', + url: '?r=igg4/account/update-info', + data: { + name: PatientName, + relationType: RelationType, + gender: Gender, + birth: Birth, + diagnosisTime: DiagnosisTime, + diagnoseType: DiagnoseType, + ageRange: userInfo.AgeRange, + patientCanFollowUp: userInfo.PatientCanFollowUp, + antibodyType: userInfo.AntibodyType, + thyroidAbnormal: userInfo.ThyroidAbnormal, + previousConvulsion: userInfo.PreviousConvulsion, + traditionalImmunosuppressant: userInfo.TraditionalImmunosuppressant, + medicalInsuranceType: userInfo.MedicalInsuranceType, + ...userInfo, + }, + }) + .then((_res) => { + wx.showToast({ + title: '修改成功', + icon: 'none', + }) + app.getUserInfo(this, true, this.formatUserInfo.bind(this)) + }) + .catch((err) => { + wx.showToast({ + title: err.data.msg, + icon: 'none', + }) + app.getUserInfo(this, true, this.formatUserInfo.bind(this)) + }) + }, + + handleChangeTel() { + app.mpBehavior({ PageName: 'PG_PATIENTPERSONALINFO_CHANGEPHONECLICK' }) + wx.navigateTo({ + url: '/pages/changePhone/index', + }) + }, + handleChangeUser() { + wx.navigateTo({ + url: '/pages/changeUser/index', + }) + }, + handleLogout() { + app.mpBehavior({ PageName: 'BTN_PATIENTPERSONALINFOLOGOUT' }) + wx.navigateTo({ + url: '/pages/cancellation/index', + }) + }, + handleBack() { + wx.navigateBack() + }, + routerTo(e) { + const { url } = e.currentTarget.dataset + if (url.includes('/doctor/pages/d_login/index')) { + app.mpBehavior({ PageName: 'BTN_PATIENTPERSONALINFOSWITCHDOCTORPORTAL' }) + } + wx.navigateTo({ + url, + }) + }, + redirectTo(e) { + const { url } = e.currentTarget.dataset + wx.redirectTo({ + url, + }) + }, +}) diff --git a/src/pages/personalInformation/index.wxml b/src/pages/personalInformation/index.wxml new file mode 100644 index 0000000..db97cc4 --- /dev/null +++ b/src/pages/personalInformation/index.wxml @@ -0,0 +1,284 @@ + + + + + + + + + + 切换账号 + 切换医生端 + 注销 + + + + + + 关闭 + 保存 + + + + {{item.value}} + + + diff --git a/src/pages/privacyAgreement/index.json b/src/pages/privacyAgreement/index.json new file mode 100644 index 0000000..5175f10 --- /dev/null +++ b/src/pages/privacyAgreement/index.json @@ -0,0 +1,10 @@ +{ + "navigationBarTitleText": "", + "navigationStyle": "custom", + "disableScroll": true, + "usingComponents": { + "mp-html": "mp-html", + "loginNavbar": "/components/loginNavbar/index", + "navBar": "/components/navBar/navBar" + } +} diff --git a/src/pages/privacyAgreement/index.scss b/src/pages/privacyAgreement/index.scss new file mode 100644 index 0000000..386ef66 --- /dev/null +++ b/src/pages/privacyAgreement/index.scss @@ -0,0 +1,74 @@ +.page { + position: relative; + box-sizing: border-box; + background-color: #fff; + height: 100vh; + overflow: hidden; + .bg { + width: 100%; + } + .page-container { + position: absolute; + width: 100%; + top: 0; + left: 0; + display: flex; + flex-direction: column; + height: 100vh; + padding-bottom: 80rpx; + box-sizing: border-box; + .navbar { + flex-shrink: 0; + } + .content { + position: relative; + flex: 1; + margin: 80rpx auto 0; + overflow-y: auto; + overflow-x: hidden; + padding: 40rpx 48rpx; + width: 654rpx; + font-size: 28rpx; + color: #666666; + box-sizing: border-box; + background: #ffffff; + box-shadow: 0rpx 4rpx 24rpx 0rpx rgba(0, 0, 0, 0.09); + border: 2rpx solid rgba(224, 71, 117, 0.25); + border-radius: 24rpx; + .mask { + position: sticky; + bottom: -40rpx; + left: 0; + width: 100%; + height: 250rpx; + background: linear-gradient(rgba(255, 255, 255, 0.3), #fff); + } + } + .footer { + flex-shrink: 0; + margin: 81rpx 48rpx 0; + box-sizing: border-box; + display: flex; + > view:not(:last-of-type), + > image { + margin-right: 30rpx; + } + .btn { + flex: 1; + text-align: center; + height: 80rpx; + line-height: 80rpx; + text-align: center; + border: 2rpx solid #e04775; + border-radius: 24rpx; + font-size: 34rpx; + font-weight: bold; + color: #e04775; + } + .sure { + background-color: #e04775; + color: #fff; + } + } + } +} diff --git a/src/pages/privacyAgreement/index.ts b/src/pages/privacyAgreement/index.ts new file mode 100644 index 0000000..9bddd18 --- /dev/null +++ b/src/pages/privacyAgreement/index.ts @@ -0,0 +1,39 @@ +const app = getApp() + +Page({ + data: { + durgInfo: {}, + pagePath: '', + id: '', + Content: `

知情同意书


【重症肌无力患者支持“gMG给力加油站”项目】(以下简称“我们”)深知个人信息对您的重要性,并会尽全力保护您的个人信息安全可靠。我们致力于维持您对我们的信任,恪守以下原则,保护您的个人信息:权责一致原则、目的明确原则、选择同意原则、最少用原则、确保安全原则、公开透明原则等。同时,我们承诺,我们将按照业界成熟的安全标准,采取相应的安全保护措施来保护您的个人信息

    请在使用我们的产品(或服务)前,仔细阅读并立即本《知情同意书》。



    一、我们如何收集和使用您的个人信息

    个人信息是指以电子或者其它方式记录的能够单独或者与其它信息结合识别特定自然人身份或者反映特定自然人活动情况的各种信息。

    我们仅会处于以下目的,收集和使用您的个人信息

     1、注册成为用户:为完成创建账号,你需提供以下信息:

    你的姓名、手机号码,年龄,性别,重症肌无力疾病确诊证明材料。您提供的上述信息,将在您使用本服务期间持续授权我们使用。在您注销账号时,我们将停止使用并删除上述信息。

     2、个性化推荐疾病知识及服务:为了给您提供个性化的疾病知识及推荐服务,我们将记录您在使用本服务期间的就诊记录、预约信息、内容的浏览记录等。在您注销账号时,我们将停止使用并删除上述信息。

      3,用药患者支持模块的注册将需要提供,你的姓名,手机号,年龄 性别 用药处方信息的证明材料,您提供的上述信息,将在您使用本服务期间持续授权我们使用。在您注销账号时,我们将停止使用并删除上述信息。

     4、中心内部数据分析和研究:我们收集数据是根据您与我们的互动和您做出的选择,包括隐私设置以及IP地址、设备型号等;我们要将信息用于本文未载明的其它用途时,会事先征求您的同意。



    二、我们如何共享、转让、披露您的个人信息

    (一)共享

    我们不会向其它任何公司、组织和个人分享您的个人信息,但以下情况除外:

     1、在获取明确同意的情况下共享:获得您的明确同意后,我们会与其它方共享您的个人信息。

     2、我们可能会根据法律法规规定,或按照政府主管部门的强制性要求耱,共享您的个人信息。

     3、与您所绑定的医生共享:您的个人信息可能会与分享给您加入的医生作为科研和分析使用。我们只会共享必要的个人信息,且受本文所声明目的的约束。如要改变个人信息的处理目的,将再次征求您的同意。

     4、涉及到用药不良事件时,在符合适用的法律法规前提下,您的相关信息和资料会披露给药品捐赠方药品上市许可持有人或其在中国的代理人的药品不良反应监管部门,其可能会就此进行跟进和随访,将该等信息录入到药品捐赠方的其药品不良事件数据库并按照相关法律规定上报给相关法律部门。

     5、与授权合作伙伴共享:仅为实现本文中声明的目的,我们的某些服务将由授权合作伙伴提供  。我们可能会与合作伙伴共享您的个人信息,已提供更好的客户服务和用户体验。

    例如,我们聘请来提供患者随访服务的公司可能需要采集利和访问您的个人数据。在这种情况下,这些公司必须遵守我的数据隐私和安全要求。我们仅会出于合法、正当、必要、特定、明确的目的共享您的个人信息,并且只会共享提供服务所必要的个人信息。

    对我们与之共享个人信息的公司、组织和个人,我们会与其签暑严格的保密协定,要求他们按照我们的说明、本文以及其它任何相关的保密和安全措施来处理个人信息。

    (二)转让

    我们不会将您的个人信息转让给任何公司、组织和个人,但以下情况除外:

    在获得明确同意的情况下转让:获得您的明确同意后,我们会向其它方转让你的个人信息;

    (三)公开披露

    我们仅会在以下情况下,公开披露您的个人信息:

     1、获得您明确同意后;

     2、基于法律的披露:在法律、法律程序、诉讼或政府主管部门强制性要求下,我们可能会公开披露您的个人信息。



    三、您的权利

    按照中国相关的法律、法规、标准,以及其它国家、地区的通行做法,我们保障您对自己的个人信息行使以下权利:

    (一)访问您的个人信息

    如果您想访问您的信息,可以通过以下方式自行访问:

    账户信息——如果您希望访问或编辑您的账户中的个人信息,可以在小程序的个人中心中进行浏览或编辑。。

    (二)删除您的个人信息

    在以下情形中,您可以向我们提出删除个人信息的请求:

     1、如果我们处理个人信息的行为违反法律法规;

     2、如果我们收集、使用您的个人信息,却未征得您的统一;

     3、如果我们处理个人信息的行为违反了与您的约定;

     4、如果您不再使用我们的产品或服务,或您注销了账号;

     5、如果我们不再为您提供产品或服务。

    若我们决定响应您的删除请求,我们还将同时通知从我们获得您的个人信息的实体,要求其及时删除,除非法律法规另有规定,或这些实体获得您的独立授权。

    当您从我们服务中删除信息后,我们会在备份更新时删除这些信息。

     (三)改变您授权同意的范围

    对于额外手机的个人信息的收集和使用,您可以随时给予或收回您的授权同意。

    您可以随时使用我们的在线客服功能。我们将在30天内回复您的请求。

     (四)个人信息主体注销账户

    您可以随时使用我们的在线客服功能。我们将在30天内回复您的请求。

    在注销账户之后,我们将停止为您提供产品或服务,并依据您的请求,删除您的个人信息,法律法规另有规定的除外。

     (五)响应您的上述请求

    为保障安全,您可能需要提供书面请求,或以其它方式证明您的身份。我们可能会先要求您验证自己的身份,然后再处理您的请求。

`, + }, + onLoad(options) { + this.setData({ + pagePath: options.page, + id: options.id, + }) + app.waitLogin({ isReg: false, loginPage: true }).then(() => { + app.mpBehavior({ PageName: 'PG_PATIENTINFORMEDCONSENT' }) + }) + }, + handleBack() { + app.mpBehavior({ PageName: 'BTN_PATIENTCONSENTDISAGREE' }) + wx.navigateBack() + }, + handleSure(e) { + app.mpBehavior({ PageName: 'BTN_PATIENTCONSENTAGREE' }) + const { replace } = e.currentTarget.dataset + const { pagePath, id } = this.data + if (replace) { + wx.redirectTo({ + url: `${pagePath}?ignoreAgreement=1` + `&id=${id}`, + }) + } else { + wx.navigateTo({ + url: `${pagePath}?page=/pages/enterInfo/index&ignoreAgreement=1&id=${id}&proces=1`, + }) + } + }, +}) + +export {} diff --git a/src/pages/privacyAgreement/index.wxml b/src/pages/privacyAgreement/index.wxml new file mode 100644 index 0000000..c5fb982 --- /dev/null +++ b/src/pages/privacyAgreement/index.wxml @@ -0,0 +1,17 @@ + + + + + + + + + + 不同意 + 同意 + + + 关闭 + + + diff --git a/src/pages/publishStoryDetail/index.json b/src/pages/publishStoryDetail/index.json new file mode 100644 index 0000000..4102756 --- /dev/null +++ b/src/pages/publishStoryDetail/index.json @@ -0,0 +1,12 @@ +{ + "navigationBarTitleText": "患者故事", + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/navBar/navBar", + "star": "/components/star/index", + "van-icon": "@vant/weapp/icon/index", + "mp-html": "mp-html", + "free-audio":"/components/freeAudio/index", + "timeOut": "/components/timeOut/index" + } +} diff --git a/src/pages/publishStoryDetail/index.scss b/src/pages/publishStoryDetail/index.scss new file mode 100644 index 0000000..ede7508 --- /dev/null +++ b/src/pages/publishStoryDetail/index.scss @@ -0,0 +1,113 @@ +.page { + .banner-img { + width: 100%; + height: 192rpx; + } + .page-container { + box-sizing: border-box; + margin-top: -20rpx; + padding: 0 50rpx 200rpx; + + .banner { + .title { + margin-top: 34rpx; + font-size: 44rpx; + color: #484848; + font-weight: bold; + word-break: break-all; + } + .banner-footer { + margin-top: 16rpx; + display: flex; + align-items: center; + justify-content: space-between; + .time { + font-size: 36rpx; + color: #b6b7ba; + } + .date { + @extend .time; + } + } + } + .container { + .audio { + margin-top: 32rpx; + padding-bottom: 20rpx; + } + .mp-html { + margin-top: 32rpx; + } + } + } + .animate { + position: fixed; + z-index: 1; + left:1000000px; + bottom: calc(env(safe-area-inset-bottom) + 80rpx); + transform: translateX(-50%); + width: 200rpx; + height: 400rpx; + &.active { + left: 50%; + } + } + .footer { + position: fixed; + bottom: 0; + left: 0; + width: 100%; + padding: 26rpx 50rpx calc(env(safe-area-inset-bottom) + 26rpx); + display: flex; + justify-content: space-between; + align-items: center; + box-sizing: border-box; + box-shadow: 0rpx 8rpx 20rpx 0rpx rgba(0, 0, 0, 0.26); + background-color: #fff; + .f-item { + display: flex; + align-items: center; + font-size: 30rpx; + color: #e04775; + margin: 0; + padding: 0; + background: transparent; + &::after { + display: none; + outline: none; + } + .icon { + margin-right: 6rpx; + width: 44rpx; + height: 44rpx; + } + .icon-active { + @extend .icon; + display: none; + } + &.active { + color: #e04775; + .icon { + display: none; + } + .icon-active { + display: block; + } + } + } + .button { + margin: 0; + padding: 0; + background-color: transparent; + &::after { + border: none; + outline: none; + } + } + .vertical { + width: 3rpx; + height: 28rpx; + background-color: #f3f3f4; + } + } +} diff --git a/src/pages/publishStoryDetail/index.ts b/src/pages/publishStoryDetail/index.ts new file mode 100644 index 0000000..dd82d38 --- /dev/null +++ b/src/pages/publishStoryDetail/index.ts @@ -0,0 +1,198 @@ +const app = getApp() + +Page({ + data: { + id: '', + CateId: '', + index: 0 as string | number, + detail: {} as any, + + alertPending: false, + starShow: false, + + asideOut: false, + asideType: '2', + timeToast: false, + timeToastType: '', + timeToastParams: { + rewardScore: 0, + }, + + starLock: false, + shareLock: false, + sendShare: false, + }, + + onLoad(options) { + console.log('options: ', options) + const { id } = options + this.setData({ + id, + }) + app.waitLogin().then(() => { + this.getInfoDetail(id) + this.handleView(id) + }) + this.handleTimeOut() + }, + onShow() { + app.mpBehavior({ PageName: 'PG_PATIENTSTORYDETAILS' }) + if (this.data.sendShare) { + this.setData({ + sendShare: false, + timeToastType: '4', + }) + this.handleTimeOut() + } + }, + getInfoDetail(id, star = false) { + wx.ajax({ + method: 'GET', + url: '?r=igg4/story/story-info', + data: { + Id: id, + }, + }).then(async (res) => { + res.Content = await this.formatVideo(res.Content) + let asideOut = false + if (res.CanGetScore) { + asideOut = true + } + this.setData({ + detail: res, + }) + if (!star) { + this.setData({ + asideOut, + }) + } + }) + }, + formatVideo(Content) { + return new Promise((reslove) => { + const query = wx.createSelectorQuery() + query + .select('#mp-html') + .boundingClientRect((rect) => { + const mpWidth = rect.width + const reg = /]*)width="(.*?)".*?height="(.*?)".*?>/g + Content = Content.replace(reg, (match, otherAttributes, width, height) => { + if (!isNaN(Number(width)) && !isNaN(Number(height))) { + return `