From 653892eb8ba0b7113df2969a12d1b4e5c900ab4f Mon Sep 17 00:00:00 2001 From: xiaoheiiskinder <11674173+xiaohei102908@user.noreply.gitee.com> Date: Sat, 28 Oct 2023 09:13:10 +0800 Subject: [PATCH] 1028 --- .eslintrc.js | 31 + api/all.js | 25 + api/index.js | 0 app.js | 166 + app.json | 107 + app.wxss | 160 + components/Uploader/Uploader.js | 35 + components/Uploader/Uploader.json | 6 + components/Uploader/Uploader.wxml | 8 + components/Uploader/Uploader.wxss | 26 + components/dist/action-sheet/index.d.ts | 1 + components/dist/action-sheet/index.js | 70 + components/dist/action-sheet/index.json | 8 + components/dist/action-sheet/index.wxml | 69 + components/dist/action-sheet/index.wxss | 1 + components/dist/area/index.d.ts | 1 + components/dist/area/index.js | 217 + components/dist/area/index.json | 6 + components/dist/area/index.wxml | 20 + components/dist/area/index.wxs | 8 + components/dist/area/index.wxss | 1 + components/dist/button/index.d.ts | 1 + components/dist/button/index.js | 64 + components/dist/button/index.json | 7 + components/dist/button/index.wxml | 53 + components/dist/button/index.wxs | 39 + components/dist/button/index.wxss | 1 + components/dist/calendar/calendar.wxml | 68 + .../dist/calendar/components/header/index.d.ts | 1 + .../dist/calendar/components/header/index.js | 37 + .../dist/calendar/components/header/index.json | 3 + .../dist/calendar/components/header/index.wxml | 16 + .../dist/calendar/components/header/index.wxss | 1 + .../dist/calendar/components/month/index.d.ts | 6 + components/dist/calendar/components/month/index.js | 154 + .../dist/calendar/components/month/index.json | 3 + .../dist/calendar/components/month/index.wxml | 39 + .../dist/calendar/components/month/index.wxs | 71 + .../dist/calendar/components/month/index.wxss | 1 + components/dist/calendar/index.d.ts | 1 + components/dist/calendar/index.js | 337 + components/dist/calendar/index.json | 10 + components/dist/calendar/index.wxml | 25 + components/dist/calendar/index.wxs | 37 + components/dist/calendar/index.wxss | 1 + components/dist/calendar/utils.d.ts | 12 + components/dist/calendar/utils.js | 83 + components/dist/calendar/utils.wxs | 25 + components/dist/card/index.d.ts | 1 + components/dist/card/index.js | 49 + components/dist/card/index.json | 6 + components/dist/card/index.wxml | 56 + components/dist/card/index.wxss | 1 + components/dist/cell-group/index.d.ts | 1 + components/dist/cell-group/index.js | 11 + components/dist/cell-group/index.json | 3 + components/dist/cell-group/index.wxml | 11 + components/dist/cell-group/index.wxss | 1 + components/dist/cell/index.d.ts | 1 + components/dist/cell/index.js | 38 + components/dist/cell/index.json | 6 + components/dist/cell/index.wxml | 47 + components/dist/cell/index.wxs | 17 + components/dist/cell/index.wxss | 1 + components/dist/checkbox-group/index.d.ts | 1 + components/dist/checkbox-group/index.js | 36 + components/dist/checkbox-group/index.json | 3 + components/dist/checkbox-group/index.wxml | 5 + components/dist/checkbox-group/index.wxss | 1 + components/dist/checkbox/index.d.ts | 1 + components/dist/checkbox/index.js | 77 + components/dist/checkbox/index.json | 6 + components/dist/checkbox/index.wxml | 31 + components/dist/checkbox/index.wxs | 20 + components/dist/checkbox/index.wxss | 1 + components/dist/circle/canvas.d.ts | 4 + components/dist/circle/canvas.js | 43 + components/dist/circle/index.d.ts | 1 + components/dist/circle/index.js | 193 + components/dist/circle/index.json | 3 + components/dist/circle/index.wxml | 9 + components/dist/circle/index.wxss | 1 + components/dist/col/index.d.ts | 1 + components/dist/col/index.js | 9 + components/dist/col/index.json | 3 + components/dist/col/index.wxml | 9 + components/dist/col/index.wxs | 18 + components/dist/col/index.wxss | 1 + components/dist/collapse-item/animate.d.ts | 2 + components/dist/collapse-item/animate.js | 39 + components/dist/collapse-item/index.d.ts | 1 + components/dist/collapse-item/index.js | 59 + components/dist/collapse-item/index.json | 6 + components/dist/collapse-item/index.wxml | 44 + components/dist/collapse-item/index.wxss | 1 + components/dist/collapse/index.d.ts | 1 + components/dist/collapse/index.js | 46 + components/dist/collapse/index.json | 3 + components/dist/collapse/index.wxml | 3 + components/dist/collapse/index.wxss | 1 + components/dist/common/color.d.ts | 7 + components/dist/common/color.js | 7 + components/dist/common/component.d.ts | 4 + components/dist/common/component.js | 45 + components/dist/common/index.wxss | 1 + components/dist/common/relation.d.ts | 15 + components/dist/common/relation.js | 56 + components/dist/common/style/clearfix.wxss | 1 + components/dist/common/style/ellipsis.wxss | 1 + components/dist/common/style/hairline.wxss | 1 + components/dist/common/style/mixins/clearfix.wxss | 0 components/dist/common/style/mixins/ellipsis.wxss | 0 components/dist/common/style/mixins/hairline.wxss | 0 components/dist/common/style/var.wxss | 0 components/dist/common/utils.d.ts | 13 + components/dist/common/utils.js | 92 + components/dist/common/validator.d.ts | 9 + components/dist/common/validator.js | 31 + components/dist/common/version.d.ts | 7 + components/dist/common/version.js | 48 + components/dist/config-provider/index.d.ts | 1 + components/dist/config-provider/index.js | 9 + components/dist/config-provider/index.json | 3 + components/dist/config-provider/index.wxml | 5 + components/dist/config-provider/index.wxs | 29 + components/dist/count-down/index.d.ts | 1 + components/dist/count-down/index.js | 100 + components/dist/count-down/index.json | 3 + components/dist/count-down/index.wxml | 4 + components/dist/count-down/index.wxss | 1 + components/dist/count-down/utils.d.ts | 10 + components/dist/count-down/utils.js | 57 + components/dist/datetime-picker/index.d.ts | 1 + components/dist/datetime-picker/index.js | 295 + components/dist/datetime-picker/index.json | 6 + components/dist/datetime-picker/index.wxml | 16 + components/dist/datetime-picker/index.wxss | 1 + components/dist/definitions/index.d.ts | 27 + components/dist/definitions/index.js | 1 + components/dist/dialog/dialog.d.ts | 50 + components/dist/dialog/dialog.js | 75 + components/dist/dialog/index.d.ts | 1 + components/dist/dialog/index.js | 122 + components/dist/dialog/index.json | 9 + components/dist/dialog/index.wxml | 113 + components/dist/dialog/index.wxss | 1 + components/dist/divider/index.d.ts | 1 + components/dist/divider/index.js | 12 + components/dist/divider/index.json | 4 + components/dist/divider/index.wxml | 9 + components/dist/divider/index.wxs | 18 + components/dist/divider/index.wxss | 1 + components/dist/dropdown-item/index.d.ts | 1 + components/dist/dropdown-item/index.js | 102 + components/dist/dropdown-item/index.json | 8 + components/dist/dropdown-item/index.wxml | 48 + components/dist/dropdown-item/index.wxss | 1 + components/dist/dropdown-item/shared.d.ts | 5 + components/dist/dropdown-item/shared.js | 1 + components/dist/dropdown-menu/index.d.ts | 1 + components/dist/dropdown-menu/index.js | 112 + components/dist/dropdown-menu/index.json | 3 + components/dist/dropdown-menu/index.wxml | 23 + components/dist/dropdown-menu/index.wxs | 16 + components/dist/dropdown-menu/index.wxss | 1 + components/dist/empty/index.d.ts | 1 + components/dist/empty/index.js | 10 + components/dist/empty/index.json | 4 + components/dist/empty/index.wxml | 22 + components/dist/empty/index.wxs | 14 + components/dist/empty/index.wxss | 1 + components/dist/field/index.d.ts | 1 + components/dist/field/index.js | 107 + components/dist/field/index.json | 7 + components/dist/field/index.wxml | 56 + components/dist/field/index.wxs | 18 + components/dist/field/index.wxss | 1 + components/dist/field/input.wxml | 28 + components/dist/field/props.d.ts | 4 + components/dist/field/props.js | 64 + components/dist/field/textarea.wxml | 29 + components/dist/goods-action-button/index.d.ts | 1 + components/dist/goods-action-button/index.js | 36 + components/dist/goods-action-button/index.json | 6 + components/dist/goods-action-button/index.wxml | 30 + components/dist/goods-action-button/index.wxss | 1 + components/dist/goods-action-icon/index.d.ts | 1 + components/dist/goods-action-icon/index.js | 21 + components/dist/goods-action-icon/index.json | 7 + components/dist/goods-action-icon/index.wxml | 35 + components/dist/goods-action-icon/index.wxss | 1 + components/dist/goods-action/index.d.ts | 1 + components/dist/goods-action/index.js | 15 + components/dist/goods-action/index.json | 3 + components/dist/goods-action/index.wxml | 5 + components/dist/goods-action/index.wxss | 1 + components/dist/grid-item/index.d.ts | 1 + components/dist/grid-item/index.js | 52 + components/dist/grid-item/index.json | 6 + components/dist/grid-item/index.wxml | 27 + components/dist/grid-item/index.wxs | 32 + components/dist/grid-item/index.wxss | 1 + components/dist/grid/index.d.ts | 1 + components/dist/grid/index.js | 55 + components/dist/grid/index.json | 3 + components/dist/grid/index.wxml | 8 + components/dist/grid/index.wxs | 13 + components/dist/grid/index.wxss | 1 + components/dist/icon/index.d.ts | 1 + components/dist/icon/index.js | 20 + components/dist/icon/index.json | 6 + components/dist/icon/index.wxml | 20 + components/dist/icon/index.wxs | 39 + components/dist/icon/index.wxss | 1 + components/dist/image/index.d.ts | 1 + components/dist/image/index.js | 60 + components/dist/image/index.json | 7 + components/dist/image/index.wxml | 34 + components/dist/image/index.wxs | 32 + components/dist/image/index.wxss | 1 + components/dist/index-anchor/index.d.ts | 1 + components/dist/index-anchor/index.js | 25 + components/dist/index-anchor/index.json | 3 + components/dist/index-anchor/index.wxml | 14 + components/dist/index-anchor/index.wxss | 1 + components/dist/index-bar/index.d.ts | 1 + components/dist/index-bar/index.js | 243 + components/dist/index-bar/index.json | 3 + components/dist/index-bar/index.wxml | 22 + components/dist/index-bar/index.wxss | 1 + components/dist/info/index.d.ts | 1 + components/dist/info/index.js | 8 + components/dist/info/index.json | 3 + components/dist/info/index.wxml | 7 + components/dist/info/index.wxss | 1 + components/dist/loading/index.d.ts | 1 + components/dist/loading/index.js | 16 + components/dist/loading/index.json | 3 + components/dist/loading/index.wxml | 19 + components/dist/loading/index.wxs | 22 + components/dist/loading/index.wxss | 1 + components/dist/mixins/basic.d.ts | 1 + components/dist/mixins/basic.js | 11 + components/dist/mixins/button.d.ts | 1 + components/dist/mixins/button.js | 41 + components/dist/mixins/link.d.ts | 1 + components/dist/mixins/link.js | 23 + components/dist/mixins/page-scroll.d.ts | 5 + components/dist/mixins/page-scroll.js | 33 + components/dist/mixins/touch.d.ts | 1 + components/dist/mixins/touch.js | 37 + components/dist/mixins/transition.d.ts | 1 + components/dist/mixins/transition.js | 115 + components/dist/nav-bar/index.d.ts | 1 + components/dist/nav-bar/index.js | 65 + components/dist/nav-bar/index.json | 6 + components/dist/nav-bar/index.wxml | 42 + components/dist/nav-bar/index.wxs | 13 + components/dist/nav-bar/index.wxss | 1 + components/dist/notice-bar/index.d.ts | 1 + components/dist/notice-bar/index.js | 120 + components/dist/notice-bar/index.json | 6 + components/dist/notice-bar/index.wxml | 39 + components/dist/notice-bar/index.wxs | 15 + components/dist/notice-bar/index.wxss | 1 + components/dist/notify/index.d.ts | 1 + components/dist/notify/index.js | 65 + components/dist/notify/index.json | 6 + components/dist/notify/index.wxml | 21 + components/dist/notify/index.wxs | 22 + components/dist/notify/index.wxss | 1 + components/dist/notify/notify.d.ts | 20 + components/dist/notify/notify.js | 46 + components/dist/overlay/index.d.ts | 1 + components/dist/overlay/index.js | 26 + components/dist/overlay/index.json | 6 + components/dist/overlay/index.wxml | 21 + components/dist/overlay/index.wxss | 1 + components/dist/panel/index.d.ts | 1 + components/dist/panel/index.js | 9 + components/dist/panel/index.json | 6 + components/dist/panel/index.wxml | 19 + components/dist/panel/index.wxss | 1 + components/dist/picker-column/index.d.ts | 1 + components/dist/picker-column/index.js | 118 + components/dist/picker-column/index.json | 3 + components/dist/picker-column/index.wxml | 23 + components/dist/picker-column/index.wxs | 36 + components/dist/picker-column/index.wxss | 1 + components/dist/picker/index.d.ts | 1 + components/dist/picker/index.js | 136 + components/dist/picker/index.json | 7 + components/dist/picker/index.wxml | 37 + components/dist/picker/index.wxs | 42 + components/dist/picker/index.wxss | 1 + components/dist/picker/shared.d.ts | 21 + components/dist/picker/shared.js | 21 + components/dist/picker/toolbar.wxml | 23 + components/dist/popup/index.d.ts | 1 + components/dist/popup/index.js | 89 + components/dist/popup/index.json | 7 + components/dist/popup/index.wxml | 26 + components/dist/popup/index.wxs | 18 + components/dist/popup/index.wxss | 1 + components/dist/progress/index.d.ts | 1 + components/dist/progress/index.js | 51 + components/dist/progress/index.json | 3 + components/dist/progress/index.wxml | 20 + components/dist/progress/index.wxs | 36 + components/dist/progress/index.wxss | 1 + components/dist/radio-group/index.d.ts | 1 + components/dist/radio-group/index.js | 22 + components/dist/radio-group/index.json | 3 + components/dist/radio-group/index.wxml | 5 + components/dist/radio-group/index.wxss | 1 + components/dist/radio/index.d.ts | 1 + components/dist/radio/index.js | 66 + components/dist/radio/index.json | 6 + components/dist/radio/index.wxml | 30 + components/dist/radio/index.wxs | 33 + components/dist/radio/index.wxss | 1 + components/dist/rate/index.d.ts | 1 + components/dist/rate/index.js | 78 + components/dist/rate/index.json | 6 + components/dist/rate/index.wxml | 35 + components/dist/rate/index.wxss | 1 + components/dist/row/index.d.ts | 1 + components/dist/row/index.js | 23 + components/dist/row/index.json | 3 + components/dist/row/index.wxml | 5 + components/dist/row/index.wxs | 18 + components/dist/row/index.wxss | 1 + components/dist/search/index.d.ts | 1 + components/dist/search/index.js | 89 + components/dist/search/index.json | 6 + components/dist/search/index.wxml | 53 + components/dist/search/index.wxss | 1 + components/dist/share-sheet/index.d.ts | 1 + components/dist/share-sheet/index.js | 55 + components/dist/share-sheet/index.json | 7 + components/dist/share-sheet/index.wxml | 46 + components/dist/share-sheet/index.wxs | 12 + components/dist/share-sheet/index.wxss | 1 + components/dist/share-sheet/options.d.ts | 1 + components/dist/share-sheet/options.js | 14 + components/dist/share-sheet/options.json | 3 + components/dist/share-sheet/options.wxml | 20 + components/dist/share-sheet/options.wxs | 14 + components/dist/share-sheet/options.wxss | 1 + components/dist/sidebar-item/index.d.ts | 1 + components/dist/sidebar-item/index.js | 29 + components/dist/sidebar-item/index.json | 6 + components/dist/sidebar-item/index.wxml | 18 + components/dist/sidebar-item/index.wxss | 1 + components/dist/sidebar/index.d.ts | 1 + components/dist/sidebar/index.js | 34 + components/dist/sidebar/index.json | 3 + components/dist/sidebar/index.wxml | 3 + components/dist/sidebar/index.wxss | 1 + components/dist/skeleton/index.d.ts | 1 + components/dist/skeleton/index.js | 46 + components/dist/skeleton/index.json | 4 + components/dist/skeleton/index.wxml | 29 + components/dist/skeleton/index.wxss | 1 + components/dist/slider/index.d.ts | 1 + components/dist/slider/index.js | 191 + components/dist/slider/index.json | 3 + components/dist/slider/index.wxml | 68 + components/dist/slider/index.wxs | 14 + components/dist/slider/index.wxss | 1 + components/dist/stepper/index.d.ts | 1 + components/dist/stepper/index.js | 184 + components/dist/stepper/index.json | 3 + components/dist/stepper/index.wxml | 42 + components/dist/stepper/index.wxs | 22 + components/dist/stepper/index.wxss | 1 + components/dist/steps/index.d.ts | 1 + components/dist/steps/index.js | 33 + components/dist/steps/index.json | 6 + components/dist/steps/index.wxml | 54 + components/dist/steps/index.wxss | 1 + components/dist/sticky/index.d.ts | 1 + components/dist/sticky/index.js | 118 + components/dist/sticky/index.json | 3 + components/dist/sticky/index.wxml | 8 + components/dist/sticky/index.wxs | 25 + components/dist/sticky/index.wxss | 1 + components/dist/submit-bar/index.d.ts | 1 + components/dist/submit-bar/index.js | 56 + components/dist/submit-bar/index.json | 7 + components/dist/submit-bar/index.wxml | 44 + components/dist/submit-bar/index.wxss | 1 + components/dist/swipe-cell/index.d.ts | 1 + components/dist/swipe-cell/index.js | 133 + components/dist/swipe-cell/index.json | 3 + components/dist/swipe-cell/index.wxml | 20 + components/dist/swipe-cell/index.wxss | 1 + components/dist/switch/index.d.ts | 1 + components/dist/switch/index.js | 36 + components/dist/switch/index.json | 6 + components/dist/switch/index.wxml | 16 + components/dist/switch/index.wxs | 26 + components/dist/switch/index.wxss | 1 + components/dist/tab/index.d.ts | 1 + components/dist/tab/index.js | 56 + components/dist/tab/index.json | 3 + components/dist/tab/index.wxml | 8 + components/dist/tab/index.wxss | 1 + components/dist/tabbar-item/index.d.ts | 1 + components/dist/tabbar-item/index.js | 56 + components/dist/tabbar-item/index.json | 7 + components/dist/tabbar-item/index.wxml | 28 + components/dist/tabbar-item/index.wxss | 1 + components/dist/tabbar/index.d.ts | 1 + components/dist/tabbar/index.js | 65 + components/dist/tabbar/index.json | 3 + components/dist/tabbar/index.wxml | 10 + components/dist/tabbar/index.wxss | 1 + components/dist/tabs/index.d.ts | 1 + components/dist/tabs/index.js | 269 + components/dist/tabs/index.json | 7 + components/dist/tabs/index.wxml | 63 + components/dist/tabs/index.wxs | 82 + components/dist/tabs/index.wxss | 1 + components/dist/tag/index.d.ts | 1 + components/dist/tag/index.js | 21 + components/dist/tag/index.json | 6 + components/dist/tag/index.wxml | 15 + components/dist/tag/index.wxs | 13 + components/dist/tag/index.wxss | 1 + components/dist/toast/index.d.ts | 1 + components/dist/toast/index.js | 29 + components/dist/toast/index.json | 9 + components/dist/toast/index.wxml | 36 + components/dist/toast/index.wxss | 1 + components/dist/toast/toast.d.ts | 26 + components/dist/toast/toast.js | 66 + components/dist/transition/index.d.ts | 1 + components/dist/transition/index.js | 13 + components/dist/transition/index.json | 3 + components/dist/transition/index.wxml | 10 + components/dist/transition/index.wxs | 17 + components/dist/transition/index.wxss | 1 + components/dist/tree-select/index.d.ts | 1 + components/dist/tree-select/index.js | 68 + components/dist/tree-select/index.json | 8 + components/dist/tree-select/index.wxml | 41 + components/dist/tree-select/index.wxs | 12 + components/dist/tree-select/index.wxss | 1 + components/dist/uploader/index.d.ts | 1 + components/dist/uploader/index.js | 155 + components/dist/uploader/index.json | 7 + components/dist/uploader/index.wxml | 83 + components/dist/uploader/index.wxs | 14 + components/dist/uploader/index.wxss | 1 + components/dist/uploader/shared.d.ts | 28 + components/dist/uploader/shared.js | 30 + components/dist/uploader/utils.d.ts | 22 + components/dist/uploader/utils.js | 84 + components/dist/wxs/add-unit.wxs | 12 + components/dist/wxs/array.wxs | 5 + components/dist/wxs/bem.wxs | 39 + components/dist/wxs/memoize.wxs | 55 + components/dist/wxs/object.wxs | 13 + components/dist/wxs/style.wxs | 42 + components/dist/wxs/utils.wxs | 10 + components/eventemitter2/index.js | 800 ++ components/eventemitter2/index.js.map | 1 + components/loading/index.js | 34 + components/loading/index.json | 5 + components/loading/index.wxml | 114 + components/loading/index.wxss | 634 ++ components/tree/index.js | 75 + components/tree/index.json | 6 + components/tree/index.wxml | 24 + components/tree/index.wxss | 59 + components/tree1/index.js | 104 + components/tree1/index.json | 6 + components/tree1/index.wxml | 24 + components/tree1/index.wxss | 59 + config.js | 13 + js_sdk/jsencrypt-Rsa/jsencrypt/jsencrypt.min.js | 4 + js_sdk/jsencrypt-Rsa/jsencrypt/jsencrypt.vue | 88 + miniprogram_npm/charenc/index.js | 46 + miniprogram_npm/charenc/index.js.map | 1 + miniprogram_npm/crypt/index.js | 109 + miniprogram_npm/crypt/index.js.map | 1 + miniprogram_npm/crypto-js/index.js | 6879 +++++++++++++++++ miniprogram_npm/crypto-js/index.js.map | 1 + miniprogram_npm/is-buffer/index.js | 34 + miniprogram_npm/is-buffer/index.js.map | 1 + miniprogram_npm/md5/index.js | 173 + miniprogram_npm/md5/index.js.map | 1 + miniprogram_npm/pako/index.js | 6726 ++++++++++++++++ miniprogram_npm/pako/index.js.map | 1 + node_modules/charenc/LICENSE.mkd | 27 + node_modules/charenc/README.js | 1 + node_modules/charenc/charenc.js | 33 + node_modules/charenc/package.json | 54 + node_modules/crypt/LICENSE.mkd | 27 + node_modules/crypt/README.mkd | 1 + node_modules/crypt/crypt.js | 96 + node_modules/crypt/package.json | 52 + node_modules/crypto-js/CONTRIBUTING.md | 28 + node_modules/crypto-js/LICENSE | 24 + node_modules/crypto-js/README.md | 261 + node_modules/crypto-js/aes.js | 234 + node_modules/crypto-js/bower.json | 39 + node_modules/crypto-js/cipher-core.js | 890 +++ node_modules/crypto-js/core.js | 807 ++ node_modules/crypto-js/crypto-js.js | 6191 +++++++++++++++ node_modules/crypto-js/docs/QuickStartGuide.wiki | 470 ++ node_modules/crypto-js/enc-base64.js | 136 + node_modules/crypto-js/enc-base64url.js | 140 + node_modules/crypto-js/enc-hex.js | 18 + node_modules/crypto-js/enc-latin1.js | 18 + node_modules/crypto-js/enc-utf16.js | 149 + node_modules/crypto-js/enc-utf8.js | 18 + node_modules/crypto-js/evpkdf.js | 134 + node_modules/crypto-js/format-hex.js | 66 + node_modules/crypto-js/format-openssl.js | 18 + node_modules/crypto-js/hmac-md5.js | 18 + node_modules/crypto-js/hmac-ripemd160.js | 18 + node_modules/crypto-js/hmac-sha1.js | 18 + node_modules/crypto-js/hmac-sha224.js | 18 + node_modules/crypto-js/hmac-sha256.js | 18 + node_modules/crypto-js/hmac-sha3.js | 18 + node_modules/crypto-js/hmac-sha384.js | 18 + node_modules/crypto-js/hmac-sha512.js | 18 + node_modules/crypto-js/hmac.js | 143 + node_modules/crypto-js/index.js | 18 + node_modules/crypto-js/lib-typedarrays.js | 76 + node_modules/crypto-js/md5.js | 268 + node_modules/crypto-js/mode-cfb.js | 80 + node_modules/crypto-js/mode-ctr-gladman.js | 116 + node_modules/crypto-js/mode-ctr.js | 58 + node_modules/crypto-js/mode-ecb.js | 40 + node_modules/crypto-js/mode-ofb.js | 54 + node_modules/crypto-js/package.json | 71 + node_modules/crypto-js/pad-ansix923.js | 49 + node_modules/crypto-js/pad-iso10126.js | 44 + node_modules/crypto-js/pad-iso97971.js | 40 + node_modules/crypto-js/pad-nopadding.js | 30 + node_modules/crypto-js/pad-pkcs7.js | 18 + node_modules/crypto-js/pad-zeropadding.js | 47 + node_modules/crypto-js/pbkdf2.js | 145 + node_modules/crypto-js/rabbit-legacy.js | 190 + node_modules/crypto-js/rabbit.js | 192 + node_modules/crypto-js/rc4.js | 139 + node_modules/crypto-js/ripemd160.js | 267 + node_modules/crypto-js/sha1.js | 150 + node_modules/crypto-js/sha224.js | 80 + node_modules/crypto-js/sha256.js | 199 + node_modules/crypto-js/sha3.js | 326 + node_modules/crypto-js/sha384.js | 83 + node_modules/crypto-js/sha512.js | 326 + node_modules/crypto-js/tripledes.js | 779 ++ node_modules/crypto-js/x64-core.js | 304 + node_modules/is-buffer/LICENSE | 21 + node_modules/is-buffer/README.md | 53 + node_modules/is-buffer/index.js | 21 + node_modules/is-buffer/package.json | 77 + node_modules/is-buffer/test/basic.js | 24 + node_modules/md5/.travis.yml | 7 + node_modules/md5/LICENSE | 27 + node_modules/md5/README.md | 111 + node_modules/md5/demo/index.html | 48 + node_modules/md5/dist/md5.min.js | 7 + node_modules/md5/md5.js | 160 + node_modules/md5/package.json | 71 + node_modules/md5/test.js | 75 + node_modules/md5/webpack.config.js | 13 + node_modules/pako/CHANGELOG.md | 211 + node_modules/pako/LICENSE | 21 + node_modules/pako/README.md | 177 + node_modules/pako/dist/pako.es5.js | 8027 ++++++++++++++++++++ node_modules/pako/dist/pako.es5.min.js | 2 + node_modules/pako/dist/pako.esm.mjs | 6708 ++++++++++++++++ node_modules/pako/dist/pako.js | 6727 ++++++++++++++++ node_modules/pako/dist/pako.min.js | 2 + node_modules/pako/dist/pako_deflate.es5.js | 4589 +++++++++++ node_modules/pako/dist/pako_deflate.es5.min.js | 2 + node_modules/pako/dist/pako_deflate.js | 3978 ++++++++++ node_modules/pako/dist/pako_deflate.min.js | 2 + node_modules/pako/dist/pako_inflate.es5.js | 3979 ++++++++++ node_modules/pako/dist/pako_inflate.es5.min.js | 2 + node_modules/pako/dist/pako_inflate.js | 3218 ++++++++ node_modules/pako/dist/pako_inflate.min.js | 2 + node_modules/pako/index.js | 18 + node_modules/pako/lib/deflate.js | 380 + node_modules/pako/lib/inflate.js | 419 + node_modules/pako/lib/utils/common.js | 48 + node_modules/pako/lib/utils/strings.js | 174 + node_modules/pako/lib/zlib/README | 59 + node_modules/pako/lib/zlib/adler32.js | 51 + node_modules/pako/lib/zlib/constants.js | 68 + node_modules/pako/lib/zlib/crc32.js | 59 + node_modules/pako/lib/zlib/deflate.js | 1850 +++++ node_modules/pako/lib/zlib/gzheader.js | 58 + node_modules/pako/lib/zlib/inffast.js | 344 + node_modules/pako/lib/zlib/inflate.js | 1547 ++++ node_modules/pako/lib/zlib/inftrees.js | 344 + node_modules/pako/lib/zlib/messages.js | 32 + node_modules/pako/lib/zlib/trees.js | 1229 +++ node_modules/pako/lib/zlib/zstream.js | 47 + node_modules/pako/package.json | 113 + node_modules/qrcode-base64/LICENSE | 21 + node_modules/qrcode-base64/README.md | 32 + node_modules/qrcode-base64/index.js | 1625 ++++ node_modules/qrcode-base64/package.json | 53 + package-lock.json | 48 + package.json | 17 + pages/Bluetooth/Bluetooth.js | 3523 +++++++++ pages/Bluetooth/Bluetooth.json | 5 + pages/Bluetooth/Bluetooth.wxml | 214 + pages/Bluetooth/Bluetooth.wxss | 87 + pages/Bluetooth1/Bluetooth1.js | 552 ++ pages/Bluetooth1/Bluetooth1.json | 5 + pages/Bluetooth1/Bluetooth1.wxml | 59 + pages/Bluetooth1/Bluetooth1.wxss | 16 + pages/addBlueButton/addBlueButton.js | 425 ++ pages/addBlueButton/addBlueButton.json | 3 + pages/addBlueButton/addBlueButton.wxml | 17 + pages/addBlueButton/addBlueButton.wxss | 1 + pages/addperson/addperson.js | 4330 +++++++++++ pages/addperson/addperson.json | 5 + pages/addperson/addperson.wxml | 105 + pages/addperson/addperson.wxss | 51 + pages/bindLock/bindLock.js | 751 ++ pages/bindLock/bindLock.json | 7 + pages/bindLock/bindLock.wxml | 100 + pages/bindLock/bindLock.wxss | 259 + pages/changeLock/changeLock.js | 282 + pages/changeLock/changeLock.json | 3 + pages/changeLock/changeLock.wxml | 8 + pages/changeLock/changeLock.wxss | 4 + pages/config/config.js | 113 + pages/config/config.json | 3 + pages/config/config.wxml | 4 + pages/config/config.wxss | 4 + pages/index/index.js | 634 ++ pages/index/index.json | 8 + pages/index/index.wxml | 56 + pages/index/index.wxss | 107 + pages/indexUser/indexUser.js | 127 + pages/indexUser/indexUser.json | 7 + pages/indexUser/indexUser.wxml | 57 + pages/indexUser/indexUser.wxss | 132 + pages/login/login.js | 307 + pages/login/login.json | 5 + pages/login/login.wxml | 35 + pages/login/login.wxss | 23 + pages/logs/logs.js | 18 + pages/logs/logs.json | 4 + pages/logs/logs.wxml | 6 + pages/logs/logs.wxss | 8 + pages/modelselection/modelselection.js | 102 + pages/modelselection/modelselection.json | 3 + pages/modelselection/modelselection.wxml | 8 + pages/modelselection/modelselection.wxss | 4 + pages/my/my.js | 84 + pages/my/my.json | 3 + pages/my/my.wxml | 83 + pages/my/my.wxss | 122 + pages/openLockLog/openLockLog.js | 479 ++ pages/openLockLog/openLockLog.json | 3 + pages/openLockLog/openLockLog.wxml | 44 + pages/openLockLog/openLockLog.wxss | 22 + pages/paymentInterface/paymentInterface.js | 352 + pages/paymentInterface/paymentInterface.json | 3 + pages/paymentInterface/paymentInterface.wxml | 49 + pages/paymentInterface/paymentInterface.wxss | 59 + pages/permissions/permissions.js | 421 + pages/permissions/permissions.json | 3 + pages/permissions/permissions.wxml | 13 + pages/permissions/permissions.wxss | 10 + pages/personManger/personManger.js | 1232 +++ pages/personManger/personManger.json | 3 + pages/personManger/personManger.wxml | 30 + pages/personManger/personManger.wxss | 12 + pages/register/register.js | 66 + pages/register/register.json | 3 + pages/register/register.wxml | 2 + pages/register/register.wxss | 1 + pages/rentDetail/rentDetail.js | 209 + pages/rentDetail/rentDetail.json | 3 + pages/rentDetail/rentDetail.wxml | 34 + pages/rentDetail/rentDetail.wxss | 83 + pages/rentManagement/rentManagement.js | 399 + pages/rentManagement/rentManagement.json | 5 + pages/rentManagement/rentManagement.wxml | 51 + pages/rentManagement/rentManagement.wxss | 44 + pages/roomDetail/roomDetail.js | 2925 +++++++ pages/roomDetail/roomDetail.json | 4 + pages/roomDetail/roomDetail.wxml | 155 + pages/roomDetail/roomDetail.wxss | 180 + pages/selectPersonnel/selectPersonnel.js | 639 ++ pages/selectPersonnel/selectPersonnel.json | 3 + pages/selectPersonnel/selectPersonnel.wxml | 24 + pages/selectPersonnel/selectPersonnel.wxss | 11 + pages/updateWord/updateWord.js | 181 + pages/updateWord/updateWord.json | 3 + pages/updateWord/updateWord.wxml | 9 + pages/updateWord/updateWord.wxss | 14 + pages/userbluetoothUnlock/userbluetoothUnlock.js | 2106 +++++ pages/userbluetoothUnlock/userbluetoothUnlock.json | 4 + pages/userbluetoothUnlock/userbluetoothUnlock.wxml | 137 + pages/userbluetoothUnlock/userbluetoothUnlock.wxss | 181 + pagesA.zip | Bin 0 -> 3362145 bytes pagesA/activatePayment/activatePayment.js | 211 + pagesA/activatePayment/activatePayment.json | 5 + pagesA/activatePayment/activatePayment.wxml | 209 + pagesA/activatePayment/activatePayment.wxss | 231 + pagesA/faceinfo/faceinfo.js | 126 + pagesA/faceinfo/faceinfo.json | 3 + pagesA/faceinfo/faceinfo.wxml | 50 + pagesA/faceinfo/faceinfo.wxss | 78 + pagesA/facepeople/facepeople.js | 219 + pagesA/facepeople/facepeople.json | 3 + pagesA/facepeople/facepeople.wxml | 56 + pagesA/facepeople/facepeople.wxss | 128 + pagesA/forgetpasswoed/forgetpasswoed.js | 66 + pagesA/forgetpasswoed/forgetpasswoed.json | 3 + pagesA/forgetpasswoed/forgetpasswoed.wxml | 2 + pagesA/forgetpasswoed/forgetpasswoed.wxss | 1 + pagesA/installLock/installLock.js | 66 + pagesA/installLock/installLock.json | 3 + pagesA/installLock/installLock.wxml | 2 + pagesA/installLock/installLock.wxss | 1 + pagesA/newconstructionitem/newconstructionitem.js | 51 + .../newconstructionitem/newconstructionitem.json | 3 + .../newconstructionitem/newconstructionitem.wxml | 2 + .../newconstructionitem/newconstructionitem.wxss | 1 + pagesA/passwordList/passwordList.js | 891 +++ pagesA/passwordList/passwordList.json | 7 + pagesA/passwordList/passwordList.wxml | 43 + pagesA/passwordList/passwordList.wxss | 32 + pagesA/selectFace/selectFace.js | 312 + pagesA/selectFace/selectFace.json | 3 + pagesA/selectFace/selectFace.wxml | 15 + pagesA/selectFace/selectFace.wxss | 105 + pagesA/selectFace1/selectFace.js | 289 + pagesA/selectFace1/selectFace.json | 3 + pagesA/selectFace1/selectFace.wxml | 19 + pagesA/selectFace1/selectFace.wxss | 85 + project.config.json | 81 + project.private.config.json | 53 + sitemap.json | 7 + static/config.json | 1 + static/css/common.wxss | 10 + static/css/iconfont/iconfont.wxss | 191 + static/css/iconfont/iconfont2.wxss | 154 + static/css/iconfont1/iconfont.wxss | 151 + static/home.png | Bin 0 -> 1270 bytes static/home1.png | Bin 0 -> 1206 bytes static/i1.png | Bin 0 -> 1809 bytes static/i2.png | Bin 0 -> 1299 bytes static/i3.png | Bin 0 -> 2295 bytes static/images/bgimg.jpg | Bin 0 -> 67671 bytes static/images/bgimg_1.jpg | Bin 0 -> 70623 bytes static/images/bindlock.png | Bin 0 -> 13750 bytes static/images/head.png | Bin 0 -> 11222 bytes static/images/jihebeijing.png | Bin 0 -> 91478 bytes static/images/loginOut.svg | 1 + static/images/logo.jpg | Bin 0 -> 6601 bytes static/images/logo1.jpg | Bin 0 -> 16913 bytes static/images/qrcode.png | Bin 0 -> 586 bytes static/mix-tree/currentIcon.png | Bin 0 -> 1600 bytes static/mix-tree/defaultIcon.png | Bin 0 -> 588 bytes static/my.png | Bin 0 -> 925 bytes static/my1.png | Bin 0 -> 1463 bytes static/tab-home-current.png | Bin 0 -> 4063 bytes static/tab-home.png | Bin 0 -> 3966 bytes static/u1490.svg | 6 + utils/ICINPakage/ICINLocker.js | 4092 ++++++++++ utils/ICINPakage/ICINLocker_backup.js | 3791 +++++++++ utils/ICINPakage/base64-js.js | 150 + utils/ICINPakage/base64-js/LICENSE | 21 + utils/ICINPakage/base64-js/README.md | 34 + utils/ICINPakage/base64-js/base64js.min.js | 1 + utils/ICINPakage/base64-js/index.d.ts | 3 + utils/ICINPakage/base64-js/package.json | 75 + utils/ICINPakage/buffer.js | 2106 +++++ utils/ICINPakage/buffer/AUTHORS.md | 73 + utils/ICINPakage/buffer/LICENSE | 21 + utils/ICINPakage/buffer/README.md | 410 + utils/ICINPakage/buffer/index.d.ts | 194 + utils/ICINPakage/buffer/package.json | 125 + utils/ICINPakage/crc-index.js | 581 ++ utils/ICINPakage/crc-index.js.map | 1 + utils/ICINPakage/ieee754.js | 85 + utils/ICINPakage/ieee754/LICENSE | 11 + utils/ICINPakage/ieee754/README.md | 51 + utils/ICINPakage/ieee754/index.d.ts | 10 + utils/ICINPakage/ieee754/package.json | 84 + utils/ICINPakage/md5.min.js | 10 + utils/ICINPakage/sm4.js | 422 + utils/IotTask.js | 78 + utils/LWJ.js | 807 ++ utils/base64.js | 129 + utils/bleall.js | 254 + utils/btls/ble.js | 60 + utils/btls/ble1.js | 60 + utils/btls/bleHandler.js | 360 + utils/btls/bleHandler1.js | 320 + utils/btls/error.js | 44 + utils/btls/tools.js | 512 ++ utils/equipment.js | 491 ++ utils/formData.js | 146 + utils/index.js | 1078 +++ utils/jsencrypt.js | 249 + utils/md5.js | 1 + utils/methods.js | 349 + utils/mimeMap.js | 345 + utils/moment.js | 4602 +++++++++++ utils/qrcode-base64/weapp-qrcode.js | 1625 ++++ utils/request.js | 509 ++ utils/url.js | 7 + utils/util.js | 558 ++ utils/util1.js | 387 + 820 files changed, 141034 insertions(+) create mode 100644 .eslintrc.js create mode 100644 api/all.js create mode 100644 api/index.js create mode 100644 app.js create mode 100644 app.json create mode 100644 app.wxss create mode 100644 components/Uploader/Uploader.js create mode 100644 components/Uploader/Uploader.json create mode 100644 components/Uploader/Uploader.wxml create mode 100644 components/Uploader/Uploader.wxss create mode 100644 components/dist/action-sheet/index.d.ts create mode 100644 components/dist/action-sheet/index.js create mode 100644 components/dist/action-sheet/index.json create mode 100644 components/dist/action-sheet/index.wxml create mode 100644 components/dist/action-sheet/index.wxss create mode 100644 components/dist/area/index.d.ts create mode 100644 components/dist/area/index.js create mode 100644 components/dist/area/index.json create mode 100644 components/dist/area/index.wxml create mode 100644 components/dist/area/index.wxs create mode 100644 components/dist/area/index.wxss create mode 100644 components/dist/button/index.d.ts create mode 100644 components/dist/button/index.js create mode 100644 components/dist/button/index.json create mode 100644 components/dist/button/index.wxml create mode 100644 components/dist/button/index.wxs create mode 100644 components/dist/button/index.wxss create mode 100644 components/dist/calendar/calendar.wxml create mode 100644 components/dist/calendar/components/header/index.d.ts create mode 100644 components/dist/calendar/components/header/index.js create mode 100644 components/dist/calendar/components/header/index.json create mode 100644 components/dist/calendar/components/header/index.wxml create mode 100644 components/dist/calendar/components/header/index.wxss create mode 100644 components/dist/calendar/components/month/index.d.ts create mode 100644 components/dist/calendar/components/month/index.js create mode 100644 components/dist/calendar/components/month/index.json create mode 100644 components/dist/calendar/components/month/index.wxml create mode 100644 components/dist/calendar/components/month/index.wxs create mode 100644 components/dist/calendar/components/month/index.wxss create mode 100644 components/dist/calendar/index.d.ts create mode 100644 components/dist/calendar/index.js create mode 100644 components/dist/calendar/index.json create mode 100644 components/dist/calendar/index.wxml create mode 100644 components/dist/calendar/index.wxs create mode 100644 components/dist/calendar/index.wxss create mode 100644 components/dist/calendar/utils.d.ts create mode 100644 components/dist/calendar/utils.js create mode 100644 components/dist/calendar/utils.wxs create mode 100644 components/dist/card/index.d.ts create mode 100644 components/dist/card/index.js create mode 100644 components/dist/card/index.json create mode 100644 components/dist/card/index.wxml create mode 100644 components/dist/card/index.wxss create mode 100644 components/dist/cell-group/index.d.ts create mode 100644 components/dist/cell-group/index.js create mode 100644 components/dist/cell-group/index.json create mode 100644 components/dist/cell-group/index.wxml create mode 100644 components/dist/cell-group/index.wxss create mode 100644 components/dist/cell/index.d.ts create mode 100644 components/dist/cell/index.js create mode 100644 components/dist/cell/index.json create mode 100644 components/dist/cell/index.wxml create mode 100644 components/dist/cell/index.wxs create mode 100644 components/dist/cell/index.wxss create mode 100644 components/dist/checkbox-group/index.d.ts create mode 100644 components/dist/checkbox-group/index.js create mode 100644 components/dist/checkbox-group/index.json create mode 100644 components/dist/checkbox-group/index.wxml create mode 100644 components/dist/checkbox-group/index.wxss create mode 100644 components/dist/checkbox/index.d.ts create mode 100644 components/dist/checkbox/index.js create mode 100644 components/dist/checkbox/index.json create mode 100644 components/dist/checkbox/index.wxml create mode 100644 components/dist/checkbox/index.wxs create mode 100644 components/dist/checkbox/index.wxss create mode 100644 components/dist/circle/canvas.d.ts create mode 100644 components/dist/circle/canvas.js create mode 100644 components/dist/circle/index.d.ts create mode 100644 components/dist/circle/index.js create mode 100644 components/dist/circle/index.json create mode 100644 components/dist/circle/index.wxml create mode 100644 components/dist/circle/index.wxss create mode 100644 components/dist/col/index.d.ts create mode 100644 components/dist/col/index.js create mode 100644 components/dist/col/index.json create mode 100644 components/dist/col/index.wxml create mode 100644 components/dist/col/index.wxs create mode 100644 components/dist/col/index.wxss create mode 100644 components/dist/collapse-item/animate.d.ts create mode 100644 components/dist/collapse-item/animate.js create mode 100644 components/dist/collapse-item/index.d.ts create mode 100644 components/dist/collapse-item/index.js create mode 100644 components/dist/collapse-item/index.json create mode 100644 components/dist/collapse-item/index.wxml create mode 100644 components/dist/collapse-item/index.wxss create mode 100644 components/dist/collapse/index.d.ts create mode 100644 components/dist/collapse/index.js create mode 100644 components/dist/collapse/index.json create mode 100644 components/dist/collapse/index.wxml create mode 100644 components/dist/collapse/index.wxss create mode 100644 components/dist/common/color.d.ts create mode 100644 components/dist/common/color.js create mode 100644 components/dist/common/component.d.ts create mode 100644 components/dist/common/component.js create mode 100644 components/dist/common/index.wxss create mode 100644 components/dist/common/relation.d.ts create mode 100644 components/dist/common/relation.js create mode 100644 components/dist/common/style/clearfix.wxss create mode 100644 components/dist/common/style/ellipsis.wxss create mode 100644 components/dist/common/style/hairline.wxss create mode 100644 components/dist/common/style/mixins/clearfix.wxss create mode 100644 components/dist/common/style/mixins/ellipsis.wxss create mode 100644 components/dist/common/style/mixins/hairline.wxss create mode 100644 components/dist/common/style/var.wxss create mode 100644 components/dist/common/utils.d.ts create mode 100644 components/dist/common/utils.js create mode 100644 components/dist/common/validator.d.ts create mode 100644 components/dist/common/validator.js create mode 100644 components/dist/common/version.d.ts create mode 100644 components/dist/common/version.js create mode 100644 components/dist/config-provider/index.d.ts create mode 100644 components/dist/config-provider/index.js create mode 100644 components/dist/config-provider/index.json create mode 100644 components/dist/config-provider/index.wxml create mode 100644 components/dist/config-provider/index.wxs create mode 100644 components/dist/count-down/index.d.ts create mode 100644 components/dist/count-down/index.js create mode 100644 components/dist/count-down/index.json create mode 100644 components/dist/count-down/index.wxml create mode 100644 components/dist/count-down/index.wxss create mode 100644 components/dist/count-down/utils.d.ts create mode 100644 components/dist/count-down/utils.js create mode 100644 components/dist/datetime-picker/index.d.ts create mode 100644 components/dist/datetime-picker/index.js create mode 100644 components/dist/datetime-picker/index.json create mode 100644 components/dist/datetime-picker/index.wxml create mode 100644 components/dist/datetime-picker/index.wxss create mode 100644 components/dist/definitions/index.d.ts create mode 100644 components/dist/definitions/index.js create mode 100644 components/dist/dialog/dialog.d.ts create mode 100644 components/dist/dialog/dialog.js create mode 100644 components/dist/dialog/index.d.ts create mode 100644 components/dist/dialog/index.js create mode 100644 components/dist/dialog/index.json create mode 100644 components/dist/dialog/index.wxml create mode 100644 components/dist/dialog/index.wxss create mode 100644 components/dist/divider/index.d.ts create mode 100644 components/dist/divider/index.js create mode 100644 components/dist/divider/index.json create mode 100644 components/dist/divider/index.wxml create mode 100644 components/dist/divider/index.wxs create mode 100644 components/dist/divider/index.wxss create mode 100644 components/dist/dropdown-item/index.d.ts create mode 100644 components/dist/dropdown-item/index.js create mode 100644 components/dist/dropdown-item/index.json create mode 100644 components/dist/dropdown-item/index.wxml create mode 100644 components/dist/dropdown-item/index.wxss create mode 100644 components/dist/dropdown-item/shared.d.ts create mode 100644 components/dist/dropdown-item/shared.js create mode 100644 components/dist/dropdown-menu/index.d.ts create mode 100644 components/dist/dropdown-menu/index.js create mode 100644 components/dist/dropdown-menu/index.json create mode 100644 components/dist/dropdown-menu/index.wxml create mode 100644 components/dist/dropdown-menu/index.wxs create mode 100644 components/dist/dropdown-menu/index.wxss create mode 100644 components/dist/empty/index.d.ts create mode 100644 components/dist/empty/index.js create mode 100644 components/dist/empty/index.json create mode 100644 components/dist/empty/index.wxml create mode 100644 components/dist/empty/index.wxs create mode 100644 components/dist/empty/index.wxss create mode 100644 components/dist/field/index.d.ts create mode 100644 components/dist/field/index.js create mode 100644 components/dist/field/index.json create mode 100644 components/dist/field/index.wxml create mode 100644 components/dist/field/index.wxs create mode 100644 components/dist/field/index.wxss create mode 100644 components/dist/field/input.wxml create mode 100644 components/dist/field/props.d.ts create mode 100644 components/dist/field/props.js create mode 100644 components/dist/field/textarea.wxml create mode 100644 components/dist/goods-action-button/index.d.ts create mode 100644 components/dist/goods-action-button/index.js create mode 100644 components/dist/goods-action-button/index.json create mode 100644 components/dist/goods-action-button/index.wxml create mode 100644 components/dist/goods-action-button/index.wxss create mode 100644 components/dist/goods-action-icon/index.d.ts create mode 100644 components/dist/goods-action-icon/index.js create mode 100644 components/dist/goods-action-icon/index.json create mode 100644 components/dist/goods-action-icon/index.wxml create mode 100644 components/dist/goods-action-icon/index.wxss create mode 100644 components/dist/goods-action/index.d.ts create mode 100644 components/dist/goods-action/index.js create mode 100644 components/dist/goods-action/index.json create mode 100644 components/dist/goods-action/index.wxml create mode 100644 components/dist/goods-action/index.wxss create mode 100644 components/dist/grid-item/index.d.ts create mode 100644 components/dist/grid-item/index.js create mode 100644 components/dist/grid-item/index.json create mode 100644 components/dist/grid-item/index.wxml create mode 100644 components/dist/grid-item/index.wxs create mode 100644 components/dist/grid-item/index.wxss create mode 100644 components/dist/grid/index.d.ts create mode 100644 components/dist/grid/index.js create mode 100644 components/dist/grid/index.json create mode 100644 components/dist/grid/index.wxml create mode 100644 components/dist/grid/index.wxs create mode 100644 components/dist/grid/index.wxss create mode 100644 components/dist/icon/index.d.ts create mode 100644 components/dist/icon/index.js create mode 100644 components/dist/icon/index.json create mode 100644 components/dist/icon/index.wxml create mode 100644 components/dist/icon/index.wxs create mode 100644 components/dist/icon/index.wxss create mode 100644 components/dist/image/index.d.ts create mode 100644 components/dist/image/index.js create mode 100644 components/dist/image/index.json create mode 100644 components/dist/image/index.wxml create mode 100644 components/dist/image/index.wxs create mode 100644 components/dist/image/index.wxss create mode 100644 components/dist/index-anchor/index.d.ts create mode 100644 components/dist/index-anchor/index.js create mode 100644 components/dist/index-anchor/index.json create mode 100644 components/dist/index-anchor/index.wxml create mode 100644 components/dist/index-anchor/index.wxss create mode 100644 components/dist/index-bar/index.d.ts create mode 100644 components/dist/index-bar/index.js create mode 100644 components/dist/index-bar/index.json create mode 100644 components/dist/index-bar/index.wxml create mode 100644 components/dist/index-bar/index.wxss create mode 100644 components/dist/info/index.d.ts create mode 100644 components/dist/info/index.js create mode 100644 components/dist/info/index.json create mode 100644 components/dist/info/index.wxml create mode 100644 components/dist/info/index.wxss create mode 100644 components/dist/loading/index.d.ts create mode 100644 components/dist/loading/index.js create mode 100644 components/dist/loading/index.json create mode 100644 components/dist/loading/index.wxml create mode 100644 components/dist/loading/index.wxs create mode 100644 components/dist/loading/index.wxss create mode 100644 components/dist/mixins/basic.d.ts create mode 100644 components/dist/mixins/basic.js create mode 100644 components/dist/mixins/button.d.ts create mode 100644 components/dist/mixins/button.js create mode 100644 components/dist/mixins/link.d.ts create mode 100644 components/dist/mixins/link.js create mode 100644 components/dist/mixins/page-scroll.d.ts create mode 100644 components/dist/mixins/page-scroll.js create mode 100644 components/dist/mixins/touch.d.ts create mode 100644 components/dist/mixins/touch.js create mode 100644 components/dist/mixins/transition.d.ts create mode 100644 components/dist/mixins/transition.js create mode 100644 components/dist/nav-bar/index.d.ts create mode 100644 components/dist/nav-bar/index.js create mode 100644 components/dist/nav-bar/index.json create mode 100644 components/dist/nav-bar/index.wxml create mode 100644 components/dist/nav-bar/index.wxs create mode 100644 components/dist/nav-bar/index.wxss create mode 100644 components/dist/notice-bar/index.d.ts create mode 100644 components/dist/notice-bar/index.js create mode 100644 components/dist/notice-bar/index.json create mode 100644 components/dist/notice-bar/index.wxml create mode 100644 components/dist/notice-bar/index.wxs create mode 100644 components/dist/notice-bar/index.wxss create mode 100644 components/dist/notify/index.d.ts create mode 100644 components/dist/notify/index.js create mode 100644 components/dist/notify/index.json create mode 100644 components/dist/notify/index.wxml create mode 100644 components/dist/notify/index.wxs create mode 100644 components/dist/notify/index.wxss create mode 100644 components/dist/notify/notify.d.ts create mode 100644 components/dist/notify/notify.js create mode 100644 components/dist/overlay/index.d.ts create mode 100644 components/dist/overlay/index.js create mode 100644 components/dist/overlay/index.json create mode 100644 components/dist/overlay/index.wxml create mode 100644 components/dist/overlay/index.wxss create mode 100644 components/dist/panel/index.d.ts create mode 100644 components/dist/panel/index.js create mode 100644 components/dist/panel/index.json create mode 100644 components/dist/panel/index.wxml create mode 100644 components/dist/panel/index.wxss create mode 100644 components/dist/picker-column/index.d.ts create mode 100644 components/dist/picker-column/index.js create mode 100644 components/dist/picker-column/index.json create mode 100644 components/dist/picker-column/index.wxml create mode 100644 components/dist/picker-column/index.wxs create mode 100644 components/dist/picker-column/index.wxss create mode 100644 components/dist/picker/index.d.ts create mode 100644 components/dist/picker/index.js create mode 100644 components/dist/picker/index.json create mode 100644 components/dist/picker/index.wxml create mode 100644 components/dist/picker/index.wxs create mode 100644 components/dist/picker/index.wxss create mode 100644 components/dist/picker/shared.d.ts create mode 100644 components/dist/picker/shared.js create mode 100644 components/dist/picker/toolbar.wxml create mode 100644 components/dist/popup/index.d.ts create mode 100644 components/dist/popup/index.js create mode 100644 components/dist/popup/index.json create mode 100644 components/dist/popup/index.wxml create mode 100644 components/dist/popup/index.wxs create mode 100644 components/dist/popup/index.wxss create mode 100644 components/dist/progress/index.d.ts create mode 100644 components/dist/progress/index.js create mode 100644 components/dist/progress/index.json create mode 100644 components/dist/progress/index.wxml create mode 100644 components/dist/progress/index.wxs create mode 100644 components/dist/progress/index.wxss create mode 100644 components/dist/radio-group/index.d.ts create mode 100644 components/dist/radio-group/index.js create mode 100644 components/dist/radio-group/index.json create mode 100644 components/dist/radio-group/index.wxml create mode 100644 components/dist/radio-group/index.wxss create mode 100644 components/dist/radio/index.d.ts create mode 100644 components/dist/radio/index.js create mode 100644 components/dist/radio/index.json create mode 100644 components/dist/radio/index.wxml create mode 100644 components/dist/radio/index.wxs create mode 100644 components/dist/radio/index.wxss create mode 100644 components/dist/rate/index.d.ts create mode 100644 components/dist/rate/index.js create mode 100644 components/dist/rate/index.json create mode 100644 components/dist/rate/index.wxml create mode 100644 components/dist/rate/index.wxss create mode 100644 components/dist/row/index.d.ts create mode 100644 components/dist/row/index.js create mode 100644 components/dist/row/index.json create mode 100644 components/dist/row/index.wxml create mode 100644 components/dist/row/index.wxs create mode 100644 components/dist/row/index.wxss create mode 100644 components/dist/search/index.d.ts create mode 100644 components/dist/search/index.js create mode 100644 components/dist/search/index.json create mode 100644 components/dist/search/index.wxml create mode 100644 components/dist/search/index.wxss create mode 100644 components/dist/share-sheet/index.d.ts create mode 100644 components/dist/share-sheet/index.js create mode 100644 components/dist/share-sheet/index.json create mode 100644 components/dist/share-sheet/index.wxml create mode 100644 components/dist/share-sheet/index.wxs create mode 100644 components/dist/share-sheet/index.wxss create mode 100644 components/dist/share-sheet/options.d.ts create mode 100644 components/dist/share-sheet/options.js create mode 100644 components/dist/share-sheet/options.json create mode 100644 components/dist/share-sheet/options.wxml create mode 100644 components/dist/share-sheet/options.wxs create mode 100644 components/dist/share-sheet/options.wxss create mode 100644 components/dist/sidebar-item/index.d.ts create mode 100644 components/dist/sidebar-item/index.js create mode 100644 components/dist/sidebar-item/index.json create mode 100644 components/dist/sidebar-item/index.wxml create mode 100644 components/dist/sidebar-item/index.wxss create mode 100644 components/dist/sidebar/index.d.ts create mode 100644 components/dist/sidebar/index.js create mode 100644 components/dist/sidebar/index.json create mode 100644 components/dist/sidebar/index.wxml create mode 100644 components/dist/sidebar/index.wxss create mode 100644 components/dist/skeleton/index.d.ts create mode 100644 components/dist/skeleton/index.js create mode 100644 components/dist/skeleton/index.json create mode 100644 components/dist/skeleton/index.wxml create mode 100644 components/dist/skeleton/index.wxss create mode 100644 components/dist/slider/index.d.ts create mode 100644 components/dist/slider/index.js create mode 100644 components/dist/slider/index.json create mode 100644 components/dist/slider/index.wxml create mode 100644 components/dist/slider/index.wxs create mode 100644 components/dist/slider/index.wxss create mode 100644 components/dist/stepper/index.d.ts create mode 100644 components/dist/stepper/index.js create mode 100644 components/dist/stepper/index.json create mode 100644 components/dist/stepper/index.wxml create mode 100644 components/dist/stepper/index.wxs create mode 100644 components/dist/stepper/index.wxss create mode 100644 components/dist/steps/index.d.ts create mode 100644 components/dist/steps/index.js create mode 100644 components/dist/steps/index.json create mode 100644 components/dist/steps/index.wxml create mode 100644 components/dist/steps/index.wxss create mode 100644 components/dist/sticky/index.d.ts create mode 100644 components/dist/sticky/index.js create mode 100644 components/dist/sticky/index.json create mode 100644 components/dist/sticky/index.wxml create mode 100644 components/dist/sticky/index.wxs create mode 100644 components/dist/sticky/index.wxss create mode 100644 components/dist/submit-bar/index.d.ts create mode 100644 components/dist/submit-bar/index.js create mode 100644 components/dist/submit-bar/index.json create mode 100644 components/dist/submit-bar/index.wxml create mode 100644 components/dist/submit-bar/index.wxss create mode 100644 components/dist/swipe-cell/index.d.ts create mode 100644 components/dist/swipe-cell/index.js create mode 100644 components/dist/swipe-cell/index.json create mode 100644 components/dist/swipe-cell/index.wxml create mode 100644 components/dist/swipe-cell/index.wxss create mode 100644 components/dist/switch/index.d.ts create mode 100644 components/dist/switch/index.js create mode 100644 components/dist/switch/index.json create mode 100644 components/dist/switch/index.wxml create mode 100644 components/dist/switch/index.wxs create mode 100644 components/dist/switch/index.wxss create mode 100644 components/dist/tab/index.d.ts create mode 100644 components/dist/tab/index.js create mode 100644 components/dist/tab/index.json create mode 100644 components/dist/tab/index.wxml create mode 100644 components/dist/tab/index.wxss create mode 100644 components/dist/tabbar-item/index.d.ts create mode 100644 components/dist/tabbar-item/index.js create mode 100644 components/dist/tabbar-item/index.json create mode 100644 components/dist/tabbar-item/index.wxml create mode 100644 components/dist/tabbar-item/index.wxss create mode 100644 components/dist/tabbar/index.d.ts create mode 100644 components/dist/tabbar/index.js create mode 100644 components/dist/tabbar/index.json create mode 100644 components/dist/tabbar/index.wxml create mode 100644 components/dist/tabbar/index.wxss create mode 100644 components/dist/tabs/index.d.ts create mode 100644 components/dist/tabs/index.js create mode 100644 components/dist/tabs/index.json create mode 100644 components/dist/tabs/index.wxml create mode 100644 components/dist/tabs/index.wxs create mode 100644 components/dist/tabs/index.wxss create mode 100644 components/dist/tag/index.d.ts create mode 100644 components/dist/tag/index.js create mode 100644 components/dist/tag/index.json create mode 100644 components/dist/tag/index.wxml create mode 100644 components/dist/tag/index.wxs create mode 100644 components/dist/tag/index.wxss create mode 100644 components/dist/toast/index.d.ts create mode 100644 components/dist/toast/index.js create mode 100644 components/dist/toast/index.json create mode 100644 components/dist/toast/index.wxml create mode 100644 components/dist/toast/index.wxss create mode 100644 components/dist/toast/toast.d.ts create mode 100644 components/dist/toast/toast.js create mode 100644 components/dist/transition/index.d.ts create mode 100644 components/dist/transition/index.js create mode 100644 components/dist/transition/index.json create mode 100644 components/dist/transition/index.wxml create mode 100644 components/dist/transition/index.wxs create mode 100644 components/dist/transition/index.wxss create mode 100644 components/dist/tree-select/index.d.ts create mode 100644 components/dist/tree-select/index.js create mode 100644 components/dist/tree-select/index.json create mode 100644 components/dist/tree-select/index.wxml create mode 100644 components/dist/tree-select/index.wxs create mode 100644 components/dist/tree-select/index.wxss create mode 100644 components/dist/uploader/index.d.ts create mode 100644 components/dist/uploader/index.js create mode 100644 components/dist/uploader/index.json create mode 100644 components/dist/uploader/index.wxml create mode 100644 components/dist/uploader/index.wxs create mode 100644 components/dist/uploader/index.wxss create mode 100644 components/dist/uploader/shared.d.ts create mode 100644 components/dist/uploader/shared.js create mode 100644 components/dist/uploader/utils.d.ts create mode 100644 components/dist/uploader/utils.js create mode 100644 components/dist/wxs/add-unit.wxs create mode 100644 components/dist/wxs/array.wxs create mode 100644 components/dist/wxs/bem.wxs create mode 100644 components/dist/wxs/memoize.wxs create mode 100644 components/dist/wxs/object.wxs create mode 100644 components/dist/wxs/style.wxs create mode 100644 components/dist/wxs/utils.wxs create mode 100644 components/eventemitter2/index.js create mode 100644 components/eventemitter2/index.js.map create mode 100644 components/loading/index.js create mode 100644 components/loading/index.json create mode 100644 components/loading/index.wxml create mode 100644 components/loading/index.wxss create mode 100644 components/tree/index.js create mode 100644 components/tree/index.json create mode 100644 components/tree/index.wxml create mode 100644 components/tree/index.wxss create mode 100644 components/tree1/index.js create mode 100644 components/tree1/index.json create mode 100644 components/tree1/index.wxml create mode 100644 components/tree1/index.wxss create mode 100644 config.js create mode 100644 js_sdk/jsencrypt-Rsa/jsencrypt/jsencrypt.min.js create mode 100644 js_sdk/jsencrypt-Rsa/jsencrypt/jsencrypt.vue create mode 100644 miniprogram_npm/charenc/index.js create mode 100644 miniprogram_npm/charenc/index.js.map create mode 100644 miniprogram_npm/crypt/index.js create mode 100644 miniprogram_npm/crypt/index.js.map create mode 100644 miniprogram_npm/crypto-js/index.js create mode 100644 miniprogram_npm/crypto-js/index.js.map create mode 100644 miniprogram_npm/is-buffer/index.js create mode 100644 miniprogram_npm/is-buffer/index.js.map create mode 100644 miniprogram_npm/md5/index.js create mode 100644 miniprogram_npm/md5/index.js.map create mode 100644 miniprogram_npm/pako/index.js create mode 100644 miniprogram_npm/pako/index.js.map create mode 100644 node_modules/charenc/LICENSE.mkd create mode 100644 node_modules/charenc/README.js create mode 100644 node_modules/charenc/charenc.js create mode 100644 node_modules/charenc/package.json create mode 100644 node_modules/crypt/LICENSE.mkd create mode 100644 node_modules/crypt/README.mkd create mode 100644 node_modules/crypt/crypt.js create mode 100644 node_modules/crypt/package.json create mode 100644 node_modules/crypto-js/CONTRIBUTING.md create mode 100644 node_modules/crypto-js/LICENSE create mode 100644 node_modules/crypto-js/README.md create mode 100644 node_modules/crypto-js/aes.js create mode 100644 node_modules/crypto-js/bower.json create mode 100644 node_modules/crypto-js/cipher-core.js create mode 100644 node_modules/crypto-js/core.js create mode 100644 node_modules/crypto-js/crypto-js.js create mode 100644 node_modules/crypto-js/docs/QuickStartGuide.wiki create mode 100644 node_modules/crypto-js/enc-base64.js create mode 100644 node_modules/crypto-js/enc-base64url.js create mode 100644 node_modules/crypto-js/enc-hex.js create mode 100644 node_modules/crypto-js/enc-latin1.js create mode 100644 node_modules/crypto-js/enc-utf16.js create mode 100644 node_modules/crypto-js/enc-utf8.js create mode 100644 node_modules/crypto-js/evpkdf.js create mode 100644 node_modules/crypto-js/format-hex.js create mode 100644 node_modules/crypto-js/format-openssl.js create mode 100644 node_modules/crypto-js/hmac-md5.js create mode 100644 node_modules/crypto-js/hmac-ripemd160.js create mode 100644 node_modules/crypto-js/hmac-sha1.js create mode 100644 node_modules/crypto-js/hmac-sha224.js create mode 100644 node_modules/crypto-js/hmac-sha256.js create mode 100644 node_modules/crypto-js/hmac-sha3.js create mode 100644 node_modules/crypto-js/hmac-sha384.js create mode 100644 node_modules/crypto-js/hmac-sha512.js create mode 100644 node_modules/crypto-js/hmac.js create mode 100644 node_modules/crypto-js/index.js create mode 100644 node_modules/crypto-js/lib-typedarrays.js create mode 100644 node_modules/crypto-js/md5.js create mode 100644 node_modules/crypto-js/mode-cfb.js create mode 100644 node_modules/crypto-js/mode-ctr-gladman.js create mode 100644 node_modules/crypto-js/mode-ctr.js create mode 100644 node_modules/crypto-js/mode-ecb.js create mode 100644 node_modules/crypto-js/mode-ofb.js create mode 100644 node_modules/crypto-js/package.json create mode 100644 node_modules/crypto-js/pad-ansix923.js create mode 100644 node_modules/crypto-js/pad-iso10126.js create mode 100644 node_modules/crypto-js/pad-iso97971.js create mode 100644 node_modules/crypto-js/pad-nopadding.js create mode 100644 node_modules/crypto-js/pad-pkcs7.js create mode 100644 node_modules/crypto-js/pad-zeropadding.js create mode 100644 node_modules/crypto-js/pbkdf2.js create mode 100644 node_modules/crypto-js/rabbit-legacy.js create mode 100644 node_modules/crypto-js/rabbit.js create mode 100644 node_modules/crypto-js/rc4.js create mode 100644 node_modules/crypto-js/ripemd160.js create mode 100644 node_modules/crypto-js/sha1.js create mode 100644 node_modules/crypto-js/sha224.js create mode 100644 node_modules/crypto-js/sha256.js create mode 100644 node_modules/crypto-js/sha3.js create mode 100644 node_modules/crypto-js/sha384.js create mode 100644 node_modules/crypto-js/sha512.js create mode 100644 node_modules/crypto-js/tripledes.js create mode 100644 node_modules/crypto-js/x64-core.js create mode 100644 node_modules/is-buffer/LICENSE create mode 100644 node_modules/is-buffer/README.md create mode 100644 node_modules/is-buffer/index.js create mode 100644 node_modules/is-buffer/package.json create mode 100644 node_modules/is-buffer/test/basic.js create mode 100644 node_modules/md5/.travis.yml create mode 100644 node_modules/md5/LICENSE create mode 100644 node_modules/md5/README.md create mode 100644 node_modules/md5/demo/index.html create mode 100644 node_modules/md5/dist/md5.min.js create mode 100644 node_modules/md5/md5.js create mode 100644 node_modules/md5/package.json create mode 100644 node_modules/md5/test.js create mode 100644 node_modules/md5/webpack.config.js create mode 100644 node_modules/pako/CHANGELOG.md create mode 100644 node_modules/pako/LICENSE create mode 100644 node_modules/pako/README.md create mode 100644 node_modules/pako/dist/pako.es5.js create mode 100644 node_modules/pako/dist/pako.es5.min.js create mode 100644 node_modules/pako/dist/pako.esm.mjs create mode 100644 node_modules/pako/dist/pako.js create mode 100644 node_modules/pako/dist/pako.min.js create mode 100644 node_modules/pako/dist/pako_deflate.es5.js create mode 100644 node_modules/pako/dist/pako_deflate.es5.min.js create mode 100644 node_modules/pako/dist/pako_deflate.js create mode 100644 node_modules/pako/dist/pako_deflate.min.js create mode 100644 node_modules/pako/dist/pako_inflate.es5.js create mode 100644 node_modules/pako/dist/pako_inflate.es5.min.js create mode 100644 node_modules/pako/dist/pako_inflate.js create mode 100644 node_modules/pako/dist/pako_inflate.min.js create mode 100644 node_modules/pako/index.js create mode 100644 node_modules/pako/lib/deflate.js create mode 100644 node_modules/pako/lib/inflate.js create mode 100644 node_modules/pako/lib/utils/common.js create mode 100644 node_modules/pako/lib/utils/strings.js create mode 100644 node_modules/pako/lib/zlib/README create mode 100644 node_modules/pako/lib/zlib/adler32.js create mode 100644 node_modules/pako/lib/zlib/constants.js create mode 100644 node_modules/pako/lib/zlib/crc32.js create mode 100644 node_modules/pako/lib/zlib/deflate.js create mode 100644 node_modules/pako/lib/zlib/gzheader.js create mode 100644 node_modules/pako/lib/zlib/inffast.js create mode 100644 node_modules/pako/lib/zlib/inflate.js create mode 100644 node_modules/pako/lib/zlib/inftrees.js create mode 100644 node_modules/pako/lib/zlib/messages.js create mode 100644 node_modules/pako/lib/zlib/trees.js create mode 100644 node_modules/pako/lib/zlib/zstream.js create mode 100644 node_modules/pako/package.json create mode 100644 node_modules/qrcode-base64/LICENSE create mode 100644 node_modules/qrcode-base64/README.md create mode 100644 node_modules/qrcode-base64/index.js create mode 100644 node_modules/qrcode-base64/package.json create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 pages/Bluetooth/Bluetooth.js create mode 100644 pages/Bluetooth/Bluetooth.json create mode 100644 pages/Bluetooth/Bluetooth.wxml create mode 100644 pages/Bluetooth/Bluetooth.wxss create mode 100644 pages/Bluetooth1/Bluetooth1.js create mode 100644 pages/Bluetooth1/Bluetooth1.json create mode 100644 pages/Bluetooth1/Bluetooth1.wxml create mode 100644 pages/Bluetooth1/Bluetooth1.wxss create mode 100644 pages/addBlueButton/addBlueButton.js create mode 100644 pages/addBlueButton/addBlueButton.json create mode 100644 pages/addBlueButton/addBlueButton.wxml create mode 100644 pages/addBlueButton/addBlueButton.wxss create mode 100644 pages/addperson/addperson.js create mode 100644 pages/addperson/addperson.json create mode 100644 pages/addperson/addperson.wxml create mode 100644 pages/addperson/addperson.wxss create mode 100644 pages/bindLock/bindLock.js create mode 100644 pages/bindLock/bindLock.json create mode 100644 pages/bindLock/bindLock.wxml create mode 100644 pages/bindLock/bindLock.wxss create mode 100644 pages/changeLock/changeLock.js create mode 100644 pages/changeLock/changeLock.json create mode 100644 pages/changeLock/changeLock.wxml create mode 100644 pages/changeLock/changeLock.wxss create mode 100644 pages/config/config.js create mode 100644 pages/config/config.json create mode 100644 pages/config/config.wxml create mode 100644 pages/config/config.wxss create mode 100644 pages/index/index.js create mode 100644 pages/index/index.json create mode 100644 pages/index/index.wxml create mode 100644 pages/index/index.wxss create mode 100644 pages/indexUser/indexUser.js create mode 100644 pages/indexUser/indexUser.json create mode 100644 pages/indexUser/indexUser.wxml create mode 100644 pages/indexUser/indexUser.wxss create mode 100644 pages/login/login.js create mode 100644 pages/login/login.json create mode 100644 pages/login/login.wxml create mode 100644 pages/login/login.wxss create mode 100644 pages/logs/logs.js create mode 100644 pages/logs/logs.json create mode 100644 pages/logs/logs.wxml create mode 100644 pages/logs/logs.wxss create mode 100644 pages/modelselection/modelselection.js create mode 100644 pages/modelselection/modelselection.json create mode 100644 pages/modelselection/modelselection.wxml create mode 100644 pages/modelselection/modelselection.wxss create mode 100644 pages/my/my.js create mode 100644 pages/my/my.json create mode 100644 pages/my/my.wxml create mode 100644 pages/my/my.wxss create mode 100644 pages/openLockLog/openLockLog.js create mode 100644 pages/openLockLog/openLockLog.json create mode 100644 pages/openLockLog/openLockLog.wxml create mode 100644 pages/openLockLog/openLockLog.wxss create mode 100644 pages/paymentInterface/paymentInterface.js create mode 100644 pages/paymentInterface/paymentInterface.json create mode 100644 pages/paymentInterface/paymentInterface.wxml create mode 100644 pages/paymentInterface/paymentInterface.wxss create mode 100644 pages/permissions/permissions.js create mode 100644 pages/permissions/permissions.json create mode 100644 pages/permissions/permissions.wxml create mode 100644 pages/permissions/permissions.wxss create mode 100644 pages/personManger/personManger.js create mode 100644 pages/personManger/personManger.json create mode 100644 pages/personManger/personManger.wxml create mode 100644 pages/personManger/personManger.wxss create mode 100644 pages/register/register.js create mode 100644 pages/register/register.json create mode 100644 pages/register/register.wxml create mode 100644 pages/register/register.wxss create mode 100644 pages/rentDetail/rentDetail.js create mode 100644 pages/rentDetail/rentDetail.json create mode 100644 pages/rentDetail/rentDetail.wxml create mode 100644 pages/rentDetail/rentDetail.wxss create mode 100644 pages/rentManagement/rentManagement.js create mode 100644 pages/rentManagement/rentManagement.json create mode 100644 pages/rentManagement/rentManagement.wxml create mode 100644 pages/rentManagement/rentManagement.wxss create mode 100644 pages/roomDetail/roomDetail.js create mode 100644 pages/roomDetail/roomDetail.json create mode 100644 pages/roomDetail/roomDetail.wxml create mode 100644 pages/roomDetail/roomDetail.wxss create mode 100644 pages/selectPersonnel/selectPersonnel.js create mode 100644 pages/selectPersonnel/selectPersonnel.json create mode 100644 pages/selectPersonnel/selectPersonnel.wxml create mode 100644 pages/selectPersonnel/selectPersonnel.wxss create mode 100644 pages/updateWord/updateWord.js create mode 100644 pages/updateWord/updateWord.json create mode 100644 pages/updateWord/updateWord.wxml create mode 100644 pages/updateWord/updateWord.wxss create mode 100644 pages/userbluetoothUnlock/userbluetoothUnlock.js create mode 100644 pages/userbluetoothUnlock/userbluetoothUnlock.json create mode 100644 pages/userbluetoothUnlock/userbluetoothUnlock.wxml create mode 100644 pages/userbluetoothUnlock/userbluetoothUnlock.wxss create mode 100644 pagesA.zip create mode 100644 pagesA/activatePayment/activatePayment.js create mode 100644 pagesA/activatePayment/activatePayment.json create mode 100644 pagesA/activatePayment/activatePayment.wxml create mode 100644 pagesA/activatePayment/activatePayment.wxss create mode 100644 pagesA/faceinfo/faceinfo.js create mode 100644 pagesA/faceinfo/faceinfo.json create mode 100644 pagesA/faceinfo/faceinfo.wxml create mode 100644 pagesA/faceinfo/faceinfo.wxss create mode 100644 pagesA/facepeople/facepeople.js create mode 100644 pagesA/facepeople/facepeople.json create mode 100644 pagesA/facepeople/facepeople.wxml create mode 100644 pagesA/facepeople/facepeople.wxss create mode 100644 pagesA/forgetpasswoed/forgetpasswoed.js create mode 100644 pagesA/forgetpasswoed/forgetpasswoed.json create mode 100644 pagesA/forgetpasswoed/forgetpasswoed.wxml create mode 100644 pagesA/forgetpasswoed/forgetpasswoed.wxss create mode 100644 pagesA/installLock/installLock.js create mode 100644 pagesA/installLock/installLock.json create mode 100644 pagesA/installLock/installLock.wxml create mode 100644 pagesA/installLock/installLock.wxss create mode 100644 pagesA/newconstructionitem/newconstructionitem.js create mode 100644 pagesA/newconstructionitem/newconstructionitem.json create mode 100644 pagesA/newconstructionitem/newconstructionitem.wxml create mode 100644 pagesA/newconstructionitem/newconstructionitem.wxss create mode 100644 pagesA/passwordList/passwordList.js create mode 100644 pagesA/passwordList/passwordList.json create mode 100644 pagesA/passwordList/passwordList.wxml create mode 100644 pagesA/passwordList/passwordList.wxss create mode 100644 pagesA/selectFace/selectFace.js create mode 100644 pagesA/selectFace/selectFace.json create mode 100644 pagesA/selectFace/selectFace.wxml create mode 100644 pagesA/selectFace/selectFace.wxss create mode 100644 pagesA/selectFace1/selectFace.js create mode 100644 pagesA/selectFace1/selectFace.json create mode 100644 pagesA/selectFace1/selectFace.wxml create mode 100644 pagesA/selectFace1/selectFace.wxss create mode 100644 project.config.json create mode 100644 project.private.config.json create mode 100644 sitemap.json create mode 100644 static/config.json create mode 100644 static/css/common.wxss create mode 100644 static/css/iconfont/iconfont.wxss create mode 100644 static/css/iconfont/iconfont2.wxss create mode 100644 static/css/iconfont1/iconfont.wxss create mode 100644 static/home.png create mode 100644 static/home1.png create mode 100644 static/i1.png create mode 100644 static/i2.png create mode 100644 static/i3.png create mode 100644 static/images/bgimg.jpg create mode 100644 static/images/bgimg_1.jpg create mode 100644 static/images/bindlock.png create mode 100644 static/images/head.png create mode 100644 static/images/jihebeijing.png create mode 100644 static/images/loginOut.svg create mode 100644 static/images/logo.jpg create mode 100644 static/images/logo1.jpg create mode 100644 static/images/qrcode.png create mode 100644 static/mix-tree/currentIcon.png create mode 100644 static/mix-tree/defaultIcon.png create mode 100644 static/my.png create mode 100644 static/my1.png create mode 100644 static/tab-home-current.png create mode 100644 static/tab-home.png create mode 100644 static/u1490.svg create mode 100644 utils/ICINPakage/ICINLocker.js create mode 100644 utils/ICINPakage/ICINLocker_backup.js create mode 100644 utils/ICINPakage/base64-js.js create mode 100644 utils/ICINPakage/base64-js/LICENSE create mode 100644 utils/ICINPakage/base64-js/README.md create mode 100644 utils/ICINPakage/base64-js/base64js.min.js create mode 100644 utils/ICINPakage/base64-js/index.d.ts create mode 100644 utils/ICINPakage/base64-js/package.json create mode 100644 utils/ICINPakage/buffer.js create mode 100644 utils/ICINPakage/buffer/AUTHORS.md create mode 100644 utils/ICINPakage/buffer/LICENSE create mode 100644 utils/ICINPakage/buffer/README.md create mode 100644 utils/ICINPakage/buffer/index.d.ts create mode 100644 utils/ICINPakage/buffer/package.json create mode 100644 utils/ICINPakage/crc-index.js create mode 100644 utils/ICINPakage/crc-index.js.map create mode 100644 utils/ICINPakage/ieee754.js create mode 100644 utils/ICINPakage/ieee754/LICENSE create mode 100644 utils/ICINPakage/ieee754/README.md create mode 100644 utils/ICINPakage/ieee754/index.d.ts create mode 100644 utils/ICINPakage/ieee754/package.json create mode 100644 utils/ICINPakage/md5.min.js create mode 100644 utils/ICINPakage/sm4.js create mode 100644 utils/IotTask.js create mode 100644 utils/LWJ.js create mode 100644 utils/base64.js create mode 100644 utils/bleall.js create mode 100644 utils/btls/ble.js create mode 100644 utils/btls/ble1.js create mode 100644 utils/btls/bleHandler.js create mode 100644 utils/btls/bleHandler1.js create mode 100644 utils/btls/error.js create mode 100644 utils/btls/tools.js create mode 100644 utils/equipment.js create mode 100644 utils/formData.js create mode 100644 utils/index.js create mode 100644 utils/jsencrypt.js create mode 100644 utils/md5.js create mode 100644 utils/methods.js create mode 100644 utils/mimeMap.js create mode 100644 utils/moment.js create mode 100644 utils/qrcode-base64/weapp-qrcode.js create mode 100644 utils/request.js create mode 100644 utils/url.js create mode 100644 utils/util.js create mode 100644 utils/util1.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..115cc02 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,31 @@ +/* + * Eslint config file + * Documentation: https://eslint.org/docs/user-guide/configuring/ + * Install the Eslint extension before using this feature. + */ +module.exports = { + env: { + es6: true, + browser: true, + node: true, + }, + ecmaFeatures: { + modules: true, + }, + parserOptions: { + ecmaVersion: 2018, + sourceType: 'module', + }, + globals: { + wx: true, + App: true, + Page: true, + getCurrentPages: true, + getApp: true, + Component: true, + requirePlugin: true, + requireMiniProgram: true, + }, + // extends: 'eslint:recommended', + rules: {}, +} diff --git a/api/all.js b/api/all.js new file mode 100644 index 0000000..e0d38f2 --- /dev/null +++ b/api/all.js @@ -0,0 +1,25 @@ +let api={} +api.openLock = "v1/device/isp/openLock" //远程开锁 +api.oauthKey = "oauth/key" //验证码 +api.login = "oauth/token" //登录 +api.sendCommand = "v1/device/send/command" //通用接口 +api.getuserInfo = "v1/account/user/info" //获取账户信息 +api.getcardlist = "v1/card/get/list" //获取人员(卡)列表 +api.getDeviceOperateUserInfo = "v1/device/isp/operateUserInfo" // 下发凭证用户命令 +api.addCertificates = "v1/device/add/certificate" //添加凭证 +api.getIntegration = "v1/card/get/integration" //获取首页列表 +api.getSiteList = "v1/site/get/list" //获取房间列表信息 +// api.getuserInfo = "v1/account/user/info"//获取用户信息 +api.getDeviceItems = "v1/device/get/items"//获取设备 +api.getTree = "v1/site/get/tree" //获取所有房源 +api.bindDeviceSite = "v1/device/bind/site" // 绑定房间 +api.unbindDeviceSite = "v1/device/unbind/site" // 解除绑定房间 +api.getOpenRecord = "v1/device/get/open/record"//获取开门数据 +api.addOpenRecord = "v1/device/add/openRecord"//添加开门记录 +api.getSiteTenant = "v1/site/get/tenant" //获取已入住人员信息 +api.addCard = "v1/card/add" //创建人员(卡) +api.bindCard = "v1/site/bind/card" //绑定房间 +api.queryList = "v1/card/query/list"//获取卡号(IMEI) +export { + api +} \ No newline at end of file diff --git a/api/index.js b/api/index.js new file mode 100644 index 0000000..e69de29 diff --git a/app.js b/app.js new file mode 100644 index 0000000..704b630 --- /dev/null +++ b/app.js @@ -0,0 +1,166 @@ +// app.js +const app=getApp() +const EventEmitter2 = require("./components/eventemitter2/index.js").EventEmitter2; +const emitter = new EventEmitter2(); +const WXAPI = require('./utils/request') + +const plugin = requirePlugin("myPlugin") + +App({ + onLaunch() { + this.globalData.sysinfo = wx.getSystemInfoSync() + plugin.init('wx20de9fe5943934a1', '458f9df0-3405-66a9-1cdb-49d5f4197e6a') + .then(function(res){ + console.log('res', res) + if(res.code != 200){ + wx.showToast({ + title: res.data.msg, + }) + } + }) + wx.login({ + success (res) { + if (res.code) { + let data={ + code:res.code + } + WXAPI.getOpenId(data).then(res=>{ + console.log(res) + wx.setStorageSync('openid', res.openid) + }) + } else { + console.log('登录失败!' + res.errMsg) + } + } + }) + // 展示本地存储能力 + var logs = wx.getStorageSync('token') || '' + var userRole = wx.getStorageSync('userRole') || '' + var signature= wx.getStorageSync('signature') || '' + // 登录 + if(logs!=''&&userRole==0){ + this.globalData.token=logs.access_token + setTimeout(()=>{ + wx.switchTab({ + url: '/pages/index/index', + }) + },100) + } + if(signature&&userRole==1){ + wx.navigateTo({ + url: '/pages/indexUser/indexUser', + }) + } + }, + getDeviceByDevName(devName) { + return this.globalData.foundBleDevs[devName] + }, + addDeviceWithDevName(devName, dev) { + this.globalData.foundBleDevs[devName] = dev + }, + connectTo: function(options) { + console.debug('connectTo', options) + if (typeof options !== 'object') { + var message = '请求传参应为 object 类型,但实际传了 ' + (typeof options) + ' 类型'; + throw new RequestError('invalid params', message); + } + + var success = options.success || noop; + var fail = options.fail || noop; + var complete = options.complete || noop; + + // 成功回调 + var callSuccess = function() { + success.apply(null, arguments); + complete.apply(null, arguments); + }; + + // 失败回调 + var callFail = function(error) { + fail.call(null, error); + complete.call(null, error); + }; + var that = this + if (options.devName == undefined) { + throw new RequestError('invalid params', 'options.devName'); + } + + var bleDev = that.globalData.foundBleDevs[options.devName] + console.log('bleDev', bleDev) + if(bleDev == undefined){ + throw new RequestError('dev not found', options.devName); + } + + wx.showLoading({ + mask: true, + title: '连接中...', + }) + wx.createBLEConnection({ + deviceId: bleDev.deviceId, + timeout: 8000, + success: function(res) { + console.log('createBLEConnection success', res) + wx.getBLEDeviceServices({ + deviceId: bleDev.deviceId, + success: function(res) { + wx.getBLEDeviceCharacteristics({ + deviceId: bleDev.deviceId, + serviceId: config.uuid.serviceUuid.toUpperCase(), + success: function(res) { + wx.notifyBLECharacteristicValueChange({ + deviceId: bleDev.deviceId, + serviceId: config.uuid.serviceUuid.toUpperCase(), + characteristicId: config.uuid.notifyUuid.toUpperCase(), + state: true, + success: function(res) { + callSuccess() + }, + fail: function(res) { + callFail(res) + } + }) + }, + fail: function(res) { + callFail(res) + } + }) + }, + fail: function(res) { + callFail(res) + } + }) + }, + fail: function(res) { + console.log('createBLEConnection fail', res) + wx.hideLoading() + if (res.errMsg.indexOf('already connect') > 0) { + callSuccess() + } else { + callFail(res) + } + } + }) + }, + globalData: { + userInfo: null, + token:'', + baseurl:'https://schoolsafety.zhiweisz.cn/', + emitter:emitter,//全局订阅函数 + ble: "", //全局蓝牙实例 + blueStatus: false, + userInfo: null, + fingerprintId: -1,//指纹ID + backdata: -1,//返回状态 + openlock:-1,//蓝牙开锁返回状态 + stop29:false, + zgBlueStatus:false, + blueDeviceId:'', + deviceNum:'', + tenantIdEnter:wx.getStorageSync('tenantId') || '100', + sysinfo: null, + foundBleDevs: {}, + isSearch:false, + isConnected:false, + isInitReady:false + } +}) diff --git a/app.json b/app.json new file mode 100644 index 0000000..c3b79dc --- /dev/null +++ b/app.json @@ -0,0 +1,107 @@ +{ + "pages": [ + "pages/login/login", + "pages/index/index", + "pages/my/my", + "pages/logs/logs", + "pages/register/register", + "pages/roomDetail/roomDetail", + "pages/openLockLog/openLockLog", + "pages/permissions/permissions", + "pages/bindLock/bindLock", + "pages/personManger/personManger", + "pages/addperson/addperson", + "pages/updateWord/updateWord", + "pages/modelselection/modelselection", + "pages/Bluetooth1/Bluetooth1", + "pages/changeLock/changeLock", + "pages/Bluetooth/Bluetooth", + "pages/selectPersonnel/selectPersonnel", + "pages/addBlueButton/addBlueButton", + "pages/userbluetoothUnlock/userbluetoothUnlock", + "pages/indexUser/indexUser", + "pages/config/config", + "pages/rentDetail/rentDetail", + "pages/rentManagement/rentManagement", + "pages/paymentInterface/paymentInterface" + ], + "subPackages": [ + { + "root": "pagesA", + "pages": [ + "forgetpasswoed/forgetpasswoed", + "installLock/installLock", + "passwordList/passwordList", + "facepeople/facepeople", + "faceinfo/faceinfo", + "selectFace/selectFace", + "newconstructionitem/newconstructionitem", + "activatePayment/activatePayment" + ] + } + ], + "window": { + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#02BFFF", + "navigationBarTitleText": "智慧公寓管理系统", + "navigationBarTextStyle": "white" + }, + "plugins": { + "myPlugin": { + "version": "1.7.0", + "provider": "wx8c85a8eeaad80bbf" + } + }, + "tabBar": { + "color": "#333", + "selectedColor": "#00C1D1", + "list": [ + { + "pagePath": "pages/index/index", + "iconPath": "./static/home1.png", + "selectedIconPath": "./static/home.png", + "text": "首页" + }, + { + "pagePath": "pages/my/my", + "iconPath": "./static/my1.png", + "selectedIconPath": "./static/my.png", + "text": "我的" + } + ] + }, + "usingComponents": { + "van-button": "./components/dist/button/index", + "van-field": "./components/dist/field/index", + "van-search": "./components/dist/search/index", + "van-card": "./components/dist/card/index", + "van-datetime-picker": "./components/dist/datetime-picker/index", + "van-cell": "./components/dist/cell/index", + "van-cell-group": "./components/dist/cell-group/index", + "van-popup": "./components/dist/popup/index", + "van-radio": "./components/dist/radio/index", + "van-radio-group": "./components/dist/radio-group/index", + "van-dialog": "./components/dist/dialog/index", + "van-sidebar": "./components/dist/sidebar/index", + "van-sidebar-item": "./components/dist/sidebar-item/index", + "van-steps": "./components/dist/steps/index", + "van-action-sheet": "./components/dist/action-sheet/index", + "van-tree-select": "./components/dist/tree-select/index", + "van-tab": "./components/dist/tab/index", + "van-tabs": "./components/dist/tabs/index", + "van-empty": "./components/dist/empty/index", + "van-icon": "./components/dist/icon/index", + "van-image": "./components/dist/image/index" + }, + "onReachBottomDistance": 100, + "permission": { + "scope.userLocation": { + "desc": "你的位置信息将用于获取蓝牙连接" + } + }, + "requiredPrivateInfos":[ + "getLocation" + ], + "lazyCodeLoading": "requiredComponents", + "sitemapLocation": "sitemap.json" +} \ No newline at end of file diff --git a/app.wxss b/app.wxss new file mode 100644 index 0000000..d32b5da --- /dev/null +++ b/app.wxss @@ -0,0 +1,160 @@ +/**app.wxss**/ +/* @import "./static/css/iconfont/iconfont.wxss"; */ +@import "./static/css/iconfont/iconfont.wxss"; +@import "./static//css/common.wxss"; +.container { + height: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: space-between; + padding: 200rpx 0; + box-sizing: border-box; +} +.box-sizing-border{ + box-sizing: border-box; +} +.position-relative{ + position: relative; +} +.position-absolute{ + position: absolute; +} +.position-fixed{ + position: fixed; + top: 0; + left: 0; + width: 100%; + z-index: 99; +} +.position-sticky{ + position: sticky; +} +.d-flex{ + display: flex; + flex-wrap: wrap; +} +.d-line{ + display: inline; +} +.d-inline-block{ + display: inline-block; +} +.align-center{ + align-items: center; +} +.justify-content-between{ + justify-content: space-between; +} +.bg-fff{ + background: #fff; +} +.bg-000{ + background: #000; +} +.pb-2{ + padding-bottom: 8px; +} +.pa-1{ + padding: 4px; +} +.pa-2{ + padding: 8px; +} +.px-2{ + padding-left: 8px; + padding-right: 8px; +} +.py-2{ + padding-top: 8px; + padding-bottom: 8px; +} +.py-3{ + padding-top: 12px; + padding-bottom: 12px; +} + +.ma-2{ + margin: 8px; +} +.ma-4{ + margin: 15px; +} +.mt-43{ + margin-top: 172px; +} +.mb-1{ + margin-bottom: 4px; +} +.mb-4{ + margin-bottom: 16px; +} +.ml-1{ + margin-left: 4px; +} +.ml-2{ + margin-left: 8px; +} + +.border-all{ + border: 1px solid #f2f3f5; +} + +.b-line{ + border-bottom: 2rpx solid #eee; +} +/* 文字不超过一行 */ +.text-ellipsis{ + overflow: hidden; + width: 100%; + text-overflow: ellipsis; + white-space: nowrap; +} +/* 百分比宽度 */ +.w-50{ + width: 50%; +} +.w-80{ + width: 80%; +} +.w-100{ + width: 100%; +} +.height-percentage-100{ + height: 100%; +} +.width-percentage-100{ + width: 100%; +} +/* 字体大小 */ +.font-size-10{ + font-size: 10px; +} +.font-size-12{ + font-size: 24rpx; +} +.font-size-14{ + font-size: 28rpx; +} +.font-size-16{ + font-size: 32rpx; +} +.font-size-28{ + font-size: 28px; +} +/* 字体颜色 */ +.color-red{ + color: red; +} +.color-orange{ + color: #f37b1d; +} +.color-green{ + color: green; +} +.color-fff{ + color: #fff; +} +.color-333{ + color: #333; +} \ No newline at end of file diff --git a/components/Uploader/Uploader.js b/components/Uploader/Uploader.js new file mode 100644 index 0000000..2527301 --- /dev/null +++ b/components/Uploader/Uploader.js @@ -0,0 +1,35 @@ +// components/Uploader.js +Component({ + /** + * 组件的属性列表 + */ + properties: { + fileList: { + type: Array, + value: [] + }, + info: { + type: Object, + value: {url:'',text:''} + } + }, + + /** + * 组件的初始数据 + */ + data: { + + }, + + /** + * 组件的方法列表 + */ + methods: { + afterRead(e){ + this.triggerEvent('afterRead',e) + }, + deleteImg(e){ + this.triggerEvent('deleteImg',e) + } + } +}) diff --git a/components/Uploader/Uploader.json b/components/Uploader/Uploader.json new file mode 100644 index 0000000..c812035 --- /dev/null +++ b/components/Uploader/Uploader.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-uploader": "../dist/uploader/index" + } +} \ No newline at end of file diff --git a/components/Uploader/Uploader.wxml b/components/Uploader/Uploader.wxml new file mode 100644 index 0000000..167db2c --- /dev/null +++ b/components/Uploader/Uploader.wxml @@ -0,0 +1,8 @@ + + + + + + {{info.text}} + + diff --git a/components/Uploader/Uploader.wxss b/components/Uploader/Uploader.wxss new file mode 100644 index 0000000..2f973c3 --- /dev/null +++ b/components/Uploader/Uploader.wxss @@ -0,0 +1,26 @@ +/* components/Uploader.wxss */ +.position-absolute{ + position: absolute; +} +.font-size-14{ + font-size: 14px; +} +.font-size-12{ + font-size: 12px; +} +.font-weight-600{ + font-weight: 600; +} +.idCard van-uploader{ + display: inline-block; + width: 100%; +} +.idCard van-uploader image{ + width: 49vw; +} +.idCard-absolute{ + left: 50%; + top: 50%; + width: 80%; + transform: translateX(-50%) translateY(-50%); +} \ No newline at end of file diff --git a/components/dist/action-sheet/index.d.ts b/components/dist/action-sheet/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/components/dist/action-sheet/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/components/dist/action-sheet/index.js b/components/dist/action-sheet/index.js new file mode 100644 index 0000000..58e866d --- /dev/null +++ b/components/dist/action-sheet/index.js @@ -0,0 +1,70 @@ +import { VantComponent } from '../common/component'; +import { button } from '../mixins/button'; +VantComponent({ + mixins: [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(event) { + const { index } = event.currentTarget.dataset; + const { actions, closeOnClickAction, canIUseGetUserProfile } = this.data; + const item = actions[index]; + if (item) { + this.$emit('select', item); + if (closeOnClickAction) { + this.onClose(); + } + if (item.openType === 'getUserInfo' && canIUseGetUserProfile) { + wx.getUserProfile({ + desc: item.getUserProfileDesc || ' ', + complete: (userProfile) => { + this.$emit('getuserinfo', userProfile); + }, + }); + } + } + }, + onCancel() { + this.$emit('cancel'); + }, + onClose() { + this.$emit('close'); + }, + onClickOverlay() { + this.$emit('click-overlay'); + this.onClose(); + }, + }, +}); diff --git a/components/dist/action-sheet/index.json b/components/dist/action-sheet/index.json new file mode 100644 index 0000000..19bf989 --- /dev/null +++ b/components/dist/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/components/dist/action-sheet/index.wxml b/components/dist/action-sheet/index.wxml new file mode 100644 index 0000000..b04cc3a --- /dev/null +++ b/components/dist/action-sheet/index.wxml @@ -0,0 +1,69 @@ + + + + + {{ title }} + + + + {{ description }} + + + + + + + + + + {{ cancelText }} + + + diff --git a/components/dist/action-sheet/index.wxss b/components/dist/action-sheet/index.wxss new file mode 100644 index 0000000..eedd361 --- /dev/null +++ b/components/dist/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/components/dist/area/index.d.ts b/components/dist/area/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/components/dist/area/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/components/dist/area/index.js b/components/dist/area/index.js new file mode 100644 index 0000000..2a7c79b --- /dev/null +++ b/components/dist/area/index.js @@ -0,0 +1,217 @@ +import { VantComponent } from '../common/component'; +import { pickerProps } from '../picker/shared'; +import { requestAnimationFrame } from '../common/utils'; +const EMPTY_CODE = '000000'; +VantComponent({ + classes: ['active-class', 'toolbar-class', 'column-class'], + props: Object.assign(Object.assign({}, pickerProps), { value: { + type: String, + observer(value) { + this.code = value; + this.setValues(); + }, + }, areaList: { + type: Object, + value: {}, + observer: 'setValues', + }, columnsNum: { + type: null, + value: 3, + }, columnsPlaceholder: { + type: Array, + observer(val) { + this.setData({ + typeToColumnsPlaceholder: { + province: val[0] || '', + city: val[1] || '', + county: val[2] || '', + }, + }); + }, + } }), + data: { + columns: [{ values: [] }, { values: [] }, { values: [] }], + typeToColumnsPlaceholder: {}, + }, + mounted() { + requestAnimationFrame(() => { + this.setValues(); + }); + }, + methods: { + getPicker() { + if (this.picker == null) { + this.picker = this.selectComponent('.van-area__picker'); + } + return this.picker; + }, + onCancel(event) { + this.emit('cancel', event.detail); + }, + onConfirm(event) { + const { index } = event.detail; + let { value } = event.detail; + value = this.parseValues(value); + this.emit('confirm', { value, index }); + }, + emit(type, detail) { + detail.values = detail.value; + delete detail.value; + this.$emit(type, detail); + }, + parseValues(values) { + const { columnsPlaceholder } = this.data; + return values.map((value, index) => { + if (value && + (!value.code || value.name === columnsPlaceholder[index])) { + return Object.assign(Object.assign({}, value), { code: '', name: '' }); + } + return value; + }); + }, + onChange(event) { + var _a; + const { index, picker, value } = event.detail; + this.code = value[index].code; + (_a = this.setValues()) === null || _a === void 0 ? void 0 : _a.then(() => { + this.$emit('change', { + picker, + values: this.parseValues(picker.getValues()), + index, + }); + }); + }, + getConfig(type) { + const { areaList } = this.data; + return (areaList && areaList[`${type}_list`]) || {}; + }, + getList(type, code) { + if (type !== 'province' && !code) { + return []; + } + const { typeToColumnsPlaceholder } = this.data; + const list = this.getConfig(type); + let result = Object.keys(list).map((code) => ({ + code, + name: list[code], + })); + if (code != null) { + // oversea code + if (code[0] === '9' && type === 'city') { + code = '9'; + } + result = result.filter((item) => item.code.indexOf(code) === 0); + } + if (typeToColumnsPlaceholder[type] && result.length) { + // set columns placeholder + const codeFill = type === 'province' + ? '' + : type === 'city' + ? EMPTY_CODE.slice(2, 4) + : EMPTY_CODE.slice(4, 6); + result.unshift({ + code: `${code}${codeFill}`, + name: typeToColumnsPlaceholder[type], + }); + } + return result; + }, + getIndex(type, code) { + let compareNum = type === 'province' ? 2 : type === 'city' ? 4 : 6; + const 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 (let i = 0; i < list.length; i++) { + if (list[i].code.slice(0, compareNum) === code) { + return i; + } + } + return 0; + }, + setValues() { + const picker = this.getPicker(); + if (!picker) { + return; + } + let code = this.code || this.getDefaultCode(); + const provinceList = this.getList('province'); + const cityList = this.getList('city', code.slice(0, 2)); + const stack = []; + const indexes = []; + const { columnsNum } = this.data; + 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; + } + } + 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(() => { }) + .then(() => picker.setIndexes(indexes)) + .catch(() => { }); + }, + getDefaultCode() { + const { columnsPlaceholder } = this.data; + if (columnsPlaceholder.length) { + return EMPTY_CODE; + } + const countyCodes = Object.keys(this.getConfig('county')); + if (countyCodes[0]) { + return countyCodes[0]; + } + const cityCodes = Object.keys(this.getConfig('city')); + if (cityCodes[0]) { + return cityCodes[0]; + } + return ''; + }, + getValues() { + const picker = this.getPicker(); + if (!picker) { + return []; + } + return this.parseValues(picker.getValues().filter((value) => !!value)); + }, + getDetail() { + const values = this.getValues(); + const area = { + code: '', + country: '', + province: '', + city: '', + county: '', + }; + if (!values.length) { + return area; + } + const names = values.map((item) => 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(code) { + this.code = code || ''; + return this.setValues(); + }, + }, +}); diff --git a/components/dist/area/index.json b/components/dist/area/index.json new file mode 100644 index 0000000..a778e91 --- /dev/null +++ b/components/dist/area/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-picker": "../picker/index" + } +} diff --git a/components/dist/area/index.wxml b/components/dist/area/index.wxml new file mode 100644 index 0000000..f7dc51f --- /dev/null +++ b/components/dist/area/index.wxml @@ -0,0 +1,20 @@ + + + diff --git a/components/dist/area/index.wxs b/components/dist/area/index.wxs new file mode 100644 index 0000000..07723c1 --- /dev/null +++ b/components/dist/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/components/dist/area/index.wxss b/components/dist/area/index.wxss new file mode 100644 index 0000000..99694d6 --- /dev/null +++ b/components/dist/area/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss'; \ No newline at end of file diff --git a/components/dist/button/index.d.ts b/components/dist/button/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/components/dist/button/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/components/dist/button/index.js b/components/dist/button/index.js new file mode 100644 index 0000000..0e3c134 --- /dev/null +++ b/components/dist/button/index.js @@ -0,0 +1,64 @@ +import { VantComponent } from '../common/component'; +import { button } from '../mixins/button'; +import { canIUseFormFieldButton } from '../common/version'; +const mixins = [button]; +if (canIUseFormFieldButton()) { + mixins.push('wx://form-field-button'); +} +VantComponent({ + 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(event) { + this.$emit('click', event); + const { canIUseGetUserProfile, openType, getUserProfileDesc, lang, } = this.data; + if (openType === 'getUserInfo' && canIUseGetUserProfile) { + wx.getUserProfile({ + desc: getUserProfileDesc || ' ', + lang: lang || 'en', + complete: (userProfile) => { + this.$emit('getuserinfo', userProfile); + }, + }); + } + }, + }, +}); diff --git a/components/dist/button/index.json b/components/dist/button/index.json new file mode 100644 index 0000000..e00a588 --- /dev/null +++ b/components/dist/button/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": { + "van-icon": "../icon/index", + "van-loading": "../loading/index" + } +} diff --git a/components/dist/button/index.wxml b/components/dist/button/index.wxml new file mode 100644 index 0000000..8034845 --- /dev/null +++ b/components/dist/button/index.wxml @@ -0,0 +1,53 @@ + + + + diff --git a/components/dist/button/index.wxs b/components/dist/button/index.wxs new file mode 100644 index 0000000..8b649fe --- /dev/null +++ b/components/dist/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/components/dist/button/index.wxss b/components/dist/button/index.wxss new file mode 100644 index 0000000..bd8bb5a --- /dev/null +++ b/components/dist/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/components/dist/calendar/calendar.wxml b/components/dist/calendar/calendar.wxml new file mode 100644 index 0000000..808f739 --- /dev/null +++ b/components/dist/calendar/calendar.wxml @@ -0,0 +1,68 @@ + +
+ +
+ + + + + + + + + + + + {{ + computed.getButtonDisabled(type, currentDate) + ? confirmDisabledText + : confirmText + }} + + +
diff --git a/components/dist/calendar/components/header/index.d.ts b/components/dist/calendar/components/header/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/components/dist/calendar/components/header/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/components/dist/calendar/components/header/index.js b/components/dist/calendar/components/header/index.js new file mode 100644 index 0000000..8fb3682 --- /dev/null +++ b/components/dist/calendar/components/header/index.js @@ -0,0 +1,37 @@ +import { VantComponent } from '../../../common/component'; +VantComponent({ + props: { + title: { + type: String, + value: '日期选择', + }, + subtitle: String, + showTitle: Boolean, + showSubtitle: Boolean, + firstDayOfWeek: { + type: Number, + observer: 'initWeekDay', + }, + }, + data: { + weekdays: [], + }, + created() { + this.initWeekDay(); + }, + methods: { + initWeekDay() { + const defaultWeeks = ['日', '一', '二', '三', '四', '五', '六']; + const firstDayOfWeek = this.data.firstDayOfWeek || 0; + this.setData({ + weekdays: [ + ...defaultWeeks.slice(firstDayOfWeek, 7), + ...defaultWeeks.slice(0, firstDayOfWeek), + ], + }); + }, + onClickSubtitle(event) { + this.$emit('click-subtitle', event); + }, + }, +}); diff --git a/components/dist/calendar/components/header/index.json b/components/dist/calendar/components/header/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/components/dist/calendar/components/header/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/components/dist/calendar/components/header/index.wxml b/components/dist/calendar/components/header/index.wxml new file mode 100644 index 0000000..7e56c83 --- /dev/null +++ b/components/dist/calendar/components/header/index.wxml @@ -0,0 +1,16 @@ + + + + {{ title }} + + + + {{ subtitle }} + + + + + {{ item }} + + + diff --git a/components/dist/calendar/components/header/index.wxss b/components/dist/calendar/components/header/index.wxss new file mode 100644 index 0000000..272537e --- /dev/null +++ b/components/dist/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/components/dist/calendar/components/month/index.d.ts b/components/dist/calendar/components/month/index.d.ts new file mode 100644 index 0000000..3ccf85a --- /dev/null +++ b/components/dist/calendar/components/month/index.d.ts @@ -0,0 +1,6 @@ +export interface Day { + date: Date; + type: string; + text: number; + bottomInfo?: string; +} diff --git a/components/dist/calendar/components/month/index.js b/components/dist/calendar/components/month/index.js new file mode 100644 index 0000000..d04c0fe --- /dev/null +++ b/components/dist/calendar/components/month/index.js @@ -0,0 +1,154 @@ +import { VantComponent } from '../../../common/component'; +import { getMonthEndDay, compareDay, getPrevDay, getNextDay, } from '../../utils'; +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(event) { + const { index } = event.currentTarget.dataset; + const item = this.data.days[index]; + if (item.type !== 'disabled') { + this.$emit('click', item); + } + }, + setDays() { + const days = []; + const startDate = new Date(this.data.date); + const year = startDate.getFullYear(); + const month = startDate.getMonth(); + const totalDay = getMonthEndDay(startDate.getFullYear(), startDate.getMonth() + 1); + for (let day = 1; day <= totalDay; day++) { + const date = new Date(year, month, day); + const type = this.getDayType(date); + let config = { + date, + type, + text: day, + bottomInfo: this.getBottomInfo(type), + }; + if (this.data.formatter) { + config = this.data.formatter(config); + } + days.push(config); + } + this.setData({ days }); + }, + getMultipleDayType(day) { + const { currentDate } = this.data; + if (!Array.isArray(currentDate)) { + return ''; + } + const isSelected = (date) => currentDate.some((item) => compareDay(item, date) === 0); + if (isSelected(day)) { + const prevDay = getPrevDay(day); + const nextDay = getNextDay(day); + const prevSelected = isSelected(prevDay); + const nextSelected = isSelected(nextDay); + if (prevSelected && nextSelected) { + return 'multiple-middle'; + } + if (prevSelected) { + return 'end'; + } + return nextSelected ? 'start' : 'multiple-selected'; + } + return ''; + }, + getRangeDayType(day) { + const { currentDate, allowSameDay } = this.data; + if (!Array.isArray(currentDate)) { + return ''; + } + const [startDay, endDay] = currentDate; + if (!startDay) { + return ''; + } + const compareToStart = compareDay(day, startDay); + if (!endDay) { + return compareToStart === 0 ? 'start' : ''; + } + const compareToEnd = 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(day) { + const { type, minDate, maxDate, currentDate } = this.data; + if (compareDay(day, minDate) < 0 || compareDay(day, maxDate) > 0) { + return 'disabled'; + } + if (type === 'single') { + return compareDay(day, currentDate) === 0 ? 'selected' : ''; + } + if (type === 'multiple') { + return this.getMultipleDayType(day); + } + /* istanbul ignore else */ + if (type === 'range') { + return this.getRangeDayType(day); + } + return ''; + }, + getBottomInfo(type) { + if (this.data.type === 'range') { + if (type === 'start') { + return '开始'; + } + if (type === 'end') { + return '结束'; + } + if (type === 'start-end') { + return '开始/结束'; + } + } + }, + }, +}); diff --git a/components/dist/calendar/components/month/index.json b/components/dist/calendar/components/month/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/components/dist/calendar/components/month/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/components/dist/calendar/components/month/index.wxml b/components/dist/calendar/components/month/index.wxml new file mode 100644 index 0000000..4a2c47c --- /dev/null +++ b/components/dist/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/components/dist/calendar/components/month/index.wxs b/components/dist/calendar/components/month/index.wxs new file mode 100644 index 0000000..55e45a5 --- /dev/null +++ b/components/dist/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/components/dist/calendar/components/month/index.wxss b/components/dist/calendar/components/month/index.wxss new file mode 100644 index 0000000..9aee73d --- /dev/null +++ b/components/dist/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/components/dist/calendar/index.d.ts b/components/dist/calendar/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/components/dist/calendar/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/components/dist/calendar/index.js b/components/dist/calendar/index.js new file mode 100644 index 0000000..3b7b454 --- /dev/null +++ b/components/dist/calendar/index.js @@ -0,0 +1,337 @@ +import { VantComponent } from '../common/component'; +import { ROW_HEIGHT, getPrevDay, getNextDay, getToday, compareDay, copyDates, calcDateNum, formatMonthTitle, compareMonth, getMonths, getDayByOffset, } from './utils'; +import Toast from '../toast/toast'; +import { requestAnimationFrame } from '../common/utils'; +const initialMinDate = getToday().getTime(); +const initialMaxDate = (() => { + const now = getToday(); + return new Date(now.getFullYear(), now.getMonth() + 6, now.getDate()).getTime(); +})(); +const getTime = (date) => date instanceof Date ? date.getTime() : date; +VantComponent({ + props: { + title: { + type: String, + value: '日期选择', + }, + color: String, + show: { + type: Boolean, + observer(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, + observer(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: 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, + }, + firstDayOfWeek: { + type: Number, + value: 0, + }, + readonly: Boolean, + }, + data: { + subtitle: '', + currentDate: null, + scrollIntoView: '', + }, + created() { + this.setData({ + currentDate: this.getInitialDate(this.data.defaultDate), + }); + }, + mounted() { + if (this.data.show || !this.data.poppable) { + this.initRect(); + this.scrollIntoView(); + } + }, + methods: { + reset() { + this.setData({ currentDate: this.getInitialDate() }); + this.scrollIntoView(); + }, + initRect() { + if (this.contentObserver != null) { + this.contentObserver.disconnect(); + } + const contentObserver = this.createIntersectionObserver({ + thresholds: [0, 0.1, 0.9, 1], + observeAll: true, + }); + this.contentObserver = contentObserver; + contentObserver.relativeTo('.van-calendar__body'); + contentObserver.observe('.month', (res) => { + if (res.boundingClientRect.top <= res.relativeRect.top) { + // @ts-ignore + this.setData({ subtitle: formatMonthTitle(res.dataset.date) }); + } + }); + }, + limitDateRange(date, minDate = null, maxDate = null) { + minDate = minDate || this.data.minDate; + maxDate = maxDate || this.data.maxDate; + if (compareDay(date, minDate) === -1) { + return minDate; + } + if (compareDay(date, maxDate) === 1) { + return maxDate; + } + return date; + }, + getInitialDate(defaultDate = null) { + const { type, minDate, maxDate } = this.data; + const now = getToday().getTime(); + if (type === 'range') { + if (!Array.isArray(defaultDate)) { + defaultDate = []; + } + const [startDay, endDay] = defaultDate || []; + const start = this.limitDateRange(startDay || now, minDate, getPrevDay(new Date(maxDate)).getTime()); + const end = this.limitDateRange(endDay || now, getNextDay(new Date(minDate)).getTime()); + return [start, end]; + } + if (type === 'multiple') { + if (Array.isArray(defaultDate)) { + return defaultDate.map((date) => this.limitDateRange(date)); + } + return [this.limitDateRange(now)]; + } + if (!defaultDate || Array.isArray(defaultDate)) { + defaultDate = now; + } + return this.limitDateRange(defaultDate); + }, + scrollIntoView() { + requestAnimationFrame(() => { + const { currentDate, type, show, poppable, minDate, maxDate } = this.data; + // @ts-ignore + const targetDate = type === 'single' ? currentDate : currentDate[0]; + const displayed = show || !poppable; + if (!targetDate || !displayed) { + return; + } + const months = getMonths(minDate, maxDate); + months.some((month, index) => { + if (compareMonth(month, targetDate) === 0) { + this.setData({ scrollIntoView: `month${index}` }); + return true; + } + return false; + }); + }); + }, + onOpen() { + this.$emit('open'); + }, + onOpened() { + this.$emit('opened'); + }, + onClose() { + this.$emit('close'); + }, + onClosed() { + this.$emit('closed'); + }, + onClickDay(event) { + if (this.data.readonly) { + return; + } + let { date } = event.detail; + const { type, currentDate, allowSameDay } = this.data; + if (type === 'range') { + // @ts-ignore + const [startDay, endDay] = currentDate; + if (startDay && !endDay) { + const compareToStart = compareDay(date, startDay); + if (compareToStart === 1) { + const { days } = this.selectComponent('.month').data; + days.some((day, index) => { + const isDisabled = day.type === 'disabled' && + getTime(startDay) < getTime(day.date) && + getTime(day.date) < getTime(date); + if (isDisabled) { + ({ date } = days[index - 1]); + } + return isDisabled; + }); + this.select([startDay, date], true); + } + else if (compareToStart === -1) { + this.select([date, null]); + } + else if (allowSameDay) { + this.select([date, date]); + } + } + else { + this.select([date, null]); + } + } + else if (type === 'multiple') { + let selectedIndex; + // @ts-ignore + const selected = currentDate.some((dateItem, index) => { + const equal = compareDay(dateItem, date) === 0; + if (equal) { + selectedIndex = index; + } + return equal; + }); + if (selected) { + // @ts-ignore + const cancelDate = currentDate.splice(selectedIndex, 1); + this.setData({ currentDate }); + this.unselect(cancelDate); + } + else { + // @ts-ignore + this.select([...currentDate, date]); + } + } + else { + this.select(date, true); + } + }, + unselect(dateArray) { + const date = dateArray[0]; + if (date) { + this.$emit('unselect', copyDates(date)); + } + }, + select(date, complete) { + if (complete && this.data.type === 'range') { + const valid = this.checkRange(date); + if (!valid) { + // auto selected to max range if showConfirm + if (this.data.showConfirm) { + this.emit([ + date[0], + getDayByOffset(date[0], this.data.maxRange - 1), + ]); + } + else { + this.emit(date); + } + return; + } + } + this.emit(date); + if (complete && !this.data.showConfirm) { + this.onConfirm(); + } + }, + emit(date) { + this.setData({ + currentDate: Array.isArray(date) ? date.map(getTime) : getTime(date), + }); + this.$emit('select', copyDates(date)); + }, + checkRange(date) { + const { maxRange, rangePrompt, showRangePrompt } = this.data; + if (maxRange && calcDateNum(date) > maxRange) { + if (showRangePrompt) { + Toast({ + context: this, + message: rangePrompt || `选择天数不能超过 ${maxRange} 天`, + }); + } + this.$emit('over-range'); + return false; + } + return true; + }, + onConfirm() { + if (this.data.type === 'range' && + !this.checkRange(this.data.currentDate)) { + return; + } + wx.nextTick(() => { + // @ts-ignore + this.$emit('confirm', copyDates(this.data.currentDate)); + }); + }, + onClickSubtitle(event) { + this.$emit('click-subtitle', event); + }, + }, +}); diff --git a/components/dist/calendar/index.json b/components/dist/calendar/index.json new file mode 100644 index 0000000..397d5ae --- /dev/null +++ b/components/dist/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/components/dist/calendar/index.wxml b/components/dist/calendar/index.wxml new file mode 100644 index 0000000..bc8bcfd --- /dev/null +++ b/components/dist/calendar/index.wxml @@ -0,0 +1,25 @@ + + + + + + + + + + + + diff --git a/components/dist/calendar/index.wxs b/components/dist/calendar/index.wxs new file mode 100644 index 0000000..2c04be1 --- /dev/null +++ b/components/dist/calendar/index.wxs @@ -0,0 +1,37 @@ +/* eslint-disable */ +var utils = require('./utils.wxs'); + +function getMonths(minDate, maxDate) { + var months = []; + var cursor = getDate(minDate); + + cursor.setDate(1); + + do { + months.push(cursor.getTime()); + cursor.setMonth(cursor.getMonth() + 1); + } while (utils.compareMonth(cursor, getDate(maxDate)) !== 1); + + return months; +} + +function getButtonDisabled(type, currentDate) { + if (currentDate == null) { + return true; + } + + if (type === 'range') { + return !currentDate[0] || !currentDate[1]; + } + + if (type === 'multiple') { + return !currentDate.length; + } + + return !currentDate; +} + +module.exports = { + getMonths: getMonths, + getButtonDisabled: getButtonDisabled +}; diff --git a/components/dist/calendar/index.wxss b/components/dist/calendar/index.wxss new file mode 100644 index 0000000..05df518 --- /dev/null +++ b/components/dist/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,80%)}.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/components/dist/calendar/utils.d.ts b/components/dist/calendar/utils.d.ts new file mode 100644 index 0000000..eb710c0 --- /dev/null +++ b/components/dist/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): 1 | -1 | 0; +export declare function compareDay(day1: Date | number, day2: Date | number): 1 | -1 | 0; +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/components/dist/calendar/utils.js b/components/dist/calendar/utils.js new file mode 100644 index 0000000..83d6971 --- /dev/null +++ b/components/dist/calendar/utils.js @@ -0,0 +1,83 @@ +export const ROW_HEIGHT = 64; +export function formatMonthTitle(date) { + if (!(date instanceof Date)) { + date = new Date(date); + } + return `${date.getFullYear()}年${date.getMonth() + 1}月`; +} +export function compareMonth(date1, date2) { + if (!(date1 instanceof Date)) { + date1 = new Date(date1); + } + if (!(date2 instanceof Date)) { + date2 = new Date(date2); + } + const year1 = date1.getFullYear(); + const year2 = date2.getFullYear(); + const month1 = date1.getMonth(); + const month2 = date2.getMonth(); + if (year1 === year2) { + return month1 === month2 ? 0 : month1 > month2 ? 1 : -1; + } + return year1 > year2 ? 1 : -1; +} +export function compareDay(day1, day2) { + if (!(day1 instanceof Date)) { + day1 = new Date(day1); + } + if (!(day2 instanceof Date)) { + day2 = new Date(day2); + } + const compareMonthResult = compareMonth(day1, day2); + if (compareMonthResult === 0) { + const date1 = day1.getDate(); + const date2 = day2.getDate(); + return date1 === date2 ? 0 : date1 > date2 ? 1 : -1; + } + return compareMonthResult; +} +export function getDayByOffset(date, offset) { + date = new Date(date); + date.setDate(date.getDate() + offset); + return date; +} +export function getPrevDay(date) { + return getDayByOffset(date, -1); +} +export function getNextDay(date) { + return getDayByOffset(date, 1); +} +export function getToday() { + const today = new Date(); + today.setHours(0, 0, 0, 0); + return today; +} +export function calcDateNum(date) { + const day1 = new Date(date[0]).getTime(); + const day2 = new Date(date[1]).getTime(); + return (day2 - day1) / (1000 * 60 * 60 * 24) + 1; +} +export function copyDates(dates) { + if (Array.isArray(dates)) { + return dates.map((date) => { + if (date === null) { + return date; + } + return new Date(date); + }); + } + return new Date(dates); +} +export function getMonthEndDay(year, month) { + return 32 - new Date(year, month - 1, 32).getDate(); +} +export function getMonths(minDate, maxDate) { + const months = []; + const cursor = new Date(minDate); + cursor.setDate(1); + do { + months.push(cursor.getTime()); + cursor.setMonth(cursor.getMonth() + 1); + } while (compareMonth(cursor, maxDate) !== 1); + return months; +} diff --git a/components/dist/calendar/utils.wxs b/components/dist/calendar/utils.wxs new file mode 100644 index 0000000..e57f6b3 --- /dev/null +++ b/components/dist/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/components/dist/card/index.d.ts b/components/dist/card/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/components/dist/card/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/components/dist/card/index.js b/components/dist/card/index.js new file mode 100644 index 0000000..5bbd212 --- /dev/null +++ b/components/dist/card/index.js @@ -0,0 +1,49 @@ +import { link } from '../mixins/link'; +import { VantComponent } from '../common/component'; +VantComponent({ + classes: [ + 'num-class', + 'desc-class', + 'thumb-class', + 'title-class', + 'price-class', + 'origin-price-class', + ], + mixins: [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() { + const { price } = this.data; + const priceArr = price.toString().split('.'); + this.setData({ + integerStr: priceArr[0], + decimalStr: priceArr[1] ? `.${priceArr[1]}` : '', + }); + }, + onClickThumb() { + this.jumpLink('thumbLink'); + }, + }, +}); diff --git a/components/dist/card/index.json b/components/dist/card/index.json new file mode 100644 index 0000000..e917407 --- /dev/null +++ b/components/dist/card/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-tag": "../tag/index" + } +} diff --git a/components/dist/card/index.wxml b/components/dist/card/index.wxml new file mode 100644 index 0000000..62173e4 --- /dev/null +++ b/components/dist/card/index.wxml @@ -0,0 +1,56 @@ + + + + + + + + + {{ tag }} + + + + + + + {{ title }} + + + {{ desc }} + + + + + + + + + {{ currency }} + {{ integerStr }} + {{ decimalStr }} + + + {{ currency }} {{ originPrice }} + + x {{ num }} + + + + + + + + + + diff --git a/components/dist/card/index.wxss b/components/dist/card/index.wxss new file mode 100644 index 0000000..0f4d7c5 --- /dev/null +++ b/components/dist/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/components/dist/cell-group/index.d.ts b/components/dist/cell-group/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/components/dist/cell-group/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/components/dist/cell-group/index.js b/components/dist/cell-group/index.js new file mode 100644 index 0000000..170760f --- /dev/null +++ b/components/dist/cell-group/index.js @@ -0,0 +1,11 @@ +import { VantComponent } from '../common/component'; +VantComponent({ + props: { + title: String, + border: { + type: Boolean, + value: true, + }, + inset: Boolean, + }, +}); diff --git a/components/dist/cell-group/index.json b/components/dist/cell-group/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/components/dist/cell-group/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/components/dist/cell-group/index.wxml b/components/dist/cell-group/index.wxml new file mode 100644 index 0000000..311e064 --- /dev/null +++ b/components/dist/cell-group/index.wxml @@ -0,0 +1,11 @@ + + + + {{ title }} + + + + diff --git a/components/dist/cell-group/index.wxss b/components/dist/cell-group/index.wxss new file mode 100644 index 0000000..08b252f --- /dev/null +++ b/components/dist/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/components/dist/cell/index.d.ts b/components/dist/cell/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/components/dist/cell/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/components/dist/cell/index.js b/components/dist/cell/index.js new file mode 100644 index 0000000..35548b9 --- /dev/null +++ b/components/dist/cell/index.js @@ -0,0 +1,38 @@ +import { link } from '../mixins/link'; +import { VantComponent } from '../common/component'; +VantComponent({ + classes: [ + 'title-class', + 'label-class', + 'value-class', + 'right-icon-class', + 'hover-class', + ], + mixins: [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(event) { + this.$emit('click', event.detail); + this.jumpLink(); + }, + }, +}); diff --git a/components/dist/cell/index.json b/components/dist/cell/index.json new file mode 100644 index 0000000..0a336c0 --- /dev/null +++ b/components/dist/cell/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-icon": "../icon/index" + } +} diff --git a/components/dist/cell/index.wxml b/components/dist/cell/index.wxml new file mode 100644 index 0000000..8387c3c --- /dev/null +++ b/components/dist/cell/index.wxml @@ -0,0 +1,47 @@ + + + + + + + + + + {{ title }} + + + + + {{ label }} + + + + + {{ value }} + + + + + + + + diff --git a/components/dist/cell/index.wxs b/components/dist/cell/index.wxs new file mode 100644 index 0000000..e3500c4 --- /dev/null +++ b/components/dist/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/components/dist/cell/index.wxss b/components/dist/cell/index.wxss new file mode 100644 index 0000000..1802f8e --- /dev/null +++ b/components/dist/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/components/dist/checkbox-group/index.d.ts b/components/dist/checkbox-group/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/components/dist/checkbox-group/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/components/dist/checkbox-group/index.js b/components/dist/checkbox-group/index.js new file mode 100644 index 0000000..c47d97d --- /dev/null +++ b/components/dist/checkbox-group/index.js @@ -0,0 +1,36 @@ +import { useChildren } from '../common/relation'; +import { VantComponent } from '../common/component'; +VantComponent({ + field: true, + relation: 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() { + this.children.forEach((child) => this.updateChild(child)); + }, + updateChild(child) { + const { value, disabled, direction } = this.data; + child.setData({ + value: value.indexOf(child.data.name) !== -1, + parentDisabled: disabled, + direction, + }); + }, + }, +}); diff --git a/components/dist/checkbox-group/index.json b/components/dist/checkbox-group/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/components/dist/checkbox-group/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/components/dist/checkbox-group/index.wxml b/components/dist/checkbox-group/index.wxml new file mode 100644 index 0000000..638bf9d --- /dev/null +++ b/components/dist/checkbox-group/index.wxml @@ -0,0 +1,5 @@ + + + + + diff --git a/components/dist/checkbox-group/index.wxss b/components/dist/checkbox-group/index.wxss new file mode 100644 index 0000000..c5666d7 --- /dev/null +++ b/components/dist/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/components/dist/checkbox/index.d.ts b/components/dist/checkbox/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/components/dist/checkbox/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/components/dist/checkbox/index.js b/components/dist/checkbox/index.js new file mode 100644 index 0000000..e3b78ab --- /dev/null +++ b/components/dist/checkbox/index.js @@ -0,0 +1,77 @@ +import { useParent } from '../common/relation'; +import { VantComponent } from '../common/component'; +function emit(target, value) { + target.$emit('input', value); + target.$emit('change', value); +} +VantComponent({ + field: true, + relation: 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(value) { + if (this.parent) { + this.setParentValue(this.parent, value); + } + else { + emit(this, value); + } + }, + toggle() { + const { parentDisabled, disabled, value } = this.data; + if (!disabled && !parentDisabled) { + this.emitChange(!value); + } + }, + onClickLabel() { + const { labelDisabled, parentDisabled, disabled, value } = this.data; + if (!disabled && !labelDisabled && !parentDisabled) { + this.emitChange(!value); + } + }, + setParentValue(parent, value) { + const parentValue = parent.data.value.slice(); + const { name } = this.data; + const { max } = parent.data; + if (value) { + if (max && parentValue.length >= max) { + return; + } + if (parentValue.indexOf(name) === -1) { + parentValue.push(name); + emit(parent, parentValue); + } + } + else { + const index = parentValue.indexOf(name); + if (index !== -1) { + parentValue.splice(index, 1); + emit(parent, parentValue); + } + } + }, + }, +}); diff --git a/components/dist/checkbox/index.json b/components/dist/checkbox/index.json new file mode 100644 index 0000000..0a336c0 --- /dev/null +++ b/components/dist/checkbox/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-icon": "../icon/index" + } +} diff --git a/components/dist/checkbox/index.wxml b/components/dist/checkbox/index.wxml new file mode 100644 index 0000000..39a7bb0 --- /dev/null +++ b/components/dist/checkbox/index.wxml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + diff --git a/components/dist/checkbox/index.wxs b/components/dist/checkbox/index.wxs new file mode 100644 index 0000000..eb9c772 --- /dev/null +++ b/components/dist/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/components/dist/checkbox/index.wxss b/components/dist/checkbox/index.wxss new file mode 100644 index 0000000..da2272a --- /dev/null +++ b/components/dist/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/components/dist/circle/canvas.d.ts b/components/dist/circle/canvas.d.ts new file mode 100644 index 0000000..15268c9 --- /dev/null +++ b/components/dist/circle/canvas.d.ts @@ -0,0 +1,4 @@ +/// +declare type CanvasContext = WechatMiniprogram.CanvasContext; +export declare function adaptor(ctx: CanvasContext & Record): CanvasContext; +export {}; diff --git a/components/dist/circle/canvas.js b/components/dist/circle/canvas.js new file mode 100644 index 0000000..3ade4cd --- /dev/null +++ b/components/dist/circle/canvas.js @@ -0,0 +1,43 @@ +export function adaptor(ctx) { + // @ts-ignore + return Object.assign(ctx, { + setStrokeStyle(val) { + ctx.strokeStyle = val; + }, + setLineWidth(val) { + ctx.lineWidth = val; + }, + setLineCap(val) { + ctx.lineCap = val; + }, + setFillStyle(val) { + ctx.fillStyle = val; + }, + setFontSize(val) { + ctx.font = String(val); + }, + setGlobalAlpha(val) { + ctx.globalAlpha = val; + }, + setLineJoin(val) { + ctx.lineJoin = val; + }, + setTextAlign(val) { + ctx.textAlign = val; + }, + setMiterLimit(val) { + ctx.miterLimit = val; + }, + setShadow(offsetX, offsetY, blur, color) { + ctx.shadowOffsetX = offsetX; + ctx.shadowOffsetY = offsetY; + ctx.shadowBlur = blur; + ctx.shadowColor = color; + }, + setTextBaseline(val) { + ctx.textBaseline = val; + }, + createCircularGradient() { }, + draw() { }, + }); +} diff --git a/components/dist/circle/index.d.ts b/components/dist/circle/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/components/dist/circle/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/components/dist/circle/index.js b/components/dist/circle/index.js new file mode 100644 index 0000000..2a4baf5 --- /dev/null +++ b/components/dist/circle/index.js @@ -0,0 +1,193 @@ +import { BLUE, WHITE } from '../common/color'; +import { VantComponent } from '../common/component'; +import { getSystemInfoSync } from '../common/utils'; +import { isObj } from '../common/validator'; +import { canIUseCanvas2d } from '../common/version'; +import { adaptor } from './canvas'; +function format(rate) { + return Math.min(Math.max(rate, 0), 100); +} +const PERIMETER = 2 * Math.PI; +const BEGIN_ANGLE = -Math.PI / 2; +const STEP = 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() { + this.drawCircle(this.currentValue); + }, + }, + fill: String, + layerColor: { + type: String, + value: WHITE, + }, + color: { + type: null, + value: BLUE, + observer() { + this.setHoverColor().then(() => { + this.drawCircle(this.currentValue); + }); + }, + }, + type: { + type: String, + value: '', + }, + strokeWidth: { + type: Number, + value: 4, + }, + clockwise: { + type: Boolean, + value: true, + }, + }, + data: { + hoverColor: BLUE, + }, + methods: { + getContext() { + const { type, size } = this.data; + if (type === '' || !canIUseCanvas2d()) { + const ctx = wx.createCanvasContext('van-circle', this); + return Promise.resolve(ctx); + } + const dpr = getSystemInfoSync().pixelRatio; + return new Promise((resolve) => { + wx.createSelectorQuery() + .in(this) + .select('#van-circle') + .node() + .exec((res) => { + const canvas = res[0].node; + const ctx = canvas.getContext(type); + if (!this.inited) { + this.inited = true; + canvas.width = size * dpr; + canvas.height = size * dpr; + ctx.scale(dpr, dpr); + } + resolve(adaptor(ctx)); + }); + }); + }, + setHoverColor() { + const { color, size } = this.data; + if (isObj(color)) { + return this.getContext().then((context) => { + const LinearColor = context.createLinearGradient(size, 0, 0, 0); + Object.keys(color) + .sort((a, b) => parseFloat(a) - parseFloat(b)) + .map((key) => LinearColor.addColorStop(parseFloat(key) / 100, color[key])); + this.hoverColor = LinearColor; + }); + } + this.hoverColor = color; + return Promise.resolve(); + }, + presetCanvas(context, strokeStyle, beginAngle, endAngle, fill) { + const { strokeWidth, lineCap, clockwise, size } = this.data; + const position = size / 2; + const 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(context) { + const { layerColor, fill } = this.data; + this.presetCanvas(context, layerColor, 0, PERIMETER, fill); + }, + renderHoverCircle(context, formatValue) { + const { clockwise } = this.data; + // 结束角度 + const progress = PERIMETER * (formatValue / 100); + const endAngle = clockwise + ? BEGIN_ANGLE + progress + : 3 * Math.PI - (BEGIN_ANGLE + progress); + this.presetCanvas(context, this.hoverColor, BEGIN_ANGLE, endAngle); + }, + drawCircle(currentValue) { + const { size } = this.data; + this.getContext().then((context) => { + context.clearRect(0, 0, size, size); + this.renderLayerCircle(context); + const formatValue = format(currentValue); + if (formatValue !== 0) { + this.renderHoverCircle(context, formatValue); + } + context.draw(); + }); + }, + reRender() { + // tofector 动画暂时没有想到好的解决方案 + const { value, speed } = this.data; + if (speed <= 0 || speed > 1000) { + this.drawCircle(value); + return; + } + this.clearMockInterval(); + this.currentValue = this.currentValue || 0; + const run = () => { + this.interval = setTimeout(() => { + 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() { + if (this.interval) { + clearTimeout(this.interval); + this.interval = null; + } + }, + }, + mounted() { + this.currentValue = this.data.value; + this.setHoverColor().then(() => { + this.drawCircle(this.currentValue); + }); + }, + destroyed() { + this.clearMockInterval(); + }, +}); diff --git a/components/dist/circle/index.json b/components/dist/circle/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/components/dist/circle/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/components/dist/circle/index.wxml b/components/dist/circle/index.wxml new file mode 100644 index 0000000..52bc59f --- /dev/null +++ b/components/dist/circle/index.wxml @@ -0,0 +1,9 @@ + + + + + + + + {{ text }} + diff --git a/components/dist/circle/index.wxss b/components/dist/circle/index.wxss new file mode 100644 index 0000000..2200751 --- /dev/null +++ b/components/dist/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/components/dist/col/index.d.ts b/components/dist/col/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/components/dist/col/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/components/dist/col/index.js b/components/dist/col/index.js new file mode 100644 index 0000000..02bb78d --- /dev/null +++ b/components/dist/col/index.js @@ -0,0 +1,9 @@ +import { useParent } from '../common/relation'; +import { VantComponent } from '../common/component'; +VantComponent({ + relation: useParent('row'), + props: { + span: Number, + offset: Number, + }, +}); diff --git a/components/dist/col/index.json b/components/dist/col/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/components/dist/col/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/components/dist/col/index.wxml b/components/dist/col/index.wxml new file mode 100644 index 0000000..975348b --- /dev/null +++ b/components/dist/col/index.wxml @@ -0,0 +1,9 @@ + + + + + + diff --git a/components/dist/col/index.wxs b/components/dist/col/index.wxs new file mode 100644 index 0000000..507c1cb --- /dev/null +++ b/components/dist/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/components/dist/col/index.wxss b/components/dist/col/index.wxss new file mode 100644 index 0000000..2fa265e --- /dev/null +++ b/components/dist/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/components/dist/collapse-item/animate.d.ts b/components/dist/collapse-item/animate.d.ts new file mode 100644 index 0000000..32157b6 --- /dev/null +++ b/components/dist/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/components/dist/collapse-item/animate.js b/components/dist/collapse-item/animate.js new file mode 100644 index 0000000..f966ac5 --- /dev/null +++ b/components/dist/collapse-item/animate.js @@ -0,0 +1,39 @@ +import { getRect } from '../common/utils'; +function useAnimation(context, expanded, mounted, height) { + const 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(), + }); +} +export function setContentAnimate(context, expanded, mounted) { + getRect(context, '.van-collapse-item__content') + .then((rect) => rect.height) + .then((height) => { + useAnimation(context, expanded, mounted, height); + }); +} diff --git a/components/dist/collapse-item/index.d.ts b/components/dist/collapse-item/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/components/dist/collapse-item/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/components/dist/collapse-item/index.js b/components/dist/collapse-item/index.js new file mode 100644 index 0000000..991d7df --- /dev/null +++ b/components/dist/collapse-item/index.js @@ -0,0 +1,59 @@ +import { VantComponent } from '../common/component'; +import { useParent } from '../common/relation'; +import { setContentAnimate } from './animate'; +VantComponent({ + classes: ['title-class', 'content-class'], + relation: useParent('collapse'), + props: { + name: null, + title: null, + value: null, + icon: String, + label: String, + disabled: Boolean, + clickable: Boolean, + border: { + type: Boolean, + value: true, + }, + isLink: { + type: Boolean, + value: true, + }, + }, + data: { + expanded: false, + }, + mounted() { + this.updateExpanded(); + this.mounted = true; + }, + methods: { + updateExpanded() { + if (!this.parent) { + return; + } + const { value, accordion } = this.parent.data; + const { children = [] } = this.parent; + const { name } = this.data; + const index = children.indexOf(this); + const currentName = name == null ? index : name; + const expanded = accordion + ? value === currentName + : (value || []).some((name) => name === currentName); + if (expanded !== this.data.expanded) { + setContentAnimate(this, expanded, this.mounted); + } + this.setData({ index, expanded }); + }, + onClick() { + if (this.data.disabled) { + return; + } + const { name, expanded } = this.data; + const index = this.parent.children.indexOf(this); + const currentName = name == null ? index : name; + this.parent.switch(currentName, !expanded); + }, + }, +}); diff --git a/components/dist/collapse-item/index.json b/components/dist/collapse-item/index.json new file mode 100644 index 0000000..0e5425c --- /dev/null +++ b/components/dist/collapse-item/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-cell": "../cell/index" + } +} diff --git a/components/dist/collapse-item/index.wxml b/components/dist/collapse-item/index.wxml new file mode 100644 index 0000000..ae4cc83 --- /dev/null +++ b/components/dist/collapse-item/index.wxml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + diff --git a/components/dist/collapse-item/index.wxss b/components/dist/collapse-item/index.wxss new file mode 100644 index 0000000..4a65b5a --- /dev/null +++ b/components/dist/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/components/dist/collapse/index.d.ts b/components/dist/collapse/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/components/dist/collapse/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/components/dist/collapse/index.js b/components/dist/collapse/index.js new file mode 100644 index 0000000..3616087 --- /dev/null +++ b/components/dist/collapse/index.js @@ -0,0 +1,46 @@ +import { VantComponent } from '../common/component'; +import { useChildren } from '../common/relation'; +VantComponent({ + relation: useChildren('collapse-item'), + props: { + value: { + type: null, + observer: 'updateExpanded', + }, + accordion: { + type: Boolean, + observer: 'updateExpanded', + }, + border: { + type: Boolean, + value: true, + }, + }, + methods: { + updateExpanded() { + this.children.forEach((child) => { + child.updateExpanded(); + }); + }, + switch(name, expanded) { + const { accordion, value } = this.data; + const changeItem = name; + if (!accordion) { + name = expanded + ? (value || []).concat(name) + : (value || []).filter((activeName) => 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/components/dist/collapse/index.json b/components/dist/collapse/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/components/dist/collapse/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/components/dist/collapse/index.wxml b/components/dist/collapse/index.wxml new file mode 100644 index 0000000..fd4e171 --- /dev/null +++ b/components/dist/collapse/index.wxml @@ -0,0 +1,3 @@ + + + diff --git a/components/dist/collapse/index.wxss b/components/dist/collapse/index.wxss new file mode 100644 index 0000000..99694d6 --- /dev/null +++ b/components/dist/collapse/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss'; \ No newline at end of file diff --git a/components/dist/common/color.d.ts b/components/dist/common/color.d.ts new file mode 100644 index 0000000..386f307 --- /dev/null +++ b/components/dist/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/components/dist/common/color.js b/components/dist/common/color.js new file mode 100644 index 0000000..6b285bd --- /dev/null +++ b/components/dist/common/color.js @@ -0,0 +1,7 @@ +export const RED = '#ee0a24'; +export const BLUE = '#1989fa'; +export const WHITE = '#fff'; +export const GREEN = '#07c160'; +export const ORANGE = '#ff976a'; +export const GRAY = '#323233'; +export const GRAY_DARK = '#969799'; diff --git a/components/dist/common/component.d.ts b/components/dist/common/component.d.ts new file mode 100644 index 0000000..acdd7f0 --- /dev/null +++ b/components/dist/common/component.d.ts @@ -0,0 +1,4 @@ +/// +import { VantComponentOptions } from '../definitions/index'; +declare function VantComponent(vantOptions: VantComponentOptions): void; +export { VantComponent }; diff --git a/components/dist/common/component.js b/components/dist/common/component.js new file mode 100644 index 0000000..8528dc0 --- /dev/null +++ b/components/dist/common/component.js @@ -0,0 +1,45 @@ +import { basic } from '../mixins/basic'; +function mapKeys(source, target, map) { + Object.keys(map).forEach((key) => { + if (source[key]) { + target[map[key]] = source[key]; + } + }); +} +function VantComponent(vantOptions) { + const options = {}; + mapKeys(vantOptions, options, { + data: 'data', + props: 'properties', + mixins: 'behaviors', + methods: 'methods', + beforeCreate: 'created', + created: 'attached', + mounted: 'ready', + destroyed: 'detached', + classes: 'externalClasses', + }); + // add default externalClasses + options.externalClasses = options.externalClasses || []; + options.externalClasses.push('custom-class'); + // add default behaviors + options.behaviors = options.behaviors || []; + options.behaviors.push(basic); + // add relations + const { relation } = vantOptions; + 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); +} +export { VantComponent }; diff --git a/components/dist/common/index.wxss b/components/dist/common/index.wxss new file mode 100644 index 0000000..a73bb7a --- /dev/null +++ b/components/dist/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/components/dist/common/relation.d.ts b/components/dist/common/relation.d.ts new file mode 100644 index 0000000..4b5af00 --- /dev/null +++ b/components/dist/common/relation.d.ts @@ -0,0 +1,15 @@ +/// +declare 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/components/dist/common/relation.js b/components/dist/common/relation.js new file mode 100644 index 0000000..04e2934 --- /dev/null +++ b/components/dist/common/relation.js @@ -0,0 +1,56 @@ +export function useParent(name, onEffect) { + const path = `../${name}/index`; + return { + relations: { + [path]: { + type: 'ancestor', + linked() { + onEffect && onEffect.call(this); + }, + linkChanged() { + onEffect && onEffect.call(this); + }, + unlinked() { + onEffect && onEffect.call(this); + }, + }, + }, + mixin: Behavior({ + created() { + Object.defineProperty(this, 'parent', { + get: () => this.getRelationNodes(path)[0], + }); + Object.defineProperty(this, 'index', { + // @ts-ignore + get: () => { 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); }, + }); + }, + }), + }; +} +export function useChildren(name, onEffect) { + const path = `../${name}/index`; + return { + relations: { + [path]: { + type: 'descendant', + linked(target) { + onEffect && onEffect.call(this, target); + }, + linkChanged(target) { + onEffect && onEffect.call(this, target); + }, + unlinked(target) { + onEffect && onEffect.call(this, target); + }, + }, + }, + mixin: Behavior({ + created() { + Object.defineProperty(this, 'children', { + get: () => this.getRelationNodes(path) || [], + }); + }, + }), + }; +} diff --git a/components/dist/common/style/clearfix.wxss b/components/dist/common/style/clearfix.wxss new file mode 100644 index 0000000..442246f --- /dev/null +++ b/components/dist/common/style/clearfix.wxss @@ -0,0 +1 @@ +.van-clearfix:after{clear:both;content:"";display:table} \ No newline at end of file diff --git a/components/dist/common/style/ellipsis.wxss b/components/dist/common/style/ellipsis.wxss new file mode 100644 index 0000000..ee701df --- /dev/null +++ b/components/dist/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/components/dist/common/style/hairline.wxss b/components/dist/common/style/hairline.wxss new file mode 100644 index 0000000..f7c6260 --- /dev/null +++ b/components/dist/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/components/dist/common/style/mixins/clearfix.wxss b/components/dist/common/style/mixins/clearfix.wxss new file mode 100644 index 0000000..e69de29 diff --git a/components/dist/common/style/mixins/ellipsis.wxss b/components/dist/common/style/mixins/ellipsis.wxss new file mode 100644 index 0000000..e69de29 diff --git a/components/dist/common/style/mixins/hairline.wxss b/components/dist/common/style/mixins/hairline.wxss new file mode 100644 index 0000000..e69de29 diff --git a/components/dist/common/style/var.wxss b/components/dist/common/style/var.wxss new file mode 100644 index 0000000..e69de29 diff --git a/components/dist/common/utils.d.ts b/components/dist/common/utils.d.ts new file mode 100644 index 0000000..5332a68 --- /dev/null +++ b/components/dist/common/utils.d.ts @@ -0,0 +1,13 @@ +/// +export { isDef } from './validator'; +export declare function range(num: number, min: number, max: number): number; +export declare function nextTick(cb: (...args: any[]) => void): void; +export declare function getSystemInfoSync(): WechatMiniprogram.SystemInfo; +export declare function addUnit(value?: string | number): string | undefined; +export declare function requestAnimationFrame(cb: () => void): number | WechatMiniprogram.NodesRef; +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 getCurrentPage(): T & WechatMiniprogram.OptionalInterface & WechatMiniprogram.Page.InstanceProperties & WechatMiniprogram.Page.InstanceMethods & WechatMiniprogram.Page.Data & WechatMiniprogram.IAnyObject; diff --git a/components/dist/common/utils.js b/components/dist/common/utils.js new file mode 100644 index 0000000..d06acb1 --- /dev/null +++ b/components/dist/common/utils.js @@ -0,0 +1,92 @@ +import { isDef, isNumber, isPlainObject, isPromise } from './validator'; +import { canIUseGroupSetData, canIUseNextTick } from './version'; +export { isDef } from './validator'; +export function range(num, min, max) { + return Math.min(Math.max(num, min), max); +} +export function nextTick(cb) { + if (canIUseNextTick()) { + wx.nextTick(cb); + } + else { + setTimeout(() => { + cb(); + }, 1000 / 30); + } +} +let systemInfo; +export function getSystemInfoSync() { + if (systemInfo == null) { + systemInfo = wx.getSystemInfoSync(); + } + return systemInfo; +} +export function addUnit(value) { + if (!isDef(value)) { + return undefined; + } + value = String(value); + return isNumber(value) ? `${value}px` : value; +} +export function requestAnimationFrame(cb) { + const systemInfo = getSystemInfoSync(); + if (systemInfo.platform === 'devtools') { + return setTimeout(() => { + cb(); + }, 1000 / 30); + } + return wx + .createSelectorQuery() + .selectViewport() + .boundingClientRect() + .exec(() => { + cb(); + }); +} +export function pickExclude(obj, keys) { + if (!isPlainObject(obj)) { + return {}; + } + return Object.keys(obj).reduce((prev, key) => { + if (!keys.includes(key)) { + prev[key] = obj[key]; + } + return prev; + }, {}); +} +export function getRect(context, selector) { + return new Promise((resolve) => { + wx.createSelectorQuery() + .in(context) + .select(selector) + .boundingClientRect() + .exec((rect = []) => resolve(rect[0])); + }); +} +export function getAllRect(context, selector) { + return new Promise((resolve) => { + wx.createSelectorQuery() + .in(context) + .selectAll(selector) + .boundingClientRect() + .exec((rect = []) => resolve(rect[0])); + }); +} +export function groupSetData(context, cb) { + if (canIUseGroupSetData()) { + context.groupSetData(cb); + } + else { + cb(); + } +} +export function toPromise(promiseLike) { + if (isPromise(promiseLike)) { + return promiseLike; + } + return Promise.resolve(promiseLike); +} +export function getCurrentPage() { + const pages = getCurrentPages(); + return pages[pages.length - 1]; +} diff --git a/components/dist/common/validator.d.ts b/components/dist/common/validator.d.ts new file mode 100644 index 0000000..152894a --- /dev/null +++ b/components/dist/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/components/dist/common/validator.js b/components/dist/common/validator.js new file mode 100644 index 0000000..f11f844 --- /dev/null +++ b/components/dist/common/validator.js @@ -0,0 +1,31 @@ +// eslint-disable-next-line @typescript-eslint/ban-types +export function isFunction(val) { + return typeof val === 'function'; +} +export function isPlainObject(val) { + return val !== null && typeof val === 'object' && !Array.isArray(val); +} +export function isPromise(val) { + return isPlainObject(val) && isFunction(val.then) && isFunction(val.catch); +} +export function isDef(value) { + return value !== undefined && value !== null; +} +export function isObj(x) { + const type = typeof x; + return x !== null && (type === 'object' || type === 'function'); +} +export function isNumber(value) { + return /^\d+(\.\d+)?$/.test(value); +} +export function isBoolean(value) { + return typeof value === 'boolean'; +} +const IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i; +const VIDEO_REGEXP = /\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv)/i; +export function isImageUrl(url) { + return IMAGE_REGEXP.test(url); +} +export function isVideoUrl(url) { + return VIDEO_REGEXP.test(url); +} diff --git a/components/dist/common/version.d.ts b/components/dist/common/version.d.ts new file mode 100644 index 0000000..988b226 --- /dev/null +++ b/components/dist/common/version.d.ts @@ -0,0 +1,7 @@ +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; diff --git a/components/dist/common/version.js b/components/dist/common/version.js new file mode 100644 index 0000000..eb85185 --- /dev/null +++ b/components/dist/common/version.js @@ -0,0 +1,48 @@ +import { getSystemInfoSync } from './utils'; +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], 10); + const num2 = parseInt(v2[i], 10); + if (num1 > num2) { + return 1; + } + if (num1 < num2) { + return -1; + } + } + return 0; +} +function gte(version) { + const system = getSystemInfoSync(); + return compareVersion(system.SDKVersion, version) >= 0; +} +export function canIUseModel() { + return gte('2.9.3'); +} +export function canIUseFormFieldButton() { + return gte('2.10.3'); +} +export function canIUseAnimate() { + return gte('2.9.0'); +} +export function canIUseGroupSetData() { + return gte('2.4.0'); +} +export function canIUseNextTick() { + return wx.canIUse('nextTick'); +} +export function canIUseCanvas2d() { + return gte('2.9.0'); +} +export function canIUseGetUserProfile() { + return !!wx.getUserProfile; +} diff --git a/components/dist/config-provider/index.d.ts b/components/dist/config-provider/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/components/dist/config-provider/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/components/dist/config-provider/index.js b/components/dist/config-provider/index.js new file mode 100644 index 0000000..0cb23f4 --- /dev/null +++ b/components/dist/config-provider/index.js @@ -0,0 +1,9 @@ +import { VantComponent } from '../common/component'; +VantComponent({ + props: { + themeVars: { + type: Object, + value: {}, + }, + }, +}); diff --git a/components/dist/config-provider/index.json b/components/dist/config-provider/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/components/dist/config-provider/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/components/dist/config-provider/index.wxml b/components/dist/config-provider/index.wxml new file mode 100644 index 0000000..3cfb461 --- /dev/null +++ b/components/dist/config-provider/index.wxml @@ -0,0 +1,5 @@ + + + + + diff --git a/components/dist/config-provider/index.wxs b/components/dist/config-provider/index.wxs new file mode 100644 index 0000000..7ca0203 --- /dev/null +++ b/components/dist/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/components/dist/count-down/index.d.ts b/components/dist/count-down/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/components/dist/count-down/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/components/dist/count-down/index.js b/components/dist/count-down/index.js new file mode 100644 index 0000000..da24145 --- /dev/null +++ b/components/dist/count-down/index.js @@ -0,0 +1,100 @@ +import { VantComponent } from '../common/component'; +import { isSameSecond, parseFormat, parseTimeData } from './utils'; +function simpleTick(fn) { + return setTimeout(fn, 30); +} +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: parseTimeData(0), + formattedTime: '0', + }, + destroyed() { + clearTimeout(this.tid); + this.tid = null; + }, + methods: { + // 开始 + start() { + if (this.counting) { + return; + } + this.counting = true; + this.endTime = Date.now() + this.remain; + this.tick(); + }, + // 暂停 + pause() { + this.counting = false; + clearTimeout(this.tid); + }, + // 重置 + reset() { + this.pause(); + this.remain = this.data.time; + this.setRemain(this.remain); + if (this.data.autoStart) { + this.start(); + } + }, + tick() { + if (this.data.millisecond) { + this.microTick(); + } + else { + this.macroTick(); + } + }, + microTick() { + this.tid = simpleTick(() => { + this.setRemain(this.getRemain()); + if (this.remain !== 0) { + this.microTick(); + } + }); + }, + macroTick() { + this.tid = simpleTick(() => { + const remain = this.getRemain(); + if (!isSameSecond(remain, this.remain) || remain === 0) { + this.setRemain(remain); + } + if (this.remain !== 0) { + this.macroTick(); + } + }); + }, + getRemain() { + return Math.max(this.endTime - Date.now(), 0); + }, + setRemain(remain) { + this.remain = remain; + const timeData = parseTimeData(remain); + if (this.data.useSlot) { + this.$emit('change', timeData); + } + this.setData({ + formattedTime: parseFormat(this.data.format, timeData), + }); + if (remain === 0) { + this.pause(); + this.$emit('finish'); + } + }, + }, +}); diff --git a/components/dist/count-down/index.json b/components/dist/count-down/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/components/dist/count-down/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/components/dist/count-down/index.wxml b/components/dist/count-down/index.wxml new file mode 100644 index 0000000..e206e16 --- /dev/null +++ b/components/dist/count-down/index.wxml @@ -0,0 +1,4 @@ + + + {{ formattedTime }} + diff --git a/components/dist/count-down/index.wxss b/components/dist/count-down/index.wxss new file mode 100644 index 0000000..8b957f7 --- /dev/null +++ b/components/dist/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/components/dist/count-down/utils.d.ts b/components/dist/count-down/utils.d.ts new file mode 100644 index 0000000..e4a58dd --- /dev/null +++ b/components/dist/count-down/utils.d.ts @@ -0,0 +1,10 @@ +export declare 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/components/dist/count-down/utils.js b/components/dist/count-down/utils.js new file mode 100644 index 0000000..cbdbd79 --- /dev/null +++ b/components/dist/count-down/utils.js @@ -0,0 +1,57 @@ +function padZero(num, targetLength = 2) { + let str = num + ''; + while (str.length < targetLength) { + str = '0' + str; + } + return str; +} +const SECOND = 1000; +const MINUTE = 60 * SECOND; +const HOUR = 60 * MINUTE; +const DAY = 24 * HOUR; +export function parseTimeData(time) { + const days = Math.floor(time / DAY); + const hours = Math.floor((time % DAY) / HOUR); + const minutes = Math.floor((time % HOUR) / MINUTE); + const seconds = Math.floor((time % MINUTE) / SECOND); + const milliseconds = Math.floor(time % SECOND); + return { + days, + hours, + minutes, + seconds, + milliseconds, + }; +} +export function parseFormat(format, timeData) { + const { days } = timeData; + let { hours, minutes, seconds, milliseconds } = timeData; + 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)); +} +export function isSameSecond(time1, time2) { + return Math.floor(time1 / 1000) === Math.floor(time2 / 1000); +} diff --git a/components/dist/datetime-picker/index.d.ts b/components/dist/datetime-picker/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/components/dist/datetime-picker/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/components/dist/datetime-picker/index.js b/components/dist/datetime-picker/index.js new file mode 100644 index 0000000..3334170 --- /dev/null +++ b/components/dist/datetime-picker/index.js @@ -0,0 +1,295 @@ +import { VantComponent } from '../common/component'; +import { isDef } from '../common/validator'; +import { pickerProps } from '../picker/shared'; +const currentYear = new Date().getFullYear(); +function isValidDate(date) { + return isDef(date) && !isNaN(new Date(date).getTime()); +} +function range(num, min, max) { + return Math.min(Math.max(num, min), max); +} +function padZero(val) { + return `00${val}`.slice(-2); +} +function times(n, iteratee) { + let index = -1; + const 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(); +} +const defaultFormatter = (type, value) => value; +VantComponent({ + classes: ['active-class', 'toolbar-class', 'column-class'], + props: Object.assign(Object.assign({}, 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() { + const { data } = this; + const val = this.correctValue(data.value); + const isEqual = val === data.innerValue; + this.updateColumnValue(val).then(() => { + if (!isEqual) { + this.$emit('input', val); + } + }); + }, + getPicker() { + if (this.picker == null) { + this.picker = this.selectComponent('.van-datetime-picker'); + const { picker } = this; + const { setColumnValues } = picker; + picker.setColumnValues = (...args) => setColumnValues.apply(picker, [...args, false]); + } + return this.picker; + }, + updateColumns() { + const { formatter = defaultFormatter } = this.data; + const results = this.getOriginColumns().map((column) => ({ + values: column.values.map((value) => formatter(column.type, value)), + })); + return this.set({ columns: results }); + }, + getOriginColumns() { + const { filter } = this.data; + const results = this.getRanges().map(({ type, range }) => { + let values = times(range[1] - range[0] + 1, (index) => { + const value = range[0] + index; + return type === 'year' ? `${value}` : padZero(value); + }); + if (filter) { + values = filter(type, values); + } + return { type, values }; + }); + return results; + }, + getRanges() { + const { data } = this; + if (data.type === 'time') { + return [ + { + type: 'hour', + range: [data.minHour, data.maxHour], + }, + { + type: 'minute', + range: [data.minMinute, data.maxMinute], + }, + ]; + } + const { maxYear, maxDate, maxMonth, maxHour, maxMinute, } = this.getBoundary('max', data.innerValue); + const { minYear, minDate, minMonth, minHour, minMinute, } = this.getBoundary('min', data.innerValue); + const 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(value) { + const { data } = this; + // validate value + const isDateType = data.type !== 'time'; + if (isDateType && !isValidDate(value)) { + value = data.minDate; + } + else if (!isDateType && !value) { + const { minHour } = data; + value = `${padZero(minHour)}:00`; + } + // time type + if (!isDateType) { + let [hour, minute] = value.split(':'); + hour = padZero(range(hour, data.minHour, data.maxHour)); + minute = padZero(range(minute, data.minMinute, data.maxMinute)); + return `${hour}:${minute}`; + } + // date type + value = Math.max(value, data.minDate); + value = Math.min(value, data.maxDate); + return value; + }, + getBoundary(type, innerValue) { + const value = new Date(innerValue); + const boundary = new Date(this.data[`${type}Date`]); + const year = boundary.getFullYear(); + let month = 1; + let date = 1; + let hour = 0; + let 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 { + [`${type}Year`]: year, + [`${type}Month`]: month, + [`${type}Date`]: date, + [`${type}Hour`]: hour, + [`${type}Minute`]: minute, + }; + }, + onCancel() { + this.$emit('cancel'); + }, + onConfirm() { + this.$emit('confirm', this.data.innerValue); + }, + onChange() { + const { data } = this; + let value; + const picker = this.getPicker(); + const originColumns = this.getOriginColumns(); + if (data.type === 'time') { + const indexes = picker.getIndexes(); + value = `${+originColumns[0].values[indexes[0]]}:${+originColumns[1] + .values[indexes[1]]}`; + } + else { + const indexes = picker.getIndexes(); + const values = indexes.map((value, index) => originColumns[index].values[value]); + const year = getTrueValue(values[0]); + const month = getTrueValue(values[1]); + const maxDate = getMonthEndDay(year, month); + let date = getTrueValue(values[2]); + if (data.type === 'year-month') { + date = 1; + } + date = date > maxDate ? maxDate : date; + let hour = 0; + let 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(() => { + this.$emit('input', value); + this.$emit('change', picker); + }); + }, + updateColumnValue(value) { + let values = []; + const { type } = this.data; + const formatter = this.data.formatter || defaultFormatter; + const picker = this.getPicker(); + if (type === 'time') { + const pair = value.split(':'); + values = [formatter('hour', pair[0]), formatter('minute', pair[1])]; + } + else { + const date = new Date(value); + values = [ + formatter('year', `${date.getFullYear()}`), + formatter('month', padZero(date.getMonth() + 1)), + ]; + if (type === 'date') { + values.push(formatter('day', padZero(date.getDate()))); + } + if (type === 'datetime') { + values.push(formatter('day', padZero(date.getDate())), formatter('hour', padZero(date.getHours())), formatter('minute', padZero(date.getMinutes()))); + } + } + return this.set({ innerValue: value }) + .then(() => this.updateColumns()) + .then(() => picker.setValues(values)); + }, + }, + created() { + const innerValue = this.correctValue(this.data.value); + this.updateColumnValue(innerValue).then(() => { + this.$emit('input', innerValue); + }); + }, +}); diff --git a/components/dist/datetime-picker/index.json b/components/dist/datetime-picker/index.json new file mode 100644 index 0000000..a778e91 --- /dev/null +++ b/components/dist/datetime-picker/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-picker": "../picker/index" + } +} diff --git a/components/dist/datetime-picker/index.wxml b/components/dist/datetime-picker/index.wxml new file mode 100644 index 0000000..ade2202 --- /dev/null +++ b/components/dist/datetime-picker/index.wxml @@ -0,0 +1,16 @@ + diff --git a/components/dist/datetime-picker/index.wxss b/components/dist/datetime-picker/index.wxss new file mode 100644 index 0000000..99694d6 --- /dev/null +++ b/components/dist/datetime-picker/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss'; \ No newline at end of file diff --git a/components/dist/definitions/index.d.ts b/components/dist/definitions/index.d.ts new file mode 100644 index 0000000..a7cc750 --- /dev/null +++ b/components/dist/definitions/index.d.ts @@ -0,0 +1,27 @@ +/// +interface VantComponentInstance { + parent: WechatMiniprogram.Component.TrivialInstance; + children: WechatMiniprogram.Component.TrivialInstance[]; + index: number; + $emit: (name: string, detail?: unknown, options?: WechatMiniprogram.Component.TriggerEventOption) => void; +} +export declare type VantComponentOptions = { + data?: Data; + field?: boolean; + classes?: string[]; + mixins?: string[]; + props?: Props; + relation?: { + relations: Record; + mixin: string; + }; + methods?: Methods; + beforeCreate?: () => void; + created?: () => void; + mounted?: () => void; + destroyed?: () => void; +} & ThisType, Props, Methods> & Record>; +export {}; diff --git a/components/dist/definitions/index.js b/components/dist/definitions/index.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/components/dist/definitions/index.js @@ -0,0 +1 @@ +export {}; diff --git a/components/dist/dialog/dialog.d.ts b/components/dist/dialog/dialog.d.ts new file mode 100644 index 0000000..c981315 --- /dev/null +++ b/components/dist/dialog/dialog.d.ts @@ -0,0 +1,50 @@ +/// +export declare type Action = 'confirm' | 'cancel' | 'overlay'; +interface DialogOptions { + lang?: string; + show?: boolean; + title?: string; + width?: string | number | null; + zIndex?: number; + theme?: string; + context?: WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance; + message?: string; + overlay?: boolean; + selector?: string; + ariaLabel?: string; + 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/components/dist/dialog/dialog.js b/components/dist/dialog/dialog.js new file mode 100644 index 0000000..0b72fec --- /dev/null +++ b/components/dist/dialog/dialog.js @@ -0,0 +1,75 @@ +let queue = []; +const 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: '', +}; +let currentOptions = Object.assign({}, defaultOptions); +function getContext() { + const pages = getCurrentPages(); + return pages[pages.length - 1]; +} +const Dialog = (options) => { + options = Object.assign(Object.assign({}, currentOptions), options); + return new Promise((resolve, reject) => { + const context = options.context || getContext(); + const dialog = context.selectComponent(options.selector); + delete options.context; + delete options.selector; + if (dialog) { + dialog.setData(Object.assign({ callback: (action, instance) => { + action === 'confirm' ? resolve(instance) : reject(instance); + } }, options)); + wx.nextTick(() => { + dialog.setData({ show: true }); + }); + queue.push(dialog); + } + else { + console.warn('未找到 van-dialog 节点,请确认 selector 及 context 是否正确'); + } + }); +}; +Dialog.alert = (options) => Dialog(options); +Dialog.confirm = (options) => Dialog(Object.assign({ showCancelButton: true }, options)); +Dialog.close = () => { + queue.forEach((dialog) => { + dialog.close(); + }); + queue = []; +}; +Dialog.stopLoading = () => { + queue.forEach((dialog) => { + dialog.stopLoading(); + }); +}; +Dialog.currentOptions = currentOptions; +Dialog.defaultOptions = defaultOptions; +Dialog.setDefaultOptions = (options) => { + currentOptions = Object.assign(Object.assign({}, currentOptions), options); + Dialog.currentOptions = currentOptions; +}; +Dialog.resetDefaultOptions = () => { + currentOptions = Object.assign({}, defaultOptions); + Dialog.currentOptions = currentOptions; +}; +Dialog.resetDefaultOptions(); +export default Dialog; diff --git a/components/dist/dialog/index.d.ts b/components/dist/dialog/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/components/dist/dialog/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/components/dist/dialog/index.js b/components/dist/dialog/index.js new file mode 100644 index 0000000..6f24cf4 --- /dev/null +++ b/components/dist/dialog/index.js @@ -0,0 +1,122 @@ +import { VantComponent } from '../common/component'; +import { button } from '../mixins/button'; +import { GRAY, RED } from '../common/color'; +import { toPromise } from '../common/utils'; +VantComponent({ + mixins: [button], + props: { + show: { + type: Boolean, + observer(show) { + !show && this.stopLoading(); + }, + }, + title: String, + message: String, + theme: { + type: String, + value: 'default', + }, + useSlot: Boolean, + className: String, + customStyle: String, + asyncClose: Boolean, + messageAlign: String, + beforeClose: null, + overlayStyle: String, + useTitleSlot: Boolean, + showCancelButton: Boolean, + closeOnClickOverlay: Boolean, + confirmButtonOpenType: String, + width: null, + zIndex: { + type: Number, + value: 2000, + }, + confirmButtonText: { + type: String, + value: '确认', + }, + cancelButtonText: { + type: String, + value: '取消', + }, + confirmButtonColor: { + type: String, + value: RED, + }, + cancelButtonColor: { + type: String, + value: GRAY, + }, + showConfirmButton: { + type: Boolean, + value: true, + }, + overlay: { + type: Boolean, + value: true, + }, + transition: { + type: String, + value: 'scale', + }, + }, + data: { + loading: { + confirm: false, + cancel: false, + }, + callback: (() => { }), + }, + methods: { + onConfirm() { + this.handleAction('confirm'); + }, + onCancel() { + this.handleAction('cancel'); + }, + onClickOverlay() { + this.close('overlay'); + }, + close(action) { + this.setData({ show: false }); + wx.nextTick(() => { + this.$emit('close', action); + const { callback } = this.data; + if (callback) { + callback(action, this); + } + }); + }, + stopLoading() { + this.setData({ + loading: { + confirm: false, + cancel: false, + }, + }); + }, + handleAction(action) { + this.$emit(action, { dialog: this }); + const { asyncClose, beforeClose } = this.data; + if (!asyncClose && !beforeClose) { + this.close(action); + return; + } + this.setData({ + [`loading.${action}`]: true, + }); + if (beforeClose) { + toPromise(beforeClose(action)).then((value) => { + if (value) { + this.close(action); + } + else { + this.stopLoading(); + } + }); + } + }, + }, +}); diff --git a/components/dist/dialog/index.json b/components/dist/dialog/index.json new file mode 100644 index 0000000..43417fc --- /dev/null +++ b/components/dist/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/components/dist/dialog/index.wxml b/components/dist/dialog/index.wxml new file mode 100644 index 0000000..f49dee4 --- /dev/null +++ b/components/dist/dialog/index.wxml @@ -0,0 +1,113 @@ + + + + + + {{ title }} + + + + + {{ message }} + + + + + {{ cancelButtonText }} + + + {{ confirmButtonText }} + + + + + + {{ cancelButtonText }} + + + {{ confirmButtonText }} + + + diff --git a/components/dist/dialog/index.wxss b/components/dist/dialog/index.wxss new file mode 100644 index 0000000..571861a --- /dev/null +++ b/components/dist/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__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/components/dist/divider/index.d.ts b/components/dist/divider/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/components/dist/divider/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/components/dist/divider/index.js b/components/dist/divider/index.js new file mode 100644 index 0000000..9596edd --- /dev/null +++ b/components/dist/divider/index.js @@ -0,0 +1,12 @@ +import { VantComponent } from '../common/component'; +VantComponent({ + props: { + dashed: Boolean, + hairline: Boolean, + contentPosition: String, + fontSize: String, + borderColor: String, + textColor: String, + customStyle: String, + }, +}); diff --git a/components/dist/divider/index.json b/components/dist/divider/index.json new file mode 100644 index 0000000..a89ef4d --- /dev/null +++ b/components/dist/divider/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} diff --git a/components/dist/divider/index.wxml b/components/dist/divider/index.wxml new file mode 100644 index 0000000..f6a5a45 --- /dev/null +++ b/components/dist/divider/index.wxml @@ -0,0 +1,9 @@ + + + + + + diff --git a/components/dist/divider/index.wxs b/components/dist/divider/index.wxs new file mode 100644 index 0000000..215b14f --- /dev/null +++ b/components/dist/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/components/dist/divider/index.wxss b/components/dist/divider/index.wxss new file mode 100644 index 0000000..e91dc44 --- /dev/null +++ b/components/dist/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/components/dist/dropdown-item/index.d.ts b/components/dist/dropdown-item/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/components/dist/dropdown-item/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/components/dist/dropdown-item/index.js b/components/dist/dropdown-item/index.js new file mode 100644 index 0000000..0b0d00f --- /dev/null +++ b/components/dist/dropdown-item/index.js @@ -0,0 +1,102 @@ +import { useParent } from '../common/relation'; +import { VantComponent } from '../common/component'; +VantComponent({ + field: true, + relation: useParent('dropdown-menu', function () { + this.updateDataFromParent(); + }), + props: { + value: { + type: null, + observer: 'rerender', + }, + title: { + type: String, + observer: 'rerender', + }, + disabled: Boolean, + titleClass: { + type: String, + observer: 'rerender', + }, + options: { + type: Array, + value: [], + observer: 'rerender', + }, + popupStyle: String, + }, + data: { + transition: true, + showPopup: false, + showWrapper: false, + displayTitle: '', + }, + methods: { + rerender() { + wx.nextTick(() => { + var _a; + (_a = this.parent) === null || _a === void 0 ? void 0 : _a.updateItemListData(); + }); + }, + updateDataFromParent() { + if (this.parent) { + const { overlay, duration, activeColor, closeOnClickOverlay, direction, } = this.parent.data; + this.setData({ + overlay, + duration, + activeColor, + closeOnClickOverlay, + direction, + }); + } + }, + onOpen() { + this.$emit('open'); + }, + onOpened() { + this.$emit('opened'); + }, + onClose() { + this.$emit('close'); + }, + onClosed() { + this.$emit('closed'); + this.setData({ showWrapper: false }); + }, + onOptionTap(event) { + const { option } = event.currentTarget.dataset; + const { value } = option; + const shouldEmitChange = this.data.value !== value; + this.setData({ showPopup: false, value }); + this.$emit('close'); + this.rerender(); + if (shouldEmitChange) { + this.$emit('change', value); + } + }, + toggle(show, options = {}) { + var _a; + const { showPopup } = this.data; + if (typeof show !== 'boolean') { + show = !showPopup; + } + if (show === showPopup) { + return; + } + this.setData({ + transition: !options.immediate, + showPopup: show, + }); + if (show) { + (_a = this.parent) === null || _a === void 0 ? void 0 : _a.getChildWrapperStyle().then((wrapperStyle) => { + this.setData({ wrapperStyle, showWrapper: true }); + this.rerender(); + }); + } + else { + this.rerender(); + } + }, + }, +}); diff --git a/components/dist/dropdown-item/index.json b/components/dist/dropdown-item/index.json new file mode 100644 index 0000000..88d5409 --- /dev/null +++ b/components/dist/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/components/dist/dropdown-item/index.wxml b/components/dist/dropdown-item/index.wxml new file mode 100644 index 0000000..dd75292 --- /dev/null +++ b/components/dist/dropdown-item/index.wxml @@ -0,0 +1,48 @@ + + + + + + + {{ item.text }} + + + + + + + diff --git a/components/dist/dropdown-item/index.wxss b/components/dist/dropdown-item/index.wxss new file mode 100644 index 0000000..80505e9 --- /dev/null +++ b/components/dist/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/components/dist/dropdown-item/shared.d.ts b/components/dist/dropdown-item/shared.d.ts new file mode 100644 index 0000000..774eb4c --- /dev/null +++ b/components/dist/dropdown-item/shared.d.ts @@ -0,0 +1,5 @@ +export interface Option { + text: string; + value: string | number; + icon: string; +} diff --git a/components/dist/dropdown-item/shared.js b/components/dist/dropdown-item/shared.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/components/dist/dropdown-item/shared.js @@ -0,0 +1 @@ +export {}; diff --git a/components/dist/dropdown-menu/index.d.ts b/components/dist/dropdown-menu/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/components/dist/dropdown-menu/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/components/dist/dropdown-menu/index.js b/components/dist/dropdown-menu/index.js new file mode 100644 index 0000000..1ed1a87 --- /dev/null +++ b/components/dist/dropdown-menu/index.js @@ -0,0 +1,112 @@ +import { VantComponent } from '../common/component'; +import { useChildren } from '../common/relation'; +import { addUnit, getRect, getSystemInfoSync } from '../common/utils'; +let ARRAY = []; +VantComponent({ + field: true, + relation: useChildren('dropdown-item', function () { + this.updateItemListData(); + }), + props: { + activeColor: { + type: String, + observer: 'updateChildrenData', + }, + overlay: { + type: Boolean, + value: true, + observer: 'updateChildrenData', + }, + zIndex: { + type: Number, + value: 10, + }, + duration: { + type: Number, + value: 200, + observer: 'updateChildrenData', + }, + direction: { + type: String, + value: 'down', + observer: 'updateChildrenData', + }, + closeOnClickOverlay: { + type: Boolean, + value: true, + observer: 'updateChildrenData', + }, + closeOnClickOutside: { + type: Boolean, + value: true, + }, + }, + data: { + itemListData: [], + }, + beforeCreate() { + const { windowHeight } = getSystemInfoSync(); + this.windowHeight = windowHeight; + ARRAY.push(this); + }, + destroyed() { + ARRAY = ARRAY.filter((item) => item !== this); + }, + methods: { + updateItemListData() { + this.setData({ + itemListData: this.children.map((child) => child.data), + }); + }, + updateChildrenData() { + this.children.forEach((child) => { + child.updateDataFromParent(); + }); + }, + toggleItem(active) { + this.children.forEach((item, index) => { + const { showPopup } = item.data; + if (index === active) { + item.toggle(); + } + else if (showPopup) { + item.toggle(false, { immediate: true }); + } + }); + }, + close() { + this.children.forEach((child) => { + child.toggle(false, { immediate: true }); + }); + }, + getChildWrapperStyle() { + const { zIndex, direction } = this.data; + return getRect(this, '.van-dropdown-menu').then((rect) => { + const { top = 0, bottom = 0 } = rect; + const offset = direction === 'down' ? bottom : this.windowHeight - top; + let wrapperStyle = `z-index: ${zIndex};`; + if (direction === 'down') { + wrapperStyle += `top: ${addUnit(offset)};`; + } + else { + wrapperStyle += `bottom: ${addUnit(offset)};`; + } + return wrapperStyle; + }); + }, + onTitleTap(event) { + const { index } = event.currentTarget.dataset; + const child = this.children[index]; + if (!child.data.disabled) { + ARRAY.forEach((menuItem) => { + if (menuItem && + menuItem.data.closeOnClickOutside && + menuItem !== this) { + menuItem.close(); + } + }); + this.toggleItem(index); + } + }, + }, +}); diff --git a/components/dist/dropdown-menu/index.json b/components/dist/dropdown-menu/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/components/dist/dropdown-menu/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/components/dist/dropdown-menu/index.wxml b/components/dist/dropdown-menu/index.wxml new file mode 100644 index 0000000..cfd661d --- /dev/null +++ b/components/dist/dropdown-menu/index.wxml @@ -0,0 +1,23 @@ + + + + + + + + {{ computed.displayTitle(item) }} + + + + + + diff --git a/components/dist/dropdown-menu/index.wxs b/components/dist/dropdown-menu/index.wxs new file mode 100644 index 0000000..6538854 --- /dev/null +++ b/components/dist/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/components/dist/dropdown-menu/index.wxss b/components/dist/dropdown-menu/index.wxss new file mode 100644 index 0000000..daa5748 --- /dev/null +++ b/components/dist/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 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:-4px;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/components/dist/empty/index.d.ts b/components/dist/empty/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/components/dist/empty/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/components/dist/empty/index.js b/components/dist/empty/index.js new file mode 100644 index 0000000..842e1bb --- /dev/null +++ b/components/dist/empty/index.js @@ -0,0 +1,10 @@ +import { VantComponent } from '../common/component'; +VantComponent({ + props: { + description: String, + image: { + type: String, + value: 'default', + }, + }, +}); diff --git a/components/dist/empty/index.json b/components/dist/empty/index.json new file mode 100644 index 0000000..a89ef4d --- /dev/null +++ b/components/dist/empty/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} diff --git a/components/dist/empty/index.wxml b/components/dist/empty/index.wxml new file mode 100644 index 0000000..9c7b719 --- /dev/null +++ b/components/dist/empty/index.wxml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + {{ description }} + + + + + + diff --git a/components/dist/empty/index.wxs b/components/dist/empty/index.wxs new file mode 100644 index 0000000..9696dd4 --- /dev/null +++ b/components/dist/empty/index.wxs @@ -0,0 +1,14 @@ +/* eslint-disable */ +var PRESETS = ['error', 'search', 'default', 'network']; + +function imageUrl(image) { + if (PRESETS.indexOf(image) !== -1) { + return 'https://img.yzcdn.cn/vant/empty-image-' + image + '.png'; + } + + return image; +} + +module.exports = { + imageUrl: imageUrl, +}; diff --git a/components/dist/empty/index.wxss b/components/dist/empty/index.wxss new file mode 100644 index 0000000..0fb74fe --- /dev/null +++ b/components/dist/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/components/dist/field/index.d.ts b/components/dist/field/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/components/dist/field/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/components/dist/field/index.js b/components/dist/field/index.js new file mode 100644 index 0000000..35627a2 --- /dev/null +++ b/components/dist/field/index.js @@ -0,0 +1,107 @@ +import { nextTick } from '../common/utils'; +import { VantComponent } from '../common/component'; +import { commonProps, inputProps, textareaProps } from './props'; +VantComponent({ + field: true, + classes: ['input-class', 'right-icon-class', 'label-class'], + props: Object.assign(Object.assign(Object.assign(Object.assign({}, commonProps), inputProps), 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', + } }), + data: { + focused: false, + innerValue: '', + showClear: false, + }, + created() { + this.value = this.data.value; + this.setData({ innerValue: this.value }); + }, + methods: { + onInput(event) { + const { value = '' } = event.detail || {}; + this.value = value; + this.setShowClear(); + this.emitChange(); + }, + onFocus(event) { + this.focused = true; + this.setShowClear(); + this.$emit('focus', event.detail); + }, + onBlur(event) { + this.focused = false; + this.setShowClear(); + this.$emit('blur', event.detail); + }, + onClickIcon() { + this.$emit('click-icon'); + }, + onClickInput(event) { + this.$emit('click-input', event.detail); + }, + onClear() { + this.setData({ innerValue: '' }); + this.value = ''; + this.setShowClear(); + nextTick(() => { + this.emitChange(); + this.$emit('clear', ''); + }); + }, + onConfirm(event) { + const { value = '' } = event.detail || {}; + this.value = value; + this.setShowClear(); + this.$emit('confirm', value); + }, + setValue(value) { + this.value = value; + this.setShowClear(); + if (value === '') { + this.setData({ innerValue: '' }); + } + this.emitChange(); + }, + onLineChange(event) { + this.$emit('linechange', event.detail); + }, + onKeyboardHeightChange(event) { + this.$emit('keyboardheightchange', event.detail); + }, + emitChange() { + this.setData({ value: this.value }); + nextTick(() => { + this.$emit('input', this.value); + this.$emit('change', this.value); + }); + }, + setShowClear() { + const { clearable, readonly, clearTrigger } = this.data; + const { focused, value } = this; + let showClear = false; + if (clearable && !readonly) { + const hasValue = !!value; + const trigger = clearTrigger === 'always' || (clearTrigger === 'focus' && focused); + showClear = hasValue && trigger; + } + this.setData({ showClear }); + }, + noop() { }, + }, +}); diff --git a/components/dist/field/index.json b/components/dist/field/index.json new file mode 100644 index 0000000..5906c50 --- /dev/null +++ b/components/dist/field/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": { + "van-cell": "../cell/index", + "van-icon": "../icon/index" + } +} diff --git a/components/dist/field/index.wxml b/components/dist/field/index.wxml new file mode 100644 index 0000000..ec2e0ea --- /dev/null +++ b/components/dist/field/index.wxml @@ -0,0 +1,56 @@ + + + + + + + {{ label }} + + + + + + + + + + + + + + + + + + + + + {{ value.length >= maxlength ? maxlength : value.length }}/{{ maxlength }} + + + {{ errorMessage }} + + diff --git a/components/dist/field/index.wxs b/components/dist/field/index.wxs new file mode 100644 index 0000000..78575b9 --- /dev/null +++ b/components/dist/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/components/dist/field/index.wxss b/components/dist/field/index.wxss new file mode 100644 index 0000000..7571fe6 --- /dev/null +++ b/components/dist/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);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/components/dist/field/input.wxml b/components/dist/field/input.wxml new file mode 100644 index 0000000..efe9a08 --- /dev/null +++ b/components/dist/field/input.wxml @@ -0,0 +1,28 @@ + diff --git a/components/dist/field/props.d.ts b/components/dist/field/props.d.ts new file mode 100644 index 0000000..5cd130a --- /dev/null +++ b/components/dist/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/components/dist/field/props.js b/components/dist/field/props.js new file mode 100644 index 0000000..ae405b3 --- /dev/null +++ b/components/dist/field/props.js @@ -0,0 +1,64 @@ +export const commonProps = { + value: { + type: String, + observer(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, +}; +export const inputProps = { + type: { + type: String, + value: 'text', + }, + password: Boolean, + confirmType: String, + confirmHold: Boolean, + alwaysEmbed: Boolean, +}; +export const textareaProps = { + autoHeight: Boolean, + fixed: Boolean, + showConfirmBar: { + type: Boolean, + value: true, + }, + disableDefaultPadding: { + type: Boolean, + value: true, + }, +}; diff --git a/components/dist/field/textarea.wxml b/components/dist/field/textarea.wxml new file mode 100644 index 0000000..5015a51 --- /dev/null +++ b/components/dist/field/textarea.wxml @@ -0,0 +1,29 @@ +